diff --git a/eslint-suppressions.json b/eslint-suppressions.json index ad1c7d4fd8..9b14c988ad 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -1,561 +1,4 @@ { - "packages/agent-runtime/src/core/__tests__/runtime.test.ts": { - "require-yield": { - "count": 1 - } - }, - "packages/agent-runtime/src/types/event.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - }, - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/agent-runtime/src/types/state.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - }, - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/builtin-tool-group-agent-builder/src/manifest.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 2 - } - }, - "packages/builtin-tool-group-management/src/manifest.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/builtin-tool-group-management/src/types.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/builtin-tool-gtd/src/client/components/SortableTodoList/store/actions.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/builtin-tool-gtd/src/manifest.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/builtin-tool-page-agent/src/manifest.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/builtin-tool-page-agent/src/types.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 2 - } - }, - "packages/business/config/src/server/edge-config.ts": { - "@typescript-eslint/ban-types": { - "count": 1 - } - }, - "packages/business/const/src/bedrock-model-mapping.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/const/src/plugin.ts": { - "regexp/match-any": { - "count": 5 - } - }, - "packages/context-engine/src/engine/messages/MessagesEngine.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/context-engine/src/engine/messages/types.ts": { - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/context-engine/src/engine/tools/ToolNameResolver.ts": { - "prefer-const": { - "count": 2 - } - }, - "packages/context-engine/src/processors/InputTemplate.ts": { - "regexp/strict": { - "count": 4 - } - }, - "packages/context-engine/src/processors/PlaceholderVariables.ts": { - "regexp/strict": { - "count": 8 - } - }, - "packages/database/src/models/__tests__/userMemories.test.ts": { - "unicorn/no-new-array": { - "count": 1 - } - }, - "packages/database/src/models/message.ts": { - "@eslint-community/eslint-comments/no-duplicate-disable": { - "count": 1 - }, - "sort-keys-fix/sort-keys-fix": { - "count": 2 - } - }, - "packages/database/src/repositories/dataImporter/deprecated/__tests__/index.test.ts": { - "@typescript-eslint/no-non-null-asserted-optional-chain": { - "count": 2 - } - }, - "packages/database/src/schemas/agent.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/agentCronJob.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/aiInfra.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/apiKey.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/asyncTask.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/chatGroup.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/file.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/generation.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/message.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/oidc.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/rag.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/ragEvals.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/rbac.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/relations.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/session.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/topic.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/user.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/userMemories/index.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/database/src/schemas/userMemories/persona.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/edge-config/src/types.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - }, - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/editor-runtime/src/EditorRuntime.ts": { - "regexp/no-super-linear-backtracking": { - "count": 2 - } - }, - "packages/electron-client-ipc/src/types/localSystem.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - }, - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/electron-server-ipc/src/ipcClient.test.ts": { - "@typescript-eslint/no-unsafe-function-type": { - "count": 62 - } - }, - "packages/electron-server-ipc/src/ipcClient.ts": { - "@typescript-eslint/ban-types": { - "count": 1 - }, - "@typescript-eslint/no-unsafe-function-type": { - "count": 2 - }, - "prefer-const": { - "count": 1 - } - }, - "packages/electron-server-ipc/src/ipcServer.test.ts": { - "@typescript-eslint/no-unsafe-function-type": { - "count": 1 - } - }, - "packages/file-loaders/src/utils/parser-utils.test.ts": { - "@typescript-eslint/no-unsafe-function-type": { - "count": 14 - } - }, - "packages/model-bank/src/aiModels/google.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 2 - } - }, - "packages/model-bank/src/aiModels/vertexai.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/model-bank/src/standard-parameters/index.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - }, - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/model-runtime/src/core/BaseAI.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - }, - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/model-runtime/src/core/openaiCompatibleFactory/index.test.ts": { - "regexp/strict": { - "count": 4 - } - }, - "packages/model-runtime/src/core/streams/cloudflare.ts": { - "prefer-const": { - "count": 4 - }, - "regexp/strict": { - "count": 1 - } - }, - "packages/model-runtime/src/core/streams/google/google-ai.test.ts": { - "no-useless-escape": { - "count": 31 - } - }, - "packages/model-runtime/src/core/streams/openai/openai.ts": { - "regexp/strict": { - "count": 1 - }, - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/model-runtime/src/core/streams/openai/responsesStream.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/model-runtime/src/core/streams/spark.test.ts": { - "no-useless-escape": { - "count": 24 - } - }, - "packages/model-runtime/src/core/usageConverters/utils/computeChatCost.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/model-runtime/src/helpers/mergeChatMethodOptions.ts": { - "unicorn/no-immediate-mutation": { - "count": 1 - } - }, - "packages/model-runtime/src/providers/github/index.ts": { - "@eslint-community/eslint-comments/no-unused-enable": { - "count": 1 - }, - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/model-runtime/src/providers/google/index.test.ts": { - "require-yield": { - "count": 1 - }, - "unicorn/no-immediate-mutation": { - "count": 3 - } - }, - "packages/model-runtime/src/providers/google/thinkingResolver.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/model-runtime/src/providers/replicate/index.ts": { - "regexp/no-unused-capturing-group": { - "count": 1 - } - }, - "packages/model-runtime/src/providers/sensenova/index.ts": { - "regexp/no-unused-capturing-group": { - "count": 1 - } - }, - "packages/model-runtime/src/providers/togetherai/type.ts": { - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/model-runtime/src/types/error.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/model-runtime/src/types/image.ts": { - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/model-runtime/src/utils/desensitizeUrl.ts": { - "regexp/no-super-linear-backtracking": { - "count": 1 - } - }, - "packages/model-runtime/src/utils/sanitizeError.ts": { - "no-prototype-builtins": { - "count": 1 - } - }, - "packages/observability-otel/src/node.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - }, - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/prompts/src/prompts/files/index.test.ts": { - "regexp/no-super-linear-backtracking": { - "count": 3 - } - }, - "packages/types/src/agent/chatConfig.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - }, - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/types/src/agentCronJob/index.ts": { - "regexp/no-misleading-capturing-group": { - "count": 2 - }, - "regexp/no-super-linear-backtracking": { - "count": 9 - } - }, - "packages/types/src/agentRuntime.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/types/src/asyncTask.ts": { - "typescript-sort-keys/string-enum": { - "count": 1 - } - }, - "packages/types/src/auth.ts": { - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/types/src/conversation.ts": { - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/types/src/fetch.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/types/src/message/common/messageGroup.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - }, - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/types/src/message/common/metadata.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - }, - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/types/src/message/common/pageSelection.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - }, - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/types/src/message/db/item.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - }, - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/types/src/message/db/params.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - } - }, - "packages/types/src/message/ui/params.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - }, - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/types/src/plugins/mcp.ts": { - "typescript-sort-keys/string-enum": { - "count": 1 - } - }, - "packages/types/src/tool/plugin.ts": { - "sort-keys-fix/sort-keys-fix": { - "count": 1 - }, - "typescript-sort-keys/interface": { - "count": 1 - } - }, - "packages/types/src/topic/topic.ts": { - "typescript-sort-keys/string-enum": { - "count": 1 - } - }, - "packages/utils/src/client/fetchEventSource/parse.ts": { - "@eslint-community/eslint-comments/no-unlimited-disable": { - "count": 1 - } - }, - "packages/utils/src/promptTemplate.ts": { - "regexp/match-any": { - "count": 1 - }, - "regexp/strict": { - "count": 4 - } - }, - "packages/web-crawler/src/crawImpl/__tests__/browserless.test.ts": { - "prefer-regex-literals": { - "count": 2 - } - }, - "scripts/cdnWorkflow/index.ts": { - "prefer-const": { - "count": 1 - } - }, - "scripts/docsWorkflow/autoCDN.ts": { - "prefer-const": { - "count": 1 - } - }, - "scripts/readmeWorkflow/syncAgentIndex.ts": { - "unicorn/no-anonymous-default-export": { - "count": 1 - } - }, - "scripts/readmeWorkflow/syncPluginIndex.ts": { - "unicorn/no-anonymous-default-export": { - "count": 1 - } - }, - "scripts/readmeWorkflow/syncProviderIndex.ts": { - "unicorn/no-anonymous-default-export": { - "count": 1 - } - }, - "scripts/serverLauncher/startServer.js": { - "@typescript-eslint/no-require-imports": { - "count": 6 - }, - "regexp/no-unused-capturing-group": { - "count": 33 - } - }, - "scripts/vercelIgnoredBuildStep.js": { - "@typescript-eslint/no-require-imports": { - "count": 1 - } - }, "src/app/[variants]/(desktop)/desktop-onboarding/features/WelcomeStep.tsx": { "@eslint-react/no-nested-component-definitions": { "count": 1 @@ -617,11 +60,6 @@ "count": 1 } }, - "src/components/HtmlPreview/PreviewDrawer.tsx": { - "regexp/match-any": { - "count": 1 - } - }, "src/components/Loading/CircleLoading/index.tsx": { "unicorn/no-anonymous-default-export": { "count": 1 @@ -689,11 +127,6 @@ "count": 1 } }, - "src/features/Conversation/components/ShareMessageModal/ShareText/template.ts": { - "regexp/strict": { - "count": 2 - } - }, "src/features/Conversation/types/hooks.ts": { "typescript-sort-keys/interface": { "count": 1 @@ -749,20 +182,7 @@ "count": 1 } }, - "src/features/ShareModal/ShareText/template.ts": { - "regexp/strict": { - "count": 2 - } - }, - "src/helpers/GlobalAgentContextManager.ts": { - "regexp/strict": { - "count": 4 - } - }, "src/helpers/parserPlaceholder/index.ts": { - "regexp/strict": { - "count": 4 - }, "sort-keys-fix/sort-keys-fix": { "count": 1 } @@ -856,11 +276,6 @@ "count": 1 } }, - "src/server/services/changelog/index.ts": { - "regexp/strict": { - "count": 2 - } - }, "src/server/services/comfyui/config/fluxModelRegistry.ts": { "sort-keys-fix/sort-keys-fix": { "count": 2 @@ -954,11 +369,6 @@ "count": 2 } }, - "src/server/services/document/index.ts": { - "regexp/match-any": { - "count": 1 - } - }, "src/server/services/webhookUser/index.test.ts": { "unicorn/no-thenable": { "count": 7 @@ -1133,9 +543,6 @@ } }, "src/store/chat/slices/portal/selectors.ts": { - "regexp/match-any": { - "count": 1 - }, "sort-keys-fix/sort-keys-fix": { "count": 1 }, @@ -1321,4 +728,4 @@ "count": 1 } } -} \ No newline at end of file +} diff --git a/eslint.config.mjs b/eslint.config.mjs index 42732f474b..66dfb055e9 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -48,6 +48,8 @@ export default eslint( '@typescript-eslint/no-useless-constructor': 0, 'no-extra-boolean-cast': 0, 'react/no-unknown-property': 0, + 'regexp/match-any': 0, + 'unicorn/better-regex': 0, }, }, // MDX files diff --git a/src/app/(backend)/_deprecated/createBizOpenAI/createAzureOpenai.ts b/src/app/(backend)/_deprecated/createBizOpenAI/createAzureOpenai.ts index 031807f019..4af1c5d82b 100644 --- a/src/app/(backend)/_deprecated/createBizOpenAI/createAzureOpenai.ts +++ b/src/app/(backend)/_deprecated/createBizOpenAI/createAzureOpenai.ts @@ -1,5 +1,5 @@ import { ChatErrorType } from '@lobechat/types'; -import type {ClientOptions} from 'openai'; +import { type ClientOptions } from 'openai'; import OpenAI from 'openai'; import urlJoin from 'url-join'; diff --git a/src/app/(backend)/api/agent/route.ts b/src/app/(backend)/api/agent/route.ts index d3c53789b7..b3e98e03ca 100644 --- a/src/app/(backend)/api/agent/route.ts +++ b/src/app/(backend)/api/agent/route.ts @@ -1,6 +1,6 @@ import debug from 'debug'; -import type {NextRequest} from 'next/server'; -import { NextResponse } from 'next/server'; +import { type NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; import { getServerDB } from '@/database/core/db-adaptor'; import { AiAgentService } from '@/server/services/aiAgent'; diff --git a/src/app/(backend)/api/agent/run/route.ts b/src/app/(backend)/api/agent/run/route.ts index 68da619010..8c4dc5bbc3 100644 --- a/src/app/(backend)/api/agent/run/route.ts +++ b/src/app/(backend)/api/agent/run/route.ts @@ -1,6 +1,6 @@ import debug from 'debug'; -import type {NextRequest} from 'next/server'; -import { NextResponse } from 'next/server'; +import { type NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; import { getServerDB } from '@/database/core/db-adaptor'; import { AgentRuntimeCoordinator } from '@/server/modules/AgentRuntime'; diff --git a/src/app/(backend)/api/agent/stream/route.ts b/src/app/(backend)/api/agent/stream/route.ts index 800348a22c..19669c80b2 100644 --- a/src/app/(backend)/api/agent/stream/route.ts +++ b/src/app/(backend)/api/agent/stream/route.ts @@ -1,7 +1,7 @@ import { createSSEHeaders, createSSEWriter } from '@lobechat/utils/server'; import debug from 'debug'; -import type {NextRequest} from 'next/server'; -import { NextResponse } from 'next/server'; +import { type NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; import { StreamEventManager } from '@/server/modules/AgentRuntime'; diff --git a/src/app/(backend)/api/auth/[...all]/route.ts b/src/app/(backend)/api/auth/[...all]/route.ts index 62788509d7..fbe9d4f6c5 100644 --- a/src/app/(backend)/api/auth/[...all]/route.ts +++ b/src/app/(backend)/api/auth/[...all]/route.ts @@ -1,5 +1,5 @@ import { toNextJsHandler } from 'better-auth/next-js'; -import type { NextRequest } from 'next/server'; +import { type NextRequest } from 'next/server'; import { auth } from '@/auth'; diff --git a/src/app/(backend)/api/auth/check-user/route.ts b/src/app/(backend)/api/auth/check-user/route.ts index 4aefff76b0..c640f6d823 100644 --- a/src/app/(backend)/api/auth/check-user/route.ts +++ b/src/app/(backend)/api/auth/check-user/route.ts @@ -1,6 +1,6 @@ import { and, eq } from 'drizzle-orm'; -import type {NextRequest} from 'next/server'; -import { NextResponse } from 'next/server'; +import { type NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; import { account } from '@/database/schemas/betterAuth'; import { users } from '@/database/schemas/user'; diff --git a/src/app/(backend)/api/auth/resolve-username/route.ts b/src/app/(backend)/api/auth/resolve-username/route.ts index 950bc662a7..44ba2799df 100644 --- a/src/app/(backend)/api/auth/resolve-username/route.ts +++ b/src/app/(backend)/api/auth/resolve-username/route.ts @@ -1,6 +1,6 @@ import { eq } from 'drizzle-orm'; -import type {NextRequest} from 'next/server'; -import { NextResponse } from 'next/server'; +import { type NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; import { users } from '@/database/schemas/user'; import { serverDB } from '@/database/server'; diff --git a/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topic/workflows/topic.ts b/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topic/workflows/topic.ts index a0466c1a4b..799675310d 100644 --- a/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topic/workflows/topic.ts +++ b/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topic/workflows/topic.ts @@ -6,17 +6,17 @@ import { import { LayersEnum, MemorySourceType } from '@lobechat/types'; import { errorMessageFrom } from '@lobechat/utils'; import { Client } from '@upstash/qstash'; -import type { WorkflowContext} from '@upstash/workflow'; +import { type WorkflowContext } from '@upstash/workflow'; import { WorkflowAbort, WorkflowNonRetryableError } from '@upstash/workflow'; import { createWorkflow } from '@upstash/workflow/nextjs'; import { AsyncTaskModel } from '@/database/models/asyncTask'; import { getServerDB } from '@/database/server'; import { parseMemoryExtractionConfig } from '@/server/globalConfig/parseMemoryExtractionConfig'; -import type {MemoryExtractionPayloadInput} from '@/server/services/memory/userMemory/extract'; +import { type MemoryExtractionPayloadInput } from '@/server/services/memory/userMemory/extract'; import { MemoryExtractionExecutor, - normalizeMemoryExtractionPayload + normalizeMemoryExtractionPayload, } from '@/server/services/memory/userMemory/extract'; const { upstashWorkflowExtraHeaders } = parseMemoryExtractionConfig(); diff --git a/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topics/route.ts b/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topics/route.ts index 78f8a2804a..a5d542e338 100644 --- a/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topics/route.ts +++ b/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topics/route.ts @@ -9,10 +9,10 @@ import { WorkflowAbort } from '@upstash/workflow'; import { serve } from '@upstash/workflow/nextjs'; import { parseMemoryExtractionConfig } from '@/server/globalConfig/parseMemoryExtractionConfig'; -import type {MemoryExtractionPayloadInput} from '@/server/services/memory/userMemory/extract'; +import { type MemoryExtractionPayloadInput } from '@/server/services/memory/userMemory/extract'; import { MemoryExtractionWorkflowService, - normalizeMemoryExtractionPayload + normalizeMemoryExtractionPayload, } from '@/server/services/memory/userMemory/extract'; import { processTopicWorkflow } from '../process-topic/workflows/topic'; diff --git a/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-user-topics/route.ts b/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-user-topics/route.ts index c5bae689e8..7a25b8a03b 100644 --- a/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-user-topics/route.ts +++ b/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-user-topics/route.ts @@ -2,14 +2,14 @@ import { MemorySourceType } from '@lobechat/types'; import { Client } from '@upstash/qstash'; import { serve } from '@upstash/workflow/nextjs'; -import type { ListTopicsForMemoryExtractorCursor } from '@/database/models/topic'; +import { type ListTopicsForMemoryExtractorCursor } from '@/database/models/topic'; import { parseMemoryExtractionConfig } from '@/server/globalConfig/parseMemoryExtractionConfig'; -import type {MemoryExtractionPayloadInput} from '@/server/services/memory/userMemory/extract'; +import { type MemoryExtractionPayloadInput } from '@/server/services/memory/userMemory/extract'; import { buildWorkflowPayloadInput, MemoryExtractionExecutor, MemoryExtractionWorkflowService, - normalizeMemoryExtractionPayload + normalizeMemoryExtractionPayload, } from '@/server/services/memory/userMemory/extract'; import { forEachBatchSequential } from '@/server/services/memory/userMemory/topicBatching'; diff --git a/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-users/route.ts b/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-users/route.ts index 6d1ea21f04..d8199fe763 100644 --- a/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-users/route.ts +++ b/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-users/route.ts @@ -3,12 +3,12 @@ import { serve } from '@upstash/workflow/nextjs'; import { chunk } from 'es-toolkit/compat'; import { parseMemoryExtractionConfig } from '@/server/globalConfig/parseMemoryExtractionConfig'; -import type {MemoryExtractionPayloadInput} from '@/server/services/memory/userMemory/extract'; +import { type MemoryExtractionPayloadInput } from '@/server/services/memory/userMemory/extract'; import { buildWorkflowPayloadInput, MemoryExtractionExecutor, MemoryExtractionWorkflowService, - normalizeMemoryExtractionPayload + normalizeMemoryExtractionPayload, } from '@/server/services/memory/userMemory/extract'; const USER_PAGE_SIZE = 50; diff --git a/src/app/(backend)/market/agent/[[...segments]]/route.ts b/src/app/(backend)/market/agent/[[...segments]]/route.ts index 56f6ada48e..b9c943f784 100644 --- a/src/app/(backend)/market/agent/[[...segments]]/route.ts +++ b/src/app/(backend)/market/agent/[[...segments]]/route.ts @@ -1,5 +1,5 @@ -import type {NextRequest} from 'next/server'; -import { NextResponse } from 'next/server'; +import { type NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; import { MarketService } from '@/server/services/market'; diff --git a/src/app/(backend)/market/oidc/[[...segments]]/route.ts b/src/app/(backend)/market/oidc/[[...segments]]/route.ts index b0ca5eccd7..0e285c3dc4 100644 --- a/src/app/(backend)/market/oidc/[[...segments]]/route.ts +++ b/src/app/(backend)/market/oidc/[[...segments]]/route.ts @@ -1,5 +1,5 @@ -import type {NextRequest} from 'next/server'; -import { NextResponse } from 'next/server'; +import { type NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; import { getTrustedClientTokenForSession } from '@/libs/trusted-client'; import { MarketService } from '@/server/services/market'; diff --git a/src/app/(backend)/market/social/[[...segments]]/route.ts b/src/app/(backend)/market/social/[[...segments]]/route.ts index 119bcaae69..efe18cdd06 100644 --- a/src/app/(backend)/market/social/[[...segments]]/route.ts +++ b/src/app/(backend)/market/social/[[...segments]]/route.ts @@ -1,5 +1,5 @@ -import type {NextRequest} from 'next/server'; -import { NextResponse } from 'next/server'; +import { type NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; import { MarketService } from '@/server/services/market'; diff --git a/src/app/(backend)/market/user/[username]/route.ts b/src/app/(backend)/market/user/[username]/route.ts index 69ff6bbf2d..03e5d5a407 100644 --- a/src/app/(backend)/market/user/[username]/route.ts +++ b/src/app/(backend)/market/user/[username]/route.ts @@ -1,5 +1,5 @@ -import type {NextRequest} from 'next/server'; -import { NextResponse } from 'next/server'; +import { type NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; import { MarketService } from '@/server/services/market'; diff --git a/src/app/(backend)/market/user/me/route.ts b/src/app/(backend)/market/user/me/route.ts index 2c893f1aea..c23d95ad19 100644 --- a/src/app/(backend)/market/user/me/route.ts +++ b/src/app/(backend)/market/user/me/route.ts @@ -1,5 +1,5 @@ -import type {NextRequest} from 'next/server'; -import { NextResponse } from 'next/server'; +import { type NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; import { MarketService } from '@/server/services/market'; diff --git a/src/app/(backend)/middleware/auth/index.test.ts b/src/app/(backend)/middleware/auth/index.test.ts index 00c8576cfb..f6236d912c 100644 --- a/src/app/(backend)/middleware/auth/index.test.ts +++ b/src/app/(backend)/middleware/auth/index.test.ts @@ -5,7 +5,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { createErrorResponse } from '@/utils/errorResponse'; -import type {RequestHandler } from './index'; +import { type RequestHandler } from './index'; import { checkAuth } from './index'; import { checkAuthMethod } from './utils'; diff --git a/src/app/(backend)/middleware/auth/index.ts b/src/app/(backend)/middleware/auth/index.ts index 47d5a985d3..4b69bfaac6 100644 --- a/src/app/(backend)/middleware/auth/index.ts +++ b/src/app/(backend)/middleware/auth/index.ts @@ -1,15 +1,13 @@ -import type {ChatCompletionErrorPayload, ModelRuntime} from '@lobechat/model-runtime'; -import { - AgentRuntimeError -} from '@lobechat/model-runtime'; +import { type ChatCompletionErrorPayload, type ModelRuntime } from '@lobechat/model-runtime'; +import { AgentRuntimeError } from '@lobechat/model-runtime'; import { context as otContext } from '@lobechat/observability-otel/api'; -import type {ClientSecretPayload} from '@lobechat/types'; -import { ChatErrorType } from '@lobechat/types'; +import { type ClientSecretPayload } from '@lobechat/types'; +import { ChatErrorType } from '@lobechat/types'; import { getXorPayload } from '@lobechat/utils/server'; import { auth } from '@/auth'; import { getServerDB } from '@/database/core/db-adaptor'; -import type {LobeChatDatabase} from '@/database/type'; +import { type LobeChatDatabase } from '@/database/type'; import { LOBE_CHAT_AUTH_HEADER, LOBE_CHAT_OIDC_AUTH_HEADER, OAUTH_AUTHORIZED } from '@/envs/auth'; import { extractTraceContext, injectActiveTraceHeaders } from '@/libs/observability/traceparent'; import { validateOIDCJWT } from '@/libs/oidc-provider/jwt'; diff --git a/src/app/(backend)/middleware/validate/createValidator.ts b/src/app/(backend)/middleware/validate/createValidator.ts index cf63380dad..fc758617d4 100644 --- a/src/app/(backend)/middleware/validate/createValidator.ts +++ b/src/app/(backend)/middleware/validate/createValidator.ts @@ -1,4 +1,4 @@ -import type { NextRequest} from 'next/server'; +import { type NextRequest } from 'next/server'; import { NextResponse } from 'next/server'; import { z } from 'zod'; diff --git a/src/app/(backend)/oidc/[...oidc]/route.ts b/src/app/(backend)/oidc/[...oidc]/route.ts index d203f1db7d..4d5998161d 100644 --- a/src/app/(backend)/oidc/[...oidc]/route.ts +++ b/src/app/(backend)/oidc/[...oidc]/route.ts @@ -1,8 +1,8 @@ import { URL } from 'node:url'; import debug from 'debug'; -import type {NextRequest} from 'next/server'; -import { NextResponse } from 'next/server'; +import { type NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; import { authEnv } from '@/envs/auth'; import { createNodeRequest, createNodeResponse } from '@/libs/oidc-provider/http-adapter'; @@ -81,7 +81,6 @@ const handler = async (req: NextRequest) => { log('Final Response Headers: %O', finalHeaders); return new NextResponse(finalBody, { - headers: finalHeaders as HeadersInit, status: finalStatus, }); diff --git a/src/app/(backend)/oidc/callback/desktop/route.ts b/src/app/(backend)/oidc/callback/desktop/route.ts index de4d4d0a5b..2e4d4ee3b3 100644 --- a/src/app/(backend)/oidc/callback/desktop/route.ts +++ b/src/app/(backend)/oidc/callback/desktop/route.ts @@ -1,5 +1,5 @@ import debug from 'debug'; -import type {NextRequest} from 'next/server'; +import { type NextRequest } from 'next/server'; import { after, NextResponse } from 'next/server'; import { OAuthHandoffModel } from '@/database/models/oauthHandoff'; diff --git a/src/app/(backend)/oidc/consent/route.ts b/src/app/(backend)/oidc/consent/route.ts index 870905c2b2..fdbc46385f 100644 --- a/src/app/(backend)/oidc/consent/route.ts +++ b/src/app/(backend)/oidc/consent/route.ts @@ -1,7 +1,7 @@ import { getUserAuth } from '@lobechat/utils/server'; import debug from 'debug'; -import type {NextRequest} from 'next/server'; -import { NextResponse } from 'next/server'; +import { type NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; import { appEnv } from '@/envs/app'; import { OIDCService } from '@/server/services/oidc'; diff --git a/src/app/(backend)/oidc/handoff/route.ts b/src/app/(backend)/oidc/handoff/route.ts index 6bd7daee9a..2955e1fe1e 100644 --- a/src/app/(backend)/oidc/handoff/route.ts +++ b/src/app/(backend)/oidc/handoff/route.ts @@ -1,6 +1,6 @@ import debug from 'debug'; -import type {NextRequest} from 'next/server'; -import { NextResponse } from 'next/server'; +import { type NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; import { OAuthHandoffModel } from '@/database/models/oauthHandoff'; import { serverDB } from '@/database/server'; diff --git a/src/app/(backend)/trpc/async/[trpc]/route.ts b/src/app/(backend)/trpc/async/[trpc]/route.ts index c028cac102..6ea1a954e9 100644 --- a/src/app/(backend)/trpc/async/[trpc]/route.ts +++ b/src/app/(backend)/trpc/async/[trpc]/route.ts @@ -1,5 +1,5 @@ import { fetchRequestHandler } from '@trpc/server/adapters/fetch'; -import type { NextRequest } from 'next/server'; +import { type NextRequest } from 'next/server'; import { createAsyncRouteContext } from '@/libs/trpc/async/context'; import { prepareRequestForTRPC } from '@/libs/trpc/utils/request-adapter'; diff --git a/src/app/(backend)/trpc/lambda/[trpc]/route.ts b/src/app/(backend)/trpc/lambda/[trpc]/route.ts index fb4e8ef371..ec176fd4e8 100644 --- a/src/app/(backend)/trpc/lambda/[trpc]/route.ts +++ b/src/app/(backend)/trpc/lambda/[trpc]/route.ts @@ -1,5 +1,5 @@ import { fetchRequestHandler } from '@trpc/server/adapters/fetch'; -import type { NextRequest } from 'next/server'; +import { type NextRequest } from 'next/server'; import { createLambdaContext } from '@/libs/trpc/lambda/context'; import { prepareRequestForTRPC } from '@/libs/trpc/utils/request-adapter'; diff --git a/src/app/(backend)/trpc/mobile/[trpc]/route.ts b/src/app/(backend)/trpc/mobile/[trpc]/route.ts index c4a152da8e..43f1dc186d 100644 --- a/src/app/(backend)/trpc/mobile/[trpc]/route.ts +++ b/src/app/(backend)/trpc/mobile/[trpc]/route.ts @@ -1,5 +1,5 @@ import { fetchRequestHandler } from '@trpc/server/adapters/fetch'; -import type { NextRequest } from 'next/server'; +import { type NextRequest } from 'next/server'; import { createLambdaContext } from '@/libs/trpc/lambda/context'; import { prepareRequestForTRPC } from '@/libs/trpc/utils/request-adapter'; diff --git a/src/app/(backend)/trpc/tools/[trpc]/route.ts b/src/app/(backend)/trpc/tools/[trpc]/route.ts index 9b58941892..1f33d86d8d 100644 --- a/src/app/(backend)/trpc/tools/[trpc]/route.ts +++ b/src/app/(backend)/trpc/tools/[trpc]/route.ts @@ -1,5 +1,5 @@ import { fetchRequestHandler } from '@trpc/server/adapters/fetch'; -import type { NextRequest } from 'next/server'; +import { type NextRequest } from 'next/server'; import { createLambdaContext } from '@/libs/trpc/lambda/context'; import { prepareRequestForTRPC } from '@/libs/trpc/utils/request-adapter'; diff --git a/src/app/(backend)/webapi/chat/[provider]/route.test.ts b/src/app/(backend)/webapi/chat/[provider]/route.test.ts index 88b2cbfd16..9b42168875 100644 --- a/src/app/(backend)/webapi/chat/[provider]/route.test.ts +++ b/src/app/(backend)/webapi/chat/[provider]/route.test.ts @@ -1,5 +1,5 @@ // @vitest-environment node -import type { LobeRuntimeAI} from '@lobechat/model-runtime'; +import { type LobeRuntimeAI } from '@lobechat/model-runtime'; import { ModelRuntime } from '@lobechat/model-runtime'; import { ChatErrorType } from '@lobechat/types'; import { getXorPayload } from '@lobechat/utils/server'; diff --git a/src/app/(backend)/webapi/chat/[provider]/route.ts b/src/app/(backend)/webapi/chat/[provider]/route.ts index 13fdd34659..b8e68e354c 100644 --- a/src/app/(backend)/webapi/chat/[provider]/route.ts +++ b/src/app/(backend)/webapi/chat/[provider]/route.ts @@ -1,12 +1,10 @@ -import type {ChatCompletionErrorPayload, ModelRuntime} from '@lobechat/model-runtime'; -import { - AGENT_RUNTIME_ERROR_SET -} from '@lobechat/model-runtime'; +import { type ChatCompletionErrorPayload, type ModelRuntime } from '@lobechat/model-runtime'; +import { AGENT_RUNTIME_ERROR_SET } from '@lobechat/model-runtime'; import { ChatErrorType } from '@lobechat/types'; import { checkAuth } from '@/app/(backend)/middleware/auth'; import { createTraceOptions, initModelRuntimeFromDB } from '@/server/modules/ModelRuntime'; -import type {ChatStreamPayload} from '@/types/openai/chat'; +import { type ChatStreamPayload } from '@/types/openai/chat'; import { createErrorResponse } from '@/utils/errorResponse'; import { getTracePayload } from '@/utils/trace'; diff --git a/src/app/(backend)/webapi/models/[provider]/pull/route.ts b/src/app/(backend)/webapi/models/[provider]/pull/route.ts index 067b0e1ad9..9663c30f33 100644 --- a/src/app/(backend)/webapi/models/[provider]/pull/route.ts +++ b/src/app/(backend)/webapi/models/[provider]/pull/route.ts @@ -1,4 +1,4 @@ -import type {ChatCompletionErrorPayload, PullModelParams} from '@lobechat/model-runtime'; +import { type ChatCompletionErrorPayload, type PullModelParams } from '@lobechat/model-runtime'; import { ChatErrorType } from '@lobechat/types'; import { checkAuth } from '@/app/(backend)/middleware/auth'; diff --git a/src/app/(backend)/webapi/models/[provider]/route.test.ts b/src/app/(backend)/webapi/models/[provider]/route.test.ts index 78b68ec63a..e76721f9f3 100644 --- a/src/app/(backend)/webapi/models/[provider]/route.test.ts +++ b/src/app/(backend)/webapi/models/[provider]/route.test.ts @@ -1,5 +1,5 @@ // @vitest-environment node -import type { LobeRuntimeAI} from '@lobechat/model-runtime'; +import { type LobeRuntimeAI } from '@lobechat/model-runtime'; import { ModelRuntime } from '@lobechat/model-runtime'; import { ChatErrorType } from '@lobechat/types'; import { getXorPayload } from '@lobechat/utils/server'; diff --git a/src/app/(backend)/webapi/models/[provider]/route.ts b/src/app/(backend)/webapi/models/[provider]/route.ts index 67ac14dd58..508b46238d 100644 --- a/src/app/(backend)/webapi/models/[provider]/route.ts +++ b/src/app/(backend)/webapi/models/[provider]/route.ts @@ -1,4 +1,4 @@ -import type {ChatCompletionErrorPayload} from '@lobechat/model-runtime'; +import { type ChatCompletionErrorPayload } from '@lobechat/model-runtime'; import { ChatErrorType } from '@lobechat/types'; import { NextResponse } from 'next/server'; diff --git a/src/app/(backend)/webapi/plugin/gateway/route.ts b/src/app/(backend)/webapi/plugin/gateway/route.ts index e29d835c0a..a9f5fb8497 100644 --- a/src/app/(backend)/webapi/plugin/gateway/route.ts +++ b/src/app/(backend)/webapi/plugin/gateway/route.ts @@ -1,6 +1,6 @@ import { AgentRuntimeError } from '@lobechat/model-runtime'; import { ChatErrorType, TraceNameMap } from '@lobechat/types'; -import type { PluginRequestPayload } from '@lobehub/chat-plugin-sdk'; +import { type PluginRequestPayload } from '@lobehub/chat-plugin-sdk'; import { createGatewayOnEdgeRuntime } from '@lobehub/chat-plugins-gateway'; import { LOBE_CHAT_TRACE_ID } from '@/const/trace'; diff --git a/src/app/(backend)/webapi/revalidate/route.ts b/src/app/(backend)/webapi/revalidate/route.ts index 3f6d50d6d3..d8cb0ebb61 100644 --- a/src/app/(backend)/webapi/revalidate/route.ts +++ b/src/app/(backend)/webapi/revalidate/route.ts @@ -1,6 +1,6 @@ import { revalidateTag } from 'next/cache'; -import type {NextRequest} from 'next/server'; -import { NextResponse } from 'next/server'; +import { type NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; export const GET = async (request: NextRequest) => { if (!process.env.REVALIDATE_SECRET) { diff --git a/src/app/(backend)/webapi/stt/openai/route.ts b/src/app/(backend)/webapi/stt/openai/route.ts index d7d35d42d2..9f70f2ef8d 100644 --- a/src/app/(backend)/webapi/stt/openai/route.ts +++ b/src/app/(backend)/webapi/stt/openai/route.ts @@ -1,4 +1,4 @@ -import type {OpenAISTTPayload} from '@lobehub/tts'; +import { type OpenAISTTPayload } from '@lobehub/tts'; import { createOpenaiAudioTranscriptions } from '@lobehub/tts/server'; import { createBizOpenAI } from '@/app/(backend)/_deprecated/createBizOpenAI'; diff --git a/src/app/(backend)/webapi/trace/route.ts b/src/app/(backend)/webapi/trace/route.ts index 2bf0fe6409..c2f8bb540f 100644 --- a/src/app/(backend)/webapi/trace/route.ts +++ b/src/app/(backend)/webapi/trace/route.ts @@ -2,7 +2,7 @@ import { TraceEventType } from '@lobechat/types'; import { after } from 'next/server'; import { TraceClient } from '@/libs/traces'; -import type {TraceEventBasePayload, TraceEventPayloads} from '@/types/trace'; +import { type TraceEventBasePayload, type TraceEventPayloads } from '@/types/trace'; export const POST = async (req: Request) => { type RequestData = TraceEventPayloads & TraceEventBasePayload; diff --git a/src/app/(backend)/webapi/tts/edge/route.ts b/src/app/(backend)/webapi/tts/edge/route.ts index 51b23eca7e..0a4722fa34 100644 --- a/src/app/(backend)/webapi/tts/edge/route.ts +++ b/src/app/(backend)/webapi/tts/edge/route.ts @@ -1,5 +1,5 @@ -import type {EdgeSpeechPayload} from '@lobehub/tts'; -import { EdgeSpeechTTS } from '@lobehub/tts'; +import { type EdgeSpeechPayload } from '@lobehub/tts'; +import { EdgeSpeechTTS } from '@lobehub/tts'; import { createSpeechResponse } from '@/server/utils/createSpeechResponse'; diff --git a/src/app/(backend)/webapi/tts/microsoft/route.ts b/src/app/(backend)/webapi/tts/microsoft/route.ts index 1735ca236d..beeffab945 100644 --- a/src/app/(backend)/webapi/tts/microsoft/route.ts +++ b/src/app/(backend)/webapi/tts/microsoft/route.ts @@ -1,5 +1,5 @@ -import type {MicrosoftSpeechPayload} from '@lobehub/tts'; -import { MicrosoftSpeechTTS } from '@lobehub/tts'; +import { type MicrosoftSpeechPayload } from '@lobehub/tts'; +import { MicrosoftSpeechTTS } from '@lobehub/tts'; import { createSpeechResponse } from '@/server/utils/createSpeechResponse'; diff --git a/src/app/(backend)/webapi/tts/openai/route.ts b/src/app/(backend)/webapi/tts/openai/route.ts index 76fd3da0ea..93e0d96e9b 100644 --- a/src/app/(backend)/webapi/tts/openai/route.ts +++ b/src/app/(backend)/webapi/tts/openai/route.ts @@ -1,4 +1,4 @@ -import type {OpenAITTSPayload} from '@lobehub/tts'; +import { type OpenAITTSPayload } from '@lobehub/tts'; import { createOpenaiAudioSpeech } from '@lobehub/tts/server'; import { createBizOpenAI } from '@/app/(backend)/_deprecated/createBizOpenAI'; diff --git a/src/app/[variants]/(auth)/_layout/index.tsx b/src/app/[variants]/(auth)/_layout/index.tsx index 6d20516a2e..cddfcdbedf 100644 --- a/src/app/[variants]/(auth)/_layout/index.tsx +++ b/src/app/[variants]/(auth)/_layout/index.tsx @@ -4,7 +4,7 @@ import { COPYRIGHT_FULL } from '@lobechat/business-const'; import { Center, Flexbox, Text } from '@lobehub/ui'; import { Divider } from 'antd'; import { cx } from 'antd-style'; -import type { FC, PropsWithChildren } from 'react'; +import { type FC, type PropsWithChildren } from 'react'; import { ProductLogo } from '@/components/Branding'; import LangButton from '@/features/User/UserPanel/LangButton'; diff --git a/src/app/[variants]/(auth)/layout.tsx b/src/app/[variants]/(auth)/layout.tsx index a9cf7eb6ce..19aedd5dde 100644 --- a/src/app/[variants]/(auth)/layout.tsx +++ b/src/app/[variants]/(auth)/layout.tsx @@ -1,5 +1,5 @@ import { NuqsAdapter } from 'nuqs/adapters/next/app'; -import type {FC, PropsWithChildren} from 'react'; +import { type FC, type PropsWithChildren } from 'react'; import ClientOnly from '@/components/client/ClientOnly'; diff --git a/src/app/[variants]/(auth)/signin/SignInEmailStep.tsx b/src/app/[variants]/(auth)/signin/SignInEmailStep.tsx index bc4d4d99ae..15ff71e0b0 100644 --- a/src/app/[variants]/(auth)/signin/SignInEmailStep.tsx +++ b/src/app/[variants]/(auth)/signin/SignInEmailStep.tsx @@ -1,6 +1,6 @@ import { BRANDING_NAME } from '@lobechat/business-const'; import { Alert, Button, Flexbox, Icon, Input, Skeleton, Text } from '@lobehub/ui'; -import type { FormInstance, InputRef } from 'antd'; +import { type FormInstance, type InputRef } from 'antd'; import { Divider, Form } from 'antd'; import { createStaticStyles } from 'antd-style'; import { ChevronRight, Mail } from 'lucide-react'; diff --git a/src/app/[variants]/(auth)/signin/SignInPasswordStep.tsx b/src/app/[variants]/(auth)/signin/SignInPasswordStep.tsx index 8bbe5e9513..8fcf61b884 100644 --- a/src/app/[variants]/(auth)/signin/SignInPasswordStep.tsx +++ b/src/app/[variants]/(auth)/signin/SignInPasswordStep.tsx @@ -1,5 +1,5 @@ import { Button, Icon, InputPassword, Text } from '@lobehub/ui'; -import type { FormInstance, InputRef } from 'antd'; +import { type FormInstance, type InputRef } from 'antd'; import { Form } from 'antd'; import { cssVar } from 'antd-style'; import { ChevronLeft, ChevronRight, Lock } from 'lucide-react'; diff --git a/src/app/[variants]/(auth)/signin/useSignIn.ts b/src/app/[variants]/(auth)/signin/useSignIn.ts index 29f2eef549..5bbfaa39d1 100644 --- a/src/app/[variants]/(auth)/signin/useSignIn.ts +++ b/src/app/[variants]/(auth)/signin/useSignIn.ts @@ -3,8 +3,8 @@ import { Form } from 'antd'; import { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import type { CheckUserResponseData } from '@/app/(backend)/api/auth/check-user/route'; -import type { ResolveUsernameResponseData } from '@/app/(backend)/api/auth/resolve-username/route'; +import { type CheckUserResponseData } from '@/app/(backend)/api/auth/check-user/route'; +import { type ResolveUsernameResponseData } from '@/app/(backend)/api/auth/resolve-username/route'; import { useBusinessSignin } from '@/business/client/hooks/useBusinessSignin'; import { message } from '@/components/AntdStaticMethods'; import { requestPasswordReset, signIn } from '@/libs/better-auth/auth-client'; diff --git a/src/app/[variants]/(auth)/signup/[[...signup]]/BetterAuthSignUpForm.tsx b/src/app/[variants]/(auth)/signup/[[...signup]]/BetterAuthSignUpForm.tsx index 3c8bba8d6c..9dcbe499f9 100644 --- a/src/app/[variants]/(auth)/signup/[[...signup]]/BetterAuthSignUpForm.tsx +++ b/src/app/[variants]/(auth)/signup/[[...signup]]/BetterAuthSignUpForm.tsx @@ -10,8 +10,8 @@ import Link from '@/libs/next/Link'; import { useSearchParams } from '@/libs/next/navigation'; import { AuthCard } from '../../../../../features/AuthCard'; -import type {SignUpFormValues} from './useSignUp'; -import { useSignUp } from './useSignUp'; +import { type SignUpFormValues } from './useSignUp'; +import { useSignUp } from './useSignUp'; const BetterAuthSignUpForm = () => { const [form] = Form.useForm(); diff --git a/src/app/[variants]/(auth)/signup/[[...signup]]/page.tsx b/src/app/[variants]/(auth)/signup/[[...signup]]/page.tsx index 545b649915..592b4506d1 100644 --- a/src/app/[variants]/(auth)/signup/[[...signup]]/page.tsx +++ b/src/app/[variants]/(auth)/signup/[[...signup]]/page.tsx @@ -3,7 +3,7 @@ import { redirect } from 'next/navigation'; import { authEnv } from '@/envs/auth'; import { metadataModule } from '@/server/metadata'; import { translation } from '@/server/translation'; -import type {DynamicLayoutProps} from '@/types/next'; +import { type DynamicLayoutProps } from '@/types/next'; import { RouteVariants } from '@/utils/server/routeVariants'; import BetterAuthSignUpForm from './BetterAuthSignUpForm'; diff --git a/src/app/[variants]/(auth)/signup/[[...signup]]/useSignUp.tsx b/src/app/[variants]/(auth)/signup/[[...signup]]/useSignUp.tsx index 90170bb1ac..594960baed 100644 --- a/src/app/[variants]/(auth)/signup/[[...signup]]/useSignUp.tsx +++ b/src/app/[variants]/(auth)/signup/[[...signup]]/useSignUp.tsx @@ -3,18 +3,15 @@ import { form } from 'motion/react-m'; import { useState } from 'react'; import { useTranslation } from 'react-i18next'; -import type { - BusinessSignupFomData} from '@/business/client/hooks/useBusinessSignup'; -import { - useBusinessSignup, -} from '@/business/client/hooks/useBusinessSignup'; +import { type BusinessSignupFomData } from '@/business/client/hooks/useBusinessSignup'; +import { useBusinessSignup } from '@/business/client/hooks/useBusinessSignup'; import { message } from '@/components/AntdStaticMethods'; import { signUp } from '@/libs/better-auth/auth-client'; import { useRouter, useSearchParams } from '@/libs/next/navigation'; import { useServerConfigStore } from '@/store/serverConfig'; import { serverConfigSelectors } from '@/store/serverConfig/selectors'; -import type { BaseSignUpFormValues } from './types'; +import { type BaseSignUpFormValues } from './types'; export type SignUpFormValues = BaseSignUpFormValues & BusinessSignupFomData; diff --git a/src/app/[variants]/(desktop)/desktop-onboarding/_layout/index.tsx b/src/app/[variants]/(desktop)/desktop-onboarding/_layout/index.tsx index f1eadd55a6..3670d0d91f 100644 --- a/src/app/[variants]/(desktop)/desktop-onboarding/_layout/index.tsx +++ b/src/app/[variants]/(desktop)/desktop-onboarding/_layout/index.tsx @@ -4,7 +4,7 @@ import { TITLE_BAR_HEIGHT } from '@lobechat/desktop-bridge'; import { Center, Flexbox, Text } from '@lobehub/ui'; import { Divider } from 'antd'; import { css, cx } from 'antd-style'; -import type { FC, PropsWithChildren } from 'react'; +import { type FC, type PropsWithChildren } from 'react'; import SimpleTitleBar from '@/features/Electron/titlebar/SimpleTitleBar'; import LangButton from '@/features/User/UserPanel/LangButton'; diff --git a/src/app/[variants]/(desktop)/desktop-onboarding/components/LobeMessage.tsx b/src/app/[variants]/(desktop)/desktop-onboarding/components/LobeMessage.tsx index 0136b0a9ec..22d93769fb 100644 --- a/src/app/[variants]/(desktop)/desktop-onboarding/components/LobeMessage.tsx +++ b/src/app/[variants]/(desktop)/desktop-onboarding/components/LobeMessage.tsx @@ -1,7 +1,7 @@ -import type {FlexboxProps} from '@lobehub/ui'; -import { Flexbox, Text } from '@lobehub/ui'; -import type {TypewriterEffectProps} from '@lobehub/ui/awesome'; -import { TypewriterEffect } from '@lobehub/ui/awesome'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Flexbox, Text } from '@lobehub/ui'; +import { type TypewriterEffectProps } from '@lobehub/ui/awesome'; +import { TypewriterEffect } from '@lobehub/ui/awesome'; import { LoadingDots } from '@lobehub/ui/chat'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(desktop)/desktop-onboarding/components/OnboardingFooterActions.tsx b/src/app/[variants]/(desktop)/desktop-onboarding/components/OnboardingFooterActions.tsx index fe1c22e86f..de5eb0f20f 100644 --- a/src/app/[variants]/(desktop)/desktop-onboarding/components/OnboardingFooterActions.tsx +++ b/src/app/[variants]/(desktop)/desktop-onboarding/components/OnboardingFooterActions.tsx @@ -1,7 +1,7 @@ -import type {FlexboxProps} from '@lobehub/ui'; -import { Flexbox } from '@lobehub/ui'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Flexbox } from '@lobehub/ui'; import { cssVar } from 'antd-style'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; interface OnboardingFooterActionsProps extends Omit { diff --git a/src/app/[variants]/(desktop)/desktop-onboarding/features/LoginStep.tsx b/src/app/[variants]/(desktop)/desktop-onboarding/features/LoginStep.tsx index f1e41cbad0..13fb4a6173 100644 --- a/src/app/[variants]/(desktop)/desktop-onboarding/features/LoginStep.tsx +++ b/src/app/[variants]/(desktop)/desktop-onboarding/features/LoginStep.tsx @@ -1,11 +1,7 @@ 'use client'; -import type { - AuthorizationPhase, - AuthorizationProgress} from '@lobechat/electron-client-ipc'; -import { - useWatchBroadcast, -} from '@lobechat/electron-client-ipc'; +import { type AuthorizationPhase, type AuthorizationProgress } from '@lobechat/electron-client-ipc'; +import { useWatchBroadcast } from '@lobechat/electron-client-ipc'; import { Alert, Button, Center, Flexbox, Icon, Input, Text } from '@lobehub/ui'; import { Divider } from 'antd'; import { cssVar } from 'antd-style'; diff --git a/src/app/[variants]/(desktop)/desktop-onboarding/features/WelcomeStep.tsx b/src/app/[variants]/(desktop)/desktop-onboarding/features/WelcomeStep.tsx index 02d24dee60..481c8bb7a0 100644 --- a/src/app/[variants]/(desktop)/desktop-onboarding/features/WelcomeStep.tsx +++ b/src/app/[variants]/(desktop)/desktop-onboarding/features/WelcomeStep.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {IconProps} from '@lobehub/ui'; -import { Block, Button, Flexbox, Icon, Text } from '@lobehub/ui'; +import { type IconProps } from '@lobehub/ui'; +import { Block, Button, Flexbox, Icon, Text } from '@lobehub/ui'; import { TypewriterEffect } from '@lobehub/ui/awesome'; import { LoadingDots } from '@lobehub/ui/chat'; import { Steps } from 'antd'; diff --git a/src/app/[variants]/(desktop)/desktop-onboarding/navigation.ts b/src/app/[variants]/(desktop)/desktop-onboarding/navigation.ts index fa89e6dda5..0102e6863e 100644 --- a/src/app/[variants]/(desktop)/desktop-onboarding/navigation.ts +++ b/src/app/[variants]/(desktop)/desktop-onboarding/navigation.ts @@ -1,4 +1,4 @@ -import type { DesktopOnboardingScreen } from './types'; +import { type DesktopOnboardingScreen } from './types'; const DESKTOP_ONBOARDING_ROUTE = '/desktop-onboarding'; export const getDesktopOnboardingPath = (screen?: DesktopOnboardingScreen) => { diff --git a/src/app/[variants]/(desktop)/desktop-onboarding/storage.ts b/src/app/[variants]/(desktop)/desktop-onboarding/storage.ts index 0e40125fd3..ffd70a138d 100644 --- a/src/app/[variants]/(desktop)/desktop-onboarding/storage.ts +++ b/src/app/[variants]/(desktop)/desktop-onboarding/storage.ts @@ -1,4 +1,4 @@ -import type { DesktopOnboardingScreen} from './types'; +import { type DesktopOnboardingScreen } from './types'; import { isDesktopOnboardingScreen } from './types'; export const DESKTOP_ONBOARDING_STORAGE_KEY = 'lobechat:desktop:onboarding:completed:v1'; diff --git a/src/app/[variants]/(main)/_layout/DesktopLayoutContainer.tsx b/src/app/[variants]/(main)/_layout/DesktopLayoutContainer.tsx index 69a2b047db..482ce93ef7 100644 --- a/src/app/[variants]/(main)/_layout/DesktopLayoutContainer.tsx +++ b/src/app/[variants]/(main)/_layout/DesktopLayoutContainer.tsx @@ -1,7 +1,7 @@ import { Flexbox } from '@lobehub/ui'; import { cssVar } from 'antd-style'; -import type {FC, PropsWithChildren} from 'react'; -import { useMemo } from 'react'; +import { type FC, type PropsWithChildren } from 'react'; +import { useMemo } from 'react'; import { isDesktop } from '@/const/version'; import { useIsDark } from '@/hooks/useIsDark'; diff --git a/src/app/[variants]/(main)/_layout/index.tsx b/src/app/[variants]/(main)/_layout/index.tsx index fe54745afa..8c2958e75e 100644 --- a/src/app/[variants]/(main)/_layout/index.tsx +++ b/src/app/[variants]/(main)/_layout/index.tsx @@ -3,8 +3,8 @@ import { TITLE_BAR_HEIGHT } from '@lobechat/desktop-bridge'; import { Flexbox } from '@lobehub/ui'; import { cx } from 'antd-style'; -import type {FC} from 'react'; -import { lazy,Suspense } from 'react'; +import { type FC } from 'react'; +import { lazy, Suspense } from 'react'; import { HotkeysProvider } from 'react-hotkeys-hook'; import { Outlet } from 'react-router-dom'; diff --git a/src/app/[variants]/(main)/agent/_layout/Sidebar/Cron/CronTopicGroup.tsx b/src/app/[variants]/(main)/agent/_layout/Sidebar/Cron/CronTopicGroup.tsx index d14740837a..f33277c184 100644 --- a/src/app/[variants]/(main)/agent/_layout/Sidebar/Cron/CronTopicGroup.tsx +++ b/src/app/[variants]/(main)/agent/_layout/Sidebar/Cron/CronTopicGroup.tsx @@ -6,7 +6,7 @@ import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { useParams } from 'react-router-dom'; -import type { AgentCronJob } from '@/database/schemas/agentCronJob'; +import { type AgentCronJob } from '@/database/schemas/agentCronJob'; import { useRouter } from '@/libs/router/navigation'; import Actions from './Actions'; diff --git a/src/app/[variants]/(main)/agent/_layout/Sidebar/Cron/useDropdownMenu.tsx b/src/app/[variants]/(main)/agent/_layout/Sidebar/Cron/useDropdownMenu.tsx index df906b617e..8d5fa50c2f 100644 --- a/src/app/[variants]/(main)/agent/_layout/Sidebar/Cron/useDropdownMenu.tsx +++ b/src/app/[variants]/(main)/agent/_layout/Sidebar/Cron/useDropdownMenu.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { App } from 'antd'; import { Trash } from 'lucide-react'; import { useCallback, useMemo } from 'react'; diff --git a/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/Agent/SwitchPanel.tsx b/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/Agent/SwitchPanel.tsx index 11e2385d92..3ed9060976 100644 --- a/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/Agent/SwitchPanel.tsx +++ b/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/Agent/SwitchPanel.tsx @@ -1,7 +1,7 @@ import { Flexbox, Popover } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; -import type {PropsWithChildren} from 'react'; -import { memo, Suspense, useMemo } from 'react'; +import { type PropsWithChildren } from 'react'; +import { memo, Suspense, useMemo } from 'react'; import { useNavigate } from 'react-router-dom'; import List from '@/app/[variants]/(main)/home/_layout/Body/Agent/List'; diff --git a/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/Agent/index.tsx b/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/Agent/index.tsx index e381b530b4..05ef5625f5 100644 --- a/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/Agent/index.tsx +++ b/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/Agent/index.tsx @@ -2,7 +2,7 @@ import { ActionIcon, Avatar, Block, Text } from '@lobehub/ui'; import { ChevronsUpDownIcon } from 'lucide-react'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import React, { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/index.tsx b/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/index.tsx index eadd838892..31d124839b 100644 --- a/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/index.tsx +++ b/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/index.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { memo } from 'react'; import SideBarHeaderLayout from '@/features/NavPanel/SideBarHeaderLayout'; diff --git a/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/AllTopicsDrawer/Content.tsx b/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/AllTopicsDrawer/Content.tsx index 2a62416fd1..b10b8037e1 100644 --- a/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/AllTopicsDrawer/Content.tsx +++ b/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/AllTopicsDrawer/Content.tsx @@ -3,8 +3,8 @@ import { Flexbox } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; import { memo, useCallback, useEffect, useRef } from 'react'; -import type {VListHandle} from 'virtua'; -import { VList } from 'virtua'; +import { type VListHandle } from 'virtua'; +import { VList } from 'virtua'; import SkeletonList from '@/features/NavPanel/components/SkeletonList'; import TopicEmpty from '@/features/TopicEmpty'; diff --git a/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/List/Item/Actions.tsx b/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/List/Item/Actions.tsx index 5edb1535c1..6409785f4a 100644 --- a/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/List/Item/Actions.tsx +++ b/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/List/Item/Actions.tsx @@ -1,5 +1,5 @@ -import type {DropdownItem} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type DropdownItem } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { MoreHorizontalIcon } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/List/Item/useDropdownMenu.tsx b/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/List/Item/useDropdownMenu.tsx index e08d660511..5f6d90f019 100644 --- a/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/List/Item/useDropdownMenu.tsx +++ b/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/List/Item/useDropdownMenu.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { App } from 'antd'; import { ExternalLink, LucideCopy, PencilLine, Trash, Wand2 } from 'lucide-react'; import { useCallback } from 'react'; diff --git a/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ByTimeMode/GroupItem.tsx b/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ByTimeMode/GroupItem.tsx index caa2730fb8..90ec7fa81a 100644 --- a/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ByTimeMode/GroupItem.tsx +++ b/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ByTimeMode/GroupItem.tsx @@ -4,7 +4,7 @@ import { HashIcon } from 'lucide-react'; import React, { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {GroupedTopic} from '@/types/topic'; +import { type GroupedTopic } from '@/types/topic'; import TopicItem from '../../List/Item'; diff --git a/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/Actions.tsx b/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/Actions.tsx index 5edb1535c1..6409785f4a 100644 --- a/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/Actions.tsx +++ b/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/Actions.tsx @@ -1,5 +1,5 @@ -import type {DropdownItem} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type DropdownItem } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { MoreHorizontalIcon } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/useDropdownMenu.tsx b/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/useDropdownMenu.tsx index ff8d03cae6..955791b404 100644 --- a/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/useDropdownMenu.tsx +++ b/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/useDropdownMenu.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { App } from 'antd'; import { PencilLine, Trash } from 'lucide-react'; import { useCallback } from 'react'; diff --git a/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/useDropdownMenu.tsx b/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/useDropdownMenu.tsx index e11329384e..9fbf1c75f4 100644 --- a/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/useDropdownMenu.tsx +++ b/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/useDropdownMenu.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { App, Upload } from 'antd'; import { css, cx } from 'antd-style'; import { Hash, Import, LucideCheck, Trash } from 'lucide-react'; diff --git a/src/app/[variants]/(main)/agent/_layout/index.tsx b/src/app/[variants]/(main)/agent/_layout/index.tsx index 634c372bb7..f7410be31f 100644 --- a/src/app/[variants]/(main)/agent/_layout/index.tsx +++ b/src/app/[variants]/(main)/agent/_layout/index.tsx @@ -1,5 +1,5 @@ import { Flexbox } from '@lobehub/ui'; -import type {FC} from 'react'; +import { type FC } from 'react'; import { Outlet } from 'react-router-dom'; import AgentIdSync from '@/app/[variants]/(main)/agent/_layout/AgentIdSync'; diff --git a/src/app/[variants]/(main)/agent/cron/[cronId]/CronConfig.ts b/src/app/[variants]/(main)/agent/cron/[cronId]/CronConfig.ts index f641e71cc5..5aba2ca4a4 100644 --- a/src/app/[variants]/(main)/agent/cron/[cronId]/CronConfig.ts +++ b/src/app/[variants]/(main)/agent/cron/[cronId]/CronConfig.ts @@ -1,4 +1,4 @@ -import type { Dayjs } from 'dayjs'; +import { type Dayjs } from 'dayjs'; export type ScheduleType = 'daily' | 'hourly' | 'weekly'; @@ -99,7 +99,6 @@ export const parseCronPattern = ( return { scheduleType: 'daily', triggerHour: 0, triggerMinute: 0 }; } - const [minute, hour, , , weekday] = parts; const rawMinute = minute === '*' ? 0 : Number.parseInt(minute); // Normalize to nearest 30-minute interval (0 or 30) diff --git a/src/app/[variants]/(main)/agent/cron/[cronId]/features/CronJobScheduleConfig.tsx b/src/app/[variants]/(main)/agent/cron/[cronId]/features/CronJobScheduleConfig.tsx index 2847bd60d0..20f35b5bd6 100644 --- a/src/app/[variants]/(main)/agent/cron/[cronId]/features/CronJobScheduleConfig.tsx +++ b/src/app/[variants]/(main)/agent/cron/[cronId]/features/CronJobScheduleConfig.tsx @@ -3,13 +3,13 @@ import { Checkbox, Flexbox, FormGroup, LobeSelect as Select, Text } from '@lobehub/ui'; import { Divider, InputNumber, TimePicker } from 'antd'; import { createStaticStyles, cx } from 'antd-style'; -import type { Dayjs } from 'dayjs'; +import { type Dayjs } from 'dayjs'; import dayjs from 'dayjs'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {ScheduleType} from '../CronConfig'; -import { SCHEDULE_TYPE_OPTIONS, TIMEZONE_OPTIONS } from '../CronConfig'; +import { type ScheduleType } from '../CronConfig'; +import { SCHEDULE_TYPE_OPTIONS, TIMEZONE_OPTIONS } from '../CronConfig'; const styles = createStaticStyles(({ css, cssVar }) => ({ label: css` diff --git a/src/app/[variants]/(main)/agent/cron/[cronId]/index.tsx b/src/app/[variants]/(main)/agent/cron/[cronId]/index.tsx index 29f5c28a79..c760c370f5 100644 --- a/src/app/[variants]/(main)/agent/cron/[cronId]/index.tsx +++ b/src/app/[variants]/(main)/agent/cron/[cronId]/index.tsx @@ -4,7 +4,7 @@ import { EDITOR_DEBOUNCE_TIME } from '@lobechat/const'; import { ActionIcon, Flexbox } from '@lobehub/ui'; import { useDebounceFn } from 'ahooks'; import { App, Empty, message } from 'antd'; -import type {Dayjs} from 'dayjs'; +import { type Dayjs } from 'dayjs'; import dayjs from 'dayjs'; import { Trash2 } from 'lucide-react'; import { memo, useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react'; @@ -14,7 +14,7 @@ import useSWR from 'swr'; import AutoSaveHint from '@/components/Editor/AutoSaveHint'; import Loading from '@/components/Loading/BrandTextLoading'; -import type { UpdateAgentCronJobData } from '@/database/schemas/agentCronJob'; +import { type UpdateAgentCronJobData } from '@/database/schemas/agentCronJob'; import NavHeader from '@/features/NavHeader'; import WideScreenContainer from '@/features/WideScreenContainer'; import { useQueryRoute } from '@/hooks/useQueryRoute'; @@ -28,7 +28,7 @@ import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfi import { useUserStore } from '@/store/user'; import { labPreferSelectors } from '@/store/user/selectors'; -import type {ScheduleType} from './CronConfig'; +import { type ScheduleType } from './CronConfig'; import { buildCronPattern, parseCronPattern } from './CronConfig'; import CronJobContentEditor from './features/CronJobContentEditor'; import CronJobHeader from './features/CronJobHeader'; 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 cd4c727c42..ff5cb108de 100644 --- a/src/app/[variants]/(main)/agent/features/Conversation/AgentWelcome/ToolAuthAlert.tsx +++ b/src/app/[variants]/(main)/agent/features/Conversation/AgentWelcome/ToolAuthAlert.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {KlavisServerType} from '@lobechat/const'; -import { KLAVIS_SERVER_TYPES } from '@lobechat/const'; +import { type KlavisServerType } from '@lobechat/const'; +import { KLAVIS_SERVER_TYPES } from '@lobechat/const'; import { Alert, Avatar, Button, Flexbox, Icon, Text } from '@lobehub/ui'; import { Divider } from 'antd'; import { cssVar } from 'antd-style'; @@ -14,11 +14,8 @@ import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth'; import { useAgentStore } from '@/store/agent'; import { agentSelectors } from '@/store/agent/selectors'; import { useToolStore } from '@/store/tool'; -import type {KlavisServer} from '@/store/tool/slices/klavisStore'; -import { - KlavisServerStatus, - klavisStoreSelectors -} from '@/store/tool/slices/klavisStore'; +import { type KlavisServer } from '@/store/tool/slices/klavisStore'; +import { KlavisServerStatus, klavisStoreSelectors } from '@/store/tool/slices/klavisStore'; import { useUserStore } from '@/store/user'; import { userProfileSelectors } from '@/store/user/selectors'; diff --git a/src/app/[variants]/(main)/agent/features/Conversation/Header/HeaderActions/useMenu.tsx b/src/app/[variants]/(main)/agent/features/Conversation/Header/HeaderActions/useMenu.tsx index 27bb73137c..34c756e4c5 100644 --- a/src/app/[variants]/(main)/agent/features/Conversation/Header/HeaderActions/useMenu.tsx +++ b/src/app/[variants]/(main)/agent/features/Conversation/Header/HeaderActions/useMenu.tsx @@ -1,7 +1,7 @@ 'use client'; import { Icon } from '@lobehub/ui'; -import type { DropdownItem } from '@lobehub/ui/es/DropdownMenu/type'; +import { type DropdownItem } from '@lobehub/ui/es/DropdownMenu/type'; import { Maximize2 } from 'lucide-react'; import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/agent/features/Conversation/Header/Tags/KnowledgeTag.tsx b/src/app/[variants]/(main)/agent/features/Conversation/Header/Tags/KnowledgeTag.tsx index cd2d5c1903..c39109c15d 100644 --- a/src/app/[variants]/(main)/agent/features/Conversation/Header/Tags/KnowledgeTag.tsx +++ b/src/app/[variants]/(main)/agent/features/Conversation/Header/Tags/KnowledgeTag.tsx @@ -1,13 +1,13 @@ 'use client'; -import type {MenuProps} from '@lobehub/ui'; -import { DropdownMenu, Flexbox, Icon, Tag } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { DropdownMenu, Flexbox, Icon, Tag } from '@lobehub/ui'; import { LibraryBig } from 'lucide-react'; import { memo } from 'react'; import KnowledgeIcon from '@/components/KnowledgeIcon'; import { oneLineEllipsis } from '@/styles'; -import type {KnowledgeItem} from '@/types/knowledgeBase'; +import { type KnowledgeItem } from '@/types/knowledgeBase'; export interface PluginTagProps { data: KnowledgeItem[]; diff --git a/src/app/[variants]/(main)/agent/features/Conversation/Header/Tags/MemberCountTag.tsx b/src/app/[variants]/(main)/agent/features/Conversation/Header/Tags/MemberCountTag.tsx index 4fb1315094..f4a0ad5b44 100644 --- a/src/app/[variants]/(main)/agent/features/Conversation/Header/Tags/MemberCountTag.tsx +++ b/src/app/[variants]/(main)/agent/features/Conversation/Header/Tags/MemberCountTag.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'; import { useSessionStore } from '@/store/session'; import { sessionSelectors } from '@/store/session/selectors'; -import type {LobeGroupSession} from '@/types/session'; +import { type LobeGroupSession } from '@/types/session'; const MemberCountTag = memo(() => { const { t } = useTranslation('chat'); diff --git a/src/app/[variants]/(main)/agent/features/Conversation/MainChatInput/useSendMenuItems.tsx b/src/app/[variants]/(main)/agent/features/Conversation/MainChatInput/useSendMenuItems.tsx index 89372e0567..9b0cd383e4 100644 --- a/src/app/[variants]/(main)/agent/features/Conversation/MainChatInput/useSendMenuItems.tsx +++ b/src/app/[variants]/(main)/agent/features/Conversation/MainChatInput/useSendMenuItems.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {MenuProps} from '@lobehub/ui'; -import { Flexbox,Hotkey, Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Flexbox, Hotkey, Icon } from '@lobehub/ui'; import { BotMessageSquare, LucideCheck, MessageSquarePlus } from 'lucide-react'; import { useCallback, useMemo } from 'react'; import { Trans, useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/agent/features/Conversation/useActionsBarConfig.ts b/src/app/[variants]/(main)/agent/features/Conversation/useActionsBarConfig.ts index dce5b223be..51d35eb44b 100644 --- a/src/app/[variants]/(main)/agent/features/Conversation/useActionsBarConfig.ts +++ b/src/app/[variants]/(main)/agent/features/Conversation/useActionsBarConfig.ts @@ -5,10 +5,10 @@ import { Split } from 'lucide-react'; import { useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -import type { - ActionsBarConfig, - MessageActionFactory, - MessageActionItem, +import { + type ActionsBarConfig, + type MessageActionFactory, + type MessageActionItem, } from '@/features/Conversation/types'; import { useChatStore } from '@/store/chat'; diff --git a/src/app/[variants]/(main)/agent/features/Conversation/useAgentContext.ts b/src/app/[variants]/(main)/agent/features/Conversation/useAgentContext.ts index a1f23f585d..0952833d60 100644 --- a/src/app/[variants]/(main)/agent/features/Conversation/useAgentContext.ts +++ b/src/app/[variants]/(main)/agent/features/Conversation/useAgentContext.ts @@ -1,6 +1,6 @@ 'use client'; -import type {ConversationContext} from '@lobechat/types'; +import { type ConversationContext } from '@lobechat/types'; import { useChatStore } from '@/store/chat'; diff --git a/src/app/[variants]/(main)/agent/features/Portal/_layout/Mobile.tsx b/src/app/[variants]/(main)/agent/features/Portal/_layout/Mobile.tsx index 27a5da2feb..7ee0dde800 100644 --- a/src/app/[variants]/(main)/agent/features/Portal/_layout/Mobile.tsx +++ b/src/app/[variants]/(main)/agent/features/Portal/_layout/Mobile.tsx @@ -2,7 +2,7 @@ import { Flexbox, Modal } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { useTranslation } from 'react-i18next'; import { PortalContent } from '@/features/Portal/router'; diff --git a/src/app/[variants]/(main)/agent/features/Portal/features/Body.tsx b/src/app/[variants]/(main)/agent/features/Portal/features/Body.tsx index b6820e151e..a46080d035 100644 --- a/src/app/[variants]/(main)/agent/features/Portal/features/Body.tsx +++ b/src/app/[variants]/(main)/agent/features/Portal/features/Body.tsx @@ -2,7 +2,7 @@ import { Flexbox } from '@lobehub/ui'; import { css, cx } from 'antd-style'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; const body = css` :has(.portal-artifact) { diff --git a/src/app/[variants]/(main)/agent/features/Portal/features/Portal.tsx b/src/app/[variants]/(main)/agent/features/Portal/features/Portal.tsx index 16072bff56..98f2a12f8b 100644 --- a/src/app/[variants]/(main)/agent/features/Portal/features/Portal.tsx +++ b/src/app/[variants]/(main)/agent/features/Portal/features/Portal.tsx @@ -1,11 +1,11 @@ 'use client'; -import type {DraggablePanelProps} from '@lobehub/ui'; -import { DraggablePanel } from '@lobehub/ui'; +import { type DraggablePanelProps } from '@lobehub/ui'; +import { DraggablePanel } from '@lobehub/ui'; import { createStaticStyles, useResponsive } from 'antd-style'; import isEqual from 'fast-deep-equal'; -import type {PropsWithChildren} from 'react'; -import { Activity, memo, useState } from 'react'; +import { type PropsWithChildren } from 'react'; +import { Activity, memo, useState } from 'react'; import { CHAT_PORTAL_MAX_WIDTH, diff --git a/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/CronJobCards.tsx b/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/CronJobCards.tsx index 0f8fa8860c..caf3d69dd3 100644 --- a/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/CronJobCards.tsx +++ b/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/CronJobCards.tsx @@ -7,7 +7,7 @@ import { Calendar, Clock, Edit, Trash2 } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type { AgentCronJob } from '@/database/schemas/agentCronJob'; +import { type AgentCronJob } from '@/database/schemas/agentCronJob'; import { useAgentCronJobs } from './hooks/useAgentCronJobs'; diff --git a/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/CronJobForm.tsx b/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/CronJobForm.tsx index fd9ccf8466..ee210a0df8 100644 --- a/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/CronJobForm.tsx +++ b/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/CronJobForm.tsx @@ -5,7 +5,7 @@ import dayjs from 'dayjs'; import { memo, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; -import type { AgentCronJob } from '@/database/schemas/agentCronJob'; +import { type AgentCronJob } from '@/database/schemas/agentCronJob'; // Form data interface - excludes server-managed fields interface CronJobFormData { diff --git a/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/CronJobList.tsx b/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/CronJobList.tsx index 5a6305f5ce..ffc6948098 100644 --- a/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/CronJobList.tsx +++ b/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/CronJobList.tsx @@ -7,7 +7,7 @@ import { Calendar, Clock, Edit, Trash2 } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type { AgentCronJob } from '@/database/schemas/agentCronJob'; +import { type AgentCronJob } from '@/database/schemas/agentCronJob'; import { useAgentCronJobs } from './hooks/useAgentCronJobs'; diff --git a/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/hooks/useAgentCronJobs.ts b/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/hooks/useAgentCronJobs.ts index c37d40be60..9cc655efe7 100644 --- a/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/hooks/useAgentCronJobs.ts +++ b/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/hooks/useAgentCronJobs.ts @@ -3,9 +3,9 @@ import { useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import useSWR from 'swr'; -import type { - CreateAgentCronJobData, - UpdateAgentCronJobData, +import { + type CreateAgentCronJobData, + type UpdateAgentCronJobData, } from '@/database/schemas/agentCronJob'; import { agentCronJobService } from '@/services/agentCronJob'; diff --git a/src/app/[variants]/(main)/agent/profile/features/AgentSettings/Content.tsx b/src/app/[variants]/(main)/agent/profile/features/AgentSettings/Content.tsx index cc21503cfa..8b3438c8b2 100644 --- a/src/app/[variants]/(main)/agent/profile/features/AgentSettings/Content.tsx +++ b/src/app/[variants]/(main)/agent/profile/features/AgentSettings/Content.tsx @@ -1,7 +1,7 @@ 'use client'; import { Avatar, Block, Flexbox, Icon, Text } from '@lobehub/ui'; -import type { ItemType } from 'antd/es/menu/interface'; +import { type ItemType } from 'antd/es/menu/interface'; import { useTheme } from 'antd-style'; import isEqual from 'fast-deep-equal'; import { BrainIcon, MessageSquareHeartIcon, MessagesSquareIcon } from 'lucide-react'; diff --git a/src/app/[variants]/(main)/agent/profile/features/EditorCanvas/TypoBar.tsx b/src/app/[variants]/(main)/agent/profile/features/EditorCanvas/TypoBar.tsx index fa88d1de10..bce750e77a 100644 --- a/src/app/[variants]/(main)/agent/profile/features/EditorCanvas/TypoBar.tsx +++ b/src/app/[variants]/(main)/agent/profile/features/EditorCanvas/TypoBar.tsx @@ -1,5 +1,5 @@ -import { getHotkeyById,HotkeyEnum } from '@lobehub/editor'; -import type {ChatInputActionsProps} from '@lobehub/editor/react'; +import { getHotkeyById, HotkeyEnum } from '@lobehub/editor'; +import { type ChatInputActionsProps } from '@lobehub/editor/react'; import { FloatActions } from '@lobehub/editor/react'; import { BoldIcon, diff --git a/src/app/[variants]/(main)/agent/profile/features/EditorCanvas/useSlashItems.tsx b/src/app/[variants]/(main)/agent/profile/features/EditorCanvas/useSlashItems.tsx index 0354b9dfc0..332bad8273 100644 --- a/src/app/[variants]/(main)/agent/profile/features/EditorCanvas/useSlashItems.tsx +++ b/src/app/[variants]/(main)/agent/profile/features/EditorCanvas/useSlashItems.tsx @@ -1,4 +1,4 @@ -import type {SlashOptions} from '@lobehub/editor'; +import { type SlashOptions } from '@lobehub/editor'; import { INSERT_CHECK_LIST_COMMAND, INSERT_HEADING_COMMAND, @@ -6,7 +6,7 @@ import { INSERT_MATH_COMMAND, INSERT_ORDERED_LIST_COMMAND, INSERT_TABLE_COMMAND, - INSERT_UNORDERED_LIST_COMMAND + INSERT_UNORDERED_LIST_COMMAND, } from '@lobehub/editor'; import { Text } from '@lobehub/ui'; import { diff --git a/src/app/[variants]/(main)/agent/profile/features/Header/AgentForkTag.tsx b/src/app/[variants]/(main)/agent/profile/features/Header/AgentForkTag.tsx index bfe1413336..3eb49e32f6 100644 --- a/src/app/[variants]/(main)/agent/profile/features/Header/AgentForkTag.tsx +++ b/src/app/[variants]/(main)/agent/profile/features/Header/AgentForkTag.tsx @@ -9,7 +9,7 @@ import { useNavigate } from 'react-router-dom'; import { marketApiService } from '@/services/marketApi'; import { useAgentStore } from '@/store/agent'; import { agentSelectors } from '@/store/agent/selectors'; -import type { AgentForkSourceResponse } from '@/types/discover'; +import { type AgentForkSourceResponse } from '@/types/discover'; /** * Agent Fork Tag Component 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 c77410466c..3480fe2e98 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 @@ -11,7 +11,7 @@ import { agentChatConfigSelectors, agentSelectors } from '@/store/agent/selector import { useGlobalStore } from '@/store/global'; import { globalGeneralSelectors } from '@/store/global/selectors'; -import type { MarketPublishAction } from './types'; +import { type MarketPublishAction } from './types'; import { generateDefaultChangelog } from './utils'; export interface OriginalAgentInfo { diff --git a/src/app/[variants]/(main)/agent/profile/features/Header/AgentStatusTag.tsx b/src/app/[variants]/(main)/agent/profile/features/Header/AgentStatusTag.tsx index 9bdb28f194..562d189a91 100644 --- a/src/app/[variants]/(main)/agent/profile/features/Header/AgentStatusTag.tsx +++ b/src/app/[variants]/(main)/agent/profile/features/Header/AgentStatusTag.tsx @@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next'; import { marketApiService } from '@/services/marketApi'; import { useAgentStore } from '@/store/agent'; import { agentSelectors } from '@/store/agent/selectors'; -import type { AgentStatus } from '@/types/discover'; +import { type AgentStatus } from '@/types/discover'; /** * Agent Status Tag Component diff --git a/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/MentionList/MentionDropdown.tsx b/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/MentionList/MentionDropdown.tsx index c001f85a79..5e46008957 100644 --- a/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/MentionList/MentionDropdown.tsx +++ b/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/MentionList/MentionDropdown.tsx @@ -1,10 +1,10 @@ -import type {MenuRenderProps} from '@lobehub/editor/es/plugins/slash/react/type'; +import { type MenuRenderProps } from '@lobehub/editor/es/plugins/slash/react/type'; import { Flexbox } from '@lobehub/ui'; import { cssVar } from 'antd-style'; -import type {ReactNode} from 'react'; -import { memo, useEffect, useLayoutEffect, useRef, useState } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useEffect, useLayoutEffect, useRef, useState } from 'react'; -import type {MentionListOption} from './types'; +import { type MentionListOption } from './types'; /** * Get cursor position from browser selection API diff --git a/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/MentionList/types.ts b/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/MentionList/types.ts index 7a41ea948a..2aa3f0cdc4 100644 --- a/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/MentionList/types.ts +++ b/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/MentionList/types.ts @@ -1,5 +1,5 @@ -import type { API } from '@lobechat/prompts'; -import type { DropdownItem } from '@lobehub/ui'; +import { type API } from '@lobechat/prompts'; +import { type DropdownItem } from '@lobehub/ui'; export type MentionEntityType = 'collection' | 'api'; diff --git a/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/MentionList/useMentionItems.tsx b/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/MentionList/useMentionItems.tsx index 779a9f4a30..073ba70c74 100644 --- a/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/MentionList/useMentionItems.tsx +++ b/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/MentionList/useMentionItems.tsx @@ -1,11 +1,11 @@ -import type {KlavisServerType} from '@lobechat/const'; -import { KLAVIS_SERVER_TYPES } from '@lobechat/const'; +import { type KlavisServerType } from '@lobechat/const'; +import { KLAVIS_SERVER_TYPES } from '@lobechat/const'; import { ToolNameResolver } from '@lobechat/context-engine'; -import type {API} from '@lobechat/prompts'; -import { apiPrompt, toolPrompt } from '@lobechat/prompts'; -import type {LobeChatPluginManifest} from '@lobehub/chat-plugin-sdk'; -import type {IEditor} from '@lobehub/editor'; -import { INSERT_MENTION_COMMAND } from '@lobehub/editor'; +import { type API } from '@lobechat/prompts'; +import { apiPrompt, toolPrompt } from '@lobechat/prompts'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; +import { type IEditor } from '@lobehub/editor'; +import { INSERT_MENTION_COMMAND } from '@lobehub/editor'; import { Icon, Image } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import isEqual from 'fast-deep-equal'; @@ -19,7 +19,7 @@ import { toolSelectors } from '@/store/tool/selectors'; import { hydrationPrompt } from '@/utils/promptTemplate'; import MentionDropdown from './MentionDropdown'; -import type {MentionListOption, MentionMetadata} from './types'; +import { type MentionListOption, type MentionMetadata } from './types'; // 根据 identifier 获取 Klavis 服务器类型配置 const getKlavisServerType = (identifier: string) => diff --git a/src/app/[variants]/(main)/agent/profile/features/ProfileProvider.tsx b/src/app/[variants]/(main)/agent/profile/features/ProfileProvider.tsx index 01abbcf302..b964ccb35f 100644 --- a/src/app/[variants]/(main)/agent/profile/features/ProfileProvider.tsx +++ b/src/app/[variants]/(main)/agent/profile/features/ProfileProvider.tsx @@ -1,10 +1,10 @@ 'use client'; import { useEditor } from '@lobehub/editor/react'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { memo } from 'react'; -import { createStore,Provider } from './store'; +import { createStore, Provider } from './store'; import StoreUpdater from './StoreUpdater'; const ProfileProvider = memo(({ children }) => { diff --git a/src/app/[variants]/(main)/agent/profile/features/StoreUpdater.tsx b/src/app/[variants]/(main)/agent/profile/features/StoreUpdater.tsx index 74765ab51b..d803d8b671 100644 --- a/src/app/[variants]/(main)/agent/profile/features/StoreUpdater.tsx +++ b/src/app/[variants]/(main)/agent/profile/features/StoreUpdater.tsx @@ -3,8 +3,8 @@ import { useEditorState } from '@lobehub/editor/react'; import { memo, useEffect } from 'react'; -import type {PublicState} from './store'; -import { useProfileStore, useStoreApi } from './store'; +import { type PublicState } from './store'; +import { useProfileStore, useStoreApi } from './store'; export type StoreUpdaterProps = Partial; diff --git a/src/app/[variants]/(main)/agent/profile/features/store/action.ts b/src/app/[variants]/(main)/agent/profile/features/store/action.ts index fd6e1bdb57..bf4193d392 100644 --- a/src/app/[variants]/(main)/agent/profile/features/store/action.ts +++ b/src/app/[variants]/(main)/agent/profile/features/store/action.ts @@ -1,8 +1,8 @@ import { EDITOR_DEBOUNCE_TIME, EDITOR_MAX_WAIT } from '@lobechat/const'; import { debounce } from 'es-toolkit/compat'; -import type {StateCreator} from 'zustand'; +import { type StateCreator } from 'zustand'; -import type {State} from './initialState'; +import { type State } from './initialState'; import { initialState } from './initialState'; type SaveConfigPayload = { diff --git a/src/app/[variants]/(main)/agent/profile/features/store/index.ts b/src/app/[variants]/(main)/agent/profile/features/store/index.ts index bd36d2b3ea..fa1412c4b2 100644 --- a/src/app/[variants]/(main)/agent/profile/features/store/index.ts +++ b/src/app/[variants]/(main)/agent/profile/features/store/index.ts @@ -1,14 +1,14 @@ 'use client'; -import type {StoreApiWithSelector} from '@lobechat/types'; +import { type StoreApiWithSelector } from '@lobechat/types'; import { subscribeWithSelector } from 'zustand/middleware'; import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; import { createContext } from 'zustand-utils'; -import type {Store} from './action'; -import { store } from './action'; -import type {State} from './initialState'; +import { type Store } from './action'; +import { store } from './action'; +import { type State } from './initialState'; export type { PublicState, State } from './initialState'; diff --git a/src/app/[variants]/(main)/agent/profile/features/store/initialState.ts b/src/app/[variants]/(main)/agent/profile/features/store/initialState.ts index 9848a6bb30..0549c27e8c 100644 --- a/src/app/[variants]/(main)/agent/profile/features/store/initialState.ts +++ b/src/app/[variants]/(main)/agent/profile/features/store/initialState.ts @@ -1,7 +1,6 @@ -import type {IEditor} from '@lobehub/editor'; -import type {EditorState} from '@lobehub/editor/react'; +import { type IEditor } from '@lobehub/editor'; +import { type EditorState } from '@lobehub/editor/react'; - export interface PublicState {} export interface State extends PublicState { diff --git a/src/app/[variants]/(main)/agent/profile/features/store/selectors.ts b/src/app/[variants]/(main)/agent/profile/features/store/selectors.ts index 6d41e6eb84..28114a63a6 100644 --- a/src/app/[variants]/(main)/agent/profile/features/store/selectors.ts +++ b/src/app/[variants]/(main)/agent/profile/features/store/selectors.ts @@ -1,4 +1,4 @@ -import type {Store} from './action'; +import { type Store } from './action'; export const selectors = { editor: (s: Store) => s.editor, diff --git a/src/app/[variants]/(main)/agent/profile/index.tsx b/src/app/[variants]/(main)/agent/profile/index.tsx index 2226ec51e5..6009cb2d73 100644 --- a/src/app/[variants]/(main)/agent/profile/index.tsx +++ b/src/app/[variants]/(main)/agent/profile/index.tsx @@ -1,8 +1,8 @@ 'use client'; import { Flexbox } from '@lobehub/ui'; -import type {FC} from 'react'; -import { memo,Suspense } from 'react'; +import { type FC } from 'react'; +import { memo, Suspense } from 'react'; import Loading from '@/components/Loading/BrandTextLoading'; import AgentBuilder from '@/features/AgentBuilder'; diff --git a/src/app/[variants]/(main)/community/(detail)/agent/features/DetailProvider.tsx b/src/app/[variants]/(main)/community/(detail)/agent/features/DetailProvider.tsx index 1141089045..d7d58f3b77 100644 --- a/src/app/[variants]/(main)/community/(detail)/agent/features/DetailProvider.tsx +++ b/src/app/[variants]/(main)/community/(detail)/agent/features/DetailProvider.tsx @@ -1,9 +1,9 @@ 'use client'; -import type {ReactNode} from 'react'; -import { createContext, memo, use } from 'react'; +import { type ReactNode } from 'react'; +import { createContext, memo, use } from 'react'; -import type {DiscoverAssistantDetail} from '@/types/discover'; +import { type DiscoverAssistantDetail } from '@/types/discover'; export type DetailContextConfig = Partial; diff --git a/src/app/[variants]/(main)/community/(detail)/agent/features/Details/Capabilities/Block.tsx b/src/app/[variants]/(main)/community/(detail)/agent/features/Details/Capabilities/Block.tsx index efa26acab2..997bea56a5 100644 --- a/src/app/[variants]/(main)/community/(detail)/agent/features/Details/Capabilities/Block.tsx +++ b/src/app/[variants]/(main)/community/(detail)/agent/features/Details/Capabilities/Block.tsx @@ -1,5 +1,5 @@ import { Flexbox, Tag } from '@lobehub/ui'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import Title from '../../../../../features/Title'; diff --git a/src/app/[variants]/(main)/community/(detail)/agent/features/Details/Overview/TagList.tsx b/src/app/[variants]/(main)/community/(detail)/agent/features/Details/Overview/TagList.tsx index 712a6bbf78..5fbdb8023f 100644 --- a/src/app/[variants]/(main)/community/(detail)/agent/features/Details/Overview/TagList.tsx +++ b/src/app/[variants]/(main)/community/(detail)/agent/features/Details/Overview/TagList.tsx @@ -7,7 +7,7 @@ import { memo } from 'react'; import { Link } from 'react-router-dom'; import { useQuery } from '@/hooks/useQuery'; -import type {AssistantMarketSource} from '@/types/discover'; +import { type AssistantMarketSource } from '@/types/discover'; const styles = createStaticStyles(({ cssVar, css }) => { return { diff --git a/src/app/[variants]/(main)/community/(detail)/agent/features/Details/Related/index.tsx b/src/app/[variants]/(main)/community/(detail)/agent/features/Details/Related/index.tsx index 0ba152c11b..ef8d4810b5 100644 --- a/src/app/[variants]/(main)/community/(detail)/agent/features/Details/Related/index.tsx +++ b/src/app/[variants]/(main)/community/(detail)/agent/features/Details/Related/index.tsx @@ -4,7 +4,7 @@ import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { useQuery } from '@/hooks/useQuery'; -import type {AssistantMarketSource} from '@/types/discover'; +import { type AssistantMarketSource } from '@/types/discover'; import McpList from '../../../../../(list)/agent/features/List'; import Title from '../../../../../features/Title'; diff --git a/src/app/[variants]/(main)/community/(detail)/agent/features/Details/SystemRole/TagList.tsx b/src/app/[variants]/(main)/community/(detail)/agent/features/Details/SystemRole/TagList.tsx index 712a6bbf78..5fbdb8023f 100644 --- a/src/app/[variants]/(main)/community/(detail)/agent/features/Details/SystemRole/TagList.tsx +++ b/src/app/[variants]/(main)/community/(detail)/agent/features/Details/SystemRole/TagList.tsx @@ -7,7 +7,7 @@ import { memo } from 'react'; import { Link } from 'react-router-dom'; import { useQuery } from '@/hooks/useQuery'; -import type {AssistantMarketSource} from '@/types/discover'; +import { type AssistantMarketSource } from '@/types/discover'; const styles = createStaticStyles(({ cssVar, css }) => { return { diff --git a/src/app/[variants]/(main)/community/(detail)/agent/features/Details/Versions/index.tsx b/src/app/[variants]/(main)/community/(detail)/agent/features/Details/Versions/index.tsx index 5010e20142..f56f850ace 100644 --- a/src/app/[variants]/(main)/community/(detail)/agent/features/Details/Versions/index.tsx +++ b/src/app/[variants]/(main)/community/(detail)/agent/features/Details/Versions/index.tsx @@ -9,8 +9,8 @@ import InlineTable from '@/components/InlineTable'; import PublishedTime from '@/components/PublishedTime'; import Link from '@/libs/router/Link'; import { usePathname, useQuery } from '@/libs/router/navigation'; -import type {AssistantMarketSource} from '@/types/discover'; -import { AssistantNavKey } from '@/types/discover'; +import { type AssistantMarketSource } from '@/types/discover'; +import { AssistantNavKey } from '@/types/discover'; import Title from '../../../../../features/Title'; import { useDetailContext } from '../../DetailProvider'; diff --git a/src/app/[variants]/(main)/community/(detail)/agent/features/Sidebar/Related/Item.tsx b/src/app/[variants]/(main)/community/(detail)/agent/features/Sidebar/Related/Item.tsx index e9f0391c66..e9e4306b6d 100644 --- a/src/app/[variants]/(main)/community/(detail)/agent/features/Sidebar/Related/Item.tsx +++ b/src/app/[variants]/(main)/community/(detail)/agent/features/Sidebar/Related/Item.tsx @@ -2,7 +2,7 @@ import { Avatar, Block, Flexbox, Text } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { memo } from 'react'; -import type {DiscoverAssistantItem} from '@/types/discover'; +import { type DiscoverAssistantItem } from '@/types/discover'; const styles = createStaticStyles(({ css, cssVar }) => { return { diff --git a/src/app/[variants]/(main)/community/(detail)/agent/features/Sidebar/Related/index.tsx b/src/app/[variants]/(main)/community/(detail)/agent/features/Sidebar/Related/index.tsx index f91c1b5ca6..675b6164db 100644 --- a/src/app/[variants]/(main)/community/(detail)/agent/features/Sidebar/Related/index.tsx +++ b/src/app/[variants]/(main)/community/(detail)/agent/features/Sidebar/Related/index.tsx @@ -6,7 +6,7 @@ import { Link } from 'react-router-dom'; import urlJoin from 'url-join'; import { useQuery } from '@/hooks/useQuery'; -import type {AssistantMarketSource} from '@/types/discover'; +import { type AssistantMarketSource } from '@/types/discover'; import Title from '../../../../../features/Title'; import { useDetailContext } from '../../DetailProvider'; diff --git a/src/app/[variants]/(main)/community/(detail)/agent/features/Sidebar/TocList/index.tsx b/src/app/[variants]/(main)/community/(detail)/agent/features/Sidebar/TocList/index.tsx index 71fe05acfc..d72ca7e9de 100644 --- a/src/app/[variants]/(main)/community/(detail)/agent/features/Sidebar/TocList/index.tsx +++ b/src/app/[variants]/(main)/community/(detail)/agent/features/Sidebar/TocList/index.tsx @@ -1,7 +1,7 @@ 'use client'; import { Flexbox } from '@lobehub/ui'; -import type {AnchorProps} from 'antd'; +import { type AnchorProps } from 'antd'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/community/(detail)/agent/index.tsx b/src/app/[variants]/(main)/community/(detail)/agent/index.tsx index aab34520f9..4a7eefa2b3 100644 --- a/src/app/[variants]/(main)/community/(detail)/agent/index.tsx +++ b/src/app/[variants]/(main)/community/(detail)/agent/index.tsx @@ -6,7 +6,7 @@ import { useParams } from 'react-router-dom'; import { useQuery } from '@/hooks/useQuery'; import { useDiscoverStore } from '@/store/discover'; -import type {AssistantMarketSource} from '@/types/discover'; +import { type AssistantMarketSource } from '@/types/discover'; import NotFound from '../components/NotFound'; import { TocProvider } from '../features/Toc/useToc'; diff --git a/src/app/[variants]/(main)/community/(detail)/features/Back.tsx b/src/app/[variants]/(main)/community/(detail)/features/Back.tsx index ce2c2b13c8..d6377047b8 100644 --- a/src/app/[variants]/(main)/community/(detail)/features/Back.tsx +++ b/src/app/[variants]/(main)/community/(detail)/features/Back.tsx @@ -3,8 +3,8 @@ import { Flexbox, Icon } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { ArrowLeft } from 'lucide-react'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; diff --git a/src/app/[variants]/(main)/community/(detail)/features/Block.tsx b/src/app/[variants]/(main)/community/(detail)/features/Block.tsx index 62286a1af7..dc16fc087b 100644 --- a/src/app/[variants]/(main)/community/(detail)/features/Block.tsx +++ b/src/app/[variants]/(main)/community/(detail)/features/Block.tsx @@ -1,5 +1,5 @@ -import type {FlexboxProps} from '@lobehub/ui'; -import { Button, Flexbox, Icon } from '@lobehub/ui'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Button, Flexbox, Icon } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { ChevronRight } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/app/[variants]/(main)/community/(detail)/features/Breadcrumb.tsx b/src/app/[variants]/(main)/community/(detail)/features/Breadcrumb.tsx index 85a991cbe7..8896cc7e65 100644 --- a/src/app/[variants]/(main)/community/(detail)/features/Breadcrumb.tsx +++ b/src/app/[variants]/(main)/community/(detail)/features/Breadcrumb.tsx @@ -1,8 +1,8 @@ 'use client'; import { CopyButton, Flexbox } from '@lobehub/ui'; -import type {BreadcrumbProps} from 'antd'; -import { Breadcrumb as AntdBreadcrumb } from 'antd'; +import { type BreadcrumbProps } from 'antd'; +import { Breadcrumb as AntdBreadcrumb } from 'antd'; import { cssVar } from 'antd-style'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/community/(detail)/features/DetailLayout.tsx b/src/app/[variants]/(main)/community/(detail)/features/DetailLayout.tsx index 2f9d6aec02..d3f9d80ad6 100644 --- a/src/app/[variants]/(main)/community/(detail)/features/DetailLayout.tsx +++ b/src/app/[variants]/(main)/community/(detail)/features/DetailLayout.tsx @@ -2,7 +2,7 @@ import { Flexbox } from '@lobehub/ui'; import { useResponsive } from 'antd-style'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import Footer from '@/features/Setting/Footer'; diff --git a/src/app/[variants]/(main)/community/(detail)/features/HighlightBlock.tsx b/src/app/[variants]/(main)/community/(detail)/features/HighlightBlock.tsx index c008c92074..70e29e0ef3 100644 --- a/src/app/[variants]/(main)/community/(detail)/features/HighlightBlock.tsx +++ b/src/app/[variants]/(main)/community/(detail)/features/HighlightBlock.tsx @@ -1,10 +1,10 @@ 'use client'; -import type {FlexboxProps} from '@lobehub/ui'; -import { Flexbox, Icon } from '@lobehub/ui'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Flexbox, Icon } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; -import type {LucideIcon} from 'lucide-react'; -import type {ReactNode} from 'react'; +import { type LucideIcon } from 'lucide-react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import { useServerConfigStore } from '@/store/serverConfig'; diff --git a/src/app/[variants]/(main)/community/(detail)/features/MakedownRender.tsx b/src/app/[variants]/(main)/community/(detail)/features/MakedownRender.tsx index dab651a0bb..14963a4028 100644 --- a/src/app/[variants]/(main)/community/(detail)/features/MakedownRender.tsx +++ b/src/app/[variants]/(main)/community/(detail)/features/MakedownRender.tsx @@ -2,7 +2,7 @@ import { Center, Empty, Markdown } from '@lobehub/ui'; import { FileText } from 'lucide-react'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -43,7 +43,6 @@ const MarkdownRender = memo<{ children?: string }>(({ children }) => { if (typeof src !== 'string') return null; if (src.includes('glama.ai')) return null; - if (src.startsWith('http')) return ; return null; }, diff --git a/src/app/[variants]/(main)/community/(detail)/features/ShareButton.tsx b/src/app/[variants]/(main)/community/(detail)/features/ShareButton.tsx index b27e5b1231..5295c781eb 100644 --- a/src/app/[variants]/(main)/community/(detail)/features/ShareButton.tsx +++ b/src/app/[variants]/(main)/community/(detail)/features/ShareButton.tsx @@ -1,4 +1,4 @@ -import type {ButtonProps} from '@lobehub/ui'; +import { type ButtonProps } from '@lobehub/ui'; import { ActionIcon, Avatar, @@ -10,13 +10,13 @@ import { Modal, Skeleton, Tag, - Text + Text, } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; import { startCase } from 'es-toolkit/compat'; import { LinkIcon, Share2Icon } from 'lucide-react'; -import type {ReactNode} from 'react'; -import { memo, useState } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useShare } from '@/hooks/useShare'; diff --git a/src/app/[variants]/(main)/community/(detail)/features/SidebarContainer.tsx b/src/app/[variants]/(main)/community/(detail)/features/SidebarContainer.tsx index cb5baf16fe..1a1b71f31f 100644 --- a/src/app/[variants]/(main)/community/(detail)/features/SidebarContainer.tsx +++ b/src/app/[variants]/(main)/community/(detail)/features/SidebarContainer.tsx @@ -1,6 +1,6 @@ -import type {FlexboxProps} from '@lobehub/ui'; -import { Flexbox } from '@lobehub/ui'; -import type {FC} from 'react'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Flexbox } from '@lobehub/ui'; +import { type FC } from 'react'; const SidebarContainer: FC = ({ children, style, ...rest }) => { return ( diff --git a/src/app/[variants]/(main)/community/(detail)/features/Toc/Heading.tsx b/src/app/[variants]/(main)/community/(detail)/features/Toc/Heading.tsx index e7a42d591b..ed818bdb73 100644 --- a/src/app/[variants]/(main)/community/(detail)/features/Toc/Heading.tsx +++ b/src/app/[variants]/(main)/community/(detail)/features/Toc/Heading.tsx @@ -4,13 +4,8 @@ import { Icon } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import { kebabCase } from 'es-toolkit/compat'; import { Heading2, Heading3, Heading4, Heading5 } from 'lucide-react'; -import type {ComponentProps, FC, ReactNode} from 'react'; -import { - Children, - isValidElement, - useEffect, - useMemo -} from 'react'; +import { type ComponentProps, type FC, type ReactNode } from 'react'; +import { Children, isValidElement, useEffect, useMemo } from 'react'; import { useToc } from './useToc'; diff --git a/src/app/[variants]/(main)/community/(detail)/features/Toc/index.tsx b/src/app/[variants]/(main)/community/(detail)/features/Toc/index.tsx index 77a34df593..1e54339c39 100644 --- a/src/app/[variants]/(main)/community/(detail)/features/Toc/index.tsx +++ b/src/app/[variants]/(main)/community/(detail)/features/Toc/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {AnchorProps} from 'antd'; -import { Anchor } from 'antd'; +import { type AnchorProps } from 'antd'; +import { Anchor } from 'antd'; import { createStaticStyles, cx, responsive } from 'antd-style'; import { memo, useMemo } from 'react'; diff --git a/src/app/[variants]/(main)/community/(detail)/features/Toc/useToc.tsx b/src/app/[variants]/(main)/community/(detail)/features/Toc/useToc.tsx index a89903c763..60b4d23b16 100644 --- a/src/app/[variants]/(main)/community/(detail)/features/Toc/useToc.tsx +++ b/src/app/[variants]/(main)/community/(detail)/features/Toc/useToc.tsx @@ -1,9 +1,9 @@ 'use client'; -import type { AnchorProps } from 'antd'; +import { type AnchorProps } from 'antd'; import { unionBy } from 'es-toolkit/compat'; -import type {FC, PropsWithChildren} from 'react'; -import { createContext, use, useState } from 'react'; +import { type FC, type PropsWithChildren } from 'react'; +import { createContext, use, useState } from 'react'; interface TocState { isLoading: boolean; diff --git a/src/app/[variants]/(main)/community/(detail)/group_agent/features/DetailProvider.tsx b/src/app/[variants]/(main)/community/(detail)/group_agent/features/DetailProvider.tsx index bc6c0acc03..bef1e1b83a 100644 --- a/src/app/[variants]/(main)/community/(detail)/group_agent/features/DetailProvider.tsx +++ b/src/app/[variants]/(main)/community/(detail)/group_agent/features/DetailProvider.tsx @@ -1,9 +1,9 @@ 'use client'; -import type {ReactNode} from 'react'; -import { createContext, memo, use } from 'react'; +import { type ReactNode } from 'react'; +import { createContext, memo, use } from 'react'; -import type {DiscoverGroupAgentDetail} from '@/types/discover'; +import { type DiscoverGroupAgentDetail } from '@/types/discover'; export type DetailContextConfig = Partial; diff --git a/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Related/index.tsx b/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Related/index.tsx index 605d3b1584..4e16a8e11b 100644 --- a/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Related/index.tsx +++ b/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Related/index.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; import urlJoin from 'url-join'; -import type {DiscoverGroupAgentItem} from '@/types/discover'; +import { type DiscoverGroupAgentItem } from '@/types/discover'; import Title from '../../../../../features/Title'; import { useDetailContext } from '../../DetailProvider'; diff --git a/src/app/[variants]/(main)/community/(detail)/mcp/features/Sidebar/Related/Item.tsx b/src/app/[variants]/(main)/community/(detail)/mcp/features/Sidebar/Related/Item.tsx index 8a4c476951..7727f59cfa 100644 --- a/src/app/[variants]/(main)/community/(detail)/mcp/features/Sidebar/Related/Item.tsx +++ b/src/app/[variants]/(main)/community/(detail)/mcp/features/Sidebar/Related/Item.tsx @@ -2,7 +2,7 @@ import { Avatar, Block, Flexbox, Text } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { memo } from 'react'; -import type {DiscoverMcpItem} from '@/types/discover'; +import { type DiscoverMcpItem } from '@/types/discover'; const styles = createStaticStyles(({ css, cssVar }) => { return { diff --git a/src/app/[variants]/(main)/community/(detail)/mcp/features/Sidebar/TocList/index.tsx b/src/app/[variants]/(main)/community/(detail)/mcp/features/Sidebar/TocList/index.tsx index 4f672a8394..8b1d8644be 100644 --- a/src/app/[variants]/(main)/community/(detail)/mcp/features/Sidebar/TocList/index.tsx +++ b/src/app/[variants]/(main)/community/(detail)/mcp/features/Sidebar/TocList/index.tsx @@ -1,7 +1,7 @@ 'use client'; import { Flexbox } from '@lobehub/ui'; -import type {AnchorProps} from 'antd'; +import { type AnchorProps } from 'antd'; import { startCase } from 'es-toolkit/compat'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/community/(detail)/model/features/DetailProvider.tsx b/src/app/[variants]/(main)/community/(detail)/model/features/DetailProvider.tsx index 16f2ec74c7..92a8136477 100644 --- a/src/app/[variants]/(main)/community/(detail)/model/features/DetailProvider.tsx +++ b/src/app/[variants]/(main)/community/(detail)/model/features/DetailProvider.tsx @@ -1,9 +1,9 @@ 'use client'; -import type {ReactNode} from 'react'; -import { createContext, memo, use } from 'react'; +import { type ReactNode } from 'react'; +import { createContext, memo, use } from 'react'; -import type {DiscoverModelDetail} from '@/types/discover'; +import { type DiscoverModelDetail } from '@/types/discover'; export type DetailContextConfig = Partial; diff --git a/src/app/[variants]/(main)/community/(detail)/model/features/Details/Parameter/index.tsx b/src/app/[variants]/(main)/community/(detail)/model/features/Details/Parameter/index.tsx index d806774888..d42b1daea6 100644 --- a/src/app/[variants]/(main)/community/(detail)/model/features/Details/Parameter/index.tsx +++ b/src/app/[variants]/(main)/community/(detail)/model/features/Details/Parameter/index.tsx @@ -1,14 +1,14 @@ 'use client'; import { Collapse, Flexbox, Icon, Tag } from '@lobehub/ui'; -import type {LucideIcon} from 'lucide-react'; +import { type LucideIcon } from 'lucide-react'; import { ChartColumnBig, Delete, FileMinus, MessageSquareText, Pickaxe, - Thermometer + Thermometer, } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/community/(detail)/model/features/Sidebar/Related/Item.tsx b/src/app/[variants]/(main)/community/(detail)/model/features/Sidebar/Related/Item.tsx index 39704dd7ca..58783f4b24 100644 --- a/src/app/[variants]/(main)/community/(detail)/model/features/Sidebar/Related/Item.tsx +++ b/src/app/[variants]/(main)/community/(detail)/model/features/Sidebar/Related/Item.tsx @@ -4,7 +4,7 @@ import { createStaticStyles } from 'antd-style'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {DiscoverModelItem} from '@/types/discover'; +import { type DiscoverModelItem } from '@/types/discover'; const styles = createStaticStyles(({ css, cssVar }) => { return { diff --git a/src/app/[variants]/(main)/community/(detail)/model/features/Sidebar/RelatedProviders/Item.tsx b/src/app/[variants]/(main)/community/(detail)/model/features/Sidebar/RelatedProviders/Item.tsx index 0df08680c3..57d436b3ee 100644 --- a/src/app/[variants]/(main)/community/(detail)/model/features/Sidebar/RelatedProviders/Item.tsx +++ b/src/app/[variants]/(main)/community/(detail)/model/features/Sidebar/RelatedProviders/Item.tsx @@ -4,7 +4,7 @@ import { createStaticStyles } from 'antd-style'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {DiscoverModelDetailProviderItem} from '@/types/discover'; +import { type DiscoverModelDetailProviderItem } from '@/types/discover'; const styles = createStaticStyles(({ css, cssVar }) => { return { diff --git a/src/app/[variants]/(main)/community/(detail)/provider/features/DetailProvider.tsx b/src/app/[variants]/(main)/community/(detail)/provider/features/DetailProvider.tsx index 602d719b07..da8231a154 100644 --- a/src/app/[variants]/(main)/community/(detail)/provider/features/DetailProvider.tsx +++ b/src/app/[variants]/(main)/community/(detail)/provider/features/DetailProvider.tsx @@ -1,9 +1,9 @@ 'use client'; -import type {ReactNode} from 'react'; -import { createContext, memo, use } from 'react'; +import { type ReactNode } from 'react'; +import { createContext, memo, use } from 'react'; -import type {DiscoverProviderDetail} from '@/types/discover'; +import { type DiscoverProviderDetail } from '@/types/discover'; export type DetailContextConfig = Partial; diff --git a/src/app/[variants]/(main)/community/(detail)/provider/features/Sidebar/Related/Item.tsx b/src/app/[variants]/(main)/community/(detail)/provider/features/Sidebar/Related/Item.tsx index 49f35708a4..65d7054b13 100644 --- a/src/app/[variants]/(main)/community/(detail)/provider/features/Sidebar/Related/Item.tsx +++ b/src/app/[variants]/(main)/community/(detail)/provider/features/Sidebar/Related/Item.tsx @@ -4,7 +4,7 @@ import { createStaticStyles } from 'antd-style'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {DiscoverProviderItem} from '@/types/discover'; +import { type DiscoverProviderItem } from '@/types/discover'; const styles = createStaticStyles(({ css, cssVar }) => { return { diff --git a/src/app/[variants]/(main)/community/(detail)/provider/features/Sidebar/RelatedModels/Item.tsx b/src/app/[variants]/(main)/community/(detail)/provider/features/Sidebar/RelatedModels/Item.tsx index 0818967869..5d48be55e0 100644 --- a/src/app/[variants]/(main)/community/(detail)/provider/features/Sidebar/RelatedModels/Item.tsx +++ b/src/app/[variants]/(main)/community/(detail)/provider/features/Sidebar/RelatedModels/Item.tsx @@ -4,7 +4,7 @@ import { createStaticStyles } from 'antd-style'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {DiscoverProviderDetailModelItem} from '@/types/discover'; +import { type DiscoverProviderDetailModelItem } from '@/types/discover'; const styles = createStaticStyles(({ css, cssVar }) => { return { diff --git a/src/app/[variants]/(main)/community/(detail)/user/features/DetailProvider.tsx b/src/app/[variants]/(main)/community/(detail)/user/features/DetailProvider.tsx index ab86e5667e..91112e6776 100644 --- a/src/app/[variants]/(main)/community/(detail)/user/features/DetailProvider.tsx +++ b/src/app/[variants]/(main)/community/(detail)/user/features/DetailProvider.tsx @@ -1,10 +1,14 @@ 'use client'; -import type {ReactNode} from 'react'; -import { createContext, memo, use } from 'react'; +import { type ReactNode } from 'react'; +import { createContext, memo, use } from 'react'; -import type {MarketUserProfile} from '@/layout/AuthProvider/MarketAuth/types'; -import type {DiscoverAssistantItem, DiscoverGroupAgentItem, DiscoverUserInfo} from '@/types/discover'; +import { type MarketUserProfile } from '@/layout/AuthProvider/MarketAuth/types'; +import { + type DiscoverAssistantItem, + type DiscoverGroupAgentItem, + type DiscoverUserInfo, +} from '@/types/discover'; export interface UserDetailContextConfig { agentCount: number; 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 9affaf600e..d199b5a9d2 100644 --- a/src/app/[variants]/(main)/community/(detail)/user/features/UserAgentCard.tsx +++ b/src/app/[variants]/(main)/community/(detail)/user/features/UserAgentCard.tsx @@ -36,7 +36,7 @@ import { agentService } from '@/services/agent'; import { discoverService } from '@/services/discover'; import { useAgentStore } from '@/store/agent'; import { useHomeStore } from '@/store/home'; -import type {AgentStatus, DiscoverAssistantItem} from '@/types/discover'; +import { type AgentStatus, type DiscoverAssistantItem } from '@/types/discover'; import { formatIntergerNumber } from '@/utils/format'; import { useUserDetailContext } from './DetailProvider'; 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 2dc05badd0..f9ee0a930b 100644 --- a/src/app/[variants]/(main)/community/(detail)/user/features/UserFavoriteAgents.tsx +++ b/src/app/[variants]/(main)/community/(detail)/user/features/UserFavoriteAgents.tsx @@ -12,8 +12,8 @@ import urlJoin from 'url-join'; import PublishedTime from '@/components/PublishedTime'; import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth'; -import type {FavoriteAgentItem} from '@/services/social'; -import { socialService } from '@/services/social'; +import { type FavoriteAgentItem } from '@/services/social'; +import { socialService } from '@/services/social'; import { useDiscoverStore } from '@/store/discover'; import { formatIntergerNumber } from '@/utils/format'; 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 e98af9cb08..b47669a6ab 100644 --- a/src/app/[variants]/(main)/community/(detail)/user/features/UserFavoritePlugins.tsx +++ b/src/app/[variants]/(main)/community/(detail)/user/features/UserFavoritePlugins.tsx @@ -12,8 +12,8 @@ import urlJoin from 'url-join'; import PublishedTime from '@/components/PublishedTime'; import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth'; -import type {FavoritePluginItem} from '@/services/social'; -import { socialService } from '@/services/social'; +import { type FavoritePluginItem } from '@/services/social'; +import { socialService } from '@/services/social'; import { useDiscoverStore } from '@/store/discover'; import { useUserDetailContext } from './DetailProvider'; diff --git a/src/app/[variants]/(main)/community/(detail)/user/features/UserForkedAgentGroups.tsx b/src/app/[variants]/(main)/community/(detail)/user/features/UserForkedAgentGroups.tsx index f8c9c9ab99..7bdc313aa3 100644 --- a/src/app/[variants]/(main)/community/(detail)/user/features/UserForkedAgentGroups.tsx +++ b/src/app/[variants]/(main)/community/(detail)/user/features/UserForkedAgentGroups.tsx @@ -6,7 +6,7 @@ import { GitForkIcon } from 'lucide-react'; import { memo, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import type {DiscoverGroupAgentItem} from '@/types/discover'; +import { type DiscoverGroupAgentItem } from '@/types/discover'; import UserGroupCard from './UserGroupCard'; diff --git a/src/app/[variants]/(main)/community/(detail)/user/features/UserForkedAgents.tsx b/src/app/[variants]/(main)/community/(detail)/user/features/UserForkedAgents.tsx index e6a19754f3..348aa43d76 100644 --- a/src/app/[variants]/(main)/community/(detail)/user/features/UserForkedAgents.tsx +++ b/src/app/[variants]/(main)/community/(detail)/user/features/UserForkedAgents.tsx @@ -6,7 +6,7 @@ import { GitForkIcon } from 'lucide-react'; import { memo, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import type {DiscoverAssistantItem} from '@/types/discover'; +import { type DiscoverAssistantItem } from '@/types/discover'; import UserAgentCard from './UserAgentCard'; 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 78caafe2e1..c4c68db0a9 100644 --- a/src/app/[variants]/(main)/community/(detail)/user/features/UserGroupCard.tsx +++ b/src/app/[variants]/(main)/community/(detail)/user/features/UserGroupCard.tsx @@ -31,7 +31,7 @@ import { Link, useNavigate } from 'react-router-dom'; import urlJoin from 'url-join'; import PublishedTime from '@/components/PublishedTime'; -import type {DiscoverGroupAgentItem, GroupAgentStatus} from '@/types/discover'; +import { type DiscoverGroupAgentItem, type GroupAgentStatus } from '@/types/discover'; import { formatIntergerNumber } from '@/utils/format'; import { useUserDetailContext } from './DetailProvider'; diff --git a/src/app/[variants]/(main)/community/(detail)/user/index.tsx b/src/app/[variants]/(main)/community/(detail)/user/index.tsx index a390df13e7..102970835d 100644 --- a/src/app/[variants]/(main)/community/(detail)/user/index.tsx +++ b/src/app/[variants]/(main)/community/(detail)/user/index.tsx @@ -4,7 +4,7 @@ import { memo, useCallback, useMemo } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; import { useMarketAuth, useMarketUserProfile } from '@/layout/AuthProvider/MarketAuth'; -import type {MarketUserProfile} from '@/layout/AuthProvider/MarketAuth/types'; +import { type MarketUserProfile } from '@/layout/AuthProvider/MarketAuth/types'; import { useDiscoverStore } from '@/store/discover'; import NotFound from '../components/NotFound'; diff --git a/src/app/[variants]/(main)/community/(list)/agent/Client.tsx b/src/app/[variants]/(main)/community/(list)/agent/Client.tsx index 07333f35fb..555b96056c 100644 --- a/src/app/[variants]/(main)/community/(list)/agent/Client.tsx +++ b/src/app/[variants]/(main)/community/(list)/agent/Client.tsx @@ -6,10 +6,8 @@ import { memo } from 'react'; import { withSuspense } from '@/components/withSuspense'; import { useQuery } from '@/hooks/useQuery'; import { useDiscoverStore } from '@/store/discover'; -import type {AssistantMarketSource, AssistantQueryParams} from '@/types/discover'; -import { - DiscoverTab -} from '@/types/discover'; +import { type AssistantMarketSource, type AssistantQueryParams } from '@/types/discover'; +import { DiscoverTab } from '@/types/discover'; import Pagination from '../features/Pagination'; import List from './features/List'; diff --git a/src/app/[variants]/(main)/community/(list)/agent/features/List/Item.tsx b/src/app/[variants]/(main)/community/(list)/agent/features/List/Item.tsx index 9b4333a04f..6aee238a50 100644 --- a/src/app/[variants]/(main)/community/(list)/agent/features/List/Item.tsx +++ b/src/app/[variants]/(main)/community/(list)/agent/features/List/Item.tsx @@ -10,7 +10,7 @@ import urlJoin from 'url-join'; import PublishedTime from '@/components/PublishedTime'; import { useQuery } from '@/hooks/useQuery'; import { discoverService } from '@/services/discover'; -import type {AssistantMarketSource, DiscoverAssistantItem} from '@/types/discover'; +import { type AssistantMarketSource, type DiscoverAssistantItem } from '@/types/discover'; import TokenTag from './TokenTag'; diff --git a/src/app/[variants]/(main)/community/(list)/agent/features/List/index.tsx b/src/app/[variants]/(main)/community/(list)/agent/features/List/index.tsx index ec330a7ba3..0d21390793 100644 --- a/src/app/[variants]/(main)/community/(list)/agent/features/List/index.tsx +++ b/src/app/[variants]/(main)/community/(list)/agent/features/List/index.tsx @@ -3,7 +3,7 @@ import { Grid } from '@lobehub/ui'; import { memo } from 'react'; -import type {DiscoverAssistantItem} from '@/types/discover'; +import { type DiscoverAssistantItem } from '@/types/discover'; import AssistantEmpty from '../../../../features/AssistantEmpty'; import Item from './Item'; diff --git a/src/app/[variants]/(main)/community/(list)/agent/features/MarketSourceSwitch.tsx b/src/app/[variants]/(main)/community/(list)/agent/features/MarketSourceSwitch.tsx index fb287eb85c..9739191760 100644 --- a/src/app/[variants]/(main)/community/(list)/agent/features/MarketSourceSwitch.tsx +++ b/src/app/[variants]/(main)/community/(list)/agent/features/MarketSourceSwitch.tsx @@ -1,18 +1,14 @@ 'use client'; -import type {DropdownItem, DropdownMenuCheckboxItem} from '@lobehub/ui'; -import { - Button, - DropdownMenu, - Icon -} from '@lobehub/ui'; +import { type DropdownItem, type DropdownMenuCheckboxItem } from '@lobehub/ui'; +import { Button, DropdownMenu, Icon } from '@lobehub/ui'; import { ChevronDown, Store } from 'lucide-react'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useQuery } from '@/hooks/useQuery'; import { useQueryRoute } from '@/hooks/useQueryRoute'; -import type {AssistantMarketSource} from '@/types/discover'; +import { type AssistantMarketSource } from '@/types/discover'; const MarketSourceSwitch = memo(() => { const { t } = useTranslation('discover'); diff --git a/src/app/[variants]/(main)/community/(list)/agent/index.tsx b/src/app/[variants]/(main)/community/(list)/agent/index.tsx index c7552ccf3f..c1ff7d5e58 100644 --- a/src/app/[variants]/(main)/community/(list)/agent/index.tsx +++ b/src/app/[variants]/(main)/community/(list)/agent/index.tsx @@ -5,8 +5,8 @@ import { memo } from 'react'; import { useQuery } from '@/hooks/useQuery'; import { useDiscoverStore } from '@/store/discover'; -import type {AssistantQueryParams} from '@/types/discover'; -import { AssistantSorts, DiscoverTab } from '@/types/discover'; +import { type AssistantQueryParams } from '@/types/discover'; +import { AssistantSorts, DiscoverTab } from '@/types/discover'; import Pagination from '../features/Pagination'; import List from './features/List'; diff --git a/src/app/[variants]/(main)/community/(list)/features/Pagination.tsx b/src/app/[variants]/(main)/community/(list)/features/Pagination.tsx index d02918a8ec..eca023a07c 100644 --- a/src/app/[variants]/(main)/community/(list)/features/Pagination.tsx +++ b/src/app/[variants]/(main)/community/(list)/features/Pagination.tsx @@ -7,7 +7,7 @@ import { useLocation, useNavigate } from 'react-router-dom'; import { SCROLL_PARENT_ID } from '@/app/[variants]/(main)/community/features/const'; import { useQuery } from '@/hooks/useQuery'; -import type {DiscoverTab} from '@/types/discover'; +import { type DiscoverTab } from '@/types/discover'; const SCROLL_CONTAINER_ID = 'lobe-mobile-scroll-container'; diff --git a/src/app/[variants]/(main)/community/(list)/features/SortButton/index.tsx b/src/app/[variants]/(main)/community/(list)/features/SortButton/index.tsx index 33d2e0d835..e68d7ace3d 100644 --- a/src/app/[variants]/(main)/community/(list)/features/SortButton/index.tsx +++ b/src/app/[variants]/(main)/community/(list)/features/SortButton/index.tsx @@ -1,9 +1,5 @@ -import type {DropdownItem, DropdownMenuCheckboxItem} from '@lobehub/ui'; -import { - Button, - DropdownMenu, - Icon -} from '@lobehub/ui'; +import { type DropdownItem, type DropdownMenuCheckboxItem } from '@lobehub/ui'; +import { Button, DropdownMenu, Icon } from '@lobehub/ui'; import { ArrowDownWideNarrow, ChevronDown } from 'lucide-react'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; 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 fc2078ff81..4284bcb309 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 @@ -15,7 +15,7 @@ import OfficialIcon from '@/components/OfficialIcon'; import PublishedTime from '@/components/PublishedTime'; import Scores from '@/features/MCP/Scores'; import { discoverService } from '@/services/discover'; -import type {DiscoverMcpItem} from '@/types/discover'; +import { type DiscoverMcpItem } from '@/types/discover'; import ConnectionTypeTag from './ConnectionTypeTag'; import MetaInfo from './MetaInfo'; @@ -80,11 +80,13 @@ const McpItem = memo( const link = urlJoin('/community/mcp', identifier); const handleClick = useCallback(() => { - discoverService.reportMcpEvent({ - event: 'click', - identifier, - source: location.pathname, - }).catch(() => {}); + discoverService + .reportMcpEvent({ + event: 'click', + identifier, + source: location.pathname, + }) + .catch(() => {}); navigate(link); }, [identifier, link, navigate]); diff --git a/src/app/[variants]/(main)/community/(list)/mcp/features/List/MetaInfo.tsx b/src/app/[variants]/(main)/community/(list)/mcp/features/List/MetaInfo.tsx index 9415b11cbd..01e6b64559 100644 --- a/src/app/[variants]/(main)/community/(list)/mcp/features/List/MetaInfo.tsx +++ b/src/app/[variants]/(main)/community/(list)/mcp/features/List/MetaInfo.tsx @@ -1,9 +1,9 @@ import { Flexbox, Icon } from '@lobehub/ui'; import { DownloadIcon, StarIcon } from 'lucide-react'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; -import type {DiscoverMcpItem} from '@/types/discover'; +import { type DiscoverMcpItem } from '@/types/discover'; interface MetaInfoProps { className?: string; diff --git a/src/app/[variants]/(main)/community/(list)/mcp/features/List/index.tsx b/src/app/[variants]/(main)/community/(list)/mcp/features/List/index.tsx index f88e916091..ad81d0424f 100644 --- a/src/app/[variants]/(main)/community/(list)/mcp/features/List/index.tsx +++ b/src/app/[variants]/(main)/community/(list)/mcp/features/List/index.tsx @@ -3,7 +3,7 @@ import { Grid } from '@lobehub/ui'; import { memo } from 'react'; -import type {DiscoverMcpItem} from '@/types/discover'; +import { type DiscoverMcpItem } from '@/types/discover'; import McpEmpty from '../../../../features/McpEmpty'; import Item from './Item'; diff --git a/src/app/[variants]/(main)/community/(list)/mcp/index.tsx b/src/app/[variants]/(main)/community/(list)/mcp/index.tsx index 67f982edef..1f787677d7 100644 --- a/src/app/[variants]/(main)/community/(list)/mcp/index.tsx +++ b/src/app/[variants]/(main)/community/(list)/mcp/index.tsx @@ -5,7 +5,7 @@ import { memo } from 'react'; import { useQuery } from '@/hooks/useQuery'; import { useDiscoverStore } from '@/store/discover'; -import type {McpQueryParams} from '@/types/discover'; +import { type McpQueryParams } from '@/types/discover'; import { DiscoverTab, McpSorts } from '@/types/discover'; import Pagination from '../features/Pagination'; diff --git a/src/app/[variants]/(main)/community/(list)/model/features/List/Item.tsx b/src/app/[variants]/(main)/community/(list)/model/features/List/Item.tsx index 4d28bebc99..d98911bb8a 100644 --- a/src/app/[variants]/(main)/community/(list)/model/features/List/Item.tsx +++ b/src/app/[variants]/(main)/community/(list)/model/features/List/Item.tsx @@ -11,7 +11,7 @@ import { Link, useNavigate } from 'react-router-dom'; import urlJoin from 'url-join'; import { ModelInfoTags } from '@/components/ModelSelect'; -import type {DiscoverModelItem} from '@/types/discover'; +import { type DiscoverModelItem } from '@/types/discover'; import PublishedTime from '../../../../../../../../components/PublishedTime'; import ModelTypeIcon from './ModelTypeIcon'; diff --git a/src/app/[variants]/(main)/community/(list)/model/features/List/ModelTypeIcon.tsx b/src/app/[variants]/(main)/community/(list)/model/features/List/ModelTypeIcon.tsx index 0788bbf2f6..a516c87786 100644 --- a/src/app/[variants]/(main)/community/(list)/model/features/List/ModelTypeIcon.tsx +++ b/src/app/[variants]/(main)/community/(list)/model/features/List/ModelTypeIcon.tsx @@ -1,7 +1,7 @@ import { Icon, Tooltip } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { startCase } from 'es-toolkit/compat'; -import type {LucideIcon} from 'lucide-react'; +import { type LucideIcon } from 'lucide-react'; import { AudioLines, BoltIcon, @@ -10,9 +10,9 @@ import { MicIcon, MusicIcon, PhoneIcon, - VideoIcon + VideoIcon, } from 'lucide-react'; -import type {AiModelType} from 'model-bank'; +import { type AiModelType } from 'model-bank'; import { memo } from 'react'; const icons: Record = { diff --git a/src/app/[variants]/(main)/community/(list)/model/features/List/index.tsx b/src/app/[variants]/(main)/community/(list)/model/features/List/index.tsx index 1f9219dbf6..24bfc00a11 100644 --- a/src/app/[variants]/(main)/community/(list)/model/features/List/index.tsx +++ b/src/app/[variants]/(main)/community/(list)/model/features/List/index.tsx @@ -3,7 +3,7 @@ import { Grid } from '@lobehub/ui'; import { memo } from 'react'; -import type {DiscoverModelItem} from '@/types/discover'; +import { type DiscoverModelItem } from '@/types/discover'; import ModelEmpty from '../../../../features/ModelEmpty'; import Item from './Item'; diff --git a/src/app/[variants]/(main)/community/(list)/model/index.tsx b/src/app/[variants]/(main)/community/(list)/model/index.tsx index daafa5302e..07d1d84193 100644 --- a/src/app/[variants]/(main)/community/(list)/model/index.tsx +++ b/src/app/[variants]/(main)/community/(list)/model/index.tsx @@ -5,8 +5,8 @@ import { memo } from 'react'; import { useQuery } from '@/hooks/useQuery'; import { useDiscoverStore } from '@/store/discover'; -import type {ModelQueryParams} from '@/types/discover'; -import { DiscoverTab } from '@/types/discover'; +import { type ModelQueryParams } from '@/types/discover'; +import { DiscoverTab } from '@/types/discover'; import Pagination from '../features/Pagination'; import List from './features/List'; 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 43510c147c..f426091859 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 @@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next'; import { Link, useNavigate } from 'react-router-dom'; import urlJoin from 'url-join'; -import type {DiscoverProviderItem} from '@/types/discover'; +import { type DiscoverProviderItem } from '@/types/discover'; const styles = createStaticStyles(({ css, cssVar }) => { return { diff --git a/src/app/[variants]/(main)/community/(list)/provider/features/List/index.tsx b/src/app/[variants]/(main)/community/(list)/provider/features/List/index.tsx index d85e50ab4e..1eeae8666b 100644 --- a/src/app/[variants]/(main)/community/(list)/provider/features/List/index.tsx +++ b/src/app/[variants]/(main)/community/(list)/provider/features/List/index.tsx @@ -3,7 +3,7 @@ import { Grid } from '@lobehub/ui'; import { memo } from 'react'; -import type {DiscoverProviderItem} from '@/types/discover'; +import { type DiscoverProviderItem } from '@/types/discover'; import ProviderEmpty from '../../../../features/ProviderEmpty'; import Item from './Item'; diff --git a/src/app/[variants]/(main)/community/(list)/provider/index.tsx b/src/app/[variants]/(main)/community/(list)/provider/index.tsx index 357037f19b..d05bc13902 100644 --- a/src/app/[variants]/(main)/community/(list)/provider/index.tsx +++ b/src/app/[variants]/(main)/community/(list)/provider/index.tsx @@ -5,8 +5,8 @@ import { memo } from 'react'; import { useQuery } from '@/hooks/useQuery'; import { useDiscoverStore } from '@/store/discover'; -import type {ProviderQueryParams} from '@/types/discover'; -import { DiscoverTab } from '@/types/discover'; +import { type ProviderQueryParams } from '@/types/discover'; +import { DiscoverTab } from '@/types/discover'; import Pagination from '../features/Pagination'; import List from './features/List'; diff --git a/src/app/[variants]/(main)/community/_layout/Sidebar/Header/Nav.tsx b/src/app/[variants]/(main)/community/_layout/Sidebar/Header/Nav.tsx index 9b6f2266e6..6b5b0b12ad 100644 --- a/src/app/[variants]/(main)/community/_layout/Sidebar/Header/Nav.tsx +++ b/src/app/[variants]/(main)/community/_layout/Sidebar/Header/Nav.tsx @@ -7,7 +7,7 @@ import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { Link, useNavigate } from 'react-router-dom'; -import type {NavItemProps} from '@/features/NavPanel/components/NavItem'; +import { type NavItemProps } from '@/features/NavPanel/components/NavItem'; import NavItem from '@/features/NavPanel/components/NavItem'; import { usePathname } from '@/libs/router/navigation'; import { DiscoverTab } from '@/types/discover'; diff --git a/src/app/[variants]/(main)/community/_layout/Sidebar/Header/index.tsx b/src/app/[variants]/(main)/community/_layout/Sidebar/Header/index.tsx index 44aafa39d3..93e783f049 100644 --- a/src/app/[variants]/(main)/community/_layout/Sidebar/Header/index.tsx +++ b/src/app/[variants]/(main)/community/_layout/Sidebar/Header/index.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/community/_layout/index.tsx b/src/app/[variants]/(main)/community/_layout/index.tsx index 7bbebb29a6..e7a4742445 100644 --- a/src/app/[variants]/(main)/community/_layout/index.tsx +++ b/src/app/[variants]/(main)/community/_layout/index.tsx @@ -1,5 +1,5 @@ import { Flexbox } from '@lobehub/ui'; -import type {FC} from 'react'; +import { type FC } from 'react'; import { Outlet } from 'react-router-dom'; import Sidebar from './Sidebar'; diff --git a/src/app/[variants]/(main)/community/components/CardBanner.tsx b/src/app/[variants]/(main)/community/components/CardBanner.tsx index 09cf7b6fde..af3684b873 100644 --- a/src/app/[variants]/(main)/community/components/CardBanner.tsx +++ b/src/app/[variants]/(main)/community/components/CardBanner.tsx @@ -1,7 +1,7 @@ -import type {DivProps} from '@lobehub/ui'; -import { Avatar, Flexbox } from '@lobehub/ui'; +import { type DivProps } from '@lobehub/ui'; +import { Avatar, Flexbox } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; export const styles = createStaticStyles(({ css, cssVar }) => ({ diff --git a/src/app/[variants]/(main)/community/components/CategoryContainer.tsx b/src/app/[variants]/(main)/community/components/CategoryContainer.tsx index e9e4a4afe4..145e2cf8a3 100644 --- a/src/app/[variants]/(main)/community/components/CategoryContainer.tsx +++ b/src/app/[variants]/(main)/community/components/CategoryContainer.tsx @@ -1,5 +1,5 @@ import { ScrollShadow } from '@lobehub/ui'; -import type {FC, PropsWithChildren} from 'react'; +import { type FC, type PropsWithChildren } from 'react'; const CategoryContainer: FC> = ({ children, top = 16 }) => { return ( diff --git a/src/app/[variants]/(main)/community/components/CategoryMenu.tsx b/src/app/[variants]/(main)/community/components/CategoryMenu.tsx index af439562ac..0832eb0394 100644 --- a/src/app/[variants]/(main)/community/components/CategoryMenu.tsx +++ b/src/app/[variants]/(main)/community/components/CategoryMenu.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {MenuProps} from '@lobehub/ui'; -import { Menu } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Menu } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { memo } from 'react'; diff --git a/src/app/[variants]/(main)/community/components/GitHubAvatar.tsx b/src/app/[variants]/(main)/community/components/GitHubAvatar.tsx index fe9d7a5e9f..0e117850c5 100644 --- a/src/app/[variants]/(main)/community/components/GitHubAvatar.tsx +++ b/src/app/[variants]/(main)/community/components/GitHubAvatar.tsx @@ -1,5 +1,5 @@ -import type {AvatarProps} from '@lobehub/ui'; -import { Avatar } from '@lobehub/ui'; +import { type AvatarProps } from '@lobehub/ui'; +import { Avatar } from '@lobehub/ui'; import qs from 'query-string'; import { memo } from 'react'; import urlJoin from 'url-join'; diff --git a/src/app/[variants]/(main)/community/components/Statistic.tsx b/src/app/[variants]/(main)/community/components/Statistic.tsx index c0b05b7c21..a0ef6f85dd 100644 --- a/src/app/[variants]/(main)/community/components/Statistic.tsx +++ b/src/app/[variants]/(main)/community/components/Statistic.tsx @@ -1,9 +1,9 @@ -import type {FlexboxProps} from '@lobehub/ui'; -import { Flexbox, Icon, Text, Tooltip } from '@lobehub/ui'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Flexbox, Icon, Text, Tooltip } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; import { HelpCircleIcon } from 'lucide-react'; -import type {CSSProperties, ReactNode} from 'react'; -import { memo } from 'react'; +import { type CSSProperties, type ReactNode } from 'react'; +import { memo } from 'react'; export const styles = createStaticStyles(({ css, cssVar }) => ({ container: css` diff --git a/src/app/[variants]/(main)/community/components/Title.tsx b/src/app/[variants]/(main)/community/components/Title.tsx index 9f6a0f0c65..058ed42537 100644 --- a/src/app/[variants]/(main)/community/components/Title.tsx +++ b/src/app/[variants]/(main)/community/components/Title.tsx @@ -1,10 +1,10 @@ 'use client'; -import type {FlexboxProps} from '@lobehub/ui'; -import { Button, Flexbox, Icon, Tag } from '@lobehub/ui'; -import { createStaticStyles, responsive,useResponsive } from 'antd-style'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Button, Flexbox, Icon, Tag } from '@lobehub/ui'; +import { createStaticStyles, responsive, useResponsive } from 'antd-style'; import { ChevronRight } from 'lucide-react'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import { Link } from 'react-router-dom'; diff --git a/src/app/[variants]/(main)/community/components/VirtuosoGridList/index.tsx b/src/app/[variants]/(main)/community/components/VirtuosoGridList/index.tsx index 600f9b86b8..062a1042b7 100644 --- a/src/app/[variants]/(main)/community/components/VirtuosoGridList/index.tsx +++ b/src/app/[variants]/(main)/community/components/VirtuosoGridList/index.tsx @@ -1,8 +1,8 @@ -import type {DivProps} from '@lobehub/ui'; -import { Flexbox, Grid } from '@lobehub/ui'; +import { type DivProps } from '@lobehub/ui'; +import { Flexbox, Grid } from '@lobehub/ui'; import { memo } from 'react'; -import type {VirtuosoGridProps} from 'react-virtuoso'; -import { VirtuosoGrid } from 'react-virtuoso'; +import { type VirtuosoGridProps } from 'react-virtuoso'; +import { VirtuosoGrid } from 'react-virtuoso'; import { useScrollParent } from './useScrollParent'; @@ -42,7 +42,10 @@ const VirtuosoGridList = memo>( initialItemCount={maxInitialItemCount || count} overscan={24} components={{ - List: (({ ref, ...props }: DivProps & { ref?: React.RefObject }) => ( + List: (({ + ref, + ...props + }: DivProps & { ref?: React.RefObject }) => ( )) as any, }} diff --git a/src/app/[variants]/(main)/community/features/AssistantEmpty.tsx b/src/app/[variants]/(main)/community/features/AssistantEmpty.tsx index 296b314867..c51c51092f 100644 --- a/src/app/[variants]/(main)/community/features/AssistantEmpty.tsx +++ b/src/app/[variants]/(main)/community/features/AssistantEmpty.tsx @@ -1,5 +1,5 @@ -import type {EmptyProps} from '@lobehub/ui'; -import { Center, Empty } from '@lobehub/ui'; +import { type EmptyProps } from '@lobehub/ui'; +import { Center, Empty } from '@lobehub/ui'; import { Bot } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/community/features/McpEmpty.tsx b/src/app/[variants]/(main)/community/features/McpEmpty.tsx index 81f76a7b68..a1432f32d8 100644 --- a/src/app/[variants]/(main)/community/features/McpEmpty.tsx +++ b/src/app/[variants]/(main)/community/features/McpEmpty.tsx @@ -1,5 +1,5 @@ -import type {EmptyProps} from '@lobehub/ui'; -import { Center, Empty } from '@lobehub/ui'; +import { type EmptyProps } from '@lobehub/ui'; +import { Center, Empty } from '@lobehub/ui'; import { Boxes } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/community/features/ModelEmpty.tsx b/src/app/[variants]/(main)/community/features/ModelEmpty.tsx index 741389e49f..e834f9e70d 100644 --- a/src/app/[variants]/(main)/community/features/ModelEmpty.tsx +++ b/src/app/[variants]/(main)/community/features/ModelEmpty.tsx @@ -1,5 +1,5 @@ -import type {EmptyProps} from '@lobehub/ui'; -import { Center, Empty } from '@lobehub/ui'; +import { type EmptyProps } from '@lobehub/ui'; +import { Center, Empty } from '@lobehub/ui'; import { Cpu } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/community/features/ProviderEmpty.tsx b/src/app/[variants]/(main)/community/features/ProviderEmpty.tsx index 6d5bd219c6..726980a4d8 100644 --- a/src/app/[variants]/(main)/community/features/ProviderEmpty.tsx +++ b/src/app/[variants]/(main)/community/features/ProviderEmpty.tsx @@ -1,5 +1,5 @@ -import type {EmptyProps} from '@lobehub/ui'; -import { Center, Empty } from '@lobehub/ui'; +import { type EmptyProps } from '@lobehub/ui'; +import { Center, Empty } from '@lobehub/ui'; import { Cloud } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/community/features/Search.tsx b/src/app/[variants]/(main)/community/features/Search.tsx index 94a003a2bf..6fa374ff3e 100644 --- a/src/app/[variants]/(main)/community/features/Search.tsx +++ b/src/app/[variants]/(main)/community/features/Search.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {SearchBarProps} from '@lobehub/ui'; -import { SearchBar } from '@lobehub/ui'; +import { type SearchBarProps } from '@lobehub/ui'; +import { SearchBar } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/community/features/Title.tsx b/src/app/[variants]/(main)/community/features/Title.tsx index 3156451b16..b358cb6dd3 100644 --- a/src/app/[variants]/(main)/community/features/Title.tsx +++ b/src/app/[variants]/(main)/community/features/Title.tsx @@ -1,10 +1,10 @@ 'use client'; -import type {FlexboxProps} from '@lobehub/ui'; -import { Flexbox, Icon } from '@lobehub/ui'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Flexbox, Icon } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; import { ChevronRight } from 'lucide-react'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import { Link as RouterLink } from 'react-router-dom'; diff --git a/src/app/[variants]/(main)/community/features/useNav.tsx b/src/app/[variants]/(main)/community/features/useNav.tsx index a68a976101..8e47873560 100644 --- a/src/app/[variants]/(main)/community/features/useNav.tsx +++ b/src/app/[variants]/(main)/community/features/useNav.tsx @@ -1,12 +1,12 @@ import { MCP } from '@lobehub/icons'; import { Icon } from '@lobehub/ui'; import { Bot, Brain, BrainCircuit, House } from 'lucide-react'; -import type {ReactNode} from 'react'; -import { useMemo } from 'react'; +import { type ReactNode } from 'react'; +import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation } from 'react-router-dom'; -import type { MenuProps } from '@/components/Menu'; +import { type MenuProps } from '@/components/Menu'; import { DiscoverTab } from '@/types/discover'; const ICON_SIZE = 16; @@ -31,47 +31,29 @@ export const useNav = () => { { icon: , key: DiscoverTab.Home, - label: ( -
- {t('tab.home')} -
- ), + label:
{t('tab.home')}
, }, { icon: , key: DiscoverTab.Assistants, - label: ( -
- {t('tab.assistant')} -
- ), + label:
{t('tab.assistant')}
, }, { icon: , key: DiscoverTab.Mcp, label: ( -
- {`MCP ${t('tab.plugin')}`} -
+
{`MCP ${t('tab.plugin')}`}
), }, { icon: , key: DiscoverTab.Models, - label: ( -
- {t('tab.model')} -
- ), + label:
{t('tab.model')}
, }, { icon: , key: DiscoverTab.Providers, - label: ( -
- {t('tab.provider')} -
- ), + label:
{t('tab.provider')}
, }, ], [t], diff --git a/src/app/[variants]/(main)/components/Link.tsx b/src/app/[variants]/(main)/components/Link.tsx index b1170c957a..89860d11f0 100644 --- a/src/app/[variants]/(main)/components/Link.tsx +++ b/src/app/[variants]/(main)/components/Link.tsx @@ -1,6 +1,6 @@ import React, { memo } from 'react'; -import type {LinkProps as ReactRouterLinkProps} from 'react-router-dom'; -import { Link as ReactRouterLink } from 'react-router-dom'; +import { type LinkProps as ReactRouterLinkProps } from 'react-router-dom'; +import { Link as ReactRouterLink } from 'react-router-dom'; interface LinkProps extends Omit { children?: React.ReactNode; diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/AddGroupMemberModal/AvailableAgentList.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/AddGroupMemberModal/AvailableAgentList.tsx index 4309edb1c3..eba69062e5 100644 --- a/src/app/[variants]/(main)/group/_layout/Sidebar/AddGroupMemberModal/AvailableAgentList.tsx +++ b/src/app/[variants]/(main)/group/_layout/Sidebar/AddGroupMemberModal/AvailableAgentList.tsx @@ -2,14 +2,14 @@ import { Flexbox, SearchBar, Skeleton } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; -import type {ChangeEvent} from 'react'; -import { memo, useCallback, useMemo, useState } from 'react'; +import { type ChangeEvent } from 'react'; +import { memo, useCallback, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Virtuoso } from 'react-virtuoso'; import AgentSelectionEmpty from '@/features/AgentSelectionEmpty'; -import type {AgentItemData} from './AgentItem'; +import { type AgentItemData } from './AgentItem'; import AgentItem from './AgentItem'; const styles = createStaticStyles(({ css, cssVar }) => ({ diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/AddGroupMemberModal/SelectedAgentList.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/AddGroupMemberModal/SelectedAgentList.tsx index bcfa77b395..79a305bc3b 100644 --- a/src/app/[variants]/(main)/group/_layout/Sidebar/AddGroupMemberModal/SelectedAgentList.tsx +++ b/src/app/[variants]/(main)/group/_layout/Sidebar/AddGroupMemberModal/SelectedAgentList.tsx @@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next'; import AgentSelectionEmpty from '@/features/AgentSelectionEmpty'; -import type {AgentItemData} from './AgentItem'; +import { type AgentItemData } from './AgentItem'; import AgentItem from './AgentItem'; import { useAgentSelectionStore } from './store'; diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/AddGroupMemberModal/index.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/AddGroupMemberModal/index.tsx index 4a52673bfa..50de321f11 100644 --- a/src/app/[variants]/(main)/group/_layout/Sidebar/AddGroupMemberModal/index.tsx +++ b/src/app/[variants]/(main)/group/_layout/Sidebar/AddGroupMemberModal/index.tsx @@ -9,7 +9,7 @@ import useSWR from 'swr'; import { agentService } from '@/services/agent'; -import type { AgentItemData } from './AgentItem'; +import { type AgentItemData } from './AgentItem'; import AvailableAgentList from './AvailableAgentList'; import SelectedAgentList from './SelectedAgentList'; import { useAgentSelectionStore } from './store'; diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/GroupConfig/AgentProfilePopup.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/GroupConfig/AgentProfilePopup.tsx index 4df1918ba6..11935b8d8c 100644 --- a/src/app/[variants]/(main)/group/_layout/Sidebar/GroupConfig/AgentProfilePopup.tsx +++ b/src/app/[variants]/(main)/group/_layout/Sidebar/GroupConfig/AgentProfilePopup.tsx @@ -1,11 +1,11 @@ 'use client'; -import type { AgentItem } from '@lobechat/types'; +import { type AgentItem } from '@lobechat/types'; import { ActionIcon, Avatar, Center, Flexbox, Popover, Text, Tooltip } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; import { Settings } from 'lucide-react'; -import type {PropsWithChildren} from 'react'; -import { memo, useState } from 'react'; +import { type PropsWithChildren } from 'react'; +import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/GroupConfig/GroupMemberItem.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/GroupConfig/GroupMemberItem.tsx index e0fd679e0f..60a69327c3 100644 --- a/src/app/[variants]/(main)/group/_layout/Sidebar/GroupConfig/GroupMemberItem.tsx +++ b/src/app/[variants]/(main)/group/_layout/Sidebar/GroupConfig/GroupMemberItem.tsx @@ -1,7 +1,7 @@ 'use client'; import { Avatar, Flexbox, Tag } from '@lobehub/ui'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/GroupConfig/GroupRole.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/GroupConfig/GroupRole.tsx index 5a50215cee..3c8196869d 100644 --- a/src/app/[variants]/(main)/group/_layout/Sidebar/GroupConfig/GroupRole.tsx +++ b/src/app/[variants]/(main)/group/_layout/Sidebar/GroupConfig/GroupRole.tsx @@ -2,14 +2,14 @@ import { Flexbox } from '@lobehub/ui'; import { EditableMessage } from '@lobehub/ui/chat'; -import type {MouseEvent} from 'react'; +import { type MouseEvent } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import GroupInfo from '@/features/GroupInfo'; import { useAgentGroupStore } from '@/store/agentGroup'; import { agentGroupSelectors } from '@/store/agentGroup/selectors'; -import type {LobeSession} from '@/types/session'; +import { type LobeSession } from '@/types/session'; import { styles } from './style'; diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/Header/Agent/SwitchPanel.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/Header/Agent/SwitchPanel.tsx index 085624d94e..a9320c8576 100644 --- a/src/app/[variants]/(main)/group/_layout/Sidebar/Header/Agent/SwitchPanel.tsx +++ b/src/app/[variants]/(main)/group/_layout/Sidebar/Header/Agent/SwitchPanel.tsx @@ -1,5 +1,5 @@ import { Flexbox, Popover } from '@lobehub/ui'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import React, { memo, Suspense } from 'react'; import { useNavigate } from 'react-router-dom'; diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/Header/Agent/index.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/Header/Agent/index.tsx index e141e57f4b..6762315b3b 100644 --- a/src/app/[variants]/(main)/group/_layout/Sidebar/Header/Agent/index.tsx +++ b/src/app/[variants]/(main)/group/_layout/Sidebar/Header/Agent/index.tsx @@ -2,7 +2,7 @@ import { ActionIcon, Block, Text } from '@lobehub/ui'; import { ChevronsUpDownIcon } from 'lucide-react'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import React, { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/Header/index.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/Header/index.tsx index eadd838892..31d124839b 100644 --- a/src/app/[variants]/(main)/group/_layout/Sidebar/Header/index.tsx +++ b/src/app/[variants]/(main)/group/_layout/Sidebar/Header/index.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { memo } from 'react'; import SideBarHeaderLayout from '@/features/NavPanel/SideBarHeaderLayout'; diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/Members/index.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/Members/index.tsx index 6e0e2d1e0a..30fb28b3dc 100644 --- a/src/app/[variants]/(main)/group/_layout/Sidebar/Members/index.tsx +++ b/src/app/[variants]/(main)/group/_layout/Sidebar/Members/index.tsx @@ -2,8 +2,8 @@ import { AccordionItem, ActionIcon, Flexbox, Text } from '@lobehub/ui'; import { Loader2Icon, UserPlus } from 'lucide-react'; -import type {MouseEvent} from 'react'; -import { memo, useState } from 'react'; +import { type MouseEvent } from 'react'; +import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useInitGroupConfig } from '@/hooks/useInitGroupConfig'; diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/AllTopicsDrawer/Content.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/AllTopicsDrawer/Content.tsx index 2a62416fd1..b10b8037e1 100644 --- a/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/AllTopicsDrawer/Content.tsx +++ b/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/AllTopicsDrawer/Content.tsx @@ -3,8 +3,8 @@ import { Flexbox } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; import { memo, useCallback, useEffect, useRef } from 'react'; -import type {VListHandle} from 'virtua'; -import { VList } from 'virtua'; +import { type VListHandle } from 'virtua'; +import { VList } from 'virtua'; import SkeletonList from '@/features/NavPanel/components/SkeletonList'; import TopicEmpty from '@/features/TopicEmpty'; diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/Actions.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/Actions.tsx index 5edb1535c1..6409785f4a 100644 --- a/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/Actions.tsx +++ b/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/Actions.tsx @@ -1,5 +1,5 @@ -import type {DropdownItem} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type DropdownItem } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { MoreHorizontalIcon } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/useDropdownMenu.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/useDropdownMenu.tsx index e08d660511..5f6d90f019 100644 --- a/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/useDropdownMenu.tsx +++ b/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/useDropdownMenu.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { App } from 'antd'; import { ExternalLink, LucideCopy, PencilLine, Trash, Wand2 } from 'lucide-react'; import { useCallback } from 'react'; diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ByTimeMode/GroupItem.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ByTimeMode/GroupItem.tsx index caa2730fb8..90ec7fa81a 100644 --- a/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ByTimeMode/GroupItem.tsx +++ b/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ByTimeMode/GroupItem.tsx @@ -4,7 +4,7 @@ import { HashIcon } from 'lucide-react'; import React, { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {GroupedTopic} from '@/types/topic'; +import { type GroupedTopic } from '@/types/topic'; import TopicItem from '../../List/Item'; diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/Actions.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/Actions.tsx index 5edb1535c1..6409785f4a 100644 --- a/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/Actions.tsx +++ b/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/Actions.tsx @@ -1,5 +1,5 @@ -import type {DropdownItem} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type DropdownItem } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { MoreHorizontalIcon } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/useDropdownMenu.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/useDropdownMenu.tsx index ff8d03cae6..955791b404 100644 --- a/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/useDropdownMenu.tsx +++ b/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/useDropdownMenu.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { App } from 'antd'; import { PencilLine, Trash } from 'lucide-react'; import { useCallback } from 'react'; diff --git a/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/useDropdownMenu.tsx b/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/useDropdownMenu.tsx index e11329384e..9fbf1c75f4 100644 --- a/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/useDropdownMenu.tsx +++ b/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/useDropdownMenu.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { App, Upload } from 'antd'; import { css, cx } from 'antd-style'; import { Hash, Import, LucideCheck, Trash } from 'lucide-react'; diff --git a/src/app/[variants]/(main)/group/_layout/index.tsx b/src/app/[variants]/(main)/group/_layout/index.tsx index 134f6d6876..b66e095fe2 100644 --- a/src/app/[variants]/(main)/group/_layout/index.tsx +++ b/src/app/[variants]/(main)/group/_layout/index.tsx @@ -1,5 +1,5 @@ import { Flexbox } from '@lobehub/ui'; -import type {FC} from 'react'; +import { type FC } from 'react'; import { Outlet } from 'react-router-dom'; import { isDesktop } from '@/const/version'; diff --git a/src/app/[variants]/(main)/group/features/Conversation/ChatItem/Thread.tsx b/src/app/[variants]/(main)/group/features/Conversation/ChatItem/Thread.tsx index dbd5ae39c9..bcd47af26c 100644 --- a/src/app/[variants]/(main)/group/features/Conversation/ChatItem/Thread.tsx +++ b/src/app/[variants]/(main)/group/features/Conversation/ChatItem/Thread.tsx @@ -1,8 +1,8 @@ import { Flexbox, Text } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; import isEqual from 'fast-deep-equal'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { useIsDark } from '@/hooks/useIsDark'; diff --git a/src/app/[variants]/(main)/group/features/Conversation/ChatItem/ThreadItem.tsx b/src/app/[variants]/(main)/group/features/Conversation/ChatItem/ThreadItem.tsx index f46564e973..0e9052e634 100644 --- a/src/app/[variants]/(main)/group/features/Conversation/ChatItem/ThreadItem.tsx +++ b/src/app/[variants]/(main)/group/features/Conversation/ChatItem/ThreadItem.tsx @@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next'; import { useIsMobile } from '@/hooks/useIsMobile'; import { useChatStore } from '@/store/chat'; import { chatSelectors } from '@/store/chat/selectors'; -import type {ThreadItem} from '@/types/topic'; +import { type ThreadItem } from '@/types/topic'; const styles = createStaticStyles(({ css, cssVar }) => ({ active: css` diff --git a/src/app/[variants]/(main)/group/features/Conversation/Header/Tags/KnowledgeTag.tsx b/src/app/[variants]/(main)/group/features/Conversation/Header/Tags/KnowledgeTag.tsx index cd2d5c1903..c39109c15d 100644 --- a/src/app/[variants]/(main)/group/features/Conversation/Header/Tags/KnowledgeTag.tsx +++ b/src/app/[variants]/(main)/group/features/Conversation/Header/Tags/KnowledgeTag.tsx @@ -1,13 +1,13 @@ 'use client'; -import type {MenuProps} from '@lobehub/ui'; -import { DropdownMenu, Flexbox, Icon, Tag } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { DropdownMenu, Flexbox, Icon, Tag } from '@lobehub/ui'; import { LibraryBig } from 'lucide-react'; import { memo } from 'react'; import KnowledgeIcon from '@/components/KnowledgeIcon'; import { oneLineEllipsis } from '@/styles'; -import type {KnowledgeItem} from '@/types/knowledgeBase'; +import { type KnowledgeItem } from '@/types/knowledgeBase'; export interface PluginTagProps { data: KnowledgeItem[]; diff --git a/src/app/[variants]/(main)/group/features/Conversation/MainChatInput/GroupChat.tsx b/src/app/[variants]/(main)/group/features/Conversation/MainChatInput/GroupChat.tsx index b3bbb7ba11..407d46fd05 100644 --- a/src/app/[variants]/(main)/group/features/Conversation/MainChatInput/GroupChat.tsx +++ b/src/app/[variants]/(main)/group/features/Conversation/MainChatInput/GroupChat.tsx @@ -1,14 +1,14 @@ 'use client'; -import type {SlashOptions} from '@lobehub/editor'; +import { type SlashOptions } from '@lobehub/editor'; import { Alert, Avatar, Flexbox } from '@lobehub/ui'; import { isEqual } from 'es-toolkit/compat'; import { memo, Suspense, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { DEFAULT_AVATAR } from '@/const/meta'; -import type {ActionKeys} from '@/features/ChatInput'; -import { ChatInputProvider, DesktopChatInput } from '@/features/ChatInput'; +import { type ActionKeys } from '@/features/ChatInput'; +import { ChatInputProvider, DesktopChatInput } from '@/features/ChatInput'; import GroupAvatar from '@/features/GroupAvatar'; import WideScreenContainer from '@/features/WideScreenContainer'; import { useAgentGroupStore } from '@/store/agentGroup'; diff --git a/src/app/[variants]/(main)/group/features/Conversation/MainChatInput/useSendMenuItems.tsx b/src/app/[variants]/(main)/group/features/Conversation/MainChatInput/useSendMenuItems.tsx index 1fd8763084..b999f6576e 100644 --- a/src/app/[variants]/(main)/group/features/Conversation/MainChatInput/useSendMenuItems.tsx +++ b/src/app/[variants]/(main)/group/features/Conversation/MainChatInput/useSendMenuItems.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {MenuProps} from '@lobehub/ui'; -import { Flexbox,Hotkey, Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Flexbox, Hotkey, Icon } from '@lobehub/ui'; import { BotMessageSquare, LucideCheck, MessageSquarePlus } from 'lucide-react'; import { useCallback, useMemo } from 'react'; import { Trans, useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/group/features/Conversation/useActionsBarConfig.ts b/src/app/[variants]/(main)/group/features/Conversation/useActionsBarConfig.ts index 5ba2b21de0..4b774bd006 100644 --- a/src/app/[variants]/(main)/group/features/Conversation/useActionsBarConfig.ts +++ b/src/app/[variants]/(main)/group/features/Conversation/useActionsBarConfig.ts @@ -5,10 +5,10 @@ import { Split } from 'lucide-react'; import { useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -import type { - ActionsBarConfig, - MessageActionFactory, - MessageActionItem, +import { + type ActionsBarConfig, + type MessageActionFactory, + type MessageActionItem, } from '@/features/Conversation/types'; import { useChatStore } from '@/store/chat'; diff --git a/src/app/[variants]/(main)/group/features/Conversation/useGroupContext.ts b/src/app/[variants]/(main)/group/features/Conversation/useGroupContext.ts index 1f29badf0d..28c297bec4 100644 --- a/src/app/[variants]/(main)/group/features/Conversation/useGroupContext.ts +++ b/src/app/[variants]/(main)/group/features/Conversation/useGroupContext.ts @@ -1,6 +1,6 @@ 'use client'; -import type {ConversationContext} from '@lobechat/types'; +import { type ConversationContext } from '@lobechat/types'; import { useAgentGroupStore } from '@/store/agentGroup'; import { agentGroupSelectors } from '@/store/agentGroup/selectors'; diff --git a/src/app/[variants]/(main)/group/features/Conversation/useGroupHooks.ts b/src/app/[variants]/(main)/group/features/Conversation/useGroupHooks.ts index c256094eeb..0334f87c44 100644 --- a/src/app/[variants]/(main)/group/features/Conversation/useGroupHooks.ts +++ b/src/app/[variants]/(main)/group/features/Conversation/useGroupHooks.ts @@ -1,9 +1,9 @@ 'use client'; -import type {ConversationContext, SendMessageParams} from '@lobechat/types'; +import { type ConversationContext, type SendMessageParams } from '@lobechat/types'; import { useMemo } from 'react'; -import type {ConversationHooks} from '@/features/Conversation'; +import { type ConversationHooks } from '@/features/Conversation'; import { useChatStore } from '@/store/chat'; /** diff --git a/src/app/[variants]/(main)/group/features/Portal/_layout/Mobile.tsx b/src/app/[variants]/(main)/group/features/Portal/_layout/Mobile.tsx index 27a5da2feb..7ee0dde800 100644 --- a/src/app/[variants]/(main)/group/features/Portal/_layout/Mobile.tsx +++ b/src/app/[variants]/(main)/group/features/Portal/_layout/Mobile.tsx @@ -2,7 +2,7 @@ import { Flexbox, Modal } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { useTranslation } from 'react-i18next'; import { PortalContent } from '@/features/Portal/router'; diff --git a/src/app/[variants]/(main)/group/features/Portal/features/Body.tsx b/src/app/[variants]/(main)/group/features/Portal/features/Body.tsx index b6820e151e..a46080d035 100644 --- a/src/app/[variants]/(main)/group/features/Portal/features/Body.tsx +++ b/src/app/[variants]/(main)/group/features/Portal/features/Body.tsx @@ -2,7 +2,7 @@ import { Flexbox } from '@lobehub/ui'; import { css, cx } from 'antd-style'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; const body = css` :has(.portal-artifact) { diff --git a/src/app/[variants]/(main)/group/profile/features/AgentBuilder/AgentBuilderConversation.tsx b/src/app/[variants]/(main)/group/profile/features/AgentBuilder/AgentBuilderConversation.tsx index fd5b2cbc47..077c7bb234 100644 --- a/src/app/[variants]/(main)/group/profile/features/AgentBuilder/AgentBuilderConversation.tsx +++ b/src/app/[variants]/(main)/group/profile/features/AgentBuilder/AgentBuilderConversation.tsx @@ -2,7 +2,7 @@ import { Flexbox } from '@lobehub/ui'; import { memo } from 'react'; import AgentBuilderWelcome from '@/features/AgentBuilder/AgentBuilderWelcome'; -import type { ActionKeys } from '@/features/ChatInput'; +import { type ActionKeys } from '@/features/ChatInput'; import { ChatInput, ChatList } from '@/features/Conversation'; import TopicSelector from './TopicSelector'; diff --git a/src/app/[variants]/(main)/group/profile/features/AgentBuilder/AgentBuilderProvider.tsx b/src/app/[variants]/(main)/group/profile/features/AgentBuilder/AgentBuilderProvider.tsx index 4208f366b9..d658474781 100644 --- a/src/app/[variants]/(main)/group/profile/features/AgentBuilder/AgentBuilderProvider.tsx +++ b/src/app/[variants]/(main)/group/profile/features/AgentBuilder/AgentBuilderProvider.tsx @@ -1,10 +1,10 @@ -import type {ReactNode} from 'react'; -import { memo, useMemo } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useMemo } from 'react'; import { ConversationProvider } from '@/features/Conversation'; import { useOperationState } from '@/hooks/useOperationState'; import { useChatStore } from '@/store/chat'; -import type {MessageMapKeyInput} from '@/store/chat/utils/messageMapKey'; +import { type MessageMapKeyInput } from '@/store/chat/utils/messageMapKey'; import { messageMapKey } from '@/store/chat/utils/messageMapKey'; interface AgentBuilderProviderProps { diff --git a/src/app/[variants]/(main)/group/profile/features/AgentBuilder/TopicSelector.tsx b/src/app/[variants]/(main)/group/profile/features/AgentBuilder/TopicSelector.tsx index b00045d3f2..4e88d28259 100644 --- a/src/app/[variants]/(main)/group/profile/features/AgentBuilder/TopicSelector.tsx +++ b/src/app/[variants]/(main)/group/profile/features/AgentBuilder/TopicSelector.tsx @@ -1,5 +1,5 @@ -import type {DropdownMenuCheckboxItem} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu, Tag } from '@lobehub/ui'; +import { type DropdownMenuCheckboxItem } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu, Tag } from '@lobehub/ui'; import { Clock3Icon, PlusIcon } from 'lucide-react'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/group/profile/features/AgentSettings/Content.tsx b/src/app/[variants]/(main)/group/profile/features/AgentSettings/Content.tsx index 5201f38cb2..735f8c8402 100644 --- a/src/app/[variants]/(main)/group/profile/features/AgentSettings/Content.tsx +++ b/src/app/[variants]/(main)/group/profile/features/AgentSettings/Content.tsx @@ -1,7 +1,7 @@ 'use client'; import { Avatar, Block, Flexbox, Icon, Text } from '@lobehub/ui'; -import type { ItemType } from 'antd/es/menu/interface'; +import { type ItemType } from 'antd/es/menu/interface'; import { useTheme } from 'antd-style'; import { MessageSquareHeartIcon } from 'lucide-react'; import { memo, useMemo, useState } from 'react'; diff --git a/src/app/[variants]/(main)/group/profile/features/GroupProfile/GroupForkTag.tsx b/src/app/[variants]/(main)/group/profile/features/GroupProfile/GroupForkTag.tsx index a070052669..16252f05ab 100644 --- a/src/app/[variants]/(main)/group/profile/features/GroupProfile/GroupForkTag.tsx +++ b/src/app/[variants]/(main)/group/profile/features/GroupProfile/GroupForkTag.tsx @@ -9,7 +9,7 @@ import { useNavigate } from 'react-router-dom'; import { marketApiService } from '@/services/marketApi'; import { useAgentGroupStore } from '@/store/agentGroup'; import { agentGroupSelectors } from '@/store/agentGroup/selectors'; -import type { AgentGroupForkSourceResponse } from '@/types/discover'; +import { type AgentGroupForkSourceResponse } from '@/types/discover'; /** * Group Fork Tag Component @@ -35,8 +35,7 @@ const GroupForkTag = memo(() => { setLoading(true); // Get fork source info from market using the marketIdentifier - const forkSourceResponse = - await marketApiService.getAgentGroupForkSource(marketIdentifier); + const forkSourceResponse = await marketApiService.getAgentGroupForkSource(marketIdentifier); setForkSource(forkSourceResponse.source); } catch (error) { diff --git a/src/app/[variants]/(main)/group/profile/features/GroupProfile/GroupStatusTag.tsx b/src/app/[variants]/(main)/group/profile/features/GroupProfile/GroupStatusTag.tsx index 9229cd5cb2..678fddce6e 100644 --- a/src/app/[variants]/(main)/group/profile/features/GroupProfile/GroupStatusTag.tsx +++ b/src/app/[variants]/(main)/group/profile/features/GroupProfile/GroupStatusTag.tsx @@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next'; import { useAgentGroupStore } from '@/store/agentGroup'; import { agentGroupSelectors } from '@/store/agentGroup/selectors'; -import type { AgentStatus } from '@/types/discover'; +import { type AgentStatus } from '@/types/discover'; /** * Group Status Tag Component diff --git a/src/app/[variants]/(main)/group/profile/features/Header/AgentPublishButton/PublishButton.tsx b/src/app/[variants]/(main)/group/profile/features/Header/AgentPublishButton/PublishButton.tsx index d0d9d54a11..a09e7f99a8 100644 --- a/src/app/[variants]/(main)/group/profile/features/Header/AgentPublishButton/PublishButton.tsx +++ b/src/app/[variants]/(main)/group/profile/features/Header/AgentPublishButton/PublishButton.tsx @@ -10,7 +10,7 @@ import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth'; import { resolveMarketAuthError } from '@/layout/AuthProvider/MarketAuth/errors'; import { useServerConfigStore } from '@/store/serverConfig'; -import type { MarketPublishAction } from './types'; +import { type MarketPublishAction } from './types'; import { useMarketPublish } from './useMarketPublish'; interface MarketPublishButtonProps { 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 ef994dcca4..90aca7cee5 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 @@ -11,7 +11,7 @@ import { agentChatConfigSelectors, agentSelectors } from '@/store/agent/selector import { useGlobalStore } from '@/store/global'; import { globalGeneralSelectors } from '@/store/global/selectors'; -import type { MarketPublishAction } from './types'; +import { type MarketPublishAction } from './types'; import { generateDefaultChangelog, generateMarketIdentifier } from './utils'; interface UseMarketPublishOptions { diff --git a/src/app/[variants]/(main)/group/profile/features/Header/ChromeTabs/index.tsx b/src/app/[variants]/(main)/group/profile/features/Header/ChromeTabs/index.tsx index c097ee0a2f..5b7d8172dd 100644 --- a/src/app/[variants]/(main)/group/profile/features/Header/ChromeTabs/index.tsx +++ b/src/app/[variants]/(main)/group/profile/features/Header/ChromeTabs/index.tsx @@ -3,7 +3,7 @@ import { Avatar, Flexbox } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; import { Plus } from 'lucide-react'; -import type { ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo, useEffect, useRef } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/GroupForkConfirmModal.tsx b/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/GroupForkConfirmModal.tsx index f3de7227ed..54e3ad11df 100644 --- a/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/GroupForkConfirmModal.tsx +++ b/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/GroupForkConfirmModal.tsx @@ -4,7 +4,7 @@ import { Avatar, Flexbox, Modal } from '@lobehub/ui'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type { OriginalGroupInfo } from './types'; +import { type OriginalGroupInfo } from './types'; interface GroupForkConfirmModalProps { loading?: boolean; 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 ac89d52453..3514875aed 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 @@ -13,7 +13,7 @@ import { agentGroupSelectors } from '@/store/agentGroup/selectors'; import { useGroupVersionReviewStatus } from '../../GroupProfile/GroupVersionReviewTag'; import GroupForkConfirmModal from './GroupForkConfirmModal'; -import type { MarketPublishAction, OriginalGroupInfo } from './types'; +import { type MarketPublishAction, type OriginalGroupInfo } from './types'; import { useMarketGroupPublish } from './useMarketGroupPublish'; interface GroupPublishButtonProps { diff --git a/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/useMarketGroupPublish.ts b/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/useMarketGroupPublish.ts index 1a954f5d7d..496d27a3ee 100644 --- a/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/useMarketGroupPublish.ts +++ b/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/useMarketGroupPublish.ts @@ -10,7 +10,7 @@ import { agentGroupSelectors } from '@/store/agentGroup/selectors'; import { useGlobalStore } from '@/store/global'; import { globalGeneralSelectors } from '@/store/global/selectors'; -import type { MarketPublishAction, OriginalGroupInfo } from './types'; +import { type MarketPublishAction, type OriginalGroupInfo } from './types'; import { generateDefaultChangelog } from './utils'; interface UseMarketGroupPublishOptions { diff --git a/src/app/[variants]/(main)/group/profile/features/Header/index.tsx b/src/app/[variants]/(main)/group/profile/features/Header/index.tsx index 5f2f7074a6..aa977f6b46 100644 --- a/src/app/[variants]/(main)/group/profile/features/Header/index.tsx +++ b/src/app/[variants]/(main)/group/profile/features/Header/index.tsx @@ -15,7 +15,7 @@ import { useGlobalStore } from '@/store/global'; import { systemStatusSelectors } from '@/store/global/selectors'; import AgentBuilderToggle from './AgentBuilderToggle'; -import type {ChromeTabItem} from './ChromeTabs'; +import { type ChromeTabItem } from './ChromeTabs'; import ChromeTabs from './ChromeTabs'; const styles = createStaticStyles(({ css, cssVar }) => ({ diff --git a/src/app/[variants]/(main)/group/profile/features/MemberProfile/MentionList/MentionDropdown.tsx b/src/app/[variants]/(main)/group/profile/features/MemberProfile/MentionList/MentionDropdown.tsx index c001f85a79..5e46008957 100644 --- a/src/app/[variants]/(main)/group/profile/features/MemberProfile/MentionList/MentionDropdown.tsx +++ b/src/app/[variants]/(main)/group/profile/features/MemberProfile/MentionList/MentionDropdown.tsx @@ -1,10 +1,10 @@ -import type {MenuRenderProps} from '@lobehub/editor/es/plugins/slash/react/type'; +import { type MenuRenderProps } from '@lobehub/editor/es/plugins/slash/react/type'; import { Flexbox } from '@lobehub/ui'; import { cssVar } from 'antd-style'; -import type {ReactNode} from 'react'; -import { memo, useEffect, useLayoutEffect, useRef, useState } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useEffect, useLayoutEffect, useRef, useState } from 'react'; -import type {MentionListOption} from './types'; +import { type MentionListOption } from './types'; /** * Get cursor position from browser selection API diff --git a/src/app/[variants]/(main)/group/profile/features/MemberProfile/MentionList/types.ts b/src/app/[variants]/(main)/group/profile/features/MemberProfile/MentionList/types.ts index 7a41ea948a..2aa3f0cdc4 100644 --- a/src/app/[variants]/(main)/group/profile/features/MemberProfile/MentionList/types.ts +++ b/src/app/[variants]/(main)/group/profile/features/MemberProfile/MentionList/types.ts @@ -1,5 +1,5 @@ -import type { API } from '@lobechat/prompts'; -import type { DropdownItem } from '@lobehub/ui'; +import { type API } from '@lobechat/prompts'; +import { type DropdownItem } from '@lobehub/ui'; export type MentionEntityType = 'collection' | 'api'; diff --git a/src/app/[variants]/(main)/group/profile/features/MemberProfile/MentionList/useMentionItems.tsx b/src/app/[variants]/(main)/group/profile/features/MemberProfile/MentionList/useMentionItems.tsx index 779a9f4a30..073ba70c74 100644 --- a/src/app/[variants]/(main)/group/profile/features/MemberProfile/MentionList/useMentionItems.tsx +++ b/src/app/[variants]/(main)/group/profile/features/MemberProfile/MentionList/useMentionItems.tsx @@ -1,11 +1,11 @@ -import type {KlavisServerType} from '@lobechat/const'; -import { KLAVIS_SERVER_TYPES } from '@lobechat/const'; +import { type KlavisServerType } from '@lobechat/const'; +import { KLAVIS_SERVER_TYPES } from '@lobechat/const'; import { ToolNameResolver } from '@lobechat/context-engine'; -import type {API} from '@lobechat/prompts'; -import { apiPrompt, toolPrompt } from '@lobechat/prompts'; -import type {LobeChatPluginManifest} from '@lobehub/chat-plugin-sdk'; -import type {IEditor} from '@lobehub/editor'; -import { INSERT_MENTION_COMMAND } from '@lobehub/editor'; +import { type API } from '@lobechat/prompts'; +import { apiPrompt, toolPrompt } from '@lobechat/prompts'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; +import { type IEditor } from '@lobehub/editor'; +import { INSERT_MENTION_COMMAND } from '@lobehub/editor'; import { Icon, Image } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import isEqual from 'fast-deep-equal'; @@ -19,7 +19,7 @@ import { toolSelectors } from '@/store/tool/selectors'; import { hydrationPrompt } from '@/utils/promptTemplate'; import MentionDropdown from './MentionDropdown'; -import type {MentionListOption, MentionMetadata} from './types'; +import { type MentionListOption, type MentionMetadata } from './types'; // 根据 identifier 获取 Klavis 服务器类型配置 const getKlavisServerType = (identifier: string) => diff --git a/src/app/[variants]/(main)/group/profile/index.tsx b/src/app/[variants]/(main)/group/profile/index.tsx index cbc6a1dfd9..0befb1e374 100644 --- a/src/app/[variants]/(main)/group/profile/index.tsx +++ b/src/app/[variants]/(main)/group/profile/index.tsx @@ -1,8 +1,8 @@ 'use client'; import { Flexbox } from '@lobehub/ui'; -import type {FC} from 'react'; -import { memo,Suspense } from 'react'; +import { type FC } from 'react'; +import { memo, Suspense } from 'react'; import Loading from '@/components/Loading/BrandTextLoading'; import WideScreenContainer from '@/features/WideScreenContainer'; diff --git a/src/app/[variants]/(main)/home/_layout/Body/Agent/Actions.tsx b/src/app/[variants]/(main)/home/_layout/Body/Agent/Actions.tsx index df5b2e7f47..63fcf26d2c 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Agent/Actions.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Agent/Actions.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { MoreHorizontalIcon } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentGroupItem/index.tsx b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentGroupItem/index.tsx index 0a6e789f7d..a0c62afe48 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentGroupItem/index.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentGroupItem/index.tsx @@ -1,10 +1,10 @@ import { GROUP_CHAT_URL } from '@lobechat/const'; -import type { SidebarAgentItem } from '@lobechat/types'; +import { type SidebarAgentItem } from '@lobechat/types'; import { ActionIcon, Icon } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { Loader2, PinIcon } from 'lucide-react'; -import type {CSSProperties, DragEvent} from 'react'; -import { memo, useCallback, useMemo } from 'react'; +import { type CSSProperties, type DragEvent } from 'react'; +import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; diff --git a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentGroupItem/useDropdownMenu.tsx b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentGroupItem/useDropdownMenu.tsx index 7b58759fc9..275b05ca44 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentGroupItem/useDropdownMenu.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentGroupItem/useDropdownMenu.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { App } from 'antd'; import { LucideCopy, Pen, PictureInPicture2Icon, Pin, PinOff, Trash } from 'lucide-react'; import { useMemo } from 'react'; diff --git a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentItem/index.tsx b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentItem/index.tsx index 0244227f87..c50bee2dde 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentItem/index.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentItem/index.tsx @@ -1,10 +1,10 @@ import { SESSION_CHAT_URL } from '@lobechat/const'; -import type { SidebarAgentItem } from '@lobechat/types'; +import { type SidebarAgentItem } from '@lobechat/types'; import { ActionIcon, Icon } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { Loader2, PinIcon } from 'lucide-react'; -import type {CSSProperties, DragEvent} from 'react'; -import { memo, useCallback, useMemo } from 'react'; +import { type CSSProperties, type DragEvent } from 'react'; +import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; diff --git a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.tsx b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.tsx index 74cc1dc87e..d77847ff98 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentItem/useDropdownMenu.tsx @@ -1,6 +1,6 @@ import { SessionDefaultGroup } from '@lobechat/types'; -import type {MenuProps} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { App } from 'antd'; import isEqual from 'fast-deep-equal'; import { diff --git a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/Actions.tsx b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/Actions.tsx index 1a144f9087..8b4171b9c7 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/Actions.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/Actions.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { MoreHorizontalIcon } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/Item.tsx b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/Item.tsx index f9a3db1e44..390595eaa6 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/Item.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/Item.tsx @@ -1,4 +1,4 @@ -import type { SidebarGroup } from '@lobechat/types'; +import { type SidebarGroup } from '@lobechat/types'; import { AccordionItem, ContextMenuTrigger, Flexbox, Icon, Text } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { HashIcon, Loader2 } from 'lucide-react'; diff --git a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/index.tsx b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/index.tsx index 55bfabceb5..1d3720f876 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/index.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/index.tsx @@ -1,4 +1,4 @@ -import type { SidebarGroup } from '@lobechat/types'; +import { type SidebarGroup } from '@lobechat/types'; import { Accordion } from '@lobehub/ui'; import React, { memo } from 'react'; diff --git a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/useDropdownMenu.tsx b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/useDropdownMenu.tsx index 80ac3d3a1b..5f049fc1cc 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/useDropdownMenu.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/useDropdownMenu.tsx @@ -1,4 +1,4 @@ -import type {MenuProps} from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; import { useMemo } from 'react'; import { useCreateMenuItems, useSessionGroupMenuItems } from '../../../../hooks'; diff --git a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/InboxItem.tsx b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/InboxItem.tsx index 5e6aa0d696..4c4215afd9 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/InboxItem.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/InboxItem.tsx @@ -2,8 +2,8 @@ import { DEFAULT_INBOX_AVATAR, SESSION_CHAT_URL } from '@lobechat/const'; import { Avatar } from '@lobehub/ui'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; import { Link } from 'react-router-dom'; import NavItem from '@/features/NavPanel/components/NavItem'; diff --git a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Item/Actions.tsx b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Item/Actions.tsx index 5edb1535c1..6409785f4a 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Item/Actions.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Item/Actions.tsx @@ -1,5 +1,5 @@ -import type {DropdownItem} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type DropdownItem } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { MoreHorizontalIcon } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/List.tsx b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/List.tsx index bc4018eebe..b4dcd408d9 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Agent/List/List.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Agent/List/List.tsx @@ -1,8 +1,8 @@ -import type { SidebarAgentItem } from '@lobechat/types'; +import { type SidebarAgentItem } from '@lobechat/types'; import { Flexbox } from '@lobehub/ui'; import { MoreHorizontal } from 'lucide-react'; -import type {CSSProperties} from 'react'; -import { memo, useMemo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import EmptyNavItem from '@/features/NavPanel/components/EmptyNavItem'; diff --git a/src/app/[variants]/(main)/home/_layout/Body/Agent/ModalProvider.tsx b/src/app/[variants]/(main)/home/_layout/Body/Agent/ModalProvider.tsx index 451f937063..10eae74217 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Agent/ModalProvider.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Agent/ModalProvider.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {ReactNode} from 'react'; -import { createContext, memo, use, useMemo, useState } from 'react'; +import { type ReactNode } from 'react'; +import { createContext, memo, use, useMemo, useState } from 'react'; import { ChatGroupWizard } from '@/components/ChatGroupWizard'; import { MemberSelectionModal } from '@/components/MemberSelectionModal'; diff --git a/src/app/[variants]/(main)/home/_layout/Body/Agent/Modals/CreateGroupModal.tsx b/src/app/[variants]/(main)/home/_layout/Body/Agent/Modals/CreateGroupModal.tsx index 68e0e38723..ba1cea39a7 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Agent/Modals/CreateGroupModal.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Agent/Modals/CreateGroupModal.tsx @@ -1,8 +1,8 @@ -import type {ModalProps} from '@lobehub/ui'; -import { Flexbox,Input, Modal } from '@lobehub/ui'; +import { type ModalProps } from '@lobehub/ui'; +import { Flexbox, Input, Modal } from '@lobehub/ui'; import { App } from 'antd'; -import type {MouseEvent} from 'react'; -import { memo, useState } from 'react'; +import { type MouseEvent } from 'react'; +import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useGlobalStore } from '@/store/global'; diff --git a/src/app/[variants]/(main)/home/_layout/Body/Agent/useDropdownMenu.tsx b/src/app/[variants]/(main)/home/_layout/Body/Agent/useDropdownMenu.tsx index a19adb3bf0..90242eebec 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Agent/useDropdownMenu.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Agent/useDropdownMenu.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { Hash, LucideCheck } from 'lucide-react'; import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/home/_layout/Body/Project/List/Actions.tsx b/src/app/[variants]/(main)/home/_layout/Body/Project/List/Actions.tsx index 15f0853963..95da4701f4 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Project/List/Actions.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Project/List/Actions.tsx @@ -1,5 +1,5 @@ -import type {DropdownItem} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type DropdownItem } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { MoreHorizontalIcon } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/app/[variants]/(main)/home/_layout/Body/Project/List/useDropdownMenu.tsx b/src/app/[variants]/(main)/home/_layout/Body/Project/List/useDropdownMenu.tsx index b04225a684..086529d373 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Project/List/useDropdownMenu.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Project/List/useDropdownMenu.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { App } from 'antd'; import { PencilLine, Trash } from 'lucide-react'; import { useCallback } from 'react'; diff --git a/src/app/[variants]/(main)/home/_layout/Body/Project/useDropdownMenu.tsx b/src/app/[variants]/(main)/home/_layout/Body/Project/useDropdownMenu.tsx index d31263ae0c..28984836a5 100644 --- a/src/app/[variants]/(main)/home/_layout/Body/Project/useDropdownMenu.tsx +++ b/src/app/[variants]/(main)/home/_layout/Body/Project/useDropdownMenu.tsx @@ -1,4 +1,4 @@ -import type {MenuProps} from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; import { useMemo } from 'react'; import { useProjectMenuItems } from '../../hooks'; diff --git a/src/app/[variants]/(main)/home/_layout/CreateGroupModal/AvailableAgentList.tsx b/src/app/[variants]/(main)/home/_layout/CreateGroupModal/AvailableAgentList.tsx index 8fbd1deb31..a512c99759 100644 --- a/src/app/[variants]/(main)/home/_layout/CreateGroupModal/AvailableAgentList.tsx +++ b/src/app/[variants]/(main)/home/_layout/CreateGroupModal/AvailableAgentList.tsx @@ -2,14 +2,14 @@ import { Flexbox, SearchBar, Skeleton } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; -import type {ChangeEvent} from 'react'; -import { memo, useCallback, useMemo, useState } from 'react'; +import { type ChangeEvent } from 'react'; +import { memo, useCallback, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Virtuoso } from 'react-virtuoso'; import AgentSelectionEmpty from '@/features/AgentSelectionEmpty'; -import type {AgentItemData} from './AgentItem'; +import { type AgentItemData } from './AgentItem'; import AgentItem from './AgentItem'; const styles = createStaticStyles(({ css, cssVar }) => ({ diff --git a/src/app/[variants]/(main)/home/_layout/CreateGroupModal/SelectedAgentList.tsx b/src/app/[variants]/(main)/home/_layout/CreateGroupModal/SelectedAgentList.tsx index 03f29a3580..29e570a312 100644 --- a/src/app/[variants]/(main)/home/_layout/CreateGroupModal/SelectedAgentList.tsx +++ b/src/app/[variants]/(main)/home/_layout/CreateGroupModal/SelectedAgentList.tsx @@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next'; import AgentSelectionEmpty from '@/features/AgentSelectionEmpty'; -import type {AgentItemData} from './AgentItem'; +import { type AgentItemData } from './AgentItem'; import AgentItem from './AgentItem'; import { useAgentSelectionStore } from './store'; diff --git a/src/app/[variants]/(main)/home/_layout/CreateGroupModal/index.tsx b/src/app/[variants]/(main)/home/_layout/CreateGroupModal/index.tsx index 946040e81e..83c1dfff27 100644 --- a/src/app/[variants]/(main)/home/_layout/CreateGroupModal/index.tsx +++ b/src/app/[variants]/(main)/home/_layout/CreateGroupModal/index.tsx @@ -11,7 +11,7 @@ import { agentService } from '@/services/agent'; import { useGlobalStore } from '@/store/global'; import { useHomeStore } from '@/store/home'; -import type { AgentItemData } from './AgentItem'; +import { type AgentItemData } from './AgentItem'; import AvailableAgentList from './AvailableAgentList'; import SelectedAgentList from './SelectedAgentList'; import { useAgentSelectionStore } from './store'; diff --git a/src/app/[variants]/(main)/home/_layout/Footer/index.tsx b/src/app/[variants]/(main)/home/_layout/Footer/index.tsx index 25494107ff..8d36a39ff3 100644 --- a/src/app/[variants]/(main)/home/_layout/Footer/index.tsx +++ b/src/app/[variants]/(main)/home/_layout/Footer/index.tsx @@ -2,8 +2,8 @@ import { BRANDING_EMAIL, SOCIAL_URL } from '@lobechat/business-const'; import { useAnalytics } from '@lobehub/analytics/react'; -import type {MenuProps} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu, Flexbox,Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu, Flexbox, Icon } from '@lobehub/ui'; import { DiscordIcon } from '@lobehub/ui/icons'; import { Book, diff --git a/src/app/[variants]/(main)/home/_layout/Header/components/Nav.tsx b/src/app/[variants]/(main)/home/_layout/Header/components/Nav.tsx index c439c746da..6ff5f6aedc 100644 --- a/src/app/[variants]/(main)/home/_layout/Header/components/Nav.tsx +++ b/src/app/[variants]/(main)/home/_layout/Header/components/Nav.tsx @@ -12,7 +12,7 @@ import { useGlobalStore } from '@/store/global'; import { SidebarTabKey } from '@/store/global/initialState'; import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig'; -import type {NavItemProps} from '../../../../../../../features/NavPanel/components/NavItem'; +import { type NavItemProps } from '../../../../../../../features/NavPanel/components/NavItem'; import NavItem from '../../../../../../../features/NavPanel/components/NavItem'; interface Item { diff --git a/src/app/[variants]/(main)/home/_layout/hooks/useCreateMenuItems.tsx b/src/app/[variants]/(main)/home/_layout/hooks/useCreateMenuItems.tsx index f021a06da9..d9cf3dd227 100644 --- a/src/app/[variants]/(main)/home/_layout/hooks/useCreateMenuItems.tsx +++ b/src/app/[variants]/(main)/home/_layout/hooks/useCreateMenuItems.tsx @@ -1,7 +1,7 @@ import { Icon } from '@lobehub/ui'; import { GroupBotSquareIcon } from '@lobehub/ui/icons'; import { App } from 'antd'; -import type {ItemType} from 'antd/es/menu/interface'; +import { type ItemType } from 'antd/es/menu/interface'; import { BotIcon, FileTextIcon, FolderCogIcon, FolderPlus } from 'lucide-react'; import { useCallback, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -10,7 +10,7 @@ import useSWRMutation from 'swr/mutation'; import { useGroupTemplates } from '@/components/ChatGroupWizard/templates'; import { DEFAULT_CHAT_GROUP_CHAT_CONFIG } from '@/const/settings'; -import type {GroupMemberConfig} from '@/services/chatGroup'; +import { type GroupMemberConfig } from '@/services/chatGroup'; import { chatGroupService } from '@/services/chatGroup'; import { useAgentStore } from '@/store/agent'; import { useAgentGroupStore } from '@/store/agentGroup'; diff --git a/src/app/[variants]/(main)/home/_layout/hooks/useProjectMenuItems.tsx b/src/app/[variants]/(main)/home/_layout/hooks/useProjectMenuItems.tsx index 2d151d2e65..0b9e970246 100644 --- a/src/app/[variants]/(main)/home/_layout/hooks/useProjectMenuItems.tsx +++ b/src/app/[variants]/(main)/home/_layout/hooks/useProjectMenuItems.tsx @@ -1,5 +1,5 @@ import { Icon } from '@lobehub/ui'; -import type {ItemType} from 'antd/es/menu/interface'; +import { type ItemType } from 'antd/es/menu/interface'; import { BoxIcon } from 'lucide-react'; import { useCallback } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/home/_layout/hooks/useSessionGroupMenuItems.tsx b/src/app/[variants]/(main)/home/_layout/hooks/useSessionGroupMenuItems.tsx index df97b03741..9d59f1ee40 100644 --- a/src/app/[variants]/(main)/home/_layout/hooks/useSessionGroupMenuItems.tsx +++ b/src/app/[variants]/(main)/home/_layout/hooks/useSessionGroupMenuItems.tsx @@ -1,6 +1,6 @@ import { Icon } from '@lobehub/ui'; import { App } from 'antd'; -import type {ItemType} from 'antd/es/menu/interface'; +import { type ItemType } from 'antd/es/menu/interface'; import { createStaticStyles } from 'antd-style'; import { FolderCogIcon, FolderPenIcon, Trash } from 'lucide-react'; import { useCallback, useState } from 'react'; @@ -106,7 +106,6 @@ export const useSessionGroupMenuItems = () => { * Create agent in group menu item */ const createAgentInGroupMenuItem = useCallback( - (groupId: string, _isPinned?: boolean): ItemType => { const iconElement = ; return { diff --git a/src/app/[variants]/(main)/home/_layout/index.tsx b/src/app/[variants]/(main)/home/_layout/index.tsx index c51103cfcc..ee7fbdf9c5 100644 --- a/src/app/[variants]/(main)/home/_layout/index.tsx +++ b/src/app/[variants]/(main)/home/_layout/index.tsx @@ -1,7 +1,7 @@ import { Flexbox } from '@lobehub/ui'; import { useTheme } from 'antd-style'; -import type {FC, ReactNode} from 'react'; -import { Activity, useEffect, useMemo, useState } from 'react'; +import { type FC, type ReactNode } from 'react'; +import { Activity, useEffect, useMemo, useState } from 'react'; import { Outlet, useLocation, useNavigate } from 'react-router-dom'; import { useIsDark } from '@/hooks/useIsDark'; diff --git a/src/app/[variants]/(main)/home/features/CommunityAgents/Item.tsx b/src/app/[variants]/(main)/home/features/CommunityAgents/Item.tsx index 68a530ee37..06636b7c1c 100644 --- a/src/app/[variants]/(main)/home/features/CommunityAgents/Item.tsx +++ b/src/app/[variants]/(main)/home/features/CommunityAgents/Item.tsx @@ -5,7 +5,7 @@ import { memo } from 'react'; import { RECENT_BLOCK_SIZE } from '@/app/[variants]/(main)/home/features/const'; import { DEFAULT_AVATAR } from '@/const/meta'; import { useIsDark } from '@/hooks/useIsDark'; -import type {DiscoverAssistantItem} from '@/types/discover'; +import { type DiscoverAssistantItem } from '@/types/discover'; const CommunityAgentItem = memo( ({ title, avatar, backgroundColor, author, description }) => { diff --git a/src/app/[variants]/(main)/home/features/CommunityRecommend/AssistantList.tsx b/src/app/[variants]/(main)/home/features/CommunityRecommend/AssistantList.tsx index e6c95bec2a..872ae89bb0 100644 --- a/src/app/[variants]/(main)/home/features/CommunityRecommend/AssistantList.tsx +++ b/src/app/[variants]/(main)/home/features/CommunityRecommend/AssistantList.tsx @@ -7,7 +7,7 @@ import urlJoin from 'url-join'; import GroupSkeleton from '@/app/[variants]/(main)/home/features/components/GroupSkeleton'; import { RECENT_BLOCK_SIZE } from '@/app/[variants]/(main)/home/features/const'; import { useDiscoverStore } from '@/store/discover'; -import type { StarterMode } from '@/store/home'; +import { type StarterMode } from '@/store/home'; import { AssistantCategory } from '@/types/discover'; import Item from './Item'; diff --git a/src/app/[variants]/(main)/home/features/CommunityRecommend/index.tsx b/src/app/[variants]/(main)/home/features/CommunityRecommend/index.tsx index edb3a1cf33..5d8d3898bb 100644 --- a/src/app/[variants]/(main)/home/features/CommunityRecommend/index.tsx +++ b/src/app/[variants]/(main)/home/features/CommunityRecommend/index.tsx @@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; import { useDiscoverStore } from '@/store/discover'; -import type { StarterMode } from '@/store/home'; +import { type StarterMode } from '@/store/home'; import { AssistantCategory } from '@/types/discover'; import GroupBlock from '../components/GroupBlock'; diff --git a/src/app/[variants]/(main)/home/features/FeaturedPlugins/Item.tsx b/src/app/[variants]/(main)/home/features/FeaturedPlugins/Item.tsx index d6b5116ab1..e2434f12f4 100644 --- a/src/app/[variants]/(main)/home/features/FeaturedPlugins/Item.tsx +++ b/src/app/[variants]/(main)/home/features/FeaturedPlugins/Item.tsx @@ -4,7 +4,7 @@ import { memo } from 'react'; import MetaInfo from '@/app/[variants]/(main)/community/(list)/mcp/features/List/MetaInfo'; import { RECENT_BLOCK_SIZE } from '@/app/[variants]/(main)/home/features/const'; -import type {DiscoverMcpItem} from '@/types/discover'; +import { type DiscoverMcpItem } from '@/types/discover'; const FeaturedPluginItem = memo(({ name, icon, github, installCount }) => { return ( diff --git a/src/app/[variants]/(main)/home/features/InputArea/StarterList.tsx b/src/app/[variants]/(main)/home/features/InputArea/StarterList.tsx index f16a2fc5c1..21ff764734 100644 --- a/src/app/[variants]/(main)/home/features/InputArea/StarterList.tsx +++ b/src/app/[variants]/(main)/home/features/InputArea/StarterList.tsx @@ -1,6 +1,6 @@ import { BUILTIN_AGENT_SLUGS } from '@lobechat/builtin-agents'; -import type {ButtonProps} from '@lobehub/ui'; -import { Button, Center, Tooltip } from '@lobehub/ui'; +import { type ButtonProps } from '@lobehub/ui'; +import { Button, Center, Tooltip } from '@lobehub/ui'; import { GroupBotSquareIcon } from '@lobehub/ui/icons'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import { BotIcon, PenLineIcon } from 'lucide-react'; @@ -8,8 +8,8 @@ import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useInitBuiltinAgent } from '@/hooks/useInitBuiltinAgent'; -import type {StarterMode} from '@/store/home'; -import { useHomeStore } from '@/store/home'; +import { type StarterMode } from '@/store/home'; +import { useHomeStore } from '@/store/home'; const styles = createStaticStyles(({ css, cssVar }) => ({ active: css` diff --git a/src/app/[variants]/(main)/home/features/InputArea/index.tsx b/src/app/[variants]/(main)/home/features/InputArea/index.tsx index aa873148ce..590b9ad06e 100644 --- a/src/app/[variants]/(main)/home/features/InputArea/index.tsx +++ b/src/app/[variants]/(main)/home/features/InputArea/index.tsx @@ -3,8 +3,8 @@ import { AnimatePresence, m as motion } from 'motion/react'; import { useMemo } from 'react'; import DragUploadZone, { useUploadFiles } from '@/components/DragUploadZone'; -import type {ActionKeys} from '@/features/ChatInput'; -import { ChatInputProvider, DesktopChatInput } from '@/features/ChatInput'; +import { type ActionKeys } from '@/features/ChatInput'; +import { ChatInputProvider, DesktopChatInput } from '@/features/ChatInput'; import { useAgentStore } from '@/store/agent'; import { agentByIdSelectors } from '@/store/agent/selectors'; import { useChatStore } from '@/store/chat'; diff --git a/src/app/[variants]/(main)/home/features/RecentPage/Item.tsx b/src/app/[variants]/(main)/home/features/RecentPage/Item.tsx index 47e4e03034..efc3e59f0b 100644 --- a/src/app/[variants]/(main)/home/features/RecentPage/Item.tsx +++ b/src/app/[variants]/(main)/home/features/RecentPage/Item.tsx @@ -7,7 +7,7 @@ import { memo } from 'react'; import Time from '@/app/[variants]/(main)/home/features/components/Time'; import { RECENT_BLOCK_SIZE } from '@/app/[variants]/(main)/home/features/const'; -import type {FileListItem} from '@/types/files'; +import { type FileListItem } from '@/types/files'; import markdownToTxt from '@/utils/markdownToTxt'; // Helper to extract title from markdown content diff --git a/src/app/[variants]/(main)/home/features/RecentResource/Item.tsx b/src/app/[variants]/(main)/home/features/RecentResource/Item.tsx index 5c555a896d..0ebd1ba983 100644 --- a/src/app/[variants]/(main)/home/features/RecentResource/Item.tsx +++ b/src/app/[variants]/(main)/home/features/RecentResource/Item.tsx @@ -7,7 +7,7 @@ import { memo } from 'react'; import Time from '@/app/[variants]/(main)/home/features/components/Time'; import { RECENT_BLOCK_SIZE } from '@/app/[variants]/(main)/home/features/const'; import FileIcon from '@/components/FileIcon'; -import type {FileListItem} from '@/types/files'; +import { type FileListItem } from '@/types/files'; import { formatSize } from '@/utils/format'; const IMAGE_FILE_TYPES = new Set([ diff --git a/src/app/[variants]/(main)/home/features/RecentTopic/Item.tsx b/src/app/[variants]/(main)/home/features/RecentTopic/Item.tsx index bb38176575..b1ec01bc98 100644 --- a/src/app/[variants]/(main)/home/features/RecentTopic/Item.tsx +++ b/src/app/[variants]/(main)/home/features/RecentTopic/Item.tsx @@ -6,7 +6,7 @@ import Time from '@/app/[variants]/(main)/home/features/components/Time'; import { RECENT_BLOCK_SIZE } from '@/app/[variants]/(main)/home/features/const'; import { DEFAULT_AVATAR } from '@/const/meta'; import GroupAvatar from '@/features/GroupAvatar'; -import type {RecentTopic} from '@/types/topic'; +import { type RecentTopic } from '@/types/topic'; const ReactTopicItem = memo(({ title, updatedAt, agent, group, type }) => { const isGroup = type === 'group'; diff --git a/src/app/[variants]/(main)/home/features/SuggestQuestions/List.tsx b/src/app/[variants]/(main)/home/features/SuggestQuestions/List.tsx index 6911cc7cac..e9677bc300 100644 --- a/src/app/[variants]/(main)/home/features/SuggestQuestions/List.tsx +++ b/src/app/[variants]/(main)/home/features/SuggestQuestions/List.tsx @@ -5,7 +5,7 @@ import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import Item from './Item'; -import type { QuestionItem } from './useRandomQuestions'; +import { type QuestionItem } from './useRandomQuestions'; interface ListProps { questions: QuestionItem[]; diff --git a/src/app/[variants]/(main)/home/features/SuggestQuestions/index.tsx b/src/app/[variants]/(main)/home/features/SuggestQuestions/index.tsx index a8d3c94787..cfd2f98aed 100644 --- a/src/app/[variants]/(main)/home/features/SuggestQuestions/index.tsx +++ b/src/app/[variants]/(main)/home/features/SuggestQuestions/index.tsx @@ -6,7 +6,7 @@ import { Lightbulb, RefreshCw } from 'lucide-react'; import { memo, Suspense } from 'react'; import { useTranslation } from 'react-i18next'; -import type { StarterMode } from '@/store/home'; +import { type StarterMode } from '@/store/home'; import GroupBlock from '../components/GroupBlock'; import List from './List'; diff --git a/src/app/[variants]/(main)/home/features/SuggestQuestions/useRandomQuestions.ts b/src/app/[variants]/(main)/home/features/SuggestQuestions/useRandomQuestions.ts index d9376f9038..17ded5116a 100644 --- a/src/app/[variants]/(main)/home/features/SuggestQuestions/useRandomQuestions.ts +++ b/src/app/[variants]/(main)/home/features/SuggestQuestions/useRandomQuestions.ts @@ -1,6 +1,6 @@ import { useCallback, useState } from 'react'; -import type { StarterMode } from '@/store/home'; +import { type StarterMode } from '@/store/home'; const QUESTION_COUNT = 40; const DISPLAY_COUNT = 6; diff --git a/src/app/[variants]/(main)/home/features/components/GroupBlock/index.tsx b/src/app/[variants]/(main)/home/features/components/GroupBlock/index.tsx index 3b9688f97e..17f5f3421d 100644 --- a/src/app/[variants]/(main)/home/features/components/GroupBlock/index.tsx +++ b/src/app/[variants]/(main)/home/features/components/GroupBlock/index.tsx @@ -1,7 +1,7 @@ -import type { FlexboxProps, IconProps } from '@lobehub/ui'; +import { type FlexboxProps, type IconProps } from '@lobehub/ui'; import { Flexbox, Icon, Text } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { memo, Suspense, useState } from 'react'; interface GroupBlockProps extends Omit { diff --git a/src/app/[variants]/(main)/home/features/components/ScrollShadowWithButton/index.tsx b/src/app/[variants]/(main)/home/features/components/ScrollShadowWithButton/index.tsx index c011fa08b7..cc7c1f55a4 100644 --- a/src/app/[variants]/(main)/home/features/components/ScrollShadowWithButton/index.tsx +++ b/src/app/[variants]/(main)/home/features/components/ScrollShadowWithButton/index.tsx @@ -1,5 +1,5 @@ -import type {FlexboxProps} from '@lobehub/ui'; -import { Button, Flexbox, ScrollShadow } from '@lobehub/ui'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Button, Flexbox, ScrollShadow } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; import { ChevronLeft, ChevronRight } from 'lucide-react'; import { memo, useCallback, useEffect, useRef, useState } from 'react'; diff --git a/src/app/[variants]/(main)/home/index.tsx b/src/app/[variants]/(main)/home/index.tsx index 6ca963014c..8c92a1805b 100644 --- a/src/app/[variants]/(main)/home/index.tsx +++ b/src/app/[variants]/(main)/home/index.tsx @@ -1,5 +1,5 @@ import { Flexbox } from '@lobehub/ui'; -import type {FC} from 'react'; +import { type FC } from 'react'; import { useLocation } from 'react-router-dom'; import PageTitle from '@/components/PageTitle'; diff --git a/src/app/[variants]/(main)/hooks/useActiveTabKey.ts b/src/app/[variants]/(main)/hooks/useActiveTabKey.ts index 35ac788720..55c917c7fa 100644 --- a/src/app/[variants]/(main)/hooks/useActiveTabKey.ts +++ b/src/app/[variants]/(main)/hooks/useActiveTabKey.ts @@ -1,6 +1,6 @@ import { usePathname, useSearchParams } from '@/libs/router/navigation'; -import type {SidebarTabKey} from '@/store/global/initialState'; -import { ProfileTabs, SettingsTabs } from '@/store/global/initialState'; +import { type SidebarTabKey } from '@/store/global/initialState'; +import { ProfileTabs, SettingsTabs } from '@/store/global/initialState'; /** * Returns the active tab key (chat/discover/settings/...) diff --git a/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/AspectRatioSelect/index.tsx b/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/AspectRatioSelect/index.tsx index d50cb57cf5..103fbfa484 100644 --- a/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/AspectRatioSelect/index.tsx +++ b/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/AspectRatioSelect/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {GridProps} from '@lobehub/ui'; -import { Block, Center, Grid, Text } from '@lobehub/ui'; +import { type GridProps } from '@lobehub/ui'; +import { Block, Center, Grid, Text } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { memo } from 'react'; import useMergeState from 'use-merge-value'; 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 28411059d0..5b364fcf4b 100644 --- a/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ImageUpload.tsx +++ b/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ImageUpload.tsx @@ -4,8 +4,8 @@ import { Center } from '@lobehub/ui'; import { App } from 'antd'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import { Image as ImageIcon, X } from 'lucide-react'; -import type {FC} from 'react'; -import React, { memo, useEffect, useRef, useState } from 'react'; +import { type FC } from 'react'; +import React, { memo, useEffect, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useDragAndDrop } from '@/app/[variants]/(main)/image/_layout/ConfigPanel/hooks/useDragAndDrop'; @@ -13,7 +13,7 @@ import { useUploadFilesValidation } from '@/app/[variants]/(main)/image/_layout/ import { configPanelStyles } from '@/app/[variants]/(main)/image/_layout/ConfigPanel/style'; import Image from '@/libs/next/Image'; import { useFileStore } from '@/store/file'; -import type {FileUploadStatus} from '@/types/files/upload'; +import { type FileUploadStatus } from '@/types/files/upload'; // ======== Business Types ======== // diff --git a/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/InputNumber/index.tsx b/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/InputNumber/index.tsx index c1d65d2352..75508f06b9 100644 --- a/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/InputNumber/index.tsx +++ b/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/InputNumber/index.tsx @@ -3,8 +3,8 @@ import { Button, Flexbox, InputNumber, Tooltip } from '@lobehub/ui'; import { Dices } from 'lucide-react'; import { MAX_SEED } from 'model-bank'; -import type {CSSProperties} from 'react'; -import { memo, useCallback } from 'react'; +import { type CSSProperties } from 'react'; +import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { generateUniqueSeeds } from '@/utils/number'; diff --git a/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ModelSelect/ImageModelItem.tsx b/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ModelSelect/ImageModelItem.tsx index 9964ebc80b..45e37ed0b9 100644 --- a/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ModelSelect/ImageModelItem.tsx +++ b/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ModelSelect/ImageModelItem.tsx @@ -3,7 +3,7 @@ import { CREDITS_PER_DOLLAR } from '@lobechat/const/currency'; import { ModelIcon } from '@lobehub/icons'; import { Flexbox, Popover, Text } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; -import type {AiModelForSelect} from 'model-bank'; +import { type AiModelForSelect } from 'model-bank'; import numeral from 'numeral'; import { memo, useMemo } from 'react'; diff --git a/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ModelSelect/index.tsx b/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ModelSelect/index.tsx index 955a31c3ef..7fd5840c0b 100644 --- a/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ModelSelect/index.tsx +++ b/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ModelSelect/index.tsx @@ -1,5 +1,5 @@ -import type {SelectProps} from '@lobehub/ui'; -import { ActionIcon, Flexbox,Icon, Select } from '@lobehub/ui'; +import { type SelectProps } from '@lobehub/ui'; +import { ActionIcon, Flexbox, Icon, Select } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; import { LucideArrowRight, LucideBolt } from 'lucide-react'; import { memo, useMemo } from 'react'; @@ -11,7 +11,7 @@ import { useAiInfraStore } from '@/store/aiInfra'; import { aiProviderSelectors } from '@/store/aiInfra/slices/aiProvider/selectors'; import { useImageStore } from '@/store/image'; import { imageGenerationConfigSelectors } from '@/store/image/selectors'; -import type {EnabledProviderWithModels} from '@/types/index'; +import { type EnabledProviderWithModels } from '@/types/index'; import ImageModelItem from './ImageModelItem'; diff --git a/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/MultiImagesUpload/ImageManageModal.tsx b/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/MultiImagesUpload/ImageManageModal.tsx index 558c7d3384..068cb16c1a 100644 --- a/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/MultiImagesUpload/ImageManageModal.tsx +++ b/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/MultiImagesUpload/ImageManageModal.tsx @@ -3,8 +3,8 @@ import { Button, Modal } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; import { Upload, X } from 'lucide-react'; -import type {FC} from 'react'; -import React, { memo, useEffect, useRef, useState } from 'react'; +import { type FC } from 'react'; +import React, { memo, useEffect, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useUploadFilesValidation } from '@/app/[variants]/(main)/image/_layout/ConfigPanel/hooks/useUploadFilesValidation'; diff --git a/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/MultiImagesUpload/index.tsx b/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/MultiImagesUpload/index.tsx index 447453292d..fdb2b40eeb 100644 --- a/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/MultiImagesUpload/index.tsx +++ b/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/MultiImagesUpload/index.tsx @@ -4,7 +4,7 @@ import { Center } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import { Image as ImageIcon, X } from 'lucide-react'; -import type { FC } from 'react'; +import { type FC } from 'react'; import React, { memo, useEffect, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -14,9 +14,9 @@ import { useUploadFilesValidation } from '@/app/[variants]/(main)/image/_layout/ import { configPanelStyles } from '@/app/[variants]/(main)/image/_layout/ConfigPanel/style'; import Image from '@/libs/next/Image'; import { useFileStore } from '@/store/file'; -import type { FileUploadStatus } from '@/types/files/upload'; +import { type FileUploadStatus } from '@/types/files/upload'; -import type { ImageItem } from './ImageManageModal'; +import { type ImageItem } from './ImageManageModal'; import ImageManageModal from './ImageManageModal'; // ======== Business Types ======== // diff --git a/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/Select/index.tsx b/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/Select/index.tsx index e2ef5242e7..3a39bc02f8 100644 --- a/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/Select/index.tsx +++ b/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/Select/index.tsx @@ -1,9 +1,9 @@ 'use client'; -import type {GridProps} from '@lobehub/ui'; -import { Block, Center, Grid, Select, Text } from '@lobehub/ui'; +import { type GridProps } from '@lobehub/ui'; +import { Block, Center, Grid, Select, Text } from '@lobehub/ui'; import { cssVar } from 'antd-style'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import useMergeState from 'use-merge-value'; diff --git a/src/app/[variants]/(main)/image/_layout/ConfigPanel/index.tsx b/src/app/[variants]/(main)/image/_layout/ConfigPanel/index.tsx index 885ef388a1..5437b390a3 100644 --- a/src/app/[variants]/(main)/image/_layout/ConfigPanel/index.tsx +++ b/src/app/[variants]/(main)/image/_layout/ConfigPanel/index.tsx @@ -1,7 +1,7 @@ 'use client'; import { Flexbox, Text } from '@lobehub/ui'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/image/_layout/Header.tsx b/src/app/[variants]/(main)/image/_layout/Header.tsx index ad99e6f39d..70810bb39b 100644 --- a/src/app/[variants]/(main)/image/_layout/Header.tsx +++ b/src/app/[variants]/(main)/image/_layout/Header.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/image/_layout/Topics/TopicItem.tsx b/src/app/[variants]/(main)/image/_layout/Topics/TopicItem.tsx index 6bf72afd26..1c677b9634 100644 --- a/src/app/[variants]/(main)/image/_layout/Topics/TopicItem.tsx +++ b/src/app/[variants]/(main)/image/_layout/Topics/TopicItem.tsx @@ -11,7 +11,7 @@ import { useGlobalStore } from '@/store/global'; import { globalGeneralSelectors } from '@/store/global/selectors'; import { useImageStore } from '@/store/image'; import { generationTopicSelectors } from '@/store/image/slices/generationTopic/selectors'; -import type {ImageGenerationTopic} from '@/types/generation'; +import { type ImageGenerationTopic } from '@/types/generation'; const formatTime = (date: Date, locale: string) => { return new Intl.DateTimeFormat(locale, { diff --git a/src/app/[variants]/(main)/image/_layout/index.tsx b/src/app/[variants]/(main)/image/_layout/index.tsx index f9e6b32985..d7db3c62fc 100644 --- a/src/app/[variants]/(main)/image/_layout/index.tsx +++ b/src/app/[variants]/(main)/image/_layout/index.tsx @@ -1,5 +1,5 @@ import { Flexbox } from '@lobehub/ui'; -import type {FC} from 'react'; +import { type FC } from 'react'; import { Outlet } from 'react-router-dom'; import RegisterHotkeys from './RegisterHotkeys'; diff --git a/src/app/[variants]/(main)/image/_layout/type.ts b/src/app/[variants]/(main)/image/_layout/type.ts index 99688e1e9b..56afe6afe0 100644 --- a/src/app/[variants]/(main)/image/_layout/type.ts +++ b/src/app/[variants]/(main)/image/_layout/type.ts @@ -1,4 +1,4 @@ -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; export interface LayoutProps { children: ReactNode; diff --git a/src/app/[variants]/(main)/image/features/GenerationFeed/BatchItem.tsx b/src/app/[variants]/(main)/image/features/GenerationFeed/BatchItem.tsx index f1292f5d68..2128e8f968 100644 --- a/src/app/[variants]/(main)/image/features/GenerationFeed/BatchItem.tsx +++ b/src/app/[variants]/(main)/image/features/GenerationFeed/BatchItem.tsx @@ -9,7 +9,7 @@ import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; import { omit } from 'es-toolkit/compat'; import { CopyIcon, RotateCcwSquareIcon, Trash2 } from 'lucide-react'; -import type {RuntimeImageGenParams} from 'model-bank'; +import { type RuntimeImageGenParams } from 'model-bank'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -17,7 +17,7 @@ import useRenderBusinessBatchItem from '@/business/client/hooks/useRenderBusines import APIKeyForm from '@/components/InvalidAPIKey'; import { useImageStore } from '@/store/image'; import { AsyncTaskErrorType } from '@/types/asyncTask'; -import type {GenerationBatch} from '@/types/generation'; +import { type GenerationBatch } from '@/types/generation'; import { GenerationItem } from './GenerationItem'; import { DEFAULT_MAX_ITEM_WIDTH } from './GenerationItem/utils'; diff --git a/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/ActionButtons.tsx b/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/ActionButtons.tsx index d811e44fc7..dee82c9dc7 100644 --- a/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/ActionButtons.tsx +++ b/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/ActionButtons.tsx @@ -1,13 +1,13 @@ 'use client'; -import type {ActionIconGroupProps, ActionIconProps} from '@lobehub/ui'; -import { ActionIconGroup } from '@lobehub/ui'; +import { type ActionIconGroupProps, type ActionIconProps } from '@lobehub/ui'; +import { ActionIconGroup } from '@lobehub/ui'; import { Dices, Download, Trash2 } from 'lucide-react'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { styles } from './styles'; -import type {ActionButtonsProps} from './types'; +import { type ActionButtonsProps } from './types'; const actionIconProps: Partial> = { tooltipProps: { placement: 'left' }, diff --git a/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/ErrorState.tsx b/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/ErrorState.tsx index 27d5f2cfc6..5e4e43cb62 100644 --- a/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/ErrorState.tsx +++ b/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/ErrorState.tsx @@ -9,7 +9,7 @@ import { useTranslation } from 'react-i18next'; import { ActionButtons } from './ActionButtons'; import { styles } from './styles'; -import type {ErrorStateProps} from './types'; +import { type ErrorStateProps } from './types'; import { getThumbnailMaxWidth } from './utils'; // 错误状态组件 diff --git a/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/LoadingState.tsx b/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/LoadingState.tsx index 97b3a9e8ea..455019a594 100644 --- a/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/LoadingState.tsx +++ b/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/LoadingState.tsx @@ -10,7 +10,7 @@ import { AsyncTaskStatus } from '@/types/asyncTask'; import { ActionButtons } from './ActionButtons'; import { ElapsedTime } from './ElapsedTime'; import { styles } from './styles'; -import type {LoadingStateProps} from './types'; +import { type LoadingStateProps } from './types'; import { getThumbnailMaxWidth } from './utils'; // 加载状态组件 diff --git a/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/SuccessState.tsx b/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/SuccessState.tsx index 0d27a4a048..af2c5ac819 100644 --- a/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/SuccessState.tsx +++ b/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/SuccessState.tsx @@ -7,7 +7,7 @@ import ImageItem from '@/components/ImageItem'; import { ActionButtons } from './ActionButtons'; import { styles } from './styles'; -import type {SuccessStateProps} from './types'; +import { type SuccessStateProps } from './types'; import { getThumbnailMaxWidth } from './utils'; // 成功状态组件 diff --git a/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/index.tsx b/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/index.tsx index 34b8814b09..2f17999868 100644 --- a/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/index.tsx +++ b/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/index.tsx @@ -14,7 +14,7 @@ import { inferFileExtensionFromImageUrl } from '@/utils/url'; import { ErrorState } from './ErrorState'; import { LoadingState } from './LoadingState'; import { SuccessState } from './SuccessState'; -import type {GenerationItemProps} from './types'; +import { type GenerationItemProps } from './types'; import { getAspectRatio } from './utils'; const isSupportedParamSelector = imageGenerationConfigSelectors.isSupportedParam; diff --git a/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/types.ts b/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/types.ts index 7be4548416..2f8e61991e 100644 --- a/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/types.ts +++ b/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/types.ts @@ -1,4 +1,4 @@ -import type {Generation, GenerationBatch} from '@/types/generation'; +import { type Generation, type GenerationBatch } from '@/types/generation'; export interface GenerationItemProps { generation: Generation; diff --git a/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/utils.test.ts b/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/utils.test.ts index a7063e693b..e5a3ae3fa1 100644 --- a/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/utils.test.ts +++ b/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/utils.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import type { Generation, GenerationBatch } from '@/types/generation'; +import { type Generation, type GenerationBatch } from '@/types/generation'; // Import functions for testing import { diff --git a/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/utils.ts b/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/utils.ts index 92bdd0e72c..74569ecb37 100644 --- a/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/utils.ts +++ b/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/utils.ts @@ -1,4 +1,4 @@ -import type {Generation, GenerationBatch} from '@/types/generation'; +import { type Generation, type GenerationBatch } from '@/types/generation'; // Default maximum width for image items export const DEFAULT_MAX_ITEM_WIDTH = 200; diff --git a/src/app/[variants]/(main)/image/features/PromptInput/index.tsx b/src/app/[variants]/(main)/image/features/PromptInput/index.tsx index 3e1d26b79d..cadf2555c8 100644 --- a/src/app/[variants]/(main)/image/features/PromptInput/index.tsx +++ b/src/app/[variants]/(main)/image/features/PromptInput/index.tsx @@ -4,7 +4,7 @@ import { ChatInput } from '@lobehub/editor/react'; import { Button, Flexbox, TextArea } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; import { Sparkles } from 'lucide-react'; -import type { KeyboardEvent } from 'react'; +import { type KeyboardEvent } from 'react'; import { useEffect, useRef } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/memory/(home)/features/RoleTagCloud/TagCloudCanvas.tsx b/src/app/[variants]/(main)/memory/(home)/features/RoleTagCloud/TagCloudCanvas.tsx index 99ed4b53cd..5c33b2630d 100644 --- a/src/app/[variants]/(main)/memory/(home)/features/RoleTagCloud/TagCloudCanvas.tsx +++ b/src/app/[variants]/(main)/memory/(home)/features/RoleTagCloud/TagCloudCanvas.tsx @@ -4,7 +4,7 @@ import { useTheme } from 'antd-style'; import { memo, Suspense, useEffect, useMemo, useRef, useState } from 'react'; import * as THREE from 'three'; -import type {QueryTagsResult} from '@/database/models/userMemory'; +import { type QueryTagsResult } from '@/database/models/userMemory'; import UserAvatar from '@/features/User/UserAvatar'; // 配置常量 diff --git a/src/app/[variants]/(main)/memory/(home)/features/RoleTagCloud/index.tsx b/src/app/[variants]/(main)/memory/(home)/features/RoleTagCloud/index.tsx index a706d5e8c3..7b94e3bd68 100644 --- a/src/app/[variants]/(main)/memory/(home)/features/RoleTagCloud/index.tsx +++ b/src/app/[variants]/(main)/memory/(home)/features/RoleTagCloud/index.tsx @@ -5,7 +5,7 @@ import { memo, useEffect, useState } from 'react'; import Loading from '@/components/Loading/BrandTextLoading'; import { DESKTOP_HEADER_ICON_SIZE } from '@/const/layoutTokens'; -import type {QueryTagsResult} from '@/database/models/userMemory'; +import { type QueryTagsResult } from '@/database/models/userMemory'; import dynamic from '@/libs/next/dynamic'; const TagCloudCanvas = dynamic(() => import('./TagCloudCanvas'), { diff --git a/src/app/[variants]/(main)/memory/(home)/index.tsx b/src/app/[variants]/(main)/memory/(home)/index.tsx index 92996c67fe..ea31cc45a8 100644 --- a/src/app/[variants]/(main)/memory/(home)/index.tsx +++ b/src/app/[variants]/(main)/memory/(home)/index.tsx @@ -1,6 +1,6 @@ import { Flexbox } from '@lobehub/ui'; // import { PencilLineIcon } from 'lucide-react'; -import type {FC} from 'react'; +import { type FC } from 'react'; import MemoryAnalysis from '@/app/[variants]/(main)/memory/features/MemoryAnalysis'; import MemoryEmpty from '@/app/[variants]/(main)/memory/features/MemoryEmpty'; diff --git a/src/app/[variants]/(main)/memory/_layout/Sidebar/Header/Nav.tsx b/src/app/[variants]/(main)/memory/_layout/Sidebar/Header/Nav.tsx index 8340a814d3..881d6e6342 100644 --- a/src/app/[variants]/(main)/memory/_layout/Sidebar/Header/Nav.tsx +++ b/src/app/[variants]/(main)/memory/_layout/Sidebar/Header/Nav.tsx @@ -14,7 +14,7 @@ import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { Link, useNavigate } from 'react-router-dom'; -import type {NavItemProps} from '@/features/NavPanel/components/NavItem'; +import { type NavItemProps } from '@/features/NavPanel/components/NavItem'; import NavItem from '@/features/NavPanel/components/NavItem'; import { usePathname } from '@/libs/router/navigation'; import { useGlobalStore } from '@/store/global'; diff --git a/src/app/[variants]/(main)/memory/_layout/Sidebar/Header/index.tsx b/src/app/[variants]/(main)/memory/_layout/Sidebar/Header/index.tsx index c38639da80..eacc34f5e1 100644 --- a/src/app/[variants]/(main)/memory/_layout/Sidebar/Header/index.tsx +++ b/src/app/[variants]/(main)/memory/_layout/Sidebar/Header/index.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/memory/_layout/index.tsx b/src/app/[variants]/(main)/memory/_layout/index.tsx index 4b11ec0a08..397ba9ad82 100644 --- a/src/app/[variants]/(main)/memory/_layout/index.tsx +++ b/src/app/[variants]/(main)/memory/_layout/index.tsx @@ -1,7 +1,7 @@ 'use client'; import { Flexbox } from '@lobehub/ui'; -import type {FC} from 'react'; +import { type FC } from 'react'; import { Outlet } from 'react-router-dom'; import Sidebar from './Sidebar'; diff --git a/src/app/[variants]/(main)/memory/activities/features/ActivityDropdown.tsx b/src/app/[variants]/(main)/memory/activities/features/ActivityDropdown.tsx index a37a099fa0..40ba63dec5 100644 --- a/src/app/[variants]/(main)/memory/activities/features/ActivityDropdown.tsx +++ b/src/app/[variants]/(main)/memory/activities/features/ActivityDropdown.tsx @@ -1,9 +1,9 @@ -import type {ActionIconProps} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type ActionIconProps } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { App } from 'antd'; import { MoreHorizontal, Pencil, Trash2 } from 'lucide-react'; -import type {KeyboardEvent, MouseEvent} from 'react'; -import { memo } from 'react'; +import { type KeyboardEvent, type MouseEvent } from 'react'; +import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { useUserMemoryStore } from '@/store/userMemory'; diff --git a/src/app/[variants]/(main)/memory/activities/features/List/GridView/ActivityCard.tsx b/src/app/[variants]/(main)/memory/activities/features/List/GridView/ActivityCard.tsx index 7e5c52a352..893eb701f6 100644 --- a/src/app/[variants]/(main)/memory/activities/features/List/GridView/ActivityCard.tsx +++ b/src/app/[variants]/(main)/memory/activities/features/List/GridView/ActivityCard.tsx @@ -1,4 +1,4 @@ -import type { ActivityListItem } from '@lobechat/types'; +import { type ActivityListItem } from '@lobechat/types'; import { Tag } from '@lobehub/ui'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/memory/activities/features/List/GridView/index.tsx b/src/app/[variants]/(main)/memory/activities/features/List/GridView/index.tsx index 63df0fb836..f76f7ac0a4 100644 --- a/src/app/[variants]/(main)/memory/activities/features/List/GridView/index.tsx +++ b/src/app/[variants]/(main)/memory/activities/features/List/GridView/index.tsx @@ -1,4 +1,4 @@ -import type { ActivityListItem } from '@lobechat/types'; +import { type ActivityListItem } from '@lobechat/types'; import { memo } from 'react'; import { useUserMemoryStore } from '@/store/userMemory'; diff --git a/src/app/[variants]/(main)/memory/activities/features/List/TimelineView/ActivityCard.tsx b/src/app/[variants]/(main)/memory/activities/features/List/TimelineView/ActivityCard.tsx index 8aec1b3fd4..79b13b35b5 100644 --- a/src/app/[variants]/(main)/memory/activities/features/List/TimelineView/ActivityCard.tsx +++ b/src/app/[variants]/(main)/memory/activities/features/List/TimelineView/ActivityCard.tsx @@ -1,4 +1,4 @@ -import type { ActivityListItem } from '@lobechat/types'; +import { type ActivityListItem } from '@lobechat/types'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/memory/activities/features/List/TimelineView/index.tsx b/src/app/[variants]/(main)/memory/activities/features/List/TimelineView/index.tsx index b2ecc5e00b..38ed2f9749 100644 --- a/src/app/[variants]/(main)/memory/activities/features/List/TimelineView/index.tsx +++ b/src/app/[variants]/(main)/memory/activities/features/List/TimelineView/index.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { ActivityListItem } from '@lobechat/types'; +import { type ActivityListItem } from '@lobechat/types'; import { memo } from 'react'; import { useUserMemoryStore } from '@/store/userMemory'; diff --git a/src/app/[variants]/(main)/memory/activities/features/List/index.tsx b/src/app/[variants]/(main)/memory/activities/features/List/index.tsx index 29b7102d42..6d1e7b53b9 100644 --- a/src/app/[variants]/(main)/memory/activities/features/List/index.tsx +++ b/src/app/[variants]/(main)/memory/activities/features/List/index.tsx @@ -6,7 +6,7 @@ import { useQueryState } from '@/hooks/useQueryParam'; import { useGlobalStore } from '@/store/global'; import { useUserMemoryStore } from '@/store/userMemory'; -import type {ViewMode} from '../../../features/ViewModeSwitcher'; +import { type ViewMode } from '../../../features/ViewModeSwitcher'; import GridView from './GridView'; import TimelineView from './TimelineView'; diff --git a/src/app/[variants]/(main)/memory/activities/index.tsx b/src/app/[variants]/(main)/memory/activities/index.tsx index 4f6fe929b6..260d6a52b1 100644 --- a/src/app/[variants]/(main)/memory/activities/index.tsx +++ b/src/app/[variants]/(main)/memory/activities/index.tsx @@ -1,7 +1,7 @@ import { Flexbox, Icon, Tag } from '@lobehub/ui'; import { CalendarClockIcon } from 'lucide-react'; -import type {FC} from 'react'; -import { memo, useCallback, useEffect, useState } from 'react'; +import { type FC } from 'react'; +import { memo, useCallback, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { SCROLL_PARENT_ID } from '@/app/[variants]/(main)/memory/features/TimeLineView/useScrollParent'; @@ -14,7 +14,7 @@ import { useUserMemoryStore } from '@/store/userMemory'; import EditableModal from '../features/EditableModal'; import FilterBar from '../features/FilterBar'; import Loading from '../features/Loading'; -import type {ViewMode} from '../features/ViewModeSwitcher'; +import { type ViewMode } from '../features/ViewModeSwitcher'; import ViewModeSwitcher from '../features/ViewModeSwitcher'; import ActivityRightPanel from './features/ActivityRightPanel'; import List from './features/List'; diff --git a/src/app/[variants]/(main)/memory/contexts/features/ContextDropdown.tsx b/src/app/[variants]/(main)/memory/contexts/features/ContextDropdown.tsx index ec99a09dc5..f0c7a5f639 100644 --- a/src/app/[variants]/(main)/memory/contexts/features/ContextDropdown.tsx +++ b/src/app/[variants]/(main)/memory/contexts/features/ContextDropdown.tsx @@ -1,9 +1,9 @@ -import type {ActionIconProps} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type ActionIconProps } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { App } from 'antd'; import { MoreHorizontal, Pencil, Trash2 } from 'lucide-react'; -import type {KeyboardEvent, MouseEvent} from 'react'; -import { memo } from 'react'; +import { type KeyboardEvent, type MouseEvent } from 'react'; +import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { useUserMemoryStore } from '@/store/userMemory'; diff --git a/src/app/[variants]/(main)/memory/contexts/features/List/GridView/ContextCard.tsx b/src/app/[variants]/(main)/memory/contexts/features/List/GridView/ContextCard.tsx index 8079d83a1d..b0256355c6 100644 --- a/src/app/[variants]/(main)/memory/contexts/features/List/GridView/ContextCard.tsx +++ b/src/app/[variants]/(main)/memory/contexts/features/List/GridView/ContextCard.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next'; import GridCard from '@/app/[variants]/(main)/memory/features/GridView/GridCard'; import ProgressIcon from '@/app/[variants]/(main)/memory/features/ProgressIcon'; -import type {DisplayContextMemory} from '@/database/repositories/userMemory'; +import { type DisplayContextMemory } from '@/database/repositories/userMemory'; import ContextDropdown from '../../ContextDropdown'; diff --git a/src/app/[variants]/(main)/memory/contexts/features/List/GridView/index.tsx b/src/app/[variants]/(main)/memory/contexts/features/List/GridView/index.tsx index 738199ae57..0496096863 100644 --- a/src/app/[variants]/(main)/memory/contexts/features/List/GridView/index.tsx +++ b/src/app/[variants]/(main)/memory/contexts/features/List/GridView/index.tsx @@ -1,6 +1,6 @@ import { memo } from 'react'; -import type {DisplayContextMemory} from '@/database/repositories/userMemory'; +import { type DisplayContextMemory } from '@/database/repositories/userMemory'; import { useUserMemoryStore } from '@/store/userMemory'; import { GridView } from '../../../../features/GridView'; diff --git a/src/app/[variants]/(main)/memory/contexts/features/List/TimelineView/ContextCard.tsx b/src/app/[variants]/(main)/memory/contexts/features/List/TimelineView/ContextCard.tsx index 1f9fd107f2..e3af29fd81 100644 --- a/src/app/[variants]/(main)/memory/contexts/features/List/TimelineView/ContextCard.tsx +++ b/src/app/[variants]/(main)/memory/contexts/features/List/TimelineView/ContextCard.tsx @@ -1,7 +1,7 @@ import { memo } from 'react'; import TimeLineCard from '@/app/[variants]/(main)/memory/features/TimeLineView/TimeLineCard'; -import type {DisplayContextMemory} from '@/database/repositories/userMemory'; +import { type DisplayContextMemory } from '@/database/repositories/userMemory'; import ContextDropdown from '../../ContextDropdown'; diff --git a/src/app/[variants]/(main)/memory/contexts/features/List/TimelineView/index.tsx b/src/app/[variants]/(main)/memory/contexts/features/List/TimelineView/index.tsx index f7e3ebaf84..11c5093d61 100644 --- a/src/app/[variants]/(main)/memory/contexts/features/List/TimelineView/index.tsx +++ b/src/app/[variants]/(main)/memory/contexts/features/List/TimelineView/index.tsx @@ -2,7 +2,7 @@ import { memo } from 'react'; -import type {DisplayContextMemory} from '@/database/repositories/userMemory'; +import { type DisplayContextMemory } from '@/database/repositories/userMemory'; import { useUserMemoryStore } from '@/store/userMemory'; import { TimelineView as GenericTimelineView } from '../../../../features/TimeLineView'; diff --git a/src/app/[variants]/(main)/memory/contexts/features/List/index.tsx b/src/app/[variants]/(main)/memory/contexts/features/List/index.tsx index 83a8a0133b..51a073294b 100644 --- a/src/app/[variants]/(main)/memory/contexts/features/List/index.tsx +++ b/src/app/[variants]/(main)/memory/contexts/features/List/index.tsx @@ -7,7 +7,7 @@ import { useQueryState } from '@/hooks/useQueryParam'; import { useGlobalStore } from '@/store/global'; import { useUserMemoryStore } from '@/store/userMemory'; -import type {ViewMode} from '../../../features/ViewModeSwitcher'; +import { type ViewMode } from '../../../features/ViewModeSwitcher'; import GridView from './GridView'; import TimelineView from './TimelineView'; @@ -33,10 +33,7 @@ const ContextsList = memo(({ isLoading, searchValue, viewMode if (isEmpty) { return ( - + ); diff --git a/src/app/[variants]/(main)/memory/contexts/index.tsx b/src/app/[variants]/(main)/memory/contexts/index.tsx index 58c0e645cf..1459450a87 100644 --- a/src/app/[variants]/(main)/memory/contexts/index.tsx +++ b/src/app/[variants]/(main)/memory/contexts/index.tsx @@ -1,7 +1,7 @@ import { Flexbox, Icon, Tag } from '@lobehub/ui'; import { BrainCircuitIcon } from 'lucide-react'; -import type {FC} from 'react'; -import { memo, useCallback, useEffect, useState } from 'react'; +import { type FC } from 'react'; +import { memo, useCallback, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import MemoryAnalysis from '@/app/[variants]/(main)/memory/features/MemoryAnalysis'; @@ -15,7 +15,7 @@ import { useUserMemoryStore } from '@/store/userMemory'; import EditableModal from '../features/EditableModal'; import FilterBar from '../features/FilterBar'; import Loading from '../features/Loading'; -import type {ViewMode} from '../features/ViewModeSwitcher'; +import { type ViewMode } from '../features/ViewModeSwitcher'; import ViewModeSwitcher from '../features/ViewModeSwitcher'; import ContextRightPanel from './features/ContextRightPanel'; import List from './features/List'; diff --git a/src/app/[variants]/(main)/memory/experiences/features/ExperienceDropdown.tsx b/src/app/[variants]/(main)/memory/experiences/features/ExperienceDropdown.tsx index 870f3194e5..93d01f519c 100644 --- a/src/app/[variants]/(main)/memory/experiences/features/ExperienceDropdown.tsx +++ b/src/app/[variants]/(main)/memory/experiences/features/ExperienceDropdown.tsx @@ -1,9 +1,9 @@ -import type {ActionIconProps} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type ActionIconProps } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { App } from 'antd'; import { MoreHorizontal, Pencil, Trash2 } from 'lucide-react'; -import type {KeyboardEvent, MouseEvent} from 'react'; -import { memo } from 'react'; +import { type KeyboardEvent, type MouseEvent } from 'react'; +import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { useUserMemoryStore } from '@/store/userMemory'; diff --git a/src/app/[variants]/(main)/memory/experiences/features/List/GridView/ExperienceCard.tsx b/src/app/[variants]/(main)/memory/experiences/features/List/GridView/ExperienceCard.tsx index cdcbc96d66..59456897eb 100644 --- a/src/app/[variants]/(main)/memory/experiences/features/List/GridView/ExperienceCard.tsx +++ b/src/app/[variants]/(main)/memory/experiences/features/List/GridView/ExperienceCard.tsx @@ -1,4 +1,4 @@ -import type { ExperienceListItem } from '@lobechat/types'; +import { type ExperienceListItem } from '@lobechat/types'; import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; import { memo } from 'react'; diff --git a/src/app/[variants]/(main)/memory/experiences/features/List/GridView/index.tsx b/src/app/[variants]/(main)/memory/experiences/features/List/GridView/index.tsx index 5c87e906f9..06846012a1 100644 --- a/src/app/[variants]/(main)/memory/experiences/features/List/GridView/index.tsx +++ b/src/app/[variants]/(main)/memory/experiences/features/List/GridView/index.tsx @@ -1,4 +1,4 @@ -import type { ExperienceListItem } from '@lobechat/types'; +import { type ExperienceListItem } from '@lobechat/types'; import { memo } from 'react'; import { useUserMemoryStore } from '@/store/userMemory'; diff --git a/src/app/[variants]/(main)/memory/experiences/features/List/TimelineView/ExperienceCard.tsx b/src/app/[variants]/(main)/memory/experiences/features/List/TimelineView/ExperienceCard.tsx index 37b15ae712..8d612fc7a2 100644 --- a/src/app/[variants]/(main)/memory/experiences/features/List/TimelineView/ExperienceCard.tsx +++ b/src/app/[variants]/(main)/memory/experiences/features/List/TimelineView/ExperienceCard.tsx @@ -1,4 +1,4 @@ -import type { ExperienceListItem } from '@lobechat/types'; +import { type ExperienceListItem } from '@lobechat/types'; import { memo } from 'react'; import TimeLineCard from '@/app/[variants]/(main)/memory/features/TimeLineView/TimeLineCard'; diff --git a/src/app/[variants]/(main)/memory/experiences/features/List/TimelineView/index.tsx b/src/app/[variants]/(main)/memory/experiences/features/List/TimelineView/index.tsx index 77a94cf99f..fb3fb28973 100644 --- a/src/app/[variants]/(main)/memory/experiences/features/List/TimelineView/index.tsx +++ b/src/app/[variants]/(main)/memory/experiences/features/List/TimelineView/index.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { ExperienceListItem } from '@lobechat/types'; +import { type ExperienceListItem } from '@lobechat/types'; import { memo } from 'react'; import { useUserMemoryStore } from '@/store/userMemory'; diff --git a/src/app/[variants]/(main)/memory/experiences/features/List/index.tsx b/src/app/[variants]/(main)/memory/experiences/features/List/index.tsx index b13efe1de9..a31d970a43 100644 --- a/src/app/[variants]/(main)/memory/experiences/features/List/index.tsx +++ b/src/app/[variants]/(main)/memory/experiences/features/List/index.tsx @@ -7,7 +7,7 @@ import { useQueryState } from '@/hooks/useQueryParam'; import { useGlobalStore } from '@/store/global'; import { useUserMemoryStore } from '@/store/userMemory'; -import type {ViewMode} from '../../../features/ViewModeSwitcher'; +import { type ViewMode } from '../../../features/ViewModeSwitcher'; import GridView from './GridView'; import TimelineView from './TimelineView'; @@ -32,10 +32,7 @@ const ExperiencesList = memo(({ isLoading, searchValue, vi if (isEmpty) { return ( - + ); diff --git a/src/app/[variants]/(main)/memory/experiences/index.tsx b/src/app/[variants]/(main)/memory/experiences/index.tsx index 04c18a3f15..578a53f8e4 100644 --- a/src/app/[variants]/(main)/memory/experiences/index.tsx +++ b/src/app/[variants]/(main)/memory/experiences/index.tsx @@ -1,7 +1,7 @@ import { Flexbox, Icon, Tag } from '@lobehub/ui'; import { BrainCircuitIcon } from 'lucide-react'; -import type {FC} from 'react'; -import { memo, useCallback, useEffect, useState } from 'react'; +import { type FC } from 'react'; +import { memo, useCallback, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import MemoryAnalysis from '@/app/[variants]/(main)/memory/features/MemoryAnalysis'; @@ -15,7 +15,7 @@ import { useUserMemoryStore } from '@/store/userMemory'; import EditableModal from '../features/EditableModal'; import FilterBar from '../features/FilterBar'; import Loading from '../features/Loading'; -import type {ViewMode} from '../features/ViewModeSwitcher'; +import { type ViewMode } from '../features/ViewModeSwitcher'; import ViewModeSwitcher from '../features/ViewModeSwitcher'; import ExperienceRightPanel from './features/ExperienceRightPanel'; import List from './features/List'; diff --git a/src/app/[variants]/(main)/memory/features/DetailPanel.tsx b/src/app/[variants]/(main)/memory/features/DetailPanel.tsx index 9e240d8d36..5b29b01652 100644 --- a/src/app/[variants]/(main)/memory/features/DetailPanel.tsx +++ b/src/app/[variants]/(main)/memory/features/DetailPanel.tsx @@ -1,8 +1,8 @@ -import type {FlexboxProps} from '@lobehub/ui'; -import { Flexbox } from '@lobehub/ui'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Flexbox } from '@lobehub/ui'; import { memo } from 'react'; -import type {NavHeaderProps} from '@/features/NavHeader'; +import { type NavHeaderProps } from '@/features/NavHeader'; import NavHeader from '@/features/NavHeader'; import RightPanel from '@/features/RightPanel'; import ToggleRightPanelButton from '@/features/RightPanel/ToggleRightPanelButton'; diff --git a/src/app/[variants]/(main)/memory/features/GridView/GridCard.tsx b/src/app/[variants]/(main)/memory/features/GridView/GridCard.tsx index 3f1d560924..b14780cc52 100644 --- a/src/app/[variants]/(main)/memory/features/GridView/GridCard.tsx +++ b/src/app/[variants]/(main)/memory/features/GridView/GridCard.tsx @@ -1,6 +1,6 @@ import { Block, Center, Flexbox, Tag, Text } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import HashTags from '../HashTags'; diff --git a/src/app/[variants]/(main)/memory/features/GridView/index.tsx b/src/app/[variants]/(main)/memory/features/GridView/index.tsx index 3064729882..0c54348697 100644 --- a/src/app/[variants]/(main)/memory/features/GridView/index.tsx +++ b/src/app/[variants]/(main)/memory/features/GridView/index.tsx @@ -1,6 +1,6 @@ -import type {DivProps} from '@lobehub/ui'; -import { Grid } from '@lobehub/ui'; -import type {ReactNode} from 'react'; +import { type DivProps } from '@lobehub/ui'; +import { Grid } from '@lobehub/ui'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import { VirtuosoGrid } from 'react-virtuoso'; diff --git a/src/app/[variants]/(main)/memory/features/Loading.tsx b/src/app/[variants]/(main)/memory/features/Loading.tsx index afbfce651b..95431e3839 100644 --- a/src/app/[variants]/(main)/memory/features/Loading.tsx +++ b/src/app/[variants]/(main)/memory/features/Loading.tsx @@ -2,7 +2,7 @@ import { Flexbox, Grid, Skeleton } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { memo } from 'react'; -import type {ViewMode} from './ViewModeSwitcher'; +import { type ViewMode } from './ViewModeSwitcher'; const styles = createStaticStyles(({ css, cssVar }) => ({ card: css` diff --git a/src/app/[variants]/(main)/memory/features/MemoryAnalysis/DateRangeModal.tsx b/src/app/[variants]/(main)/memory/features/MemoryAnalysis/DateRangeModal.tsx index 1887a500d3..3027d539ac 100644 --- a/src/app/[variants]/(main)/memory/features/MemoryAnalysis/DateRangeModal.tsx +++ b/src/app/[variants]/(main)/memory/features/MemoryAnalysis/DateRangeModal.tsx @@ -2,7 +2,7 @@ import { Flexbox, Text } from '@lobehub/ui'; import { DatePicker, Modal } from 'antd'; -import type { RangePickerProps } from 'antd/es/date-picker'; +import { type RangePickerProps } from 'antd/es/date-picker'; import dayjs from 'dayjs'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/memory/features/MemoryAnalysis/Status.tsx b/src/app/[variants]/(main)/memory/features/MemoryAnalysis/Status.tsx index 367d3e097a..c63ee3a9b6 100644 --- a/src/app/[variants]/(main)/memory/features/MemoryAnalysis/Status.tsx +++ b/src/app/[variants]/(main)/memory/features/MemoryAnalysis/Status.tsx @@ -7,7 +7,7 @@ import { Loader2Icon, TriangleAlertIcon } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type { MemoryExtractionTask } from '@/services/userMemory/extraction'; +import { type MemoryExtractionTask } from '@/services/userMemory/extraction'; import { useMemoryAnalysisAsyncTask } from './useTask'; @@ -20,8 +20,7 @@ export const MemoryAnalysisStatus = memo(({ task }) => { const data = task; const status = data?.status; - const isRunning = - status === AsyncTaskStatus.Pending || status === AsyncTaskStatus.Processing; + const isRunning = status === AsyncTaskStatus.Pending || status === AsyncTaskStatus.Processing; const isError = status === AsyncTaskStatus.Error; if (!data || (!isRunning && !isError)) return null; @@ -45,7 +44,7 @@ export const MemoryAnalysisStatus = memo(({ task }) => { ? body : body && typeof body === 'object' && 'detail' in body && typeof body.detail === 'string' ? body.detail - : data.error?.name ?? t('analysis.status.errorTitle'); + : (data.error?.name ?? t('analysis.status.errorTitle')); return ( (({ task }) => { style={{ flex: 1, minWidth: 220 }} /> - {isError ? errorText ?? t('analysis.status.errorTitle') : progressText} + {isError ? (errorText ?? t('analysis.status.errorTitle')) : progressText} diff --git a/src/app/[variants]/(main)/memory/features/MemoryAnalysis/useTask.ts b/src/app/[variants]/(main)/memory/features/MemoryAnalysis/useTask.ts index 296622e70c..a5a0fba313 100644 --- a/src/app/[variants]/(main)/memory/features/MemoryAnalysis/useTask.ts +++ b/src/app/[variants]/(main)/memory/features/MemoryAnalysis/useTask.ts @@ -2,10 +2,8 @@ import { AsyncTaskStatus } from '@lobechat/types'; import { useEffect } from 'react'; import { useClientDataSWR } from '@/libs/swr'; -import type {MemoryExtractionTask} from '@/services/userMemory/extraction'; -import { - memoryExtractionService -} from '@/services/userMemory/extraction'; +import { type MemoryExtractionTask } from '@/services/userMemory/extraction'; +import { memoryExtractionService } from '@/services/userMemory/extraction'; const SWR_KEY = 'user-memory:analysis-task'; diff --git a/src/app/[variants]/(main)/memory/features/MemoryEmpty.tsx b/src/app/[variants]/(main)/memory/features/MemoryEmpty.tsx index db7584aa44..0d2b379d1c 100644 --- a/src/app/[variants]/(main)/memory/features/MemoryEmpty.tsx +++ b/src/app/[variants]/(main)/memory/features/MemoryEmpty.tsx @@ -1,13 +1,12 @@ -import type {EmptyProps} from '@lobehub/ui'; +import { type EmptyProps } from '@lobehub/ui'; import { Center, Empty, Flexbox } from '@lobehub/ui'; import { BrainCircuitIcon } from 'lucide-react'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -const MemoryEmpty = memo< - EmptyProps & { children?: ReactNode | ReactNode[], search?: boolean; } ->(({ search, title, children, ...rest }) => { +const MemoryEmpty = memo( + ({ search, title, children, ...rest }) => { const { t } = useTranslation('memory'); return (
@@ -25,9 +24,7 @@ const MemoryEmpty = memo< }} {...rest} > - - {children} - + {children}
diff --git a/src/app/[variants]/(main)/memory/features/ProgressIcon.tsx b/src/app/[variants]/(main)/memory/features/ProgressIcon.tsx index bea731bcdc..4a33babb67 100644 --- a/src/app/[variants]/(main)/memory/features/ProgressIcon.tsx +++ b/src/app/[variants]/(main)/memory/features/ProgressIcon.tsx @@ -1,6 +1,6 @@ import { Flexbox, Text, Tooltip } from '@lobehub/ui'; -import type {ProgressProps} from 'antd'; -import { Progress } from 'antd'; +import { type ProgressProps } from 'antd'; +import { Progress } from 'antd'; import { cssVar } from 'antd-style'; import { memo } from 'react'; diff --git a/src/app/[variants]/(main)/memory/features/SourceLink.tsx b/src/app/[variants]/(main)/memory/features/SourceLink.tsx index ede02ef28a..aef4a5716a 100644 --- a/src/app/[variants]/(main)/memory/features/SourceLink.tsx +++ b/src/app/[variants]/(main)/memory/features/SourceLink.tsx @@ -3,7 +3,7 @@ import { cssVar } from 'antd-style'; import { Link2 } from 'lucide-react'; import { memo } from 'react'; -import type {MemorySource} from '@/database/repositories/userMemory'; +import { type MemorySource } from '@/database/repositories/userMemory'; import Link from '@/libs/router/Link'; const SourceLink = memo<{ source?: MemorySource | null }>(({ source }) => { diff --git a/src/app/[variants]/(main)/memory/features/TimeLineView/PeriodGroup.tsx b/src/app/[variants]/(main)/memory/features/TimeLineView/PeriodGroup.tsx index 92a5f723f9..e445529f37 100644 --- a/src/app/[variants]/(main)/memory/features/TimeLineView/PeriodGroup.tsx +++ b/src/app/[variants]/(main)/memory/features/TimeLineView/PeriodGroup.tsx @@ -3,10 +3,10 @@ import { Flexbox, Text } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import dayjs from 'dayjs'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; -import type { GroupBy } from './index'; +import { type GroupBy } from './index'; const styles = createStaticStyles(({ css, cssVar }) => ({ itemWrapper: css` diff --git a/src/app/[variants]/(main)/memory/features/TimeLineView/TimeLineCard.tsx b/src/app/[variants]/(main)/memory/features/TimeLineView/TimeLineCard.tsx index 3511a87970..667122fc3a 100644 --- a/src/app/[variants]/(main)/memory/features/TimeLineView/TimeLineCard.tsx +++ b/src/app/[variants]/(main)/memory/features/TimeLineView/TimeLineCard.tsx @@ -1,6 +1,6 @@ import { Block, Flexbox, Tag, Text } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import CateTag from '../CateTag'; diff --git a/src/app/[variants]/(main)/memory/features/TimeLineView/index.tsx b/src/app/[variants]/(main)/memory/features/TimeLineView/index.tsx index 7ae06e9ee2..f497ecf02d 100644 --- a/src/app/[variants]/(main)/memory/features/TimeLineView/index.tsx +++ b/src/app/[variants]/(main)/memory/features/TimeLineView/index.tsx @@ -2,8 +2,8 @@ import { createStaticStyles, cx } from 'antd-style'; import dayjs from 'dayjs'; -import type {ReactNode} from 'react'; -import { memo, useMemo } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useMemo } from 'react'; import { GroupedVirtuoso } from 'react-virtuoso'; import Loading from '@/app/[variants]/(main)/memory/features/Loading'; diff --git a/src/app/[variants]/(main)/memory/identities/features/IdentityDropdown.tsx b/src/app/[variants]/(main)/memory/identities/features/IdentityDropdown.tsx index 46421200cf..f0941b1645 100644 --- a/src/app/[variants]/(main)/memory/identities/features/IdentityDropdown.tsx +++ b/src/app/[variants]/(main)/memory/identities/features/IdentityDropdown.tsx @@ -1,9 +1,9 @@ -import type {ActionIconProps} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type ActionIconProps } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { App } from 'antd'; import { MoreHorizontal, Pencil, Trash2 } from 'lucide-react'; -import type {KeyboardEvent, MouseEvent} from 'react'; -import { memo } from 'react'; +import { type KeyboardEvent, type MouseEvent } from 'react'; +import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { useUserMemoryStore } from '@/store/userMemory'; diff --git a/src/app/[variants]/(main)/memory/identities/features/List/GridView/IdentityCard.tsx b/src/app/[variants]/(main)/memory/identities/features/List/GridView/IdentityCard.tsx index 88ef726927..8275e755cb 100644 --- a/src/app/[variants]/(main)/memory/identities/features/List/GridView/IdentityCard.tsx +++ b/src/app/[variants]/(main)/memory/identities/features/List/GridView/IdentityCard.tsx @@ -1,4 +1,4 @@ -import type { IdentityListItem } from '@lobechat/types'; +import { type IdentityListItem } from '@lobechat/types'; import { memo } from 'react'; import GridCard from '@/app/[variants]/(main)/memory/features/GridView/GridCard'; diff --git a/src/app/[variants]/(main)/memory/identities/features/List/GridView/index.tsx b/src/app/[variants]/(main)/memory/identities/features/List/GridView/index.tsx index 369d4ac534..42a5382b3a 100644 --- a/src/app/[variants]/(main)/memory/identities/features/List/GridView/index.tsx +++ b/src/app/[variants]/(main)/memory/identities/features/List/GridView/index.tsx @@ -1,4 +1,4 @@ -import type { IdentityListItem } from '@lobechat/types'; +import { type IdentityListItem } from '@lobechat/types'; import { memo } from 'react'; import { useUserMemoryStore } from '@/store/userMemory'; diff --git a/src/app/[variants]/(main)/memory/identities/features/List/TimelineView/IdentityCard.tsx b/src/app/[variants]/(main)/memory/identities/features/List/TimelineView/IdentityCard.tsx index 8d0de8f4e0..7705694d0e 100644 --- a/src/app/[variants]/(main)/memory/identities/features/List/TimelineView/IdentityCard.tsx +++ b/src/app/[variants]/(main)/memory/identities/features/List/TimelineView/IdentityCard.tsx @@ -1,4 +1,4 @@ -import type { IdentityListItem } from '@lobechat/types'; +import { type IdentityListItem } from '@lobechat/types'; import { memo } from 'react'; import TimeLineCard from '../../../../features/TimeLineView/TimeLineCard'; diff --git a/src/app/[variants]/(main)/memory/identities/features/List/TimelineView/index.tsx b/src/app/[variants]/(main)/memory/identities/features/List/TimelineView/index.tsx index f9544fa936..6630457b93 100644 --- a/src/app/[variants]/(main)/memory/identities/features/List/TimelineView/index.tsx +++ b/src/app/[variants]/(main)/memory/identities/features/List/TimelineView/index.tsx @@ -1,4 +1,4 @@ -import type { IdentityListItem } from '@lobechat/types'; +import { type IdentityListItem } from '@lobechat/types'; import { memo } from 'react'; import { useUserMemoryStore } from '@/store/userMemory'; diff --git a/src/app/[variants]/(main)/memory/identities/features/List/index.tsx b/src/app/[variants]/(main)/memory/identities/features/List/index.tsx index 78dfe24316..f29240aefd 100644 --- a/src/app/[variants]/(main)/memory/identities/features/List/index.tsx +++ b/src/app/[variants]/(main)/memory/identities/features/List/index.tsx @@ -7,7 +7,7 @@ import { useGlobalStore } from '@/store/global'; import { useUserMemoryStore } from '@/store/userMemory'; import MemoryEmpty from '../../../features/MemoryEmpty'; -import type {ViewMode} from '../../../features/ViewModeSwitcher'; +import { type ViewMode } from '../../../features/ViewModeSwitcher'; import GridView from './GridView'; import TimelineView from './TimelineView'; @@ -32,10 +32,7 @@ const IdentitiesList = memo(({ isLoading, searchValue, view if (!identities || identities.length === 0) return ( - + ); diff --git a/src/app/[variants]/(main)/memory/identities/features/SegmentedBar.tsx b/src/app/[variants]/(main)/memory/identities/features/SegmentedBar.tsx index a514442497..6d3d87052f 100644 --- a/src/app/[variants]/(main)/memory/identities/features/SegmentedBar.tsx +++ b/src/app/[variants]/(main)/memory/identities/features/SegmentedBar.tsx @@ -2,7 +2,7 @@ import { Segmented } from '@lobehub/ui'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {IdentityType} from './List'; +import { type IdentityType } from './List'; interface SegmentedBarProps { onTypeChange: (type: IdentityType) => void; diff --git a/src/app/[variants]/(main)/memory/identities/index.tsx b/src/app/[variants]/(main)/memory/identities/index.tsx index 0013b556ad..adfe2c99bf 100644 --- a/src/app/[variants]/(main)/memory/identities/index.tsx +++ b/src/app/[variants]/(main)/memory/identities/index.tsx @@ -1,7 +1,7 @@ import { Flexbox, Icon, Tag } from '@lobehub/ui'; import { BrainCircuitIcon } from 'lucide-react'; -import type {FC} from 'react'; -import { memo, useCallback, useEffect, useState } from 'react'; +import { type FC } from 'react'; +import { memo, useCallback, useEffect, useState } from 'react'; import CommonFilterBar from '@/app/[variants]/(main)/memory/features/FilterBar'; import MemoryAnalysis from '@/app/[variants]/(main)/memory/features/MemoryAnalysis'; @@ -10,15 +10,15 @@ import WideScreenContainer from '@/features/WideScreenContainer'; import WideScreenButton from '@/features/WideScreenContainer/WideScreenButton'; import { useQueryState } from '@/hooks/useQueryParam'; import { useUserMemoryStore } from '@/store/userMemory'; -import type {TypesEnum} from '@/types/userMemory'; +import { type TypesEnum } from '@/types/userMemory'; import EditableModal from '../features/EditableModal'; import Loading from '../features/Loading'; import { SCROLL_PARENT_ID } from '../features/TimeLineView/useScrollParent'; -import type {ViewMode} from '../features/ViewModeSwitcher'; +import { type ViewMode } from '../features/ViewModeSwitcher'; import ViewModeSwitcher from '../features/ViewModeSwitcher'; import IdentityRightPanel from './features/IdentityRightPanel'; -import type {IdentityType} from './features/List'; +import { type IdentityType } from './features/List'; import List from './features/List'; import SegmentedBar from './features/SegmentedBar'; diff --git a/src/app/[variants]/(main)/memory/preferences/features/List/GridView/PreferenceCard.tsx b/src/app/[variants]/(main)/memory/preferences/features/List/GridView/PreferenceCard.tsx index bfc0ab0b40..00a72df7f0 100644 --- a/src/app/[variants]/(main)/memory/preferences/features/List/GridView/PreferenceCard.tsx +++ b/src/app/[variants]/(main)/memory/preferences/features/List/GridView/PreferenceCard.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'; import GridCard from '@/app/[variants]/(main)/memory/features/GridView/GridCard'; import ProgressIcon from '@/app/[variants]/(main)/memory/features/ProgressIcon'; -import type {DisplayPreferenceMemory} from '@/database/repositories/userMemory'; +import { type DisplayPreferenceMemory } from '@/database/repositories/userMemory'; import PreferenceDropdown from '../../PreferenceDropdown'; diff --git a/src/app/[variants]/(main)/memory/preferences/features/List/GridView/index.tsx b/src/app/[variants]/(main)/memory/preferences/features/List/GridView/index.tsx index 5fff3233e2..8c3fda34e0 100644 --- a/src/app/[variants]/(main)/memory/preferences/features/List/GridView/index.tsx +++ b/src/app/[variants]/(main)/memory/preferences/features/List/GridView/index.tsx @@ -1,6 +1,6 @@ import { memo } from 'react'; -import type {DisplayPreferenceMemory} from '@/database/repositories/userMemory'; +import { type DisplayPreferenceMemory } from '@/database/repositories/userMemory'; import { useUserMemoryStore } from '@/store/userMemory'; import { GridView } from '../../../../features/GridView'; diff --git a/src/app/[variants]/(main)/memory/preferences/features/List/TimelineView/PreferenceCard.tsx b/src/app/[variants]/(main)/memory/preferences/features/List/TimelineView/PreferenceCard.tsx index b53ddda51c..caf9e0df8b 100644 --- a/src/app/[variants]/(main)/memory/preferences/features/List/TimelineView/PreferenceCard.tsx +++ b/src/app/[variants]/(main)/memory/preferences/features/List/TimelineView/PreferenceCard.tsx @@ -1,7 +1,7 @@ import { memo } from 'react'; import TimeLineCard from '@/app/[variants]/(main)/memory/features/TimeLineView/TimeLineCard'; -import type {DisplayPreferenceMemory} from '@/database/repositories/userMemory'; +import { type DisplayPreferenceMemory } from '@/database/repositories/userMemory'; import PreferenceDropdown from '../../PreferenceDropdown'; diff --git a/src/app/[variants]/(main)/memory/preferences/features/List/TimelineView/index.tsx b/src/app/[variants]/(main)/memory/preferences/features/List/TimelineView/index.tsx index ad58a5312a..a705c0e5c8 100644 --- a/src/app/[variants]/(main)/memory/preferences/features/List/TimelineView/index.tsx +++ b/src/app/[variants]/(main)/memory/preferences/features/List/TimelineView/index.tsx @@ -2,7 +2,7 @@ import { memo } from 'react'; -import type {DisplayPreferenceMemory} from '@/database/repositories/userMemory'; +import { type DisplayPreferenceMemory } from '@/database/repositories/userMemory'; import { useUserMemoryStore } from '@/store/userMemory'; import { TimelineView as GenericTimelineView } from '../../../../features/TimeLineView'; diff --git a/src/app/[variants]/(main)/memory/preferences/features/List/index.tsx b/src/app/[variants]/(main)/memory/preferences/features/List/index.tsx index 22809e3f5f..a47ee4bd61 100644 --- a/src/app/[variants]/(main)/memory/preferences/features/List/index.tsx +++ b/src/app/[variants]/(main)/memory/preferences/features/List/index.tsx @@ -7,7 +7,7 @@ import { useQueryState } from '@/hooks/useQueryParam'; import { useGlobalStore } from '@/store/global'; import { useUserMemoryStore } from '@/store/userMemory'; -import type {ViewMode} from '../../../features/ViewModeSwitcher'; +import { type ViewMode } from '../../../features/ViewModeSwitcher'; import GridView from './GridView'; import TimelineView from './TimelineView'; @@ -32,10 +32,7 @@ const PreferencesList = memo(({ isLoading, searchValue, vi if (isEmpty) { return ( - + ); diff --git a/src/app/[variants]/(main)/memory/preferences/features/PreferenceDropdown.tsx b/src/app/[variants]/(main)/memory/preferences/features/PreferenceDropdown.tsx index a7529e7dd4..a3b201a7f5 100644 --- a/src/app/[variants]/(main)/memory/preferences/features/PreferenceDropdown.tsx +++ b/src/app/[variants]/(main)/memory/preferences/features/PreferenceDropdown.tsx @@ -1,9 +1,9 @@ -import type {ActionIconProps} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type ActionIconProps } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { App } from 'antd'; import { MoreHorizontal, Pencil, Trash2 } from 'lucide-react'; -import type {KeyboardEvent, MouseEvent} from 'react'; -import { memo } from 'react'; +import { type KeyboardEvent, type MouseEvent } from 'react'; +import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { useUserMemoryStore } from '@/store/userMemory'; diff --git a/src/app/[variants]/(main)/memory/preferences/index.tsx b/src/app/[variants]/(main)/memory/preferences/index.tsx index b33f686b16..018c4c68f7 100644 --- a/src/app/[variants]/(main)/memory/preferences/index.tsx +++ b/src/app/[variants]/(main)/memory/preferences/index.tsx @@ -1,7 +1,7 @@ import { Flexbox, Icon, Tag } from '@lobehub/ui'; import { BrainCircuitIcon } from 'lucide-react'; -import type {FC} from 'react'; -import { memo, useCallback, useEffect, useState } from 'react'; +import { type FC } from 'react'; +import { memo, useCallback, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import MemoryAnalysis from '@/app/[variants]/(main)/memory/features/MemoryAnalysis'; @@ -15,7 +15,7 @@ import { useUserMemoryStore } from '@/store/userMemory'; import EditableModal from '../features/EditableModal'; import FilterBar from '../features/FilterBar'; import Loading from '../features/Loading'; -import type {ViewMode} from '../features/ViewModeSwitcher'; +import { type ViewMode } from '../features/ViewModeSwitcher'; import ViewModeSwitcher from '../features/ViewModeSwitcher'; import List from './features/List'; import PreferenceRightPanel from './features/PreferenceRightPanel'; diff --git a/src/app/[variants]/(main)/page/_layout/Body/Actions.tsx b/src/app/[variants]/(main)/page/_layout/Body/Actions.tsx index 930230d131..29c652b10e 100644 --- a/src/app/[variants]/(main)/page/_layout/Body/Actions.tsx +++ b/src/app/[variants]/(main)/page/_layout/Body/Actions.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {MenuProps} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { MoreHorizontal } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/app/[variants]/(main)/page/_layout/Body/AllPagesDrawer/Content.tsx b/src/app/[variants]/(main)/page/_layout/Body/AllPagesDrawer/Content.tsx index 3f3d5fb752..a082106656 100644 --- a/src/app/[variants]/(main)/page/_layout/Body/AllPagesDrawer/Content.tsx +++ b/src/app/[variants]/(main)/page/_layout/Body/AllPagesDrawer/Content.tsx @@ -2,13 +2,13 @@ import { Flexbox } from '@lobehub/ui'; import { memo, useCallback, useMemo, useRef } from 'react'; -import type {VListHandle} from 'virtua'; -import { VList } from 'virtua'; +import { type VListHandle } from 'virtua'; +import { VList } from 'virtua'; import SkeletonList from '@/features/NavPanel/components/SkeletonList'; import PageEmpty from '@/features/PageEmpty'; import { pageSelectors, usePageStore } from '@/store/page'; -import type {LobeDocument} from '@/types/document'; +import { type LobeDocument } from '@/types/document'; import Item from '../List/Item'; diff --git a/src/app/[variants]/(main)/page/_layout/Body/List/Item/Actions.tsx b/src/app/[variants]/(main)/page/_layout/Body/List/Item/Actions.tsx index 5edb1535c1..6409785f4a 100644 --- a/src/app/[variants]/(main)/page/_layout/Body/List/Item/Actions.tsx +++ b/src/app/[variants]/(main)/page/_layout/Body/List/Item/Actions.tsx @@ -1,5 +1,5 @@ -import type {DropdownItem} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type DropdownItem } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { MoreHorizontalIcon } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/app/[variants]/(main)/page/_layout/Body/List/Item/index.tsx b/src/app/[variants]/(main)/page/_layout/Body/List/Item/index.tsx index bd5e3fa822..66d68d6edc 100644 --- a/src/app/[variants]/(main)/page/_layout/Body/List/Item/index.tsx +++ b/src/app/[variants]/(main)/page/_layout/Body/List/Item/index.tsx @@ -1,7 +1,7 @@ import { Avatar, Icon } from '@lobehub/ui'; import { FileTextIcon } from 'lucide-react'; -import type {MouseEvent} from 'react'; -import { memo, useCallback, useMemo } from 'react'; +import { type MouseEvent } from 'react'; +import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import NavItem from '@/features/NavPanel/components/NavItem'; diff --git a/src/app/[variants]/(main)/page/_layout/Body/List/Item/useDropdownMenu.tsx b/src/app/[variants]/(main)/page/_layout/Body/List/Item/useDropdownMenu.tsx index 6aa22e5574..30f927ea06 100644 --- a/src/app/[variants]/(main)/page/_layout/Body/List/Item/useDropdownMenu.tsx +++ b/src/app/[variants]/(main)/page/_layout/Body/List/Item/useDropdownMenu.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { App } from 'antd'; import { CopyPlus, Pencil, Trash2 } from 'lucide-react'; import { useCallback } from 'react'; diff --git a/src/app/[variants]/(main)/page/_layout/Body/useDropdownMenu.tsx b/src/app/[variants]/(main)/page/_layout/Body/useDropdownMenu.tsx index e09488ee89..d13d3eb1cc 100644 --- a/src/app/[variants]/(main)/page/_layout/Body/useDropdownMenu.tsx +++ b/src/app/[variants]/(main)/page/_layout/Body/useDropdownMenu.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { MenuProps } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; import { Icon } from '@lobehub/ui'; import { Hash, LucideCheck } from 'lucide-react'; import { useMemo } from 'react'; diff --git a/src/app/[variants]/(main)/page/_layout/index.tsx b/src/app/[variants]/(main)/page/_layout/index.tsx index c8e0e26072..a34c1576d7 100644 --- a/src/app/[variants]/(main)/page/_layout/index.tsx +++ b/src/app/[variants]/(main)/page/_layout/index.tsx @@ -1,7 +1,7 @@ 'use client'; import { Flexbox } from '@lobehub/ui'; -import type {FC} from 'react'; +import { type FC } from 'react'; import { Outlet } from 'react-router-dom'; import DataSync from './DataSync'; diff --git a/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/EmptyStatus.tsx b/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/EmptyStatus.tsx index b16104a9aa..b7c19ede0b 100644 --- a/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/EmptyStatus.tsx +++ b/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/EmptyStatus.tsx @@ -1,4 +1,4 @@ -import type { IconType } from '@lobehub/icons'; +import { type IconType } from '@lobehub/icons'; import { Flexbox } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { memo } from 'react'; diff --git a/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/Item/Actions.tsx b/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/Item/Actions.tsx index 5edb1535c1..6409785f4a 100644 --- a/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/Item/Actions.tsx +++ b/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/Item/Actions.tsx @@ -1,5 +1,5 @@ -import type {DropdownItem} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type DropdownItem } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { MoreHorizontalIcon } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/Item/index.tsx b/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/Item/index.tsx index f5ee7f3ef3..d3ec222cd6 100644 --- a/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/Item/index.tsx +++ b/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/Item/index.tsx @@ -1,8 +1,8 @@ import { Icon } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { Loader2Icon } from 'lucide-react'; -import type {CSSProperties} from 'react'; -import React, { memo, useCallback, useMemo } from 'react'; +import { type CSSProperties } from 'react'; +import React, { memo, useCallback, useMemo } from 'react'; import { useNavigate } from 'react-router-dom'; import { useResourceManagerStore } from '@/app/[variants]/(main)/resource/features/store'; diff --git a/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/Item/useDropdownMenu.tsx b/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/Item/useDropdownMenu.tsx index 26d2737e72..19c84bb044 100644 --- a/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/Item/useDropdownMenu.tsx +++ b/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/Item/useDropdownMenu.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { App } from 'antd'; import { PencilLine, Trash } from 'lucide-react'; import { useCallback } from 'react'; diff --git a/src/app/[variants]/(main)/resource/(home)/_layout/index.tsx b/src/app/[variants]/(main)/resource/(home)/_layout/index.tsx index f8e3c1d6af..a3b951dd76 100644 --- a/src/app/[variants]/(main)/resource/(home)/_layout/index.tsx +++ b/src/app/[variants]/(main)/resource/(home)/_layout/index.tsx @@ -1,7 +1,7 @@ 'use client'; import { Flexbox } from '@lobehub/ui'; -import type {FC} from 'react'; +import { type FC } from 'react'; import { Outlet } from 'react-router-dom'; import Sidebar from './Sidebar'; diff --git a/src/app/[variants]/(main)/resource/_layout/index.tsx b/src/app/[variants]/(main)/resource/_layout/index.tsx index 4f43853eda..164cece8ea 100644 --- a/src/app/[variants]/(main)/resource/_layout/index.tsx +++ b/src/app/[variants]/(main)/resource/_layout/index.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {FC} from 'react'; +import { type FC } from 'react'; import { Outlet } from 'react-router-dom'; import RegisterHotkeys from './RegisterHotkeys'; diff --git a/src/app/[variants]/(main)/resource/features/DndContextWrapper.tsx b/src/app/[variants]/(main)/resource/features/DndContextWrapper.tsx index 3fbdb01faa..fc50f0dfb1 100644 --- a/src/app/[variants]/(main)/resource/features/DndContextWrapper.tsx +++ b/src/app/[variants]/(main)/resource/features/DndContextWrapper.tsx @@ -4,7 +4,7 @@ import { Icon } from '@lobehub/ui'; import { App } from 'antd'; import { cssVar } from 'antd-style'; import { FileText, FolderIcon } from 'lucide-react'; -import type { PropsWithChildren } from 'react'; +import { type PropsWithChildren } from 'react'; import { createContext, memo, use, useEffect, useRef, useState } from 'react'; import { createPortal } from 'react-dom'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/resource/features/FileDetail.tsx b/src/app/[variants]/(main)/resource/features/FileDetail.tsx index bc334b1704..6ad08791a2 100644 --- a/src/app/[variants]/(main)/resource/features/FileDetail.tsx +++ b/src/app/[variants]/(main)/resource/features/FileDetail.tsx @@ -7,7 +7,7 @@ import { BoltIcon, DownloadIcon } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {FileListItem} from '@/types/files'; +import { type FileListItem } from '@/types/files'; import { downloadFile } from '@/utils/client/downloadFile'; import { formatSize } from '@/utils/format'; diff --git a/src/app/[variants]/(main)/resource/features/modal/FullscreenModal.tsx b/src/app/[variants]/(main)/resource/features/modal/FullscreenModal.tsx index 0307df49ce..d026a17630 100644 --- a/src/app/[variants]/(main)/resource/features/modal/FullscreenModal.tsx +++ b/src/app/[variants]/(main)/resource/features/modal/FullscreenModal.tsx @@ -3,7 +3,7 @@ import { Modal } from '@lobehub/ui'; import { ConfigProvider } from 'antd'; import { createStaticStyles, cx } from 'antd-style'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { useCallback, useState } from 'react'; const styles = createStaticStyles(({ css, cssVar }) => ({ diff --git a/src/app/[variants]/(main)/resource/features/store/action.ts b/src/app/[variants]/(main)/resource/features/store/action.ts index 812b6eceb4..af005a59b2 100644 --- a/src/app/[variants]/(main)/resource/features/store/action.ts +++ b/src/app/[variants]/(main)/resource/features/store/action.ts @@ -1,10 +1,10 @@ -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; -import type {ResourceManagerMode} from '@/features/ResourceManager'; -import type { FilesTabs, SortType } from '@/types/files'; +import { type ResourceManagerMode } from '@/features/ResourceManager'; +import { type FilesTabs, type SortType } from '@/types/files'; -import type {State, ViewMode} from './initialState'; -import { initialState } from './initialState'; +import { type State, type ViewMode } from './initialState'; +import { initialState } from './initialState'; export type MultiSelectActionType = | 'addToKnowledgeBase' diff --git a/src/app/[variants]/(main)/resource/features/store/index.ts b/src/app/[variants]/(main)/resource/features/store/index.ts index 5b366cf1ff..effbb5f530 100644 --- a/src/app/[variants]/(main)/resource/features/store/index.ts +++ b/src/app/[variants]/(main)/resource/features/store/index.ts @@ -1,15 +1,15 @@ 'use client'; import { useEffect } from 'react'; -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; import { subscribeWithSelector } from 'zustand/middleware'; import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; import { useFileStore } from '@/store/file'; -import type { FileListItem, QueryFileListParams } from '@/types/files'; +import { type FileListItem, type QueryFileListParams } from '@/types/files'; -import type { FolderCrumb } from './action'; +import { type FolderCrumb } from './action'; import { store } from './action'; export type { State } from './initialState'; diff --git a/src/app/[variants]/(main)/resource/features/store/initialState.ts b/src/app/[variants]/(main)/resource/features/store/initialState.ts index 0e25446be8..bd5834a7e6 100644 --- a/src/app/[variants]/(main)/resource/features/store/initialState.ts +++ b/src/app/[variants]/(main)/resource/features/store/initialState.ts @@ -1,4 +1,4 @@ -import type {ResourceManagerMode} from '@/features/ResourceManager'; +import { type ResourceManagerMode } from '@/features/ResourceManager'; import { FilesTabs, SortType } from '@/types/files'; export type ViewMode = 'list' | 'masonry'; diff --git a/src/app/[variants]/(main)/resource/features/store/selectors.ts b/src/app/[variants]/(main)/resource/features/store/selectors.ts index eb648088f3..5994a163e0 100644 --- a/src/app/[variants]/(main)/resource/features/store/selectors.ts +++ b/src/app/[variants]/(main)/resource/features/store/selectors.ts @@ -1,8 +1,8 @@ import { fileManagerSelectors, useFileStore } from '@/store/file'; -import type {FileListItem} from '@/types/files'; -import { SortType } from '@/types/files'; +import { type FileListItem } from '@/types/files'; +import { SortType } from '@/types/files'; -import type {State} from './initialState'; +import { type State } from './initialState'; /** * Sort a file list based on sort settings 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 cbe635bd8a..c01a6c6bcf 100644 --- a/src/app/[variants]/(main)/resource/library/_layout/Header/LibraryHead.tsx +++ b/src/app/[variants]/(main)/resource/library/_layout/Header/LibraryHead.tsx @@ -1,18 +1,11 @@ 'use client'; -import type {DropdownItem} from '@lobehub/ui'; -import { - ActionIcon, - Block, - Center, - DropdownMenu, - Skeleton, - Text -} from '@lobehub/ui'; +import { type DropdownItem } from '@lobehub/ui'; +import { ActionIcon, Block, Center, DropdownMenu, Skeleton, Text } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; import { ChevronsUpDownIcon } from 'lucide-react'; -import type {DragEvent} from 'react'; -import { memo, useCallback, useMemo, useState } from 'react'; +import { type DragEvent } from 'react'; +import { memo, useCallback, useMemo, useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { useDragActive } from '@/app/[variants]/(main)/resource/features/DndContextWrapper'; diff --git a/src/app/[variants]/(main)/resource/library/_layout/index.tsx b/src/app/[variants]/(main)/resource/library/_layout/index.tsx index f64499fea8..35d50c10d4 100644 --- a/src/app/[variants]/(main)/resource/library/_layout/index.tsx +++ b/src/app/[variants]/(main)/resource/library/_layout/index.tsx @@ -1,7 +1,7 @@ 'use client'; import { Flexbox } from '@lobehub/ui'; -import type {FC} from 'react'; +import { type FC } from 'react'; import { Outlet } from 'react-router-dom'; import RegisterHotkeys from '@/app/[variants]/(main)/resource/library/features/RegisterHotkeys'; diff --git a/src/app/[variants]/(main)/resource/library/features/Container.tsx b/src/app/[variants]/(main)/resource/library/features/Container.tsx index 74e5c56ea5..3404dc1526 100644 --- a/src/app/[variants]/(main)/resource/library/features/Container.tsx +++ b/src/app/[variants]/(main)/resource/library/features/Container.tsx @@ -2,7 +2,7 @@ import { Flexbox } from '@lobehub/ui'; import { useTheme } from 'antd-style'; -import type {FC, PropsWithChildren} from 'react'; +import { type FC, type PropsWithChildren } from 'react'; const Container: FC = ({ children }) => { const theme = useTheme(); diff --git a/src/app/[variants]/(main)/resource/store/action.ts b/src/app/[variants]/(main)/resource/store/action.ts index 97894871c0..07380ab418 100644 --- a/src/app/[variants]/(main)/resource/store/action.ts +++ b/src/app/[variants]/(main)/resource/store/action.ts @@ -1,9 +1,9 @@ -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; -import type {ResourceManagerMode} from '@/features/ResourceManager'; +import { type ResourceManagerMode } from '@/features/ResourceManager'; -import type {State} from './initialState'; -import { initialState } from './initialState'; +import { type State } from './initialState'; +import { initialState } from './initialState'; export interface Action { /** diff --git a/src/app/[variants]/(main)/resource/store/initialState.ts b/src/app/[variants]/(main)/resource/store/initialState.ts index 20fc388232..5e9fb215df 100644 --- a/src/app/[variants]/(main)/resource/store/initialState.ts +++ b/src/app/[variants]/(main)/resource/store/initialState.ts @@ -1,4 +1,4 @@ -import type {ResourceManagerMode} from '@/features/ResourceManager'; +import { type ResourceManagerMode } from '@/features/ResourceManager'; export interface State { currentViewItemId?: string; diff --git a/src/app/[variants]/(main)/settings/_layout/ContextProvider/index.tsx b/src/app/[variants]/(main)/settings/_layout/ContextProvider/index.tsx index 172f8d35c3..a003a5c09a 100644 --- a/src/app/[variants]/(main)/settings/_layout/ContextProvider/index.tsx +++ b/src/app/[variants]/(main)/settings/_layout/ContextProvider/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {ReactNode} from 'react'; -import { createContext, use } from 'react'; +import { type ReactNode } from 'react'; +import { createContext, use } from 'react'; interface SettingsContextType { showOpenAIApiKey?: boolean; diff --git a/src/app/[variants]/(main)/settings/_layout/Header.tsx b/src/app/[variants]/(main)/settings/_layout/Header.tsx index 6148ac1077..3c33366e8d 100644 --- a/src/app/[variants]/(main)/settings/_layout/Header.tsx +++ b/src/app/[variants]/(main)/settings/_layout/Header.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/settings/_layout/index.tsx b/src/app/[variants]/(main)/settings/_layout/index.tsx index 2850ab5c11..15352a32e8 100644 --- a/src/app/[variants]/(main)/settings/_layout/index.tsx +++ b/src/app/[variants]/(main)/settings/_layout/index.tsx @@ -1,7 +1,7 @@ 'use client'; import { Flexbox } from '@lobehub/ui'; -import type {FC} from 'react'; +import { type FC } from 'react'; import { Outlet } from 'react-router-dom'; import SideBar from '@/app/[variants]/(main)/settings/_layout/SideBar'; diff --git a/src/app/[variants]/(main)/settings/_layout/type.ts b/src/app/[variants]/(main)/settings/_layout/type.ts index eda0822672..fcd20e2c37 100644 --- a/src/app/[variants]/(main)/settings/_layout/type.ts +++ b/src/app/[variants]/(main)/settings/_layout/type.ts @@ -1,4 +1,4 @@ -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; export interface LayoutProps { children?: ReactNode; diff --git a/src/app/[variants]/(main)/settings/about/features/AboutList.tsx b/src/app/[variants]/(main)/settings/about/features/AboutList.tsx index adcea9aa6d..685a466b6f 100644 --- a/src/app/[variants]/(main)/settings/about/features/AboutList.tsx +++ b/src/app/[variants]/(main)/settings/about/features/AboutList.tsx @@ -1,10 +1,10 @@ 'use client'; import { Flexbox, Grid } from '@lobehub/ui'; -import type {FC} from 'react'; -import { memo } from 'react'; +import { type FC } from 'react'; +import { memo } from 'react'; -import type {ItemCardProps} from './ItemCard'; +import { type ItemCardProps } from './ItemCard'; interface AboutListProps { grid?: boolean; diff --git a/src/app/[variants]/(main)/settings/about/features/Analytics.tsx b/src/app/[variants]/(main)/settings/about/features/Analytics.tsx index cd8a4e62fc..cf70648011 100644 --- a/src/app/[variants]/(main)/settings/about/features/Analytics.tsx +++ b/src/app/[variants]/(main)/settings/about/features/Analytics.tsx @@ -1,8 +1,8 @@ 'use client'; import { BRANDING_NAME } from '@lobechat/business-const'; -import type {FormGroupItemType} from '@lobehub/ui'; -import { Form } from '@lobehub/ui'; +import { type FormGroupItemType } from '@lobehub/ui'; +import { Form } from '@lobehub/ui'; import { Switch } from 'antd'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/settings/about/features/ItemCard.tsx b/src/app/[variants]/(main)/settings/about/features/ItemCard.tsx index 9457813080..5f8268cb11 100644 --- a/src/app/[variants]/(main)/settings/about/features/ItemCard.tsx +++ b/src/app/[variants]/(main)/settings/about/features/ItemCard.tsx @@ -1,6 +1,6 @@ import { Block, Icon } from '@lobehub/ui'; import { cssVar } from 'antd-style'; -import type {LucideIcon} from 'lucide-react'; +import { type LucideIcon } from 'lucide-react'; import { memo } from 'react'; export interface ItemCardProps { diff --git a/src/app/[variants]/(main)/settings/about/features/ItemLink.tsx b/src/app/[variants]/(main)/settings/about/features/ItemLink.tsx index 1bc45397c5..a2248037c8 100644 --- a/src/app/[variants]/(main)/settings/about/features/ItemLink.tsx +++ b/src/app/[variants]/(main)/settings/about/features/ItemLink.tsx @@ -1,7 +1,7 @@ import { Flexbox, Icon } from '@lobehub/ui'; import { cssVar } from 'antd-style'; -import type {LucideIcon} from 'lucide-react'; -import { SquareArrowOutUpRight } from 'lucide-react'; +import { type LucideIcon } from 'lucide-react'; +import { SquareArrowOutUpRight } from 'lucide-react'; import { memo } from 'react'; export interface ItemLinkProps { diff --git a/src/app/[variants]/(main)/settings/agent/features/DefaultAgentForm.tsx b/src/app/[variants]/(main)/settings/agent/features/DefaultAgentForm.tsx index 5e4238fd91..92c6e64511 100644 --- a/src/app/[variants]/(main)/settings/agent/features/DefaultAgentForm.tsx +++ b/src/app/[variants]/(main)/settings/agent/features/DefaultAgentForm.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FormGroupItemType} from '@lobehub/ui'; -import { Form, Icon, Skeleton } from '@lobehub/ui'; +import { type FormGroupItemType } from '@lobehub/ui'; +import { Form, Icon, Skeleton } from '@lobehub/ui'; import { Form as AntForm } from 'antd'; import { Loader2Icon } from 'lucide-react'; import { memo, useState } from 'react'; diff --git a/src/app/[variants]/(main)/settings/agent/features/SystemAgentForm.tsx b/src/app/[variants]/(main)/settings/agent/features/SystemAgentForm.tsx index 98f9dc8a86..251e031d0b 100644 --- a/src/app/[variants]/(main)/settings/agent/features/SystemAgentForm.tsx +++ b/src/app/[variants]/(main)/settings/agent/features/SystemAgentForm.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FormGroupItemType, FormItemProps} from '@lobehub/ui'; -import { Button, Flexbox, Form, Icon, Skeleton } from '@lobehub/ui'; +import { type FormGroupItemType, type FormItemProps } from '@lobehub/ui'; +import { Button, Flexbox, Form, Icon, Skeleton } from '@lobehub/ui'; import { Form as AntForm, Switch } from 'antd'; import isEqual from 'fast-deep-equal'; import { Loader2Icon, PencilIcon } from 'lucide-react'; @@ -13,7 +13,7 @@ import { FORM_STYLE } from '@/const/layoutTokens'; import ModelSelect from '@/features/ModelSelect'; import { useUserStore } from '@/store/user'; import { settingsSelectors } from '@/store/user/selectors'; -import type {UserSystemAgentConfigKey} from '@/types/user/settings'; +import { type UserSystemAgentConfigKey } from '@/types/user/settings'; interface SystemAgentFormProps { allowCustomPrompt?: boolean; diff --git a/src/app/[variants]/(main)/settings/agent/features/useSync.ts b/src/app/[variants]/(main)/settings/agent/features/useSync.ts index 19882967d9..2537379aeb 100644 --- a/src/app/[variants]/(main)/settings/agent/features/useSync.ts +++ b/src/app/[variants]/(main)/settings/agent/features/useSync.ts @@ -1,4 +1,4 @@ -import type {FormInstance} from 'antd'; +import { type FormInstance } from 'antd'; import { useLayoutEffect } from 'react'; import { useUserStore } from '@/store/user'; diff --git a/src/app/[variants]/(main)/settings/apikey/features/ApiKey.tsx b/src/app/[variants]/(main)/settings/apikey/features/ApiKey.tsx index 592091b0ae..1cb6a96ea2 100644 --- a/src/app/[variants]/(main)/settings/apikey/features/ApiKey.tsx +++ b/src/app/[variants]/(main)/settings/apikey/features/ApiKey.tsx @@ -1,18 +1,18 @@ 'use client'; -import type {ActionType, ProColumns} from '@ant-design/pro-components'; -import { ProTable } from '@ant-design/pro-components'; +import { type ActionType, type ProColumns } from '@ant-design/pro-components'; +import { ProTable } from '@ant-design/pro-components'; import { Button } from '@lobehub/ui'; import { useMutation } from '@tanstack/react-query'; import { Popconfirm, Switch } from 'antd'; import { createStaticStyles } from 'antd-style'; import { Trash } from 'lucide-react'; -import type {FC} from 'react'; -import { useRef, useState } from 'react'; +import { type FC } from 'react'; +import { useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { lambdaClient } from '@/libs/trpc/client'; -import type {ApiKeyItem, CreateApiKeyParams, UpdateApiKeyParams} from '@/types/apiKey'; +import { type ApiKeyItem, type CreateApiKeyParams, type UpdateApiKeyParams } from '@/types/apiKey'; import { ApiKeyDisplay, ApiKeyModal, EditableCell } from './index'; diff --git a/src/app/[variants]/(main)/settings/apikey/features/ApiKeyDatePicker/index.tsx b/src/app/[variants]/(main)/settings/apikey/features/ApiKeyDatePicker/index.tsx index 21de9aa4f4..ccaca19884 100644 --- a/src/app/[variants]/(main)/settings/apikey/features/ApiKeyDatePicker/index.tsx +++ b/src/app/[variants]/(main)/settings/apikey/features/ApiKeyDatePicker/index.tsx @@ -1,9 +1,9 @@ import { DatePicker } from '@lobehub/ui'; -import type {DatePickerProps} from 'antd'; -import { Flex } from 'antd'; -import type {Dayjs} from 'dayjs'; +import { type DatePickerProps } from 'antd'; +import { Flex } from 'antd'; +import { type Dayjs } from 'dayjs'; import dayjs from 'dayjs'; -import type {FC} from 'react'; +import { type FC } from 'react'; import { useTranslation } from 'react-i18next'; interface ApiKeyDatePickerProps extends Omit { diff --git a/src/app/[variants]/(main)/settings/apikey/features/ApiKeyDisplay/index.tsx b/src/app/[variants]/(main)/settings/apikey/features/ApiKeyDisplay/index.tsx index 05de1eac9c..9ed677f0a2 100644 --- a/src/app/[variants]/(main)/settings/apikey/features/ApiKeyDisplay/index.tsx +++ b/src/app/[variants]/(main)/settings/apikey/features/ApiKeyDisplay/index.tsx @@ -1,8 +1,8 @@ import { CopyOutlined, EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons'; import { Button } from '@lobehub/ui'; import { App, Flex } from 'antd'; -import type {FC} from 'react'; -import { useState } from 'react'; +import { type FC } from 'react'; +import { useState } from 'react'; import { useTranslation } from 'react-i18next'; interface ApiKeyDisplayProps { diff --git a/src/app/[variants]/(main)/settings/apikey/features/ApiKeyModal/index.tsx b/src/app/[variants]/(main)/settings/apikey/features/ApiKeyModal/index.tsx index 9257397ffc..313fe19bc4 100644 --- a/src/app/[variants]/(main)/settings/apikey/features/ApiKeyModal/index.tsx +++ b/src/app/[variants]/(main)/settings/apikey/features/ApiKeyModal/index.tsx @@ -1,9 +1,9 @@ import { FormModal, Input } from '@lobehub/ui'; -import type {Dayjs} from 'dayjs'; -import type {FC} from 'react'; +import { type Dayjs } from 'dayjs'; +import { type FC } from 'react'; import { useTranslation } from 'react-i18next'; -import type {CreateApiKeyParams} from '@/types/apiKey'; +import { type CreateApiKeyParams } from '@/types/apiKey'; import ApiKeyDatePicker from '../ApiKeyDatePicker'; diff --git a/src/app/[variants]/(main)/settings/apikey/features/EditableCell/index.tsx b/src/app/[variants]/(main)/settings/apikey/features/EditableCell/index.tsx index e97c7dd774..d986e83836 100644 --- a/src/app/[variants]/(main)/settings/apikey/features/EditableCell/index.tsx +++ b/src/app/[variants]/(main)/settings/apikey/features/EditableCell/index.tsx @@ -1,10 +1,10 @@ 'use client'; import { ActionIcon, Input } from '@lobehub/ui'; -import type {InputRef} from 'antd'; -import { App } from 'antd'; +import { type InputRef } from 'antd'; +import { App } from 'antd'; import { createStaticStyles, cx } from 'antd-style'; -import type {Dayjs} from 'dayjs'; +import { type Dayjs } from 'dayjs'; import dayjs from 'dayjs'; import { Check, Edit, X } from 'lucide-react'; import React, { memo, useRef, useState } from 'react'; diff --git a/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/ChatPreview.tsx b/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/ChatPreview.tsx index 650d6e681c..e25e3281e3 100644 --- a/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/ChatPreview.tsx +++ b/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/ChatPreview.tsx @@ -1,6 +1,6 @@ import { BRANDING_NAME } from '@lobechat/business-const'; -import type {MarkdownProps} from '@lobehub/ui'; -import { Center, Markdown } from '@lobehub/ui'; +import { type MarkdownProps } from '@lobehub/ui'; +import { Center, Markdown } from '@lobehub/ui'; import { useTranslation } from 'react-i18next'; const ChatPreview = ({ fontSize }: Pick) => { diff --git a/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/ChatTransitionPreview.tsx b/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/ChatTransitionPreview.tsx index 212fbee9d5..26656d68bf 100644 --- a/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/ChatTransitionPreview.tsx +++ b/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/ChatTransitionPreview.tsx @@ -1,7 +1,7 @@ import { Flexbox, Markdown } from '@lobehub/ui'; import { memo, useEffect, useMemo, useState } from 'react'; -import type {UserGeneralConfig} from '@/types/user/settings'; +import { type UserGeneralConfig } from '@/types/user/settings'; const data = ` ### Features diff --git a/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/HighlighterPreview.tsx b/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/HighlighterPreview.tsx index 94c51da9d2..9121b8e404 100644 --- a/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/HighlighterPreview.tsx +++ b/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/HighlighterPreview.tsx @@ -1,5 +1,5 @@ -import type {HighlighterProps} from '@lobehub/ui'; -import { Highlighter } from '@lobehub/ui'; +import { type HighlighterProps } from '@lobehub/ui'; +import { Highlighter } from '@lobehub/ui'; const code = ` const person = { name: "Alice", age: 30 }; diff --git a/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/MermaidPreview.tsx b/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/MermaidPreview.tsx index 79193479e1..34e567cb9c 100644 --- a/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/MermaidPreview.tsx +++ b/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/MermaidPreview.tsx @@ -1,5 +1,5 @@ -import type {MermaidProps} from '@lobehub/ui'; -import { Center, Flexbox, Mermaid } from '@lobehub/ui'; +import { type MermaidProps } from '@lobehub/ui'; +import { Center, Flexbox, Mermaid } from '@lobehub/ui'; const code = `sequenceDiagram Alice->>John: Hello John, how are you? diff --git a/src/app/[variants]/(main)/settings/common/features/Appearance/ThemeSwatches/ThemeSwatchesNeutral.tsx b/src/app/[variants]/(main)/settings/common/features/Appearance/ThemeSwatches/ThemeSwatchesNeutral.tsx index 2a996aa34b..825792a79c 100644 --- a/src/app/[variants]/(main)/settings/common/features/Appearance/ThemeSwatches/ThemeSwatchesNeutral.tsx +++ b/src/app/[variants]/(main)/settings/common/features/Appearance/ThemeSwatches/ThemeSwatchesNeutral.tsx @@ -1,5 +1,5 @@ -import type {NeutralColors} from '@lobehub/ui'; -import { ColorSwatches, findCustomThemeName, neutralColors } from '@lobehub/ui'; +import { type NeutralColors } from '@lobehub/ui'; +import { ColorSwatches, findCustomThemeName, neutralColors } from '@lobehub/ui'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/settings/common/features/Appearance/ThemeSwatches/ThemeSwatchesPrimary.tsx b/src/app/[variants]/(main)/settings/common/features/Appearance/ThemeSwatches/ThemeSwatchesPrimary.tsx index 16d4f90c1b..223c690d2b 100644 --- a/src/app/[variants]/(main)/settings/common/features/Appearance/ThemeSwatches/ThemeSwatchesPrimary.tsx +++ b/src/app/[variants]/(main)/settings/common/features/Appearance/ThemeSwatches/ThemeSwatchesPrimary.tsx @@ -1,5 +1,5 @@ -import type {PrimaryColors} from '@lobehub/ui'; -import { ColorSwatches, findCustomThemeName, primaryColors } from '@lobehub/ui'; +import { type PrimaryColors } from '@lobehub/ui'; +import { ColorSwatches, findCustomThemeName, primaryColors } from '@lobehub/ui'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/settings/common/features/Appearance/index.tsx b/src/app/[variants]/(main)/settings/common/features/Appearance/index.tsx index 1a6c22cb6d..dfb9902861 100644 --- a/src/app/[variants]/(main)/settings/common/features/Appearance/index.tsx +++ b/src/app/[variants]/(main)/settings/common/features/Appearance/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FormGroupItemType} from '@lobehub/ui'; -import { Form, Icon, Skeleton } from '@lobehub/ui'; +import { type FormGroupItemType } from '@lobehub/ui'; +import { Form, Icon, Skeleton } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; import { Loader2Icon } from 'lucide-react'; import { memo, useState } from 'react'; diff --git a/src/app/[variants]/(main)/settings/common/features/Common/Common.tsx b/src/app/[variants]/(main)/settings/common/features/Common/Common.tsx index 5503151330..7b2f3f50d6 100644 --- a/src/app/[variants]/(main)/settings/common/features/Common/Common.tsx +++ b/src/app/[variants]/(main)/settings/common/features/Common/Common.tsx @@ -1,14 +1,7 @@ 'use client'; -import type {FormGroupItemType} from '@lobehub/ui'; -import { - Flexbox, - Form, - Icon, - ImageSelect, - LobeSelect as Select, - Skeleton -} from '@lobehub/ui'; +import { type FormGroupItemType } from '@lobehub/ui'; +import { Flexbox, Form, Icon, ImageSelect, LobeSelect as Select, Skeleton } from '@lobehub/ui'; import { Segmented, Switch } from 'antd'; import isEqual from 'fast-deep-equal'; import { Ban, Gauge, Loader2Icon, Monitor, Moon, Mouse, Sun, Waves } from 'lucide-react'; @@ -24,7 +17,7 @@ import { useGlobalStore } from '@/store/global'; import { systemStatusSelectors } from '@/store/global/selectors'; import { useUserStore } from '@/store/user'; import { settingsSelectors } from '@/store/user/selectors'; -import type {LocaleMode} from '@/types/locale'; +import { type LocaleMode } from '@/types/locale'; const Common = memo(() => { const { t } = useTranslation('setting'); diff --git a/src/app/[variants]/(main)/settings/features/SettingHeader.tsx b/src/app/[variants]/(main)/settings/features/SettingHeader.tsx index bdda726e9e..fcfea97f6d 100644 --- a/src/app/[variants]/(main)/settings/features/SettingHeader.tsx +++ b/src/app/[variants]/(main)/settings/features/SettingHeader.tsx @@ -1,6 +1,6 @@ import { Flexbox, Text } from '@lobehub/ui'; import { Divider } from 'antd'; -import type { FC, ReactNode } from 'react'; +import { type FC, type ReactNode } from 'react'; interface SettingHeaderProps { extra?: ReactNode; diff --git a/src/app/[variants]/(main)/settings/hooks/useSyncSettings.ts b/src/app/[variants]/(main)/settings/hooks/useSyncSettings.ts index d0500dbd7d..adcd59847a 100644 --- a/src/app/[variants]/(main)/settings/hooks/useSyncSettings.ts +++ b/src/app/[variants]/(main)/settings/hooks/useSyncSettings.ts @@ -1,4 +1,4 @@ -import type {FormInstance} from 'antd/es/form/hooks/useForm'; +import { type FormInstance } from 'antd/es/form/hooks/useForm'; import { useLayoutEffect } from 'react'; import { useUserStore } from '@/store/user'; diff --git a/src/app/[variants]/(main)/settings/hotkey/features/Conversation.tsx b/src/app/[variants]/(main)/settings/hotkey/features/Conversation.tsx index 95ff686f52..e9beb30edb 100644 --- a/src/app/[variants]/(main)/settings/hotkey/features/Conversation.tsx +++ b/src/app/[variants]/(main)/settings/hotkey/features/Conversation.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FormGroupItemType} from '@lobehub/ui'; -import { Form, HotkeyInput, Icon, Skeleton } from '@lobehub/ui'; +import { type FormGroupItemType } from '@lobehub/ui'; +import { Form, HotkeyInput, Icon, Skeleton } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; import { Loader2Icon } from 'lucide-react'; import { memo, useState } from 'react'; @@ -12,8 +12,8 @@ import { FORM_STYLE } from '@/const/layoutTokens'; import hotkeyMeta from '@/locales/default/hotkey'; import { useUserStore } from '@/store/user'; import { settingsSelectors } from '@/store/user/selectors'; -import type {HotkeyItem} from '@/types/hotkey'; -import { HotkeyGroupEnum } from '@/types/hotkey'; +import { type HotkeyItem } from '@/types/hotkey'; +import { HotkeyGroupEnum } from '@/types/hotkey'; const HotkeySetting = memo(() => { const { t } = useTranslation(['setting', 'hotkey']); diff --git a/src/app/[variants]/(main)/settings/hotkey/features/Desktop.tsx b/src/app/[variants]/(main)/settings/hotkey/features/Desktop.tsx index 23fa62e3e1..90de88a8ac 100644 --- a/src/app/[variants]/(main)/settings/hotkey/features/Desktop.tsx +++ b/src/app/[variants]/(main)/settings/hotkey/features/Desktop.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FormGroupItemType} from '@lobehub/ui'; -import { Form, HotkeyInput, Icon, Skeleton } from '@lobehub/ui'; +import { type FormGroupItemType } from '@lobehub/ui'; +import { Form, HotkeyInput, Icon, Skeleton } from '@lobehub/ui'; import { App } from 'antd'; import isEqual from 'fast-deep-equal'; import { Loader2Icon } from 'lucide-react'; @@ -13,7 +13,7 @@ import { FORM_STYLE } from '@/const/layoutTokens'; import hotkeyMeta from '@/locales/default/hotkey'; import { useElectronStore } from '@/store/electron'; import { desktopHotkeysSelectors } from '@/store/electron/selectors'; -import type {DesktopHotkeyItem} from '@/types/hotkey'; +import { type DesktopHotkeyItem } from '@/types/hotkey'; const HotkeySetting = memo(() => { const { t } = useTranslation(['setting', 'hotkey']); diff --git a/src/app/[variants]/(main)/settings/hotkey/features/Essential.tsx b/src/app/[variants]/(main)/settings/hotkey/features/Essential.tsx index 760c28aa94..f2700dc5e2 100644 --- a/src/app/[variants]/(main)/settings/hotkey/features/Essential.tsx +++ b/src/app/[variants]/(main)/settings/hotkey/features/Essential.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FormGroupItemType} from '@lobehub/ui'; -import { Form, HotkeyInput, Icon, Skeleton } from '@lobehub/ui'; +import { type FormGroupItemType } from '@lobehub/ui'; +import { Form, HotkeyInput, Icon, Skeleton } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; import { Loader2Icon } from 'lucide-react'; import { memo, useState } from 'react'; @@ -12,8 +12,8 @@ import { FORM_STYLE } from '@/const/layoutTokens'; import hotkeyMeta from '@/locales/default/hotkey'; import { useUserStore } from '@/store/user'; import { settingsSelectors } from '@/store/user/selectors'; -import type {HotkeyItem} from '@/types/hotkey'; -import { HotkeyGroupEnum } from '@/types/hotkey'; +import { type HotkeyItem } from '@/types/hotkey'; +import { HotkeyGroupEnum } from '@/types/hotkey'; const HotkeySetting = memo(() => { const { t } = useTranslation(['setting', 'hotkey']); diff --git a/src/app/[variants]/(main)/settings/image/features/Image.tsx b/src/app/[variants]/(main)/settings/image/features/Image.tsx index 533fe87b31..43cc509909 100644 --- a/src/app/[variants]/(main)/settings/image/features/Image.tsx +++ b/src/app/[variants]/(main)/settings/image/features/Image.tsx @@ -1,8 +1,8 @@ 'use client'; -import type {UserImageConfig} from '@lobechat/types'; -import type {FormGroupItemType} from '@lobehub/ui'; -import { Form, Icon, Skeleton } from '@lobehub/ui'; +import { type UserImageConfig } from '@lobechat/types'; +import { type FormGroupItemType } from '@lobehub/ui'; +import { Form, Icon, Skeleton } from '@lobehub/ui'; import { Loader2Icon } from 'lucide-react'; import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/settings/index.tsx b/src/app/[variants]/(main)/settings/index.tsx index f8b9accd42..77e07f7901 100644 --- a/src/app/[variants]/(main)/settings/index.tsx +++ b/src/app/[variants]/(main)/settings/index.tsx @@ -5,7 +5,7 @@ import { useParams } from 'react-router-dom'; import { SettingsTabs } from '@/store/global/initialState'; -import type {LayoutProps} from './_layout/type'; +import { type LayoutProps } from './_layout/type'; import SettingsContent from './features/SettingsContent'; const Layout = memo(() => { diff --git a/src/app/[variants]/(main)/settings/memory/features/Memory.tsx b/src/app/[variants]/(main)/settings/memory/features/Memory.tsx index 215c4feaa6..a2d5e7fab5 100644 --- a/src/app/[variants]/(main)/settings/memory/features/Memory.tsx +++ b/src/app/[variants]/(main)/settings/memory/features/Memory.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FormGroupItemType} from '@lobehub/ui'; -import { Form, Icon, Skeleton } from '@lobehub/ui'; +import { type FormGroupItemType } from '@lobehub/ui'; +import { Form, Icon, Skeleton } from '@lobehub/ui'; import { Switch } from 'antd'; import isEqual from 'fast-deep-equal'; import { Loader2Icon } from 'lucide-react'; diff --git a/src/app/[variants]/(main)/settings/profile/features/KlavisAuthorizationList/index.tsx b/src/app/[variants]/(main)/settings/profile/features/KlavisAuthorizationList/index.tsx index dd455b9407..caf3128367 100644 --- a/src/app/[variants]/(main)/settings/profile/features/KlavisAuthorizationList/index.tsx +++ b/src/app/[variants]/(main)/settings/profile/features/KlavisAuthorizationList/index.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'; import { modal } from '@/components/AntdStaticMethods'; import { useToolStore } from '@/store/tool'; -import type {KlavisServer} from '@/store/tool/slices/klavisStore'; +import { type KlavisServer } from '@/store/tool/slices/klavisStore'; interface KlavisAuthItemProps { server: KlavisServer; diff --git a/src/app/[variants]/(main)/settings/profile/features/ProfileRow.tsx b/src/app/[variants]/(main)/settings/profile/features/ProfileRow.tsx index d059fd8400..a9bac6ec2f 100644 --- a/src/app/[variants]/(main)/settings/profile/features/ProfileRow.tsx +++ b/src/app/[variants]/(main)/settings/profile/features/ProfileRow.tsx @@ -1,7 +1,7 @@ 'use client'; import { Flexbox, Text } from '@lobehub/ui'; -import type { CSSProperties, ReactNode } from 'react'; +import { type CSSProperties, type ReactNode } from 'react'; interface ProfileRowProps { action?: ReactNode; diff --git a/src/app/[variants]/(main)/settings/profile/features/SSOProvidersList/index.tsx b/src/app/[variants]/(main)/settings/profile/features/SSOProvidersList/index.tsx index 9354f63bf5..9f18ff9d50 100644 --- a/src/app/[variants]/(main)/settings/profile/features/SSOProvidersList/index.tsx +++ b/src/app/[variants]/(main)/settings/profile/features/SSOProvidersList/index.tsx @@ -1,9 +1,9 @@ import { isDesktop } from '@lobechat/const'; -import type {MenuProps} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu, Flexbox, Text } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu, Flexbox, Text } from '@lobehub/ui'; import { ArrowRight, Plus, Unlink } from 'lucide-react'; -import type {CSSProperties} from 'react'; -import { memo, useMemo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { modal, notification } from '@/components/AntdStaticMethods'; diff --git a/src/app/[variants]/(main)/settings/profile/features/UsernameRow.tsx b/src/app/[variants]/(main)/settings/profile/features/UsernameRow.tsx index ecf845d56f..80cf684198 100644 --- a/src/app/[variants]/(main)/settings/profile/features/UsernameRow.tsx +++ b/src/app/[variants]/(main)/settings/profile/features/UsernameRow.tsx @@ -2,7 +2,7 @@ import { Button, Flexbox, Input, Text } from '@lobehub/ui'; import { AnimatePresence, m as motion } from 'motion/react'; -import type { ChangeEvent } from 'react'; +import { type ChangeEvent } from 'react'; import { useCallback, useState } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/settings/provider/(list)/ProviderGrid/Card.tsx b/src/app/[variants]/(main)/settings/provider/(list)/ProviderGrid/Card.tsx index f5a4be0edb..95eb6adaec 100644 --- a/src/app/[variants]/(main)/settings/provider/(list)/ProviderGrid/Card.tsx +++ b/src/app/[variants]/(main)/settings/provider/(list)/ProviderGrid/Card.tsx @@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next'; import { BrandingProviderCard } from '@/business/client/features/BrandingProviderCard'; import { useIsDark } from '@/hooks/useIsDark'; -import type {AiProviderListItem} from '@/types/aiProvider'; +import { type AiProviderListItem } from '@/types/aiProvider'; import EnableSwitch from './EnableSwitch'; import { styles } from './style'; diff --git a/src/app/[variants]/(main)/settings/provider/(list)/ProviderGrid/EnableSwitch.tsx b/src/app/[variants]/(main)/settings/provider/(list)/ProviderGrid/EnableSwitch.tsx index 162e762051..5a96677283 100644 --- a/src/app/[variants]/(main)/settings/provider/(list)/ProviderGrid/EnableSwitch.tsx +++ b/src/app/[variants]/(main)/settings/provider/(list)/ProviderGrid/EnableSwitch.tsx @@ -1,4 +1,4 @@ -import type {FC} from 'react'; +import { type FC } from 'react'; import InstantSwitch from '@/components/InstantSwitch'; import { useAiInfraStore } from '@/store/aiInfra'; diff --git a/src/app/[variants]/(main)/settings/provider/ProviderMenu/Actions.tsx b/src/app/[variants]/(main)/settings/provider/ProviderMenu/Actions.tsx index 814a3540f0..6bdb6a693d 100644 --- a/src/app/[variants]/(main)/settings/provider/ProviderMenu/Actions.tsx +++ b/src/app/[variants]/(main)/settings/provider/ProviderMenu/Actions.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { MoreHorizontalIcon } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/app/[variants]/(main)/settings/provider/ProviderMenu/Item.tsx b/src/app/[variants]/(main)/settings/provider/ProviderMenu/Item.tsx index e6a030454e..5e9d8c512a 100644 --- a/src/app/[variants]/(main)/settings/provider/ProviderMenu/Item.tsx +++ b/src/app/[variants]/(main)/settings/provider/ProviderMenu/Item.tsx @@ -8,8 +8,8 @@ import { useLocation } from 'react-router-dom'; import { ProductLogo } from '@/components/Branding/ProductLogo'; import { isCustomBranding } from '@/const/version'; import NavItem from '@/features/NavPanel/components/NavItem'; -import type {AiProviderListItem} from '@/types/aiProvider'; -import { AiProviderSourceEnum } from '@/types/aiProvider'; +import { type AiProviderListItem } from '@/types/aiProvider'; +import { AiProviderSourceEnum } from '@/types/aiProvider'; interface ProviderItemProps extends AiProviderListItem { onClick: (id: string) => void; diff --git a/src/app/[variants]/(main)/settings/provider/ProviderMenu/SortProviderModal/GroupItem.tsx b/src/app/[variants]/(main)/settings/provider/ProviderMenu/SortProviderModal/GroupItem.tsx index 474c9235f6..021cd3bcf6 100644 --- a/src/app/[variants]/(main)/settings/provider/ProviderMenu/SortProviderModal/GroupItem.tsx +++ b/src/app/[variants]/(main)/settings/provider/ProviderMenu/SortProviderModal/GroupItem.tsx @@ -2,7 +2,7 @@ import { ProviderIcon } from '@lobehub/icons'; import { Avatar, Flexbox, SortableList } from '@lobehub/ui'; import { memo } from 'react'; -import type {AiProviderListItem} from '@/types/aiProvider'; +import { type AiProviderListItem } from '@/types/aiProvider'; const GroupItem = memo(({ id, name, source, logo }) => { return ( diff --git a/src/app/[variants]/(main)/settings/provider/ProviderMenu/SortProviderModal/index.tsx b/src/app/[variants]/(main)/settings/provider/ProviderMenu/SortProviderModal/index.tsx index 8045ab5fad..bf3696e6d0 100644 --- a/src/app/[variants]/(main)/settings/provider/ProviderMenu/SortProviderModal/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/ProviderMenu/SortProviderModal/index.tsx @@ -5,7 +5,7 @@ import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useAiInfraStore } from '@/store/aiInfra'; -import type {AiProviderListItem} from '@/types/aiProvider'; +import { type AiProviderListItem } from '@/types/aiProvider'; import GroupItem from './GroupItem'; diff --git a/src/app/[variants]/(main)/settings/provider/ProviderMenu/index.tsx b/src/app/[variants]/(main)/settings/provider/ProviderMenu/index.tsx index 316127bf95..09a6fcbd6a 100644 --- a/src/app/[variants]/(main)/settings/provider/ProviderMenu/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/ProviderMenu/index.tsx @@ -3,7 +3,7 @@ import { Flexbox, Icon, SearchBar } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { SearchIcon } from 'lucide-react'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/settings/provider/ProviderMenu/useDropdownMenu.tsx b/src/app/[variants]/(main)/settings/provider/ProviderMenu/useDropdownMenu.tsx index 100b8f570e..e041942c1d 100644 --- a/src/app/[variants]/(main)/settings/provider/ProviderMenu/useDropdownMenu.tsx +++ b/src/app/[variants]/(main)/settings/provider/ProviderMenu/useDropdownMenu.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { LucideCheck } from 'lucide-react'; import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/settings/provider/_layout/Desktop/Container.tsx b/src/app/[variants]/(main)/settings/provider/_layout/Desktop/Container.tsx index 216d890750..136600386b 100644 --- a/src/app/[variants]/(main)/settings/provider/_layout/Desktop/Container.tsx +++ b/src/app/[variants]/(main)/settings/provider/_layout/Desktop/Container.tsx @@ -1,7 +1,7 @@ 'use client'; import { Flexbox } from '@lobehub/ui'; -import type {FC, PropsWithChildren} from 'react'; +import { type FC, type PropsWithChildren } from 'react'; import NavHeader from '@/features/NavHeader'; import SettingContainer from '@/features/Setting/SettingContainer'; diff --git a/src/app/[variants]/(main)/settings/provider/_layout/Desktop/index.tsx b/src/app/[variants]/(main)/settings/provider/_layout/Desktop/index.tsx index bba0d2f7c1..8180e9abc5 100644 --- a/src/app/[variants]/(main)/settings/provider/_layout/Desktop/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/_layout/Desktop/index.tsx @@ -1,5 +1,5 @@ import { Flexbox } from '@lobehub/ui'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import ProviderMenu from '../../ProviderMenu'; import Container from './Container'; diff --git a/src/app/[variants]/(main)/settings/provider/_layout/Mobile.tsx b/src/app/[variants]/(main)/settings/provider/_layout/Mobile.tsx index 46f27f2b3d..1788ad4066 100644 --- a/src/app/[variants]/(main)/settings/provider/_layout/Mobile.tsx +++ b/src/app/[variants]/(main)/settings/provider/_layout/Mobile.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { useSearchParams } from 'react-router-dom'; import ProviderMenu from '../ProviderMenu'; diff --git a/src/app/[variants]/(main)/settings/provider/detail/azure/index.tsx b/src/app/[variants]/(main)/settings/provider/detail/azure/index.tsx index 4878f0c860..e6eba1a60d 100644 --- a/src/app/[variants]/(main)/settings/provider/detail/azure/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/detail/azure/index.tsx @@ -11,7 +11,7 @@ import { SkeletonInput } from '@/components/Skeleton'; import { aiModelSelectors, aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra'; import { KeyVaultsConfigKey, LLMProviderApiTokenKey, LLMProviderBaseUrlKey } from '../../const'; -import type {ProviderItem} from '../../type'; +import { type ProviderItem } from '../../type'; import ProviderDetail from '../default'; const styles = createStaticStyles(({ css, cssVar }) => ({ diff --git a/src/app/[variants]/(main)/settings/provider/detail/azureai/index.tsx b/src/app/[variants]/(main)/settings/provider/detail/azureai/index.tsx index 854fac5c08..c28fd332da 100644 --- a/src/app/[variants]/(main)/settings/provider/detail/azureai/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/detail/azureai/index.tsx @@ -9,7 +9,7 @@ import { SkeletonInput } from '@/components/Skeleton'; import { aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra'; import { KeyVaultsConfigKey, LLMProviderApiTokenKey, LLMProviderBaseUrlKey } from '../../const'; -import type {ProviderItem} from '../../type'; +import { type ProviderItem } from '../../type'; import ProviderDetail from '../default'; const providerKey = ModelProvider.AzureAI; diff --git a/src/app/[variants]/(main)/settings/provider/detail/bedrock/index.tsx b/src/app/[variants]/(main)/settings/provider/detail/bedrock/index.tsx index 763747b1f4..c0deb18f08 100644 --- a/src/app/[variants]/(main)/settings/provider/detail/bedrock/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/detail/bedrock/index.tsx @@ -7,10 +7,10 @@ import { useTranslation } from 'react-i18next'; import { FormPassword } from '@/components/FormInput'; import { SkeletonInput } from '@/components/Skeleton'; import { aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra'; -import type {GlobalLLMProviderKey} from '@/types/user/settings'; +import { type GlobalLLMProviderKey } from '@/types/user/settings'; import { KeyVaultsConfigKey } from '../../const'; -import type {ProviderItem} from '../../type'; +import { type ProviderItem } from '../../type'; import ProviderDetail from '../default'; const providerKey: GlobalLLMProviderKey = 'bedrock'; diff --git a/src/app/[variants]/(main)/settings/provider/detail/cloudflare/index.tsx b/src/app/[variants]/(main)/settings/provider/detail/cloudflare/index.tsx index 34febbf933..314b6b3f47 100644 --- a/src/app/[variants]/(main)/settings/provider/detail/cloudflare/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/detail/cloudflare/index.tsx @@ -6,10 +6,10 @@ import { useTranslation } from 'react-i18next'; import { FormInput, FormPassword } from '@/components/FormInput'; import { SkeletonInput } from '@/components/Skeleton'; import { aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra'; -import type {GlobalLLMProviderKey} from '@/types/user/settings'; +import { type GlobalLLMProviderKey } from '@/types/user/settings'; import { KeyVaultsConfigKey } from '../../const'; -import type {ProviderItem} from '../../type'; +import { type ProviderItem } from '../../type'; import ProviderDetail from '../default'; const providerKey: GlobalLLMProviderKey = 'cloudflare'; diff --git a/src/app/[variants]/(main)/settings/provider/detail/comfyui/index.tsx b/src/app/[variants]/(main)/settings/provider/detail/comfyui/index.tsx index b62b5f1c68..2f9666a263 100644 --- a/src/app/[variants]/(main)/settings/provider/detail/comfyui/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/detail/comfyui/index.tsx @@ -8,10 +8,10 @@ import { FormInput, FormPassword } from '@/components/FormInput'; import KeyValueEditor from '@/components/KeyValueEditor'; import { SkeletonInput } from '@/components/Skeleton'; import { aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra'; -import type {GlobalLLMProviderKey} from '@/types/user/settings'; +import { type GlobalLLMProviderKey } from '@/types/user/settings'; import { KeyVaultsConfigKey } from '../../const'; -import type {ProviderItem} from '../../type'; +import { type ProviderItem } from '../../type'; import ProviderDetail from '../default'; const providerKey: GlobalLLMProviderKey = 'comfyui'; diff --git a/src/app/[variants]/(main)/settings/provider/detail/default/index.tsx b/src/app/[variants]/(main)/settings/provider/detail/default/index.tsx index 249274828b..af4d0954f2 100644 --- a/src/app/[variants]/(main)/settings/provider/detail/default/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/detail/default/index.tsx @@ -7,7 +7,7 @@ import { useAiInfraStore } from '@/store/aiInfra'; import { useServerConfigStore } from '@/store/serverConfig'; import ModelList from '../../features/ModelList'; -import type {ProviderConfigProps} from '../../features/ProviderConfig'; +import { type ProviderConfigProps } from '../../features/ProviderConfig'; import ProviderConfig from '../../features/ProviderConfig'; interface ProviderDetailProps extends ProviderConfigProps { diff --git a/src/app/[variants]/(main)/settings/provider/detail/github/index.tsx b/src/app/[variants]/(main)/settings/provider/detail/github/index.tsx index 0adbd3a75f..9ef79dad69 100644 --- a/src/app/[variants]/(main)/settings/provider/detail/github/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/detail/github/index.tsx @@ -8,10 +8,10 @@ import { useTranslation } from 'react-i18next'; import { FormPassword } from '@/components/FormInput'; import { SkeletonInput } from '@/components/Skeleton'; import { aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra'; -import type {GlobalLLMProviderKey} from '@/types/user/settings'; +import { type GlobalLLMProviderKey } from '@/types/user/settings'; import { KeyVaultsConfigKey, LLMProviderApiTokenKey } from '../../const'; -import type {ProviderItem} from '../../type'; +import { type ProviderItem } from '../../type'; import ProviderDetail from '../default'; const styles = createStaticStyles(({ css, cssVar }) => ({ 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 f25f89130d..0d318ca7bd 100644 --- a/src/app/[variants]/(main)/settings/provider/detail/ollama/CheckError.tsx +++ b/src/app/[variants]/(main)/settings/provider/detail/ollama/CheckError.tsx @@ -1,6 +1,6 @@ -import type {ChatMessageError} from '@lobechat/types'; +import { type ChatMessageError } from '@lobechat/types'; import { Skeleton } from '@lobehub/ui'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import dynamic from '@/libs/next/dynamic'; diff --git a/src/app/[variants]/(main)/settings/provider/detail/ollama/Container.tsx b/src/app/[variants]/(main)/settings/provider/detail/ollama/Container.tsx index 410b5c83f6..ae77122caa 100644 --- a/src/app/[variants]/(main)/settings/provider/detail/ollama/Container.tsx +++ b/src/app/[variants]/(main)/settings/provider/detail/ollama/Container.tsx @@ -1,8 +1,8 @@ import { ActionIcon, Flexbox } from '@lobehub/ui'; -import { createStaticStyles , responsive } from 'antd-style'; +import { createStaticStyles, responsive } from 'antd-style'; import { XIcon } from 'lucide-react'; -import type {ReactNode} from 'react'; -import { useState } from 'react'; +import { type ReactNode } from 'react'; +import { useState } from 'react'; const styles = createStaticStyles(({ css, cssVar }) => ({ close: css` diff --git a/src/app/[variants]/(main)/settings/provider/detail/vertexai/index.tsx b/src/app/[variants]/(main)/settings/provider/detail/vertexai/index.tsx index 4e23778d61..5bfc5d6966 100644 --- a/src/app/[variants]/(main)/settings/provider/detail/vertexai/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/detail/vertexai/index.tsx @@ -8,10 +8,10 @@ import { useTranslation } from 'react-i18next'; import { FormPassword } from '@/components/FormInput'; import { SkeletonInput } from '@/components/Skeleton'; import { aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra'; -import type {GlobalLLMProviderKey} from '@/types/user/settings'; +import { type GlobalLLMProviderKey } from '@/types/user/settings'; import { KeyVaultsConfigKey, LLMProviderApiTokenKey } from '../../const'; -import type {ProviderItem} from '../../type'; +import { type ProviderItem } from '../../type'; import ProviderDetail from '../default'; const styles = createStaticStyles(({ css, cssVar }) => ({ diff --git a/src/app/[variants]/(main)/settings/provider/features/CreateNewProvider/index.tsx b/src/app/[variants]/(main)/settings/provider/features/CreateNewProvider/index.tsx index 8208f99385..63e7ed409c 100644 --- a/src/app/[variants]/(main)/settings/provider/features/CreateNewProvider/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/features/CreateNewProvider/index.tsx @@ -1,13 +1,6 @@ import { ProviderIcon } from '@lobehub/icons'; -import type {FormItemProps} from '@lobehub/ui'; -import { -Flexbox, - FormModal, - Icon, - Input, - InputPassword, - Select, - TextArea} from '@lobehub/ui'; +import { type FormItemProps } from '@lobehub/ui'; +import { Flexbox, FormModal, Icon, Input, InputPassword, Select, TextArea } from '@lobehub/ui'; import { App } from 'antd'; import { BrainIcon } from 'lucide-react'; import { memo, useState } from 'react'; @@ -15,7 +8,7 @@ import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; import { useAiInfraStore } from '@/store/aiInfra/store'; -import type {CreateAiProviderParams} from '@/types/aiProvider'; +import { type CreateAiProviderParams } from '@/types/aiProvider'; import { KeyVaultsConfigKey, LLMProviderApiTokenKey, LLMProviderBaseUrlKey } from '../../const'; import { CUSTOM_PROVIDER_SDK_OPTIONS } from '../customProviderSdkOptions'; diff --git a/src/app/[variants]/(main)/settings/provider/features/ModelList/CreateNewModelModal/ExtendParamsSelect.tsx b/src/app/[variants]/(main)/settings/provider/features/ModelList/CreateNewModelModal/ExtendParamsSelect.tsx index 737dca70ed..c07c78f108 100644 --- a/src/app/[variants]/(main)/settings/provider/features/ModelList/CreateNewModelModal/ExtendParamsSelect.tsx +++ b/src/app/[variants]/(main)/settings/provider/features/ModelList/CreateNewModelModal/ExtendParamsSelect.tsx @@ -1,7 +1,7 @@ import { Flexbox } from '@lobehub/ui'; -import { Popover, Select, Space, Switch, Tag, theme,Typography } from 'antd'; -import type { ExtendParamsType } from 'model-bank'; -import type { ReactNode } from 'react'; +import { Popover, Select, Space, Switch, Tag, theme, Typography } from 'antd'; +import { type ExtendParamsType } from 'model-bank'; +import { type ReactNode } from 'react'; import { memo, useMemo } from 'react'; import { Trans, useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/settings/provider/features/ModelList/CreateNewModelModal/Form.tsx b/src/app/[variants]/(main)/settings/provider/features/ModelList/CreateNewModelModal/Form.tsx index 5531b3c195..1b8cfc9f98 100644 --- a/src/app/[variants]/(main)/settings/provider/features/ModelList/CreateNewModelModal/Form.tsx +++ b/src/app/[variants]/(main)/settings/provider/features/ModelList/CreateNewModelModal/Form.tsx @@ -1,13 +1,13 @@ import { Input } from '@lobehub/ui'; -import type {FormInstance} from 'antd'; -import { Checkbox, Form, Select } from 'antd'; -import type {AiModelType} from 'model-bank'; +import { type FormInstance } from 'antd'; +import { Checkbox, Form, Select } from 'antd'; +import { type AiModelType } from 'model-bank'; import { memo, useEffect, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import MaxTokenSlider from '@/components/MaxTokenSlider'; import { useIsMobile } from '@/hooks/useIsMobile'; -import type {ChatModelCard} from '@/types/llm'; +import { type ChatModelCard } from '@/types/llm'; import ExtendParamsSelect from './ExtendParamsSelect'; diff --git a/src/app/[variants]/(main)/settings/provider/features/ModelList/CreateNewModelModal/index.tsx b/src/app/[variants]/(main)/settings/provider/features/ModelList/CreateNewModelModal/index.tsx index aae7c3532f..8792924d7f 100644 --- a/src/app/[variants]/(main)/settings/provider/features/ModelList/CreateNewModelModal/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/features/ModelList/CreateNewModelModal/index.tsx @@ -1,5 +1,5 @@ import { Button, Modal } from '@lobehub/ui'; -import type {FormInstance} from 'antd'; +import { type FormInstance } from 'antd'; import { memo, use, useState } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/settings/provider/features/ModelList/DisabledModels.tsx b/src/app/[variants]/(main)/settings/provider/features/ModelList/DisabledModels.tsx index aa9acd5d10..eb62498a3b 100644 --- a/src/app/[variants]/(main)/settings/provider/features/ModelList/DisabledModels.tsx +++ b/src/app/[variants]/(main)/settings/provider/features/ModelList/DisabledModels.tsx @@ -1,8 +1,8 @@ import { ActionIcon, DropdownMenu, Flexbox, Icon, Text, TooltipGroup } from '@lobehub/ui'; -import type { ItemType } from 'antd/es/menu/interface'; +import { type ItemType } from 'antd/es/menu/interface'; import isEqual from 'fast-deep-equal'; import { ArrowDownUpIcon, LucideCheck } from 'lucide-react'; -import type { AiProviderModelListItem } from 'model-bank'; +import { type AiProviderModelListItem } from 'model-bank'; import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import useSWRInfinite from 'swr/infinite'; diff --git a/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelConfigModal/index.tsx b/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelConfigModal/index.tsx index 0e9cfe5c8e..a0ddbe962f 100644 --- a/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelConfigModal/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelConfigModal/index.tsx @@ -1,5 +1,5 @@ import { Button, Modal } from '@lobehub/ui'; -import type {FormInstance} from 'antd'; +import { type FormInstance } from 'antd'; import isEqual from 'fast-deep-equal'; import { memo, use, useState } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelItem.tsx b/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelItem.tsx index 1dd087493b..981b845ebb 100644 --- a/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelItem.tsx +++ b/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelItem.tsx @@ -1,10 +1,10 @@ import { ModelIcon } from '@lobehub/icons'; -import { ActionIcon, copyToClipboard,Flexbox, Tag, Text } from '@lobehub/ui'; +import { ActionIcon, copyToClipboard, Flexbox, Tag, Text } from '@lobehub/ui'; import { App, Switch } from 'antd'; import { createStaticStyles, cssVar } from 'antd-style'; import { LucidePencil, TrashIcon } from 'lucide-react'; -import type {AiProviderModelListItem} from 'model-bank'; -import { AiModelSourceEnum } from 'model-bank'; +import { type AiProviderModelListItem } from 'model-bank'; +import { AiModelSourceEnum } from 'model-bank'; import React, { memo, use, useState } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelTitle/Search.tsx b/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelTitle/Search.tsx index 43f7c9733e..625441257c 100644 --- a/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelTitle/Search.tsx +++ b/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelTitle/Search.tsx @@ -1,5 +1,5 @@ -import type {InputProps} from '@lobehub/ui'; -import { SearchBar } from '@lobehub/ui'; +import { type InputProps } from '@lobehub/ui'; +import { SearchBar } from '@lobehub/ui'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/settings/provider/features/ModelList/SortModelModal/ListItem.tsx b/src/app/[variants]/(main)/settings/provider/features/ModelList/SortModelModal/ListItem.tsx index 1ab78145ce..6b14ac5949 100644 --- a/src/app/[variants]/(main)/settings/provider/features/ModelList/SortModelModal/ListItem.tsx +++ b/src/app/[variants]/(main)/settings/provider/features/ModelList/SortModelModal/ListItem.tsx @@ -1,6 +1,6 @@ import { ModelIcon } from '@lobehub/icons'; import { Flexbox, SortableList } from '@lobehub/ui'; -import type {AiProviderModelListItem} from 'model-bank'; +import { type AiProviderModelListItem } from 'model-bank'; import { memo } from 'react'; const ListItem = memo(({ id, displayName }) => { diff --git a/src/app/[variants]/(main)/settings/provider/features/ModelList/SortModelModal/index.tsx b/src/app/[variants]/(main)/settings/provider/features/ModelList/SortModelModal/index.tsx index c6646ef246..cfb62c8ee8 100644 --- a/src/app/[variants]/(main)/settings/provider/features/ModelList/SortModelModal/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/features/ModelList/SortModelModal/index.tsx @@ -1,7 +1,7 @@ import { Button, Flexbox, Modal, SortableList } from '@lobehub/ui'; import { App } from 'antd'; import { createStaticStyles } from 'antd-style'; -import type {AiProviderModelListItem} from 'model-bank'; +import { type AiProviderModelListItem } from 'model-bank'; import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/settings/provider/features/ModelList/index.tsx b/src/app/[variants]/(main)/settings/provider/features/ModelList/index.tsx index 28643aaf10..8ef497b6a2 100644 --- a/src/app/[variants]/(main)/settings/provider/features/ModelList/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/features/ModelList/index.tsx @@ -21,10 +21,8 @@ import DisabledModels from './DisabledModels'; import EmptyModels from './EmptyModels'; import EnabledModelList from './EnabledModelList'; import ModelTitle from './ModelTitle'; -import type {ProviderSettingsContextValue} from './ProviderSettingsContext'; -import { - ProviderSettingsContext -} from './ProviderSettingsContext'; +import { type ProviderSettingsContextValue } from './ProviderSettingsContext'; +import { ProviderSettingsContext } from './ProviderSettingsContext'; import SearchResult from './SearchResult'; import SkeletonList from './SkeletonList'; diff --git a/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/Checker.tsx b/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/Checker.tsx index dfba38edf5..9ec0613b79 100644 --- a/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/Checker.tsx +++ b/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/Checker.tsx @@ -1,14 +1,14 @@ 'use client'; import { CheckCircleFilled } from '@ant-design/icons'; -import type {ChatMessageError} from '@lobechat/types'; -import { TraceNameMap } from '@lobechat/types'; +import { type ChatMessageError } from '@lobechat/types'; +import { TraceNameMap } from '@lobechat/types'; import { ModelIcon } from '@lobehub/icons'; import { Alert, Button, Flexbox, Highlighter, Icon, LobeSelect as Select } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import { Loader2Icon } from 'lucide-react'; -import type {ReactNode} from 'react'; -import { memo, useEffect, useMemo, useState } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useProviderName } from '@/hooks/useProviderName'; diff --git a/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/EnableSwitch.tsx b/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/EnableSwitch.tsx index fc1c3781e8..21441606aa 100644 --- a/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/EnableSwitch.tsx +++ b/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/EnableSwitch.tsx @@ -1,6 +1,6 @@ import { Skeleton } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; -import type {FC} from 'react'; +import { type FC } from 'react'; import InstantSwitch from '@/components/InstantSwitch'; import { aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra'; diff --git a/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/OAuthDeviceFlowAuth/index.tsx b/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/OAuthDeviceFlowAuth/index.tsx index 3d0e4ae7b8..18f47a5fba 100644 --- a/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/OAuthDeviceFlowAuth/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/OAuthDeviceFlowAuth/index.tsx @@ -6,8 +6,8 @@ import { CopyButton, Flexbox, Icon } from '@lobehub/ui'; import { App, Avatar, Button, Typography } from 'antd'; import { createStyles, cssVar } from 'antd-style'; import { ExternalLinkIcon, Loader2Icon, LogOutIcon, UnplugIcon } from 'lucide-react'; -import type {ReactNode} from 'react'; -import { memo, useCallback, useEffect, useRef, useState } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useCallback, useEffect, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { lambdaQuery } from '@/libs/trpc/client'; diff --git a/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsx b/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsx index e1581be43c..9f63c750d6 100644 --- a/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsx +++ b/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsx @@ -1,6 +1,6 @@ import { ProviderIcon } from '@lobehub/icons'; -import type {FormItemProps} from '@lobehub/ui'; -import { Button, Flexbox,FormModal, Icon, Input, Select, TextArea } from '@lobehub/ui'; +import { type FormItemProps } from '@lobehub/ui'; +import { Button, Flexbox, FormModal, Icon, Input, Select, TextArea } from '@lobehub/ui'; import { App } from 'antd'; import { BrainIcon } from 'lucide-react'; import { memo, useState } from 'react'; @@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; import { useAiInfraStore } from '@/store/aiInfra/store'; -import type {AiProviderDetailItem, UpdateAiProviderParams} from '@/types/aiProvider'; +import { type AiProviderDetailItem, type UpdateAiProviderParams } from '@/types/aiProvider'; import { CUSTOM_PROVIDER_SDK_OPTIONS } from '../../customProviderSdkOptions'; 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 21519b6d48..6e97d7cfdd 100644 --- a/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/index.tsx +++ b/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/index.tsx @@ -3,19 +3,14 @@ import { ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const'; import { AES_GCM_URL, BASE_PROVIDER_DOC_URL, FORM_STYLE, isDesktop } from '@lobechat/const'; import { ProviderCombine } from '@lobehub/icons'; -import type {FormGroupItemType, FormItemProps} from '@lobehub/ui'; -import { - Avatar, -Center, Flexbox, Form, - Icon, -Skeleton, - Tooltip} from '@lobehub/ui'; +import { type FormGroupItemType, type FormItemProps } from '@lobehub/ui'; +import { Avatar, Center, Flexbox, Form, Icon, Skeleton, Tooltip } from '@lobehub/ui'; import { useDebounceFn } from 'ahooks'; import { Form as AntdForm, Switch } from 'antd'; import { createStaticStyles, cssVar, cx, responsive } from 'antd-style'; import { Loader2Icon, LockIcon } from 'lucide-react'; -import type {ReactNode} from 'react'; -import { memo, useCallback, useLayoutEffect, useRef } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useCallback, useLayoutEffect, useRef } from 'react'; import { Trans, useTranslation } from 'react-i18next'; import urlJoin from 'url-join'; import { z } from 'zod'; @@ -24,13 +19,11 @@ import { FormInput, FormPassword } from '@/components/FormInput'; import { SkeletonInput, SkeletonSwitch } from '@/components/Skeleton'; import { lambdaQuery } from '@/libs/trpc/client'; import { aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra'; -import type {AiProviderDetailItem, AiProviderSourceType} from '@/types/aiProvider'; -import { - AiProviderSourceEnum -} from '@/types/aiProvider'; +import { type AiProviderDetailItem, type AiProviderSourceType } from '@/types/aiProvider'; +import { AiProviderSourceEnum } from '@/types/aiProvider'; import { KeyVaultsConfigKey, LLMProviderApiTokenKey, LLMProviderBaseUrlKey } from '../../const'; -import type {CheckErrorRender} from './Checker'; +import { type CheckErrorRender } from './Checker'; import Checker from './Checker'; import EnableSwitch from './EnableSwitch'; import OAuthDeviceFlowAuth from './OAuthDeviceFlowAuth'; diff --git a/src/app/[variants]/(main)/settings/provider/features/customProviderSdkOptions.ts b/src/app/[variants]/(main)/settings/provider/features/customProviderSdkOptions.ts index d7010b3754..9ddb74964b 100644 --- a/src/app/[variants]/(main)/settings/provider/features/customProviderSdkOptions.ts +++ b/src/app/[variants]/(main)/settings/provider/features/customProviderSdkOptions.ts @@ -1,4 +1,4 @@ -import type { AiProviderSDKType } from '@/types/aiProvider'; +import { type AiProviderSDKType } from '@/types/aiProvider'; export const CUSTOM_PROVIDER_SDK_OPTIONS = [ { label: 'OpenAI', value: 'openai' }, diff --git a/src/app/[variants]/(main)/settings/provider/type.ts b/src/app/[variants]/(main)/settings/provider/type.ts index 1a77ec1a64..209cb4e107 100644 --- a/src/app/[variants]/(main)/settings/provider/type.ts +++ b/src/app/[variants]/(main)/settings/provider/type.ts @@ -1,4 +1,4 @@ -import type {ProviderConfigProps} from './features/ProviderConfig'; +import { type ProviderConfigProps } from './features/ProviderConfig'; export interface ProviderItem extends Omit { id: string; diff --git a/src/app/[variants]/(main)/settings/proxy/features/ProxyForm.tsx b/src/app/[variants]/(main)/settings/proxy/features/ProxyForm.tsx index 77ef31d423..af47dd4228 100644 --- a/src/app/[variants]/(main)/settings/proxy/features/ProxyForm.tsx +++ b/src/app/[variants]/(main)/settings/proxy/features/ProxyForm.tsx @@ -1,8 +1,8 @@ 'use client'; -import type {NetworkProxySettings} from '@lobechat/electron-client-ipc'; -import type {FormGroupItemType} from '@lobehub/ui'; -import { Alert, Flexbox, Form, Icon, Skeleton } from '@lobehub/ui'; +import { type NetworkProxySettings } from '@lobechat/electron-client-ipc'; +import { type FormGroupItemType } from '@lobehub/ui'; +import { Alert, Flexbox, Form, Icon, Skeleton } from '@lobehub/ui'; import { Button, Form as AntdForm, Input, Radio, Space, Switch } from 'antd'; import { Loader2Icon } from 'lucide-react'; import { useCallback, useEffect, useState } from 'react'; diff --git a/src/app/[variants]/(main)/settings/skill/features/Actions.tsx b/src/app/[variants]/(main)/settings/skill/features/Actions.tsx index 7efdec1966..a0680697f0 100644 --- a/src/app/[variants]/(main)/settings/skill/features/Actions.tsx +++ b/src/app/[variants]/(main)/settings/skill/features/Actions.tsx @@ -11,7 +11,7 @@ import { agentSelectors } from '@/store/agent/selectors'; import { useServerConfigStore } from '@/store/serverConfig'; import { pluginHelpers, useToolStore } from '@/store/tool'; import { pluginSelectors, pluginStoreSelectors } from '@/store/tool/selectors'; -import type {LobeToolType} from '@/types/tool/tool'; +import { type LobeToolType } from '@/types/tool/tool'; import EditCustomPlugin from './EditCustomPlugin'; diff --git a/src/app/[variants]/(main)/settings/skill/features/EditCustomPlugin.tsx b/src/app/[variants]/(main)/settings/skill/features/EditCustomPlugin.tsx index 64557375aa..5054cce904 100644 --- a/src/app/[variants]/(main)/settings/skill/features/EditCustomPlugin.tsx +++ b/src/app/[variants]/(main)/settings/skill/features/EditCustomPlugin.tsx @@ -1,5 +1,5 @@ import isEqual from 'fast-deep-equal'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import DevModal from '@/features/PluginDevModal'; diff --git a/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx b/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx index 970f5d7d10..c79f0c5953 100644 --- a/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx +++ b/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {KlavisServerType} from '@lobechat/const'; -import { Avatar, Button as LobeButton,DropdownMenu, Flexbox, Icon } from '@lobehub/ui'; +import { type KlavisServerType } from '@lobechat/const'; +import { Avatar, Button as LobeButton, DropdownMenu, Flexbox, Icon } from '@lobehub/ui'; import { App, Button } from 'antd'; import { cssVar } from 'antd-style'; import { Loader2, MoreHorizontalIcon, SquareArrowOutUpRight, Unplug } from 'lucide-react'; @@ -10,8 +10,8 @@ import { useTranslation } from 'react-i18next'; import { createKlavisSkillDetailModal } from '@/features/SkillStore/SkillDetail'; import { useToolStore } from '@/store/tool'; -import type {KlavisServer} from '@/store/tool/slices/klavisStore'; -import { KlavisServerStatus } from '@/store/tool/slices/klavisStore'; +import { type KlavisServer } from '@/store/tool/slices/klavisStore'; +import { KlavisServerStatus } from '@/store/tool/slices/klavisStore'; import { useUserStore } from '@/store/user'; import { userProfileSelectors } from '@/store/user/selectors'; diff --git a/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx b/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx index d5478b0945..8a48e41971 100644 --- a/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx +++ b/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {LobehubSkillProviderType} from '@lobechat/const'; -import { Avatar, Button as LobeButton,DropdownMenu, Flexbox, Icon } from '@lobehub/ui'; +import { type LobehubSkillProviderType } from '@lobechat/const'; +import { Avatar, Button as LobeButton, DropdownMenu, Flexbox, Icon } from '@lobehub/ui'; import { App, Button } from 'antd'; import { cssVar } from 'antd-style'; import { Loader2, MoreHorizontalIcon, SquareArrowOutUpRight, Unplug } from 'lucide-react'; @@ -10,10 +10,8 @@ import { useTranslation } from 'react-i18next'; import { createLobehubSkillDetailModal } from '@/features/SkillStore/SkillDetail'; import { useToolStore } from '@/store/tool'; -import type {LobehubSkillServer} from '@/store/tool/slices/lobehubSkillStore/types'; -import { - LobehubSkillStatus -} from '@/store/tool/slices/lobehubSkillStore/types'; +import { type LobehubSkillServer } from '@/store/tool/slices/lobehubSkillStore/types'; +import { LobehubSkillStatus } from '@/store/tool/slices/lobehubSkillStore/types'; import { styles } from './style'; diff --git a/src/app/[variants]/(main)/settings/skill/features/McpSkillItem.tsx b/src/app/[variants]/(main)/settings/skill/features/McpSkillItem.tsx index c544cbc86a..b5d8886060 100644 --- a/src/app/[variants]/(main)/settings/skill/features/McpSkillItem.tsx +++ b/src/app/[variants]/(main)/settings/skill/features/McpSkillItem.tsx @@ -11,7 +11,7 @@ import McpDetailLoading from '@/features/MCP/MCPDetail/Loading'; import PluginDetailModal from '@/features/PluginDetailModal'; import { useToolStore } from '@/store/tool'; import { pluginSelectors } from '@/store/tool/selectors'; -import type {LobeToolType} from '@/types/tool/tool'; +import { type LobeToolType } from '@/types/tool/tool'; import Actions from './Actions'; import { styles } from './style'; diff --git a/src/app/[variants]/(main)/settings/skill/features/SkillList.tsx b/src/app/[variants]/(main)/settings/skill/features/SkillList.tsx index ad28f5c85c..b2f93c0c70 100644 --- a/src/app/[variants]/(main)/settings/skill/features/SkillList.tsx +++ b/src/app/[variants]/(main)/settings/skill/features/SkillList.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { KlavisServerType, LobehubSkillProviderType } from '@lobechat/const'; +import { type KlavisServerType, type LobehubSkillProviderType } from '@lobechat/const'; import { getKlavisServerByServerIdentifier, getLobehubSkillProviderById, @@ -9,7 +9,7 @@ import { RECOMMENDED_SKILLS, RecommendedSkillType, } from '@lobechat/const'; -import type { LobeBuiltinTool } from '@lobechat/types'; +import { type LobeBuiltinTool } from '@lobechat/types'; import { Center, Empty } from '@lobehub/ui'; import { Divider } from 'antd'; import { createStaticStyles } from 'antd-style'; @@ -30,7 +30,7 @@ import { } from '@/store/tool/selectors'; import { KlavisServerStatus } from '@/store/tool/slices/klavisStore'; import { LobehubSkillStatus } from '@/store/tool/slices/lobehubSkillStore/types'; -import type { LobeToolType } from '@/types/tool/tool'; +import { type LobeToolType } from '@/types/tool/tool'; import BuiltinSkillItem from './BuiltinSkillItem'; import KlavisSkillItem from './KlavisSkillItem'; diff --git a/src/app/[variants]/(main)/settings/stats/features/components/StatsFormGroup.tsx b/src/app/[variants]/(main)/settings/stats/features/components/StatsFormGroup.tsx index 236f33c73f..ff19cdb436 100644 --- a/src/app/[variants]/(main)/settings/stats/features/components/StatsFormGroup.tsx +++ b/src/app/[variants]/(main)/settings/stats/features/components/StatsFormGroup.tsx @@ -1,8 +1,8 @@ 'use client'; -import type {BlockProps} from '@lobehub/ui'; -import { Block, Flexbox, Text } from '@lobehub/ui'; -import type {ReactNode} from 'react'; +import { type BlockProps } from '@lobehub/ui'; +import { Block, Flexbox, Text } from '@lobehub/ui'; +import { type ReactNode } from 'react'; import { memo } from 'react'; interface StatsFormGroupProps extends Omit { diff --git a/src/app/[variants]/(main)/settings/stats/features/components/TimeLabel.tsx b/src/app/[variants]/(main)/settings/stats/features/components/TimeLabel.tsx index f478b5b0f9..85ff3349db 100644 --- a/src/app/[variants]/(main)/settings/stats/features/components/TimeLabel.tsx +++ b/src/app/[variants]/(main)/settings/stats/features/components/TimeLabel.tsx @@ -1,7 +1,7 @@ import { Flexbox, Icon } from '@lobehub/ui'; import { cssVar } from 'antd-style'; -import type {LucideIcon} from 'lucide-react'; -import { Loader2 } from 'lucide-react'; +import { type LucideIcon } from 'lucide-react'; +import { Loader2 } from 'lucide-react'; import { memo } from 'react'; const TimeLabel = memo<{ diff --git a/src/app/[variants]/(main)/settings/stats/features/components/UsageBarChart.tsx b/src/app/[variants]/(main)/settings/stats/features/components/UsageBarChart.tsx index d8cb7ae4cd..80e6254b7c 100644 --- a/src/app/[variants]/(main)/settings/stats/features/components/UsageBarChart.tsx +++ b/src/app/[variants]/(main)/settings/stats/features/components/UsageBarChart.tsx @@ -1,5 +1,5 @@ -import type {BarChartProps} from '@lobehub/charts'; -import { BarChart, ChartTooltipFrame, ChartTooltipRow } from '@lobehub/charts'; +import { type BarChartProps } from '@lobehub/charts'; +import { BarChart, ChartTooltipFrame, ChartTooltipRow } from '@lobehub/charts'; import { Flexbox, Text } from '@lobehub/ui'; import { Divider } from 'antd'; diff --git a/src/app/[variants]/(main)/settings/stats/features/overview/ShareButton/ShareModal.tsx b/src/app/[variants]/(main)/settings/stats/features/overview/ShareButton/ShareModal.tsx index 53efb17afe..26dbcdd1c4 100644 --- a/src/app/[variants]/(main)/settings/stats/features/overview/ShareButton/ShareModal.tsx +++ b/src/app/[variants]/(main)/settings/stats/features/overview/ShareButton/ShareModal.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FormItemProps, FormModalProps} from '@lobehub/ui'; -import { FormModal, Segmented, Skeleton } from '@lobehub/ui'; +import { type FormItemProps, type FormModalProps } from '@lobehub/ui'; +import { FormModal, Segmented, Skeleton } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/settings/stats/features/rankings/AssistantsRank.tsx b/src/app/[variants]/(main)/settings/stats/features/rankings/AssistantsRank.tsx index 34b9a38036..1a060e2c01 100644 --- a/src/app/[variants]/(main)/settings/stats/features/rankings/AssistantsRank.tsx +++ b/src/app/[variants]/(main)/settings/stats/features/rankings/AssistantsRank.tsx @@ -11,7 +11,7 @@ import { INBOX_SESSION_ID } from '@/const/session'; import Link from '@/libs/router/Link'; import { useClientDataSWR } from '@/libs/swr'; import { sessionService } from '@/services/session'; -import type {SessionRankItem} from '@/types/session'; +import { type SessionRankItem } from '@/types/session'; import StatsFormGroup from '../components/StatsFormGroup'; diff --git a/src/app/[variants]/(main)/settings/stats/features/rankings/ModelsRank.tsx b/src/app/[variants]/(main)/settings/stats/features/rankings/ModelsRank.tsx index 7cc82fe361..35593e7240 100644 --- a/src/app/[variants]/(main)/settings/stats/features/rankings/ModelsRank.tsx +++ b/src/app/[variants]/(main)/settings/stats/features/rankings/ModelsRank.tsx @@ -1,4 +1,4 @@ -import type {ModelRankItem} from '@lobechat/types'; +import { type ModelRankItem } from '@lobechat/types'; import { BarList } from '@lobehub/charts'; import { ModelIcon } from '@lobehub/icons'; import { ActionIcon, Modal } from '@lobehub/ui'; diff --git a/src/app/[variants]/(main)/settings/stats/features/rankings/TopicsRank.tsx b/src/app/[variants]/(main)/settings/stats/features/rankings/TopicsRank.tsx index 8e6a5c838f..32ec55c2a4 100644 --- a/src/app/[variants]/(main)/settings/stats/features/rankings/TopicsRank.tsx +++ b/src/app/[variants]/(main)/settings/stats/features/rankings/TopicsRank.tsx @@ -11,7 +11,7 @@ import { INBOX_SESSION_ID } from '@/const/session'; import Link from '@/libs/router/Link'; import { useClientDataSWR } from '@/libs/swr'; import { topicService } from '@/services/topic'; -import type {TopicRankItem} from '@/types/topic'; +import { type TopicRankItem } from '@/types/topic'; import StatsFormGroup from '../components/StatsFormGroup'; 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 45b4bbc4a2..58b241d3c0 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 @@ -6,11 +6,11 @@ import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import InlineTable from '@/components/InlineTable'; -import type {UsageLog} from '@/types/usage/usageRecord'; +import { type UsageLog } from '@/types/usage/usageRecord'; import { formatPrice } from '@/utils/format'; -import type {UsageChartProps} from '../../../../types'; -import { GroupBy } from '../../../../types'; +import { type UsageChartProps } from '../../../../types'; +import { GroupBy } from '../../../../types'; interface WeightGroup { id: string; diff --git a/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/ActiveModels/index.tsx b/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/ActiveModels/index.tsx index f88fa3e3dd..7e7c37e6c9 100644 --- a/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/ActiveModels/index.tsx +++ b/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/ActiveModels/index.tsx @@ -7,11 +7,11 @@ import { useTranslation } from 'react-i18next'; import StatisticCard from '@/components/StatisticCard'; import TitleWithPercentage from '@/components/StatisticCard/TitleWithPercentage'; -import type {UsageLog} from '@/types/usage/usageRecord'; +import { type UsageLog } from '@/types/usage/usageRecord'; import { formatNumber } from '@/utils/format'; -import type {UsageChartProps} from '../../../../types'; -import { GroupBy } from '../../../../types'; +import { type UsageChartProps } from '../../../../types'; +import { GroupBy } from '../../../../types'; import ModelTable from './ModelTable'; const computeList = (data: UsageLog[], groupBy: GroupBy): string[] => { diff --git a/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/MonthSpend.tsx b/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/MonthSpend.tsx index dce5dfde9c..158fbf2a1c 100644 --- a/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/MonthSpend.tsx +++ b/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/MonthSpend.tsx @@ -6,10 +6,10 @@ import { useTranslation } from 'react-i18next'; import Statistic from '@/components/Statistic'; import StatisticCard from '@/components/StatisticCard'; import TitleWithPercentage from '@/components/StatisticCard/TitleWithPercentage'; -import type {UsageLog} from '@/types/usage/usageRecord'; +import { type UsageLog } from '@/types/usage/usageRecord'; import { formatNumber } from '@/utils/format'; -import type {UsageChartProps} from '../../../types'; +import { type UsageChartProps } from '../../../types'; const computeMonth = ( data: UsageLog[], diff --git a/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/TodaySpend.tsx b/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/TodaySpend.tsx index 12b73eab8d..e8dfb6d499 100644 --- a/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/TodaySpend.tsx +++ b/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/TodaySpend.tsx @@ -10,10 +10,10 @@ import { useTranslation } from 'react-i18next'; import Statistic from '@/components/Statistic'; import StatisticCard from '@/components/StatisticCard'; import TitleWithPercentage from '@/components/StatisticCard/TitleWithPercentage'; -import type {UsageLog} from '@/types/usage/usageRecord'; +import { type UsageLog } from '@/types/usage/usageRecord'; import { formatNumber } from '@/utils/format'; -import type {UsageChartProps} from '../../../types'; +import { type UsageChartProps } from '../../../types'; dayjs.extend(utc); dayjs.extend(isToday); diff --git a/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/index.tsx b/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/index.tsx index c7262bcbaa..3c9fe16863 100644 --- a/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/index.tsx +++ b/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/index.tsx @@ -1,7 +1,7 @@ import { Flexbox } from '@lobehub/ui'; import { memo } from 'react'; -import type {UsageChartProps} from '../../../types'; +import { type UsageChartProps } from '../../../types'; import ActiveModels from './ActiveModels'; import MonthSpend from './MonthSpend'; import TodaySpend from './TodaySpend'; diff --git a/src/app/[variants]/(main)/settings/stats/features/usage/UsageTable.tsx b/src/app/[variants]/(main)/settings/stats/features/usage/UsageTable.tsx index 7e5741b1bf..503368b4bb 100644 --- a/src/app/[variants]/(main)/settings/stats/features/usage/UsageTable.tsx +++ b/src/app/[variants]/(main)/settings/stats/features/usage/UsageTable.tsx @@ -1,6 +1,6 @@ import { ProviderIcon } from '@lobehub/icons'; import { Flexbox, Tag, Text, Tooltip } from '@lobehub/ui'; -import type {TableColumnType} from 'antd'; +import { type TableColumnType } from 'antd'; import { cssVar } from 'antd-style'; import { memo, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; @@ -11,7 +11,7 @@ import { useClientDataSWR } from '@/libs/swr'; import { usageService } from '@/services/usage'; import { formatDate, formatNumber } from '@/utils/format'; -import type {UsageChartProps} from '../../types'; +import { type UsageChartProps } from '../../types'; const UsageTable = memo(({ dateStrings }) => { const { t } = useTranslation('auth'); 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 0b625224a0..8ff2be83e6 100644 --- a/src/app/[variants]/(main)/settings/stats/features/usage/UsageTrends.tsx +++ b/src/app/[variants]/(main)/settings/stats/features/usage/UsageTrends.tsx @@ -1,13 +1,13 @@ -import type {BarChartProps} from '@lobehub/charts'; +import { type BarChartProps } from '@lobehub/charts'; import { Segmented, Skeleton } from '@lobehub/ui'; import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import type {UsageLog} from '@/types/usage/usageRecord'; +import { type UsageLog } from '@/types/usage/usageRecord'; import { formatNumber } from '@/utils/format'; -import type {UsageChartProps} from '../../types'; -import { GroupBy } from '../../types'; +import { type UsageChartProps } from '../../types'; +import { GroupBy } from '../../types'; import StatsFormGroup from '../components/StatsFormGroup'; import { UsageBarChart } from '../components/UsageBarChart'; diff --git a/src/app/[variants]/(main)/settings/stats/features/visualization/AiHeatmaps.tsx b/src/app/[variants]/(main)/settings/stats/features/visualization/AiHeatmaps.tsx index b9ea65d463..35138060cc 100644 --- a/src/app/[variants]/(main)/settings/stats/features/visualization/AiHeatmaps.tsx +++ b/src/app/[variants]/(main)/settings/stats/features/visualization/AiHeatmaps.tsx @@ -1,5 +1,5 @@ -import type {HeatmapsProps} from '@lobehub/charts'; -import { Heatmaps } from '@lobehub/charts'; +import { type HeatmapsProps } from '@lobehub/charts'; +import { Heatmaps } from '@lobehub/charts'; import { Flexbox, Icon, Tag } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { FlameIcon } from 'lucide-react'; diff --git a/src/app/[variants]/(main)/settings/stats/index.tsx b/src/app/[variants]/(main)/settings/stats/index.tsx index 90f855fa60..5059649420 100644 --- a/src/app/[variants]/(main)/settings/stats/index.tsx +++ b/src/app/[variants]/(main)/settings/stats/index.tsx @@ -2,8 +2,8 @@ import { FormGroup, Grid, Icon, Segmented } from '@lobehub/ui'; import { ProviderIcon } from '@lobehub/ui/icons'; -import type {DatePickerProps} from 'antd'; -import { DatePicker, Divider } from 'antd'; +import { type DatePickerProps } from 'antd'; +import { DatePicker, Divider } from 'antd'; import dayjs from 'dayjs'; import { Brain } from 'lucide-react'; import { memo, useEffect, useState } from 'react'; diff --git a/src/app/[variants]/(main)/settings/stats/types.ts b/src/app/[variants]/(main)/settings/stats/types.ts index 6a8b716d6a..c5ae3ab061 100644 --- a/src/app/[variants]/(main)/settings/stats/types.ts +++ b/src/app/[variants]/(main)/settings/stats/types.ts @@ -1,4 +1,4 @@ -import type {UsageLog} from '@/types/usage/usageRecord'; +import { type UsageLog } from '@/types/usage/usageRecord'; export interface UsageChartProps { data?: UsageLog[]; diff --git a/src/app/[variants]/(main)/settings/storage/features/Advanced.tsx b/src/app/[variants]/(main)/settings/storage/features/Advanced.tsx index cc49a74d10..511b04ea52 100644 --- a/src/app/[variants]/(main)/settings/storage/features/Advanced.tsx +++ b/src/app/[variants]/(main)/settings/storage/features/Advanced.tsx @@ -2,8 +2,8 @@ import { BRANDING_NAME } from '@lobechat/business-const'; import { DEFAULT_SETTINGS } from '@lobechat/config'; -import type {FormGroupItemType} from '@lobehub/ui'; -import { Button, Form, Icon } from '@lobehub/ui'; +import { type FormGroupItemType } from '@lobehub/ui'; +import { Button, Form, Icon } from '@lobehub/ui'; import { App, Switch } from 'antd'; import isEqual from 'fast-deep-equal'; import { HardDriveDownload, HardDriveUpload } from 'lucide-react'; diff --git a/src/app/[variants]/(main)/settings/system-tools/features/ToolDetectorSection.tsx b/src/app/[variants]/(main)/settings/system-tools/features/ToolDetectorSection.tsx index 67401ede04..71d0cace0e 100644 --- a/src/app/[variants]/(main)/settings/system-tools/features/ToolDetectorSection.tsx +++ b/src/app/[variants]/(main)/settings/system-tools/features/ToolDetectorSection.tsx @@ -1,18 +1,8 @@ 'use client'; -import type {ToolStatus} from '@lobechat/electron-client-ipc'; -import type {FormGroupItemType} from '@lobehub/ui'; -import { - Button, - CopyButton, - Flexbox, - Form, - Icon, - Skeleton, - Tag, - Text, - Tooltip -} from '@lobehub/ui'; +import { type ToolStatus } from '@lobechat/electron-client-ipc'; +import { type FormGroupItemType } from '@lobehub/ui'; +import { Button, CopyButton, Flexbox, Form, Icon, Skeleton, Tag, Text, Tooltip } from '@lobehub/ui'; import { CheckCircle2, Loader2Icon, RefreshCw, XCircle } from 'lucide-react'; import { memo, useCallback, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(main)/settings/tts/features/OpenAI.tsx b/src/app/[variants]/(main)/settings/tts/features/OpenAI.tsx index 196077dece..aa6124d379 100644 --- a/src/app/[variants]/(main)/settings/tts/features/OpenAI.tsx +++ b/src/app/[variants]/(main)/settings/tts/features/OpenAI.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FormGroupItemType} from '@lobehub/ui'; -import { Form, Icon, Select, Skeleton } from '@lobehub/ui'; +import { type FormGroupItemType } from '@lobehub/ui'; +import { Form, Icon, Select, Skeleton } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; import { Loader2Icon } from 'lucide-react'; import { memo, useState } from 'react'; diff --git a/src/app/[variants]/(main)/settings/tts/features/STT.tsx b/src/app/[variants]/(main)/settings/tts/features/STT.tsx index 8f89c4ade8..33e459fe8b 100644 --- a/src/app/[variants]/(main)/settings/tts/features/STT.tsx +++ b/src/app/[variants]/(main)/settings/tts/features/STT.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FormGroupItemType} from '@lobehub/ui'; -import { Form, Icon, Select, Skeleton } from '@lobehub/ui'; +import { type FormGroupItemType } from '@lobehub/ui'; +import { Form, Icon, Select, Skeleton } from '@lobehub/ui'; import { Switch } from 'antd'; import isEqual from 'fast-deep-equal'; import { Loader2Icon } from 'lucide-react'; diff --git a/src/app/[variants]/(main)/settings/tts/features/const.tsx b/src/app/[variants]/(main)/settings/tts/features/const.tsx index e4abadaff0..2e3760950e 100644 --- a/src/app/[variants]/(main)/settings/tts/features/const.tsx +++ b/src/app/[variants]/(main)/settings/tts/features/const.tsx @@ -1,5 +1,5 @@ import { OpenAI } from '@lobehub/icons'; -import type { SelectProps } from '@lobehub/ui'; +import { type SelectProps } from '@lobehub/ui'; import { LabelRenderer } from '@/components/ModelSelect'; diff --git a/src/app/[variants]/(mobile)/(home)/_layout/MobileLayout.tsx b/src/app/[variants]/(mobile)/(home)/_layout/MobileLayout.tsx index e20da7922f..9d4653ee88 100644 --- a/src/app/[variants]/(mobile)/(home)/_layout/MobileLayout.tsx +++ b/src/app/[variants]/(mobile)/(home)/_layout/MobileLayout.tsx @@ -1,4 +1,4 @@ -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import MobileContentLayout from '@/components/server/MobileNavLayout'; diff --git a/src/app/[variants]/(mobile)/(home)/_layout/SessionSearchBar.tsx b/src/app/[variants]/(mobile)/(home)/_layout/SessionSearchBar.tsx index bcaf82d3f3..b4bb6a8a7d 100644 --- a/src/app/[variants]/(mobile)/(home)/_layout/SessionSearchBar.tsx +++ b/src/app/[variants]/(mobile)/(home)/_layout/SessionSearchBar.tsx @@ -1,8 +1,8 @@ 'use client'; import { SearchBar } from '@lobehub/ui'; -import type {ChangeEvent} from 'react'; -import { memo, useCallback } from 'react'; +import { type ChangeEvent } from 'react'; +import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { useSessionStore } from '@/store/session'; diff --git a/src/app/[variants]/(mobile)/(home)/_layout/index.tsx b/src/app/[variants]/(mobile)/(home)/_layout/index.tsx index 89753f2d94..8df25b13c8 100644 --- a/src/app/[variants]/(mobile)/(home)/_layout/index.tsx +++ b/src/app/[variants]/(mobile)/(home)/_layout/index.tsx @@ -1,4 +1,4 @@ -import type {FC} from 'react'; +import { type FC } from 'react'; import { Outlet } from 'react-router-dom'; import MobileLayout from '@/app/[variants]/(mobile)/(home)/_layout/MobileLayout'; diff --git a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/CollapseGroup/Actions.tsx b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/CollapseGroup/Actions.tsx index 7174e85bc0..3619c8ffbb 100644 --- a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/CollapseGroup/Actions.tsx +++ b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/CollapseGroup/Actions.tsx @@ -1,9 +1,5 @@ -import type {DropdownMenuProps, MenuProps} from '@lobehub/ui'; -import { - ActionIcon, - DropdownMenu, - Icon -} from '@lobehub/ui'; +import { type DropdownMenuProps, type MenuProps } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu, Icon } from '@lobehub/ui'; import { App } from 'antd'; import { createStaticStyles } from 'antd-style'; import { MoreVertical, PencilLine, Plus, Settings2, Trash, UsersRound } from 'lucide-react'; diff --git a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/CollapseGroup/index.tsx b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/CollapseGroup/index.tsx index 7b769cfbcc..ae11c07d66 100644 --- a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/CollapseGroup/index.tsx +++ b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/CollapseGroup/index.tsx @@ -1,7 +1,7 @@ import { Icon } from '@lobehub/ui'; -import type {CollapseProps} from 'antd'; -import { Collapse } from 'antd'; -import { createStaticStyles , responsive } from 'antd-style'; +import { type CollapseProps } from 'antd'; +import { Collapse } from 'antd'; +import { createStaticStyles, responsive } from 'antd-style'; import { ChevronDown } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/DefaultMode.tsx b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/DefaultMode.tsx index d6024c391f..3a60cd2e11 100644 --- a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/DefaultMode.tsx +++ b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/DefaultMode.tsx @@ -1,4 +1,4 @@ -import type {CollapseProps} from 'antd'; +import { type CollapseProps } from 'antd'; import isEqual from 'fast-deep-equal'; import { memo, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -10,11 +10,8 @@ import { useServerConfigStore } from '@/store/serverConfig'; import { serverConfigSelectors } from '@/store/serverConfig/selectors'; import { useSessionStore } from '@/store/session'; import { sessionSelectors } from '@/store/session/selectors'; -import type {LobeAgentSession, LobeSessions} from '@/types/session'; -import { - LobeSessionType, - SessionDefaultGroup -} from '@/types/session'; +import { type LobeAgentSession, type LobeSessions } from '@/types/session'; +import { LobeSessionType, SessionDefaultGroup } from '@/types/session'; import CollapseGroup from './CollapseGroup'; import Actions from './CollapseGroup/Actions'; diff --git a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/List/Item/Actions.tsx b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/List/Item/Actions.tsx index d06d00da20..82a495a675 100644 --- a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/List/Item/Actions.tsx +++ b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/List/Item/Actions.tsx @@ -1,6 +1,6 @@ import { ActionIcon, DropdownMenu, Icon } from '@lobehub/ui'; import { App } from 'antd'; -import type {ItemType} from 'antd/es/menu/interface'; +import { type ItemType } from 'antd/es/menu/interface'; import { createStaticStyles } from 'antd-style'; import isEqual from 'fast-deep-equal'; import { diff --git a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/List/Item/index.tsx b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/List/Item/index.tsx index 5d83c98e3e..65e6ef2a3b 100644 --- a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/List/Item/index.tsx +++ b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/List/Item/index.tsx @@ -14,7 +14,7 @@ import { sessionHelpers } from '@/store/session/helpers'; import { sessionMetaSelectors, sessionSelectors } from '@/store/session/selectors'; import { useUserStore } from '@/store/user'; import { userProfileSelectors } from '@/store/user/selectors'; -import type {LobeGroupSession} from '@/types/session'; +import { type LobeGroupSession } from '@/types/session'; import ListItem from '../../ListItem'; import CreateGroupModal from '../../Modals/CreateGroupModal'; diff --git a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/List/index.tsx b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/List/index.tsx index 5f781bb006..bb7627929e 100644 --- a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/List/index.tsx +++ b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/List/index.tsx @@ -11,7 +11,7 @@ import { getSessionStoreState, useSessionStore } from '@/store/session'; import { sessionGroupSelectors, sessionSelectors } from '@/store/session/selectors'; import { getUserStoreState } from '@/store/user'; import { userProfileSelectors } from '@/store/user/selectors'; -import type {LobeSessions} from '@/types/session'; +import { type LobeSessions } from '@/types/session'; import SkeletonList from '../../SkeletonList'; import AddButton from './AddButton'; diff --git a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/ListItem/index.tsx b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/ListItem/index.tsx index c67b222fad..0808673278 100644 --- a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/ListItem/index.tsx +++ b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/ListItem/index.tsx @@ -1,5 +1,5 @@ -import type {ListItemProps} from '@lobehub/ui'; -import { Avatar, List } from '@lobehub/ui'; +import { type ListItemProps } from '@lobehub/ui'; +import { Avatar, List } from '@lobehub/ui'; import { useHover } from 'ahooks'; import { createStaticStyles, cx } from 'antd-style'; import { memo, useMemo, useRef } from 'react'; diff --git a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/Modals/ConfigGroupModal/GroupItem.tsx b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/Modals/ConfigGroupModal/GroupItem.tsx index 0524d172a9..4b0046b615 100644 --- a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/Modals/ConfigGroupModal/GroupItem.tsx +++ b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/Modals/ConfigGroupModal/GroupItem.tsx @@ -6,7 +6,7 @@ import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useSessionStore } from '@/store/session'; -import type {SessionGroupItem} from '@/types/session'; +import { type SessionGroupItem } from '@/types/session'; const styles = createStaticStyles(({ css }) => ({ content: css` diff --git a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/Modals/ConfigGroupModal/index.tsx b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/Modals/ConfigGroupModal/index.tsx index bc371a8e76..3d02a653ba 100644 --- a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/Modals/ConfigGroupModal/index.tsx +++ b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/Modals/ConfigGroupModal/index.tsx @@ -1,5 +1,5 @@ -import type {ModalProps} from '@lobehub/ui'; -import { Button, Flexbox,Modal, SortableList } from '@lobehub/ui'; +import { type ModalProps } from '@lobehub/ui'; +import { Button, Flexbox, Modal, SortableList } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import isEqual from 'fast-deep-equal'; import { Plus } from 'lucide-react'; @@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next'; import { useSessionStore } from '@/store/session'; import { sessionGroupSelectors } from '@/store/session/selectors'; -import type {SessionGroupItem} from '@/types/session'; +import { type SessionGroupItem } from '@/types/session'; import GroupItem from './GroupItem'; diff --git a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/Modals/CreateGroupModal.tsx b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/Modals/CreateGroupModal.tsx index a83f479a35..a4edccbec8 100644 --- a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/Modals/CreateGroupModal.tsx +++ b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/Modals/CreateGroupModal.tsx @@ -1,8 +1,8 @@ -import type {ModalProps} from '@lobehub/ui'; -import { Flexbox,Input, Modal } from '@lobehub/ui'; +import { type ModalProps } from '@lobehub/ui'; +import { Flexbox, Input, Modal } from '@lobehub/ui'; import { App } from 'antd'; -import type {MouseEvent} from 'react'; -import { memo, useState } from 'react'; +import { type MouseEvent } from 'react'; +import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useGlobalStore } from '@/store/global'; diff --git a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/Modals/RenameGroupModal.tsx b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/Modals/RenameGroupModal.tsx index 9dd2456ea2..d0189bf35c 100644 --- a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/Modals/RenameGroupModal.tsx +++ b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/Modals/RenameGroupModal.tsx @@ -1,5 +1,5 @@ -import type {ModalProps} from '@lobehub/ui'; -import { Input, Modal } from '@lobehub/ui'; +import { type ModalProps } from '@lobehub/ui'; +import { Input, Modal } from '@lobehub/ui'; import { App } from 'antd'; import isEqual from 'fast-deep-equal'; import { memo, useEffect, useState } from 'react'; diff --git a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/SearchMode.tsx b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/SearchMode.tsx index 1622ef6ee2..4c8c45822a 100644 --- a/src/app/[variants]/(mobile)/(home)/features/SessionListContent/SearchMode.tsx +++ b/src/app/[variants]/(mobile)/(home)/features/SessionListContent/SearchMode.tsx @@ -3,8 +3,8 @@ import { memo, useMemo } from 'react'; import { useServerConfigStore } from '@/store/serverConfig'; import { serverConfigSelectors } from '@/store/serverConfig/selectors'; import { useSessionStore } from '@/store/session'; -import type {LobeAgentSession, LobeSessions} from '@/types/session'; -import { LobeSessionType } from '@/types/session'; +import { type LobeAgentSession, type LobeSessions } from '@/types/session'; +import { LobeSessionType } from '@/types/session'; import SkeletonList from '../SkeletonList'; import SessionList from './List'; diff --git a/src/app/[variants]/(mobile)/_layout/NavBar.tsx b/src/app/[variants]/(mobile)/_layout/NavBar.tsx index 8e57f6f7b9..0a95192b65 100644 --- a/src/app/[variants]/(mobile)/_layout/NavBar.tsx +++ b/src/app/[variants]/(mobile)/_layout/NavBar.tsx @@ -1,7 +1,7 @@ 'use client'; import { Icon } from '@lobehub/ui'; -import type { TabBarProps } from '@lobehub/ui/mobile'; +import { type TabBarProps } from '@lobehub/ui/mobile'; import { TabBar } from '@lobehub/ui/mobile'; import { createStaticStyles } from 'antd-style'; import { Compass, MessageSquare, User } from 'lucide-react'; diff --git a/src/app/[variants]/(mobile)/_layout/index.tsx b/src/app/[variants]/(mobile)/_layout/index.tsx index 59f67af926..fdccec6879 100644 --- a/src/app/[variants]/(mobile)/_layout/index.tsx +++ b/src/app/[variants]/(mobile)/_layout/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FC} from 'react'; -import { Suspense } from 'react'; +import { type FC } from 'react'; +import { Suspense } from 'react'; import { Outlet, useLocation } from 'react-router-dom'; import Loading from '@/components/Loading/BrandTextLoading'; diff --git a/src/app/[variants]/(mobile)/chat/_layout/index.tsx b/src/app/[variants]/(mobile)/chat/_layout/index.tsx index b6dbcc2abd..e70c5399b0 100644 --- a/src/app/[variants]/(mobile)/chat/_layout/index.tsx +++ b/src/app/[variants]/(mobile)/chat/_layout/index.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {FC} from 'react'; +import { type FC } from 'react'; import { Outlet } from 'react-router-dom'; import AgentIdSync from '@/app/[variants]/(main)/agent/_layout/AgentIdSync'; diff --git a/src/app/[variants]/(mobile)/chat/features/Topic/features/AgentConfig/SystemRole.tsx b/src/app/[variants]/(mobile)/chat/features/Topic/features/AgentConfig/SystemRole.tsx index fa72d397a5..50b89786fa 100644 --- a/src/app/[variants]/(mobile)/chat/features/Topic/features/AgentConfig/SystemRole.tsx +++ b/src/app/[variants]/(mobile)/chat/features/Topic/features/AgentConfig/SystemRole.tsx @@ -3,7 +3,7 @@ import { Flexbox, Skeleton } from '@lobehub/ui'; import { EditableMessage } from '@lobehub/ui/chat'; import { createStaticStyles } from 'antd-style'; -import type {MouseEvent} from 'react'; +import { type MouseEvent } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(mobile)/chat/features/Topic/features/AgentConfig/index.tsx b/src/app/[variants]/(mobile)/chat/features/Topic/features/AgentConfig/index.tsx index 6509d52d71..05830c8244 100644 --- a/src/app/[variants]/(mobile)/chat/features/Topic/features/AgentConfig/index.tsx +++ b/src/app/[variants]/(mobile)/chat/features/Topic/features/AgentConfig/index.tsx @@ -2,8 +2,8 @@ import { ActionIcon } from '@lobehub/ui'; import { Edit } from 'lucide-react'; -import type {MouseEvent} from 'react'; -import { memo, useState } from 'react'; +import { type MouseEvent } from 'react'; +import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import useMergeState from 'use-merge-value'; diff --git a/src/app/[variants]/(mobile)/chat/features/Topic/features/ConfigLayout.tsx b/src/app/[variants]/(mobile)/chat/features/Topic/features/ConfigLayout.tsx index 944a89271f..522e72c08a 100644 --- a/src/app/[variants]/(mobile)/chat/features/Topic/features/ConfigLayout.tsx +++ b/src/app/[variants]/(mobile)/chat/features/Topic/features/ConfigLayout.tsx @@ -3,8 +3,8 @@ import { ActionIcon, Flexbox } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; import { ChevronRight } from 'lucide-react'; -import type {CSSProperties, ReactNode} from 'react'; -import { memo } from 'react'; +import { type CSSProperties, type ReactNode } from 'react'; +import { memo } from 'react'; import SidebarHeader from '@/components/SidebarHeader'; import { useGlobalStore } from '@/store/global'; diff --git a/src/app/[variants]/(mobile)/chat/features/Topic/features/TopicModal.tsx b/src/app/[variants]/(mobile)/chat/features/Topic/features/TopicModal.tsx index bee8f1df55..2e5127d835 100644 --- a/src/app/[variants]/(mobile)/chat/features/Topic/features/TopicModal.tsx +++ b/src/app/[variants]/(mobile)/chat/features/Topic/features/TopicModal.tsx @@ -1,7 +1,7 @@ 'use client'; import { Modal } from '@lobehub/ui'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(mobile)/chat/settings/_layout/index.tsx b/src/app/[variants]/(mobile)/chat/settings/_layout/index.tsx index fa09ad2d2d..19bac54dff 100644 --- a/src/app/[variants]/(mobile)/chat/settings/_layout/index.tsx +++ b/src/app/[variants]/(mobile)/chat/settings/_layout/index.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import MobileContentLayout from '@/components/server/MobileNavLayout'; import Footer from '@/features/Setting/Footer'; diff --git a/src/app/[variants]/(mobile)/chat/settings/features/AgentInfoDescription/index.tsx b/src/app/[variants]/(mobile)/chat/settings/features/AgentInfoDescription/index.tsx index af70751b7c..bfbb70d036 100644 --- a/src/app/[variants]/(mobile)/chat/settings/features/AgentInfoDescription/index.tsx +++ b/src/app/[variants]/(mobile)/chat/settings/features/AgentInfoDescription/index.tsx @@ -1,7 +1,7 @@ 'use client'; import { ProDescriptions } from '@ant-design/pro-components'; -import type {AgentItemDetail} from '@lobehub/market-sdk'; +import { type AgentItemDetail } from '@lobehub/market-sdk'; import { Flexbox, Tag } from '@lobehub/ui'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/(mobile)/me/(home)/features/useCategory.tsx b/src/app/[variants]/(mobile)/me/(home)/features/useCategory.tsx index c5118ce78a..8097cd1e7c 100644 --- a/src/app/[variants]/(mobile)/me/(home)/features/useCategory.tsx +++ b/src/app/[variants]/(mobile)/me/(home)/features/useCategory.tsx @@ -13,7 +13,7 @@ import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; -import type {CellProps} from '@/components/Cell'; +import { type CellProps } from '@/components/Cell'; import { DOCUMENTS, FEEDBACK } from '@/const/index'; import { usePlatform } from '@/hooks/usePlatform'; import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig'; diff --git a/src/app/[variants]/(mobile)/me/profile/features/Category.tsx b/src/app/[variants]/(mobile)/me/profile/features/Category.tsx index 4a2ea14ff2..a61ab42de6 100644 --- a/src/app/[variants]/(mobile)/me/profile/features/Category.tsx +++ b/src/app/[variants]/(mobile)/me/profile/features/Category.tsx @@ -5,7 +5,7 @@ import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; -import type {CellProps} from '@/components/Cell'; +import { type CellProps } from '@/components/Cell'; import Cell from '@/components/Cell'; import { ProfileTabs } from '@/store/global/initialState'; import { useUserStore } from '@/store/user'; diff --git a/src/app/[variants]/(mobile)/me/settings/features/useCategory.tsx b/src/app/[variants]/(mobile)/me/settings/features/useCategory.tsx index 74721e0ef3..0c2f02c41d 100644 --- a/src/app/[variants]/(mobile)/me/settings/features/useCategory.tsx +++ b/src/app/[variants]/(mobile)/me/settings/features/useCategory.tsx @@ -2,7 +2,7 @@ import { Brain, BrainCircuit, Info, Mic2, Settings2, Sparkles } from 'lucide-rea import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; -import type {CellProps} from '@/components/Cell'; +import { type CellProps } from '@/components/Cell'; import { SettingsTabs } from '@/store/global/initialState'; export const useCategory = () => { diff --git a/src/app/[variants]/(mobile)/router/mobileRouter.config.tsx b/src/app/[variants]/(mobile)/router/mobileRouter.config.tsx index 0e3d22d3b2..5bb163a089 100644 --- a/src/app/[variants]/(mobile)/router/mobileRouter.config.tsx +++ b/src/app/[variants]/(mobile)/router/mobileRouter.config.tsx @@ -12,7 +12,7 @@ import { BusinessMobileRoutesWithMainLayout, BusinessMobileRoutesWithoutMainLayout, } from '@/business/client/BusinessMobileRoutes'; -import type {RouteConfig} from '@/utils/router'; +import { type RouteConfig } from '@/utils/router'; import { dynamicElement, ErrorBoundary, redirectElement } from '@/utils/router'; import MobileSettingsLayout from '../settings/_layout'; diff --git a/src/app/[variants]/(mobile)/settings/_layout/Header.tsx b/src/app/[variants]/(mobile)/settings/_layout/Header.tsx index d3ed672c11..917d4f097e 100644 --- a/src/app/[variants]/(mobile)/settings/_layout/Header.tsx +++ b/src/app/[variants]/(mobile)/settings/_layout/Header.tsx @@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next'; import { useNavigate, useParams } from 'react-router-dom'; import { useShowMobileWorkspace } from '@/hooks/useShowMobileWorkspace'; -import type {SettingsTabs} from '@/store/global/initialState'; +import { type SettingsTabs } from '@/store/global/initialState'; import { useSessionStore } from '@/store/session'; import { mobileHeaderSticky } from '@/styles/mobileHeader'; diff --git a/src/app/[variants]/layout.tsx b/src/app/[variants]/layout.tsx index b0ce737a9f..d11f2d2229 100644 --- a/src/app/[variants]/layout.tsx +++ b/src/app/[variants]/layout.tsx @@ -2,9 +2,9 @@ import './initiallize'; import { ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const'; import { SpeedInsights } from '@vercel/speed-insights/next'; -import type { ResolvingViewport } from 'next'; +import { type ResolvingViewport } from 'next'; import Script from 'next/script'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { Suspense } from 'react'; import { isRtlLang } from 'rtl-detect'; @@ -14,8 +14,8 @@ import { DEFAULT_LANG } from '@/const/locale'; import { isDesktop } from '@/const/version'; import AuthProvider from '@/layout/AuthProvider'; import GlobalProvider from '@/layout/GlobalProvider'; -import type { Locales } from '@/locales/resources'; -import type { DynamicLayoutProps } from '@/types/next'; +import { type Locales } from '@/locales/resources'; +import { type DynamicLayoutProps } from '@/types/next'; import { RouteVariants } from '@/utils/server/routeVariants'; const inVercel = process.env.VERCEL === '1'; diff --git a/src/app/[variants]/loaders/routeParams.ts b/src/app/[variants]/loaders/routeParams.ts index 3d3711aabd..6f83df6ba7 100644 --- a/src/app/[variants]/loaders/routeParams.ts +++ b/src/app/[variants]/loaders/routeParams.ts @@ -1,4 +1,4 @@ -import type { LoaderFunctionArgs } from 'react-router-dom'; +import { type LoaderFunctionArgs } from 'react-router-dom'; /** * Generic route params loader diff --git a/src/app/[variants]/metadata.ts b/src/app/[variants]/metadata.ts index 926363edaa..afe29323a1 100644 --- a/src/app/[variants]/metadata.ts +++ b/src/app/[variants]/metadata.ts @@ -5,7 +5,7 @@ import { DEFAULT_LANG } from '@/const/locale'; import { OFFICIAL_URL } from '@/const/url'; import { isCustomBranding, isCustomORG } from '@/const/version'; import { translation } from '@/server/translation'; -import type {DynamicLayoutProps} from '@/types/next'; +import { type DynamicLayoutProps } from '@/types/next'; import { RouteVariants } from '@/utils/server/routeVariants'; const isDev = process.env.NODE_ENV === 'development'; diff --git a/src/app/[variants]/onboarding/_layout/index.tsx b/src/app/[variants]/onboarding/_layout/index.tsx index a716833416..a64434c5be 100644 --- a/src/app/[variants]/onboarding/_layout/index.tsx +++ b/src/app/[variants]/onboarding/_layout/index.tsx @@ -3,7 +3,7 @@ import { Center, Flexbox, Text } from '@lobehub/ui'; import { Divider } from 'antd'; import { cx } from 'antd-style'; -import type { FC, PropsWithChildren } from 'react'; +import { type FC, type PropsWithChildren } from 'react'; import LangButton from '@/features/User/UserPanel/LangButton'; import ThemeButton from '@/features/User/UserPanel/ThemeButton'; diff --git a/src/app/[variants]/onboarding/components/KlavisServerList/components/KlavisServerItem.tsx b/src/app/[variants]/onboarding/components/KlavisServerList/components/KlavisServerItem.tsx index 064b0e6134..9ed4518be5 100644 --- a/src/app/[variants]/onboarding/components/KlavisServerList/components/KlavisServerItem.tsx +++ b/src/app/[variants]/onboarding/components/KlavisServerList/components/KlavisServerItem.tsx @@ -4,9 +4,9 @@ import { Block, Flexbox, Text } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { memo } from 'react'; -import type {KlavisServerType} from '@/const/index'; -import type {KlavisServer} from '@/store/tool/slices/klavisStore'; -import { KlavisServerStatus } from '@/store/tool/slices/klavisStore'; +import { type KlavisServerType } from '@/const/index'; +import { type KlavisServer } from '@/store/tool/slices/klavisStore'; +import { KlavisServerStatus } from '@/store/tool/slices/klavisStore'; import { useKlavisOAuth } from '../hooks/useKlavisOAuth'; import { useKlavisServerActions } from '../hooks/useKlavisServerActions'; diff --git a/src/app/[variants]/onboarding/components/KlavisServerList/components/ServerIcon.tsx b/src/app/[variants]/onboarding/components/KlavisServerList/components/ServerIcon.tsx index 5818f1a113..42311efbbd 100644 --- a/src/app/[variants]/onboarding/components/KlavisServerList/components/ServerIcon.tsx +++ b/src/app/[variants]/onboarding/components/KlavisServerList/components/ServerIcon.tsx @@ -1,6 +1,6 @@ import { Avatar, Icon } from '@lobehub/ui'; import { cssVar } from 'antd-style'; -import type {LucideIcon} from 'lucide-react'; +import { type LucideIcon } from 'lucide-react'; import { memo } from 'react'; interface ServerIconProps { diff --git a/src/app/[variants]/onboarding/components/KlavisServerList/components/ServerStatusControl.tsx b/src/app/[variants]/onboarding/components/KlavisServerList/components/ServerStatusControl.tsx index 63720d00dc..bccbf14d03 100644 --- a/src/app/[variants]/onboarding/components/KlavisServerList/components/ServerStatusControl.tsx +++ b/src/app/[variants]/onboarding/components/KlavisServerList/components/ServerStatusControl.tsx @@ -4,8 +4,8 @@ import { CheckIcon, CircleX, Loader2 } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {KlavisServer} from '@/store/tool/slices/klavisStore'; -import { KlavisServerStatus } from '@/store/tool/slices/klavisStore'; +import { type KlavisServer } from '@/store/tool/slices/klavisStore'; +import { KlavisServerStatus } from '@/store/tool/slices/klavisStore'; interface ServerStatusControlProps { isConnecting: boolean; diff --git a/src/app/[variants]/onboarding/components/KlavisServerList/hooks/useKlavisServerActions.ts b/src/app/[variants]/onboarding/components/KlavisServerList/hooks/useKlavisServerActions.ts index e3fdd568aa..f26df1eb10 100644 --- a/src/app/[variants]/onboarding/components/KlavisServerList/hooks/useKlavisServerActions.ts +++ b/src/app/[variants]/onboarding/components/KlavisServerList/hooks/useKlavisServerActions.ts @@ -1,7 +1,7 @@ import { useState } from 'react'; import { useToolStore } from '@/store/tool'; -import type {KlavisServer} from '@/store/tool/slices/klavisStore'; +import { type KlavisServer } from '@/store/tool/slices/klavisStore'; import { useUserStore } from '@/store/user'; import { userProfileSelectors } from '@/store/user/selectors'; diff --git a/src/app/[variants]/onboarding/components/LobeMessage.tsx b/src/app/[variants]/onboarding/components/LobeMessage.tsx index 0136b0a9ec..22d93769fb 100644 --- a/src/app/[variants]/onboarding/components/LobeMessage.tsx +++ b/src/app/[variants]/onboarding/components/LobeMessage.tsx @@ -1,7 +1,7 @@ -import type {FlexboxProps} from '@lobehub/ui'; -import { Flexbox, Text } from '@lobehub/ui'; -import type {TypewriterEffectProps} from '@lobehub/ui/awesome'; -import { TypewriterEffect } from '@lobehub/ui/awesome'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Flexbox, Text } from '@lobehub/ui'; +import { type TypewriterEffectProps } from '@lobehub/ui/awesome'; +import { TypewriterEffect } from '@lobehub/ui/awesome'; import { LoadingDots } from '@lobehub/ui/chat'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/[variants]/onboarding/features/ResponseLanguageStep.tsx b/src/app/[variants]/onboarding/features/ResponseLanguageStep.tsx index 1d8ab5ead1..b76adecc0c 100644 --- a/src/app/[variants]/onboarding/features/ResponseLanguageStep.tsx +++ b/src/app/[variants]/onboarding/features/ResponseLanguageStep.tsx @@ -7,8 +7,8 @@ import { Undo2Icon } from 'lucide-react'; import { memo, useCallback, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import type {Locales} from '@/locales/resources'; -import { localeOptions, normalizeLocale } from '@/locales/resources'; +import { type Locales } from '@/locales/resources'; +import { localeOptions, normalizeLocale } from '@/locales/resources'; import { useGlobalStore } from '@/store/global'; import { useUserStore } from '@/store/user'; diff --git a/src/app/[variants]/onboarding/features/TelemetryStep.tsx b/src/app/[variants]/onboarding/features/TelemetryStep.tsx index fd5c493c12..950a9e266e 100644 --- a/src/app/[variants]/onboarding/features/TelemetryStep.tsx +++ b/src/app/[variants]/onboarding/features/TelemetryStep.tsx @@ -1,8 +1,8 @@ 'use client'; import { BRANDING_NAME } from '@lobechat/business-const'; -import type {IconProps} from '@lobehub/ui'; -import { Block, Button, Flexbox, Icon, Text } from '@lobehub/ui'; +import { type IconProps } from '@lobehub/ui'; +import { Block, Button, Flexbox, Icon, Text } from '@lobehub/ui'; import { TypewriterEffect } from '@lobehub/ui/awesome'; import { LoadingDots } from '@lobehub/ui/chat'; import { Steps, Switch } from 'antd'; diff --git a/src/app/[variants]/page.tsx b/src/app/[variants]/page.tsx index 178e409109..4341f541c6 100644 --- a/src/app/[variants]/page.tsx +++ b/src/app/[variants]/page.tsx @@ -1,6 +1,6 @@ import Loading from '@/components/Loading/BrandTextLoading'; import dynamic from '@/libs/next/dynamic'; -import type {DynamicLayoutProps} from '@/types/next'; +import { type DynamicLayoutProps } from '@/types/next'; import { RouteVariants } from '@/utils/server/routeVariants'; import DesktopRouter from './router'; diff --git a/src/app/[variants]/router/desktopRouter.config.tsx b/src/app/[variants]/router/desktopRouter.config.tsx index 55b75dad8f..f1d2c4f7c0 100644 --- a/src/app/[variants]/router/desktopRouter.config.tsx +++ b/src/app/[variants]/router/desktopRouter.config.tsx @@ -5,7 +5,7 @@ import { BusinessDesktopRoutesWithoutMainLayout, } from '@/business/client/BusinessDesktopRoutes'; import { isDesktop } from '@/const/version'; -import type {RouteConfig} from '@/utils/router'; +import { type RouteConfig } from '@/utils/router'; import { dynamicElement, ErrorBoundary, redirectElement } from '@/utils/router'; import DesktopOnboarding from '../(desktop)/desktop-onboarding'; diff --git a/src/app/[variants]/share/t/[id]/_layout/Title.tsx b/src/app/[variants]/share/t/[id]/_layout/Title.tsx index 090ab4d4b9..44c71acc40 100644 --- a/src/app/[variants]/share/t/[id]/_layout/Title.tsx +++ b/src/app/[variants]/share/t/[id]/_layout/Title.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { AgentGroupDetail, AgentGroupMember } from '@lobechat/types'; +import { type AgentGroupDetail, type AgentGroupMember } from '@lobechat/types'; import { Text } from '@lobehub/ui'; import { memo, useEffect } from 'react'; import { useParams } from 'react-router-dom'; diff --git a/src/app/[variants]/share/t/[id]/_layout/index.tsx b/src/app/[variants]/share/t/[id]/_layout/index.tsx index b8d3ef6352..d23a48abf5 100644 --- a/src/app/[variants]/share/t/[id]/_layout/index.tsx +++ b/src/app/[variants]/share/t/[id]/_layout/index.tsx @@ -3,7 +3,7 @@ import { Alert, Center, Flexbox } from '@lobehub/ui'; import { cx } from 'antd-style'; import NextLink from 'next/link'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { memo, Suspense } from 'react'; import { useTranslation } from 'react-i18next'; import { Link, Outlet } from 'react-router-dom'; diff --git a/src/app/[variants]/share/t/[id]/features/ActionBar.tsx b/src/app/[variants]/share/t/[id]/features/ActionBar.tsx index 6c9114d8d8..b73c93fc18 100644 --- a/src/app/[variants]/share/t/[id]/features/ActionBar.tsx +++ b/src/app/[variants]/share/t/[id]/features/ActionBar.tsx @@ -6,7 +6,7 @@ import { Link } from 'react-router-dom'; import { DEFAULT_AVATAR, DEFAULT_INBOX_AVATAR } from '@/const/meta'; import GroupAvatar from '@/features/GroupAvatar'; -import type { SharedTopicData } from '@/types/topic'; +import { type SharedTopicData } from '@/types/topic'; interface ActionBarProps { data: SharedTopicData; diff --git a/src/app/manifest.ts b/src/app/manifest.ts index d875f65e08..556d7d205b 100644 --- a/src/app/manifest.ts +++ b/src/app/manifest.ts @@ -1,4 +1,4 @@ -import type { MetadataRoute } from 'next'; +import { type MetadataRoute } from 'next'; const manifest = async (): Promise => { // Skip heavy module compilation in development diff --git a/src/app/robots.tsx b/src/app/robots.tsx index c1c9fe4ac7..b1fc2a2ded 100644 --- a/src/app/robots.tsx +++ b/src/app/robots.tsx @@ -1,4 +1,4 @@ -import type {MetadataRoute} from 'next'; +import { type MetadataRoute } from 'next'; import { Sitemap } from '@/server/sitemap'; import { getCanonicalUrl } from '@/server/utils/url'; diff --git a/src/app/sitemap.tsx b/src/app/sitemap.tsx index f74fdc5f0d..98335de773 100644 --- a/src/app/sitemap.tsx +++ b/src/app/sitemap.tsx @@ -1,4 +1,4 @@ -import type {MetadataRoute} from 'next'; +import { type MetadataRoute } from 'next'; import { LAST_MODIFIED, Sitemap, SitemapType } from '@/server/sitemap'; diff --git a/src/app/sw.ts b/src/app/sw.ts index 92f716a0a7..78adde7d8b 100644 --- a/src/app/sw.ts +++ b/src/app/sw.ts @@ -1,5 +1,5 @@ import { defaultCache } from '@serwist/next/worker'; -import type { PrecacheEntry, SerwistGlobalConfig } from 'serwist'; +import { type PrecacheEntry, type SerwistGlobalConfig } from 'serwist'; import { Serwist } from 'serwist'; // This declares the value of `injectionPoint` to TypeScript. @@ -12,7 +12,6 @@ declare global { } } - declare const self: ServiceWorkerGlobalScope; const serwist = new Serwist({ diff --git a/src/business/client/BusinessDesktopRoutes.tsx b/src/business/client/BusinessDesktopRoutes.tsx index 972f65e1d6..27aba8a209 100644 --- a/src/business/client/BusinessDesktopRoutes.tsx +++ b/src/business/client/BusinessDesktopRoutes.tsx @@ -1,4 +1,4 @@ -import type {RouteConfig} from '@/utils/router'; +import { type RouteConfig } from '@/utils/router'; export const BusinessDesktopRoutesWithMainLayout: RouteConfig[] = []; export const BusinessDesktopRoutesWithSettingsLayout: RouteConfig[] = []; diff --git a/src/business/client/BusinessGlobalProvider.tsx b/src/business/client/BusinessGlobalProvider.tsx index 7d7394c879..a13f79b1be 100644 --- a/src/business/client/BusinessGlobalProvider.tsx +++ b/src/business/client/BusinessGlobalProvider.tsx @@ -1,4 +1,4 @@ -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; export default function BusinessGlobalProvider({ children }: { children: ReactNode }) { return children; diff --git a/src/business/client/BusinessMobileRoutes.tsx b/src/business/client/BusinessMobileRoutes.tsx index 8917802850..a0fdd2aeb3 100644 --- a/src/business/client/BusinessMobileRoutes.tsx +++ b/src/business/client/BusinessMobileRoutes.tsx @@ -1,4 +1,4 @@ -import type {RouteConfig} from '@/utils/router'; +import { type RouteConfig } from '@/utils/router'; export const BusinessMobileRoutesWithMainLayout: RouteConfig[] = []; export const BusinessMobileRoutesWithSettingsLayout: RouteConfig[] = []; diff --git a/src/business/client/hooks/useBusinessErrorAlertConfig.ts b/src/business/client/hooks/useBusinessErrorAlertConfig.ts index cc91b09689..c57ce721c2 100644 --- a/src/business/client/hooks/useBusinessErrorAlertConfig.ts +++ b/src/business/client/hooks/useBusinessErrorAlertConfig.ts @@ -1,5 +1,5 @@ -import type { ErrorType } from '@lobechat/types'; -import type { AlertProps } from '@lobehub/ui'; +import { type ErrorType } from '@lobechat/types'; +import { type AlertProps } from '@lobehub/ui'; export default function useBusinessErrorAlertConfig( // eslint-disable-next-line unused-imports/no-unused-vars diff --git a/src/business/client/hooks/useBusinessErrorContent.ts b/src/business/client/hooks/useBusinessErrorContent.ts index 0d503158e9..f5ed238add 100644 --- a/src/business/client/hooks/useBusinessErrorContent.ts +++ b/src/business/client/hooks/useBusinessErrorContent.ts @@ -1,4 +1,4 @@ -import type { ErrorType } from '@lobechat/types'; +import { type ErrorType } from '@lobechat/types'; export interface BusinessErrorContentResult { errorType?: string; diff --git a/src/business/client/hooks/useBusinessSignup.tsx b/src/business/client/hooks/useBusinessSignup.tsx index 603bec34c0..72b08bc936 100644 --- a/src/business/client/hooks/useBusinessSignup.tsx +++ b/src/business/client/hooks/useBusinessSignup.tsx @@ -1,6 +1,5 @@ -import type { BaseSignUpFormValues } from '@/app/[variants]/(auth)/signup/[[...signup]]/types'; +import { type BaseSignUpFormValues } from '@/app/[variants]/(auth)/signup/[[...signup]]/types'; - export interface BusinessSignupFomData {} // eslint-disable-next-line unused-imports/no-unused-vars diff --git a/src/business/client/hooks/useRenderBusinessBatchItem.tsx b/src/business/client/hooks/useRenderBusinessBatchItem.tsx index f0274f466f..ff424470f0 100644 --- a/src/business/client/hooks/useRenderBusinessBatchItem.tsx +++ b/src/business/client/hooks/useRenderBusinessBatchItem.tsx @@ -1,4 +1,4 @@ -import type { GenerationBatch } from '@/types/generation'; +import { type GenerationBatch } from '@/types/generation'; // eslint-disable-next-line unused-imports/no-unused-vars export default function useRenderBusinessBatchItem(batch: GenerationBatch) { diff --git a/src/business/client/hooks/useRenderBusinessChatErrorMessageExtra.tsx b/src/business/client/hooks/useRenderBusinessChatErrorMessageExtra.tsx index 3cec085741..54e1a61515 100644 --- a/src/business/client/hooks/useRenderBusinessChatErrorMessageExtra.tsx +++ b/src/business/client/hooks/useRenderBusinessChatErrorMessageExtra.tsx @@ -1,4 +1,4 @@ -import type {ChatMessageError} from '@lobechat/types'; +import { type ChatMessageError } from '@lobechat/types'; export default function useRenderBusinessChatErrorMessageExtra( // eslint-disable-next-line unused-imports/no-unused-vars diff --git a/src/business/server/image-generation/chargeAfterGenerate.ts b/src/business/server/image-generation/chargeAfterGenerate.ts index 9bf46c9e11..8bc1b94c7f 100644 --- a/src/business/server/image-generation/chargeAfterGenerate.ts +++ b/src/business/server/image-generation/chargeAfterGenerate.ts @@ -1,4 +1,4 @@ -import type {ModelUsage} from '@/types/index'; +import { type ModelUsage } from '@/types/index'; interface ChargeParams { metadata: { diff --git a/src/business/server/image-generation/chargeBeforeGenerate.ts b/src/business/server/image-generation/chargeBeforeGenerate.ts index 30f83abb09..bb93e362df 100644 --- a/src/business/server/image-generation/chargeBeforeGenerate.ts +++ b/src/business/server/image-generation/chargeBeforeGenerate.ts @@ -1,5 +1,5 @@ -import type {NewGeneration, NewGenerationBatch} from '@/database/schemas'; -import type { CreateImageServicePayload } from '@/server/routers/lambda/image'; +import { type NewGeneration, type NewGenerationBatch } from '@/database/schemas'; +import { type CreateImageServicePayload } from '@/server/routers/lambda/image'; interface ChargeParams { clientIp?: string | null; diff --git a/src/business/server/user.ts b/src/business/server/user.ts index 5eb1565f1b..3cd83fe93e 100644 --- a/src/business/server/user.ts +++ b/src/business/server/user.ts @@ -1,6 +1,6 @@ /* eslint-disable unused-imports/no-unused-vars */ -import type {ReferralStatusString} from '@lobechat/types'; -import { Plans } from '@lobechat/types'; +import { type ReferralStatusString } from '@lobechat/types'; +import { Plans } from '@lobechat/types'; export async function getReferralStatus(userId: string): Promise { return undefined; diff --git a/src/components/404/index.tsx b/src/components/404/index.tsx index f7c8b0a2b6..95b9ad0728 100644 --- a/src/components/404/index.tsx +++ b/src/components/404/index.tsx @@ -1,7 +1,7 @@ 'use client'; import { Button, Flexbox, FluentEmoji } from '@lobehub/ui'; -import type {ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/components/Analytics/LobeAnalyticsProvider.tsx b/src/components/Analytics/LobeAnalyticsProvider.tsx index 7f7e13bd45..32f9d94978 100644 --- a/src/components/Analytics/LobeAnalyticsProvider.tsx +++ b/src/components/Analytics/LobeAnalyticsProvider.tsx @@ -1,12 +1,13 @@ 'use client'; -import type {GoogleAnalyticsProviderConfig, PostHogProviderAnalyticsConfig} from '@lobehub/analytics'; import { - createSingletonAnalytics + type GoogleAnalyticsProviderConfig, + type PostHogProviderAnalyticsConfig, } from '@lobehub/analytics'; +import { createSingletonAnalytics } from '@lobehub/analytics'; import { AnalyticsProvider } from '@lobehub/analytics/react'; -import type {ReactNode} from 'react'; -import { memo, useMemo } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useMemo } from 'react'; import { BUSINESS_LINE } from '@/const/analytics'; import { isDesktop } from '@/const/version'; diff --git a/src/components/Analytics/LobeAnalyticsProviderWrapper.tsx b/src/components/Analytics/LobeAnalyticsProviderWrapper.tsx index fa5940758a..bb83ba3297 100644 --- a/src/components/Analytics/LobeAnalyticsProviderWrapper.tsx +++ b/src/components/Analytics/LobeAnalyticsProviderWrapper.tsx @@ -1,4 +1,4 @@ -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import { LobeAnalyticsProvider } from '@/components/Analytics/LobeAnalyticsProvider'; diff --git a/src/components/AnimatedCollapsed/index.tsx b/src/components/AnimatedCollapsed/index.tsx index ea91271d2e..2250de00b6 100644 --- a/src/components/AnimatedCollapsed/index.tsx +++ b/src/components/AnimatedCollapsed/index.tsx @@ -1,6 +1,6 @@ import { AnimatePresence, m as motion } from 'motion/react'; -import type {CSSProperties, ReactNode} from 'react'; -import { memo } from 'react'; +import { type CSSProperties, type ReactNode } from 'react'; +import { memo } from 'react'; interface AnimatedCollapsedProps { children: ReactNode; diff --git a/src/components/AntdStaticMethods/index.tsx b/src/components/AntdStaticMethods/index.tsx index 531f0fbf61..f98eb8106c 100644 --- a/src/components/AntdStaticMethods/index.tsx +++ b/src/components/AntdStaticMethods/index.tsx @@ -1,8 +1,8 @@ // Entry component import { App } from 'antd'; -import type { MessageInstance } from 'antd/es/message/interface'; -import type { ModalStaticFunctions } from 'antd/es/modal/confirm'; -import type { NotificationInstance } from 'antd/es/notification/interface'; +import { type MessageInstance } from 'antd/es/message/interface'; +import { type ModalStaticFunctions } from 'antd/es/modal/confirm'; +import { type NotificationInstance } from 'antd/es/notification/interface'; import { memo } from 'react'; let message: MessageInstance; diff --git a/src/components/BootErrorBoundary/index.tsx b/src/components/BootErrorBoundary/index.tsx index 1449262d0d..5cbd958ce3 100644 --- a/src/components/BootErrorBoundary/index.tsx +++ b/src/components/BootErrorBoundary/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {ErrorInfo, ReactNode} from 'react'; -import { Component } from 'react'; +import { type ErrorInfo, type ReactNode } from 'react'; +import { Component } from 'react'; interface BootErrorBoundaryProps { children: ReactNode; @@ -42,7 +42,6 @@ class BootErrorBoundary extends Component= maxReloads) { - console.warn('BootErrorBoundary reached max reload attempts', { attempts, href, @@ -89,13 +86,11 @@ class BootErrorBoundary extends Component { diff --git a/src/components/Branding/ProductLogo/index.tsx b/src/components/Branding/ProductLogo/index.tsx index 6051125334..00eef56416 100644 --- a/src/components/Branding/ProductLogo/index.tsx +++ b/src/components/Branding/ProductLogo/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {LobeHubProps} from '@lobehub/ui/brand'; -import { LobeHub } from '@lobehub/ui/brand'; +import { type LobeHubProps } from '@lobehub/ui/brand'; +import { LobeHub } from '@lobehub/ui/brand'; import { memo } from 'react'; import { isCustomBranding } from '@/const/version'; diff --git a/src/components/BrowserIcon/types.ts b/src/components/BrowserIcon/types.ts index 18f408c849..7fde65ae3b 100644 --- a/src/components/BrowserIcon/types.ts +++ b/src/components/BrowserIcon/types.ts @@ -1,4 +1,4 @@ -import type {CSSProperties} from 'react'; +import { type CSSProperties } from 'react'; export interface SVGComponent { className?: string; diff --git a/src/components/Cell/index.tsx b/src/components/Cell/index.tsx index 0239ba50b8..8c78e99e0d 100644 --- a/src/components/Cell/index.tsx +++ b/src/components/Cell/index.tsx @@ -1,8 +1,8 @@ -import type {IconProps} from '@lobehub/ui'; -import { Flexbox, Icon } from '@lobehub/ui'; +import { type IconProps } from '@lobehub/ui'; +import { Flexbox, Icon } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import { ChevronRight } from 'lucide-react'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import Divider from './Divider'; diff --git a/src/components/ChangelogModal/ChangelogContent.tsx b/src/components/ChangelogModal/ChangelogContent.tsx index a6c723abcd..325f255d9a 100644 --- a/src/components/ChangelogModal/ChangelogContent.tsx +++ b/src/components/ChangelogModal/ChangelogContent.tsx @@ -8,9 +8,9 @@ import urlJoin from 'url-join'; import { CustomMDX } from '@/components/mdx'; import { OFFICIAL_SITE } from '@/const/url'; -import type { Locales } from '@/locales/resources'; +import { type Locales } from '@/locales/resources'; import { ChangelogService } from '@/server/services/changelog'; -import type { ChangelogIndexItem } from '@/types/changelog'; +import { type ChangelogIndexItem } from '@/types/changelog'; import VersionTag from './VersionTag'; diff --git a/src/components/ChatGroupWizard/ChatGroupWizard.tsx b/src/components/ChatGroupWizard/ChatGroupWizard.tsx index 302e202ddc..f3850fe139 100644 --- a/src/components/ChatGroupWizard/ChatGroupWizard.tsx +++ b/src/components/ChatGroupWizard/ChatGroupWizard.tsx @@ -17,8 +17,8 @@ import { Switch } from 'antd'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import { omit } from 'es-toolkit/compat'; import { Users } from 'lucide-react'; -import type {ChangeEvent} from 'react'; -import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { type ChangeEvent } from 'react'; +import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { DEFAULT_AVATAR } from '@/const/meta'; @@ -26,11 +26,11 @@ import GroupAvatar from '@/features/GroupAvatar'; import ModelSelect from '@/features/ModelSelect'; import { useEnabledChatModels } from '@/hooks/useEnabledChatModels'; import { useSessionStore } from '@/store/session'; -import type {LobeAgentSession} from '@/types/session'; -import { LobeSessionType } from '@/types/session'; +import { type LobeAgentSession } from '@/types/session'; +import { LobeSessionType } from '@/types/session'; -import type {GroupTemplate} from './templates'; -import { useGroupTemplates } from './templates'; +import { type GroupTemplate } from './templates'; +import { useGroupTemplates } from './templates'; const TemplateItem = memo<{ cx: (..._args: any[]) => string; @@ -441,43 +441,41 @@ const ChatGroupWizard = memo( ); const selectedAgentListItems = useMemo(() => { - return ( - selectedAgents - .map((agentId) => { - const agent = agentSessions.find((session) => session.config?.id === agentId); - if (!agent) return null; + return selectedAgents + .map((agentId) => { + const agent = agentSessions.find((session) => session.config?.id === agentId); + if (!agent) return null; - const title = agent.meta?.title || t('defaultSession', { ns: 'common' }); - const avatar = agent.meta?.avatar || DEFAULT_AVATAR; - const avatarBackground = agent.meta?.backgroundColor; - const description = agent.meta?.description || ''; + const title = agent.meta?.title || t('defaultSession', { ns: 'common' }); + const avatar = agent.meta?.avatar || DEFAULT_AVATAR; + const avatarBackground = agent.meta?.backgroundColor; + const description = agent.meta?.description || ''; - return { - actions: ( - { - if (!checked) handleRemoveAgent(agentId); - }} - /> - ), - avatar: , - description: description ? ( - - - {description} - - - ) : null, - key: agentId, - showAction: true, - title, - }; - }) - - .filter((item): item is NonNullable => Boolean(item)) - ); + return { + actions: ( + { + if (!checked) handleRemoveAgent(agentId); + }} + /> + ), + avatar: , + description: description ? ( + + + {description} + + + ) : null, + key: agentId, + showAction: true, + title, + }; + }) + + .filter((item): item is NonNullable => Boolean(item)); }, [selectedAgents, agentSessions, t, handleRemoveAgent, memberDescriptionClass]); const normalizedHostModelConfig = useMemo(() => { diff --git a/src/components/CopyableLabel/index.tsx b/src/components/CopyableLabel/index.tsx index 8c918a9f96..3d6dd93191 100644 --- a/src/components/CopyableLabel/index.tsx +++ b/src/components/CopyableLabel/index.tsx @@ -1,6 +1,6 @@ import { CopyButton, Flexbox, Text } from '@lobehub/ui'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; interface CopyableLabelProps { className?: string; diff --git a/src/components/DataStyleModal/index.tsx b/src/components/DataStyleModal/index.tsx index 305edb56e6..1cf29c0425 100644 --- a/src/components/DataStyleModal/index.tsx +++ b/src/components/DataStyleModal/index.tsx @@ -1,7 +1,7 @@ import { Flexbox, Icon, Modal } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; -import type {LucideIcon} from 'lucide-react'; -import type {ReactNode} from 'react'; +import { type LucideIcon } from 'lucide-react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import { useIsDark } from '@/hooks/useIsDark'; diff --git a/src/components/DebugNode.tsx b/src/components/DebugNode.tsx index 8d0009ce54..a47eb442ee 100644 --- a/src/components/DebugNode.tsx +++ b/src/components/DebugNode.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {ReactNode} from 'react'; -import { useEffect } from 'react'; +import { type ReactNode } from 'react'; +import { useEffect } from 'react'; interface DebugNodeProps { children?: ReactNode; @@ -12,7 +12,6 @@ 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}`); }, [trace]); diff --git a/src/components/Descriptions/index.tsx b/src/components/Descriptions/index.tsx index 22f196afc1..f83949c43f 100644 --- a/src/components/Descriptions/index.tsx +++ b/src/components/Descriptions/index.tsx @@ -1,8 +1,8 @@ -import type {GridProps, IconProps} from '@lobehub/ui'; -import { Flexbox,Grid, Icon, Text } from '@lobehub/ui'; -import { createStaticStyles, cssVar, cx , responsive } from 'antd-style'; -import type {CSSProperties, ReactNode} from 'react'; -import { memo } from 'react'; +import { type GridProps, type IconProps } from '@lobehub/ui'; +import { Flexbox, Grid, Icon, Text } from '@lobehub/ui'; +import { createStaticStyles, cssVar, cx, responsive } from 'antd-style'; +import { type CSSProperties, type ReactNode } from 'react'; +import { memo } from 'react'; import CopyableLabel from '../CopyableLabel'; diff --git a/src/components/DragUpload/useDragUpload.test.tsx b/src/components/DragUpload/useDragUpload.test.tsx index 2bfb49f4fb..8aec0f2cae 100644 --- a/src/components/DragUpload/useDragUpload.test.tsx +++ b/src/components/DragUpload/useDragUpload.test.tsx @@ -1,6 +1,6 @@ import { act, renderHook } from '@testing-library/react'; import { App } from 'antd'; -import type { Mock} from 'vitest'; +import { type Mock } from 'vitest'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { useModelSupportVision } from '@/hooks/useModelSupportVision'; diff --git a/src/components/DragUploadZone/DragUploadProvider.tsx b/src/components/DragUploadZone/DragUploadProvider.tsx index 99a82b5b71..de04a8b3bd 100644 --- a/src/components/DragUploadZone/DragUploadProvider.tsx +++ b/src/components/DragUploadZone/DragUploadProvider.tsx @@ -1,15 +1,7 @@ 'use client'; -import type {ReactNode} from 'react'; -import { - createContext, - memo, - use, - useCallback, - useEffect, - useRef, - useState -} from 'react'; +import { type ReactNode } from 'react'; +import { createContext, memo, use, useCallback, useEffect, useRef, useState } from 'react'; interface DragUploadContextValue { /** @@ -88,11 +80,7 @@ export const DragUploadProvider = memo(({ children }) = }; }, [handleDragEnter, handleDragOver, handleDragLeave, handleDrop]); - return ( - - {children} - - ); + return {children}; }); DragUploadProvider.displayName = 'DragUploadProvider'; diff --git a/src/components/DragUploadZone/index.tsx b/src/components/DragUploadZone/index.tsx index a84c6618a3..efb4163768 100644 --- a/src/components/DragUploadZone/index.tsx +++ b/src/components/DragUploadZone/index.tsx @@ -3,8 +3,8 @@ import { Center, Flexbox, Icon } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import { FileImage, FileText, FileUpIcon } from 'lucide-react'; -import type {CSSProperties, ReactNode} from 'react'; -import { memo } from 'react'; +import { type CSSProperties, type ReactNode } from 'react'; +import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { useDragUploadContext } from './DragUploadProvider'; diff --git a/src/components/DragUploadZone/usePasteFile.ts b/src/components/DragUploadZone/usePasteFile.ts index 1650459162..872f8d9335 100644 --- a/src/components/DragUploadZone/usePasteFile.ts +++ b/src/components/DragUploadZone/usePasteFile.ts @@ -1,4 +1,4 @@ -import type {IEditor} from '@lobehub/editor'; +import { type IEditor } from '@lobehub/editor'; import { useCallback, useEffect } from 'react'; import { getFileListFromDataTransferItems } from './useLocalDragUpload'; diff --git a/src/components/Editor/AutoSaveHint.tsx b/src/components/Editor/AutoSaveHint.tsx index 12d8d3a155..beac7a76f6 100644 --- a/src/components/Editor/AutoSaveHint.tsx +++ b/src/components/Editor/AutoSaveHint.tsx @@ -4,8 +4,8 @@ import { Icon, Tag } from '@lobehub/ui'; import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; import { CloudIcon, Loader2Icon } from 'lucide-react'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; import { useTranslation } from 'react-i18next'; dayjs.extend(relativeTime); diff --git a/src/components/EmojiPicker/index.tsx b/src/components/EmojiPicker/index.tsx index 87a3634cd3..290faebecf 100644 --- a/src/components/EmojiPicker/index.tsx +++ b/src/components/EmojiPicker/index.tsx @@ -1,4 +1,4 @@ -import type {EmojiPickerProps} from '@lobehub/ui'; +import { type EmojiPickerProps } from '@lobehub/ui'; import { EmojiPicker as LobeEmojiPicker } from '@lobehub/ui'; import { memo } from 'react'; diff --git a/src/components/FeatureList/index.tsx b/src/components/FeatureList/index.tsx index 46e1f6069b..eff52a3035 100644 --- a/src/components/FeatureList/index.tsx +++ b/src/components/FeatureList/index.tsx @@ -1,6 +1,6 @@ import { Center, Flexbox, Icon } from '@lobehub/ui'; import { createStaticStyles, responsive } from 'antd-style'; -import type {LucideIcon} from 'lucide-react'; +import { type LucideIcon } from 'lucide-react'; import { memo } from 'react'; import { useIsDark } from '@/hooks/useIsDark'; diff --git a/src/components/FileParsingStatus/EmbeddingStatus.tsx b/src/components/FileParsingStatus/EmbeddingStatus.tsx index a0387addf6..c25d173b34 100644 --- a/src/components/FileParsingStatus/EmbeddingStatus.tsx +++ b/src/components/FileParsingStatus/EmbeddingStatus.tsx @@ -4,8 +4,8 @@ import { BoltIcon, RotateCwIcon } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {FileParsingTask} from '@/types/asyncTask'; -import { AsyncTaskStatus } from '@/types/asyncTask'; +import { type FileParsingTask } from '@/types/asyncTask'; +import { AsyncTaskStatus } from '@/types/asyncTask'; const styles = createStaticStyles(({ css, cssVar }) => ({ errorReason: css` diff --git a/src/components/FileParsingStatus/index.tsx b/src/components/FileParsingStatus/index.tsx index 112eba95e7..4d98615ec9 100644 --- a/src/components/FileParsingStatus/index.tsx +++ b/src/components/FileParsingStatus/index.tsx @@ -5,8 +5,8 @@ import { BoltIcon, Loader2Icon, RotateCwIcon } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {FileParsingTask} from '@/types/asyncTask'; -import { AsyncTaskStatus } from '@/types/asyncTask'; +import { type FileParsingTask } from '@/types/asyncTask'; +import { AsyncTaskStatus } from '@/types/asyncTask'; import EmbeddingStatus from './EmbeddingStatus'; diff --git a/src/components/FormAction/index.tsx b/src/components/FormAction/index.tsx index c90886bb46..4ce3982415 100644 --- a/src/components/FormAction/index.tsx +++ b/src/components/FormAction/index.tsx @@ -1,7 +1,7 @@ -import type {CenterProps} from '@lobehub/ui'; -import { Avatar, Center, Flexbox } from '@lobehub/ui'; +import { type CenterProps } from '@lobehub/ui'; +import { Avatar, Center, Flexbox } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; export const styles = createStaticStyles(({ css }) => ({ diff --git a/src/components/FormInput/FormInput.tsx b/src/components/FormInput/FormInput.tsx index ae451f0a9b..3143c99c1c 100644 --- a/src/components/FormInput/FormInput.tsx +++ b/src/components/FormInput/FormInput.tsx @@ -1,6 +1,6 @@ -import type {InputProps as Props} from '@lobehub/ui'; -import { Input } from '@lobehub/ui'; -import type {InputRef} from 'antd/es/input/Input'; +import { type InputProps as Props } from '@lobehub/ui'; +import { Input } from '@lobehub/ui'; +import { type InputRef } from 'antd/es/input/Input'; import { memo, useEffect, useRef, useState } from 'react'; interface FormInputProps extends Omit { diff --git a/src/components/FormInput/FormPassword.tsx b/src/components/FormInput/FormPassword.tsx index f7ed3edc7d..5384292af6 100644 --- a/src/components/FormInput/FormPassword.tsx +++ b/src/components/FormInput/FormPassword.tsx @@ -1,6 +1,6 @@ -import type {InputProps as Props} from '@lobehub/ui'; -import { InputPassword } from '@lobehub/ui'; -import type {InputRef} from 'antd/es/input/Input'; +import { type InputProps as Props } from '@lobehub/ui'; +import { InputPassword } from '@lobehub/ui'; +import { type InputRef } from 'antd/es/input/Input'; import { memo, useEffect, useRef, useState } from 'react'; interface FormPasswordProps extends Omit { diff --git a/src/components/FormInput/FormSliderWithInput.tsx b/src/components/FormInput/FormSliderWithInput.tsx index a5232a1b74..bbbcb72e97 100644 --- a/src/components/FormInput/FormSliderWithInput.tsx +++ b/src/components/FormInput/FormSliderWithInput.tsx @@ -1,5 +1,5 @@ -import type {SliderWithInputProps} from '@lobehub/ui'; -import { SliderWithInput } from '@lobehub/ui'; +import { type SliderWithInputProps } from '@lobehub/ui'; +import { SliderWithInput } from '@lobehub/ui'; import { memo, useEffect, useState } from 'react'; interface FormSliderWithInputProps extends Omit { diff --git a/src/components/GalleyGrid/Grid.tsx b/src/components/GalleyGrid/Grid.tsx index 8eed6837db..9819bc8efc 100644 --- a/src/components/GalleyGrid/Grid.tsx +++ b/src/components/GalleyGrid/Grid.tsx @@ -1,7 +1,7 @@ import { Flexbox } from '@lobehub/ui'; import { cx } from 'antd-style'; -import type {CSSProperties, ReactNode} from 'react'; -import { memo, useMemo } from 'react'; +import { type CSSProperties, type ReactNode } from 'react'; +import { memo, useMemo } from 'react'; import { MAX_SIZE_DESKTOP, MIN_IMAGE_SIZE, styles } from './style'; diff --git a/src/components/GalleyGrid/index.tsx b/src/components/GalleyGrid/index.tsx index 6b8c9112bb..7db7971655 100644 --- a/src/components/GalleyGrid/index.tsx +++ b/src/components/GalleyGrid/index.tsx @@ -1,7 +1,7 @@ import { Flexbox } from '@lobehub/ui'; import { useResponsive } from 'antd-style'; -import type {ReactNode} from 'react'; -import { memo, useMemo } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useMemo } from 'react'; import Grid from './Grid'; import { MAX_SIZE_DESKTOP, MAX_SIZE_MOBILE } from './style'; diff --git a/src/components/GroupIcon/index.tsx b/src/components/GroupIcon/index.tsx index 36a16e00c6..3a4f18861f 100644 --- a/src/components/GroupIcon/index.tsx +++ b/src/components/GroupIcon/index.tsx @@ -1,6 +1,6 @@ import { Center, Icon } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; -import type {LucideIcon} from 'lucide-react'; +import { type LucideIcon } from 'lucide-react'; import { memo } from 'react'; const styles = createStaticStyles(({ css }) => ({ diff --git a/src/components/GuideModal/index.tsx b/src/components/GuideModal/index.tsx index eb65722868..e251abbfbf 100644 --- a/src/components/GuideModal/index.tsx +++ b/src/components/GuideModal/index.tsx @@ -1,11 +1,11 @@ 'use client'; import { Flexbox } from '@lobehub/ui'; -import type {ModalProps} from 'antd'; -import { ConfigProvider, Modal } from 'antd'; +import { type ModalProps } from 'antd'; +import { ConfigProvider, Modal } from 'antd'; import { createStaticStyles, cssVar, cx } from 'antd-style'; -import type {ReactNode} from 'react'; -import { memo, useMemo } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useMemo } from 'react'; const prefixCls = 'ant'; diff --git a/src/components/HighlightNotification/index.tsx b/src/components/HighlightNotification/index.tsx index 74728bd1e9..f85e193e60 100644 --- a/src/components/HighlightNotification/index.tsx +++ b/src/components/HighlightNotification/index.tsx @@ -5,7 +5,7 @@ import { ActionIcon, Button, Flexbox } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; import { X } from 'lucide-react'; import Link from 'next/link'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; export interface HighlightNotificationProps { diff --git a/src/components/ImageItem/index.tsx b/src/components/ImageItem/index.tsx index 6824621376..47e62bcefd 100644 --- a/src/components/ImageItem/index.tsx +++ b/src/components/ImageItem/index.tsx @@ -1,9 +1,9 @@ -import type {ImageProps} from '@lobehub/ui'; -import { ActionIcon, Image } from '@lobehub/ui'; +import { type ImageProps } from '@lobehub/ui'; +import { ActionIcon, Image } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import { Trash } from 'lucide-react'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; import { usePlatform } from '@/hooks/usePlatform'; diff --git a/src/components/IndexCard/index.tsx b/src/components/IndexCard/index.tsx index 173dd4216e..14c9dccbf5 100644 --- a/src/components/IndexCard/index.tsx +++ b/src/components/IndexCard/index.tsx @@ -1,8 +1,8 @@ -import type {FlexboxProps} from '@lobehub/ui'; -import { ActionIcon, Center, Flexbox } from '@lobehub/ui'; -import { createStaticStyles , responsive } from 'antd-style'; +import { type FlexboxProps } from '@lobehub/ui'; +import { ActionIcon, Center, Flexbox } from '@lobehub/ui'; +import { createStaticStyles, responsive } from 'antd-style'; import { ChevronDown, ChevronRight } from 'lucide-react'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; const styles = createStaticStyles(({ css, cssVar }) => ({ diff --git a/src/components/InfoTooltip/index.tsx b/src/components/InfoTooltip/index.tsx index c51eb2a2b4..4c7431a392 100644 --- a/src/components/InfoTooltip/index.tsx +++ b/src/components/InfoTooltip/index.tsx @@ -1,9 +1,9 @@ -import type {IconSize, TooltipProps} from '@lobehub/ui'; -import { Icon, Tooltip } from '@lobehub/ui'; +import { type IconSize, type TooltipProps } from '@lobehub/ui'; +import { Icon, Tooltip } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { CircleHelp } from 'lucide-react'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; interface InfoTooltipProps extends Omit { iconStyle?: CSSProperties; diff --git a/src/components/InitProgress/index.tsx b/src/components/InitProgress/index.tsx index ad1bb8964a..132bb9b403 100644 --- a/src/components/InitProgress/index.tsx +++ b/src/components/InitProgress/index.tsx @@ -2,7 +2,7 @@ import { Center, Flexbox, Icon, Text } from '@lobehub/ui'; import { Progress } from 'antd'; import { cssVar } from 'antd-style'; import { Loader2 } from 'lucide-react'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; export interface StageObjectItem { diff --git a/src/components/InlineRename/index.tsx b/src/components/InlineRename/index.tsx index 3a5f7ff9a1..d94320702c 100644 --- a/src/components/InlineRename/index.tsx +++ b/src/components/InlineRename/index.tsx @@ -1,9 +1,9 @@ 'use client'; -import type {InputProps} from '@lobehub/ui'; -import { Input, Popover } from '@lobehub/ui'; -import type { InputRef, PopoverProps } from 'antd'; -import type { KeyboardEvent} from 'react'; +import { type InputProps } from '@lobehub/ui'; +import { Input, Popover } from '@lobehub/ui'; +import { type InputRef, type PopoverProps } from 'antd'; +import { type KeyboardEvent } from 'react'; import { memo, useCallback, useEffect, useRef, useState } from 'react'; function FocusableInput(props: InputProps) { diff --git a/src/components/InlineTable/index.tsx b/src/components/InlineTable/index.tsx index 488e46d59f..12947b5a9e 100644 --- a/src/components/InlineTable/index.tsx +++ b/src/components/InlineTable/index.tsx @@ -1,5 +1,5 @@ -import type {TableProps} from 'antd'; -import { ConfigProvider, Table } from 'antd'; +import { type TableProps } from 'antd'; +import { ConfigProvider, Table } from 'antd'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import { memo } from 'react'; diff --git a/src/components/InstantSwitch/index.tsx b/src/components/InstantSwitch/index.tsx index a72f4f6ea0..2cd4c2c853 100644 --- a/src/components/InstantSwitch/index.tsx +++ b/src/components/InstantSwitch/index.tsx @@ -1,5 +1,5 @@ -import type {SwitchProps} from 'antd'; -import { Switch } from 'antd'; +import { type SwitchProps } from 'antd'; +import { Switch } from 'antd'; import { memo, useState } from 'react'; interface InstantSwitchProps { diff --git a/src/components/InvalidAPIKey/ComfyUIForm.tsx b/src/components/InvalidAPIKey/ComfyUIForm.tsx index c580c68a9d..486f2716ba 100644 --- a/src/components/InvalidAPIKey/ComfyUIForm.tsx +++ b/src/components/InvalidAPIKey/ComfyUIForm.tsx @@ -11,7 +11,7 @@ import { FormInput, FormPassword } from '@/components/FormInput'; import KeyValueEditor from '@/components/KeyValueEditor'; import { FormAction } from '@/features/Conversation/Error/style'; import { useAiInfraStore } from '@/store/aiInfra'; -import type {ComfyUIKeyVault} from '@/types/user/settings'; +import { type ComfyUIKeyVault } from '@/types/user/settings'; import { LoadingContext } from './LoadingContext'; diff --git a/src/components/InvalidAPIKey/ProviderApiKeyForm.tsx b/src/components/InvalidAPIKey/ProviderApiKeyForm.tsx index 579f1d0900..95145443ae 100644 --- a/src/components/InvalidAPIKey/ProviderApiKeyForm.tsx +++ b/src/components/InvalidAPIKey/ProviderApiKeyForm.tsx @@ -1,14 +1,14 @@ import { Button, Icon } from '@lobehub/ui'; import { Loader2Icon, Network } from 'lucide-react'; -import type {ReactNode} from 'react'; -import { memo, use, useState } from 'react'; +import { type ReactNode } from 'react'; +import { memo, use, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { FormInput, FormPassword } from '@/components/FormInput'; import { FormAction } from '@/features/Conversation/Error/style'; import { useProviderName } from '@/hooks/useProviderName'; import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig'; -import type {GlobalLLMProviderKey} from '@/types/user/settings'; +import { type GlobalLLMProviderKey } from '@/types/user/settings'; import { LoadingContext } from './LoadingContext'; import { useApiKey } from './useApiKey'; diff --git a/src/components/InvalidAPIKey/index.tsx b/src/components/InvalidAPIKey/index.tsx index 4c61bce12f..d41e792dac 100644 --- a/src/components/InvalidAPIKey/index.tsx +++ b/src/components/InvalidAPIKey/index.tsx @@ -4,7 +4,7 @@ import { ModelProvider } from 'model-bank'; import { memo, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import type {GlobalLLMProviderKey} from '@/types/user/settings'; +import { type GlobalLLMProviderKey } from '@/types/user/settings'; import BedrockForm from './Bedrock'; import ComfyUIForm from './ComfyUIForm'; diff --git a/src/components/JSONSchemaConfig/ItemRender.tsx b/src/components/JSONSchemaConfig/ItemRender.tsx index 3d0e718fbf..907367587f 100644 --- a/src/components/JSONSchemaConfig/ItemRender.tsx +++ b/src/components/JSONSchemaConfig/ItemRender.tsx @@ -1,6 +1,6 @@ import { Input, InputNumber, InputPassword, Select } from '@lobehub/ui'; import { Slider, Switch } from 'antd'; -import type {JSONSchema7Type} from 'json-schema'; +import { type JSONSchema7Type } from 'json-schema'; import { memo } from 'react'; interface JSONSchemaItemRenderProps { diff --git a/src/components/KeyValueEditor/index.tsx b/src/components/KeyValueEditor/index.tsx index 7f5ba83a8d..8dd7ad91a3 100644 --- a/src/components/KeyValueEditor/index.tsx +++ b/src/components/KeyValueEditor/index.tsx @@ -2,15 +2,15 @@ import { ActionIcon, Button, Flexbox, Icon } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import fastDeepEqual from 'fast-deep-equal'; import { LucidePlus, LucideTrash } from 'lucide-react'; -import type {CSSProperties} from 'react'; -import { memo, useEffect, useRef, useState } from 'react'; +import { type CSSProperties } from 'react'; +import { memo, useEffect, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { v4 as uuidv4 } from 'uuid'; import { FormInput } from '@/components/FormInput'; -import type {KeyValueItem} from './utils'; -import { localListToRecord, recordToLocalList } from './utils'; +import { type KeyValueItem } from './utils'; +import { localListToRecord, recordToLocalList } from './utils'; const styles = createStaticStyles(({ css, cssVar }) => ({ container: css` diff --git a/src/components/LabsModal/LabCard.tsx b/src/components/LabsModal/LabCard.tsx index 147f6cdbb4..a43510e94b 100644 --- a/src/components/LabsModal/LabCard.tsx +++ b/src/components/LabsModal/LabCard.tsx @@ -3,7 +3,7 @@ import { Flexbox } from '@lobehub/ui'; import { Switch } from 'antd'; import { createStaticStyles, cssVar } from 'antd-style'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { memo } from 'react'; import { SkeletonSwitch } from '@/components/Skeleton'; diff --git a/src/components/Link.tsx b/src/components/Link.tsx index cd8ad67ab7..2a7f5a0891 100644 --- a/src/components/Link.tsx +++ b/src/components/Link.tsx @@ -1,5 +1,5 @@ -import type {AnchorHTMLAttributes} from 'react'; -import React, { memo } from 'react'; +import { type AnchorHTMLAttributes } from 'react'; +import React, { memo } from 'react'; import { Link as RouterLink } from 'react-router-dom'; interface LinkProps extends AnchorHTMLAttributes { diff --git a/src/components/Loading/FullscreenLoading/index.tsx b/src/components/Loading/FullscreenLoading/index.tsx index 5dd5df8b4f..9ccf9a02f6 100644 --- a/src/components/Loading/FullscreenLoading/index.tsx +++ b/src/components/Loading/FullscreenLoading/index.tsx @@ -1,9 +1,9 @@ import { Center, Flexbox } from '@lobehub/ui'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import React, { memo } from 'react'; import { ProductLogo } from '@/components/Branding'; -import type {StageItem} from '@/components/InitProgress'; +import { type StageItem } from '@/components/InitProgress'; import InitProgress from '@/components/InitProgress'; interface FullscreenLoadingProps { diff --git a/src/components/Loading/SkeletonLoading/index.tsx b/src/components/Loading/SkeletonLoading/index.tsx index b06c0def10..87fb0d3153 100644 --- a/src/components/Loading/SkeletonLoading/index.tsx +++ b/src/components/Loading/SkeletonLoading/index.tsx @@ -1,8 +1,8 @@ 'use client'; import { Skeleton } from '@lobehub/ui'; -import type {SkeletonProps} from 'antd'; -import { createStaticStyles, cx , responsive } from 'antd-style'; +import { type SkeletonProps } from 'antd'; +import { createStaticStyles, cx, responsive } from 'antd-style'; import { memo } from 'react'; const styles = createStaticStyles( diff --git a/src/components/Loading/UpdateLoading/index.tsx b/src/components/Loading/UpdateLoading/index.tsx index 0567427b96..7044e0bc7f 100644 --- a/src/components/Loading/UpdateLoading/index.tsx +++ b/src/components/Loading/UpdateLoading/index.tsx @@ -1,8 +1,8 @@ -import type {IconSize} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type IconSize } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { Loader2 } from 'lucide-react'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; interface UpdateLoadingProps { size?: IconSize; diff --git a/src/components/MCPDepsIcon/Java.tsx b/src/components/MCPDepsIcon/Java.tsx index c6cf9d92da..3a385978d3 100644 --- a/src/components/MCPDepsIcon/Java.tsx +++ b/src/components/MCPDepsIcon/Java.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { IconType } from '@lobehub/icons'; +import { type IconType } from '@lobehub/icons'; import { memo } from 'react'; const Icon: IconType = memo(({ size = '1em', style, ...rest }) => { diff --git a/src/components/MCPDepsIcon/PowerShell.tsx b/src/components/MCPDepsIcon/PowerShell.tsx index 6d580d24d7..39fb640a57 100644 --- a/src/components/MCPDepsIcon/PowerShell.tsx +++ b/src/components/MCPDepsIcon/PowerShell.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { IconType } from '@lobehub/icons'; +import { type IconType } from '@lobehub/icons'; import { memo } from 'react'; const Icon: IconType = memo(({ size = '1em', style, ...rest }) => { diff --git a/src/components/MCPDepsIcon/Terminal.tsx b/src/components/MCPDepsIcon/Terminal.tsx index 1f3ee951bb..8d19d3140f 100644 --- a/src/components/MCPDepsIcon/Terminal.tsx +++ b/src/components/MCPDepsIcon/Terminal.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { IconType } from '@lobehub/icons'; +import { type IconType } from '@lobehub/icons'; import { memo } from 'react'; const Icon: IconType = memo(({ size = '1em', style, ...rest }) => { diff --git a/src/components/MCPDepsIcon/UV.tsx b/src/components/MCPDepsIcon/UV.tsx index 554bbf393d..f6a70c8da2 100644 --- a/src/components/MCPDepsIcon/UV.tsx +++ b/src/components/MCPDepsIcon/UV.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { IconType } from '@lobehub/icons'; +import { type IconType } from '@lobehub/icons'; import { memo } from 'react'; const Icon: IconType = memo(({ size = '1em', style, ...rest }) => { diff --git a/src/components/MCPStdioCommandInput/index.tsx b/src/components/MCPStdioCommandInput/index.tsx index 96b1078a21..7bcaa20f1d 100644 --- a/src/components/MCPStdioCommandInput/index.tsx +++ b/src/components/MCPStdioCommandInput/index.tsx @@ -6,10 +6,10 @@ import { SiPnpm, SiPython, } from '@icons-pack/react-simple-icons'; -import type {AutoCompleteProps} from '@lobehub/ui'; -import { AutoComplete, Flexbox } from '@lobehub/ui'; -import type {FC} from 'react'; -import { memo } from 'react'; +import { type AutoCompleteProps } from '@lobehub/ui'; +import { AutoComplete, Flexbox } from '@lobehub/ui'; +import { type FC } from 'react'; +import { memo } from 'react'; // Define preset command options const STDIO_COMMAND_OPTIONS: { diff --git a/src/components/ManifestPreviewer/index.tsx b/src/components/ManifestPreviewer/index.tsx index bf33fc06b3..ef37594607 100644 --- a/src/components/ManifestPreviewer/index.tsx +++ b/src/components/ManifestPreviewer/index.tsx @@ -1,5 +1,5 @@ import { Highlighter, Popover } from '@lobehub/ui'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; interface PluginManifestPreviewerProps { diff --git a/src/components/MemberSelectionModal/MemberSelectionModal.tsx b/src/components/MemberSelectionModal/MemberSelectionModal.tsx index 2cd8fd1e16..1651824cbe 100644 --- a/src/components/MemberSelectionModal/MemberSelectionModal.tsx +++ b/src/components/MemberSelectionModal/MemberSelectionModal.tsx @@ -16,8 +16,8 @@ import { useHover } from 'ahooks'; import { List as AntdList, Switch } from 'antd'; import { createStaticStyles, cx } from 'antd-style'; import { X } from 'lucide-react'; -import type {ChangeEvent} from 'react'; -import { memo, useCallback, useMemo, useRef, useState } from 'react'; +import { type ChangeEvent } from 'react'; +import { memo, useCallback, useMemo, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { DEFAULT_AVATAR } from '@/const/meta'; @@ -25,8 +25,8 @@ import AgentSelectionEmpty from '@/features/AgentSelectionEmpty'; import ModelSelect from '@/features/ModelSelect'; import { useEnabledChatModels } from '@/hooks/useEnabledChatModels'; import { useSessionStore } from '@/store/session'; -import type {LobeAgentSession} from '@/types/session'; -import { LobeSessionType } from '@/types/session'; +import { type LobeAgentSession } from '@/types/session'; +import { LobeSessionType } from '@/types/session'; const AvailableAgentItem = memo<{ agent: LobeAgentSession; diff --git a/src/components/Menu/index.tsx b/src/components/Menu/index.tsx index cc79dae722..efabe56665 100644 --- a/src/components/Menu/index.tsx +++ b/src/components/Menu/index.tsx @@ -1,5 +1,5 @@ -import type {MenuProps as AntdMenuProps} from 'antd'; -import { ConfigProvider,Menu as AntdMenu } from 'antd'; +import { type MenuProps as AntdMenuProps } from 'antd'; +import { ConfigProvider, Menu as AntdMenu } from 'antd'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import { memo } from 'react'; diff --git a/src/components/ModelSelect/index.tsx b/src/components/ModelSelect/index.tsx index 4567b5e286..14e9be9496 100644 --- a/src/components/ModelSelect/index.tsx +++ b/src/components/ModelSelect/index.tsx @@ -1,7 +1,7 @@ -import type {ChatModelCard} from '@lobechat/types'; -import type {IconAvatarProps} from '@lobehub/icons'; -import { LobeHub, ModelIcon, ProviderIcon } from '@lobehub/icons'; -import type { FlexboxProps} from '@lobehub/ui'; +import { type ChatModelCard } from '@lobechat/types'; +import { type IconAvatarProps } from '@lobehub/icons'; +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 { @@ -14,13 +14,13 @@ import { ToyBrick, Video, } from 'lucide-react'; -import type {ModelAbilities} from 'model-bank'; +import { type ModelAbilities } from 'model-bank'; import numeral from 'numeral'; -import type { CSSProperties,FC} from 'react'; -import { memo } from 'react'; +import { type CSSProperties, type FC } from 'react'; +import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {AiProviderSourceType} from '@/types/aiProvider'; +import { type AiProviderSourceType } from '@/types/aiProvider'; import { formatTokenNumber } from '@/utils/format'; import NewModelBadgeI18n, { NewModelBadge as NewModelBadgeCore } from './NewModelBadge'; diff --git a/src/components/NeuralNetworkLoading/index.tsx b/src/components/NeuralNetworkLoading/index.tsx index e398e04750..849c8d3caa 100644 --- a/src/components/NeuralNetworkLoading/index.tsx +++ b/src/components/NeuralNetworkLoading/index.tsx @@ -1,7 +1,7 @@ 'use client'; import { createStaticStyles, keyframes } from 'antd-style'; -import type { CSSProperties} from 'react'; +import { type CSSProperties } from 'react'; import { memo } from 'react'; const pulseAnim = keyframes` diff --git a/src/components/Notification/index.tsx b/src/components/Notification/index.tsx index 46e7775fa6..96cda40da0 100644 --- a/src/components/Notification/index.tsx +++ b/src/components/Notification/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FlexboxProps} from '@lobehub/ui'; -import { ActionIcon, Flexbox } from '@lobehub/ui'; +import { type FlexboxProps } from '@lobehub/ui'; +import { ActionIcon, Flexbox } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import { XIcon } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/components/OfficialIcon.tsx b/src/components/OfficialIcon.tsx index de77c4bc6b..c97aa366f5 100644 --- a/src/components/OfficialIcon.tsx +++ b/src/components/OfficialIcon.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { IconType } from '@lobehub/icons'; +import { type IconType } from '@lobehub/icons'; import { memo } from 'react'; const OfficialIcon: IconType = memo(({ size = 18, style, fill = '#1d9bf0', ...rest }) => { diff --git a/src/components/PanelTitle/index.tsx b/src/components/PanelTitle/index.tsx index e95f407318..b8a5181d25 100644 --- a/src/components/PanelTitle/index.tsx +++ b/src/components/PanelTitle/index.tsx @@ -2,8 +2,8 @@ import { Flexbox } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; const styles = createStaticStyles(({ css }) => ({ desc: css` diff --git a/src/components/Plugins/PluginAvatar.tsx b/src/components/Plugins/PluginAvatar.tsx index 88b189f64e..7f6bc10f80 100644 --- a/src/components/Plugins/PluginAvatar.tsx +++ b/src/components/Plugins/PluginAvatar.tsx @@ -1,7 +1,7 @@ import { MCP } from '@lobehub/icons'; import { Avatar } from '@lobehub/ui'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; interface PluginAvatarProps { alt?: string; diff --git a/src/components/ProgressItem/index.tsx b/src/components/ProgressItem/index.tsx index 2804498cd4..7080a30621 100644 --- a/src/components/ProgressItem/index.tsx +++ b/src/components/ProgressItem/index.tsx @@ -1,8 +1,8 @@ import { Flexbox } from '@lobehub/ui'; import { Progress } from 'antd'; import { createStaticStyles, cssVar, useResponsive } from 'antd-style'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; const styles = createStaticStyles(({ css }) => ({ desc: css` diff --git a/src/components/PublishedTime.tsx b/src/components/PublishedTime.tsx index c41768780b..9cf7caac84 100644 --- a/src/components/PublishedTime.tsx +++ b/src/components/PublishedTime.tsx @@ -4,7 +4,7 @@ import 'dayjs/locale/zh.js'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import dayjs from 'dayjs'; -import type {CSSProperties, FC} from 'react'; +import { type CSSProperties, type FC } from 'react'; import { useTranslation } from 'react-i18next'; const LAST_MODIFIED = new Date().toISOString(); diff --git a/src/components/SafeSpacing/index.tsx b/src/components/SafeSpacing/index.tsx index f57e537db6..de31c89c6c 100644 --- a/src/components/SafeSpacing/index.tsx +++ b/src/components/SafeSpacing/index.tsx @@ -1,5 +1,5 @@ -import type {SafeAreaProps} from '@lobehub/ui/mobile'; -import { SafeArea } from '@lobehub/ui/mobile'; +import { type SafeAreaProps } from '@lobehub/ui/mobile'; +import { SafeArea } from '@lobehub/ui/mobile'; import { memo } from 'react'; import { HEADER_HEIGHT, MOBILE_NABBAR_HEIGHT, MOBILE_TABBAR_HEIGHT } from '@/const/layoutTokens'; diff --git a/src/components/SidebarHeader/index.tsx b/src/components/SidebarHeader/index.tsx index 59014c24bb..502bb15409 100644 --- a/src/components/SidebarHeader/index.tsx +++ b/src/components/SidebarHeader/index.tsx @@ -1,7 +1,7 @@ -import type {FlexboxProps} from '@lobehub/ui'; -import { Flexbox } from '@lobehub/ui'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Flexbox } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; const styles = createStaticStyles(({ css }) => ({ diff --git a/src/components/Statistic/index.tsx b/src/components/Statistic/index.tsx index f5cf32d415..6e4de55d9e 100644 --- a/src/components/Statistic/index.tsx +++ b/src/components/Statistic/index.tsx @@ -1,6 +1,6 @@ import { Flexbox } from '@lobehub/ui'; import { cssVar } from 'antd-style'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; const Statistic = memo<{ title: ReactNode; value: ReactNode }>(({ value, title }) => { diff --git a/src/components/StatisticCard/TitleWithPercentage.tsx b/src/components/StatisticCard/TitleWithPercentage.tsx index bd73266b85..a5affebf16 100644 --- a/src/components/StatisticCard/TitleWithPercentage.tsx +++ b/src/components/StatisticCard/TitleWithPercentage.tsx @@ -1,7 +1,7 @@ import { Flexbox, Tag, Text } from '@lobehub/ui'; import { cssVar } from 'antd-style'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; import { calcGrowthPercentage } from './growthPercentage'; diff --git a/src/components/StatisticCard/index.tsx b/src/components/StatisticCard/index.tsx index efb070559f..4266dd4f26 100644 --- a/src/components/StatisticCard/index.tsx +++ b/src/components/StatisticCard/index.tsx @@ -1,8 +1,6 @@ -import type {StatisticCardProps as AntdStatisticCardProps} from '@ant-design/pro-components'; -import { - StatisticCard as AntdStatisticCard -} from '@ant-design/pro-components'; -import type { BlockProps} from '@lobehub/ui'; +import { type StatisticCardProps as AntdStatisticCardProps } from '@ant-design/pro-components'; +import { StatisticCard as AntdStatisticCard } from '@ant-design/pro-components'; +import { type BlockProps } from '@lobehub/ui'; import { Block, Text } from '@lobehub/ui'; import { Spin } from 'antd'; import { createStaticStyles, cx, responsive, useResponsive } from 'antd-style'; diff --git a/src/components/StopLoading.tsx b/src/components/StopLoading.tsx index cdbd9be2ba..9c81f11685 100644 --- a/src/components/StopLoading.tsx +++ b/src/components/StopLoading.tsx @@ -1,4 +1,4 @@ -import type { IconType } from '@lobehub/icons'; +import { type IconType } from '@lobehub/icons'; import { cssVar, cx } from 'antd-style'; const StopLoadingIcon: IconType = (({ ref, size = 16, className, style, ...rest }) => { diff --git a/src/components/StreamingMarkdown/index.tsx b/src/components/StreamingMarkdown/index.tsx index 0bb8c41a63..4fa7b83b9d 100644 --- a/src/components/StreamingMarkdown/index.tsx +++ b/src/components/StreamingMarkdown/index.tsx @@ -2,8 +2,8 @@ import { Markdown, ScrollShadow } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; -import type {RefObject} from 'react'; -import { memo, useEffect } from 'react'; +import { type RefObject } from 'react'; +import { memo, useEffect } from 'react'; import { useAutoScroll } from '@/hooks/useAutoScroll'; diff --git a/src/components/StructuredData/index.tsx b/src/components/StructuredData/index.tsx index 9ae237c718..bdac5befb4 100644 --- a/src/components/StructuredData/index.tsx +++ b/src/components/StructuredData/index.tsx @@ -1,4 +1,4 @@ -import type {FC} from 'react'; +import { type FC } from 'react'; const StructuredData: FC<{ ld: any }> = ({ ld }) => { return ( diff --git a/src/components/TextArea/index.tsx b/src/components/TextArea/index.tsx index 0ee19f080e..78c3dae49b 100644 --- a/src/components/TextArea/index.tsx +++ b/src/components/TextArea/index.tsx @@ -1,6 +1,6 @@ -import type {TextAreaProps as Props} from '@lobehub/ui'; -import { TextArea as LobeTextArea } from '@lobehub/ui'; -import type {TextAreaRef} from 'antd/es/input/TextArea'; +import { type TextAreaProps as Props } from '@lobehub/ui'; +import { TextArea as LobeTextArea } from '@lobehub/ui'; +import { type TextAreaRef } from 'antd/es/input/TextArea'; import { memo, useRef, useState } from 'react'; interface TextAreaProps extends Omit { diff --git a/src/components/TipGuide/index.tsx b/src/components/TipGuide/index.tsx index 95efec1f06..4c977a6c5d 100644 --- a/src/components/TipGuide/index.tsx +++ b/src/components/TipGuide/index.tsx @@ -1,9 +1,9 @@ import { ActionIcon, Flexbox, Popover } from '@lobehub/ui'; -import type {TooltipProps} from 'antd'; -import { ConfigProvider } from 'antd'; +import { type TooltipProps } from 'antd'; +import { ConfigProvider } from 'antd'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import { XIcon } from 'lucide-react'; -import type {CSSProperties, FC, ReactNode} from 'react'; +import { type CSSProperties, type FC, type ReactNode } from 'react'; const styles = createStaticStyles(({ css }) => { return { diff --git a/src/components/client/ClientOnly.tsx b/src/components/client/ClientOnly.tsx index 081fdb2fcf..d363b48e8d 100644 --- a/src/components/client/ClientOnly.tsx +++ b/src/components/client/ClientOnly.tsx @@ -1,8 +1,8 @@ 'use client'; import type React from 'react'; -import type {FC, PropsWithChildren} from 'react'; -import { useEffect, useState } from 'react'; +import { type FC, type PropsWithChildren } from 'react'; +import { useEffect, useState } from 'react'; const ClientOnly: FC> = ({ children, diff --git a/src/components/client/ClientResponsiveContent/index.tsx b/src/components/client/ClientResponsiveContent/index.tsx index 6bdb87c58e..28c2592fec 100644 --- a/src/components/client/ClientResponsiveContent/index.tsx +++ b/src/components/client/ClientResponsiveContent/index.tsx @@ -1,8 +1,8 @@ 'use client'; -import type {Loader} from 'next/dist/shared/lib/dynamic'; -import type {FC} from 'react'; -import { memo } from 'react'; +import { type Loader } from 'next/dist/shared/lib/dynamic'; +import { type FC } from 'react'; +import { memo } from 'react'; import MobileSwitchLoading from '@/features/MobileSwitchLoading'; import { useIsMobile } from '@/hooks/useIsMobile'; diff --git a/src/components/client/ClientResponsiveLayout.tsx b/src/components/client/ClientResponsiveLayout.tsx index 8ce9a9d36e..5434711b29 100644 --- a/src/components/client/ClientResponsiveLayout.tsx +++ b/src/components/client/ClientResponsiveLayout.tsx @@ -1,8 +1,8 @@ 'use client'; -import type {Loader} from 'next/dist/shared/lib/dynamic'; -import type {FC, PropsWithChildren} from 'react'; -import { memo } from 'react'; +import { type Loader } from 'next/dist/shared/lib/dynamic'; +import { type FC, type PropsWithChildren } from 'react'; +import { memo } from 'react'; import MobileSwitchLoading from '@/features/MobileSwitchLoading'; import { useIsMobile } from '@/hooks/useIsMobile'; diff --git a/src/components/mdx/CodeBlock.tsx b/src/components/mdx/CodeBlock.tsx index 7dc14f72c1..1070b52683 100644 --- a/src/components/mdx/CodeBlock.tsx +++ b/src/components/mdx/CodeBlock.tsx @@ -1,7 +1,7 @@ 'use client'; import { Pre, PreSingleLine } from '@lobehub/ui/mdx'; -import type {FC, PropsWithChildren} from 'react'; +import { type FC, type PropsWithChildren } from 'react'; const countLines = (str: string): number => { const regex = /\n/g; diff --git a/src/components/mdx/Image.tsx b/src/components/mdx/Image.tsx index 255835082c..280224fbbe 100644 --- a/src/components/mdx/Image.tsx +++ b/src/components/mdx/Image.tsx @@ -2,7 +2,7 @@ import { Image } from '@lobehub/ui/mdx'; import { getPlaiceholder } from 'plaiceholder'; -import type {FC} from 'react'; +import { type FC } from 'react'; import Img from '@/libs/next/Image'; diff --git a/src/components/mdx/Link.tsx b/src/components/mdx/Link.tsx index e8082f8214..25c939f01d 100644 --- a/src/components/mdx/Link.tsx +++ b/src/components/mdx/Link.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {AnchorHTMLAttributes, FC} from 'react'; +import { type AnchorHTMLAttributes, type FC } from 'react'; import { Link } from 'react-router-dom'; const EXTERNAL_HREF_REGEX = /https?:\/\//; diff --git a/src/components/mdx/index.tsx b/src/components/mdx/index.tsx index 1d9a6aedad..38aac76398 100644 --- a/src/components/mdx/index.tsx +++ b/src/components/mdx/index.tsx @@ -1,9 +1,9 @@ -import type {TypographyProps} from '@lobehub/ui'; -import { Typography as Typo } from '@lobehub/ui'; +import { type TypographyProps } from '@lobehub/ui'; +import { Typography as Typo } from '@lobehub/ui'; import { mdxComponents } from '@lobehub/ui/mdx'; -import type {MDXRemoteProps} from 'next-mdx-remote/rsc'; -import { MDXRemote } from 'next-mdx-remote/rsc'; -import type {FC} from 'react'; +import { type MDXRemoteProps } from 'next-mdx-remote/rsc'; +import { MDXRemote } from 'next-mdx-remote/rsc'; +import { type FC } from 'react'; import remarkGfm from 'remark-gfm'; import CodeBlock from './CodeBlock'; diff --git a/src/components/server/MobileNavLayout.tsx b/src/components/server/MobileNavLayout.tsx index acc339b803..bab44d3cb9 100644 --- a/src/components/server/MobileNavLayout.tsx +++ b/src/components/server/MobileNavLayout.tsx @@ -1,6 +1,6 @@ -import type {FlexboxProps} from '@lobehub/ui'; -import { Flexbox } from '@lobehub/ui'; -import type {ReactNode} from 'react'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Flexbox } from '@lobehub/ui'; +import { type ReactNode } from 'react'; interface MobileContentLayoutProps extends FlexboxProps { header?: ReactNode; diff --git a/src/components/server/ServerLayout.tsx b/src/components/server/ServerLayout.tsx index 64d9131414..83c250424c 100644 --- a/src/components/server/ServerLayout.tsx +++ b/src/components/server/ServerLayout.tsx @@ -1,6 +1,6 @@ -import type {FC, PropsWithChildren, ReactNode} from 'react'; +import { type FC, type PropsWithChildren, type ReactNode } from 'react'; -import type {DynamicLayoutProps} from '@/types/next'; +import { type DynamicLayoutProps } from '@/types/next'; import { RouteVariants } from '@/utils/server/routeVariants'; interface ServerLayoutProps { diff --git a/src/components/withSuspense.tsx b/src/components/withSuspense.tsx index e3727832ad..622e56d620 100644 --- a/src/components/withSuspense.tsx +++ b/src/components/withSuspense.tsx @@ -1,5 +1,5 @@ -import type {ComponentType} from 'react'; -import { Suspense } from 'react'; +import { type ComponentType } from 'react'; +import { Suspense } from 'react'; // @ts-ignore export const withSuspense: (Comp: T) => T = (Component: ComponentType) => (props: any) => ( diff --git a/src/config/featureFlags/utils/parser.ts b/src/config/featureFlags/utils/parser.ts index 99ab049660..92c3deae12 100644 --- a/src/config/featureFlags/utils/parser.ts +++ b/src/config/featureFlags/utils/parser.ts @@ -1,5 +1,5 @@ -import type {IFeatureFlags} from '../schema'; -import { FeatureFlagsSchema } from '../schema'; +import { type IFeatureFlags } from '../schema'; +import { FeatureFlagsSchema } from '../schema'; /** * 解析环境变量中的特性标志字符串。 diff --git a/src/config/routes/index.ts b/src/config/routes/index.ts index 5470a7de5c..2020654385 100644 --- a/src/config/routes/index.ts +++ b/src/config/routes/index.ts @@ -1,11 +1,11 @@ -import type {LucideIcon} from 'lucide-react'; +import { type LucideIcon } from 'lucide-react'; import { BrainCircuit, FilePenIcon, Image, LibraryBigIcon, Settings, - ShapesIcon + ShapesIcon, } from 'lucide-react'; export interface NavigationRoute { diff --git a/src/envs/redis.ts b/src/envs/redis.ts index 834605c5e6..271ee429c2 100644 --- a/src/envs/redis.ts +++ b/src/envs/redis.ts @@ -2,7 +2,7 @@ import { createEnv } from '@t3-oss/env-nextjs'; import { z } from 'zod'; -import type { RedisConfig } from '@/libs/redis'; +import { type RedisConfig } from '@/libs/redis'; const parseNumber = (value?: string) => { const parsed = Number.parseInt(value ?? '', 10); diff --git a/src/features/AgentBuilder/AgentBuilderConversation.tsx b/src/features/AgentBuilder/AgentBuilderConversation.tsx index b5ed2920d8..23507e0d72 100644 --- a/src/features/AgentBuilder/AgentBuilderConversation.tsx +++ b/src/features/AgentBuilder/AgentBuilderConversation.tsx @@ -2,7 +2,7 @@ import { Flexbox } from '@lobehub/ui'; import { memo } from 'react'; import DragUploadZone, { useUploadFiles } from '@/components/DragUploadZone'; -import type { ActionKeys } from '@/features/ChatInput'; +import { type ActionKeys } from '@/features/ChatInput'; import { ChatInput, ChatList } from '@/features/Conversation'; import { useAgentStore } from '@/store/agent'; import { agentByIdSelectors } from '@/store/agent/selectors'; diff --git a/src/features/AgentBuilder/AgentBuilderProvider.tsx b/src/features/AgentBuilder/AgentBuilderProvider.tsx index 26196e785a..494cec78dc 100644 --- a/src/features/AgentBuilder/AgentBuilderProvider.tsx +++ b/src/features/AgentBuilder/AgentBuilderProvider.tsx @@ -1,10 +1,10 @@ -import type {ReactNode} from 'react'; -import { memo, useMemo } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useMemo } from 'react'; import { ConversationProvider } from '@/features/Conversation'; import { useOperationState } from '@/hooks/useOperationState'; import { useChatStore } from '@/store/chat'; -import type {MessageMapKeyInput} from '@/store/chat/utils/messageMapKey'; +import { type MessageMapKeyInput } from '@/store/chat/utils/messageMapKey'; import { messageMapKey } from '@/store/chat/utils/messageMapKey'; interface AgentBuilderProviderProps { diff --git a/src/features/AgentBuilder/AgentBuilderWelcome.tsx b/src/features/AgentBuilder/AgentBuilderWelcome.tsx index bf615f06a4..fca861003f 100644 --- a/src/features/AgentBuilder/AgentBuilderWelcome.tsx +++ b/src/features/AgentBuilder/AgentBuilderWelcome.tsx @@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next'; import { DEFAULT_INBOX_AVATAR } from '@/const/index'; import { conversationSelectors, useConversationStore } from '@/features/Conversation'; -import type { SuggestMode } from '@/features/SuggestQuestions'; +import { type SuggestMode } from '@/features/SuggestQuestions'; import SuggestQuestions from '@/features/SuggestQuestions'; import { useAgentStore } from '@/store/agent'; import { agentByIdSelectors } from '@/store/agent/selectors'; diff --git a/src/features/AgentBuilder/TopicSelector.tsx b/src/features/AgentBuilder/TopicSelector.tsx index 668cae1a28..66f687e63d 100644 --- a/src/features/AgentBuilder/TopicSelector.tsx +++ b/src/features/AgentBuilder/TopicSelector.tsx @@ -1,5 +1,5 @@ -import type {DropdownMenuCheckboxItem} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu, Flexbox } from '@lobehub/ui'; +import { type DropdownMenuCheckboxItem } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu, Flexbox } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; diff --git a/src/features/AgentInfo/index.tsx b/src/features/AgentInfo/index.tsx index 91b94f684b..26b422b4ec 100644 --- a/src/features/AgentInfo/index.tsx +++ b/src/features/AgentInfo/index.tsx @@ -2,10 +2,10 @@ import { Avatar, Center, Markdown, Tag } from '@lobehub/ui'; import { Divider } from 'antd'; import { createStaticStyles, cssVar } from 'antd-style'; import { startCase } from 'es-toolkit/compat'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; -import type {MetaData} from '@/types/meta'; +import { type MetaData } from '@/types/meta'; const styles = createStaticStyles(({ css, cssVar }) => ({ avatar: css` diff --git a/src/features/AgentSelectionEmpty.tsx b/src/features/AgentSelectionEmpty.tsx index d01916b016..f1a6075b83 100644 --- a/src/features/AgentSelectionEmpty.tsx +++ b/src/features/AgentSelectionEmpty.tsx @@ -1,5 +1,5 @@ -import type {EmptyProps} from '@lobehub/ui'; -import { Center, Empty } from '@lobehub/ui'; +import { type EmptyProps } from '@lobehub/ui'; +import { Center, Empty } from '@lobehub/ui'; import { Users } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/AgentSetting/AgentCategory/index.tsx b/src/features/AgentSetting/AgentCategory/index.tsx index 2b735d8d0a..81e1f06519 100644 --- a/src/features/AgentSetting/AgentCategory/index.tsx +++ b/src/features/AgentSetting/AgentCategory/index.tsx @@ -3,7 +3,7 @@ import { memo } from 'react'; import Menu from '@/components/Menu'; -import type {ChatSettingsTabs} from '@/store/global/initialState'; +import { type ChatSettingsTabs } from '@/store/global/initialState'; import { useCategory } from './useCategory'; diff --git a/src/features/AgentSetting/AgentCategory/useCategory.tsx b/src/features/AgentSetting/AgentCategory/useCategory.tsx index c911539819..95790da7b6 100644 --- a/src/features/AgentSetting/AgentCategory/useCategory.tsx +++ b/src/features/AgentSetting/AgentCategory/useCategory.tsx @@ -1,10 +1,10 @@ import { Icon } from '@lobehub/ui'; -import type {MenuItemType} from 'antd/es/menu/interface'; +import { type MenuItemType } from 'antd/es/menu/interface'; import { Bot, BrainCog, Handshake, MessagesSquare, Mic2, UserCircle } from 'lucide-react'; import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -import type { MenuProps } from '@/components/Menu'; +import { type MenuProps } from '@/components/Menu'; import { useAgentStore } from '@/store/agent'; import { builtinAgentSelectors } from '@/store/agent/selectors'; import { ChatSettingsTabs } from '@/store/global/initialState'; diff --git a/src/features/AgentSetting/AgentChat/index.tsx b/src/features/AgentSetting/AgentChat/index.tsx index d7b47a7b6b..4608845f99 100644 --- a/src/features/AgentSetting/AgentChat/index.tsx +++ b/src/features/AgentSetting/AgentChat/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FormGroupItemType} from '@lobehub/ui'; -import { Form, SliderWithInput } from '@lobehub/ui'; +import { type FormGroupItemType } from '@lobehub/ui'; +import { Form, SliderWithInput } from '@lobehub/ui'; import { Switch } from 'antd'; import isEqual from 'fast-deep-equal'; import { memo } from 'react'; diff --git a/src/features/AgentSetting/AgentMeta/AutoGenerateInput.tsx b/src/features/AgentSetting/AgentMeta/AutoGenerateInput.tsx index 093598767d..db31a61d87 100644 --- a/src/features/AgentSetting/AgentMeta/AutoGenerateInput.tsx +++ b/src/features/AgentSetting/AgentMeta/AutoGenerateInput.tsx @@ -1,5 +1,5 @@ -import type {InputProps} from '@lobehub/ui'; -import { ActionIcon, Input } from '@lobehub/ui'; +import { type InputProps } from '@lobehub/ui'; +import { ActionIcon, Input } from '@lobehub/ui'; import { Wand2 } from 'lucide-react'; import { memo, useCallback, useEffect, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/AgentSetting/AgentMeta/AutoGenerateSelect.tsx b/src/features/AgentSetting/AgentMeta/AutoGenerateSelect.tsx index 7259b08cfe..1b555eb703 100644 --- a/src/features/AgentSetting/AgentMeta/AutoGenerateSelect.tsx +++ b/src/features/AgentSetting/AgentMeta/AutoGenerateSelect.tsx @@ -1,5 +1,5 @@ -import type {SelectProps} from '@lobehub/ui'; -import { ActionIcon, Select } from '@lobehub/ui'; +import { type SelectProps } from '@lobehub/ui'; +import { ActionIcon, Select } from '@lobehub/ui'; import { isString } from 'es-toolkit/compat'; import { Wand2 } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/features/AgentSetting/AgentMeta/BackgroundSwatches.tsx b/src/features/AgentSetting/AgentMeta/BackgroundSwatches.tsx index 4ff4af3e1d..c6a255550e 100644 --- a/src/features/AgentSetting/AgentMeta/BackgroundSwatches.tsx +++ b/src/features/AgentSetting/AgentMeta/BackgroundSwatches.tsx @@ -1,5 +1,5 @@ -import type {ColorSwatchesProps} from '@lobehub/ui'; -import { ColorSwatches, primaryColors } from '@lobehub/ui'; +import { type ColorSwatchesProps } from '@lobehub/ui'; +import { ColorSwatches, primaryColors } from '@lobehub/ui'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/AgentSetting/AgentMeta/index.tsx b/src/features/AgentSetting/AgentMeta/index.tsx index bbcc009877..5340777e02 100644 --- a/src/features/AgentSetting/AgentMeta/index.tsx +++ b/src/features/AgentSetting/AgentMeta/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FormGroupItemType, FormItemProps} from '@lobehub/ui'; -import { Button, Form, Tooltip } from '@lobehub/ui'; +import { type FormGroupItemType, type FormItemProps } from '@lobehub/ui'; +import { Button, Form, Tooltip } from '@lobehub/ui'; import { useUpdateEffect } from 'ahooks'; import isEqual from 'fast-deep-equal'; import { Wand2 } from 'lucide-react'; diff --git a/src/features/AgentSetting/AgentModal/index.tsx b/src/features/AgentSetting/AgentModal/index.tsx index bac688f91b..8aa11f295b 100644 --- a/src/features/AgentSetting/AgentModal/index.tsx +++ b/src/features/AgentSetting/AgentModal/index.tsx @@ -1,11 +1,7 @@ 'use client'; -import type {FormGroupItemType, FormItemProps} from '@lobehub/ui'; -import { -Flexbox, - Form, - Select, - SliderWithInput} from '@lobehub/ui'; +import { type FormGroupItemType, type FormItemProps } from '@lobehub/ui'; +import { Flexbox, Form, Select, SliderWithInput } from '@lobehub/ui'; import { Form as AntdForm, Switch } from 'antd'; import { createStaticStyles } from 'antd-style'; import isEqual from 'fast-deep-equal'; diff --git a/src/features/AgentSetting/AgentPlugin/AddPluginButton.tsx b/src/features/AgentSetting/AgentPlugin/AddPluginButton.tsx index dfbf6d4e8c..d158ec1060 100644 --- a/src/features/AgentSetting/AgentPlugin/AddPluginButton.tsx +++ b/src/features/AgentSetting/AgentPlugin/AddPluginButton.tsx @@ -1,8 +1,8 @@ -import type {ButtonProps} from '@lobehub/ui'; -import { Button } from '@lobehub/ui'; +import { type ButtonProps } from '@lobehub/ui'; +import { Button } from '@lobehub/ui'; import { Grid2x2Plus } from 'lucide-react'; -import type {Ref} from 'react'; -import { useState } from 'react'; +import { type Ref } from 'react'; +import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import DevModal from '@/features/PluginDevModal'; diff --git a/src/features/AgentSetting/AgentPlugin/index.tsx b/src/features/AgentSetting/AgentPlugin/index.tsx index 1aa0766170..a2025e7dd5 100644 --- a/src/features/AgentSetting/AgentPlugin/index.tsx +++ b/src/features/AgentSetting/AgentPlugin/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FormGroupItemType} from '@lobehub/ui'; -import { Avatar, Button, Center, Empty, Flexbox,Form, Tag, Tooltip } from '@lobehub/ui'; +import { type FormGroupItemType } from '@lobehub/ui'; +import { Avatar, Button, Center, Empty, Flexbox, Form, Tag, Tooltip } from '@lobehub/ui'; import { Space, Switch } from 'antd'; import isEqual from 'fast-deep-equal'; import { BlocksIcon, LucideTrash2, Store } from 'lucide-react'; diff --git a/src/features/AgentSetting/AgentSettings.tsx b/src/features/AgentSetting/AgentSettings.tsx index 2ea3b6b183..a4008dac2a 100644 --- a/src/features/AgentSetting/AgentSettings.tsx +++ b/src/features/AgentSetting/AgentSettings.tsx @@ -1,12 +1,12 @@ import { Skeleton } from '@lobehub/ui'; -import { memo,Suspense } from 'react'; +import { memo, Suspense } from 'react'; import { ChatSettingsTabs } from '@/store/global/initialState'; import { useServerConfigStore } from '@/store/serverConfig'; import AgentSettingsContent from './AgentSettingsContent'; import { AgentSettingsProvider } from './AgentSettingsProvider'; -import type {StoreUpdaterProps} from './StoreUpdater'; +import { type StoreUpdaterProps } from './StoreUpdater'; export interface AgentSettingsProps extends StoreUpdaterProps { tab: ChatSettingsTabs; diff --git a/src/features/AgentSetting/AgentSettingsContent.tsx b/src/features/AgentSetting/AgentSettingsContent.tsx index cba0ac4b65..1ef8618ef1 100644 --- a/src/features/AgentSetting/AgentSettingsContent.tsx +++ b/src/features/AgentSetting/AgentSettingsContent.tsx @@ -1,4 +1,4 @@ -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import { useAgentStore } from '@/store/agent'; diff --git a/src/features/AgentSetting/AgentSettingsProvider.tsx b/src/features/AgentSetting/AgentSettingsProvider.tsx index d7be56cd8f..35eb9f254d 100644 --- a/src/features/AgentSetting/AgentSettingsProvider.tsx +++ b/src/features/AgentSetting/AgentSettingsProvider.tsx @@ -1,8 +1,8 @@ -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; -import { createStore,Provider } from './store'; -import type {StoreUpdaterProps} from './StoreUpdater'; +import { createStore, Provider } from './store'; +import { type StoreUpdaterProps } from './StoreUpdater'; import StoreUpdater from './StoreUpdater'; interface AgentSettingsProps extends StoreUpdaterProps { diff --git a/src/features/AgentSetting/AgentTTS/SelectWithTTSPreview.tsx b/src/features/AgentSetting/AgentTTS/SelectWithTTSPreview.tsx index 8b88cde4f6..32aeffb794 100644 --- a/src/features/AgentSetting/AgentTTS/SelectWithTTSPreview.tsx +++ b/src/features/AgentSetting/AgentTTS/SelectWithTTSPreview.tsx @@ -1,120 +1,127 @@ import { getMessageError } from '@lobechat/fetch-sse'; -import type {ChatMessageError} from '@lobechat/types'; +import { type ChatMessageError } from '@lobechat/types'; import { AudioPlayer } from '@lobehub/tts/react'; -import type {SelectProps} from '@lobehub/ui'; -import { Alert, Button, Flexbox, Highlighter, Select } from '@lobehub/ui'; -import type {RefSelectProps} from 'antd'; +import { type SelectProps } from '@lobehub/ui'; +import { Alert, Button, Flexbox, Highlighter, Select } from '@lobehub/ui'; +import { type RefSelectProps } from 'antd'; import { cssVar } from 'antd-style'; import { useCallback, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useTTS } from '@/hooks/useTTS'; -import type {TTSServer} from '@/types/agent'; +import { type TTSServer } from '@/types/agent'; interface SelectWithTTSPreviewProps extends SelectProps { server: TTSServer; } -const SelectWithTTSPreview = ({ ref, value, options, server, onSelect, ...rest }: SelectWithTTSPreviewProps & { ref?: React.RefObject }) => { - const [error, setError] = useState(); - const [voice, setVoice] = useState(value); - const { t } = useTranslation('welcome'); - const PREVIEW_TEXT = ['Lobe Chat', t('slogan.title'), t('slogan.desc1')].join('. '); +const SelectWithTTSPreview = ({ + ref, + value, + options, + server, + onSelect, + ...rest +}: SelectWithTTSPreviewProps & { ref?: React.RefObject }) => { + const [error, setError] = useState(); + const [voice, setVoice] = useState(value); + const { t } = useTranslation('welcome'); + const PREVIEW_TEXT = ['Lobe Chat', t('slogan.title'), t('slogan.desc1')].join('. '); - const setDefaultError = useCallback( - (err?: any) => { - setError({ body: err, message: t('tts.responseError', { ns: 'error' }), type: 500 }); - }, - [t], - ); + const setDefaultError = useCallback( + (err?: any) => { + setError({ body: err, message: t('tts.responseError', { ns: 'error' }), type: 500 }); + }, + [t], + ); - const { isGlobalLoading, audio, stop, start, response, setText } = useTTS(PREVIEW_TEXT, { - onError: (err) => { - stop(); - setDefaultError(err); - }, - onErrorRetry: (err) => { - stop(); - setDefaultError(err); - }, - onSuccess: async () => { - if (!response) return; - if (response.status === 200) return; - const message = await getMessageError(response); - if (message) { - setError(message); - } else { - setDefaultError(); - } - stop(); - }, - server, - voice, - }); - - const handleCloseError = useCallback(() => { - setError(undefined); + const { isGlobalLoading, audio, stop, start, response, setText } = useTTS(PREVIEW_TEXT, { + onError: (err) => { stop(); - }, [stop]); - - const handleRetry = useCallback(() => { - setError(undefined); + setDefaultError(err); + }, + onErrorRetry: (err) => { stop(); - start(); - }, [stop, start]); - - const handleSelect: SelectProps['onSelect'] = (value, option) => { + setDefaultError(err); + }, + onSuccess: async () => { + if (!response) return; + if (response.status === 200) return; + const message = await getMessageError(response); + if (message) { + setError(message); + } else { + setDefaultError(); + } stop(); - setVoice(value as string); - setText([PREVIEW_TEXT, option?.label].join(' - ')); - onSelect?.(value, option); - }; - return ( - - - + + + {error && ( + + {t('retry', { ns: 'common' })} + + } + extra={ + error.body && ( + + {JSON.stringify(error.body, null, 2)} + + ) + } + onClose={handleCloseError} + /> + )} + + ); +}; export default SelectWithTTSPreview; diff --git a/src/features/AgentSetting/AgentTTS/index.tsx b/src/features/AgentSetting/AgentTTS/index.tsx index 0d0184df1b..7a13e869b6 100644 --- a/src/features/AgentSetting/AgentTTS/index.tsx +++ b/src/features/AgentSetting/AgentTTS/index.tsx @@ -1,8 +1,8 @@ 'use client'; import { VoiceList } from '@lobehub/tts'; -import type {FormGroupItemType} from '@lobehub/ui'; -import { Form, Select } from '@lobehub/ui'; +import { type FormGroupItemType } from '@lobehub/ui'; +import { Form, Select } from '@lobehub/ui'; import { Switch } from 'antd'; import isEqual from 'fast-deep-equal'; import { Mic } from 'lucide-react'; diff --git a/src/features/AgentSetting/AgentTTS/options.tsx b/src/features/AgentSetting/AgentTTS/options.tsx index 806d07bf44..816c7d5bb8 100644 --- a/src/features/AgentSetting/AgentTTS/options.tsx +++ b/src/features/AgentSetting/AgentTTS/options.tsx @@ -1,5 +1,5 @@ import { Azure, OpenAI } from '@lobehub/icons'; -import type { SelectProps } from '@lobehub/ui'; +import { type SelectProps } from '@lobehub/ui'; import { LabelRenderer } from '@/components/ModelSelect'; diff --git a/src/features/AgentSetting/StoreUpdater.tsx b/src/features/AgentSetting/StoreUpdater.tsx index 156b755912..6a0658c1e6 100644 --- a/src/features/AgentSetting/StoreUpdater.tsx +++ b/src/features/AgentSetting/StoreUpdater.tsx @@ -1,13 +1,13 @@ 'use client'; -import type {ForwardedRef} from 'react'; -import { memo, useImperativeHandle } from 'react'; +import { type ForwardedRef } from 'react'; +import { memo, useImperativeHandle } from 'react'; import { createStoreUpdater } from 'zustand-utils'; -import type {AgentSettingsInstance} from './hooks/useAgentSettings'; -import { useAgentSettings } from './hooks/useAgentSettings'; -import type {State} from './store'; -import { useStoreApi } from './store'; +import { type AgentSettingsInstance } from './hooks/useAgentSettings'; +import { useAgentSettings } from './hooks/useAgentSettings'; +import { type State } from './store'; +import { useStoreApi } from './store'; export interface StoreUpdaterProps extends Partial< Pick diff --git a/src/features/AgentSetting/hooks/useAgentSettings.ts b/src/features/AgentSetting/hooks/useAgentSettings.ts index fa0d607e8f..c103dfe26a 100644 --- a/src/features/AgentSetting/hooks/useAgentSettings.ts +++ b/src/features/AgentSetting/hooks/useAgentSettings.ts @@ -1,7 +1,7 @@ import { useMemo } from 'react'; import { useStoreApi } from '../store'; -import type {PublicAction} from '../store/action'; +import { type PublicAction } from '../store/action'; export type AgentSettingsInstance = PublicAction; diff --git a/src/features/AgentSetting/store/action.ts b/src/features/AgentSetting/store/action.ts index 35ee0c5698..9af81bbea9 100644 --- a/src/features/AgentSetting/store/action.ts +++ b/src/features/AgentSetting/store/action.ts @@ -1,32 +1,32 @@ -import type {MessageTextChunk} from '@lobechat/fetch-sse'; +import { type MessageTextChunk } from '@lobechat/fetch-sse'; import { chainPickEmoji, chainSummaryAgentName, chainSummaryDescription, chainSummaryTags, } from '@lobechat/prompts'; -import type {TracePayload} from '@lobechat/types'; -import { TraceNameMap, TraceTopicType } from '@lobechat/types'; +import { type TracePayload } from '@lobechat/types'; +import { TraceNameMap, TraceTopicType } from '@lobechat/types'; import { getSingletonAnalyticsOptional } from '@lobehub/analytics'; -import type { PartialDeep } from 'type-fest'; -import type {StateCreator} from 'zustand/vanilla'; +import { type PartialDeep } from 'type-fest'; +import { type StateCreator } from 'zustand/vanilla'; import { chatService } from '@/services/chat'; import { globalHelpers } from '@/store/global/helpers'; import { useUserStore } from '@/store/user'; import { systemAgentSelectors } from '@/store/user/slices/settings/selectors'; -import type {LobeAgentChatConfig, LobeAgentConfig} from '@/types/agent'; -import type {MetaData} from '@/types/meta'; -import type {SystemAgentItem} from '@/types/user/settings'; +import { type LobeAgentChatConfig, type LobeAgentConfig } from '@/types/agent'; +import { type MetaData } from '@/types/meta'; +import { type SystemAgentItem } from '@/types/user/settings'; import { merge } from '@/utils/merge'; import { setNamespace } from '@/utils/storeDebug'; -import type {LoadingState, SaveStatus,State} from '../store/initialState'; -import { initialState } from './initialState'; -import type {ConfigDispatch} from './reducers/config'; -import { configReducer } from './reducers/config'; -import type {MetaDataDispatch} from './reducers/meta'; -import { metaDataReducer } from './reducers/meta'; +import { type LoadingState, type SaveStatus, type State } from '../store/initialState'; +import { initialState } from './initialState'; +import { type ConfigDispatch } from './reducers/config'; +import { configReducer } from './reducers/config'; +import { type MetaDataDispatch } from './reducers/meta'; +import { metaDataReducer } from './reducers/meta'; export interface PublicAction { /** diff --git a/src/features/AgentSetting/store/index.ts b/src/features/AgentSetting/store/index.ts index 3ddde8ba1f..c577e4ebb5 100644 --- a/src/features/AgentSetting/store/index.ts +++ b/src/features/AgentSetting/store/index.ts @@ -1,13 +1,13 @@ 'use client'; -import type {StoreApiWithSelector} from '@lobechat/types'; +import { type StoreApiWithSelector } from '@lobechat/types'; import { subscribeWithSelector } from 'zustand/middleware'; import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; import { createContext } from 'zustand-utils'; -import type {Store} from './action'; -import { store } from './action'; +import { type Store } from './action'; +import { store } from './action'; export type { State } from './initialState'; diff --git a/src/features/AgentSetting/store/initialState.ts b/src/features/AgentSetting/store/initialState.ts index f9e48b8c85..3900a32d0e 100644 --- a/src/features/AgentSetting/store/initialState.ts +++ b/src/features/AgentSetting/store/initialState.ts @@ -1,7 +1,7 @@ import { DEFAULT_AGENT_META } from '@/const/meta'; import { DEFAULT_AGENT_CONFIG } from '@/const/settings'; -import type {LobeAgentConfig} from '@/types/agent'; -import type {MetaData} from '@/types/meta'; +import { type LobeAgentConfig } from '@/types/agent'; +import { type MetaData } from '@/types/meta'; export type LoadingState = Record | string, boolean>; export type SaveStatus = 'idle' | 'saving' | 'saved'; diff --git a/src/features/AgentSetting/store/reducers/config.ts b/src/features/AgentSetting/store/reducers/config.ts index 9aa3f71c92..d60057d7a0 100644 --- a/src/features/AgentSetting/store/reducers/config.ts +++ b/src/features/AgentSetting/store/reducers/config.ts @@ -1,7 +1,7 @@ import { produce } from 'immer'; import { DEFAULT_AGENT_CONFIG } from '@/const/settings'; -import type {LobeAgentConfig} from '@/types/agent'; +import { type LobeAgentConfig } from '@/types/agent'; import { merge } from '@/utils/merge'; export type ConfigDispatch = diff --git a/src/features/AgentSetting/store/reducers/meta.ts b/src/features/AgentSetting/store/reducers/meta.ts index 96ebd7bb69..72e73ca2e6 100644 --- a/src/features/AgentSetting/store/reducers/meta.ts +++ b/src/features/AgentSetting/store/reducers/meta.ts @@ -1,7 +1,7 @@ import { produce } from 'immer'; import { DEFAULT_AGENT_META } from '@/const/meta'; -import type {MetaData} from '@/types/meta'; +import { type MetaData } from '@/types/meta'; import { merge } from '@/utils/merge'; export type MetaDataDispatch = { type: 'update'; value: Partial } | { type: 'reset' }; diff --git a/src/features/AgentSetting/store/selectors.ts b/src/features/AgentSetting/store/selectors.ts index d6332ab9c1..1d55264f6b 100644 --- a/src/features/AgentSetting/store/selectors.ts +++ b/src/features/AgentSetting/store/selectors.ts @@ -4,10 +4,10 @@ import { DEFAULT_AGENT_CONFIG, DEFAUTT_AGENT_TTS_CONFIG, } from '@/const/settings'; -import type {LobeAgentChatConfig} from '@/types/agent'; +import { type LobeAgentChatConfig } from '@/types/agent'; import { merge } from '@/utils/merge'; -import type {Store} from './action'; +import { type Store } from './action'; const chatConfig = (s: Store): LobeAgentChatConfig => s.config.chatConfig || DEFAULT_AGENT_CHAT_CONFIG; diff --git a/src/features/AuthCard/index.tsx b/src/features/AuthCard/index.tsx index c6130b4a9b..19ca1ec1db 100644 --- a/src/features/AuthCard/index.tsx +++ b/src/features/AuthCard/index.tsx @@ -1,8 +1,8 @@ 'use client'; -import type {FlexboxProps} from '@lobehub/ui'; -import { Flexbox, Text } from '@lobehub/ui'; -import type {ReactNode} from 'react'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Flexbox, Text } from '@lobehub/ui'; +import { type ReactNode } from 'react'; import { memo } from 'react'; export interface AuthCardProps extends Omit { diff --git a/src/features/AvatarWithUpload/index.tsx b/src/features/AvatarWithUpload/index.tsx index 0137524ad4..0ccf93f6a3 100644 --- a/src/features/AvatarWithUpload/index.tsx +++ b/src/features/AvatarWithUpload/index.tsx @@ -9,7 +9,7 @@ import { useUserStore } from '@/store/user'; import { imageToBase64 } from '@/utils/imageToBase64'; import { createUploadImageHandler } from '@/utils/uploadFIle'; -import type {UserAvatarProps} from '../User/UserAvatar'; +import { type UserAvatarProps } from '../User/UserAvatar'; import UserAvatar from '../User/UserAvatar'; interface AvatarWithUploadProps extends UserAvatarProps { diff --git a/src/features/ChatInput/ActionBar/History/Controls.tsx b/src/features/ChatInput/ActionBar/History/Controls.tsx index af16eb24eb..c75ad13177 100644 --- a/src/features/ChatInput/ActionBar/History/Controls.tsx +++ b/src/features/ChatInput/ActionBar/History/Controls.tsx @@ -1,5 +1,5 @@ -import type {FormItemProps} from '@lobehub/ui'; -import { Form, SliderWithInput } from '@lobehub/ui'; +import { type FormItemProps } from '@lobehub/ui'; +import { Form, SliderWithInput } from '@lobehub/ui'; import { Form as AntdForm, Switch } from 'antd'; import { debounce } from 'es-toolkit/compat'; import { memo, useEffect } from 'react'; diff --git a/src/features/ChatInput/ActionBar/Knowledge/useControls.tsx b/src/features/ChatInput/ActionBar/Knowledge/useControls.tsx index 5829b28d3e..4701acf258 100644 --- a/src/features/ChatInput/ActionBar/Knowledge/useControls.tsx +++ b/src/features/ChatInput/ActionBar/Knowledge/useControls.tsx @@ -1,5 +1,5 @@ -import type {ItemType} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type ItemType } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; import { ArrowRight, LibraryBig } from 'lucide-react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/ChatInput/ActionBar/Mention/index.tsx b/src/features/ChatInput/ActionBar/Mention/index.tsx index 15fd8b3d1b..37ea68355b 100644 --- a/src/features/ChatInput/ActionBar/Mention/index.tsx +++ b/src/features/ChatInput/ActionBar/Mention/index.tsx @@ -1,5 +1,5 @@ -import type {ItemType} from '@lobehub/ui'; -import { Avatar } from '@lobehub/ui'; +import { type ItemType } from '@lobehub/ui'; +import { Avatar } from '@lobehub/ui'; import { AtSign } from 'lucide-react'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next'; import { useMentionStore } from '@/store/mention'; import { useSessionStore } from '@/store/session'; import { sessionSelectors } from '@/store/session/selectors'; -import type { LobeGroupSession } from '@/types/session'; +import { type LobeGroupSession } from '@/types/session'; import Action from '../components/Action'; diff --git a/src/features/ChatInput/ActionBar/Model/ControlsForm.tsx b/src/features/ChatInput/ActionBar/Model/ControlsForm.tsx index 62485b9fed..a2fd77bbb6 100644 --- a/src/features/ChatInput/ActionBar/Model/ControlsForm.tsx +++ b/src/features/ChatInput/ActionBar/Model/ControlsForm.tsx @@ -1,4 +1,4 @@ -import type { FormItemProps } from '@lobehub/ui'; +import { type FormItemProps } from '@lobehub/ui'; import { Form } from '@lobehub/ui'; import { Form as AntdForm, Grid, Switch } from 'antd'; import isEqual from 'fast-deep-equal'; diff --git a/src/features/ChatInput/ActionBar/Model/GPT51ReasoningEffortSlider.tsx b/src/features/ChatInput/ActionBar/Model/GPT51ReasoningEffortSlider.tsx index 487d6749fd..c513c5dc0f 100644 --- a/src/features/ChatInput/ActionBar/Model/GPT51ReasoningEffortSlider.tsx +++ b/src/features/ChatInput/ActionBar/Model/GPT51ReasoningEffortSlider.tsx @@ -1,5 +1,5 @@ -import type {CreatedLevelSliderProps} from './createLevelSlider'; -import { createLevelSliderComponent } from './createLevelSlider'; +import { type CreatedLevelSliderProps } from './createLevelSlider'; +import { createLevelSliderComponent } from './createLevelSlider'; const GPT51_REASONING_EFFORT_LEVELS = ['none', 'low', 'medium', 'high'] as const; type GPT51ReasoningEffort = (typeof GPT51_REASONING_EFFORT_LEVELS)[number]; diff --git a/src/features/ChatInput/ActionBar/Model/GPT52ProReasoningEffortSlider.tsx b/src/features/ChatInput/ActionBar/Model/GPT52ProReasoningEffortSlider.tsx index a63da90914..f844e088ab 100644 --- a/src/features/ChatInput/ActionBar/Model/GPT52ProReasoningEffortSlider.tsx +++ b/src/features/ChatInput/ActionBar/Model/GPT52ProReasoningEffortSlider.tsx @@ -1,5 +1,5 @@ -import type {CreatedLevelSliderProps} from './createLevelSlider'; -import { createLevelSliderComponent } from './createLevelSlider'; +import { type CreatedLevelSliderProps } from './createLevelSlider'; +import { createLevelSliderComponent } from './createLevelSlider'; const GPT52_PRO_REASONING_EFFORT_LEVELS = ['medium', 'high', 'xhigh'] as const; type GPT52ProReasoningEffort = (typeof GPT52_PRO_REASONING_EFFORT_LEVELS)[number]; diff --git a/src/features/ChatInput/ActionBar/Model/GPT52ReasoningEffortSlider.tsx b/src/features/ChatInput/ActionBar/Model/GPT52ReasoningEffortSlider.tsx index 6da7b6b33c..5cdd68ae7b 100644 --- a/src/features/ChatInput/ActionBar/Model/GPT52ReasoningEffortSlider.tsx +++ b/src/features/ChatInput/ActionBar/Model/GPT52ReasoningEffortSlider.tsx @@ -1,5 +1,5 @@ -import type {CreatedLevelSliderProps} from './createLevelSlider'; -import { createLevelSliderComponent } from './createLevelSlider'; +import { type CreatedLevelSliderProps } from './createLevelSlider'; +import { createLevelSliderComponent } from './createLevelSlider'; const GPT52_REASONING_EFFORT_LEVELS = ['none', 'low', 'medium', 'high', 'xhigh'] as const; type GPT52ReasoningEffort = (typeof GPT52_REASONING_EFFORT_LEVELS)[number]; diff --git a/src/features/ChatInput/ActionBar/Model/GPT5ReasoningEffortSlider.tsx b/src/features/ChatInput/ActionBar/Model/GPT5ReasoningEffortSlider.tsx index 262f707c6c..dd434785cb 100644 --- a/src/features/ChatInput/ActionBar/Model/GPT5ReasoningEffortSlider.tsx +++ b/src/features/ChatInput/ActionBar/Model/GPT5ReasoningEffortSlider.tsx @@ -1,5 +1,5 @@ -import type {CreatedLevelSliderProps} from './createLevelSlider'; -import { createLevelSliderComponent } from './createLevelSlider'; +import { type CreatedLevelSliderProps } from './createLevelSlider'; +import { createLevelSliderComponent } from './createLevelSlider'; const GPT5_REASONING_EFFORT_LEVELS = ['minimal', 'low', 'medium', 'high'] as const; type GPT5ReasoningEffort = (typeof GPT5_REASONING_EFFORT_LEVELS)[number]; diff --git a/src/features/ChatInput/ActionBar/Model/ImageResolutionSlider.tsx b/src/features/ChatInput/ActionBar/Model/ImageResolutionSlider.tsx index d9be2f2e32..4bd1e9e5ea 100644 --- a/src/features/ChatInput/ActionBar/Model/ImageResolutionSlider.tsx +++ b/src/features/ChatInput/ActionBar/Model/ImageResolutionSlider.tsx @@ -1,5 +1,5 @@ -import type {CreatedLevelSliderProps} from './createLevelSlider'; -import { createLevelSliderComponent } from './createLevelSlider'; +import { type CreatedLevelSliderProps } from './createLevelSlider'; +import { createLevelSliderComponent } from './createLevelSlider'; const IMAGE_RESOLUTIONS = ['1K', '2K', '4K'] as const; type ImageResolution = (typeof IMAGE_RESOLUTIONS)[number]; diff --git a/src/features/ChatInput/ActionBar/Model/LevelSlider.tsx b/src/features/ChatInput/ActionBar/Model/LevelSlider.tsx index 3b505cbabd..e95deb4b9e 100644 --- a/src/features/ChatInput/ActionBar/Model/LevelSlider.tsx +++ b/src/features/ChatInput/ActionBar/Model/LevelSlider.tsx @@ -1,8 +1,8 @@ import { Flexbox } from '@lobehub/ui'; import { Slider } from 'antd'; -import type {SliderSingleProps} from 'antd/es/slider'; -import type {CSSProperties} from 'react'; -import { memo, useMemo } from 'react'; +import { type SliderSingleProps } from 'antd/es/slider'; +import { type CSSProperties } from 'react'; +import { memo, useMemo } from 'react'; import useMergeState from 'use-merge-value'; export interface LevelSliderProps { diff --git a/src/features/ChatInput/ActionBar/Model/ReasoningEffortSlider.tsx b/src/features/ChatInput/ActionBar/Model/ReasoningEffortSlider.tsx index 1da7c3d13d..3b0ec93b58 100644 --- a/src/features/ChatInput/ActionBar/Model/ReasoningEffortSlider.tsx +++ b/src/features/ChatInput/ActionBar/Model/ReasoningEffortSlider.tsx @@ -1,5 +1,5 @@ -import type {CreatedLevelSliderProps} from './createLevelSlider'; -import { createLevelSliderComponent } from './createLevelSlider'; +import { type CreatedLevelSliderProps } from './createLevelSlider'; +import { createLevelSliderComponent } from './createLevelSlider'; const REASONING_EFFORT_LEVELS = ['low', 'medium', 'high'] as const; type ReasoningEffort = (typeof REASONING_EFFORT_LEVELS)[number]; diff --git a/src/features/ChatInput/ActionBar/Model/TextVerbositySlider.tsx b/src/features/ChatInput/ActionBar/Model/TextVerbositySlider.tsx index 65c4f7a954..3ef84458ee 100644 --- a/src/features/ChatInput/ActionBar/Model/TextVerbositySlider.tsx +++ b/src/features/ChatInput/ActionBar/Model/TextVerbositySlider.tsx @@ -1,5 +1,5 @@ -import type {CreatedLevelSliderProps} from './createLevelSlider'; -import { createLevelSliderComponent } from './createLevelSlider'; +import { type CreatedLevelSliderProps } from './createLevelSlider'; +import { createLevelSliderComponent } from './createLevelSlider'; const TEXT_VERBOSITY_LEVELS = ['low', 'medium', 'high'] as const; type TextVerbosity = (typeof TEXT_VERBOSITY_LEVELS)[number]; diff --git a/src/features/ChatInput/ActionBar/Model/ThinkingLevel2Slider.tsx b/src/features/ChatInput/ActionBar/Model/ThinkingLevel2Slider.tsx index 72adf29e1e..89e75b33e0 100644 --- a/src/features/ChatInput/ActionBar/Model/ThinkingLevel2Slider.tsx +++ b/src/features/ChatInput/ActionBar/Model/ThinkingLevel2Slider.tsx @@ -1,5 +1,5 @@ -import type {CreatedLevelSliderProps} from './createLevelSlider'; -import { createLevelSliderComponent } from './createLevelSlider'; +import { type CreatedLevelSliderProps } from './createLevelSlider'; +import { createLevelSliderComponent } from './createLevelSlider'; const THINKING_LEVELS_2 = ['low', 'high'] as const; type ThinkingLevel2 = (typeof THINKING_LEVELS_2)[number]; diff --git a/src/features/ChatInput/ActionBar/Model/ThinkingLevelSlider.tsx b/src/features/ChatInput/ActionBar/Model/ThinkingLevelSlider.tsx index ca4790fff3..819d0e949f 100644 --- a/src/features/ChatInput/ActionBar/Model/ThinkingLevelSlider.tsx +++ b/src/features/ChatInput/ActionBar/Model/ThinkingLevelSlider.tsx @@ -1,5 +1,5 @@ -import type {CreatedLevelSliderProps} from './createLevelSlider'; -import { createLevelSliderComponent } from './createLevelSlider'; +import { type CreatedLevelSliderProps } from './createLevelSlider'; +import { createLevelSliderComponent } from './createLevelSlider'; const THINKING_LEVELS = ['minimal', 'low', 'medium', 'high'] as const; type ThinkingLevel = (typeof THINKING_LEVELS)[number]; diff --git a/src/features/ChatInput/ActionBar/Model/ThinkingSlider.tsx b/src/features/ChatInput/ActionBar/Model/ThinkingSlider.tsx index d14b2edf3f..8f1f5d55cd 100644 --- a/src/features/ChatInput/ActionBar/Model/ThinkingSlider.tsx +++ b/src/features/ChatInput/ActionBar/Model/ThinkingSlider.tsx @@ -1,5 +1,5 @@ -import type {CreatedLevelSliderProps} from './createLevelSlider'; -import { createLevelSliderComponent } from './createLevelSlider'; +import { type CreatedLevelSliderProps } from './createLevelSlider'; +import { createLevelSliderComponent } from './createLevelSlider'; const THINKING_MODES = ['disabled', 'auto', 'enabled'] as const; type ThinkingMode = (typeof THINKING_MODES)[number]; diff --git a/src/features/ChatInput/ActionBar/Model/createLevelSlider.tsx b/src/features/ChatInput/ActionBar/Model/createLevelSlider.tsx index b9917ad815..143806d7a5 100644 --- a/src/features/ChatInput/ActionBar/Model/createLevelSlider.tsx +++ b/src/features/ChatInput/ActionBar/Model/createLevelSlider.tsx @@ -1,9 +1,9 @@ 'use client'; -import type {LobeAgentChatConfig} from '@lobechat/types'; -import type {SliderSingleProps} from 'antd/es/slider'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type LobeAgentChatConfig } from '@lobechat/types'; +import { type SliderSingleProps } from 'antd/es/slider'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; import { useAgentStore } from '@/store/agent'; import { chatConfigByIdSelectors } from '@/store/agent/selectors'; diff --git a/src/features/ChatInput/ActionBar/Params/Controls.tsx b/src/features/ChatInput/ActionBar/Params/Controls.tsx index 270bca84c9..2a4860e85f 100644 --- a/src/features/ChatInput/ActionBar/Params/Controls.tsx +++ b/src/features/ChatInput/ActionBar/Params/Controls.tsx @@ -1,10 +1,10 @@ -import type {FormItemProps} from '@lobehub/ui'; -import { Checkbox, Flexbox,Form, SliderWithInput, Tag } from '@lobehub/ui'; +import { type FormItemProps } from '@lobehub/ui'; +import { Checkbox, Flexbox, Form, SliderWithInput, Tag } from '@lobehub/ui'; import { Form as AntdForm, Switch } from 'antd'; import { createStaticStyles } from 'antd-style'; import { debounce } from 'es-toolkit/compat'; import isEqual from 'fast-deep-equal'; -import type { ComponentType } from 'react'; +import { type ComponentType } from 'react'; import { memo, useCallback, useEffect, useRef } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/ChatInput/ActionBar/STT/browser.tsx b/src/features/ChatInput/ActionBar/STT/browser.tsx index 9476228a82..d920a0d52e 100644 --- a/src/features/ChatInput/ActionBar/STT/browser.tsx +++ b/src/features/ChatInput/ActionBar/STT/browser.tsx @@ -1,11 +1,11 @@ import { getMessageError } from '@lobechat/fetch-sse'; -import type {ChatMessageError} from '@lobechat/types'; -import type {SpeechRecognitionOptions} from '@lobehub/tts/react'; -import { useSpeechRecognition } from '@lobehub/tts/react'; +import { type ChatMessageError } from '@lobechat/types'; +import { type SpeechRecognitionOptions } from '@lobehub/tts/react'; +import { useSpeechRecognition } from '@lobehub/tts/react'; import isEqual from 'fast-deep-equal'; import { memo, useCallback, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import type {SWRConfiguration} from 'swr'; +import { type SWRConfiguration } from 'swr'; import { useAgentStore } from '@/store/agent'; import { agentByIdSelectors } from '@/store/agent/selectors'; diff --git a/src/features/ChatInput/ActionBar/STT/common.tsx b/src/features/ChatInput/ActionBar/STT/common.tsx index e2079ae225..ab34475215 100644 --- a/src/features/ChatInput/ActionBar/STT/common.tsx +++ b/src/features/ChatInput/ActionBar/STT/common.tsx @@ -1,4 +1,4 @@ -import type {ChatMessageError} from '@lobechat/types'; +import { type ChatMessageError } from '@lobechat/types'; import { Alert, Button, Flexbox, Highlighter } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; import { Mic, MicOff } from 'lucide-react'; diff --git a/src/features/ChatInput/ActionBar/STT/openai.tsx b/src/features/ChatInput/ActionBar/STT/openai.tsx index 4449429533..046daba1c2 100644 --- a/src/features/ChatInput/ActionBar/STT/openai.tsx +++ b/src/features/ChatInput/ActionBar/STT/openai.tsx @@ -1,12 +1,12 @@ import { getMessageError } from '@lobechat/fetch-sse'; -import type {ChatMessageError} from '@lobechat/types'; +import { type ChatMessageError } from '@lobechat/types'; import { getRecordMineType } from '@lobehub/tts'; -import type {OpenAISTTOptions} from '@lobehub/tts/react'; -import { useOpenAISTT } from '@lobehub/tts/react'; +import { type OpenAISTTOptions } from '@lobehub/tts/react'; +import { useOpenAISTT } from '@lobehub/tts/react'; import isEqual from 'fast-deep-equal'; import { memo, useCallback, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import type {SWRConfiguration} from 'swr'; +import { type SWRConfiguration } from 'swr'; import { createHeaderWithOpenAI } from '@/services/_header'; import { API_ENDPOINTS } from '@/services/_url'; diff --git a/src/features/ChatInput/ActionBar/Search/Controls.tsx b/src/features/ChatInput/ActionBar/Search/Controls.tsx index ce7fa9e89e..bf9e69de85 100644 --- a/src/features/ChatInput/ActionBar/Search/Controls.tsx +++ b/src/features/ChatInput/ActionBar/Search/Controls.tsx @@ -2,15 +2,15 @@ import { Center, Flexbox, Icon } from '@lobehub/ui'; import { GlobeOffIcon } from '@lobehub/ui/icons'; import { Divider } from 'antd'; import { createStaticStyles, cssVar, cx } from 'antd-style'; -import type {LucideIcon} from 'lucide-react'; -import { SparkleIcon } from 'lucide-react'; +import { type LucideIcon } from 'lucide-react'; +import { SparkleIcon } from 'lucide-react'; import { memo, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import { useAgentStore } from '@/store/agent'; import { agentByIdSelectors, chatConfigByIdSelectors } from '@/store/agent/selectors'; import { aiModelSelectors, aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra'; -import type {SearchMode} from '@/types/search'; +import { type SearchMode } from '@/types/search'; import { useAgentId } from '../../hooks/useAgentId'; import { useUpdateAgentConfig } from '../../hooks/useUpdateAgentConfig'; diff --git a/src/features/ChatInput/ActionBar/Search/FunctionCallingModelSelect/index.tsx b/src/features/ChatInput/ActionBar/Search/FunctionCallingModelSelect/index.tsx index da77e1aa16..6d8a600fca 100644 --- a/src/features/ChatInput/ActionBar/Search/FunctionCallingModelSelect/index.tsx +++ b/src/features/ChatInput/ActionBar/Search/FunctionCallingModelSelect/index.tsx @@ -1,13 +1,13 @@ -import type {LobeSelectProps} from '@lobehub/ui'; -import { LobeSelect, TooltipGroup } from '@lobehub/ui'; +import { type LobeSelectProps } from '@lobehub/ui'; +import { LobeSelect, TooltipGroup } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; -import type {ReactNode} from 'react'; -import { memo, useMemo } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useMemo } from 'react'; import { ModelItemRender, ProviderItemRender } from '@/components/ModelSelect'; import { useEnabledChatModels } from '@/hooks/useEnabledChatModels'; -import type {WorkingModel} from '@/types/agent'; -import type {EnabledProviderWithModels} from '@/types/aiProvider'; +import { type WorkingModel } from '@/types/agent'; +import { type EnabledProviderWithModels } from '@/types/aiProvider'; const prefixCls = 'ant'; diff --git a/src/features/ChatInput/ActionBar/Token/index.tsx b/src/features/ChatInput/ActionBar/Token/index.tsx index 5e4fe1aa0c..cf91475316 100644 --- a/src/features/ChatInput/ActionBar/Token/index.tsx +++ b/src/features/ChatInput/ActionBar/Token/index.tsx @@ -1,4 +1,4 @@ -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { memo } from 'react'; import { useModelHasContextWindowToken } from '@/hooks/useModelHasContextWindowToken'; diff --git a/src/features/ChatInput/ActionBar/Tools/KlavisServerItem.tsx b/src/features/ChatInput/ActionBar/Tools/KlavisServerItem.tsx index 3a1cf7841b..1041ea9670 100644 --- a/src/features/ChatInput/ActionBar/Tools/KlavisServerItem.tsx +++ b/src/features/ChatInput/ActionBar/Tools/KlavisServerItem.tsx @@ -6,8 +6,8 @@ import { useTranslation } from 'react-i18next'; import { useAgentStore } from '@/store/agent'; import { agentSelectors } from '@/store/agent/selectors'; import { useToolStore } from '@/store/tool'; -import type {KlavisServer} from '@/store/tool/slices/klavisStore'; -import { KlavisServerStatus } from '@/store/tool/slices/klavisStore'; +import { type KlavisServer } from '@/store/tool/slices/klavisStore'; +import { KlavisServerStatus } from '@/store/tool/slices/klavisStore'; import { useUserStore } from '@/store/user'; import { userProfileSelectors } from '@/store/user/selectors'; diff --git a/src/features/ChatInput/ActionBar/Tools/KlavisSkillIcon.tsx b/src/features/ChatInput/ActionBar/Tools/KlavisSkillIcon.tsx index 58a067ed90..5e38a10109 100644 --- a/src/features/ChatInput/ActionBar/Tools/KlavisSkillIcon.tsx +++ b/src/features/ChatInput/ActionBar/Tools/KlavisSkillIcon.tsx @@ -1,4 +1,4 @@ -import type {KlavisServerType} from '@lobechat/const'; +import { type KlavisServerType } from '@lobechat/const'; import { Icon } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { memo } from 'react'; diff --git a/src/features/ChatInput/ActionBar/Tools/LobehubSkillIcon.tsx b/src/features/ChatInput/ActionBar/Tools/LobehubSkillIcon.tsx index 58545324cb..758bddb6ca 100644 --- a/src/features/ChatInput/ActionBar/Tools/LobehubSkillIcon.tsx +++ b/src/features/ChatInput/ActionBar/Tools/LobehubSkillIcon.tsx @@ -1,4 +1,4 @@ -import type {LobehubSkillProviderType} from '@lobechat/const'; +import { type LobehubSkillProviderType } from '@lobechat/const'; import { Icon } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { memo } from 'react'; diff --git a/src/features/ChatInput/ActionBar/Tools/PopoverContent.tsx b/src/features/ChatInput/ActionBar/Tools/PopoverContent.tsx index 3679c77aa6..2bafc32912 100644 --- a/src/features/ChatInput/ActionBar/Tools/PopoverContent.tsx +++ b/src/features/ChatInput/ActionBar/Tools/PopoverContent.tsx @@ -1,5 +1,5 @@ -import type {ItemType} from '@lobehub/ui'; -import { Flexbox, Icon, usePopoverContext } from '@lobehub/ui'; +import { type ItemType } from '@lobehub/ui'; +import { Flexbox, Icon, usePopoverContext } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; import { ChevronRight, ExternalLink, Settings, Store } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/features/ChatInput/ActionBar/Tools/ToolItem.tsx b/src/features/ChatInput/ActionBar/Tools/ToolItem.tsx index f52246d641..dec98e3cc6 100644 --- a/src/features/ChatInput/ActionBar/Tools/ToolItem.tsx +++ b/src/features/ChatInput/ActionBar/Tools/ToolItem.tsx @@ -1,12 +1,12 @@ import { Flexbox } from '@lobehub/ui'; -import { memo,Suspense } from 'react'; +import { memo, Suspense } from 'react'; import DebugNode from '@/components/DebugNode'; import PluginTag from '@/components/Plugins/PluginTag'; import { useToolStore } from '@/store/tool'; import { customPluginSelectors } from '@/store/tool/selectors'; -import type {CheckboxItemProps} from '../components/CheckboxWithLoading'; +import { type CheckboxItemProps } from '../components/CheckboxWithLoading'; import CheckboxItem from '../components/CheckboxWithLoading'; const ToolItem = memo(({ id, onUpdate, label, checked }) => { diff --git a/src/features/ChatInput/ActionBar/Tools/ToolsList.tsx b/src/features/ChatInput/ActionBar/Tools/ToolsList.tsx index 9a487f2945..95776174ac 100644 --- a/src/features/ChatInput/ActionBar/Tools/ToolsList.tsx +++ b/src/features/ChatInput/ActionBar/Tools/ToolsList.tsx @@ -1,8 +1,8 @@ -import type {ItemType} from '@lobehub/ui'; -import { Flexbox, Icon, Text } from '@lobehub/ui'; +import { type ItemType } from '@lobehub/ui'; +import { Flexbox, Icon, Text } from '@lobehub/ui'; import { Divider } from 'antd'; import { createStaticStyles, cssVar } from 'antd-style'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { Fragment, isValidElement, memo } from 'react'; export const toolsListStyles = createStaticStyles(({ css }) => ({ diff --git a/src/features/ChatInput/ActionBar/Tools/useControls.tsx b/src/features/ChatInput/ActionBar/Tools/useControls.tsx index f0d38e16a4..14980796e2 100644 --- a/src/features/ChatInput/ActionBar/Tools/useControls.tsx +++ b/src/features/ChatInput/ActionBar/Tools/useControls.tsx @@ -4,7 +4,7 @@ import { RECOMMENDED_SKILLS, RecommendedSkillType, } from '@lobechat/const'; -import type { ItemType } from '@lobehub/ui'; +import { type ItemType } from '@lobehub/ui'; import { Avatar, Icon } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; import { ToyBrick } from 'lucide-react'; diff --git a/src/features/ChatInput/ActionBar/Upload/ServerMode.tsx b/src/features/ChatInput/ActionBar/Upload/ServerMode.tsx index e30c531a1c..491fc87e57 100644 --- a/src/features/ChatInput/ActionBar/Upload/ServerMode.tsx +++ b/src/features/ChatInput/ActionBar/Upload/ServerMode.tsx @@ -1,6 +1,6 @@ import { validateVideoFileSize } from '@lobechat/utils/client'; -import type {ItemType} from '@lobehub/ui'; -import { Icon, Tooltip } from '@lobehub/ui'; +import { type ItemType } from '@lobehub/ui'; +import { Icon, Tooltip } from '@lobehub/ui'; import { Upload } from 'antd'; import { css, cx } from 'antd-style'; import isEqual from 'fast-deep-equal'; @@ -22,7 +22,7 @@ import { preferenceSelectors } from '@/store/user/selectors'; import { useAgentId } from '../../hooks/useAgentId'; import Action from '../components/Action'; -import type { ActionDropdownMenuItems } from '../components/ActionDropdown'; +import { type ActionDropdownMenuItems } from '../components/ActionDropdown'; import CheckboxItem from '../components/CheckboxWithLoading'; const hotArea = css` diff --git a/src/features/ChatInput/ActionBar/components/Action.tsx b/src/features/ChatInput/ActionBar/components/Action.tsx index cf99b67814..854beaeed1 100644 --- a/src/features/ChatInput/ActionBar/components/Action.tsx +++ b/src/features/ChatInput/ActionBar/components/Action.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {ActionIconProps, PopoverTrigger} from '@lobehub/ui'; -import { ActionIcon } from '@lobehub/ui'; +import { type ActionIconProps, type PopoverTrigger } from '@lobehub/ui'; +import { ActionIcon } from '@lobehub/ui'; import { isUndefined } from 'es-toolkit/compat'; import { memo } from 'react'; import useMergeState from 'use-merge-value'; @@ -9,9 +9,9 @@ import useMergeState from 'use-merge-value'; import { useServerConfigStore } from '@/store/serverConfig'; import { useActionBarContext } from '../context'; -import type {ActionDropdownProps} from './ActionDropdown'; +import { type ActionDropdownProps } from './ActionDropdown'; import ActionDropdown from './ActionDropdown'; -import type {ActionPopoverProps} from './ActionPopover'; +import { type ActionPopoverProps } from './ActionPopover'; import ActionPopover from './ActionPopover'; interface ActionProps extends Omit { diff --git a/src/features/ChatInput/ActionBar/components/ActionDropdown.tsx b/src/features/ChatInput/ActionBar/components/ActionDropdown.tsx index 69cd84542e..ce173ad6c7 100644 --- a/src/features/ChatInput/ActionBar/components/ActionDropdown.tsx +++ b/src/features/ChatInput/ActionBar/components/ActionDropdown.tsx @@ -1,16 +1,22 @@ 'use client'; -import type {DropdownMenuPopupProps, DropdownMenuProps, MenuItemType, MenuProps, PopoverTrigger} from '@lobehub/ui'; +import { + type DropdownMenuPopupProps, + type DropdownMenuProps, + type MenuItemType, + type MenuProps, + type PopoverTrigger, +} from '@lobehub/ui'; import { DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuTrigger, - renderDropdownMenuItems + renderDropdownMenuItems, } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; -import type {CSSProperties, ReactNode} from 'react'; +import { type CSSProperties, type ReactNode } from 'react'; import { isValidElement, memo, @@ -19,7 +25,7 @@ import { useEffect, useMemo, useRef, - useState + useState, } from 'react'; import DebugNode from '@/components/DebugNode'; diff --git a/src/features/ChatInput/ActionBar/components/ActionPopover.tsx b/src/features/ChatInput/ActionBar/components/ActionPopover.tsx index 6cf147a897..04ba033313 100644 --- a/src/features/ChatInput/ActionBar/components/ActionPopover.tsx +++ b/src/features/ChatInput/ActionBar/components/ActionPopover.tsx @@ -1,9 +1,9 @@ 'use client'; -import type {PopoverProps} from '@lobehub/ui'; -import { Flexbox, Popover } from '@lobehub/ui'; +import { type PopoverProps } from '@lobehub/ui'; +import { Flexbox, Popover } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo, Suspense } from 'react'; import DebugNode from '@/components/DebugNode'; diff --git a/src/features/ChatInput/ActionBar/components/CheckboxWithLoading.tsx b/src/features/ChatInput/ActionBar/components/CheckboxWithLoading.tsx index e75933fd75..31deed5e04 100644 --- a/src/features/ChatInput/ActionBar/components/CheckboxWithLoading.tsx +++ b/src/features/ChatInput/ActionBar/components/CheckboxWithLoading.tsx @@ -1,7 +1,7 @@ import { Center, Checkbox, Flexbox, Icon } from '@lobehub/ui'; import { Loader2 } from 'lucide-react'; -import type {ReactNode} from 'react'; -import { memo, useState } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useState } from 'react'; export interface CheckboxItemProps { checked?: boolean; diff --git a/src/features/ChatInput/ActionBar/index.tsx b/src/features/ChatInput/ActionBar/index.tsx index f4a3866445..4bc71c2bd8 100644 --- a/src/features/ChatInput/ActionBar/index.tsx +++ b/src/features/ChatInput/ActionBar/index.tsx @@ -1,5 +1,5 @@ -import type {ChatInputActionsProps} from '@lobehub/editor/react'; -import { ChatInputActions } from '@lobehub/editor/react'; +import { type ChatInputActionsProps } from '@lobehub/editor/react'; +import { ChatInputActions } from '@lobehub/editor/react'; import { memo, useMemo } from 'react'; import { useGlobalStore } from '@/store/global'; @@ -7,11 +7,11 @@ import { systemStatusSelectors } from '@/store/global/selectors'; import { useUserStore } from '@/store/user'; import { labPreferSelectors } from '@/store/user/slices/preference/selectors'; -import type {ActionKeys} from '../ActionBar/config'; -import { actionMap } from '../ActionBar/config'; +import { type ActionKeys } from '../ActionBar/config'; +import { actionMap } from '../ActionBar/config'; import { useChatInputStore } from '../store'; -import type {DropdownPlacement} from './context'; -import { ActionBarContext } from './context'; +import { type DropdownPlacement } from './context'; +import { ActionBarContext } from './context'; const mapActionsToItems = (keys: ActionKeys[]): ChatInputActionsProps['items'] => keys.map((actionKey, index) => { diff --git a/src/features/ChatInput/ChatInputProvider.tsx b/src/features/ChatInput/ChatInputProvider.tsx index bc8a51e1b8..2d6fc7b7e7 100644 --- a/src/features/ChatInput/ChatInputProvider.tsx +++ b/src/features/ChatInput/ChatInputProvider.tsx @@ -1,9 +1,9 @@ import { useEditor } from '@lobehub/editor/react'; -import type {ReactNode} from 'react'; -import { memo, useRef } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useRef } from 'react'; -import { createStore,Provider } from './store'; -import type {StoreUpdaterProps} from './StoreUpdater'; +import { createStore, Provider } from './store'; +import { type StoreUpdaterProps } from './StoreUpdater'; import StoreUpdater from './StoreUpdater'; interface ChatInputProviderProps extends StoreUpdaterProps { diff --git a/src/features/ChatInput/Desktop/ContextContainer/ContextItem/Content.tsx b/src/features/ChatInput/Desktop/ContextContainer/ContextItem/Content.tsx index 9862a194cb..7a93778fee 100644 --- a/src/features/ChatInput/Desktop/ContextContainer/ContextItem/Content.tsx +++ b/src/features/ChatInput/Desktop/ContextContainer/ContextItem/Content.tsx @@ -3,7 +3,7 @@ import { createStaticStyles } from 'antd-style'; import { memo } from 'react'; import FileIcon from '@/components/FileIcon'; -import type {UploadFileItem} from '@/types/files/upload'; +import { type UploadFileItem } from '@/types/files/upload'; const styles = createStaticStyles(({ css }) => ({ image: css` diff --git a/src/features/ChatInput/Desktop/ContextContainer/ContextItem/FilePreviewModal.tsx b/src/features/ChatInput/Desktop/ContextContainer/ContextItem/FilePreviewModal.tsx index cce3d96560..cb68805c22 100644 --- a/src/features/ChatInput/Desktop/ContextContainer/ContextItem/FilePreviewModal.tsx +++ b/src/features/ChatInput/Desktop/ContextContainer/ContextItem/FilePreviewModal.tsx @@ -4,7 +4,7 @@ import { Modal } from '@lobehub/ui'; import { memo } from 'react'; import FileViewer from '@/features/FileViewer'; -import type {UploadFileItem} from '@/types/files/upload'; +import { type UploadFileItem } from '@/types/files/upload'; interface FilePreviewModalProps { file: UploadFileItem; diff --git a/src/features/ChatInput/Desktop/ContextContainer/ContextItem/index.tsx b/src/features/ChatInput/Desktop/ContextContainer/ContextItem/index.tsx index f3d3bfa2da..7bbb953588 100644 --- a/src/features/ChatInput/Desktop/ContextContainer/ContextItem/index.tsx +++ b/src/features/ChatInput/Desktop/ContextContainer/ContextItem/index.tsx @@ -1,12 +1,12 @@ -import { createRawModal,Flexbox, Tag, Tooltip } from '@lobehub/ui'; +import { createRawModal, Flexbox, Tag, Tooltip } from '@lobehub/ui'; import { Progress } from 'antd'; import { createStaticStyles, cssVar } from 'antd-style'; import { memo } from 'react'; import { useEventCallback } from '@/hooks/useEventCallback'; import { useFileStore } from '@/store/file'; -import type {UploadFileItem} from '@/types/files/upload'; -import { UPLOAD_STATUS_SET } from '@/types/files/upload'; +import { type UploadFileItem } from '@/types/files/upload'; +import { UPLOAD_STATUS_SET } from '@/types/files/upload'; import Content from './Content'; import FilePreviewModal from './FilePreviewModal'; diff --git a/src/features/ChatInput/Desktop/ContextContainer/SelectionItem.tsx b/src/features/ChatInput/Desktop/ContextContainer/SelectionItem.tsx index 1f912a5b22..377d154a40 100644 --- a/src/features/ChatInput/Desktop/ContextContainer/SelectionItem.tsx +++ b/src/features/ChatInput/Desktop/ContextContainer/SelectionItem.tsx @@ -1,4 +1,4 @@ -import type {ChatContextContent} from '@lobechat/types'; +import { type ChatContextContent } from '@lobechat/types'; import { Tag, Tooltip } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { TextIcon } from 'lucide-react'; diff --git a/src/features/ChatInput/Desktop/FilePreview/FileItem/Content.tsx b/src/features/ChatInput/Desktop/FilePreview/FileItem/Content.tsx index ec4e5ce1ae..a158f96c13 100644 --- a/src/features/ChatInput/Desktop/FilePreview/FileItem/Content.tsx +++ b/src/features/ChatInput/Desktop/FilePreview/FileItem/Content.tsx @@ -3,7 +3,7 @@ import { createStaticStyles } from 'antd-style'; import { memo } from 'react'; import FileIcon from '@/components/FileIcon'; -import type {UploadFileItem} from '@/types/files/upload'; +import { type UploadFileItem } from '@/types/files/upload'; const styles = createStaticStyles(({ css }) => ({ image: css` diff --git a/src/features/ChatInput/Desktop/FilePreview/FileItem/index.tsx b/src/features/ChatInput/Desktop/FilePreview/FileItem/index.tsx index 06fe56a69e..56ff1c54a6 100644 --- a/src/features/ChatInput/Desktop/FilePreview/FileItem/index.tsx +++ b/src/features/ChatInput/Desktop/FilePreview/FileItem/index.tsx @@ -5,7 +5,7 @@ import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { useFileStore } from '@/store/file'; -import type {UploadFileItem} from '@/types/files/upload'; +import { type UploadFileItem } from '@/types/files/upload'; import UploadDetail from '../../../components/UploadDetail'; import Content from './Content'; diff --git a/src/features/ChatInput/Desktop/index.tsx b/src/features/ChatInput/Desktop/index.tsx index a923139191..88b8bef873 100644 --- a/src/features/ChatInput/Desktop/index.tsx +++ b/src/features/ChatInput/Desktop/index.tsx @@ -1,10 +1,10 @@ 'use client'; -import type { ChatInputProps } from '@lobehub/editor/react'; +import { type ChatInputProps } from '@lobehub/editor/react'; import { ChatInput, ChatInputActionBar } from '@lobehub/editor/react'; import { Center, Flexbox, Text } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { memo, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; @@ -15,7 +15,7 @@ import { fileChatSelectors, useFileStore } from '@/store/file'; import { useGlobalStore } from '@/store/global'; import { systemStatusSelectors } from '@/store/global/selectors'; -import type { ActionToolbarProps } from '../ActionBar'; +import { type ActionToolbarProps } from '../ActionBar'; import ActionBar from '../ActionBar'; import InputEditor from '../InputEditor'; import SendArea from '../SendArea'; diff --git a/src/features/ChatInput/InputEditor/useSlashItems.tsx b/src/features/ChatInput/InputEditor/useSlashItems.tsx index 20e3196795..266b6806b8 100644 --- a/src/features/ChatInput/InputEditor/useSlashItems.tsx +++ b/src/features/ChatInput/InputEditor/useSlashItems.tsx @@ -1,9 +1,9 @@ -import type {SlashOptions} from '@lobehub/editor'; +import { type SlashOptions } from '@lobehub/editor'; import { INSERT_HEADING_COMMAND, INSERT_HORIZONTAL_RULE_COMMAND, INSERT_MATH_COMMAND, - INSERT_TABLE_COMMAND + INSERT_TABLE_COMMAND, } from '@lobehub/editor'; import { Text } from '@lobehub/ui'; import { diff --git a/src/features/ChatInput/Mobile/FilePreview/FileItem/File.tsx b/src/features/ChatInput/Mobile/FilePreview/FileItem/File.tsx index 2b7b586001..ec463cac29 100644 --- a/src/features/ChatInput/Mobile/FilePreview/FileItem/File.tsx +++ b/src/features/ChatInput/Mobile/FilePreview/FileItem/File.tsx @@ -5,7 +5,7 @@ import { memo } from 'react'; import FileIcon from '@/components/FileIcon'; import UploadDetail from '@/features/ChatInput/components/UploadDetail'; -import type {UploadFileItem} from '@/types/files'; +import { type UploadFileItem } from '@/types/files'; const styles = createStaticStyles(({ css }) => ({ container: css` diff --git a/src/features/ChatInput/Mobile/FilePreview/FileItem/index.tsx b/src/features/ChatInput/Mobile/FilePreview/FileItem/index.tsx index a57dfd5616..15fddc6592 100644 --- a/src/features/ChatInput/Mobile/FilePreview/FileItem/index.tsx +++ b/src/features/ChatInput/Mobile/FilePreview/FileItem/index.tsx @@ -1,8 +1,8 @@ -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; import { useFileStore } from '@/store/file'; -import type {UploadFileItem} from '@/types/files'; +import { type UploadFileItem } from '@/types/files'; import File from './File'; import Image from './Image'; diff --git a/src/features/ChatInput/SendArea/index.tsx b/src/features/ChatInput/SendArea/index.tsx index ffbc6ab3b0..b71ba09a1a 100644 --- a/src/features/ChatInput/SendArea/index.tsx +++ b/src/features/ChatInput/SendArea/index.tsx @@ -2,8 +2,8 @@ import { Flexbox } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; import { memo, useMemo } from 'react'; -import type {ActionKey} from '../ActionBar/config'; -import { actionMap } from '../ActionBar/config'; +import { type ActionKey } from '../ActionBar/config'; +import { actionMap } from '../ActionBar/config'; import { useChatInputStore } from '../store'; import ExpandButton from './ExpandButton'; import SendButton from './SendButton'; diff --git a/src/features/ChatInput/StoreUpdater.tsx b/src/features/ChatInput/StoreUpdater.tsx index d74ab2b5c7..048899cc11 100644 --- a/src/features/ChatInput/StoreUpdater.tsx +++ b/src/features/ChatInput/StoreUpdater.tsx @@ -1,13 +1,13 @@ 'use client'; -import type {ForwardedRef} from 'react'; -import { memo, useImperativeHandle } from 'react'; +import { type ForwardedRef } from 'react'; +import { memo, useImperativeHandle } from 'react'; import { createStoreUpdater } from 'zustand-utils'; -import type {ChatInputEditor} from './hooks/useChatInputEditor'; -import { useChatInputEditor } from './hooks/useChatInputEditor'; -import type {PublicState} from './store'; -import { useStoreApi } from './store'; +import { type ChatInputEditor } from './hooks/useChatInputEditor'; +import { useChatInputEditor } from './hooks/useChatInputEditor'; +import { type PublicState } from './store'; +import { useStoreApi } from './store'; export interface StoreUpdaterProps extends Partial { chatInputEditorRef?: ForwardedRef; diff --git a/src/features/ChatInput/TypoBar/index.tsx b/src/features/ChatInput/TypoBar/index.tsx index 7ce9dde2af..248165c112 100644 --- a/src/features/ChatInput/TypoBar/index.tsx +++ b/src/features/ChatInput/TypoBar/index.tsx @@ -1,8 +1,6 @@ -import { getHotkeyById,HotkeyEnum } from '@lobehub/editor'; -import type {ChatInputActionsProps} from '@lobehub/editor/react'; -import { ChatInputActionBar, - ChatInputActions, -useEditorState } from '@lobehub/editor/react'; +import { getHotkeyById, HotkeyEnum } from '@lobehub/editor'; +import { type ChatInputActionsProps } from '@lobehub/editor/react'; +import { ChatInputActionBar, ChatInputActions, useEditorState } from '@lobehub/editor/react'; import { cssVar } from 'antd-style'; import { BoldIcon, diff --git a/src/features/ChatInput/components/UploadDetail/UploadStatus.tsx b/src/features/ChatInput/components/UploadDetail/UploadStatus.tsx index d048633261..b5492d932a 100644 --- a/src/features/ChatInput/components/UploadDetail/UploadStatus.tsx +++ b/src/features/ChatInput/components/UploadDetail/UploadStatus.tsx @@ -6,7 +6,7 @@ import { Loader2Icon } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {FileUploadState, FileUploadStatus} from '@/types/files/upload'; +import { type FileUploadState, type FileUploadStatus } from '@/types/files/upload'; import { formatSize } from '@/utils/format'; interface UploadStateProps { diff --git a/src/features/ChatInput/components/UploadDetail/index.tsx b/src/features/ChatInput/components/UploadDetail/index.tsx index dbe414d2ca..843a2aa004 100644 --- a/src/features/ChatInput/components/UploadDetail/index.tsx +++ b/src/features/ChatInput/components/UploadDetail/index.tsx @@ -4,8 +4,8 @@ import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import FileParsingStatus from '@/components/FileParsingStatus'; -import type {FileParsingTask} from '@/types/asyncTask'; -import type {FileUploadState, FileUploadStatus} from '@/types/files'; +import { type FileParsingTask } from '@/types/asyncTask'; +import { type FileUploadState, type FileUploadStatus } from '@/types/files'; import UploadStatus from './UploadStatus'; diff --git a/src/features/ChatInput/hooks/useChatInputEditor.ts b/src/features/ChatInput/hooks/useChatInputEditor.ts index d2c7c7430a..94efb8ea79 100644 --- a/src/features/ChatInput/hooks/useChatInputEditor.ts +++ b/src/features/ChatInput/hooks/useChatInputEditor.ts @@ -1,4 +1,4 @@ -import type {IEditor} from '@lobehub/editor'; +import { type IEditor } from '@lobehub/editor'; import { useMemo } from 'react'; import { useChatInputStore } from '@/features/ChatInput/store'; diff --git a/src/features/ChatInput/hooks/useUpdateAgentConfig.ts b/src/features/ChatInput/hooks/useUpdateAgentConfig.ts index 4c10da510f..a75881d054 100644 --- a/src/features/ChatInput/hooks/useUpdateAgentConfig.ts +++ b/src/features/ChatInput/hooks/useUpdateAgentConfig.ts @@ -1,10 +1,10 @@ 'use client'; import { useCallback } from 'react'; -import type { PartialDeep } from 'type-fest'; +import { type PartialDeep } from 'type-fest'; import { useAgentStore } from '@/store/agent'; -import type {LobeAgentChatConfig, LobeAgentConfig} from '@/types/agent'; +import { type LobeAgentChatConfig, type LobeAgentConfig } from '@/types/agent'; import { useAgentId } from './useAgentId'; diff --git a/src/features/ChatInput/store/action.ts b/src/features/ChatInput/store/action.ts index b0ef13f6a0..39e4b53a93 100644 --- a/src/features/ChatInput/store/action.ts +++ b/src/features/ChatInput/store/action.ts @@ -1,7 +1,7 @@ -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; -import type {PublicState, State} from './initialState'; -import { initialState } from './initialState'; +import { type PublicState, type State } from './initialState'; +import { initialState } from './initialState'; export interface Action { getJSONState: () => any; diff --git a/src/features/ChatInput/store/index.ts b/src/features/ChatInput/store/index.ts index 09805657ba..b5cb6b4655 100644 --- a/src/features/ChatInput/store/index.ts +++ b/src/features/ChatInput/store/index.ts @@ -1,14 +1,14 @@ 'use client'; -import type {StoreApiWithSelector} from '@lobechat/types'; +import { type StoreApiWithSelector } from '@lobechat/types'; import { subscribeWithSelector } from 'zustand/middleware'; import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; import { createContext } from 'zustand-utils'; -import type {Store} from './action'; -import { store } from './action'; -import type {State} from './initialState'; +import { type Store } from './action'; +import { store } from './action'; +import { type State } from './initialState'; export type { PublicState, State } from './initialState'; diff --git a/src/features/ChatInput/store/initialState.ts b/src/features/ChatInput/store/initialState.ts index e6c990f976..dad7ef4ce4 100644 --- a/src/features/ChatInput/store/initialState.ts +++ b/src/features/ChatInput/store/initialState.ts @@ -1,8 +1,8 @@ -import type {IEditor, SlashOptions} from '@lobehub/editor'; -import type { ChatInputProps } from '@lobehub/editor/react'; -import type { MenuProps } from '@lobehub/ui'; +import { type IEditor, type SlashOptions } from '@lobehub/editor'; +import { type ChatInputProps } from '@lobehub/editor/react'; +import { type MenuProps } from '@lobehub/ui'; -import type {ActionKeys} from '@/features/ChatInput'; +import { type ActionKeys } from '@/features/ChatInput'; export type SendButtonHandler = (params: { clearContent: () => void; diff --git a/src/features/ChatInput/store/selectors.ts b/src/features/ChatInput/store/selectors.ts index 3ef28281c1..be04aa1620 100644 --- a/src/features/ChatInput/store/selectors.ts +++ b/src/features/ChatInput/store/selectors.ts @@ -1,5 +1,5 @@ -import type {SendButtonProps, State} from './initialState'; -import { initialSendButtonState } from './initialState'; +import { type SendButtonProps, type State } from './initialState'; +import { initialSendButtonState } from './initialState'; export const selectors = { sendButtonProps: (s: State): SendButtonProps => s.sendButtonProps || initialSendButtonState, diff --git a/src/features/ChatMiniMap/MinimapIndicator.tsx b/src/features/ChatMiniMap/MinimapIndicator.tsx index dbff6ddfad..e5ab7d17f3 100644 --- a/src/features/ChatMiniMap/MinimapIndicator.tsx +++ b/src/features/ChatMiniMap/MinimapIndicator.tsx @@ -4,7 +4,7 @@ import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { indicatorStyles } from './styles'; -import type { MinimapIndicatorProps } from './types'; +import { type MinimapIndicatorProps } from './types'; export const MinimapIndicator = memo( ({ id, width, preview, role, virtuosoIndex, position, activePosition, onJump }) => { diff --git a/src/features/ChatMiniMap/useMinimapData.ts b/src/features/ChatMiniMap/useMinimapData.ts index d2a8f81a12..52a3bbb4db 100644 --- a/src/features/ChatMiniMap/useMinimapData.ts +++ b/src/features/ChatMiniMap/useMinimapData.ts @@ -4,7 +4,7 @@ import { useCallback, useMemo } from 'react'; import { conversationSelectors, useConversationStore } from '@/features/Conversation'; -import type { MinimapIndicator } from './types'; +import { type MinimapIndicator } from './types'; import { getIndicatorWidth, getPreviewText } from './utils'; const log = debug('lobe-react:chat-minimap'); diff --git a/src/features/CommandMenu/ChatList.tsx b/src/features/CommandMenu/ChatList.tsx index 9dcab9ec06..e0c82dc461 100644 --- a/src/features/CommandMenu/ChatList.tsx +++ b/src/features/CommandMenu/ChatList.tsx @@ -1,7 +1,7 @@ import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type { ChatMessage } from './types'; +import { type ChatMessage } from './types'; interface ChatListProps { messages: ChatMessage[]; diff --git a/src/features/CommandMenu/CommandMenuContext.tsx b/src/features/CommandMenu/CommandMenuContext.tsx index 51662b56b4..a699482984 100644 --- a/src/features/CommandMenu/CommandMenuContext.tsx +++ b/src/features/CommandMenu/CommandMenuContext.tsx @@ -1,17 +1,11 @@ 'use client'; -import type {Dispatch, ReactNode, SetStateAction} from 'react'; -import { - createContext, - use, - useCallback, - useMemo, - useState -} from 'react'; +import { type Dispatch, type ReactNode, type SetStateAction } from 'react'; +import { createContext, use, useCallback, useMemo, useState } from 'react'; -import type {MenuContext, PageType, SelectedAgent} from './types'; +import { type MenuContext, type PageType, type SelectedAgent } from './types'; import { detectContext } from './utils/context'; -import type { ValidSearchType } from './utils/queryParser'; +import { type ValidSearchType } from './utils/queryParser'; interface CommandMenuContextValue { menuContext: MenuContext; diff --git a/src/features/CommandMenu/SearchResults.tsx b/src/features/CommandMenu/SearchResults.tsx index 2efbb34c01..5097e8fbba 100644 --- a/src/features/CommandMenu/SearchResults.tsx +++ b/src/features/CommandMenu/SearchResults.tsx @@ -16,12 +16,12 @@ import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; -import type { SearchResult } from '@/database/repositories/search'; +import { type SearchResult } from '@/database/repositories/search'; import { markdownToTxt } from '@/utils/markdownToTxt'; import { CommandItem } from './components'; import { styles } from './styles'; -import type { ValidSearchType } from './utils/queryParser'; +import { type ValidSearchType } from './utils/queryParser'; interface SearchResultsProps { isLoading: boolean; @@ -185,7 +185,6 @@ const SearchResults = memo( } }; - const getItemValue = (result: SearchResult) => { const meta = [result.title, result.description].filter(Boolean).join(' '); // Prefix with "search-result" to ensure these items rank after built-in commands @@ -193,7 +192,6 @@ const SearchResults = memo( return `search-result ${result.type} ${result.id} ${meta}`.trim(); }; - const getDescription = (result: SearchResult) => { if (!result.description) return null; // Sanitize markdown content for message search results @@ -203,7 +201,6 @@ const SearchResults = memo( return result.description; }; - const getSubtitle = (result: SearchResult) => { const description = getDescription(result); diff --git a/src/features/CommandMenu/components/CommandInput.tsx b/src/features/CommandMenu/components/CommandInput.tsx index af8e54cc72..2604066cf5 100644 --- a/src/features/CommandMenu/components/CommandInput.tsx +++ b/src/features/CommandMenu/components/CommandInput.tsx @@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next'; import { useCommandMenuContext } from '../CommandMenuContext'; import { styles } from '../styles'; import { useCommandMenu } from '../useCommandMenu'; -import type { ValidSearchType } from '../utils/queryParser'; +import { type ValidSearchType } from '../utils/queryParser'; const CommandInput = memo(() => { const { t } = useTranslation('common'); diff --git a/src/features/CommandMenu/components/CommandItem.tsx b/src/features/CommandMenu/components/CommandItem.tsx index 03908e96bc..104a74b688 100644 --- a/src/features/CommandMenu/components/CommandItem.tsx +++ b/src/features/CommandMenu/components/CommandItem.tsx @@ -1,5 +1,5 @@ import { Command } from 'cmdk'; -import type { ComponentProps, ReactNode } from 'react'; +import { type ComponentProps, type ReactNode } from 'react'; import { cloneElement, isValidElement, memo } from 'react'; import { useCommandMenuContext } from '../CommandMenuContext'; @@ -44,7 +44,6 @@ const CommandItem = memo((props) => { } if (props.variant === 'detailed') { - const { icon, title, description, trailingLabel, unpinned: _unpinned, ...itemProps } = props; return ( @@ -61,7 +60,7 @@ const CommandItem = memo((props) => { } // Simple variant (default) - + const { icon, children, unpinned: _unpinned, ...itemProps } = props; // Clone the icon element and add the icon className if it's a valid React element diff --git a/src/features/CommandMenu/useCommandMenu.ts b/src/features/CommandMenu/useCommandMenu.ts index 8f615e9f2f..66dcdc9539 100644 --- a/src/features/CommandMenu/useCommandMenu.ts +++ b/src/features/CommandMenu/useCommandMenu.ts @@ -6,7 +6,7 @@ import useSWR from 'swr'; import { useCreateMenuItems } from '@/app/[variants]/(main)/home/_layout/hooks'; import { isDesktop } from '@/const/version'; -import type { SearchResult } from '@/database/repositories/search'; +import { type SearchResult } from '@/database/repositories/search'; import { useCreateNewModal } from '@/features/LibraryModal'; import { useGroupWizard } from '@/layout/GlobalProvider/GroupWizardProvider'; import { lambdaClient } from '@/libs/trpc/client'; @@ -19,7 +19,7 @@ import { globalHelpers } from '@/store/global/helpers'; import { useHomeStore } from '@/store/home'; import { useCommandMenuContext } from './CommandMenuContext'; -import type { ThemeMode } from './types'; +import { type ThemeMode } from './types'; /** * Shared methods for CommandMenu diff --git a/src/features/CommandMenu/utils/context.ts b/src/features/CommandMenu/utils/context.ts index 3b7620ad67..6d2abda7af 100644 --- a/src/features/CommandMenu/utils/context.ts +++ b/src/features/CommandMenu/utils/context.ts @@ -1,4 +1,4 @@ -import type { Context, MenuContext } from '../types'; +import { type Context, type MenuContext } from '../types'; /** * Configuration for context detection diff --git a/src/features/CommandMenu/utils/contextCommands.ts b/src/features/CommandMenu/utils/contextCommands.ts index fe403c90e1..a7d21fb2df 100644 --- a/src/features/CommandMenu/utils/contextCommands.ts +++ b/src/features/CommandMenu/utils/contextCommands.ts @@ -1,6 +1,6 @@ import { ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const'; import { isDesktop } from '@lobechat/const'; -import type { LucideIcon } from 'lucide-react'; +import { type LucideIcon } from 'lucide-react'; import { Brain, ChartColumnBigIcon, @@ -18,7 +18,7 @@ import { UserCircle, } from 'lucide-react'; -import type { ContextType, MenuContext } from '../types'; +import { type ContextType, type MenuContext } from '../types'; export interface ContextCommand { icon: LucideIcon; diff --git a/src/features/Conversation/ChatInput/index.tsx b/src/features/Conversation/ChatInput/index.tsx index 2ad2c5578c..781ab072d7 100644 --- a/src/features/Conversation/ChatInput/index.tsx +++ b/src/features/Conversation/ChatInput/index.tsx @@ -1,15 +1,18 @@ 'use client'; -import type { SlashOptions } from '@lobehub/editor'; -import type {MenuProps} from '@lobehub/ui'; -import { Alert, Flexbox } from '@lobehub/ui'; -import type {ReactNode} from 'react'; -import { memo, useCallback } from 'react'; +import { type SlashOptions } from '@lobehub/editor'; +import { type MenuProps } from '@lobehub/ui'; +import { Alert, Flexbox } from '@lobehub/ui'; +import { type ReactNode } from 'react'; +import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; -import type {ActionKeys} from '@/features/ChatInput'; -import { ChatInputProvider, DesktopChatInput } from '@/features/ChatInput'; -import type { SendButtonHandler, SendButtonProps } from '@/features/ChatInput/store/initialState'; +import { type ActionKeys } from '@/features/ChatInput'; +import { ChatInputProvider, DesktopChatInput } from '@/features/ChatInput'; +import { + type SendButtonHandler, + type SendButtonProps, +} from '@/features/ChatInput/store/initialState'; import { useChatStore } from '@/store/chat'; import { fileChatSelectors, useFileStore } from '@/store/file'; diff --git a/src/features/Conversation/ChatItem/ChatItem.tsx b/src/features/Conversation/ChatItem/ChatItem.tsx index a2fa35fc84..fbb1bab0ed 100644 --- a/src/features/Conversation/ChatItem/ChatItem.tsx +++ b/src/features/Conversation/ChatItem/ChatItem.tsx @@ -10,7 +10,7 @@ import ErrorContent from './components/ErrorContent'; import MessageContent from './components/MessageContent'; import Title from './components/Title'; import { styles } from './style'; -import type {ChatItemProps} from './type'; +import { type ChatItemProps } from './type'; const ChatItem = memo( ({ diff --git a/src/features/Conversation/ChatItem/components/Actions.tsx b/src/features/Conversation/ChatItem/components/Actions.tsx index 1962104a9b..f422c9d22b 100644 --- a/src/features/Conversation/ChatItem/components/Actions.tsx +++ b/src/features/Conversation/ChatItem/components/Actions.tsx @@ -1,7 +1,7 @@ import { Flexbox } from '@lobehub/ui'; import { memo } from 'react'; -import type {ChatItemProps} from '../type'; +import { type ChatItemProps } from '../type'; export interface ActionsProps { actions: ChatItemProps['actions']; diff --git a/src/features/Conversation/ChatItem/components/Avatar.tsx b/src/features/Conversation/ChatItem/components/Avatar.tsx index fa122aca87..4865a1dc2b 100644 --- a/src/features/Conversation/ChatItem/components/Avatar.tsx +++ b/src/features/Conversation/ChatItem/components/Avatar.tsx @@ -1,8 +1,8 @@ import { Avatar as A } from '@lobehub/ui'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; -import type { ChatItemProps } from '../type'; +import { type ChatItemProps } from '../type'; export interface AvatarProps { alt?: string; diff --git a/src/features/Conversation/ChatItem/components/ErrorContent.tsx b/src/features/Conversation/ChatItem/components/ErrorContent.tsx index b78dc4785d..38c935623a 100644 --- a/src/features/Conversation/ChatItem/components/ErrorContent.tsx +++ b/src/features/Conversation/ChatItem/components/ErrorContent.tsx @@ -1,12 +1,12 @@ import { Alert, Skeleton } from '@lobehub/ui'; import { Button } from 'antd'; import { RotateCcw } from 'lucide-react'; -import { memo,Suspense } from 'react'; +import { memo, Suspense } from 'react'; import { useTranslation } from 'react-i18next'; import { useConversationStore } from '@/features/Conversation'; -import type {ChatItemProps} from '../type'; +import { type ChatItemProps } from '../type'; export interface ErrorContentProps { customErrorRender?: ChatItemProps['customErrorRender']; diff --git a/src/features/Conversation/ChatItem/components/Loading.tsx b/src/features/Conversation/ChatItem/components/Loading.tsx index 7324101629..1b7169b38a 100644 --- a/src/features/Conversation/ChatItem/components/Loading.tsx +++ b/src/features/Conversation/ChatItem/components/Loading.tsx @@ -3,7 +3,7 @@ import { Loader2 } from 'lucide-react'; import { memo } from 'react'; import { styles } from '../style'; -import type { ChatItemProps } from '../type'; +import { type ChatItemProps } from '../type'; export interface LoadingProps { loading?: ChatItemProps['loading']; diff --git a/src/features/Conversation/ChatItem/components/MessageContent/index.tsx b/src/features/Conversation/ChatItem/components/MessageContent/index.tsx index 8a4bffd9c5..4a123edde8 100644 --- a/src/features/Conversation/ChatItem/components/MessageContent/index.tsx +++ b/src/features/Conversation/ChatItem/components/MessageContent/index.tsx @@ -1,12 +1,12 @@ import { Flexbox } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; -import type {ReactNode} from 'react'; -import { memo, Suspense, useCallback } from 'react'; +import { type ReactNode } from 'react'; +import { memo, Suspense, useCallback } from 'react'; import { useConversationStore } from '@/features/Conversation/store'; import dynamic from '@/libs/next/dynamic'; -import type {ChatItemProps} from '../../type'; +import { type ChatItemProps } from '../../type'; const EditorModal = dynamic( () => import('@/features/EditorModal').then((mode) => mode.EditorModal), diff --git a/src/features/Conversation/ChatItem/components/Title.tsx b/src/features/Conversation/ChatItem/components/Title.tsx index 5acd1ec11d..a95492932a 100644 --- a/src/features/Conversation/ChatItem/components/Title.tsx +++ b/src/features/Conversation/ChatItem/components/Title.tsx @@ -3,7 +3,7 @@ import dayjs from 'dayjs'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {ChatItemProps} from '../type'; +import { type ChatItemProps } from '../type'; export interface TitleProps { avatar: ChatItemProps['avatar']; diff --git a/src/features/Conversation/ChatItem/type.ts b/src/features/Conversation/ChatItem/type.ts index 569959aaf4..274fe70208 100644 --- a/src/features/Conversation/ChatItem/type.ts +++ b/src/features/Conversation/ChatItem/type.ts @@ -1,6 +1,6 @@ -import type {AlertProps, AvatarProps, DivProps, FlexboxProps} from '@lobehub/ui'; -import type {EditableMessageProps, MetaData} from '@lobehub/ui/chat'; -import type {ReactNode} from 'react'; +import { type AlertProps, type AvatarProps, type DivProps, type FlexboxProps } from '@lobehub/ui'; +import { type EditableMessageProps, type MetaData } from '@lobehub/ui/chat'; +import { type ReactNode } from 'react'; export interface ChatItemProps extends Omit { aboveMessage?: ReactNode; diff --git a/src/features/Conversation/ChatList/components/VirtualizedList.tsx b/src/features/Conversation/ChatList/components/VirtualizedList.tsx index ca012849c2..6be93fc6f4 100644 --- a/src/features/Conversation/ChatList/components/VirtualizedList.tsx +++ b/src/features/Conversation/ChatList/components/VirtualizedList.tsx @@ -1,10 +1,10 @@ 'use client'; import isEqual from 'fast-deep-equal'; -import type {ReactElement, ReactNode} from 'react'; -import { memo, useCallback, useEffect, useRef } from 'react'; -import type {VListHandle} from 'virtua'; -import { VList } from 'virtua'; +import { type ReactElement, type ReactNode } from 'react'; +import { memo, useCallback, useEffect, useRef } from 'react'; +import { type VListHandle } from 'virtua'; +import { VList } from 'virtua'; import WideScreenContainer from '../../../WideScreenContainer'; import { dataSelectors, useConversationStore, virtuaListSelectors } from '../../store'; diff --git a/src/features/Conversation/ChatList/index.tsx b/src/features/Conversation/ChatList/index.tsx index 720f490287..b5f7fd3489 100644 --- a/src/features/Conversation/ChatList/index.tsx +++ b/src/features/Conversation/ChatList/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {ReactNode} from 'react'; -import { memo, useCallback } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useCallback } from 'react'; import { useFetchTopicMemories } from '@/hooks/useFetchMemoryForTopic'; import { useFetchNotebookDocuments } from '@/hooks/useFetchNotebookDocuments'; diff --git a/src/features/Conversation/ConversationProvider.tsx b/src/features/Conversation/ConversationProvider.tsx index d055841365..3236ab26be 100644 --- a/src/features/Conversation/ConversationProvider.tsx +++ b/src/features/Conversation/ConversationProvider.tsx @@ -1,20 +1,20 @@ 'use client'; -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import debug from 'debug'; import isEqual from 'fast-deep-equal'; -import type {ReactNode} from 'react'; -import { memo, useMemo } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useMemo } from 'react'; import { messageMapKey } from '@/store/chat/utils/messageMapKey'; -import { createStore,Provider } from './store'; +import { createStore, Provider } from './store'; import StoreUpdater from './StoreUpdater'; -import type { - ActionsBarConfig, - ConversationContext, - ConversationHooks, - OperationState, +import { + type ActionsBarConfig, + type ConversationContext, + type ConversationHooks, + type OperationState, } from './types'; const log = debug('lobe-render:features:Conversation'); diff --git a/src/features/Conversation/Error/BaseErrorForm.tsx b/src/features/Conversation/Error/BaseErrorForm.tsx index 23ad7e6551..3de0376017 100644 --- a/src/features/Conversation/Error/BaseErrorForm.tsx +++ b/src/features/Conversation/Error/BaseErrorForm.tsx @@ -1,5 +1,5 @@ import { Block, Flexbox, Text } from '@lobehub/ui'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; interface BaseErrorFormProps { diff --git a/src/features/Conversation/Error/ChatInvalidApiKey.tsx b/src/features/Conversation/Error/ChatInvalidApiKey.tsx index 62ac38a520..f861de87fe 100644 --- a/src/features/Conversation/Error/ChatInvalidApiKey.tsx +++ b/src/features/Conversation/Error/ChatInvalidApiKey.tsx @@ -7,7 +7,7 @@ import { useNavigate } from 'react-router-dom'; import urlJoin from 'url-join'; import { useProviderName } from '@/hooks/useProviderName'; -import type {GlobalLLMProviderKey} from '@/types/user/settings/modelProvider'; +import { type GlobalLLMProviderKey } from '@/types/user/settings/modelProvider'; import { useConversationStore } from '../store'; import BaseErrorForm from './BaseErrorForm'; diff --git a/src/features/Conversation/Error/OllamaBizError/index.tsx b/src/features/Conversation/Error/OllamaBizError/index.tsx index 713fa503cc..ce2a0cdbe0 100644 --- a/src/features/Conversation/Error/OllamaBizError/index.tsx +++ b/src/features/Conversation/Error/OllamaBizError/index.tsx @@ -1,6 +1,6 @@ -import type {ChatMessageError} from '@lobechat/types'; -import type {AlertProps} from '@lobehub/ui'; -import { Skeleton } from '@lobehub/ui'; +import { type ChatMessageError } from '@lobechat/types'; +import { type AlertProps } from '@lobehub/ui'; +import { Skeleton } from '@lobehub/ui'; import { memo } from 'react'; import ErrorContent from '@/features/Conversation/ChatItem/components/ErrorContent'; diff --git a/src/features/Conversation/Error/index.tsx b/src/features/Conversation/Error/index.tsx index 6020729737..2d503c003e 100644 --- a/src/features/Conversation/Error/index.tsx +++ b/src/features/Conversation/Error/index.tsx @@ -1,11 +1,11 @@ import { ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const'; -import type {ILobeAgentRuntimeErrorType} from '@lobechat/model-runtime'; -import { AgentRuntimeErrorType } from '@lobechat/model-runtime'; -import type {ChatMessageError, ErrorType} from '@lobechat/types'; -import { ChatErrorType } from '@lobechat/types'; -import type {IPluginErrorType} from '@lobehub/chat-plugin-sdk'; -import type {AlertProps} from '@lobehub/ui'; -import { Block, Highlighter, Skeleton } from '@lobehub/ui'; +import { type ILobeAgentRuntimeErrorType } from '@lobechat/model-runtime'; +import { AgentRuntimeErrorType } from '@lobechat/model-runtime'; +import { type ChatMessageError, type ErrorType } from '@lobechat/types'; +import { ChatErrorType } from '@lobechat/types'; +import { type IPluginErrorType } from '@lobehub/chat-plugin-sdk'; +import { type AlertProps } from '@lobehub/ui'; +import { Block, Highlighter, Skeleton } from '@lobehub/ui'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/Conversation/Error/style.tsx b/src/features/Conversation/Error/style.tsx index 15a44111a7..321b9a872e 100644 --- a/src/features/Conversation/Error/style.tsx +++ b/src/features/Conversation/Error/style.tsx @@ -1,7 +1,7 @@ -import type { CenterProps } from '@lobehub/ui'; +import { type CenterProps } from '@lobehub/ui'; import { Avatar, Center, Flexbox } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; export const styles = createStaticStyles(({ css, cssVar }) => ({ diff --git a/src/features/Conversation/Markdown/index.tsx b/src/features/Conversation/Markdown/index.tsx index ee20c10933..e72215f642 100644 --- a/src/features/Conversation/Markdown/index.tsx +++ b/src/features/Conversation/Markdown/index.tsx @@ -1,5 +1,5 @@ -import type {MarkdownProps} from '@lobehub/ui'; -import { Markdown } from '@lobehub/ui'; +import { type MarkdownProps } from '@lobehub/ui'; +import { Markdown } from '@lobehub/ui'; import { memo } from 'react'; import { useUserStore } from '@/store/user'; diff --git a/src/features/Conversation/Markdown/plugins/LobeArtifact/Render/index.tsx b/src/features/Conversation/Markdown/plugins/LobeArtifact/Render/index.tsx index 6df327ddcd..7968b34bc0 100644 --- a/src/features/Conversation/Markdown/plugins/LobeArtifact/Render/index.tsx +++ b/src/features/Conversation/Markdown/plugins/LobeArtifact/Render/index.tsx @@ -9,7 +9,7 @@ import { useChatStore } from '@/store/chat'; import { chatPortalSelectors, messageStateSelectors } from '@/store/chat/selectors'; import { dotLoading } from '@/styles/loading'; -import type {MarkdownElementProps} from '../../type'; +import { type MarkdownElementProps } from '../../type'; import ArtifactIcon from './Icon'; const styles = createStaticStyles(({ css, cssVar }) => ({ diff --git a/src/features/Conversation/Markdown/plugins/LobeArtifact/index.ts b/src/features/Conversation/Markdown/plugins/LobeArtifact/index.ts index 6a15f36754..2578dd4834 100644 --- a/src/features/Conversation/Markdown/plugins/LobeArtifact/index.ts +++ b/src/features/Conversation/Markdown/plugins/LobeArtifact/index.ts @@ -1,8 +1,8 @@ -import type {FC} from 'react'; +import { type FC } from 'react'; import { ARTIFACT_TAG } from '@/const/plugin'; -import type {MarkdownElement, MarkdownElementProps} from '../type'; +import { type MarkdownElement, type MarkdownElementProps } from '../type'; import rehypePlugin from './rehypePlugin'; import Component from './Render'; diff --git a/src/features/Conversation/Markdown/plugins/LobeThinking/Render.tsx b/src/features/Conversation/Markdown/plugins/LobeThinking/Render.tsx index 0f9fd886d1..78e1627db5 100644 --- a/src/features/Conversation/Markdown/plugins/LobeThinking/Render.tsx +++ b/src/features/Conversation/Markdown/plugins/LobeThinking/Render.tsx @@ -6,7 +6,7 @@ import { useUserStore } from '@/store/user'; import { userGeneralSettingsSelectors } from '@/store/user/selectors'; import { dataSelectors, useConversationStore } from '../../../store'; -import type {MarkdownElementProps} from '../type'; +import { type MarkdownElementProps } from '../type'; import { isTagClosed } from '../utils'; const Render = memo(({ children, id }) => { diff --git a/src/features/Conversation/Markdown/plugins/LobeThinking/index.ts b/src/features/Conversation/Markdown/plugins/LobeThinking/index.ts index a1c174d4f9..95eb9006a4 100644 --- a/src/features/Conversation/Markdown/plugins/LobeThinking/index.ts +++ b/src/features/Conversation/Markdown/plugins/LobeThinking/index.ts @@ -1,7 +1,7 @@ import { ARTIFACT_THINKING_TAG } from '@/const/plugin'; import { createRemarkCustomTagPlugin } from '../remarkPlugins/createRemarkCustomTagPlugin'; -import type {MarkdownElement} from '../type'; +import { type MarkdownElement } from '../type'; import Component from './Render'; const LobeThinkingElement: MarkdownElement = { diff --git a/src/features/Conversation/Markdown/plugins/LocalFile/Render/index.tsx b/src/features/Conversation/Markdown/plugins/LocalFile/Render/index.tsx index c7d7755dfa..79eadb91ad 100644 --- a/src/features/Conversation/Markdown/plugins/LocalFile/Render/index.tsx +++ b/src/features/Conversation/Markdown/plugins/LocalFile/Render/index.tsx @@ -3,7 +3,7 @@ import React, { memo } from 'react'; import { LocalFile } from '@/features/LocalFile'; -import type {MarkdownElementProps} from '../../type'; +import { type MarkdownElementProps } from '../../type'; interface LocalFileProps { isDirectory: boolean; diff --git a/src/features/Conversation/Markdown/plugins/LocalFile/index.ts b/src/features/Conversation/Markdown/plugins/LocalFile/index.ts index bbd1f35db6..deb4f4137c 100644 --- a/src/features/Conversation/Markdown/plugins/LocalFile/index.ts +++ b/src/features/Conversation/Markdown/plugins/LocalFile/index.ts @@ -1,9 +1,9 @@ -import type {FC} from 'react'; +import { type FC } from 'react'; import { LOCAL_FILE_TAG } from '@/const/plugin'; import { createRemarkSelfClosingTagPlugin } from '../remarkPlugins/createRemarkSelfClosingTagPlugin'; -import type {MarkdownElement, MarkdownElementProps} from '../type'; +import { type MarkdownElement, type MarkdownElementProps } from '../type'; import RenderComponent from './Render'; // 定义此元素的标签名 diff --git a/src/features/Conversation/Markdown/plugins/Mention/Render.tsx b/src/features/Conversation/Markdown/plugins/Mention/Render.tsx index 8d9d8d6d35..2860f98bf0 100644 --- a/src/features/Conversation/Markdown/plugins/Mention/Render.tsx +++ b/src/features/Conversation/Markdown/plugins/Mention/Render.tsx @@ -10,7 +10,7 @@ import { DEFAULT_AVATAR } from '@/const/index'; import { useSessionStore } from '@/store/session'; import { sessionSelectors } from '@/store/session/selectors'; -import type {MarkdownElementProps} from '../type'; +import { type MarkdownElementProps } from '../type'; const styles = createStaticStyles(({ css, cssVar }) => ({ mention: css` diff --git a/src/features/Conversation/Markdown/plugins/Mention/index.ts b/src/features/Conversation/Markdown/plugins/Mention/index.ts index 6b9b3f9335..2ee6d4f6e3 100644 --- a/src/features/Conversation/Markdown/plugins/Mention/index.ts +++ b/src/features/Conversation/Markdown/plugins/Mention/index.ts @@ -1,7 +1,7 @@ import { MENTION_TAG } from '@/const/plugin'; import { createRemarkSelfClosingTagPlugin } from '../remarkPlugins/createRemarkSelfClosingTagPlugin'; -import type {MarkdownElement} from '../type'; +import { type MarkdownElement } from '../type'; import Component from './Render'; const Mention: MarkdownElement = { diff --git a/src/features/Conversation/Markdown/plugins/Thinking/Render.tsx b/src/features/Conversation/Markdown/plugins/Thinking/Render.tsx index 6ac716075e..2284e8f9ad 100644 --- a/src/features/Conversation/Markdown/plugins/Thinking/Render.tsx +++ b/src/features/Conversation/Markdown/plugins/Thinking/Render.tsx @@ -5,7 +5,7 @@ import { useUserStore } from '@/store/user'; import { userGeneralSettingsSelectors } from '@/store/user/selectors'; import { dataSelectors, useConversationStore } from '../../../store'; -import type {MarkdownElementProps} from '../type'; +import { type MarkdownElementProps } from '../type'; const isThinkingClosed = (input: string = '') => { const openTag = ``; diff --git a/src/features/Conversation/Markdown/plugins/Thinking/index.ts b/src/features/Conversation/Markdown/plugins/Thinking/index.ts index e56547f528..730765bd12 100644 --- a/src/features/Conversation/Markdown/plugins/Thinking/index.ts +++ b/src/features/Conversation/Markdown/plugins/Thinking/index.ts @@ -1,7 +1,7 @@ import { THINKING_TAG } from '@/const/plugin'; import { createRemarkCustomTagPlugin } from '../remarkPlugins/createRemarkCustomTagPlugin'; -import type {MarkdownElement} from '../type'; +import { type MarkdownElement } from '../type'; import Component from './Render'; const ThinkingElement: MarkdownElement = { diff --git a/src/features/Conversation/Markdown/plugins/index.ts b/src/features/Conversation/Markdown/plugins/index.ts index 7c3c2e0de9..e3c62b93ff 100644 --- a/src/features/Conversation/Markdown/plugins/index.ts +++ b/src/features/Conversation/Markdown/plugins/index.ts @@ -3,7 +3,7 @@ import LobeThinking from './LobeThinking'; import LocalFile from './LocalFile'; import Mention from './Mention'; import Thinking from './Thinking'; -import type {MarkdownElement} from './type'; +import { type MarkdownElement } from './type'; export type { MarkdownElement } from './type'; diff --git a/src/features/Conversation/Markdown/plugins/remarkPlugins/createRemarkSelfClosingTagPlugin.ts b/src/features/Conversation/Markdown/plugins/remarkPlugins/createRemarkSelfClosingTagPlugin.ts index db6eb77ee9..763e6f201e 100644 --- a/src/features/Conversation/Markdown/plugins/remarkPlugins/createRemarkSelfClosingTagPlugin.ts +++ b/src/features/Conversation/Markdown/plugins/remarkPlugins/createRemarkSelfClosingTagPlugin.ts @@ -1,5 +1,5 @@ import debug from 'debug'; -import type { Plugin } from 'unified'; +import { type Plugin } from 'unified'; import { SKIP, visit } from 'unist-util-visit'; // 创建 debugger 实例 diff --git a/src/features/Conversation/Markdown/plugins/remarkPlugins/getNodeContent.test.ts b/src/features/Conversation/Markdown/plugins/remarkPlugins/getNodeContent.test.ts index 52febbbfb4..e194c0e3b9 100644 --- a/src/features/Conversation/Markdown/plugins/remarkPlugins/getNodeContent.test.ts +++ b/src/features/Conversation/Markdown/plugins/remarkPlugins/getNodeContent.test.ts @@ -1,4 +1,4 @@ -import type { Parent } from 'unist'; +import { type Parent } from 'unist'; import { expect } from 'vitest'; import { treeNodeToString } from './getNodeContent'; diff --git a/src/features/Conversation/Markdown/plugins/remarkPlugins/getNodeContent.ts b/src/features/Conversation/Markdown/plugins/remarkPlugins/getNodeContent.ts index cfca89b1c7..d7e030af9c 100644 --- a/src/features/Conversation/Markdown/plugins/remarkPlugins/getNodeContent.ts +++ b/src/features/Conversation/Markdown/plugins/remarkPlugins/getNodeContent.ts @@ -1,5 +1,5 @@ import { toMarkdown } from 'mdast-util-to-markdown'; -import type {Parent} from 'unist'; +import { type Parent } from 'unist'; const processNode = (node: any): string => { // 处理数学公式节点 diff --git a/src/features/Conversation/Markdown/plugins/type.ts b/src/features/Conversation/Markdown/plugins/type.ts index 502a476fea..4201b346c2 100644 --- a/src/features/Conversation/Markdown/plugins/type.ts +++ b/src/features/Conversation/Markdown/plugins/type.ts @@ -1,4 +1,4 @@ -import type {FC, ReactNode} from 'react'; +import { type FC, type ReactNode } from 'react'; export interface MarkdownElementProps { children: ReactNode; diff --git a/src/features/Conversation/Messages/AgentCouncil/components/AutoScrollShadow.tsx b/src/features/Conversation/Messages/AgentCouncil/components/AutoScrollShadow.tsx index 12daa53fd5..645ccbada9 100644 --- a/src/features/Conversation/Messages/AgentCouncil/components/AutoScrollShadow.tsx +++ b/src/features/Conversation/Messages/AgentCouncil/components/AutoScrollShadow.tsx @@ -1,6 +1,6 @@ import { ScrollShadow } from '@lobehub/ui'; -import type {PropsWithChildren, RefObject} from 'react'; -import { memo, useEffect } from 'react'; +import { type PropsWithChildren, type RefObject } from 'react'; +import { memo, useEffect } from 'react'; import { useAutoScroll } from '@/hooks/useAutoScroll'; diff --git a/src/features/Conversation/Messages/AgentCouncil/components/CouncilList.tsx b/src/features/Conversation/Messages/AgentCouncil/components/CouncilList.tsx index b335299631..e82d32ce09 100644 --- a/src/features/Conversation/Messages/AgentCouncil/components/CouncilList.tsx +++ b/src/features/Conversation/Messages/AgentCouncil/components/CouncilList.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {UIChatMessage} from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { Flexbox } from '@lobehub/ui'; import { Divider } from 'antd'; import isEqual from 'fast-deep-equal'; diff --git a/src/features/Conversation/Messages/AgentCouncil/components/CouncilMember.tsx b/src/features/Conversation/Messages/AgentCouncil/components/CouncilMember.tsx index fa8e2e2a4d..b7bada6b86 100644 --- a/src/features/Conversation/Messages/AgentCouncil/components/CouncilMember.tsx +++ b/src/features/Conversation/Messages/AgentCouncil/components/CouncilMember.tsx @@ -1,8 +1,8 @@ 'use client'; import isEqual from 'fast-deep-equal'; -import type {MouseEventHandler} from 'react'; -import { memo, useCallback } from 'react'; +import { type MouseEventHandler } from 'react'; +import { memo, useCallback } from 'react'; import { LOADING_FLAT } from '@/const/message'; import { MESSAGE_ACTION_BAR_PORTAL_ATTRIBUTES } from '@/const/messageActionPortal'; @@ -10,7 +10,7 @@ import { ChatItem } from '@/features/Conversation/ChatItem'; import ErrorMessageExtra, { useErrorContent } from '@/features/Conversation/Error'; import { AssistantMessageExtra } from '@/features/Conversation/Messages/Assistant/Extra'; import { normalizeThinkTags, processWithArtifact } from '@/features/Conversation/utils/markdown'; -import type { UIChatMessage } from '@/types/index'; +import { type UIChatMessage } from '@/types/index'; import { useAgentMeta } from '../../../hooks'; import { messageStateSelectors, useConversationStore } from '../../../store'; diff --git a/src/features/Conversation/Messages/AgentCouncil/components/ScrollShadowWithButton.tsx b/src/features/Conversation/Messages/AgentCouncil/components/ScrollShadowWithButton.tsx index 85c0b643a5..fca707a38b 100644 --- a/src/features/Conversation/Messages/AgentCouncil/components/ScrollShadowWithButton.tsx +++ b/src/features/Conversation/Messages/AgentCouncil/components/ScrollShadowWithButton.tsx @@ -1,5 +1,5 @@ -import type {FlexboxProps} from '@lobehub/ui'; -import { Button, Flexbox, ScrollShadow } from '@lobehub/ui'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Button, Flexbox, ScrollShadow } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; import { ChevronLeft, ChevronRight } from 'lucide-react'; import { memo, useCallback, useEffect, useRef, useState } from 'react'; diff --git a/src/features/Conversation/Messages/AgentCouncil/index.tsx b/src/features/Conversation/Messages/AgentCouncil/index.tsx index c3b2ce9bcf..29c6920037 100644 --- a/src/features/Conversation/Messages/AgentCouncil/index.tsx +++ b/src/features/Conversation/Messages/AgentCouncil/index.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {UIChatMessage} from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { Flexbox, Icon } from '@lobehub/ui'; import { Segmented } from 'antd'; import isEqual from 'fast-deep-equal'; diff --git a/src/features/Conversation/Messages/Assistant/Actions/Error.tsx b/src/features/Conversation/Messages/Assistant/Actions/Error.tsx index d4bb44d36c..61e88df2fb 100644 --- a/src/features/Conversation/Messages/Assistant/Actions/Error.tsx +++ b/src/features/Conversation/Messages/Assistant/Actions/Error.tsx @@ -1,8 +1,8 @@ -import type { ActionIconGroupEvent } from '@lobehub/ui'; +import { type ActionIconGroupEvent } from '@lobehub/ui'; import { ActionIconGroup } from '@lobehub/ui'; import { memo } from 'react'; -import type { AssistantActions } from './useAssistantActions'; +import { type AssistantActions } from './useAssistantActions'; interface ErrorActionsBarProps { actions: AssistantActions; diff --git a/src/features/Conversation/Messages/Assistant/Actions/useAssistantActions.ts b/src/features/Conversation/Messages/Assistant/Actions/useAssistantActions.ts index 4ad769f863..39a06ce683 100644 --- a/src/features/Conversation/Messages/Assistant/Actions/useAssistantActions.ts +++ b/src/features/Conversation/Messages/Assistant/Actions/useAssistantActions.ts @@ -1,4 +1,4 @@ -import type { ActionIconGroupItemType } from '@lobehub/ui'; +import { type ActionIconGroupItemType } from '@lobehub/ui'; import { copyToClipboard } from '@lobehub/ui'; import { App } from 'antd'; import { css, cx } from 'antd-style'; @@ -18,7 +18,7 @@ import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { localeOptions } from '@/locales/resources'; -import type {UIChatMessage} from '@/types/index'; +import { type UIChatMessage } from '@/types/index'; import { messageStateSelectors, useConversationStore } from '../../../store'; diff --git a/src/features/Conversation/Messages/Assistant/Extra/index.tsx b/src/features/Conversation/Messages/Assistant/Extra/index.tsx index bcea3637d0..b4884d7cb6 100644 --- a/src/features/Conversation/Messages/Assistant/Extra/index.tsx +++ b/src/features/Conversation/Messages/Assistant/Extra/index.tsx @@ -1,5 +1,5 @@ import { LOADING_FLAT } from '@lobechat/const'; -import type {ModelPerformance, ModelUsage} from '@lobechat/types'; +import { type ModelPerformance, type ModelUsage } from '@lobechat/types'; import { Flexbox } from '@lobehub/ui'; import { memo } from 'react'; diff --git a/src/features/Conversation/Messages/Assistant/components/MessageContent.tsx b/src/features/Conversation/Messages/Assistant/components/MessageContent.tsx index 4c6cf91cf8..3a71fb8904 100644 --- a/src/features/Conversation/Messages/Assistant/components/MessageContent.tsx +++ b/src/features/Conversation/Messages/Assistant/components/MessageContent.tsx @@ -1,5 +1,5 @@ import { LOADING_FLAT } from '@lobechat/const'; -import type {UIChatMessage} from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { Flexbox } from '@lobehub/ui'; import { memo, useCallback } from 'react'; diff --git a/src/features/Conversation/Messages/Assistant/index.tsx b/src/features/Conversation/Messages/Assistant/index.tsx index 804d7187d9..313dac5752 100644 --- a/src/features/Conversation/Messages/Assistant/index.tsx +++ b/src/features/Conversation/Messages/Assistant/index.tsx @@ -2,8 +2,8 @@ import { LOADING_FLAT } from '@lobechat/const'; import isEqual from 'fast-deep-equal'; -import type {MouseEventHandler} from 'react'; -import { memo, useCallback } from 'react'; +import { type MouseEventHandler } from 'react'; +import { memo, useCallback } from 'react'; import { MESSAGE_ACTION_BAR_PORTAL_ATTRIBUTES } from '@/const/messageActionPortal'; import { ChatItem } from '@/features/Conversation/ChatItem'; diff --git a/src/features/Conversation/Messages/Assistant/useMarkdown.tsx b/src/features/Conversation/Messages/Assistant/useMarkdown.tsx index cd97418a17..325162b6d4 100644 --- a/src/features/Conversation/Messages/Assistant/useMarkdown.tsx +++ b/src/features/Conversation/Messages/Assistant/useMarkdown.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {MarkdownProps} from '@lobehub/ui'; +import { type MarkdownProps } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; import { useMemo } from 'react'; diff --git a/src/features/Conversation/Messages/AssistantGroup/Actions/useGroupActions.ts b/src/features/Conversation/Messages/AssistantGroup/Actions/useGroupActions.ts index a13a51a056..2809674e94 100644 --- a/src/features/Conversation/Messages/AssistantGroup/Actions/useGroupActions.ts +++ b/src/features/Conversation/Messages/AssistantGroup/Actions/useGroupActions.ts @@ -1,4 +1,4 @@ -import type { ActionIconGroupItemType } from '@lobehub/ui'; +import { type ActionIconGroupItemType } from '@lobehub/ui'; import { copyToClipboard } from '@lobehub/ui'; import { App } from 'antd'; import { @@ -17,7 +17,7 @@ import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { localeOptions } from '@/locales/resources'; -import type {AssistantContentBlock, UIChatMessage} from '@/types/index'; +import { type AssistantContentBlock, type UIChatMessage } from '@/types/index'; import { dataSelectors, messageStateSelectors, useConversationStore } from '../../../store'; diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Actions/Settings.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Actions/Settings.tsx index 3a57445aca..5aca2c2107 100644 --- a/src/features/Conversation/Messages/AssistantGroup/Tool/Actions/Settings.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Actions/Settings.tsx @@ -3,7 +3,7 @@ import { LucideSettings } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type { PluginDetailModalProps } from '@/features/PluginDetailModal'; +import { type PluginDetailModalProps } from '@/features/PluginDetailModal'; import dynamic from '@/libs/next/dynamic'; import { pluginHelpers, useToolStore } from '@/store/tool'; import { pluginSelectors } from '@/store/tool/selectors'; diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Debug/index.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Debug/index.tsx index 9933a7d244..1f62c7930d 100644 --- a/src/features/Conversation/Messages/AssistantGroup/Tool/Debug/index.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Debug/index.tsx @@ -1,6 +1,6 @@ -import type {ToolIntervention} from '@lobechat/types'; -import type {TabsProps} from '@lobehub/ui'; -import { Block, Highlighter, Icon, Tabs } from '@lobehub/ui'; +import { type ToolIntervention } from '@lobechat/types'; +import { type TabsProps } from '@lobehub/ui'; +import { Block, Highlighter, Icon, Tabs } from '@lobehub/ui'; import { BracesIcon, FunctionSquareIcon, diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Arguments/index.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Arguments/index.tsx index 67e155fab8..60181c78e4 100644 --- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Arguments/index.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Arguments/index.tsx @@ -2,11 +2,11 @@ import { Flexbox, Highlighter, Text } from '@lobehub/ui'; import { Divider } from 'antd'; import { cssVar, cx } from 'antd-style'; import { parse } from 'partial-json'; -import type {ReactNode} from 'react'; -import { memo, useMemo } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {DescriptionItem} from '@/components/Descriptions'; +import { type DescriptionItem } from '@/components/Descriptions'; import Descriptions from '@/components/Descriptions'; import { useYamlArguments } from '@/hooks/useYamlArguments'; import { shinyTextStyles } from '@/styles'; diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/ErrorResponse.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/ErrorResponse.tsx index 329dfbb345..c2926aeefe 100644 --- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/ErrorResponse.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/ErrorResponse.tsx @@ -1,4 +1,4 @@ -import type {ChatMessageError, ChatPluginPayload} from '@lobechat/types'; +import { type ChatMessageError, type ChatPluginPayload } from '@lobechat/types'; import { Alert, Flexbox, Highlighter } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { memo } from 'react'; diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/ApprovalActions.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/ApprovalActions.tsx index e794d6ded3..e4730e2f7d 100644 --- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/ApprovalActions.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/ApprovalActions.tsx @@ -8,7 +8,7 @@ import { useUserStore } from '@/store/user'; import { useConversationStore } from '../../../../../store'; import { useMessageAggregationContext } from '../../../../Contexts/MessageAggregationContext'; -import type {ApprovalMode} from './index'; +import { type ApprovalMode } from './index'; interface ApprovalActionsProps { apiName: string; diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/KeyValueEditor.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/KeyValueEditor.tsx index eb6bf39e3f..adba682a10 100644 --- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/KeyValueEditor.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/KeyValueEditor.tsx @@ -1,6 +1,6 @@ import { ActionIcon, Button, Flexbox, Icon, Input } from '@lobehub/ui'; -import type {FormInstance} from 'antd'; -import { App, Form } from 'antd'; +import { type FormInstance } from 'antd'; +import { App, Form } from 'antd'; import { createStaticStyles } from 'antd-style'; import { LucidePlus, LucideTrash } from 'lucide-react'; import { memo, useEffect, useRef, useState } from 'react'; diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/ModeSelector.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/ModeSelector.tsx index 135d183e66..08057eca02 100644 --- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/ModeSelector.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/ModeSelector.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { Button, Center, DropdownMenu, Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Button, Center, DropdownMenu, Icon } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { Check, ChevronDown, Hand, ListChecks, Zap } from 'lucide-react'; import { memo, useCallback, useMemo } from 'react'; @@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next'; import { useUserStore } from '@/store/user'; import { toolInterventionSelectors } from '@/store/user/selectors'; -import type {ApprovalMode} from './index'; +import { type ApprovalMode } from './index'; const styles = createStaticStyles(({ css, cssVar }) => ({ icon: css` diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/PluginSettings.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/PluginSettings.tsx index 927954dd38..405f972e5d 100644 --- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/PluginSettings.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/PluginSettings.tsx @@ -1,4 +1,4 @@ -import type {ChatPluginPayload} from '@lobechat/types'; +import { type ChatPluginPayload } from '@lobechat/types'; import { Avatar, Button, Center, Flexbox } from '@lobehub/ui'; import { Divider } from 'antd'; import { cssVar } from 'antd-style'; diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Render/CustomRender.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Render/CustomRender.tsx index e4db01cccd..b0ec9127a2 100644 --- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Render/CustomRender.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Render/CustomRender.tsx @@ -2,7 +2,7 @@ import { Flexbox } from '@lobehub/ui'; import { memo } from 'react'; import PluginRender from '@/features/PluginsUI/Render'; -import type {ChatPluginPayload} from '@/types/index'; +import { type ChatPluginPayload } from '@/types/index'; interface CustomRenderProps { content: string; diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Render/index.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Render/index.tsx index c06920d0e9..efda18aa01 100644 --- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Render/index.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Render/index.tsx @@ -1,4 +1,4 @@ -import type {ChatPluginPayload} from '@lobechat/types'; +import { type ChatPluginPayload } from '@lobechat/types'; import { memo } from 'react'; import { getBuiltinRender } from '@/tools/renders'; diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/index.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/index.tsx index ce479fb3e1..6a6cf9e7f9 100644 --- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/index.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/index.tsx @@ -1,7 +1,7 @@ -import type {ChatToolResult, ToolIntervention} from '@lobechat/types'; +import { type ChatToolResult, type ToolIntervention } from '@lobechat/types'; import { safeParsePartialJSON } from '@lobechat/utils'; import { Flexbox } from '@lobehub/ui'; -import { memo,Suspense } from 'react'; +import { memo, Suspense } from 'react'; import { getBuiltinStreaming } from '@/tools/streamings'; diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/StatusIndicator.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/StatusIndicator.tsx index 77513ba8f9..63b4dc84fb 100644 --- a/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/StatusIndicator.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/StatusIndicator.tsx @@ -1,4 +1,4 @@ -import type {ToolIntervention} from '@lobechat/types'; +import { type ToolIntervention } from '@lobechat/types'; import { Block, Icon, Tooltip } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { Ban, Check, HandIcon, PauseIcon, X } from 'lucide-react'; diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/index.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/index.tsx index 9800b6f1b3..25b62d1e53 100644 --- a/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/index.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/index.tsx @@ -1,4 +1,4 @@ -import type {ToolIntervention} from '@lobechat/types'; +import { type ToolIntervention } from '@lobechat/types'; import { safeParseJSON, safeParsePartialJSON } from '@lobechat/utils'; import { Flexbox } from '@lobehub/ui'; import { memo } from 'react'; diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/index.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/index.tsx index 1755f9bf74..8250a2ec52 100644 --- a/src/features/Conversation/Messages/AssistantGroup/Tool/index.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/Tool/index.tsx @@ -1,5 +1,5 @@ import { LOADING_FLAT } from '@lobechat/const'; -import type {ChatToolResult, ToolIntervention} from '@lobechat/types'; +import { type ChatToolResult, type ToolIntervention } from '@lobechat/types'; import { AccordionItem, Flexbox, Skeleton } from '@lobehub/ui'; import { Divider } from 'antd'; import { memo, useEffect, useState } from 'react'; diff --git a/src/features/Conversation/Messages/AssistantGroup/Tools.tsx b/src/features/Conversation/Messages/AssistantGroup/Tools.tsx index 2f1222cf39..f701e3c126 100644 --- a/src/features/Conversation/Messages/AssistantGroup/Tools.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/Tools.tsx @@ -1,4 +1,4 @@ -import type {ChatToolPayloadWithResult} from '@lobechat/types'; +import { type ChatToolPayloadWithResult } from '@lobechat/types'; import { Flexbox } from '@lobehub/ui'; import { memo } from 'react'; diff --git a/src/features/Conversation/Messages/AssistantGroup/components/ContentBlock.tsx b/src/features/Conversation/Messages/AssistantGroup/components/ContentBlock.tsx index 28b9fce227..4300e998e4 100644 --- a/src/features/Conversation/Messages/AssistantGroup/components/ContentBlock.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/components/ContentBlock.tsx @@ -3,7 +3,7 @@ import { memo, useCallback } from 'react'; import { LOADING_FLAT } from '@/const/message'; import { useErrorContent } from '@/features/Conversation/Error'; -import type {AssistantContentBlock} from '@/types/index'; +import { type AssistantContentBlock } from '@/types/index'; import ErrorContent from '../../../ChatItem/components/ErrorContent'; import { messageStateSelectors, useConversationStore } from '../../../store'; diff --git a/src/features/Conversation/Messages/AssistantGroup/components/Group.tsx b/src/features/Conversation/Messages/AssistantGroup/components/Group.tsx index 75c43cfdaa..5b7837b586 100644 --- a/src/features/Conversation/Messages/AssistantGroup/components/Group.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/components/Group.tsx @@ -3,7 +3,7 @@ import { createStaticStyles } from 'antd-style'; import isEqual from 'fast-deep-equal'; import { memo, useMemo } from 'react'; -import type {AssistantContentBlock} from '@/types/index'; +import { type AssistantContentBlock } from '@/types/index'; import { messageStateSelectors, useConversationStore } from '../../../store'; import { MessageAggregationContext } from '../../Contexts/MessageAggregationContext'; diff --git a/src/features/Conversation/Messages/AssistantGroup/components/GroupItem.tsx b/src/features/Conversation/Messages/AssistantGroup/components/GroupItem.tsx index afaa234946..6ac25934b0 100644 --- a/src/features/Conversation/Messages/AssistantGroup/components/GroupItem.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/components/GroupItem.tsx @@ -2,7 +2,7 @@ import { Flexbox } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; import { memo } from 'react'; -import type {AssistantContentBlock} from '@/types/index'; +import { type AssistantContentBlock } from '@/types/index'; import { useConversationStore } from '../../../store'; import ContentBlock from './ContentBlock'; diff --git a/src/features/Conversation/Messages/AssistantGroup/useMarkdown.tsx b/src/features/Conversation/Messages/AssistantGroup/useMarkdown.tsx index 6b7b967070..ef42098dab 100644 --- a/src/features/Conversation/Messages/AssistantGroup/useMarkdown.tsx +++ b/src/features/Conversation/Messages/AssistantGroup/useMarkdown.tsx @@ -1,11 +1,11 @@ -import type {MarkdownProps} from '@lobehub/ui'; +import { type MarkdownProps } from '@lobehub/ui'; import { useMemo } from 'react'; import { useUserStore } from '@/store/user'; import { userGeneralSettingsSelectors } from '@/store/user/selectors'; -import type {MarkdownElement} from '../../Markdown/plugins'; -import { markdownElements } from '../../Markdown/plugins'; +import { type MarkdownElement } from '../../Markdown/plugins'; +import { markdownElements } from '../../Markdown/plugins'; import { messageStateSelectors, useConversationStore } from '../../store'; const rehypePlugins = markdownElements diff --git a/src/features/Conversation/Messages/CompressedGroup/CompressedMessageItem.tsx b/src/features/Conversation/Messages/CompressedGroup/CompressedMessageItem.tsx index 9fe774d5a2..bc639eb1d4 100644 --- a/src/features/Conversation/Messages/CompressedGroup/CompressedMessageItem.tsx +++ b/src/features/Conversation/Messages/CompressedGroup/CompressedMessageItem.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { Avatar, Flexbox } from '@lobehub/ui'; import { memo } from 'react'; diff --git a/src/features/Conversation/Messages/Contexts/MessageActionProvider.tsx b/src/features/Conversation/Messages/Contexts/MessageActionProvider.tsx index 33e9fc54e2..4f2f0d70d2 100644 --- a/src/features/Conversation/Messages/Contexts/MessageActionProvider.tsx +++ b/src/features/Conversation/Messages/Contexts/MessageActionProvider.tsx @@ -1,6 +1,6 @@ import { isEqual } from 'es-toolkit/compat'; -import type {FC, PropsWithChildren} from 'react'; -import { memo, useEffect, useRef, useState } from 'react'; +import { type FC, type PropsWithChildren } from 'react'; +import { memo, useEffect, useRef, useState } from 'react'; import { createPortal } from 'react-dom'; import { MESSAGE_ACTION_BAR_PORTAL_SELECTORS } from '@/const/messageActionPortal'; @@ -9,14 +9,14 @@ import { dataSelectors, useConversationStore } from '../../store'; import { AssistantActionsBar } from '../Assistant/Actions'; import { GroupActionsBar } from '../AssistantGroup/Actions'; import { UserActionsBar } from '../User/Actions'; -import type {MessageActionType} from './message-action-context'; +import { type MessageActionType } from './message-action-context'; import { MessageItemActionElementPortialContext, MessageItemActionTypeContext, SetMessageItemActionElementPortialContext, SetMessageItemActionTypeContext, useMessageItemActionElementPortialContext, - useMessageItemActionTypeContext + useMessageItemActionTypeContext, } from './message-action-context'; interface SingletonPortalProps { diff --git a/src/features/Conversation/Messages/Contexts/message-action-context.ts b/src/features/Conversation/Messages/Contexts/message-action-context.ts index 113ced3a95..a7aa292d40 100644 --- a/src/features/Conversation/Messages/Contexts/message-action-context.ts +++ b/src/features/Conversation/Messages/Contexts/message-action-context.ts @@ -1,5 +1,5 @@ -import type {Dispatch, SetStateAction} from 'react'; -import { createContext, useContext } from 'react'; +import { type Dispatch, type SetStateAction } from 'react'; +import { createContext, useContext } from 'react'; export const MessageItemActionElementPortialContext = createContext(null); diff --git a/src/features/Conversation/Messages/GroupTasks/TaskItem/ClientTaskItem.tsx b/src/features/Conversation/Messages/GroupTasks/TaskItem/ClientTaskItem.tsx index 645989cdfe..2a3986e27b 100644 --- a/src/features/Conversation/Messages/GroupTasks/TaskItem/ClientTaskItem.tsx +++ b/src/features/Conversation/Messages/GroupTasks/TaskItem/ClientTaskItem.tsx @@ -8,7 +8,7 @@ import { agentGroupSelectors } from '@/store/agentGroup/selectors'; import { useChatStore } from '@/store/chat'; import { displayMessageSelectors } from '@/store/chat/selectors'; import { messageMapKey } from '@/store/chat/utils/messageMapKey'; -import type { UIChatMessage } from '@/types/index'; +import { type UIChatMessage } from '@/types/index'; import { ThreadStatus } from '@/types/index'; import { @@ -17,7 +17,7 @@ import { isProcessingStatus, TaskMessages, } from '../../Tasks/shared'; -import type {TaskMetrics} from './TaskTitle'; +import { type TaskMetrics } from './TaskTitle'; import TaskTitle from './TaskTitle'; interface ClientTaskItemProps { diff --git a/src/features/Conversation/Messages/GroupTasks/TaskItem/ServerTaskItem.tsx b/src/features/Conversation/Messages/GroupTasks/TaskItem/ServerTaskItem.tsx index 33d3003d10..b17392f4f4 100644 --- a/src/features/Conversation/Messages/GroupTasks/TaskItem/ServerTaskItem.tsx +++ b/src/features/Conversation/Messages/GroupTasks/TaskItem/ServerTaskItem.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { ThreadStatus } from '@lobechat/types'; import { AccordionItem, Block } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; @@ -10,7 +10,7 @@ import { useAgentGroupStore } from '@/store/agentGroup'; import { agentGroupSelectors } from '@/store/agentGroup/selectors'; import { TaskContent } from '../../Tasks/shared'; -import type {TaskMetrics} from './TaskTitle'; +import { type TaskMetrics } from './TaskTitle'; import TaskTitle from './TaskTitle'; interface ServerTaskItemProps { diff --git a/src/features/Conversation/Messages/GroupTasks/TaskItem/index.tsx b/src/features/Conversation/Messages/GroupTasks/TaskItem/index.tsx index 992b1b3b1d..f5507de69c 100644 --- a/src/features/Conversation/Messages/GroupTasks/TaskItem/index.tsx +++ b/src/features/Conversation/Messages/GroupTasks/TaskItem/index.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import isEqual from 'fast-deep-equal'; import { memo } from 'react'; diff --git a/src/features/Conversation/Messages/GroupTasks/index.tsx b/src/features/Conversation/Messages/GroupTasks/index.tsx index c015bacdca..437363eaa9 100644 --- a/src/features/Conversation/Messages/GroupTasks/index.tsx +++ b/src/features/Conversation/Messages/GroupTasks/index.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {UIChatMessage} from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { Block, Flexbox, GroupAvatar, Icon, Tag } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import isEqual from 'fast-deep-equal'; diff --git a/src/features/Conversation/Messages/Supervisor/Actions/useGroupActions.ts b/src/features/Conversation/Messages/Supervisor/Actions/useGroupActions.ts index dc2e5841ee..31c411e2bf 100644 --- a/src/features/Conversation/Messages/Supervisor/Actions/useGroupActions.ts +++ b/src/features/Conversation/Messages/Supervisor/Actions/useGroupActions.ts @@ -1,4 +1,4 @@ -import type { ActionIconGroupItemType } from '@lobehub/ui'; +import { type ActionIconGroupItemType } from '@lobehub/ui'; import { copyToClipboard } from '@lobehub/ui'; import { App } from 'antd'; import { @@ -15,7 +15,7 @@ import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { localeOptions } from '@/locales/resources'; -import type {AssistantContentBlock, UIChatMessage} from '@/types/index'; +import { type AssistantContentBlock, type UIChatMessage } from '@/types/index'; import { dataSelectors, messageStateSelectors, useConversationStore } from '../../../store'; diff --git a/src/features/Conversation/Messages/Supervisor/components/ContentBlock.tsx b/src/features/Conversation/Messages/Supervisor/components/ContentBlock.tsx index be8710e29e..91616a1d77 100644 --- a/src/features/Conversation/Messages/Supervisor/components/ContentBlock.tsx +++ b/src/features/Conversation/Messages/Supervisor/components/ContentBlock.tsx @@ -3,7 +3,7 @@ import { memo } from 'react'; import { LOADING_FLAT } from '@/const/message'; import { useErrorContent } from '@/features/Conversation/Error'; -import type {AssistantContentBlock} from '@/types/index'; +import { type AssistantContentBlock } from '@/types/index'; import ErrorContent from '../../../ChatItem/components/ErrorContent'; import { messageStateSelectors, useConversationStore } from '../../../store'; diff --git a/src/features/Conversation/Messages/Supervisor/components/Group.tsx b/src/features/Conversation/Messages/Supervisor/components/Group.tsx index 9f837a4af6..01123f0ce3 100644 --- a/src/features/Conversation/Messages/Supervisor/components/Group.tsx +++ b/src/features/Conversation/Messages/Supervisor/components/Group.tsx @@ -3,7 +3,7 @@ import { createStaticStyles } from 'antd-style'; import isEqual from 'fast-deep-equal'; import { memo, useMemo } from 'react'; -import type {AssistantContentBlock} from '@/types/index'; +import { type AssistantContentBlock } from '@/types/index'; import { messageStateSelectors, useConversationStore } from '../../../store'; import { MessageAggregationContext } from '../../Contexts/MessageAggregationContext'; diff --git a/src/features/Conversation/Messages/Supervisor/index.tsx b/src/features/Conversation/Messages/Supervisor/index.tsx index 401fd4871d..56048d6aa9 100644 --- a/src/features/Conversation/Messages/Supervisor/index.tsx +++ b/src/features/Conversation/Messages/Supervisor/index.tsx @@ -3,8 +3,8 @@ import type { EmojiReaction } from '@lobechat/types'; import { Tag } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; -import type {MouseEventHandler} from 'react'; -import { memo, useCallback } from 'react'; +import { type MouseEventHandler } from 'react'; +import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { MESSAGE_ACTION_BAR_PORTAL_ATTRIBUTES } from '@/const/messageActionPortal'; diff --git a/src/features/Conversation/Messages/Task/Actions/Error.tsx b/src/features/Conversation/Messages/Task/Actions/Error.tsx index d4bb44d36c..61e88df2fb 100644 --- a/src/features/Conversation/Messages/Task/Actions/Error.tsx +++ b/src/features/Conversation/Messages/Task/Actions/Error.tsx @@ -1,8 +1,8 @@ -import type { ActionIconGroupEvent } from '@lobehub/ui'; +import { type ActionIconGroupEvent } from '@lobehub/ui'; import { ActionIconGroup } from '@lobehub/ui'; import { memo } from 'react'; -import type { AssistantActions } from './useAssistantActions'; +import { type AssistantActions } from './useAssistantActions'; interface ErrorActionsBarProps { actions: AssistantActions; diff --git a/src/features/Conversation/Messages/Task/Actions/index.tsx b/src/features/Conversation/Messages/Task/Actions/index.tsx index 5ed8a3d2ad..3d4001de89 100644 --- a/src/features/Conversation/Messages/Task/Actions/index.tsx +++ b/src/features/Conversation/Messages/Task/Actions/index.tsx @@ -1,17 +1,17 @@ -import type {UIChatMessage} from '@lobechat/types'; -import type { ActionIconGroupEvent, ActionIconGroupItemType } from '@lobehub/ui'; +import { type UIChatMessage } from '@lobechat/types'; +import { type ActionIconGroupEvent, type ActionIconGroupItemType } from '@lobehub/ui'; import { ActionIconGroup, createRawModal } from '@lobehub/ui'; import { memo, useCallback, useMemo } from 'react'; import { useEventCallback } from '@/hooks/useEventCallback'; -import type {ShareModalProps} from '../../../components/ShareMessageModal'; +import { type ShareModalProps } from '../../../components/ShareMessageModal'; import ShareMessageModal from '../../../components/ShareMessageModal'; import { createStore, Provider, useConversationStoreApi } from '../../../store'; -import type { - MessageActionItem, - MessageActionItemOrDivider, - MessageActionsConfig, +import { + type MessageActionItem, + type MessageActionItemOrDivider, + type MessageActionsConfig, } from '../../../types'; import { ErrorActionsBar } from './Error'; import { useAssistantActions } from './useAssistantActions'; diff --git a/src/features/Conversation/Messages/Task/Actions/useAssistantActions.ts b/src/features/Conversation/Messages/Task/Actions/useAssistantActions.ts index 21b591803f..157dcfd5b3 100644 --- a/src/features/Conversation/Messages/Task/Actions/useAssistantActions.ts +++ b/src/features/Conversation/Messages/Task/Actions/useAssistantActions.ts @@ -1,4 +1,4 @@ -import type { ActionIconGroupItemType } from '@lobehub/ui'; +import { type ActionIconGroupItemType } from '@lobehub/ui'; import { copyToClipboard } from '@lobehub/ui'; import { App } from 'antd'; import { @@ -13,7 +13,7 @@ import { import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {UIChatMessage} from '@/types/index'; +import { type UIChatMessage } from '@/types/index'; import { messageStateSelectors, useConversationStore } from '../../../store'; diff --git a/src/features/Conversation/Messages/Task/ClientTaskDetail/index.tsx b/src/features/Conversation/Messages/Task/ClientTaskDetail/index.tsx index 5b4e3d4120..b821635447 100644 --- a/src/features/Conversation/Messages/Task/ClientTaskDetail/index.tsx +++ b/src/features/Conversation/Messages/Task/ClientTaskDetail/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {TaskDetail} from '@lobechat/types'; -import { ThreadStatus } from '@lobechat/types'; +import { type TaskDetail } from '@lobechat/types'; +import { ThreadStatus } from '@lobechat/types'; import { memo, useMemo } from 'react'; import BubblesLoading from '@/components/BubblesLoading'; diff --git a/src/features/Conversation/Messages/Task/TaskDetailPanel/StatusContent.tsx b/src/features/Conversation/Messages/Task/TaskDetailPanel/StatusContent.tsx index 50c2838a5f..3548fff61d 100644 --- a/src/features/Conversation/Messages/Task/TaskDetailPanel/StatusContent.tsx +++ b/src/features/Conversation/Messages/Task/TaskDetailPanel/StatusContent.tsx @@ -3,8 +3,8 @@ import { memo } from 'react'; import { useChatStore } from '@/store/chat'; -import type {TaskDetail} from '@/types/index'; -import { ThreadStatus } from '@/types/index'; +import { type TaskDetail } from '@/types/index'; +import { ThreadStatus } from '@/types/index'; import { ErrorState, diff --git a/src/features/Conversation/Messages/Task/TaskDetailPanel/index.tsx b/src/features/Conversation/Messages/Task/TaskDetailPanel/index.tsx index d0cbbaf5cb..de98e93454 100644 --- a/src/features/Conversation/Messages/Task/TaskDetailPanel/index.tsx +++ b/src/features/Conversation/Messages/Task/TaskDetailPanel/index.tsx @@ -2,7 +2,7 @@ import { memo } from 'react'; -import type {TaskDetail} from '@/types/index'; +import { type TaskDetail } from '@/types/index'; import StatusContent from './StatusContent'; diff --git a/src/features/Conversation/Messages/Task/components/MessageContent.tsx b/src/features/Conversation/Messages/Task/components/MessageContent.tsx index 6988b8ac04..797b8df38b 100644 --- a/src/features/Conversation/Messages/Task/components/MessageContent.tsx +++ b/src/features/Conversation/Messages/Task/components/MessageContent.tsx @@ -1,5 +1,5 @@ import { LOADING_FLAT } from '@lobechat/const'; -import type {UIChatMessage} from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { Flexbox } from '@lobehub/ui'; import { memo } from 'react'; diff --git a/src/features/Conversation/Messages/Tasks/TaskItem/ClientTaskItem.tsx b/src/features/Conversation/Messages/Tasks/TaskItem/ClientTaskItem.tsx index 432f331033..18b3ccc145 100644 --- a/src/features/Conversation/Messages/Tasks/TaskItem/ClientTaskItem.tsx +++ b/src/features/Conversation/Messages/Tasks/TaskItem/ClientTaskItem.tsx @@ -6,11 +6,11 @@ import { memo, useMemo, useState } from 'react'; import { useChatStore } from '@/store/chat'; import { displayMessageSelectors } from '@/store/chat/selectors'; import { messageMapKey } from '@/store/chat/utils/messageMapKey'; -import type { UIChatMessage } from '@/types/index'; +import { type UIChatMessage } from '@/types/index'; import { ThreadStatus } from '@/types/index'; -import { ErrorState, InitializingState, isProcessingStatus,TaskMessages } from '../shared'; -import type {TaskMetrics} from './TaskTitle'; +import { ErrorState, InitializingState, isProcessingStatus, TaskMessages } from '../shared'; +import { type TaskMetrics } from './TaskTitle'; import TaskTitle from './TaskTitle'; interface ClientTaskItemProps { diff --git a/src/features/Conversation/Messages/Tasks/TaskItem/ServerTaskItem.tsx b/src/features/Conversation/Messages/Tasks/TaskItem/ServerTaskItem.tsx index 96cdbd1483..7413c197b4 100644 --- a/src/features/Conversation/Messages/Tasks/TaskItem/ServerTaskItem.tsx +++ b/src/features/Conversation/Messages/Tasks/TaskItem/ServerTaskItem.tsx @@ -3,11 +3,11 @@ import { AccordionItem, Block } from '@lobehub/ui'; import { memo, useMemo, useState } from 'react'; -import type { UIChatMessage } from '@/types/index'; +import { type UIChatMessage } from '@/types/index'; import { ThreadStatus } from '@/types/index'; import { TaskContent } from '../shared'; -import type {TaskMetrics} from './TaskTitle'; +import { type TaskMetrics } from './TaskTitle'; import TaskTitle from './TaskTitle'; interface ServerTaskItemProps { diff --git a/src/features/Conversation/Messages/Tasks/TaskItem/index.tsx b/src/features/Conversation/Messages/Tasks/TaskItem/index.tsx index e535c3a01c..28d69dc949 100644 --- a/src/features/Conversation/Messages/Tasks/TaskItem/index.tsx +++ b/src/features/Conversation/Messages/Tasks/TaskItem/index.tsx @@ -3,7 +3,7 @@ import isEqual from 'fast-deep-equal'; import { memo } from 'react'; -import type { UIChatMessage } from '@/types/index'; +import { type UIChatMessage } from '@/types/index'; import ClientTaskItem from './ClientTaskItem'; import ServerTaskItem from './ServerTaskItem'; diff --git a/src/features/Conversation/Messages/Tasks/index.tsx b/src/features/Conversation/Messages/Tasks/index.tsx index 23b48e732b..dfb0dcb37e 100644 --- a/src/features/Conversation/Messages/Tasks/index.tsx +++ b/src/features/Conversation/Messages/Tasks/index.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {UIChatMessage} from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { Flexbox, Tag } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; import { memo } from 'react'; diff --git a/src/features/Conversation/Messages/Tasks/shared/CompletedState.tsx b/src/features/Conversation/Messages/Tasks/shared/CompletedState.tsx index 62fc54bab1..90fea8f6fa 100644 --- a/src/features/Conversation/Messages/Tasks/shared/CompletedState.tsx +++ b/src/features/Conversation/Messages/Tasks/shared/CompletedState.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {TaskDetail} from '@lobechat/types'; -import type { IconProps} from '@lobehub/ui'; +import { type TaskDetail } from '@lobechat/types'; +import { type IconProps } from '@lobehub/ui'; import { Flexbox, Icon, Tag } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; import { Footprints, Timer, Wrench } from 'lucide-react'; diff --git a/src/features/Conversation/Messages/Tasks/shared/ErrorState.tsx b/src/features/Conversation/Messages/Tasks/shared/ErrorState.tsx index 47808932bf..aef903e12a 100644 --- a/src/features/Conversation/Messages/Tasks/shared/ErrorState.tsx +++ b/src/features/Conversation/Messages/Tasks/shared/ErrorState.tsx @@ -6,8 +6,8 @@ import { MessageSquare, Timer, Wrench } from 'lucide-react'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {TaskDetail} from '@/types/index'; -import { ThreadStatus } from '@/types/index'; +import { type TaskDetail } from '@/types/index'; +import { ThreadStatus } from '@/types/index'; import { MetricItem } from './CompletedState'; import { formatCost, formatDuration } from './utils'; diff --git a/src/features/Conversation/Messages/Tasks/shared/ProcessingState.tsx b/src/features/Conversation/Messages/Tasks/shared/ProcessingState.tsx index 25f77f95aa..cd2915fbd6 100644 --- a/src/features/Conversation/Messages/Tasks/shared/ProcessingState.tsx +++ b/src/features/Conversation/Messages/Tasks/shared/ProcessingState.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {TaskDetail} from '@lobechat/types'; +import { type TaskDetail } from '@lobechat/types'; import { Flexbox, Text } from '@lobehub/ui'; import { createStaticStyles, keyframes } from 'antd-style'; import { Footprints, Timer, Wrench } from 'lucide-react'; diff --git a/src/features/Conversation/Messages/Tasks/shared/TaskAvatar.tsx b/src/features/Conversation/Messages/Tasks/shared/TaskAvatar.tsx index 2a7b19b72a..8d8533ee83 100644 --- a/src/features/Conversation/Messages/Tasks/shared/TaskAvatar.tsx +++ b/src/features/Conversation/Messages/Tasks/shared/TaskAvatar.tsx @@ -1,7 +1,7 @@ import { Block, Flexbox, Icon } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { ListTodo } from 'lucide-react'; -import type { FC, PropsWithChildren } from 'react'; +import { type FC, type PropsWithChildren } from 'react'; const TaskAvatar: FC = ({ children }) => { return ( diff --git a/src/features/Conversation/Messages/Tasks/shared/TaskContent.tsx b/src/features/Conversation/Messages/Tasks/shared/TaskContent.tsx index 041bc8f471..85556160ad 100644 --- a/src/features/Conversation/Messages/Tasks/shared/TaskContent.tsx +++ b/src/features/Conversation/Messages/Tasks/shared/TaskContent.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { TaskDetail, ThreadStatus,UIChatMessage } from '@lobechat/types'; +import { type TaskDetail, type ThreadStatus, type UIChatMessage } from '@lobechat/types'; import { Flexbox, Text } from '@lobehub/ui'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/Conversation/Messages/Tasks/shared/TaskMessages.tsx b/src/features/Conversation/Messages/Tasks/shared/TaskMessages.tsx index 7e55535d76..556f59062d 100644 --- a/src/features/Conversation/Messages/Tasks/shared/TaskMessages.tsx +++ b/src/features/Conversation/Messages/Tasks/shared/TaskMessages.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {AssistantContentBlock, UIChatMessage} from '@lobechat/types'; +import { type AssistantContentBlock, type UIChatMessage } from '@lobechat/types'; import { Accordion, AccordionItem, @@ -13,8 +13,8 @@ import { } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; import { ScrollText, Workflow } from 'lucide-react'; -import type {RefObject} from 'react'; -import { memo, useEffect, useMemo, useState } from 'react'; +import { type RefObject } from 'react'; +import { memo, useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import NeuralNetworkLoading from '@/components/NeuralNetworkLoading'; diff --git a/src/features/Conversation/Messages/Tasks/shared/useTaskPolling.ts b/src/features/Conversation/Messages/Tasks/shared/useTaskPolling.ts index 8fc5a787da..1713ceae6f 100644 --- a/src/features/Conversation/Messages/Tasks/shared/useTaskPolling.ts +++ b/src/features/Conversation/Messages/Tasks/shared/useTaskPolling.ts @@ -1,6 +1,6 @@ 'use client'; -import type { ThreadStatus } from '@lobechat/types'; +import { type ThreadStatus } from '@lobechat/types'; import { useEffect, useState } from 'react'; import { useChatStore } from '@/store/chat'; diff --git a/src/features/Conversation/Messages/Tasks/shared/utils.ts b/src/features/Conversation/Messages/Tasks/shared/utils.ts index f511df900f..d629fd28f8 100644 --- a/src/features/Conversation/Messages/Tasks/shared/utils.ts +++ b/src/features/Conversation/Messages/Tasks/shared/utils.ts @@ -1,7 +1,9 @@ -import type {AssistantContentBlock, ModelUsage, TaskCurrentActivity} from '@lobechat/types'; import { - ThreadStatus + type AssistantContentBlock, + type ModelUsage, + type TaskCurrentActivity, } from '@lobechat/types'; +import { ThreadStatus } from '@lobechat/types'; /** * Format duration in milliseconds to human-readable string diff --git a/src/features/Conversation/Messages/Tool/ErrorBoundary/ErrorResult.tsx b/src/features/Conversation/Messages/Tool/ErrorBoundary/ErrorResult.tsx index 1280f938a2..d0acedce45 100644 --- a/src/features/Conversation/Messages/Tool/ErrorBoundary/ErrorResult.tsx +++ b/src/features/Conversation/Messages/Tool/ErrorBoundary/ErrorResult.tsx @@ -1,8 +1,8 @@ 'use client'; import { Alert, Highlighter } from '@lobehub/ui'; -import type {ErrorInfo} from 'react'; -import { memo } from 'react'; +import { type ErrorInfo } from 'react'; +import { memo } from 'react'; interface ErrorDisplayProps { apiName?: string; diff --git a/src/features/Conversation/Messages/Tool/ErrorBoundary/index.tsx b/src/features/Conversation/Messages/Tool/ErrorBoundary/index.tsx index 20f9f77a69..945c7eae82 100644 --- a/src/features/Conversation/Messages/Tool/ErrorBoundary/index.tsx +++ b/src/features/Conversation/Messages/Tool/ErrorBoundary/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {ErrorInfo, ReactNode} from 'react'; -import { Component } from 'react'; +import { type ErrorInfo, type ReactNode } from 'react'; +import { Component } from 'react'; import { ErrorDisplay } from './ErrorResult'; diff --git a/src/features/Conversation/Messages/Tool/Tool/index.tsx b/src/features/Conversation/Messages/Tool/Tool/index.tsx index 87fb0c9a50..5be087c7f8 100644 --- a/src/features/Conversation/Messages/Tool/Tool/index.tsx +++ b/src/features/Conversation/Messages/Tool/Tool/index.tsx @@ -1,6 +1,6 @@ import { Accordion, AccordionItem, Flexbox, Skeleton } from '@lobehub/ui'; -import type {CSSProperties} from 'react'; -import { memo, useState } from 'react'; +import { type CSSProperties } from 'react'; +import { memo, useState } from 'react'; import Actions from '@/features/Conversation/Messages/AssistantGroup/Tool/Actions'; import dynamic from '@/libs/next/dynamic'; diff --git a/src/features/Conversation/Messages/Tool/index.tsx b/src/features/Conversation/Messages/Tool/index.tsx index 7e44f0162d..8c1a2578d8 100644 --- a/src/features/Conversation/Messages/Tool/index.tsx +++ b/src/features/Conversation/Messages/Tool/index.tsx @@ -1,4 +1,4 @@ -import type {UIChatMessage} from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { Alert, Button, Flexbox } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; import { memo, useState } from 'react'; diff --git a/src/features/Conversation/Messages/User/Actions/index.tsx b/src/features/Conversation/Messages/User/Actions/index.tsx index 054f86f20c..9aab27b655 100644 --- a/src/features/Conversation/Messages/User/Actions/index.tsx +++ b/src/features/Conversation/Messages/User/Actions/index.tsx @@ -1,14 +1,14 @@ -import type {UIChatMessage} from '@lobechat/types'; -import type { ActionIconGroupEvent, ActionIconGroupItemType } from '@lobehub/ui'; +import { type UIChatMessage } from '@lobechat/types'; +import { type ActionIconGroupEvent, type ActionIconGroupItemType } from '@lobehub/ui'; import { ActionIconGroup, Flexbox } from '@lobehub/ui'; import { memo, useCallback, useMemo } from 'react'; import { MESSAGE_ACTION_BAR_PORTAL_ATTRIBUTES } from '@/const/messageActionPortal'; -import type { - MessageActionItem, - MessageActionItemOrDivider, - MessageActionsConfig, +import { + type MessageActionItem, + type MessageActionItemOrDivider, + type MessageActionsConfig, } from '../../../types'; import MessageBranch from '../../components/MessageBranch'; import { useUserActions } from './useUserActions'; diff --git a/src/features/Conversation/Messages/User/Actions/useUserActions.ts b/src/features/Conversation/Messages/User/Actions/useUserActions.ts index 0103717dbe..d64d25819e 100644 --- a/src/features/Conversation/Messages/User/Actions/useUserActions.ts +++ b/src/features/Conversation/Messages/User/Actions/useUserActions.ts @@ -1,4 +1,4 @@ -import type { ActionIconGroupItemType } from '@lobehub/ui'; +import { type ActionIconGroupItemType } from '@lobehub/ui'; import { copyToClipboard } from '@lobehub/ui'; import { App } from 'antd'; import { Copy, Edit, LanguagesIcon, Play, RotateCcw, Trash } from 'lucide-react'; @@ -6,7 +6,7 @@ import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { localeOptions } from '@/locales/resources'; -import type {UIChatMessage} from '@/types/index'; +import { type UIChatMessage } from '@/types/index'; import { messageStateSelectors, useConversationStore } from '../../../store'; diff --git a/src/features/Conversation/Messages/User/components/FileListViewer/Item.tsx b/src/features/Conversation/Messages/User/components/FileListViewer/Item.tsx index 5ca488147a..a513cf3cf6 100644 --- a/src/features/Conversation/Messages/User/components/FileListViewer/Item.tsx +++ b/src/features/Conversation/Messages/User/components/FileListViewer/Item.tsx @@ -3,7 +3,7 @@ import { memo } from 'react'; import FileIcon from '@/components/FileIcon'; import { useChatStore } from '@/store/chat'; -import type {ChatFileItem} from '@/types/index'; +import { type ChatFileItem } from '@/types/index'; import { formatSize } from '@/utils/format'; const FileItem = memo(({ id, fileType, size, name }) => { diff --git a/src/features/Conversation/Messages/User/components/FileListViewer/index.tsx b/src/features/Conversation/Messages/User/components/FileListViewer/index.tsx index 1a38cb01e3..59826580c3 100644 --- a/src/features/Conversation/Messages/User/components/FileListViewer/index.tsx +++ b/src/features/Conversation/Messages/User/components/FileListViewer/index.tsx @@ -1,7 +1,7 @@ import { Flexbox } from '@lobehub/ui'; import { memo } from 'react'; -import type {ChatFileItem} from '@/types/index'; +import { type ChatFileItem } from '@/types/index'; import FileItem from './Item'; diff --git a/src/features/Conversation/Messages/User/components/MessageContent.tsx b/src/features/Conversation/Messages/User/components/MessageContent.tsx index a97a519cb2..7b86bb4682 100644 --- a/src/features/Conversation/Messages/User/components/MessageContent.tsx +++ b/src/features/Conversation/Messages/User/components/MessageContent.tsx @@ -2,7 +2,7 @@ import { Flexbox } from '@lobehub/ui'; import { memo } from 'react'; import MarkdownMessage from '@/features/Conversation/Markdown'; -import type {UIChatMessage} from '@/types/index'; +import { type UIChatMessage } from '@/types/index'; import { useMarkdown } from '../useMarkdown'; import FileListViewer from './FileListViewer'; diff --git a/src/features/Conversation/Messages/User/components/PageSelections.tsx b/src/features/Conversation/Messages/User/components/PageSelections.tsx index d86f6cb110..f46133b831 100644 --- a/src/features/Conversation/Messages/User/components/PageSelections.tsx +++ b/src/features/Conversation/Messages/User/components/PageSelections.tsx @@ -2,7 +2,7 @@ import { Flexbox } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { memo } from 'react'; -import type { PageSelection } from '@/types/index'; +import { type PageSelection } from '@/types/index'; const styles = createStaticStyles(({ css, cssVar }) => ({ container: css` @@ -49,7 +49,7 @@ const PageSelections = memo(({ selections }) => { {selections.map((selection) => ( - { } + {} "
{selection.content}
diff --git a/src/features/Conversation/Messages/User/components/VideoFileListViewer.tsx b/src/features/Conversation/Messages/User/components/VideoFileListViewer.tsx index 9d5dfe3cf8..9b124dea9c 100644 --- a/src/features/Conversation/Messages/User/components/VideoFileListViewer.tsx +++ b/src/features/Conversation/Messages/User/components/VideoFileListViewer.tsx @@ -1,7 +1,7 @@ import { Flexbox } from '@lobehub/ui'; import { memo } from 'react'; -import type {ChatVideoItem} from '@/types/index'; +import { type ChatVideoItem } from '@/types/index'; interface VideoFileListViewerProps { items: ChatVideoItem[]; diff --git a/src/features/Conversation/Messages/User/index.tsx b/src/features/Conversation/Messages/User/index.tsx index c02ed925f6..d1a7a14ca4 100644 --- a/src/features/Conversation/Messages/User/index.tsx +++ b/src/features/Conversation/Messages/User/index.tsx @@ -1,7 +1,7 @@ import { Tag } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; -import type {MouseEventHandler} from 'react'; -import { memo, useCallback, useMemo } from 'react'; +import { type MouseEventHandler } from 'react'; +import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { ChatItem } from '@/features/Conversation/ChatItem'; diff --git a/src/features/Conversation/Messages/User/useMarkdown.tsx b/src/features/Conversation/Messages/User/useMarkdown.tsx index 7a0bca9f5f..b71f272609 100644 --- a/src/features/Conversation/Messages/User/useMarkdown.tsx +++ b/src/features/Conversation/Messages/User/useMarkdown.tsx @@ -1,6 +1,6 @@ -import type {MarkdownProps} from '@lobehub/ui'; -import type {ReactNode} from 'react'; -import { useMemo } from 'react'; +import { type MarkdownProps } from '@lobehub/ui'; +import { type ReactNode } from 'react'; +import { useMemo } from 'react'; import { markdownElements } from '../../Markdown/plugins'; import ContentPreview from './components/ContentPreview'; diff --git a/src/features/Conversation/Messages/components/ContentLoading.tsx b/src/features/Conversation/Messages/components/ContentLoading.tsx index c7b0a789d1..aafdfbf609 100644 --- a/src/features/Conversation/Messages/components/ContentLoading.tsx +++ b/src/features/Conversation/Messages/components/ContentLoading.tsx @@ -6,7 +6,7 @@ import BubblesLoading from '@/components/BubblesLoading'; import NeuralNetworkLoading from '@/components/NeuralNetworkLoading'; import { useChatStore } from '@/store/chat'; import { operationSelectors } from '@/store/chat/selectors'; -import type { OperationType } from '@/store/chat/slices/operation/types'; +import { type OperationType } from '@/store/chat/slices/operation/types'; import { shinyTextStyles } from '@/styles/loading'; const ELAPSED_TIME_THRESHOLD = 2100; // Show elapsed time after 2 seconds diff --git a/src/features/Conversation/Messages/components/DisplayContent.tsx b/src/features/Conversation/Messages/components/DisplayContent.tsx index ba29f1ce0c..88410f8fc8 100644 --- a/src/features/Conversation/Messages/components/DisplayContent.tsx +++ b/src/features/Conversation/Messages/components/DisplayContent.tsx @@ -1,5 +1,5 @@ import { deserializeParts } from '@lobechat/utils'; -import type {MarkdownProps} from '@lobehub/ui'; +import { type MarkdownProps } from '@lobehub/ui'; import { memo } from 'react'; import { LOADING_FLAT } from '@/const/message'; diff --git a/src/features/Conversation/Messages/components/Extras/ExtraContainer.tsx b/src/features/Conversation/Messages/components/Extras/ExtraContainer.tsx index 2edc6ba5d9..0680296ee8 100644 --- a/src/features/Conversation/Messages/components/Extras/ExtraContainer.tsx +++ b/src/features/Conversation/Messages/components/Extras/ExtraContainer.tsx @@ -1,5 +1,5 @@ import { Divider } from 'antd'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { memo } from 'react'; const ExtraContainer = memo(({ children }) => { diff --git a/src/features/Conversation/Messages/components/Extras/TTS/FilePlayer.tsx b/src/features/Conversation/Messages/components/Extras/TTS/FilePlayer.tsx index 3426dd0481..8080b073d3 100644 --- a/src/features/Conversation/Messages/components/Extras/TTS/FilePlayer.tsx +++ b/src/features/Conversation/Messages/components/Extras/TTS/FilePlayer.tsx @@ -4,7 +4,7 @@ import { memo, useCallback } from 'react'; import { useFileStore } from '@/store/file'; import { useConversationStore } from '../../../../store'; -import type {TTSProps} from './InitPlayer'; +import { type TTSProps } from './InitPlayer'; import Player from './Player'; const FilePlayer = memo(({ file, id }) => { diff --git a/src/features/Conversation/Messages/components/Extras/TTS/InitPlayer.tsx b/src/features/Conversation/Messages/components/Extras/TTS/InitPlayer.tsx index c53929f062..1f5259df6e 100644 --- a/src/features/Conversation/Messages/components/Extras/TTS/InitPlayer.tsx +++ b/src/features/Conversation/Messages/components/Extras/TTS/InitPlayer.tsx @@ -1,5 +1,5 @@ import { getMessageError } from '@lobechat/fetch-sse'; -import type {ChatMessageError, ChatTTS} from '@lobechat/types'; +import { type ChatMessageError, type ChatTTS } from '@lobechat/types'; import { memo, useCallback, useEffect, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/Conversation/Messages/components/Extras/TTS/Player.tsx b/src/features/Conversation/Messages/components/Extras/TTS/Player.tsx index 8de9bd1930..e611385b99 100644 --- a/src/features/Conversation/Messages/components/Extras/TTS/Player.tsx +++ b/src/features/Conversation/Messages/components/Extras/TTS/Player.tsx @@ -1,6 +1,6 @@ -import type {ChatMessageError} from '@lobechat/types'; -import type {AudioPlayerProps} from '@lobehub/tts/react'; -import { AudioPlayer } from '@lobehub/tts/react'; +import { type ChatMessageError } from '@lobechat/types'; +import { type AudioPlayerProps } from '@lobehub/tts/react'; +import { AudioPlayer } from '@lobehub/tts/react'; import { ActionIcon, Alert, Button, Flexbox, Highlighter } from '@lobehub/ui'; import { TrashIcon } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/features/Conversation/Messages/components/Extras/TTS/index.tsx b/src/features/Conversation/Messages/components/Extras/TTS/index.tsx index e4123d2968..a953741053 100644 --- a/src/features/Conversation/Messages/components/Extras/TTS/index.tsx +++ b/src/features/Conversation/Messages/components/Extras/TTS/index.tsx @@ -7,7 +7,7 @@ import { useGlobalStore } from '@/store/global'; import { globalGeneralSelectors } from '@/store/global/selectors'; import FilePlayer from './FilePlayer'; -import type {TTSProps} from './InitPlayer'; +import { type TTSProps } from './InitPlayer'; import InitPlayer from './InitPlayer'; const TTS = memo( diff --git a/src/features/Conversation/Messages/components/Extras/Translate.tsx b/src/features/Conversation/Messages/components/Extras/Translate.tsx index 9bc9e77f94..9027a7916f 100644 --- a/src/features/Conversation/Messages/components/Extras/Translate.tsx +++ b/src/features/Conversation/Messages/components/Extras/Translate.tsx @@ -1,5 +1,5 @@ -import type {ChatTranslate} from '@lobechat/types'; -import { ActionIcon, copyToClipboard,Flexbox, Icon, Markdown, Tag } from '@lobehub/ui'; +import { type ChatTranslate } from '@lobechat/types'; +import { ActionIcon, copyToClipboard, Flexbox, Icon, Markdown, Tag } from '@lobehub/ui'; import { App } from 'antd'; import { cssVar } from 'antd-style'; import { ChevronDown, ChevronsRight, ChevronUp, CopyIcon, TrashIcon } from 'lucide-react'; diff --git a/src/features/Conversation/Messages/components/Extras/Usage/UsageDetail/ModelCard.tsx b/src/features/Conversation/Messages/components/Extras/Usage/UsageDetail/ModelCard.tsx index efd26d68d9..50094d77c0 100644 --- a/src/features/Conversation/Messages/components/Extras/Usage/UsageDetail/ModelCard.tsx +++ b/src/features/Conversation/Messages/components/Extras/Usage/UsageDetail/ModelCard.tsx @@ -3,7 +3,7 @@ import { ModelIcon } from '@lobehub/icons'; import { Flexbox, Icon, Segmented, Tooltip } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { ArrowDownToDot, ArrowUpFromDot, BookUp2Icon, CircleFadingArrowUp } from 'lucide-react'; -import type {LobeDefaultAiModelListItem} from 'model-bank'; +import { type LobeDefaultAiModelListItem } from 'model-bank'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/Conversation/Messages/components/Extras/Usage/UsageDetail/index.tsx b/src/features/Conversation/Messages/components/Extras/Usage/UsageDetail/index.tsx index 5f7f7b0584..e77d522455 100644 --- a/src/features/Conversation/Messages/components/Extras/Usage/UsageDetail/index.tsx +++ b/src/features/Conversation/Messages/components/Extras/Usage/UsageDetail/index.tsx @@ -1,4 +1,4 @@ -import type {ModelPerformance, ModelUsage} from '@lobechat/types'; +import { type ModelPerformance, type ModelUsage } from '@lobechat/types'; import { Center, Flexbox, Icon, Popover } from '@lobehub/ui'; import { Divider } from 'antd'; import { cssVar } from 'antd-style'; @@ -14,7 +14,7 @@ import { formatNumber, formatShortenNumber } from '@/utils/format'; import AnimatedNumber from './AnimatedNumber'; import ModelCard from './ModelCard'; -import type {TokenProgressItem} from './TokenProgress'; +import { type TokenProgressItem } from './TokenProgress'; import TokenProgress from './TokenProgress'; import { getDetailsToken } from './tokens'; diff --git a/src/features/Conversation/Messages/components/Extras/Usage/UsageDetail/pricing.ts b/src/features/Conversation/Messages/components/Extras/Usage/UsageDetail/pricing.ts index b4ee86a195..fbafca8143 100644 --- a/src/features/Conversation/Messages/components/Extras/Usage/UsageDetail/pricing.ts +++ b/src/features/Conversation/Messages/components/Extras/Usage/UsageDetail/pricing.ts @@ -1,4 +1,4 @@ -import type {ModelPriceCurrency, Pricing} from 'model-bank'; +import { type ModelPriceCurrency, type Pricing } from 'model-bank'; import { formatPriceByCurrency, diff --git a/src/features/Conversation/Messages/components/Extras/Usage/UsageDetail/tokens.ts b/src/features/Conversation/Messages/components/Extras/Usage/UsageDetail/tokens.ts index d7aff2aed7..e2e0f20895 100644 --- a/src/features/Conversation/Messages/components/Extras/Usage/UsageDetail/tokens.ts +++ b/src/features/Conversation/Messages/components/Extras/Usage/UsageDetail/tokens.ts @@ -1,5 +1,5 @@ -import type {ModelUsage} from '@lobechat/types'; -import type {LobeDefaultAiModelListItem} from 'model-bank'; +import { type ModelUsage } from '@lobechat/types'; +import { type LobeDefaultAiModelListItem } from 'model-bank'; import { getAudioInputUnitRate, getAudioOutputUnitRate } from '@/utils/pricing'; diff --git a/src/features/Conversation/Messages/components/Extras/Usage/index.tsx b/src/features/Conversation/Messages/components/Extras/Usage/index.tsx index 723d98d45c..3d0b801431 100644 --- a/src/features/Conversation/Messages/components/Extras/Usage/index.tsx +++ b/src/features/Conversation/Messages/components/Extras/Usage/index.tsx @@ -1,4 +1,4 @@ -import type {ModelPerformance, ModelUsage} from '@lobechat/types'; +import { type ModelPerformance, type ModelUsage } from '@lobechat/types'; import { ModelIcon } from '@lobehub/icons'; import { Center, Flexbox } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; diff --git a/src/features/Conversation/Messages/components/FileChunks/ChunkItem.tsx b/src/features/Conversation/Messages/components/FileChunks/ChunkItem.tsx index a34031e27e..420977d2a0 100644 --- a/src/features/Conversation/Messages/components/FileChunks/ChunkItem.tsx +++ b/src/features/Conversation/Messages/components/FileChunks/ChunkItem.tsx @@ -1,4 +1,4 @@ -import type {ChatFileChunk} from '@lobechat/types'; +import { type ChatFileChunk } from '@lobechat/types'; import { Center, Flexbox, Text, Tooltip } from '@lobehub/ui'; import { cx } from 'antd-style'; import { memo } from 'react'; diff --git a/src/features/Conversation/Messages/components/FileChunks/index.tsx b/src/features/Conversation/Messages/components/FileChunks/index.tsx index 85fae94903..6aa02f8afb 100644 --- a/src/features/Conversation/Messages/components/FileChunks/index.tsx +++ b/src/features/Conversation/Messages/components/FileChunks/index.tsx @@ -1,4 +1,4 @@ -import type {ChatFileChunk} from '@lobechat/types'; +import { type ChatFileChunk } from '@lobechat/types'; import { Flexbox, Icon } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import { BookOpenTextIcon, ChevronDown, ChevronRight } from 'lucide-react'; diff --git a/src/features/Conversation/Messages/components/Reasoning.tsx b/src/features/Conversation/Messages/components/Reasoning.tsx index 4826dfb270..b29f718353 100644 --- a/src/features/Conversation/Messages/components/Reasoning.tsx +++ b/src/features/Conversation/Messages/components/Reasoning.tsx @@ -1,4 +1,4 @@ -import type {MessageContentPart} from '@lobechat/types'; +import { type MessageContentPart } from '@lobechat/types'; import { deserializeParts } from '@lobechat/utils'; import { memo } from 'react'; diff --git a/src/features/Conversation/Messages/components/RichContentRenderer.tsx b/src/features/Conversation/Messages/components/RichContentRenderer.tsx index b53f5eaa35..bbe25fb704 100644 --- a/src/features/Conversation/Messages/components/RichContentRenderer.tsx +++ b/src/features/Conversation/Messages/components/RichContentRenderer.tsx @@ -1,7 +1,7 @@ import { Flexbox, Image, Markdown } from '@lobehub/ui'; import { memo } from 'react'; -import type {MessageContentPart} from '@/types/index'; +import { type MessageContentPart } from '@/types/index'; interface RichContentRendererProps { parts: MessageContentPart[]; diff --git a/src/features/Conversation/Messages/components/SearchGrounding.tsx b/src/features/Conversation/Messages/components/SearchGrounding.tsx index 6caad5daca..56ee197420 100644 --- a/src/features/Conversation/Messages/components/SearchGrounding.tsx +++ b/src/features/Conversation/Messages/components/SearchGrounding.tsx @@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next'; import { useIsDark } from '@/hooks/useIsDark'; import Image from '@/libs/next/Image'; -import type {GroundingSearch} from '@/types/search'; +import { type GroundingSearch } from '@/types/search'; const styles = createStaticStyles(({ css, cssVar }) => ({ container: css` diff --git a/src/features/Conversation/Messages/index.tsx b/src/features/Conversation/Messages/index.tsx index 6f8aa82f8a..07410447bd 100644 --- a/src/features/Conversation/Messages/index.tsx +++ b/src/features/Conversation/Messages/index.tsx @@ -4,8 +4,8 @@ import { isDesktop } from '@lobechat/const'; import { Flexbox } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; import isEqual from 'fast-deep-equal'; -import type {MouseEvent, ReactNode} from 'react'; -import { memo, Suspense, useCallback } from 'react'; +import { type MouseEvent, type ReactNode } from 'react'; +import { memo, Suspense, useCallback } from 'react'; import BubblesLoading from '@/components/BubblesLoading'; diff --git a/src/features/Conversation/StoreUpdater.tsx b/src/features/Conversation/StoreUpdater.tsx index 9240ba7da6..f6cbafd144 100644 --- a/src/features/Conversation/StoreUpdater.tsx +++ b/src/features/Conversation/StoreUpdater.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import debug from 'debug'; import { memo, useEffect, useRef } from 'react'; import { createStoreUpdater } from 'zustand-utils'; @@ -8,11 +8,11 @@ import { createStoreUpdater } from 'zustand-utils'; import { messageMapKey } from '@/store/chat/utils/messageMapKey'; import { useConversationStoreApi } from './store'; -import type { - ActionsBarConfig, - ConversationContext, - ConversationHooks, - OperationState, +import { + type ActionsBarConfig, + type ConversationContext, + type ConversationHooks, + type OperationState, } from './types'; const log = debug('lobe-render:features:Conversation'); diff --git a/src/features/Conversation/TodoProgress/index.tsx b/src/features/Conversation/TodoProgress/index.tsx index 835f7687b4..d41785a3b8 100644 --- a/src/features/Conversation/TodoProgress/index.tsx +++ b/src/features/Conversation/TodoProgress/index.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {StepContextTodos} from '@lobechat/types'; +import { type StepContextTodos } from '@lobechat/types'; import { Checkbox, Flexbox, Icon, Tag } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import { ChevronDown, ChevronUp, CircleArrowRight, ListTodo } from 'lucide-react'; diff --git a/src/features/Conversation/components/ShareMessageModal/ShareImage/Preview.tsx b/src/features/Conversation/components/ShareMessageModal/ShareImage/Preview.tsx index 73850407c2..d13959d516 100644 --- a/src/features/Conversation/components/ShareMessageModal/ShareImage/Preview.tsx +++ b/src/features/Conversation/components/ShareMessageModal/ShareImage/Preview.tsx @@ -1,5 +1,5 @@ import { OFFICIAL_DOMAIN } from '@lobechat/const'; -import type {UIChatMessage} from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { ModelTag } from '@lobehub/icons'; import { Avatar, Flexbox } from '@lobehub/ui'; import { ChatHeaderTitle } from '@lobehub/ui/chat'; @@ -17,7 +17,7 @@ import { useAgentMeta, useIsBuiltinAgent } from '../../../hooks'; import { normalizeThinkTags, processWithArtifact } from '../../../utils/markdown'; import { styles as containerStyles } from '../style'; import { styles } from './style'; -import type {FieldType} from './type'; +import { type FieldType } from './type'; interface PreviewProps extends FieldType { message: UIChatMessage; diff --git a/src/features/Conversation/components/ShareMessageModal/ShareImage/index.tsx b/src/features/Conversation/components/ShareMessageModal/ShareImage/index.tsx index e8edad0751..f715d21fbe 100644 --- a/src/features/Conversation/components/ShareMessageModal/ShareImage/index.tsx +++ b/src/features/Conversation/components/ShareMessageModal/ShareImage/index.tsx @@ -1,6 +1,6 @@ -import type {UIChatMessage} from '@lobechat/types'; -import type {FormItemProps} from '@lobehub/ui'; -import { Button, Flexbox,Form, Segmented } from '@lobehub/ui'; +import { type UIChatMessage } from '@lobechat/types'; +import { type FormItemProps } from '@lobehub/ui'; +import { Button, Flexbox, Form, Segmented } from '@lobehub/ui'; import { Switch } from 'antd'; import { CopyIcon } from 'lucide-react'; import { memo, useState } from 'react'; @@ -15,7 +15,7 @@ import { agentSelectors } from '@/store/agent/selectors'; import { styles } from '../style'; import Preview from './Preview'; -import type {FieldType} from './type'; +import { type FieldType } from './type'; const DEFAULT_FIELD_VALUE: FieldType = { imageType: ImageType.JPG, diff --git a/src/features/Conversation/components/ShareMessageModal/ShareImage/type.ts b/src/features/Conversation/components/ShareMessageModal/ShareImage/type.ts index a40e488c33..17660e7272 100644 --- a/src/features/Conversation/components/ShareMessageModal/ShareImage/type.ts +++ b/src/features/Conversation/components/ShareMessageModal/ShareImage/type.ts @@ -1,4 +1,4 @@ -import type {ImageType} from '@/hooks/useScreenshot'; +import { type ImageType } from '@/hooks/useScreenshot'; export type FieldType = { imageType: ImageType; diff --git a/src/features/Conversation/components/ShareMessageModal/ShareText/index.tsx b/src/features/Conversation/components/ShareMessageModal/ShareText/index.tsx index 058e27a5f9..9ef30c3e81 100644 --- a/src/features/Conversation/components/ShareMessageModal/ShareText/index.tsx +++ b/src/features/Conversation/components/ShareMessageModal/ShareText/index.tsx @@ -1,5 +1,5 @@ -import type {UIChatMessage} from '@lobechat/types'; -import { Button, copyToClipboard,Flexbox } from '@lobehub/ui'; +import { type UIChatMessage } from '@lobechat/types'; +import { Button, copyToClipboard, Flexbox } from '@lobehub/ui'; import { App } from 'antd'; import isEqual from 'fast-deep-equal'; import { CopyIcon } from 'lucide-react'; diff --git a/src/features/Conversation/components/ShareMessageModal/ShareText/template.test.ts b/src/features/Conversation/components/ShareMessageModal/ShareText/template.test.ts index 3a2382ac4b..9e3385c5d4 100644 --- a/src/features/Conversation/components/ShareMessageModal/ShareText/template.test.ts +++ b/src/features/Conversation/components/ShareMessageModal/ShareText/template.test.ts @@ -1,4 +1,4 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { describe, expect, it } from 'vitest'; import { LOADING_FLAT } from '@/const/message'; diff --git a/src/features/Conversation/components/ShareMessageModal/ShareText/template.ts b/src/features/Conversation/components/ShareMessageModal/ShareText/template.ts index 5cf72491d0..7eb56c35d8 100644 --- a/src/features/Conversation/components/ShareMessageModal/ShareText/template.ts +++ b/src/features/Conversation/components/ShareMessageModal/ShareText/template.ts @@ -1,4 +1,4 @@ -import type {UIChatMessage} from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { template } from 'es-toolkit/compat'; import { LOADING_FLAT } from '@/const/message'; @@ -12,7 +12,7 @@ const markdownTemplate = template( `, { evaluate: /<%([\s\S]+?)%>/g, - interpolate: /\{{([\s\S]+?)\}}/g, + interpolate: /\{\{([\s\S]+?)\}\}/g, }, ); diff --git a/src/features/Conversation/components/ShareMessageModal/index.tsx b/src/features/Conversation/components/ShareMessageModal/index.tsx index 49d86a8b69..e264c0ccfd 100644 --- a/src/features/Conversation/components/ShareMessageModal/index.tsx +++ b/src/features/Conversation/components/ShareMessageModal/index.tsx @@ -1,4 +1,4 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { Flexbox, Modal, Segmented, Tabs } from '@lobehub/ui'; import { memo, useId, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/Conversation/components/Thinking/index.tsx b/src/features/Conversation/components/Thinking/index.tsx index b288ba8fbd..63c9962274 100644 --- a/src/features/Conversation/components/Thinking/index.tsx +++ b/src/features/Conversation/components/Thinking/index.tsx @@ -1,15 +1,11 @@ import { Accordion, AccordionItem, ScrollShadow } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; -import type {CSSProperties, ReactNode, RefObject} from 'react'; -import { - memo, - useEffect, - useState -} from 'react'; +import { type CSSProperties, type ReactNode, type RefObject } from 'react'; +import { memo, useEffect, useState } from 'react'; import MarkdownMessage from '@/features/Conversation/Markdown'; import { useAutoScroll } from '@/hooks/useAutoScroll'; -import type {ChatCitationItem} from '@/types/index'; +import { type ChatCitationItem } from '@/types/index'; import Title from './Title'; diff --git a/src/features/Conversation/hooks/useAgentMeta.ts b/src/features/Conversation/hooks/useAgentMeta.ts index f982acacdd..9819d1c4c5 100644 --- a/src/features/Conversation/hooks/useAgentMeta.ts +++ b/src/features/Conversation/hooks/useAgentMeta.ts @@ -1,4 +1,4 @@ -import type {MetaData} from '@lobechat/types'; +import { type MetaData } from '@lobechat/types'; import { useMemo } from 'react'; import { useAgentStore } from '@/store/agent'; diff --git a/src/features/Conversation/hooks/useChatItemContextMenu.tsx b/src/features/Conversation/hooks/useChatItemContextMenu.tsx index 4e06126b6d..de39cdb51d 100644 --- a/src/features/Conversation/hooks/useChatItemContextMenu.tsx +++ b/src/features/Conversation/hooks/useChatItemContextMenu.tsx @@ -1,11 +1,13 @@ -import type {ActionIconGroupEvent, ActionIconGroupItemType, DropdownItem, GenericItemType} from '@lobehub/ui'; import { - createRawModal, - showContextMenu + type ActionIconGroupEvent, + type ActionIconGroupItemType, + type DropdownItem, + type GenericItemType, } from '@lobehub/ui'; +import { createRawModal, showContextMenu } from '@lobehub/ui'; import { App } from 'antd'; import isEqual from 'fast-deep-equal'; -import type { MouseEvent, ReactNode } from 'react'; +import { type MouseEvent, type ReactNode } from 'react'; import { useCallback, useMemo, useRef } from 'react'; import { useTranslation } from 'react-i18next'; @@ -15,7 +17,7 @@ import { sessionSelectors } from '@/store/session/selectors'; import { useUserStore } from '@/store/user'; import { userGeneralSettingsSelectors } from '@/store/user/selectors'; -import type {ShareModalProps} from '../components/ShareMessageModal'; +import { type ShareModalProps } from '../components/ShareMessageModal'; import ShareMessageModal from '../components/ShareMessageModal'; import { createStore, diff --git a/src/features/Conversation/hooks/useChatListActionsBar.tsx b/src/features/Conversation/hooks/useChatListActionsBar.tsx index ed1ce4ba0c..a4657aba76 100644 --- a/src/features/Conversation/hooks/useChatListActionsBar.tsx +++ b/src/features/Conversation/hooks/useChatListActionsBar.tsx @@ -1,4 +1,4 @@ -import type { ActionIconGroupItemType } from '@lobehub/ui'; +import { type ActionIconGroupItemType } from '@lobehub/ui'; import { css, cx } from 'antd-style'; import { ArrowDownFromLine, diff --git a/src/features/Conversation/hooks/useDoubleClickEdit.ts b/src/features/Conversation/hooks/useDoubleClickEdit.ts index 5b924556aa..927b297f0c 100644 --- a/src/features/Conversation/hooks/useDoubleClickEdit.ts +++ b/src/features/Conversation/hooks/useDoubleClickEdit.ts @@ -1,5 +1,5 @@ -import type {MouseEventHandler} from 'react'; -import { useCallback } from 'react'; +import { type MouseEventHandler } from 'react'; +import { useCallback } from 'react'; import { useConversationStore } from '../store'; diff --git a/src/features/Conversation/store.test.ts b/src/features/Conversation/store.test.ts index 5fa392f180..3d74f7fe18 100644 --- a/src/features/Conversation/store.test.ts +++ b/src/features/Conversation/store.test.ts @@ -2,7 +2,7 @@ import { act } from '@testing-library/react'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { createStore } from './store'; -import type { ConversationContext, ConversationHooks } from './types'; +import { type ConversationContext, type ConversationHooks } from './types'; // Mock dependencies vi.mock('@/store/chat', () => ({ diff --git a/src/features/Conversation/store/action.ts b/src/features/Conversation/store/action.ts index 300194477c..c845305ae2 100644 --- a/src/features/Conversation/store/action.ts +++ b/src/features/Conversation/store/action.ts @@ -1,21 +1,21 @@ -import type { StateCreator } from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; -import type { ConversationContext, ConversationHooks } from '../types'; -import type {State} from './initialState'; +import { type ConversationContext, type ConversationHooks } from '../types'; +import { type State } from './initialState'; import { initialState } from './initialState'; -import type { DataAction } from './slices/data/action'; +import { type DataAction } from './slices/data/action'; import { dataSlice } from './slices/data/action'; -import type { GenerationAction } from './slices/generation/action'; +import { type GenerationAction } from './slices/generation/action'; import { generationSlice } from './slices/generation/action'; -import type { InputAction } from './slices/input/action'; +import { type InputAction } from './slices/input/action'; import { inputSlice } from './slices/input/action'; -import type { MessageAction } from './slices/message/action'; +import { type MessageAction } from './slices/message/action'; import { messageSlice } from './slices/message/action'; -import type { MessageEditingAction } from './slices/messageState/action'; +import { type MessageEditingAction } from './slices/messageState/action'; import { messageEditingSlice } from './slices/messageState/action'; -import type { ToolAction } from './slices/tool/action'; +import { type ToolAction } from './slices/tool/action'; import { toolSlice } from './slices/tool/action'; -import type { VirtuaListAction } from './slices/virtuaList/action'; +import { type VirtuaListAction } from './slices/virtuaList/action'; import { virtuaListSlice } from './slices/virtuaList/action'; // ===== Combined Store Type ===== diff --git a/src/features/Conversation/store/index.ts b/src/features/Conversation/store/index.ts index a7c85a2fed..209f0adf58 100644 --- a/src/features/Conversation/store/index.ts +++ b/src/features/Conversation/store/index.ts @@ -1,14 +1,14 @@ 'use client'; -import type { StoreApiWithSelector } from '@lobechat/types'; +import { type StoreApiWithSelector } from '@lobechat/types'; import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; import { createContext } from 'zustand-utils'; import { createDevtools } from '@/store/middleware/createDevtools'; -import type {CreateStoreParams, Store} from './action'; -import { createStoreAction } from './action'; +import { type CreateStoreParams, type Store } from './action'; +import { createStoreAction } from './action'; export type { Store as ConversationStore, ConversationStore as Store } from './action'; export type { State } from './initialState'; diff --git a/src/features/Conversation/store/initialState.ts b/src/features/Conversation/store/initialState.ts index 1ac880860b..0f8fec39f6 100644 --- a/src/features/Conversation/store/initialState.ts +++ b/src/features/Conversation/store/initialState.ts @@ -1,21 +1,19 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; -import type { - ActionsBarConfig, - ConversationContext, - ConversationHooks, - OperationState, +import { + type ActionsBarConfig, + type ConversationContext, + type ConversationHooks, + type OperationState, } from '../types'; import { DEFAULT_OPERATION_STATE } from '../types/operation'; -import type {DataState} from './slices/data/initialState'; +import { type DataState } from './slices/data/initialState'; import { dataInitialState } from './slices/data/initialState'; -import type {InputState} from './slices/input/initialState'; +import { type InputState } from './slices/input/initialState'; import { inputInitialState } from './slices/input/initialState'; -import type {MessageStateState} from './slices/messageState/initialState'; -import { - messageStateInitialState -} from './slices/messageState/initialState'; -import type {VirtuaListState} from './slices/virtuaList/initialState'; +import { type MessageStateState } from './slices/messageState/initialState'; +import { messageStateInitialState } from './slices/messageState/initialState'; +import { type VirtuaListState } from './slices/virtuaList/initialState'; import { virtuaListInitialState } from './slices/virtuaList/initialState'; export interface State extends DataState, InputState, MessageStateState, VirtuaListState { diff --git a/src/features/Conversation/store/selectors.test.ts b/src/features/Conversation/store/selectors.test.ts index ca00f507f4..180f0e9bfa 100644 --- a/src/features/Conversation/store/selectors.test.ts +++ b/src/features/Conversation/store/selectors.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest'; import { DEFAULT_OPERATION_STATE } from '../types/operation'; -import type { State } from './initialState'; +import { type State } from './initialState'; import { conversationSelectors } from './selectors'; // Helper to create a mock state diff --git a/src/features/Conversation/store/slices/context/selectors.ts b/src/features/Conversation/store/slices/context/selectors.ts index 68f7c671ec..5937a075cf 100644 --- a/src/features/Conversation/store/slices/context/selectors.ts +++ b/src/features/Conversation/store/slices/context/selectors.ts @@ -1,4 +1,4 @@ -import type { State } from '../../initialState'; +import { type State } from '../../initialState'; const context = (s: State) => s.context; const agentId = (s: State) => s.context.agentId; diff --git a/src/features/Conversation/store/slices/data/action.test.ts b/src/features/Conversation/store/slices/data/action.test.ts index d8eb81cd55..16feccfabd 100644 --- a/src/features/Conversation/store/slices/data/action.test.ts +++ b/src/features/Conversation/store/slices/data/action.test.ts @@ -1,4 +1,4 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { act, waitFor } from '@testing-library/react'; import { describe, expect, it, vi } from 'vitest'; diff --git a/src/features/Conversation/store/slices/data/action.ts b/src/features/Conversation/store/slices/data/action.ts index 7267914430..d84386a1c8 100644 --- a/src/features/Conversation/store/slices/data/action.ts +++ b/src/features/Conversation/store/slices/data/action.ts @@ -1,16 +1,16 @@ import { parse } from '@lobechat/conversation-flow'; -import type { ConversationContext, UIChatMessage } from '@lobechat/types'; +import { type ConversationContext, type UIChatMessage } from '@lobechat/types'; import debug from 'debug'; -import type { SWRResponse } from 'swr'; -import type { StateCreator } from 'zustand/vanilla'; +import { type SWRResponse } from 'swr'; +import { type StateCreator } from 'zustand/vanilla'; import { useClientDataSWRWithSync } from '@/libs/swr'; import { messageService } from '@/services/message'; import { messageMapKey } from '@/store/chat/utils/messageMapKey'; -import type { Store as ConversationStore } from '../../action'; -import type {MessageDispatch} from './reducer'; -import { messagesReducer } from './reducer'; +import { type Store as ConversationStore } from '../../action'; +import { type MessageDispatch } from './reducer'; +import { messagesReducer } from './reducer'; import { dataSelectors } from './selectors'; const log = debug('lobe-render:features:Conversation'); diff --git a/src/features/Conversation/store/slices/data/initialState.ts b/src/features/Conversation/store/slices/data/initialState.ts index c10e0b2e34..6bb9b9b9af 100644 --- a/src/features/Conversation/store/slices/data/initialState.ts +++ b/src/features/Conversation/store/slices/data/initialState.ts @@ -1,4 +1,4 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; export interface DataState { /** diff --git a/src/features/Conversation/store/slices/data/reducer.test.ts b/src/features/Conversation/store/slices/data/reducer.test.ts index 26be9afe6f..586451d789 100644 --- a/src/features/Conversation/store/slices/data/reducer.test.ts +++ b/src/features/Conversation/store/slices/data/reducer.test.ts @@ -1,7 +1,7 @@ -import type { ChatToolPayload, UIChatMessage } from '@lobechat/types'; +import { type ChatToolPayload, type UIChatMessage } from '@lobechat/types'; import { beforeEach, describe, expect, it } from 'vitest'; -import type { MessageDispatch} from './reducer'; +import { type MessageDispatch } from './reducer'; import { messagesReducer } from './reducer'; describe('messagesReducer', () => { diff --git a/src/features/Conversation/store/slices/data/reducer.ts b/src/features/Conversation/store/slices/data/reducer.ts index b8da7387e7..1ba1ca5c71 100644 --- a/src/features/Conversation/store/slices/data/reducer.ts +++ b/src/features/Conversation/store/slices/data/reducer.ts @@ -1,9 +1,9 @@ -import type { - ChatMessageExtra, - ChatToolPayload, - CreateMessageParams, - MessagePluginItem, - UIChatMessage, +import { + type ChatMessageExtra, + type ChatToolPayload, + type CreateMessageParams, + type MessagePluginItem, + type UIChatMessage, } from '@lobechat/types'; import isEqual from 'fast-deep-equal'; import { produce } from 'immer'; diff --git a/src/features/Conversation/store/slices/data/selectors.ts b/src/features/Conversation/store/slices/data/selectors.ts index 70bf14f901..b264087645 100644 --- a/src/features/Conversation/store/slices/data/selectors.ts +++ b/src/features/Conversation/store/slices/data/selectors.ts @@ -1,9 +1,9 @@ -import type { AssistantContentBlock, UIChatMessage } from '@lobechat/types'; +import { type AssistantContentBlock, type UIChatMessage } from '@lobechat/types'; import { useChatStore } from '@/store/chat'; import { topicSelectors } from '@/store/chat/selectors'; -import type { State } from '../../initialState'; +import { type State } from '../../initialState'; const displayMessages = (s: State) => s.displayMessages; const displayMessageIds = (s: State) => s.displayMessages.map((m) => m.id); diff --git a/src/features/Conversation/store/slices/generation/action.test.ts b/src/features/Conversation/store/slices/generation/action.test.ts index d0547d4340..5ae6b2cd2a 100644 --- a/src/features/Conversation/store/slices/generation/action.test.ts +++ b/src/features/Conversation/store/slices/generation/action.test.ts @@ -3,7 +3,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { AI_RUNTIME_OPERATION_TYPES } from '@/store/chat/slices/operation/types'; -import type { ConversationContext, ConversationHooks } from '../../../types'; +import { type ConversationContext, type ConversationHooks } from '../../../types'; import { createStore } from '../../index'; // Mock useChatStore diff --git a/src/features/Conversation/store/slices/generation/action.ts b/src/features/Conversation/store/slices/generation/action.ts index 6b196173fb..f07b252102 100644 --- a/src/features/Conversation/store/slices/generation/action.ts +++ b/src/features/Conversation/store/slices/generation/action.ts @@ -1,10 +1,10 @@ -import type { StateCreator } from 'zustand'; +import { type StateCreator } from 'zustand'; import { MESSAGE_CANCEL_FLAT } from '@/const/index'; import { useChatStore } from '@/store/chat'; import { AI_RUNTIME_OPERATION_TYPES } from '@/store/chat/slices/operation/types'; -import type { Store as ConversationStore } from '../../action'; +import { type Store as ConversationStore } from '../../action'; /** * Generation Actions diff --git a/src/features/Conversation/store/slices/input/action.ts b/src/features/Conversation/store/slices/input/action.ts index c34b262d36..b53be90928 100644 --- a/src/features/Conversation/store/slices/input/action.ts +++ b/src/features/Conversation/store/slices/input/action.ts @@ -1,8 +1,8 @@ -import type { StateCreator } from 'zustand'; +import { type StateCreator } from 'zustand'; import { useChatStore } from '@/store/chat'; -import type { State } from '../../initialState'; +import { type State } from '../../initialState'; export interface InputAction { /** diff --git a/src/features/Conversation/store/slices/input/selectors.ts b/src/features/Conversation/store/slices/input/selectors.ts index 31c01e9a5a..3203c03906 100644 --- a/src/features/Conversation/store/slices/input/selectors.ts +++ b/src/features/Conversation/store/slices/input/selectors.ts @@ -1,4 +1,4 @@ -import type { State } from '../../initialState'; +import { type State } from '../../initialState'; const editor = (s: State) => s.editor; const inputMessage = (s: State) => s.inputMessage; diff --git a/src/features/Conversation/store/slices/message/action/crud.test.ts b/src/features/Conversation/store/slices/message/action/crud.test.ts index 4f3011a6d3..d7731d4741 100644 --- a/src/features/Conversation/store/slices/message/action/crud.test.ts +++ b/src/features/Conversation/store/slices/message/action/crud.test.ts @@ -1,10 +1,10 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { act } from '@testing-library/react'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import * as messageServiceModule from '@/services/message'; -import type { ConversationContext } from '../../../../types'; +import { type ConversationContext } from '../../../../types'; import { createStore } from '../../../index'; // Mock conversation-flow parse function (必须 mock,因为这是外部库) diff --git a/src/features/Conversation/store/slices/message/action/crud.ts b/src/features/Conversation/store/slices/message/action/crud.ts index 12453843c0..b8624e6f44 100644 --- a/src/features/Conversation/store/slices/message/action/crud.ts +++ b/src/features/Conversation/store/slices/message/action/crud.ts @@ -1,14 +1,26 @@ -import type {AssistantContentBlock, ChatImageItem, ChatMessageError, ChatMessagePluginError, ChatToolPayload, ChatToolPayloadWithResult, ChatVideoItem, CreateMessageParams, GroundingSearch, MessageMetadata, MessagePluginItem, ModelReasoning, UpdateMessageRAGParams} from '@lobechat/types'; import { - ChatErrorType + type AssistantContentBlock, + type ChatImageItem, + type ChatMessageError, + type ChatMessagePluginError, + type ChatToolPayload, + type ChatToolPayloadWithResult, + type ChatVideoItem, + type CreateMessageParams, + type GroundingSearch, + type MessageMetadata, + type MessagePluginItem, + type ModelReasoning, + type UpdateMessageRAGParams, } from '@lobechat/types'; +import { ChatErrorType } from '@lobechat/types'; import { merge, nanoid, safeParseJSON } from '@lobechat/utils'; import isEqual from 'fast-deep-equal'; -import type { StateCreator } from 'zustand'; +import { type StateCreator } from 'zustand'; import { messageService } from '@/services/message'; -import type { Store as ConversationStore } from '../../../action'; +import { type Store as ConversationStore } from '../../../action'; import { dataSelectors } from '../../data/selectors'; /** diff --git a/src/features/Conversation/store/slices/message/action/sendMessage.ts b/src/features/Conversation/store/slices/message/action/sendMessage.ts index 1e382252aa..bbdbd6d1de 100644 --- a/src/features/Conversation/store/slices/message/action/sendMessage.ts +++ b/src/features/Conversation/store/slices/message/action/sendMessage.ts @@ -1,8 +1,8 @@ -import type { SendMessageParams } from '@lobechat/types'; +import { type SendMessageParams } from '@lobechat/types'; import { useChatStore } from '@/store/chat'; -import type { Store as ConversationStore } from '../../../action'; +import { type Store as ConversationStore } from '../../../action'; /** * Send a message in this conversation diff --git a/src/features/Conversation/store/slices/message/action/state.test.ts b/src/features/Conversation/store/slices/message/action/state.test.ts index 4ae37d42e2..5724fcd135 100644 --- a/src/features/Conversation/store/slices/message/action/state.test.ts +++ b/src/features/Conversation/store/slices/message/action/state.test.ts @@ -1,4 +1,4 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { messageService } from '@/services/message'; diff --git a/src/features/Conversation/store/slices/message/action/state.ts b/src/features/Conversation/store/slices/message/action/state.ts index 289c9603ab..f9c99a0abb 100644 --- a/src/features/Conversation/store/slices/message/action/state.ts +++ b/src/features/Conversation/store/slices/message/action/state.ts @@ -1,10 +1,10 @@ import { copyToClipboard } from '@lobehub/ui'; import { produce } from 'immer'; -import type { StateCreator } from 'zustand'; +import { type StateCreator } from 'zustand'; import { messageService } from '@/services/message'; -import type { Store as ConversationStore } from '../../../action'; +import { type Store as ConversationStore } from '../../../action'; import { dataSelectors } from '../../data/selectors'; /** diff --git a/src/features/Conversation/store/slices/messageState/action.ts b/src/features/Conversation/store/slices/messageState/action.ts index 4744d78f9e..570adfcd98 100644 --- a/src/features/Conversation/store/slices/messageState/action.ts +++ b/src/features/Conversation/store/slices/messageState/action.ts @@ -1,7 +1,7 @@ import { produce } from 'immer'; -import type { StateCreator } from 'zustand'; +import { type StateCreator } from 'zustand'; -import type { State } from '../../initialState'; +import { type State } from '../../initialState'; export interface MessageEditingAction { /** @@ -24,10 +24,12 @@ const toggleBooleanList = (ids: string[], id: string, value: boolean) => { }); }; -export const messageEditingSlice: StateCreator = ( - set, - get, -) => ({ +export const messageEditingSlice: StateCreator< + State, + [['zustand/devtools', never]], + [], + MessageEditingAction +> = (set, get) => ({ toggleMessageEditing: (id, editing) => { set( { messageEditingIds: toggleBooleanList(get().messageEditingIds, id, editing) }, diff --git a/src/features/Conversation/store/slices/messageState/selectors.ts b/src/features/Conversation/store/slices/messageState/selectors.ts index 4f8f8132bb..1644854be5 100644 --- a/src/features/Conversation/store/slices/messageState/selectors.ts +++ b/src/features/Conversation/store/slices/messageState/selectors.ts @@ -1,7 +1,7 @@ import { useChatStore } from '@/store/chat'; import { threadSelectors } from '@/store/chat/selectors'; -import type { State } from '../../initialState'; +import { type State } from '../../initialState'; import { dataSelectors } from '../data/selectors'; /** @@ -119,7 +119,7 @@ const isToolApiNameShining = * Check if a message has a thread by source message ID * This is a bridge selector that reads from global ChatStore */ - + const hasThreadBySourceMsgId = (id: string) => (_s: State) => { const chatState = useChatStore.getState(); return threadSelectors.hasThreadBySourceMsgId(id)(chatState); @@ -129,7 +129,7 @@ const hasThreadBySourceMsgId = (id: string) => (_s: State) => { * Check if we are in thread mode (has active thread ID) * This is a bridge selector that reads from global ChatStore */ - + const isThreadMode = (_s: State) => { const chatState = useChatStore.getState(); return !!chatState.activeThreadId; diff --git a/src/features/Conversation/store/slices/tool/action.test.ts b/src/features/Conversation/store/slices/tool/action.test.ts index 0ab098c6c0..d47baf1006 100644 --- a/src/features/Conversation/store/slices/tool/action.test.ts +++ b/src/features/Conversation/store/slices/tool/action.test.ts @@ -1,7 +1,7 @@ import { act } from '@testing-library/react'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import type { ConversationContext, ConversationHooks } from '../../../types'; +import { type ConversationContext, type ConversationHooks } from '../../../types'; import { createStore } from '../../index'; // Mock dependencies diff --git a/src/features/Conversation/store/slices/tool/action.ts b/src/features/Conversation/store/slices/tool/action.ts index 839bc1128d..68efab0853 100644 --- a/src/features/Conversation/store/slices/tool/action.ts +++ b/src/features/Conversation/store/slices/tool/action.ts @@ -1,8 +1,8 @@ -import type { StateCreator } from 'zustand'; +import { type StateCreator } from 'zustand'; import { useChatStore } from '@/store/chat'; -import type { Store as ConversationStore } from '../../action'; +import { type Store as ConversationStore } from '../../action'; import { dataSelectors } from '../data/selectors'; /** diff --git a/src/features/Conversation/store/slices/virtuaList/action.ts b/src/features/Conversation/store/slices/virtuaList/action.ts index 583deac74f..39597632ff 100644 --- a/src/features/Conversation/store/slices/virtuaList/action.ts +++ b/src/features/Conversation/store/slices/virtuaList/action.ts @@ -1,7 +1,7 @@ -import type { StateCreator } from 'zustand'; +import { type StateCreator } from 'zustand'; -import type { State } from '../../initialState'; -import type { VirtuaScrollMethods, VisibleItemMetrics } from './initialState'; +import { type State } from '../../initialState'; +import { type VirtuaScrollMethods, type VisibleItemMetrics } from './initialState'; export interface VirtuaListAction { /** diff --git a/src/features/Conversation/store/slices/virtuaList/selectors.ts b/src/features/Conversation/store/slices/virtuaList/selectors.ts index 89b5ac1cd9..054ae15d20 100644 --- a/src/features/Conversation/store/slices/virtuaList/selectors.ts +++ b/src/features/Conversation/store/slices/virtuaList/selectors.ts @@ -1,4 +1,4 @@ -import type { State } from '../../initialState'; +import { type State } from '../../initialState'; const atBottom = (s: State) => s.atBottom; const isScrolling = (s: State) => s.isScrolling; diff --git a/src/features/Conversation/types/context.ts b/src/features/Conversation/types/context.ts index ccd3252589..58a8d1dde3 100644 --- a/src/features/Conversation/types/context.ts +++ b/src/features/Conversation/types/context.ts @@ -1,4 +1,4 @@ -import type {ConversationContext as BaseConversationContext} from '@lobechat/types'; +import { type ConversationContext as BaseConversationContext } from '@lobechat/types'; /** * Extended Conversation Context diff --git a/src/features/Conversation/types/hooks.ts b/src/features/Conversation/types/hooks.ts index 8f93de3e4d..ddc4b45320 100644 --- a/src/features/Conversation/types/hooks.ts +++ b/src/features/Conversation/types/hooks.ts @@ -1,8 +1,8 @@ -import type { - ChatToolPayload, - MessageToolCall, - SendMessageParams, - UIChatMessage, +import { + type ChatToolPayload, + type MessageToolCall, + type SendMessageParams, + type UIChatMessage, } from '@lobechat/types'; /** diff --git a/src/features/Conversation/types/ui.ts b/src/features/Conversation/types/ui.ts index 9983bc6db5..3a5c3830c7 100644 --- a/src/features/Conversation/types/ui.ts +++ b/src/features/Conversation/types/ui.ts @@ -1,7 +1,7 @@ -import type {LLMRoleType, UIChatMessage} from '@lobechat/types'; -import type {ActionIconGroupItemType} from '@lobehub/ui'; -import type {ChatItemProps} from '@lobehub/ui/chat'; -import type {FC, ReactNode} from 'react'; +import { type LLMRoleType, type UIChatMessage } from '@lobechat/types'; +import { type ActionIconGroupItemType } from '@lobehub/ui'; +import { type ChatItemProps } from '@lobehub/ui/chat'; +import { type FC, type ReactNode } from 'react'; export type RenderRole = LLMRoleType | 'default' | 'history' | string; export type RenderMessage = FC; diff --git a/src/features/DataImporter/Error.tsx b/src/features/DataImporter/Error.tsx index 4b54aaaca4..a78ef4865c 100644 --- a/src/features/DataImporter/Error.tsx +++ b/src/features/DataImporter/Error.tsx @@ -7,7 +7,7 @@ import Balancer from 'react-wrap-balancer'; import { GITHUB_ISSUES } from '@/const/url'; import { githubService } from '@/services/github'; -import type {ErrorShape} from '@/types/importer'; +import { type ErrorShape } from '@/types/importer'; interface ErrorProps { error?: ErrorShape; diff --git a/src/features/DataImporter/ImportDetail.tsx b/src/features/DataImporter/ImportDetail.tsx index 8e264d7f31..7a0c9928fc 100644 --- a/src/features/DataImporter/ImportDetail.tsx +++ b/src/features/DataImporter/ImportDetail.tsx @@ -7,7 +7,7 @@ import { Info } from 'lucide-react'; import { useState } from 'react'; import { useTranslation } from 'react-i18next'; -import type {ImportPgDataStructure} from '@/types/export'; +import { type ImportPgDataStructure } from '@/types/export'; const getNonEmptyTables = (data: ImportPgDataStructure) => { const result = []; diff --git a/src/features/DataImporter/config.ts b/src/features/DataImporter/config.ts index 6049c06c18..f6518aab5b 100644 --- a/src/features/DataImporter/config.ts +++ b/src/features/DataImporter/config.ts @@ -1,7 +1,7 @@ import { t } from 'i18next'; import { notification } from '@/components/AntdStaticMethods'; -import type {ImportPgDataStructure} from '@/types/export'; +import { type ImportPgDataStructure } from '@/types/export'; export const parseConfigFile = async (file: File): Promise => { const text = await file.text(); diff --git a/src/features/DataImporter/index.tsx b/src/features/DataImporter/index.tsx index 3bbd73fdc2..5d2e22356d 100644 --- a/src/features/DataImporter/index.tsx +++ b/src/features/DataImporter/index.tsx @@ -1,20 +1,20 @@ 'use client'; -import type {ErrorShape, ImportFileUploadState} from '@lobechat/types'; -import { ImportStage } from '@lobechat/types'; +import { type ErrorShape, type ImportFileUploadState } from '@lobechat/types'; +import { ImportStage } from '@lobechat/types'; import { Center } from '@lobehub/ui'; import { Upload } from 'antd'; import { createStaticStyles, cx } from 'antd-style'; import { ImportIcon } from 'lucide-react'; -import type {ReactNode} from 'react'; -import React, { memo, useMemo, useState } from 'react'; +import { type ReactNode } from 'react'; +import React, { memo, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import DataStyleModal from '@/components/DataStyleModal'; import { importService } from '@/services/import'; import { useChatStore } from '@/store/chat'; import { useHomeStore } from '@/store/home'; -import type {ImportPgDataStructure} from '@/types/export'; +import { type ImportPgDataStructure } from '@/types/export'; import { parseConfigFile } from './config'; import ImportError from './Error'; diff --git a/src/features/DevPanel/CacheViewer/cacheProvider.tsx b/src/features/DevPanel/CacheViewer/cacheProvider.tsx index 0469be55d0..49f36c87ec 100644 --- a/src/features/DevPanel/CacheViewer/cacheProvider.tsx +++ b/src/features/DevPanel/CacheViewer/cacheProvider.tsx @@ -1,18 +1,12 @@ 'use client'; -import type {PropsWithChildren} from 'react'; -import { - createContext, - use, - useEffect, - useState, - useTransition -} from 'react'; +import { type PropsWithChildren } from 'react'; +import { createContext, use, useEffect, useState, useTransition } from 'react'; import { usePathname } from '@/libs/router/navigation'; import { getCacheFiles } from './getCacheEntries'; -import type { NextCacheFileData } from './schema'; +import { type NextCacheFileData } from './schema'; interface CachePanelContextProps { entries: NextCacheFileData[]; diff --git a/src/features/DevPanel/CacheViewer/getCacheEntries.ts b/src/features/DevPanel/CacheViewer/getCacheEntries.ts index 69b30fc025..702e659a85 100644 --- a/src/features/DevPanel/CacheViewer/getCacheEntries.ts +++ b/src/features/DevPanel/CacheViewer/getCacheEntries.ts @@ -5,8 +5,8 @@ import { existsSync, promises } from 'node:fs'; import pMap from 'p-map'; import { ZodError } from 'zod'; -import type {NextCacheFileData} from './schema'; -import { nextCacheFileSchema } from './schema'; +import { type NextCacheFileData } from './schema'; +import { nextCacheFileSchema } from './schema'; const cachePath = '.next/cache/fetch-cache'; diff --git a/src/features/DevPanel/features/FloatPanel.tsx b/src/features/DevPanel/features/FloatPanel.tsx index ac2d3c5d72..18eee36db1 100644 --- a/src/features/DevPanel/features/FloatPanel.tsx +++ b/src/features/DevPanel/features/FloatPanel.tsx @@ -5,8 +5,8 @@ import { ActionIcon, Flexbox, FluentEmoji, Icon, SideNav } from '@lobehub/ui'; import { FloatButton } from 'antd'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import { BugIcon, BugOff, XIcon } from 'lucide-react'; -import type {ReactNode} from 'react'; -import { memo, useEffect, useState } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useEffect, useState } from 'react'; import { Rnd } from 'react-rnd'; import { isDesktop } from '@/const/version'; diff --git a/src/features/DevPanel/features/Header.tsx b/src/features/DevPanel/features/Header.tsx index c5770c8cb3..71eb527585 100644 --- a/src/features/DevPanel/features/Header.tsx +++ b/src/features/DevPanel/features/Header.tsx @@ -1,7 +1,7 @@ -import type {ActionIconProps, FlexboxProps} from '@lobehub/ui'; -import { ActionIcon, Flexbox } from '@lobehub/ui'; +import { type ActionIconProps, type FlexboxProps } from '@lobehub/ui'; +import { ActionIcon, Flexbox } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import React from 'react'; const styles = createStaticStyles(({ css, cssVar }) => ({ @@ -20,7 +20,6 @@ interface HeaderProps extends Omit { } const Header = ({ title, actions = [], extra, ...rest }: HeaderProps) => { - return ( ({ checked: css` diff --git a/src/features/Electron/navigation/routeMetadata.ts b/src/features/Electron/navigation/routeMetadata.ts index 6366372440..c26f3abc66 100644 --- a/src/features/Electron/navigation/routeMetadata.ts +++ b/src/features/Electron/navigation/routeMetadata.ts @@ -2,15 +2,8 @@ * Route metadata mapping for navigation history * Provides title and icon information based on route path */ -import type {LucideIcon} from 'lucide-react'; -import { - Circle, - Home, - MessageSquare, - Rocket, - ShapesIcon, - Users -} from 'lucide-react'; +import { type LucideIcon } from 'lucide-react'; +import { Circle, Home, MessageSquare, Rocket, ShapesIcon, Users } from 'lucide-react'; import { getRouteById } from '@/config/routes'; diff --git a/src/features/Electron/navigation/useNavigationHistory.ts b/src/features/Electron/navigation/useNavigationHistory.ts index 5498e61be7..f937be97cc 100644 --- a/src/features/Electron/navigation/useNavigationHistory.ts +++ b/src/features/Electron/navigation/useNavigationHistory.ts @@ -6,7 +6,10 @@ import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate } from 'react-router-dom'; import { pluginRegistry } from '@/features/Electron/titlebar/RecentlyViewed/plugins'; -import type {CachedPageData, PageReference} from '@/features/Electron/titlebar/RecentlyViewed/types'; +import { + type CachedPageData, + type PageReference, +} from '@/features/Electron/titlebar/RecentlyViewed/types'; import { useAgentStore } from '@/store/agent'; import { agentSelectors } from '@/store/agent/selectors/selectors'; import { useChatStore } from '@/store/chat'; diff --git a/src/features/Electron/titlebar/RecentlyViewed/PageItem.tsx b/src/features/Electron/titlebar/RecentlyViewed/PageItem.tsx index 34753bc0ae..099c6e6eb4 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/PageItem.tsx +++ b/src/features/Electron/titlebar/RecentlyViewed/PageItem.tsx @@ -10,7 +10,7 @@ import { useLocation, useNavigate } from 'react-router-dom'; import { useElectronStore } from '@/store/electron'; import { useStyles } from './styles'; -import type {ResolvedPageData} from './types'; +import { type ResolvedPageData } from './types'; interface PageItemProps { isPinned: boolean; diff --git a/src/features/Electron/titlebar/RecentlyViewed/Section.tsx b/src/features/Electron/titlebar/RecentlyViewed/Section.tsx index d07911edc0..a430e64993 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/Section.tsx +++ b/src/features/Electron/titlebar/RecentlyViewed/Section.tsx @@ -4,7 +4,7 @@ import { memo } from 'react'; import PageItem from './PageItem'; import { useStyles } from './styles'; -import type {ResolvedPageData} from './types'; +import { type ResolvedPageData } from './types'; interface SectionProps { isPinned: boolean; diff --git a/src/features/Electron/titlebar/RecentlyViewed/hooks/usePluginContext.ts b/src/features/Electron/titlebar/RecentlyViewed/hooks/usePluginContext.ts index 0a84099af3..aa2bc03835 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/hooks/usePluginContext.ts +++ b/src/features/Electron/titlebar/RecentlyViewed/hooks/usePluginContext.ts @@ -10,9 +10,9 @@ import { usePageStore } from '@/store/page'; import { listSelectors } from '@/store/page/slices/list/selectors'; import { useSessionStore } from '@/store/session'; import { sessionGroupSelectors } from '@/store/session/slices/sessionGroup/selectors'; -import type {ChatTopic} from '@/types/topic'; +import { type ChatTopic } from '@/types/topic'; -import type {PluginContext} from '../plugins/types'; +import { type PluginContext } from '../plugins/types'; /** * Search for a topic across all entries in topicDataMap diff --git a/src/features/Electron/titlebar/RecentlyViewed/hooks/useResolvedPages.ts b/src/features/Electron/titlebar/RecentlyViewed/hooks/useResolvedPages.ts index 7347dcd6a8..1954d6e8dd 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/hooks/useResolvedPages.ts +++ b/src/features/Electron/titlebar/RecentlyViewed/hooks/useResolvedPages.ts @@ -5,7 +5,7 @@ import { useMemo } from 'react'; import { useElectronStore } from '@/store/electron'; import { pluginRegistry } from '../plugins'; -import type {ResolvedPageData} from '../types'; +import { type ResolvedPageData } from '../types'; import { usePluginContext } from './usePluginContext'; interface UseResolvedPagesResult { diff --git a/src/features/Electron/titlebar/RecentlyViewed/plugins/agentPlugin.ts b/src/features/Electron/titlebar/RecentlyViewed/plugins/agentPlugin.ts index f3196c0b7c..6e8cbe55e3 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/plugins/agentPlugin.ts +++ b/src/features/Electron/titlebar/RecentlyViewed/plugins/agentPlugin.ts @@ -1,9 +1,8 @@ - import { MessageSquare } from 'lucide-react'; -import type {AgentParams, PageReference, ResolvedPageData} from '../types'; -import type {PluginContext, RecentlyViewedPlugin} from './types'; -import { createPageReference } from './types'; +import { type AgentParams, type PageReference, type ResolvedPageData } from '../types'; +import { type PluginContext, type RecentlyViewedPlugin } from './types'; +import { createPageReference } from './types'; const AGENT_PATH_REGEX = /^\/agent\/([^/?]+)$/; diff --git a/src/features/Electron/titlebar/RecentlyViewed/plugins/agentTopicPlugin.ts b/src/features/Electron/titlebar/RecentlyViewed/plugins/agentTopicPlugin.ts index ff1a3c43ef..d797c0109b 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/plugins/agentTopicPlugin.ts +++ b/src/features/Electron/titlebar/RecentlyViewed/plugins/agentTopicPlugin.ts @@ -1,9 +1,8 @@ - import { MessageSquare } from 'lucide-react'; -import type {AgentTopicParams, PageReference, ResolvedPageData} from '../types'; -import type {PluginContext, RecentlyViewedPlugin} from './types'; -import { createPageReference } from './types'; +import { type AgentTopicParams, type PageReference, type ResolvedPageData } from '../types'; +import { type PluginContext, type RecentlyViewedPlugin } from './types'; +import { createPageReference } from './types'; const AGENT_PATH_REGEX = /^\/agent\/([^/?]+)$/; diff --git a/src/features/Electron/titlebar/RecentlyViewed/plugins/communityPlugin.ts b/src/features/Electron/titlebar/RecentlyViewed/plugins/communityPlugin.ts index ec6de36abc..e7076bb883 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/plugins/communityPlugin.ts +++ b/src/features/Electron/titlebar/RecentlyViewed/plugins/communityPlugin.ts @@ -1,11 +1,10 @@ - import { ShapesIcon } from 'lucide-react'; import { getRouteById } from '@/config/routes'; -import type {CommunityParams, PageReference, ResolvedPageData} from '../types'; -import type {PluginContext, RecentlyViewedPlugin} from './types'; -import { createPageReference } from './types'; +import { type CommunityParams, type PageReference, type ResolvedPageData } from '../types'; +import { type PluginContext, type RecentlyViewedPlugin } from './types'; +import { createPageReference } from './types'; const communityIcon = getRouteById('community')?.icon || ShapesIcon; diff --git a/src/features/Electron/titlebar/RecentlyViewed/plugins/groupPlugin.ts b/src/features/Electron/titlebar/RecentlyViewed/plugins/groupPlugin.ts index 69636fbfa4..88d66a0618 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/plugins/groupPlugin.ts +++ b/src/features/Electron/titlebar/RecentlyViewed/plugins/groupPlugin.ts @@ -1,9 +1,8 @@ - import { Users } from 'lucide-react'; -import type {GroupParams, PageReference, ResolvedPageData} from '../types'; -import type {PluginContext, RecentlyViewedPlugin} from './types'; -import { createPageReference } from './types'; +import { type GroupParams, type PageReference, type ResolvedPageData } from '../types'; +import { type PluginContext, type RecentlyViewedPlugin } from './types'; +import { createPageReference } from './types'; const GROUP_PATH_REGEX = /^\/group\/([^/?]+)$/; diff --git a/src/features/Electron/titlebar/RecentlyViewed/plugins/groupTopicPlugin.ts b/src/features/Electron/titlebar/RecentlyViewed/plugins/groupTopicPlugin.ts index 0f31142a17..b54425e0da 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/plugins/groupTopicPlugin.ts +++ b/src/features/Electron/titlebar/RecentlyViewed/plugins/groupTopicPlugin.ts @@ -1,9 +1,8 @@ - import { Users } from 'lucide-react'; -import type {GroupTopicParams, PageReference, ResolvedPageData} from '../types'; -import type {PluginContext, RecentlyViewedPlugin} from './types'; -import { createPageReference } from './types'; +import { type GroupTopicParams, type PageReference, type ResolvedPageData } from '../types'; +import { type PluginContext, type RecentlyViewedPlugin } from './types'; +import { createPageReference } from './types'; const GROUP_PATH_REGEX = /^\/group\/([^/?]+)$/; diff --git a/src/features/Electron/titlebar/RecentlyViewed/plugins/homePlugin.ts b/src/features/Electron/titlebar/RecentlyViewed/plugins/homePlugin.ts index fa699e0e15..054ab3defd 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/plugins/homePlugin.ts +++ b/src/features/Electron/titlebar/RecentlyViewed/plugins/homePlugin.ts @@ -1,9 +1,8 @@ - import { Home } from 'lucide-react'; -import type {HomeParams, PageReference, ResolvedPageData} from '../types'; -import type {PluginContext, RecentlyViewedPlugin} from './types'; -import { createPageReference } from './types'; +import { type HomeParams, type PageReference, type ResolvedPageData } from '../types'; +import { type PluginContext, type RecentlyViewedPlugin } from './types'; +import { createPageReference } from './types'; export const homePlugin: RecentlyViewedPlugin<'home'> = { checkExists(_reference: PageReference<'home'>, _ctx: PluginContext): boolean { diff --git a/src/features/Electron/titlebar/RecentlyViewed/plugins/imagePlugin.ts b/src/features/Electron/titlebar/RecentlyViewed/plugins/imagePlugin.ts index a765471a49..81da4bf392 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/plugins/imagePlugin.ts +++ b/src/features/Electron/titlebar/RecentlyViewed/plugins/imagePlugin.ts @@ -1,11 +1,10 @@ - import { Image } from 'lucide-react'; import { getRouteById } from '@/config/routes'; -import type {ImageParams, PageReference, ResolvedPageData} from '../types'; -import type {PluginContext, RecentlyViewedPlugin} from './types'; -import { createPageReference } from './types'; +import { type ImageParams, type PageReference, type ResolvedPageData } from '../types'; +import { type PluginContext, type RecentlyViewedPlugin } from './types'; +import { createPageReference } from './types'; const imageIcon = getRouteById('image')?.icon || Image; diff --git a/src/features/Electron/titlebar/RecentlyViewed/plugins/memoryPlugin.ts b/src/features/Electron/titlebar/RecentlyViewed/plugins/memoryPlugin.ts index 087d9563c3..f5470cd267 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/plugins/memoryPlugin.ts +++ b/src/features/Electron/titlebar/RecentlyViewed/plugins/memoryPlugin.ts @@ -1,11 +1,10 @@ - import { Brain } from 'lucide-react'; import { getRouteById } from '@/config/routes'; -import type {MemoryParams, PageReference, ResolvedPageData} from '../types'; -import type {PluginContext, RecentlyViewedPlugin} from './types'; -import { createPageReference } from './types'; +import { type MemoryParams, type PageReference, type ResolvedPageData } from '../types'; +import { type PluginContext, type RecentlyViewedPlugin } from './types'; +import { createPageReference } from './types'; const memoryIcon = getRouteById('memory')?.icon || Brain; diff --git a/src/features/Electron/titlebar/RecentlyViewed/plugins/pagePlugin.ts b/src/features/Electron/titlebar/RecentlyViewed/plugins/pagePlugin.ts index c118a3b1eb..adbdcdc62a 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/plugins/pagePlugin.ts +++ b/src/features/Electron/titlebar/RecentlyViewed/plugins/pagePlugin.ts @@ -1,11 +1,10 @@ - import { FileText } from 'lucide-react'; import { getRouteById } from '@/config/routes'; -import type {PageParams, PageReference, ResolvedPageData} from '../types'; -import type {PluginContext, RecentlyViewedPlugin} from './types'; -import { createPageReference } from './types'; +import { type PageParams, type PageReference, type ResolvedPageData } from '../types'; +import { type PluginContext, type RecentlyViewedPlugin } from './types'; +import { createPageReference } from './types'; const PAGE_PATH_REGEX = /^\/page\/([^/?]+)$/; diff --git a/src/features/Electron/titlebar/RecentlyViewed/plugins/registry.ts b/src/features/Electron/titlebar/RecentlyViewed/plugins/registry.ts index f5ada21526..7b43a1db92 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/plugins/registry.ts +++ b/src/features/Electron/titlebar/RecentlyViewed/plugins/registry.ts @@ -1,6 +1,9 @@ - -import type {PageReference, PageType, ResolvedPageData} from '../types'; -import type {BaseRecentlyViewedPlugin, PluginContext, RecentlyViewedPlugin} from './types'; +import { type PageReference, type PageType, type ResolvedPageData } from '../types'; +import { + type BaseRecentlyViewedPlugin, + type PluginContext, + type RecentlyViewedPlugin, +} from './types'; /** * Plugin registry for RecentlyViewed system diff --git a/src/features/Electron/titlebar/RecentlyViewed/plugins/resourcePlugin.ts b/src/features/Electron/titlebar/RecentlyViewed/plugins/resourcePlugin.ts index 66d46a7530..cccc89e726 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/plugins/resourcePlugin.ts +++ b/src/features/Electron/titlebar/RecentlyViewed/plugins/resourcePlugin.ts @@ -1,11 +1,10 @@ - import { Database } from 'lucide-react'; import { getRouteById } from '@/config/routes'; -import type {PageReference, ResolvedPageData, ResourceParams} from '../types'; -import type {PluginContext, RecentlyViewedPlugin} from './types'; -import { createPageReference } from './types'; +import { type PageReference, type ResolvedPageData, type ResourceParams } from '../types'; +import { type PluginContext, type RecentlyViewedPlugin } from './types'; +import { createPageReference } from './types'; const resourceIcon = getRouteById('resource')?.icon || Database; diff --git a/src/features/Electron/titlebar/RecentlyViewed/plugins/settingsPlugin.ts b/src/features/Electron/titlebar/RecentlyViewed/plugins/settingsPlugin.ts index 853e148ace..15bd855fb9 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/plugins/settingsPlugin.ts +++ b/src/features/Electron/titlebar/RecentlyViewed/plugins/settingsPlugin.ts @@ -1,11 +1,10 @@ - import { Settings } from 'lucide-react'; import { getRouteById } from '@/config/routes'; -import type {PageReference, ResolvedPageData, SettingsParams} from '../types'; -import type {PluginContext, RecentlyViewedPlugin} from './types'; -import { createPageReference } from './types'; +import { type PageReference, type ResolvedPageData, type SettingsParams } from '../types'; +import { type PluginContext, type RecentlyViewedPlugin } from './types'; +import { createPageReference } from './types'; const settingsIcon = getRouteById('settings')?.icon || Settings; diff --git a/src/features/Electron/titlebar/RecentlyViewed/plugins/types.ts b/src/features/Electron/titlebar/RecentlyViewed/plugins/types.ts index f467ade6bb..ee62afb860 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/plugins/types.ts +++ b/src/features/Electron/titlebar/RecentlyViewed/plugins/types.ts @@ -1,11 +1,16 @@ -import type {LucideIcon} from 'lucide-react'; +import { type LucideIcon } from 'lucide-react'; -import type {LobeDocument} from '@/types/document'; -import type {MetaData} from '@/types/meta'; -import type {SessionGroupItem} from '@/types/session'; -import type {ChatTopic} from '@/types/topic'; +import { type LobeDocument } from '@/types/document'; +import { type MetaData } from '@/types/meta'; +import { type SessionGroupItem } from '@/types/session'; +import { type ChatTopic } from '@/types/topic'; -import type {PageParamsMap, PageReference, PageType, ResolvedPageData} from '../types'; +import { + type PageParamsMap, + type PageReference, + type PageType, + type ResolvedPageData, +} from '../types'; // ======== Plugin Context ======== // diff --git a/src/features/Electron/titlebar/RecentlyViewed/storage.ts b/src/features/Electron/titlebar/RecentlyViewed/storage.ts index 6b116cb818..16ae7aeb79 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/storage.ts +++ b/src/features/Electron/titlebar/RecentlyViewed/storage.ts @@ -1,4 +1,4 @@ -import type {PageReference} from './types'; +import { type PageReference } from './types'; export const PINNED_PAGES_STORAGE_KEY = 'lobechat:desktop:pinned-pages:v2'; diff --git a/src/features/Electron/titlebar/RecentlyViewed/types.ts b/src/features/Electron/titlebar/RecentlyViewed/types.ts index ca6027d9c0..64b93bb1be 100644 --- a/src/features/Electron/titlebar/RecentlyViewed/types.ts +++ b/src/features/Electron/titlebar/RecentlyViewed/types.ts @@ -1,4 +1,4 @@ -import type {LucideIcon} from 'lucide-react'; +import { type LucideIcon } from 'lucide-react'; // ======== Page Types ======== // @@ -62,7 +62,6 @@ export interface ImageParams { section?: string; } - export interface HomeParams {} /** diff --git a/src/features/Electron/titlebar/SimpleTitleBar.tsx b/src/features/Electron/titlebar/SimpleTitleBar.tsx index f425b60568..940afb43f5 100644 --- a/src/features/Electron/titlebar/SimpleTitleBar.tsx +++ b/src/features/Electron/titlebar/SimpleTitleBar.tsx @@ -2,7 +2,7 @@ import { TITLE_BAR_HEIGHT } from '@lobechat/desktop-bridge'; import { Flexbox } from '@lobehub/ui'; -import type {FC} from 'react'; +import { type FC } from 'react'; import { ProductLogo } from '@/components/Branding/ProductLogo'; import { electronStylish } from '@/styles/electron'; diff --git a/src/features/Electron/updater/UpdateModal.tsx b/src/features/Electron/updater/UpdateModal.tsx index fee58a7d7c..ee3fd44490 100644 --- a/src/features/Electron/updater/UpdateModal.tsx +++ b/src/features/Electron/updater/UpdateModal.tsx @@ -1,9 +1,7 @@ -import type {ProgressInfo, UpdateInfo} from '@lobechat/electron-client-ipc'; -import { - useWatchBroadcast -} from '@lobechat/electron-client-ipc'; -import type {ModalInstance} from '@lobehub/ui'; -import { Button, createModal,Flexbox } from '@lobehub/ui'; +import { type ProgressInfo, type UpdateInfo } from '@lobechat/electron-client-ipc'; +import { useWatchBroadcast } from '@lobechat/electron-client-ipc'; +import { type ModalInstance } from '@lobehub/ui'; +import { Button, createModal, Flexbox } from '@lobehub/ui'; import { App, Progress, Spin } from 'antd'; import React, { memo, useCallback, useEffect, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/Electron/updater/UpdateNotification.tsx b/src/features/Electron/updater/UpdateNotification.tsx index 5950ac3e1c..ebb204fd70 100644 --- a/src/features/Electron/updater/UpdateNotification.tsx +++ b/src/features/Electron/updater/UpdateNotification.tsx @@ -1,5 +1,5 @@ -import type {UpdateInfo} from '@lobechat/electron-client-ipc'; -import { useWatchBroadcast } from '@lobechat/electron-client-ipc'; +import { type UpdateInfo } from '@lobechat/electron-client-ipc'; +import { useWatchBroadcast } from '@lobechat/electron-client-ipc'; import { Button, Flexbox, Icon } from '@lobehub/ui'; import { Modal } from 'antd'; import { createStaticStyles, cssVar } from 'antd-style'; diff --git a/src/features/FileSidePanel/index.tsx b/src/features/FileSidePanel/index.tsx index b5aacacd2f..d55dc84630 100644 --- a/src/features/FileSidePanel/index.tsx +++ b/src/features/FileSidePanel/index.tsx @@ -1,12 +1,12 @@ 'use client'; import { ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const'; -import type {DraggablePanelProps} from '@lobehub/ui'; -import { DraggablePanel, DraggablePanelContainer } from '@lobehub/ui'; +import { type DraggablePanelProps } from '@lobehub/ui'; +import { DraggablePanel, DraggablePanelContainer } from '@lobehub/ui'; import { createStaticStyles, cssVar, useResponsive } from 'antd-style'; import isEqual from 'fast-deep-equal'; -import type {PropsWithChildren} from 'react'; -import { memo, useEffect, useState } from 'react'; +import { type PropsWithChildren } from 'react'; +import { memo, useEffect, useState } from 'react'; import UsageFooter from '@/business/client/features/FileSidePanel/UsageFooter'; import { FOLDER_WIDTH } from '@/const/layoutTokens'; diff --git a/src/features/FileViewer/NotSupport/index.tsx b/src/features/FileViewer/NotSupport/index.tsx index b212e70434..07ef59e7fe 100644 --- a/src/features/FileViewer/NotSupport/index.tsx +++ b/src/features/FileViewer/NotSupport/index.tsx @@ -1,7 +1,7 @@ import { Button, Center, Flexbox, FluentEmoji } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; -import type {ComponentType, CSSProperties} from 'react'; -import { useState } from 'react'; +import { type ComponentType, type CSSProperties } from 'react'; +import { useState } from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { MORE_FILE_PREVIEW_REQUEST_URL } from '@/const/url'; @@ -37,7 +37,12 @@ const NotSupport: ComponentType = ({ fileName, url, style }) => 此文件格式暂不支持在线预览,如有预览诉求,欢迎 - + 反馈给我们 diff --git a/src/features/FileViewer/Renderer/PDF/HighlightLayer.tsx b/src/features/FileViewer/Renderer/PDF/HighlightLayer.tsx index f7f025e995..eb6edafcdb 100644 --- a/src/features/FileViewer/Renderer/PDF/HighlightLayer.tsx +++ b/src/features/FileViewer/Renderer/PDF/HighlightLayer.tsx @@ -1,8 +1,8 @@ -import type {FC} from 'react'; -import { memo } from 'react'; +import { type FC } from 'react'; +import { memo } from 'react'; import { useFileStore } from '@/store/file'; -import type {ChunkMetadata, Coordinates, FileChunk} from '@/types/chunk'; +import { type ChunkMetadata, type Coordinates, type FileChunk } from '@/types/chunk'; interface HighlightRectProps { coordinates: Coordinates; diff --git a/src/features/FileViewer/index.tsx b/src/features/FileViewer/index.tsx index ec48d23f44..e2759d6ef0 100644 --- a/src/features/FileViewer/index.tsx +++ b/src/features/FileViewer/index.tsx @@ -1,9 +1,9 @@ 'use client'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; -import type {FileListItem} from '@/types/files'; +import { type FileListItem } from '@/types/files'; import NotSupport from './NotSupport'; import CodeViewer from './Renderer/Code'; diff --git a/src/features/GroupAvatar/index.tsx b/src/features/GroupAvatar/index.tsx index 97c83337be..e497153f0d 100644 --- a/src/features/GroupAvatar/index.tsx +++ b/src/features/GroupAvatar/index.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { GroupAvatarProps} from '@lobehub/ui'; +import { type GroupAvatarProps } from '@lobehub/ui'; import { GroupAvatar, Skeleton } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { memo, useMemo } from 'react'; diff --git a/src/features/GroupInfo/index.tsx b/src/features/GroupInfo/index.tsx index 57aa0adfcd..7b02496d63 100644 --- a/src/features/GroupInfo/index.tsx +++ b/src/features/GroupInfo/index.tsx @@ -1,10 +1,10 @@ import { Avatar, Center, Tag } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; import { startCase } from 'es-toolkit/compat'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; -import type {MetaData} from '@/types/meta'; +import { type MetaData } from '@/types/meta'; const styles = createStaticStyles(({ css }) => ({ avatar: css` diff --git a/src/features/HotkeyHelperPanel/HotkeyContent.tsx b/src/features/HotkeyHelperPanel/HotkeyContent.tsx index d237d44acc..7b8824a1e6 100644 --- a/src/features/HotkeyHelperPanel/HotkeyContent.tsx +++ b/src/features/HotkeyHelperPanel/HotkeyContent.tsx @@ -8,7 +8,7 @@ import { HOTKEYS_REGISTRATION } from '@/const/hotkeys'; import hotkeyMeta from '@/locales/default/hotkey'; import { useUserStore } from '@/store/user'; import { settingsSelectors } from '@/store/user/slices/settings/selectors'; -import type {HotkeyGroupId} from '@/types/hotkey'; +import { type HotkeyGroupId } from '@/types/hotkey'; const styles = createStaticStyles(({ css, cssVar }) => ({ desc: css` diff --git a/src/features/HotkeyHelperPanel/index.tsx b/src/features/HotkeyHelperPanel/index.tsx index c988b5eff3..bd13a2ad98 100644 --- a/src/features/HotkeyHelperPanel/index.tsx +++ b/src/features/HotkeyHelperPanel/index.tsx @@ -6,8 +6,8 @@ import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useGlobalStore } from '@/store/global'; -import type {HotkeyGroupId} from '@/types/hotkey'; -import { HotkeyGroupEnum } from '@/types/hotkey'; +import { type HotkeyGroupId } from '@/types/hotkey'; +import { HotkeyGroupEnum } from '@/types/hotkey'; import HotkeyContent from './HotkeyContent'; diff --git a/src/features/ImageSidePanel/index.tsx b/src/features/ImageSidePanel/index.tsx index e002fec2ce..95fc001ae2 100644 --- a/src/features/ImageSidePanel/index.tsx +++ b/src/features/ImageSidePanel/index.tsx @@ -1,11 +1,11 @@ 'use client'; -import type {DraggablePanelProps} from '@lobehub/ui'; -import { DraggablePanel, DraggablePanelContainer } from '@lobehub/ui'; +import { type DraggablePanelProps } from '@lobehub/ui'; +import { DraggablePanel, DraggablePanelContainer } from '@lobehub/ui'; import { createStaticStyles, cssVar, useResponsive } from 'antd-style'; import isEqual from 'fast-deep-equal'; -import type {PropsWithChildren} from 'react'; -import { memo, useEffect, useState } from 'react'; +import { type PropsWithChildren } from 'react'; +import { memo, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import PanelTitle from '@/components/PanelTitle'; diff --git a/src/features/ImageTopicPanel/index.tsx b/src/features/ImageTopicPanel/index.tsx index 83b357ad02..9745fd066f 100644 --- a/src/features/ImageTopicPanel/index.tsx +++ b/src/features/ImageTopicPanel/index.tsx @@ -1,11 +1,11 @@ 'use client'; -import type {DraggablePanelProps} from '@lobehub/ui'; -import { DraggablePanel, DraggablePanelContainer } from '@lobehub/ui'; +import { type DraggablePanelProps } from '@lobehub/ui'; +import { DraggablePanel, DraggablePanelContainer } from '@lobehub/ui'; import { createStaticStyles, cssVar, useResponsive } from 'antd-style'; import isEqual from 'fast-deep-equal'; -import type {PropsWithChildren} from 'react'; -import { memo, useEffect, useState } from 'react'; +import { type PropsWithChildren } from 'react'; +import { memo, useEffect, useState } from 'react'; import { useGlobalStore } from '@/store/global'; import { systemStatusSelectors } from '@/store/global/selectors'; diff --git a/src/features/LibraryModal/AssignKnowledgeBase/Item/MasonryItem.tsx b/src/features/LibraryModal/AssignKnowledgeBase/Item/MasonryItem.tsx index eb844e6a55..ab0a8046da 100644 --- a/src/features/LibraryModal/AssignKnowledgeBase/Item/MasonryItem.tsx +++ b/src/features/LibraryModal/AssignKnowledgeBase/Item/MasonryItem.tsx @@ -3,7 +3,7 @@ import { createStaticStyles } from 'antd-style'; import { memo } from 'react'; import KnowledgeIcon from '@/components/KnowledgeIcon'; -import type {KnowledgeItem} from '@/types/knowledgeBase'; +import { type KnowledgeItem } from '@/types/knowledgeBase'; import Actions from './Action'; diff --git a/src/features/LibraryModal/AssignKnowledgeBase/Item/MasonryItemWrapper.tsx b/src/features/LibraryModal/AssignKnowledgeBase/Item/MasonryItemWrapper.tsx index 863646636e..4423164912 100644 --- a/src/features/LibraryModal/AssignKnowledgeBase/Item/MasonryItemWrapper.tsx +++ b/src/features/LibraryModal/AssignKnowledgeBase/Item/MasonryItemWrapper.tsx @@ -1,6 +1,6 @@ import { memo } from 'react'; -import type {KnowledgeItem} from '@/types/knowledgeBase'; +import { type KnowledgeItem } from '@/types/knowledgeBase'; import MasonryItem from './MasonryItem'; diff --git a/src/features/LibraryModal/AssignKnowledgeBase/Item/PluginTag.tsx b/src/features/LibraryModal/AssignKnowledgeBase/Item/PluginTag.tsx index 9091288070..582396c63b 100644 --- a/src/features/LibraryModal/AssignKnowledgeBase/Item/PluginTag.tsx +++ b/src/features/LibraryModal/AssignKnowledgeBase/Item/PluginTag.tsx @@ -4,7 +4,7 @@ import { BadgeCheck, CircleUser, Package } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {InstallPluginMeta} from '@/types/tool/plugin'; +import { type InstallPluginMeta } from '@/types/tool/plugin'; const styles = createStaticStyles(({ css, cssVar }) => ({ community: css` diff --git a/src/features/LibraryModal/AssignKnowledgeBase/Item/index.tsx b/src/features/LibraryModal/AssignKnowledgeBase/Item/index.tsx index c784cf63c6..dd89772645 100644 --- a/src/features/LibraryModal/AssignKnowledgeBase/Item/index.tsx +++ b/src/features/LibraryModal/AssignKnowledgeBase/Item/index.tsx @@ -3,7 +3,7 @@ import { createStaticStyles } from 'antd-style'; import { memo } from 'react'; import KnowledgeIcon from '@/components/KnowledgeIcon'; -import type {KnowledgeItem} from '@/types/knowledgeBase'; +import { type KnowledgeItem } from '@/types/knowledgeBase'; import Actions from './Action'; diff --git a/src/features/LibraryModal/AssignKnowledgeBase/List.tsx b/src/features/LibraryModal/AssignKnowledgeBase/List.tsx index e665bc6a1b..1b940a064d 100644 --- a/src/features/LibraryModal/AssignKnowledgeBase/List.tsx +++ b/src/features/LibraryModal/AssignKnowledgeBase/List.tsx @@ -12,7 +12,7 @@ import Item from './Item'; import MasonryItemWrapper from './Item/MasonryItemWrapper'; import Loading from './Loading'; import MasonrySkeleton from './MasonrySkeleton'; -import type {ViewMode} from './ViewSwitcher'; +import { type ViewMode } from './ViewSwitcher'; import ViewSwitcher from './ViewSwitcher'; export const List = memo(() => { diff --git a/src/features/LibraryModal/CreateNew/CreateForm.tsx b/src/features/LibraryModal/CreateNew/CreateForm.tsx index 67576876d3..396bd2617f 100644 --- a/src/features/LibraryModal/CreateNew/CreateForm.tsx +++ b/src/features/LibraryModal/CreateNew/CreateForm.tsx @@ -3,7 +3,7 @@ import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useKnowledgeBaseStore } from '@/store/library'; -import type {CreateKnowledgeBaseParams} from '@/types/knowledgeBase'; +import { type CreateKnowledgeBaseParams } from '@/types/knowledgeBase'; interface CreateFormProps { onClose?: () => void; diff --git a/src/features/MCP/MCPInstallProgress/InstallError/ErrorDetails.tsx b/src/features/MCP/MCPInstallProgress/InstallError/ErrorDetails.tsx index dde44bc965..a9db698cf9 100644 --- a/src/features/MCP/MCPInstallProgress/InstallError/ErrorDetails.tsx +++ b/src/features/MCP/MCPInstallProgress/InstallError/ErrorDetails.tsx @@ -4,7 +4,7 @@ import * as motion from 'motion/react-m'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {MCPErrorInfoMetadata} from '@/types/plugins'; +import { type MCPErrorInfoMetadata } from '@/types/plugins'; const ErrorDetails = memo<{ errorInfo: MCPErrorInfoMetadata; diff --git a/src/features/MCP/MCPInstallProgress/InstallError/index.tsx b/src/features/MCP/MCPInstallProgress/InstallError/index.tsx index c1a7899089..347ac2a70a 100644 --- a/src/features/MCP/MCPInstallProgress/InstallError/index.tsx +++ b/src/features/MCP/MCPInstallProgress/InstallError/index.tsx @@ -3,7 +3,7 @@ import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { useToolStore } from '@/store/tool'; -import type {MCPErrorInfo} from '@/types/plugins'; +import { type MCPErrorInfo } from '@/types/plugins'; import ErrorDetails from './ErrorDetails'; diff --git a/src/features/MCP/MCPInstallProgress/MCPDependenciesGuide.tsx b/src/features/MCP/MCPInstallProgress/MCPDependenciesGuide.tsx index dc4bdbe0fa..c4ec06c13c 100644 --- a/src/features/MCP/MCPInstallProgress/MCPDependenciesGuide.tsx +++ b/src/features/MCP/MCPInstallProgress/MCPDependenciesGuide.tsx @@ -7,7 +7,7 @@ import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { useToolStore } from '@/store/tool'; -import type {SystemDependencyCheckResult} from '@/types/plugins'; +import { type SystemDependencyCheckResult } from '@/types/plugins'; interface MCPDependenciesGuideProps { identifier: string; diff --git a/src/features/MCP/MCPSettings/McpSettingsModal.tsx b/src/features/MCP/MCPSettings/McpSettingsModal.tsx index fd61c3091f..406b9bb79c 100644 --- a/src/features/MCP/MCPSettings/McpSettingsModal.tsx +++ b/src/features/MCP/MCPSettings/McpSettingsModal.tsx @@ -4,7 +4,7 @@ import { Button, Flexbox, Modal } from '@lobehub/ui'; import { memo, useRef } from 'react'; import { useTranslation } from 'react-i18next'; -import type {SettingsRef} from './index'; +import { type SettingsRef } from './index'; import Settings from './index'; interface McpSettingsModalProps { diff --git a/src/features/MCP/calculateScore.ts b/src/features/MCP/calculateScore.ts index c56cb717bb..aa1a44ba7b 100644 --- a/src/features/MCP/calculateScore.ts +++ b/src/features/MCP/calculateScore.ts @@ -1,6 +1,6 @@ -import type {DeploymentOption} from '@lobehub/market-types'; +import { type DeploymentOption } from '@lobehub/market-types'; -import type {DiscoverMcpDetail} from '@/types/discover'; +import { type DiscoverMcpDetail } from '@/types/discover'; export interface ScoreItem { check: boolean; @@ -80,19 +80,18 @@ export const DEFAULT_WEIGHTS = { }; // 评分计算输入数据类型 -export interface ScoreCalculationInput - extends Partial< - Pick< - DiscoverMcpDetail, - | 'deploymentOptions' - | 'github' - | 'isValidated' - | 'overview' - | 'promptsCount' - | 'resourcesCount' - | 'toolsCount' - > - > { +export interface ScoreCalculationInput extends Partial< + Pick< + DiscoverMcpDetail, + | 'deploymentOptions' + | 'github' + | 'isValidated' + | 'overview' + | 'promptsCount' + | 'resourcesCount' + | 'toolsCount' + > +> { installationMethods?: string; // 列表页使用 isClaimed?: boolean; // 添加 isClaimed 属性 } @@ -129,7 +128,7 @@ export function calculateScoreFlags(data: ScoreCalculationInput): ScoreFlags { ); const hasDeployMoreThanManual = Boolean( hasDeployment && - effectiveDeploymentOptions?.find((item) => item.installationMethod !== 'manual'), + effectiveDeploymentOptions?.find((item) => item.installationMethod !== 'manual'), ); const hasTools = Boolean(toolsCount && toolsCount > 0); diff --git a/src/features/MCP/useScoreList.ts b/src/features/MCP/useScoreList.ts index f3e4a5fc9f..ee4a106896 100644 --- a/src/features/MCP/useScoreList.ts +++ b/src/features/MCP/useScoreList.ts @@ -2,8 +2,8 @@ import { useTranslation } from 'react-i18next'; import { useDetailContext } from '@/features/MCPPluginDetail/DetailProvider'; -import type {ScoreListItem} from './calculateScore'; -import { calculateScoreFlags,DEFAULT_WEIGHTS } from './calculateScore'; +import { type ScoreListItem } from './calculateScore'; +import { calculateScoreFlags, DEFAULT_WEIGHTS } from './calculateScore'; /** * Hook for creating score list items with translations diff --git a/src/features/MCP/utils.ts b/src/features/MCP/utils.ts index fa09943a04..dcc02acf14 100644 --- a/src/features/MCP/utils.ts +++ b/src/features/MCP/utils.ts @@ -1,4 +1,4 @@ -import type {ConnectionConfig, DeploymentOption} from '@lobehub/market-types'; +import { type ConnectionConfig, type DeploymentOption } from '@lobehub/market-types'; export const genServerConfig = (identifier?: string, connection?: ConnectionConfig) => { // 检查是否为 HTTP 类型 diff --git a/src/features/MCPPluginDetail/Agents.tsx b/src/features/MCPPluginDetail/Agents.tsx index 72f0138fd0..800266b457 100644 --- a/src/features/MCPPluginDetail/Agents.tsx +++ b/src/features/MCPPluginDetail/Agents.tsx @@ -12,7 +12,7 @@ import { agentListStyles as styles } from '@/features/SkillStore/SkillDetail/sty import VirtuosoLoading from '@/features/SkillStore/SkillList/VirtuosoLoading'; import { useClientDataSWR } from '@/libs/swr'; import { discoverService } from '@/services/discover'; -import type {DiscoverAssistantItem} from '@/types/discover'; +import { type DiscoverAssistantItem } from '@/types/discover'; import { useDetailContext } from './DetailProvider'; diff --git a/src/features/MCPPluginDetail/CollapseDesc.tsx b/src/features/MCPPluginDetail/CollapseDesc.tsx index 2a51505d8d..cf4bba1f3d 100644 --- a/src/features/MCPPluginDetail/CollapseDesc.tsx +++ b/src/features/MCPPluginDetail/CollapseDesc.tsx @@ -1,6 +1,6 @@ import { Text } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { memo } from 'react'; const styles = createStaticStyles(({ css, cssVar }) => { diff --git a/src/features/MCPPluginDetail/CollapseLayout.tsx b/src/features/MCPPluginDetail/CollapseLayout.tsx index c1ff2fd88d..c65796d801 100644 --- a/src/features/MCPPluginDetail/CollapseLayout.tsx +++ b/src/features/MCPPluginDetail/CollapseLayout.tsx @@ -1,8 +1,8 @@ import { Flexbox } from '@lobehub/ui'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; -import type {TitleProps} from '../../app/[variants]/(main)/community/features/Title'; +import { type TitleProps } from '../../app/[variants]/(main)/community/features/Title'; import Title from '../../app/[variants]/(main)/community/features/Title'; export type CollapseItemType = { diff --git a/src/features/MCPPluginDetail/Deployment/Platform/index.tsx b/src/features/MCPPluginDetail/Deployment/Platform/index.tsx index de9b9f8f58..cefff7bda1 100644 --- a/src/features/MCPPluginDetail/Deployment/Platform/index.tsx +++ b/src/features/MCPPluginDetail/Deployment/Platform/index.tsx @@ -1,4 +1,4 @@ -import type {ConnectionConfig} from '@lobehub/market-types'; +import { type ConnectionConfig } from '@lobehub/market-types'; import { Block, Highlighter } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; import { memo } from 'react'; diff --git a/src/features/MCPPluginDetail/DetailProvider.tsx b/src/features/MCPPluginDetail/DetailProvider.tsx index 2e6d3a6dd1..bb1da245dd 100644 --- a/src/features/MCPPluginDetail/DetailProvider.tsx +++ b/src/features/MCPPluginDetail/DetailProvider.tsx @@ -1,9 +1,9 @@ 'use client'; -import type {ReactNode} from 'react'; -import { createContext, memo, use } from 'react'; +import { type ReactNode } from 'react'; +import { createContext, memo, use } from 'react'; -import type {DiscoverMcpDetail} from '@/types/discover'; +import { type DiscoverMcpDetail } from '@/types/discover'; export type DetailContextConfig = Partial; diff --git a/src/features/MCPPluginDetail/Nav.tsx b/src/features/MCPPluginDetail/Nav.tsx index 9678713aae..66cfaf861f 100644 --- a/src/features/MCPPluginDetail/Nav.tsx +++ b/src/features/MCPPluginDetail/Nav.tsx @@ -1,8 +1,8 @@ 'use client'; import { SOCIAL_URL } from '@lobechat/business-const'; -import type {TabsProps} from '@lobehub/ui'; -import { Flexbox, Icon, Tabs, Tag } from '@lobehub/ui'; +import { type TabsProps } from '@lobehub/ui'; +import { Flexbox, Icon, Tabs, Tag } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { BookOpenIcon, diff --git a/src/features/MCPPluginDetail/Schema/Block.tsx b/src/features/MCPPluginDetail/Schema/Block.tsx index 572c2d7126..01ab65979a 100644 --- a/src/features/MCPPluginDetail/Schema/Block.tsx +++ b/src/features/MCPPluginDetail/Schema/Block.tsx @@ -1,5 +1,5 @@ import { Flexbox, Segmented, Tag } from '@lobehub/ui'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/MCPPluginDetail/Score/ScoreItem.tsx b/src/features/MCPPluginDetail/Score/ScoreItem.tsx index f11fdc23e1..123e0ba662 100644 --- a/src/features/MCPPluginDetail/Score/ScoreItem.tsx +++ b/src/features/MCPPluginDetail/Score/ScoreItem.tsx @@ -1,7 +1,7 @@ import { Flexbox, Icon } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { BanIcon, CircleCheckBigIcon, CircleDashedIcon } from 'lucide-react'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import Title from '../../../app/[variants]/(main)/community/features/Title'; diff --git a/src/features/MCPPluginDetail/Score/ScoreList.tsx b/src/features/MCPPluginDetail/Score/ScoreList.tsx index 16e8bcffb3..821a9e8b78 100644 --- a/src/features/MCPPluginDetail/Score/ScoreList.tsx +++ b/src/features/MCPPluginDetail/Score/ScoreList.tsx @@ -2,7 +2,7 @@ import { Flexbox } from '@lobehub/ui'; import { Divider } from 'antd'; import { Fragment, memo } from 'react'; -import type {ScoreItemProps} from './ScoreItem'; +import { type ScoreItemProps } from './ScoreItem'; import ScoreItem from './ScoreItem'; interface ScoreListProps { diff --git a/src/features/MCPPluginDetail/Score/TotalScore.tsx b/src/features/MCPPluginDetail/Score/TotalScore.tsx index c63c8e71e7..5bb68e7d01 100644 --- a/src/features/MCPPluginDetail/Score/TotalScore.tsx +++ b/src/features/MCPPluginDetail/Score/TotalScore.tsx @@ -4,8 +4,8 @@ import { createStaticStyles, cssVar } from 'antd-style'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {ScoreResult} from '../../MCP/calculateScore'; -import { sortItemsByPriority } from '../../MCP/calculateScore'; +import { type ScoreResult } from '../../MCP/calculateScore'; +import { sortItemsByPriority } from '../../MCP/calculateScore'; // 使用 cssVar 的 getGradeColor 版本 const getGradeColor = (grade: string): string => { diff --git a/src/features/MobileSwitchLoading/index.tsx b/src/features/MobileSwitchLoading/index.tsx index 1e7871970d..dd34f3296b 100644 --- a/src/features/MobileSwitchLoading/index.tsx +++ b/src/features/MobileSwitchLoading/index.tsx @@ -1,6 +1,6 @@ import { Center, Flexbox, Icon } from '@lobehub/ui'; import { Loader2 } from 'lucide-react'; -import type {DynamicOptions} from 'next/dist/shared/lib/dynamic'; +import { type DynamicOptions } from 'next/dist/shared/lib/dynamic'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/MobileTabBar/index.tsx b/src/features/MobileTabBar/index.tsx index 95a141add7..23653c190b 100644 --- a/src/features/MobileTabBar/index.tsx +++ b/src/features/MobileTabBar/index.tsx @@ -1,6 +1,6 @@ import { Icon } from '@lobehub/ui'; -import type {TabBarProps} from '@lobehub/ui/mobile'; -import { TabBar } from '@lobehub/ui/mobile'; +import { type TabBarProps } from '@lobehub/ui/mobile'; +import { TabBar } from '@lobehub/ui/mobile'; import { createStaticStyles, cssVar } from 'antd-style'; import { Bot, MessageSquare, User } from 'lucide-react'; import { memo, useMemo } from 'react'; diff --git a/src/features/ModelSelect/index.tsx b/src/features/ModelSelect/index.tsx index 8e476cfc67..51ecce0e60 100644 --- a/src/features/ModelSelect/index.tsx +++ b/src/features/ModelSelect/index.tsx @@ -1,12 +1,12 @@ -import type {LobeSelectProps} from '@lobehub/ui'; -import { LobeSelect, TooltipGroup } from '@lobehub/ui'; +import { type LobeSelectProps } from '@lobehub/ui'; +import { LobeSelect, TooltipGroup } from '@lobehub/ui'; import { createStyles } from 'antd-style'; -import type {ReactNode} from 'react'; -import { memo, useMemo } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useMemo } from 'react'; import { ModelItemRender, ProviderItemRender } from '@/components/ModelSelect'; import { useEnabledChatModels } from '@/hooks/useEnabledChatModels'; -import type {EnabledProviderWithModels} from '@/types/aiProvider'; +import { type EnabledProviderWithModels } from '@/types/aiProvider'; const useStyles = createStyles(({ css }, { popupWidth }: { popupWidth?: number | string }) => ({ popup: css` diff --git a/src/features/ModelSwitchPanel/__mocks__/mockEnabledChatModels.ts b/src/features/ModelSwitchPanel/__mocks__/mockEnabledChatModels.ts index 181278115c..5746151eb6 100644 --- a/src/features/ModelSwitchPanel/__mocks__/mockEnabledChatModels.ts +++ b/src/features/ModelSwitchPanel/__mocks__/mockEnabledChatModels.ts @@ -1,6 +1,6 @@ -import type { AiModelForSelect } from 'model-bank'; +import { type AiModelForSelect } from 'model-bank'; -import type { EnabledProviderWithModels } from '@/types/aiProvider'; +import { type EnabledProviderWithModels } from '@/types/aiProvider'; /** * Mock data for testing ModelSwitchPanel diff --git a/src/features/ModelSwitchPanel/components/Footer.tsx b/src/features/ModelSwitchPanel/components/Footer.tsx index ea0fcca531..5b21d8ad22 100644 --- a/src/features/ModelSwitchPanel/components/Footer.tsx +++ b/src/features/ModelSwitchPanel/components/Footer.tsx @@ -1,7 +1,7 @@ import { Block, Flexbox, Icon } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { LucideArrowRight, LucideBolt } from 'lucide-react'; -import type { FC } from 'react'; +import { type FC } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; diff --git a/src/features/ModelSwitchPanel/components/List/ListItemRenderer.tsx b/src/features/ModelSwitchPanel/components/List/ListItemRenderer.tsx index d7dc138acb..d403e92974 100644 --- a/src/features/ModelSwitchPanel/components/List/ListItemRenderer.tsx +++ b/src/features/ModelSwitchPanel/components/List/ListItemRenderer.tsx @@ -9,7 +9,7 @@ import urlJoin from 'url-join'; import { ModelItemRender, ProviderItemRender } from '@/components/ModelSelect'; import { styles } from '../../styles'; -import type { ListItem } from '../../types'; +import { type ListItem } from '../../types'; import { menuKey } from '../../utils'; import { MultipleProvidersModelItem } from './MultipleProvidersModelItem'; import { SingleProviderModelItem } from './SingleProviderModelItem'; diff --git a/src/features/ModelSwitchPanel/components/List/MultipleProvidersModelItem.tsx b/src/features/ModelSwitchPanel/components/List/MultipleProvidersModelItem.tsx index df227b1cd4..eb73186678 100644 --- a/src/features/ModelSwitchPanel/components/List/MultipleProvidersModelItem.tsx +++ b/src/features/ModelSwitchPanel/components/List/MultipleProvidersModelItem.tsx @@ -23,7 +23,7 @@ import urlJoin from 'url-join'; import { ModelItemRender, ProviderItemRender } from '@/components/ModelSelect'; import { styles } from '../../styles'; -import type { ModelWithProviders } from '../../types'; +import { type ModelWithProviders } from '../../types'; import { menuKey } from '../../utils'; interface MultipleProvidersModelItemProps { diff --git a/src/features/ModelSwitchPanel/components/List/SingleProviderModelItem.tsx b/src/features/ModelSwitchPanel/components/List/SingleProviderModelItem.tsx index 1f3b4209c6..f29b6ea963 100644 --- a/src/features/ModelSwitchPanel/components/List/SingleProviderModelItem.tsx +++ b/src/features/ModelSwitchPanel/components/List/SingleProviderModelItem.tsx @@ -2,7 +2,7 @@ import { memo } from 'react'; import { ModelItemRender } from '@/components/ModelSelect'; -import type { ModelWithProviders } from '../../types'; +import { type ModelWithProviders } from '../../types'; interface SingleProviderModelItemProps { data: ModelWithProviders; diff --git a/src/features/ModelSwitchPanel/components/List/index.tsx b/src/features/ModelSwitchPanel/components/List/index.tsx index 251417cffe..463faa83f9 100644 --- a/src/features/ModelSwitchPanel/components/List/index.tsx +++ b/src/features/ModelSwitchPanel/components/List/index.tsx @@ -1,5 +1,5 @@ import { Flexbox, TooltipGroup } from '@lobehub/ui'; -import type { FC } from 'react'; +import { type FC } from 'react'; import { useCallback, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Virtuoso } from 'react-virtuoso'; @@ -11,7 +11,7 @@ import { useBuildListItems } from '../../hooks/useBuildListItems'; import { useModelAndProvider } from '../../hooks/useModelAndProvider'; import { usePanelHandlers } from '../../hooks/usePanelHandlers'; import { styles } from '../../styles'; -import type { GroupMode } from '../../types'; +import { type GroupMode } from '../../types'; import { menuKey } from '../../utils'; import { ListItemRenderer } from './ListItemRenderer'; diff --git a/src/features/ModelSwitchPanel/components/PanelContent.tsx b/src/features/ModelSwitchPanel/components/PanelContent.tsx index 80267434c2..eca65a39ef 100644 --- a/src/features/ModelSwitchPanel/components/PanelContent.tsx +++ b/src/features/ModelSwitchPanel/components/PanelContent.tsx @@ -1,4 +1,4 @@ -import type { FC } from 'react'; +import { type FC } from 'react'; import { useState } from 'react'; import { Rnd } from 'react-rnd'; diff --git a/src/features/ModelSwitchPanel/components/Toolbar.tsx b/src/features/ModelSwitchPanel/components/Toolbar.tsx index c79c479217..e8574bcd75 100644 --- a/src/features/ModelSwitchPanel/components/Toolbar.tsx +++ b/src/features/ModelSwitchPanel/components/Toolbar.tsx @@ -5,7 +5,7 @@ import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { styles } from '../styles'; -import type { GroupMode } from '../types'; +import { type GroupMode } from '../types'; interface ToolbarProps { groupMode: GroupMode; @@ -19,7 +19,14 @@ export const Toolbar = memo( const { t } = useTranslation('components'); return ( - + { const groupMode = useGlobalStore(systemStatusSelectors.modelSwitchPanelGroupMode) as GroupMode; diff --git a/src/features/ModelSwitchPanel/index.tsx b/src/features/ModelSwitchPanel/index.tsx index fd0e0ebf9a..889d0a680e 100644 --- a/src/features/ModelSwitchPanel/index.tsx +++ b/src/features/ModelSwitchPanel/index.tsx @@ -9,7 +9,7 @@ import { memo, useCallback, useState } from 'react'; import { PanelContent } from './components/PanelContent'; import { styles } from './styles'; -import type { ModelSwitchPanelProps } from './types'; +import { type ModelSwitchPanelProps } from './types'; const ModelSwitchPanel = memo( ({ diff --git a/src/features/ModelSwitchPanel/types.ts b/src/features/ModelSwitchPanel/types.ts index 4c785d7710..c69c313730 100644 --- a/src/features/ModelSwitchPanel/types.ts +++ b/src/features/ModelSwitchPanel/types.ts @@ -1,8 +1,8 @@ -import type { DropdownMenuPlacement } from '@lobehub/ui'; -import type { AiModelForSelect } from 'model-bank'; -import type { ReactNode } from 'react'; +import { type DropdownMenuPlacement } from '@lobehub/ui'; +import { type AiModelForSelect } from 'model-bank'; +import { type ReactNode } from 'react'; -import type { EnabledProviderWithModels } from '@/types/aiProvider'; +import { type EnabledProviderWithModels } from '@/types/aiProvider'; export type GroupMode = 'byModel' | 'byProvider'; diff --git a/src/features/ModelSwitchPanel/utils.ts b/src/features/ModelSwitchPanel/utils.ts index 9b4c854454..c2ebdeff0f 100644 --- a/src/features/ModelSwitchPanel/utils.ts +++ b/src/features/ModelSwitchPanel/utils.ts @@ -1,4 +1,4 @@ -import type { ListItem } from './types'; +import { type ListItem } from './types'; export const menuKey = (provider: string, model: string) => `${provider}-${model}`; diff --git a/src/features/NavHeader/index.tsx b/src/features/NavHeader/index.tsx index 6c676c77ad..34acbe91c0 100644 --- a/src/features/NavHeader/index.tsx +++ b/src/features/NavHeader/index.tsx @@ -1,7 +1,7 @@ -import type {FlexboxProps} from '@lobehub/ui'; -import { Flexbox, TooltipGroup } from '@lobehub/ui'; -import type {CSSProperties, ReactNode} from 'react'; -import { memo } from 'react'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Flexbox, TooltipGroup } from '@lobehub/ui'; +import { type CSSProperties, type ReactNode } from 'react'; +import { memo } from 'react'; import ToggleLeftPanelButton from '@/features/NavPanel/ToggleLeftPanelButton'; import { useGlobalStore } from '@/store/global'; diff --git a/src/features/NavPanel/SideBarDrawer.tsx b/src/features/NavPanel/SideBarDrawer.tsx index 3fe5280863..66756979ab 100644 --- a/src/features/NavPanel/SideBarDrawer.tsx +++ b/src/features/NavPanel/SideBarDrawer.tsx @@ -4,7 +4,7 @@ import { ActionIcon, Flexbox, Text } from '@lobehub/ui'; import { Drawer } from 'antd'; import { cssVar } from 'antd-style'; import { XIcon } from 'lucide-react'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo, Suspense } from 'react'; import { DESKTOP_HEADER_ICON_SIZE } from '@/const/layoutTokens'; diff --git a/src/features/NavPanel/SideBarHeaderLayout.tsx b/src/features/NavPanel/SideBarHeaderLayout.tsx index 3cbf3079cc..ab3921c8a8 100644 --- a/src/features/NavPanel/SideBarHeaderLayout.tsx +++ b/src/features/NavPanel/SideBarHeaderLayout.tsx @@ -1,11 +1,11 @@ 'use client'; import { Flexbox, Icon, Text } from '@lobehub/ui'; -import type {BreadcrumbProps} from 'antd'; -import { Breadcrumb } from 'antd'; +import { type BreadcrumbProps } from 'antd'; +import { Breadcrumb } from 'antd'; import { createStaticStyles } from 'antd-style'; import { ChevronRightIcon, HomeIcon } from 'lucide-react'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import { flushSync } from 'react-dom'; import { useNavigate } from 'react-router-dom'; diff --git a/src/features/NavPanel/SideBarLayout.tsx b/src/features/NavPanel/SideBarLayout.tsx index 841980f924..e9bee9935f 100644 --- a/src/features/NavPanel/SideBarLayout.tsx +++ b/src/features/NavPanel/SideBarLayout.tsx @@ -1,5 +1,5 @@ import { Flexbox, ScrollShadow, TooltipGroup } from '@lobehub/ui'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo, Suspense } from 'react'; import Footer from '@/app/[variants]/(main)/home/_layout/Footer'; diff --git a/src/features/NavPanel/ToggleLeftPanelButton.tsx b/src/features/NavPanel/ToggleLeftPanelButton.tsx index c3f41b7b4d..9b1376a80a 100644 --- a/src/features/NavPanel/ToggleLeftPanelButton.tsx +++ b/src/features/NavPanel/ToggleLeftPanelButton.tsx @@ -1,9 +1,9 @@ 'use client'; -import type {ActionIconProps} from '@lobehub/ui'; -import { ActionIcon } from '@lobehub/ui'; +import { type ActionIconProps } from '@lobehub/ui'; +import { ActionIcon } from '@lobehub/ui'; import { PanelLeftClose, PanelLeftOpen } from 'lucide-react'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/NavPanel/components/BackButton.tsx b/src/features/NavPanel/components/BackButton.tsx index 8194ee7eff..36f62b89ee 100644 --- a/src/features/NavPanel/components/BackButton.tsx +++ b/src/features/NavPanel/components/BackButton.tsx @@ -1,5 +1,5 @@ -import type {ActionIconProps} from '@lobehub/ui'; -import { ActionIcon } from '@lobehub/ui'; +import { type ActionIconProps } from '@lobehub/ui'; +import { ActionIcon } from '@lobehub/ui'; import { ChevronLeftIcon } from 'lucide-react'; import { memo } from 'react'; import { Link } from 'react-router-dom'; diff --git a/src/features/NavPanel/components/BackNav.tsx b/src/features/NavPanel/components/BackNav.tsx index 07441f4250..e25e9c2272 100644 --- a/src/features/NavPanel/components/BackNav.tsx +++ b/src/features/NavPanel/components/BackNav.tsx @@ -1,7 +1,7 @@ import { ActionIcon, Button, Flexbox } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { ChevronLeftIcon } from 'lucide-react'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; diff --git a/src/features/NavPanel/components/NavItem.tsx b/src/features/NavPanel/components/NavItem.tsx index 2335db669e..09dab07d8a 100644 --- a/src/features/NavPanel/components/NavItem.tsx +++ b/src/features/NavPanel/components/NavItem.tsx @@ -1,9 +1,9 @@ 'use client'; -import type { BlockProps, GenericItemType, IconProps } from '@lobehub/ui'; +import { type BlockProps, type GenericItemType, type IconProps } from '@lobehub/ui'; import { Block, Center, ContextMenuTrigger, Flexbox, Icon, Text } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import NeuralNetworkLoading from '@/components/NeuralNetworkLoading'; diff --git a/src/features/NavPanel/components/NavPanelDraggable.tsx b/src/features/NavPanel/components/NavPanelDraggable.tsx index 232f50623c..942fa6c5be 100644 --- a/src/features/NavPanel/components/NavPanelDraggable.tsx +++ b/src/features/NavPanel/components/NavPanelDraggable.tsx @@ -3,7 +3,7 @@ import { DraggablePanel, Freeze } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; import { AnimatePresence, motion, useIsPresent } from 'motion/react'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { memo, useLayoutEffect, useMemo, useRef } from 'react'; import { USER_DROPDOWN_ICON_ID } from '@/app/[variants]/(main)/home/_layout/Header/components/User'; @@ -65,12 +65,15 @@ const draggableStyles = createStaticStyles(({ css, cssVar }) => ({ overflow: hidden; flex: 1; + + min-width: 240px; + max-width: 100%; min-height: 100%; max-height: 100%; - max-width: 100%; - min-width: 240px; `, layer: css` + will-change: filter, opacity, transform; + position: absolute; inset: 0; @@ -78,12 +81,10 @@ const draggableStyles = createStaticStyles(({ css, cssVar }) => ({ display: flex; flex-direction: column; + min-width: 240px; + max-width: 100%; min-height: 100%; max-height: 100%; - max-width: 100%; - min-width: 240px; - - will-change: filter, opacity, transform; `, panel: css` user-select: none; diff --git a/src/features/NavPanel/components/SkeletonList.tsx b/src/features/NavPanel/components/SkeletonList.tsx index efd020aa02..5173ac396d 100644 --- a/src/features/NavPanel/components/SkeletonList.tsx +++ b/src/features/NavPanel/components/SkeletonList.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FlexboxProps} from '@lobehub/ui'; -import { Flexbox, Skeleton } from '@lobehub/ui'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Flexbox, Skeleton } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { memo } from 'react'; diff --git a/src/features/NavPanel/hooks/useNavPanel.ts b/src/features/NavPanel/hooks/useNavPanel.ts index 09d2c3f25c..ee87050679 100644 --- a/src/features/NavPanel/hooks/useNavPanel.ts +++ b/src/features/NavPanel/hooks/useNavPanel.ts @@ -1,6 +1,6 @@ 'use client'; -import type {DraggablePanelProps} from '@lobehub/ui'; +import { type DraggablePanelProps } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; import { useTypeScriptHappyCallback } from '@/hooks/useTypeScriptHappyCallback'; diff --git a/src/features/NavPanel/index.tsx b/src/features/NavPanel/index.tsx index 36b6b8179d..d7d43fc9f7 100644 --- a/src/features/NavPanel/index.tsx +++ b/src/features/NavPanel/index.tsx @@ -1,11 +1,7 @@ 'use client'; -import type {PropsWithChildren, ReactNode} from 'react'; -import { - memo, - useLayoutEffect, - useSyncExternalStore -} from 'react'; +import { type PropsWithChildren, type ReactNode } from 'react'; +import { memo, useLayoutEffect, useSyncExternalStore } from 'react'; import Sidebar from '../../app/[variants]/(main)/home/_layout/Sidebar'; import { NavPanelDraggable } from './components/NavPanelDraggable'; diff --git a/src/features/OllamaModelDownloader/index.tsx b/src/features/OllamaModelDownloader/index.tsx index 6b05c7afe2..e1536ed363 100644 --- a/src/features/OllamaModelDownloader/index.tsx +++ b/src/features/OllamaModelDownloader/index.tsx @@ -2,14 +2,14 @@ import { Ollama } from '@lobehub/icons'; import { Alert, Button, Center, Flexbox, Input } from '@lobehub/ui'; import { Progress } from 'antd'; import { cssVar } from 'antd-style'; -import type {ReactNode} from 'react'; -import { memo, useCallback, useMemo, useState } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useCallback, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import FormAction from '@/components/FormAction'; import { useActionSWR } from '@/libs/swr'; -import type {ModelProgressInfo} from '@/services/models'; -import { modelsService } from '@/services/models'; +import { type ModelProgressInfo } from '@/services/models'; +import { modelsService } from '@/services/models'; import { formatSize } from '@/utils/format'; import { useDownloadMonitor } from './useDownloadMonitor'; diff --git a/src/features/PageEditor/Copilot/AgentSelector/Actions.tsx b/src/features/PageEditor/Copilot/AgentSelector/Actions.tsx index 48e4349cda..bee41bb07c 100644 --- a/src/features/PageEditor/Copilot/AgentSelector/Actions.tsx +++ b/src/features/PageEditor/Copilot/AgentSelector/Actions.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { MoreHorizontalIcon } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/features/PageEditor/Copilot/AgentSelector/AgentItem.tsx b/src/features/PageEditor/Copilot/AgentSelector/AgentItem.tsx index 92c83777e4..fc117572c2 100644 --- a/src/features/PageEditor/Copilot/AgentSelector/AgentItem.tsx +++ b/src/features/PageEditor/Copilot/AgentSelector/AgentItem.tsx @@ -1,4 +1,4 @@ -import type {GroupMemberAvatar} from '@lobechat/types'; +import { type GroupMemberAvatar } from '@lobechat/types'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/PageEditor/Copilot/AgentSelector/useDropdownMenu.tsx b/src/features/PageEditor/Copilot/AgentSelector/useDropdownMenu.tsx index 03b00bd597..ba8a149333 100644 --- a/src/features/PageEditor/Copilot/AgentSelector/useDropdownMenu.tsx +++ b/src/features/PageEditor/Copilot/AgentSelector/useDropdownMenu.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { App } from 'antd'; import { Trash2 } from 'lucide-react'; import { useMemo } from 'react'; diff --git a/src/features/PageEditor/Copilot/Conversation.tsx b/src/features/PageEditor/Copilot/Conversation.tsx index 4424639a40..a77ed255fb 100644 --- a/src/features/PageEditor/Copilot/Conversation.tsx +++ b/src/features/PageEditor/Copilot/Conversation.tsx @@ -2,7 +2,7 @@ import { Flexbox } from '@lobehub/ui'; import { memo, useEffect, useState } from 'react'; import DragUploadZone, { useUploadFiles } from '@/components/DragUploadZone'; -import type { ActionKeys } from '@/features/ChatInput'; +import { type ActionKeys } from '@/features/ChatInput'; import { ChatInput, ChatList } from '@/features/Conversation'; import { useAgentStore } from '@/store/agent'; import { agentByIdSelectors } from '@/store/agent/selectors'; diff --git a/src/features/PageEditor/Copilot/TopicSelector/Actions.tsx b/src/features/PageEditor/Copilot/TopicSelector/Actions.tsx index 4cb78dfaac..8b3e16803e 100644 --- a/src/features/PageEditor/Copilot/TopicSelector/Actions.tsx +++ b/src/features/PageEditor/Copilot/TopicSelector/Actions.tsx @@ -1,5 +1,5 @@ -import type {DropdownItem} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu } from '@lobehub/ui'; +import { type DropdownItem } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu } from '@lobehub/ui'; import { MoreHorizontalIcon } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/features/PageEditor/Copilot/TopicSelector/useDropdownMenu.tsx b/src/features/PageEditor/Copilot/TopicSelector/useDropdownMenu.tsx index f576483f7f..3cc16d80ff 100644 --- a/src/features/PageEditor/Copilot/TopicSelector/useDropdownMenu.tsx +++ b/src/features/PageEditor/Copilot/TopicSelector/useDropdownMenu.tsx @@ -1,5 +1,5 @@ -import type {MenuProps} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { App } from 'antd'; import { Trash2 } from 'lucide-react'; import { useCallback } from 'react'; diff --git a/src/features/PageEditor/EditorCanvas/index.tsx b/src/features/PageEditor/EditorCanvas/index.tsx index 1fffea69f5..473b025819 100644 --- a/src/features/PageEditor/EditorCanvas/index.tsx +++ b/src/features/PageEditor/EditorCanvas/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {CSSProperties} from 'react'; -import { memo } from 'react'; +import { type CSSProperties } from 'react'; +import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { EditorCanvas as SharedEditorCanvas } from '@/features/EditorCanvas'; diff --git a/src/features/PageEditor/EditorCanvas/useAskCopilotItem.tsx b/src/features/PageEditor/EditorCanvas/useAskCopilotItem.tsx index 32a079a2d9..d2d1738da6 100644 --- a/src/features/PageEditor/EditorCanvas/useAskCopilotItem.tsx +++ b/src/features/PageEditor/EditorCanvas/useAskCopilotItem.tsx @@ -2,9 +2,9 @@ import { DEFAULT_INBOX_AVATAR } from '@lobechat/const'; import { nanoid } from '@lobechat/utils'; -import type {IEditor} from '@lobehub/editor'; -import { HIDE_TOOLBAR_COMMAND } from '@lobehub/editor'; -import type {ChatInputActionsProps} from '@lobehub/editor/react'; +import { type IEditor } from '@lobehub/editor'; +import { HIDE_TOOLBAR_COMMAND } from '@lobehub/editor'; +import { type ChatInputActionsProps } from '@lobehub/editor/react'; import { Avatar, Block } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; import { useMemo } from 'react'; diff --git a/src/features/PageEditor/EditorCanvas/useSlashItems.tsx b/src/features/PageEditor/EditorCanvas/useSlashItems.tsx index 663341e91e..93e1206b3e 100644 --- a/src/features/PageEditor/EditorCanvas/useSlashItems.tsx +++ b/src/features/PageEditor/EditorCanvas/useSlashItems.tsx @@ -1,4 +1,4 @@ -import type {IEditor, SlashOptions} from '@lobehub/editor'; +import { type IEditor, type SlashOptions } from '@lobehub/editor'; import { INSERT_CHECK_LIST_COMMAND, INSERT_CODEMIRROR_COMMAND, @@ -8,7 +8,7 @@ import { INSERT_MATH_COMMAND, INSERT_ORDERED_LIST_COMMAND, INSERT_TABLE_COMMAND, - INSERT_UNORDERED_LIST_COMMAND + INSERT_UNORDERED_LIST_COMMAND, } from '@lobehub/editor'; import { Text } from '@lobehub/ui'; import { diff --git a/src/features/PageEditor/Header/useMenu.tsx b/src/features/PageEditor/Header/useMenu.tsx index 707ca7e60b..836d69c180 100644 --- a/src/features/PageEditor/Header/useMenu.tsx +++ b/src/features/PageEditor/Header/useMenu.tsx @@ -1,6 +1,6 @@ import { isDesktop } from '@lobechat/const'; -import type {DropdownItem} from '@lobehub/ui'; -import { Icon } from '@lobehub/ui'; +import { type DropdownItem } from '@lobehub/ui'; +import { Icon } from '@lobehub/ui'; import { App } from 'antd'; import { cssVar, useResponsive } from 'antd-style'; import dayjs from 'dayjs'; diff --git a/src/features/PageEditor/PageAgentProvider.tsx b/src/features/PageEditor/PageAgentProvider.tsx index 57ae6c1aae..ecec77fbf2 100644 --- a/src/features/PageEditor/PageAgentProvider.tsx +++ b/src/features/PageEditor/PageAgentProvider.tsx @@ -1,11 +1,11 @@ -import type {ReactNode} from 'react'; -import { memo, useMemo } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useMemo } from 'react'; import { ConversationProvider } from '@/features/Conversation'; import { useOperationState } from '@/hooks/useOperationState'; import { useAgentStore } from '@/store/agent'; import { useChatStore } from '@/store/chat'; -import type {MessageMapKeyInput} from '@/store/chat/utils/messageMapKey'; +import { type MessageMapKeyInput } from '@/store/chat/utils/messageMapKey'; import { messageMapKey } from '@/store/chat/utils/messageMapKey'; interface PageAgentProviderProps { diff --git a/src/features/PageEditor/PageEditor.tsx b/src/features/PageEditor/PageEditor.tsx index eb048adfc4..f17234fdcb 100644 --- a/src/features/PageEditor/PageEditor.tsx +++ b/src/features/PageEditor/PageEditor.tsx @@ -4,8 +4,8 @@ import { BUILTIN_AGENT_SLUGS } from '@lobechat/builtin-agents'; import { EditorProvider } from '@lobehub/editor/react'; import { Flexbox } from '@lobehub/ui'; import { cssVar } from 'antd-style'; -import type {FC} from 'react'; -import { memo, useEffect } from 'react'; +import { type FC } from 'react'; +import { memo, useEffect } from 'react'; import Loading from '@/components/Loading/BrandTextLoading'; import DiffAllToolbar from '@/features/EditorCanvas/DiffAllToolbar'; diff --git a/src/features/PageEditor/PageEditorProvider.tsx b/src/features/PageEditor/PageEditorProvider.tsx index d5da43aab6..cb2cc90f08 100644 --- a/src/features/PageEditor/PageEditorProvider.tsx +++ b/src/features/PageEditor/PageEditorProvider.tsx @@ -1,11 +1,11 @@ 'use client'; import { useEditor } from '@lobehub/editor/react'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; -import { createStore,Provider } from './store'; -import type {StoreUpdaterProps} from './StoreUpdater'; +import { createStore, Provider } from './store'; +import { type StoreUpdaterProps } from './StoreUpdater'; import StoreUpdater from './StoreUpdater'; interface PageEditorProviderProps extends StoreUpdaterProps { diff --git a/src/features/PageEditor/StoreUpdater.tsx b/src/features/PageEditor/StoreUpdater.tsx index a397d78cc9..c5998cc19b 100644 --- a/src/features/PageEditor/StoreUpdater.tsx +++ b/src/features/PageEditor/StoreUpdater.tsx @@ -5,8 +5,8 @@ import { createStoreUpdater } from 'zustand-utils'; import { pageAgentRuntime } from '@/store/tool/slices/builtin/executors/lobe-page-agent'; -import type {PublicState} from './store'; -import { usePageEditorStore, useStoreApi } from './store'; +import { type PublicState } from './store'; +import { usePageEditorStore, useStoreApi } from './store'; export interface StoreUpdaterProps extends Partial { pageId?: string; diff --git a/src/features/PageEditor/store/action.ts b/src/features/PageEditor/store/action.ts index e502307a1f..4c605fba1e 100644 --- a/src/features/PageEditor/store/action.ts +++ b/src/features/PageEditor/store/action.ts @@ -1,12 +1,12 @@ import { EDITOR_DEBOUNCE_TIME, EDITOR_MAX_WAIT } from '@lobechat/const'; import debug from 'debug'; import { debounce } from 'es-toolkit/compat'; -import type {StateCreator} from 'zustand'; +import { type StateCreator } from 'zustand'; import { useDocumentStore } from '@/store/document'; import { useFileStore } from '@/store/file'; -import type {State} from './initialState'; +import { type State } from './initialState'; import { initialState } from './initialState'; const log = debug('page:editor'); diff --git a/src/features/PageEditor/store/index.ts b/src/features/PageEditor/store/index.ts index 1f9d2462da..41d2c68acc 100644 --- a/src/features/PageEditor/store/index.ts +++ b/src/features/PageEditor/store/index.ts @@ -1,14 +1,14 @@ 'use client'; -import type {StoreApiWithSelector} from '@lobechat/types'; +import { type StoreApiWithSelector } from '@lobechat/types'; import { subscribeWithSelector } from 'zustand/middleware'; import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; import { createContext } from 'zustand-utils'; -import type {Store} from './action'; -import { store } from './action'; -import type {State} from './initialState'; +import { type Store } from './action'; +import { store } from './action'; +import { type State } from './initialState'; export type { PublicState, State } from './initialState'; diff --git a/src/features/PageEditor/store/initialState.ts b/src/features/PageEditor/store/initialState.ts index b9dc6df7b5..9923972669 100644 --- a/src/features/PageEditor/store/initialState.ts +++ b/src/features/PageEditor/store/initialState.ts @@ -1,4 +1,4 @@ -import type {IEditor} from '@lobehub/editor'; +import { type IEditor } from '@lobehub/editor'; export type MetaSaveStatus = 'idle' | 'saving' | 'saved'; diff --git a/src/features/PageEditor/store/selectors.ts b/src/features/PageEditor/store/selectors.ts index 4064da05df..9f65a9de94 100644 --- a/src/features/PageEditor/store/selectors.ts +++ b/src/features/PageEditor/store/selectors.ts @@ -1,4 +1,4 @@ -import type {Store} from './action'; +import { type Store } from './action'; export const selectors = { documentId: (s: Store) => s.documentId, diff --git a/src/features/PageEmpty.tsx b/src/features/PageEmpty.tsx index 0eed853c69..8dc6363fc8 100644 --- a/src/features/PageEmpty.tsx +++ b/src/features/PageEmpty.tsx @@ -1,5 +1,5 @@ -import type {EmptyProps} from '@lobehub/ui'; -import { Center, Empty } from '@lobehub/ui'; +import { type EmptyProps } from '@lobehub/ui'; +import { Center, Empty } from '@lobehub/ui'; import { FileText } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/PlanIcon/index.tsx b/src/features/PlanIcon/index.tsx index 1fe55f2931..abbdedf74c 100644 --- a/src/features/PlanIcon/index.tsx +++ b/src/features/PlanIcon/index.tsx @@ -2,8 +2,8 @@ import { Plans } from '@lobechat/types'; import { Center, Flexbox, Icon, Tag } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; import { Atom, Box, CircleSlash, Sparkle, Zap } from 'lucide-react'; -import type {CSSProperties, MouseEvent} from 'react'; -import { memo } from 'react'; +import { type CSSProperties, type MouseEvent } from 'react'; +import { memo } from 'react'; import { useTranslation } from 'react-i18next'; export const themes = { diff --git a/src/features/PluginDetailModal/index.tsx b/src/features/PluginDetailModal/index.tsx index 63e5998054..483c091181 100644 --- a/src/features/PluginDetailModal/index.tsx +++ b/src/features/PluginDetailModal/index.tsx @@ -1,5 +1,5 @@ -import type {SegmentedProps} from '@lobehub/ui'; -import { Modal, Segmented } from '@lobehub/ui'; +import { type SegmentedProps } from '@lobehub/ui'; +import { Modal, Segmented } from '@lobehub/ui'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import useMergeState from 'use-merge-value'; diff --git a/src/features/PluginDevModal/LocalForm.tsx b/src/features/PluginDevModal/LocalForm.tsx index 678e0e1f74..b40d04f5ba 100644 --- a/src/features/PluginDevModal/LocalForm.tsx +++ b/src/features/PluginDevModal/LocalForm.tsx @@ -1,6 +1,6 @@ -import type {FormItemProps} from '@lobehub/ui'; -import { Form, Input, TextArea } from '@lobehub/ui'; -import type {FormInstance} from 'antd'; +import { type FormItemProps } from '@lobehub/ui'; +import { Form, Input, TextArea } from '@lobehub/ui'; +import { type FormInstance } from 'antd'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/PluginDevModal/MCPManifestForm/ArgsInput.tsx b/src/features/PluginDevModal/MCPManifestForm/ArgsInput.tsx index 1dec43e087..06827946b5 100644 --- a/src/features/PluginDevModal/MCPManifestForm/ArgsInput.tsx +++ b/src/features/PluginDevModal/MCPManifestForm/ArgsInput.tsx @@ -1,5 +1,5 @@ -import type {InputProps} from '@lobehub/ui'; -import { ActionIcon, Button, Flexbox,Input } from '@lobehub/ui'; +import { type InputProps } from '@lobehub/ui'; +import { ActionIcon, Button, Flexbox, Input } from '@lobehub/ui'; import { Plus, X } from 'lucide-react'; import React, { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/PluginDevModal/MCPManifestForm/CollapsibleSection.tsx b/src/features/PluginDevModal/MCPManifestForm/CollapsibleSection.tsx index 254b47207b..ffc8bf0670 100644 --- a/src/features/PluginDevModal/MCPManifestForm/CollapsibleSection.tsx +++ b/src/features/PluginDevModal/MCPManifestForm/CollapsibleSection.tsx @@ -1,7 +1,7 @@ import { createStaticStyles, cx } from 'antd-style'; import { ChevronDown, ChevronRight } from 'lucide-react'; -import type {ReactNode} from 'react'; -import { useState } from 'react'; +import { type ReactNode } from 'react'; +import { useState } from 'react'; const styles = createStaticStyles(({ css, cssVar }) => ({ container: css` diff --git a/src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx b/src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx index e32ebc73ae..4cdc9963c4 100644 --- a/src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx +++ b/src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx @@ -1,5 +1,5 @@ import { Alert, Button, Flexbox, TextArea } from '@lobehub/ui'; -import type {FormInstance} from 'antd'; +import { type FormInstance } from 'antd'; import { useState } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/PluginDevModal/MCPManifestForm/index.tsx b/src/features/PluginDevModal/MCPManifestForm/index.tsx index 4667041f49..958e02cdce 100644 --- a/src/features/PluginDevModal/MCPManifestForm/index.tsx +++ b/src/features/PluginDevModal/MCPManifestForm/index.tsx @@ -1,6 +1,6 @@ import { Alert, Button, Flexbox, FormItem, Input, InputPassword } from '@lobehub/ui'; -import type {FormInstance} from 'antd'; -import { Divider, Form, Radio } from 'antd'; +import { type FormInstance } from 'antd'; +import { Divider, Form, Radio } from 'antd'; import isEqual from 'fast-deep-equal'; import { useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -10,7 +10,7 @@ import MCPStdioCommandInput from '@/components/MCPStdioCommandInput'; import ErrorDetails from '@/features/MCP/MCPInstallProgress/InstallError/ErrorDetails'; import { useToolStore } from '@/store/tool'; import { mcpStoreSelectors, pluginSelectors } from '@/store/tool/selectors'; -import type {MCPErrorInfoMetadata} from '@/types/plugins'; +import { type MCPErrorInfoMetadata } from '@/types/plugins'; import ArgsInput from './ArgsInput'; import CollapsibleSection from './CollapsibleSection'; diff --git a/src/features/PluginDevModal/MCPManifestForm/utils.ts b/src/features/PluginDevModal/MCPManifestForm/utils.ts index e96e5de319..9e2d541fd7 100644 --- a/src/features/PluginDevModal/MCPManifestForm/utils.ts +++ b/src/features/PluginDevModal/MCPManifestForm/utils.ts @@ -1,4 +1,4 @@ -import type {LobeChatPluginManifest} from '@lobehub/chat-plugin-sdk'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; import { safeParseJSON } from '@/utils/safeParseJSON'; diff --git a/src/features/PluginDevModal/PluginPreview/index.tsx b/src/features/PluginDevModal/PluginPreview/index.tsx index 720e37c1a4..bfad7f15a4 100644 --- a/src/features/PluginDevModal/PluginPreview/index.tsx +++ b/src/features/PluginDevModal/PluginPreview/index.tsx @@ -1,7 +1,7 @@ -import type {LobeChatPluginManifest} from '@lobehub/chat-plugin-sdk'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; import { Block, Button, Flexbox, Icon, Text } from '@lobehub/ui'; -import type {FormInstance} from 'antd'; -import { Form as AForm } from 'antd'; +import { type FormInstance } from 'antd'; +import { Form as AForm } from 'antd'; import { cssVar } from 'antd-style'; import { FileCode } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/features/PluginDevModal/UrlManifestForm.tsx b/src/features/PluginDevModal/UrlManifestForm.tsx index 7741ffc16f..39d9073a34 100644 --- a/src/features/PluginDevModal/UrlManifestForm.tsx +++ b/src/features/PluginDevModal/UrlManifestForm.tsx @@ -1,8 +1,8 @@ import { BRANDING_NAME } from '@lobechat/business-const'; -import type {LobeChatPluginManifest} from '@lobehub/chat-plugin-sdk'; -import { ActionIcon, Checkbox,Flexbox, FormItem, Input } from '@lobehub/ui'; -import type {FormInstance} from 'antd'; -import { Form } from 'antd'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; +import { ActionIcon, Checkbox, Flexbox, FormItem, Input } from '@lobehub/ui'; +import { type FormInstance } from 'antd'; +import { Form } from 'antd'; import { FileCode, RotateCwIcon } from 'lucide-react'; import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -11,7 +11,7 @@ import ManifestPreviewer from '@/components/ManifestPreviewer'; import { toolService } from '@/services/tool'; import { useToolStore } from '@/store/tool'; import { pluginSelectors } from '@/store/tool/selectors'; -import type {PluginInstallError} from '@/types/tool/plugin'; +import { type PluginInstallError } from '@/types/tool/plugin'; interface ProxyCheckerProps { onChange?: (value: boolean) => void; diff --git a/src/features/PluginDevModal/index.tsx b/src/features/PluginDevModal/index.tsx index 0871b44789..06202d0076 100644 --- a/src/features/PluginDevModal/index.tsx +++ b/src/features/PluginDevModal/index.tsx @@ -6,7 +6,7 @@ import { memo, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { isDesktop } from '@/const/version'; -import type {LobeToolCustomPlugin} from '@/types/tool/plugin'; +import { type LobeToolCustomPlugin } from '@/types/tool/plugin'; import MCPManifestForm from './MCPManifestForm'; import PluginPreview from './PluginPreview'; @@ -153,9 +153,7 @@ const DevModal = memo( {t('dev.manifest.mode.claude')}
- - {t('dev.manifest.mode.claudeWip')} - + {t('dev.manifest.mode.claudeWip')}
), diff --git a/src/features/PluginSettings/index.tsx b/src/features/PluginSettings/index.tsx index b97374c41c..bbb2975a52 100644 --- a/src/features/PluginSettings/index.tsx +++ b/src/features/PluginSettings/index.tsx @@ -1,4 +1,4 @@ -import type {PluginSchema} from '@lobehub/chat-plugin-sdk'; +import { type PluginSchema } from '@lobehub/chat-plugin-sdk'; import { Form, Markdown } from '@lobehub/ui'; import { Form as AForm } from 'antd'; import { createStaticStyles } from 'antd-style'; diff --git a/src/features/PluginTag/index.tsx b/src/features/PluginTag/index.tsx index d0b558a04d..098c56f9b3 100644 --- a/src/features/PluginTag/index.tsx +++ b/src/features/PluginTag/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {MenuProps} from '@lobehub/ui'; -import { Center, DropdownMenu, Icon, Tag } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Center, DropdownMenu, Icon, Tag } from '@lobehub/ui'; import isEqual from 'fast-deep-equal'; import { LucideToyBrick } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/features/PluginsUI/Render/DefaultType/IFrameRender/index.tsx b/src/features/PluginsUI/Render/DefaultType/IFrameRender/index.tsx index 8997a8f3eb..0f49369d8f 100644 --- a/src/features/PluginsUI/Render/DefaultType/IFrameRender/index.tsx +++ b/src/features/PluginsUI/Render/DefaultType/IFrameRender/index.tsx @@ -1,4 +1,4 @@ -import type {PluginRenderProps} from '@lobehub/chat-plugin-sdk/client'; +import { type PluginRenderProps } from '@lobehub/chat-plugin-sdk/client'; import { Skeleton } from '@lobehub/ui'; import { memo, useRef, useState } from 'react'; diff --git a/src/features/PluginsUI/Render/DefaultType/SystemJsRender/index.tsx b/src/features/PluginsUI/Render/DefaultType/SystemJsRender/index.tsx index a9572e5d3e..bd6be24722 100644 --- a/src/features/PluginsUI/Render/DefaultType/SystemJsRender/index.tsx +++ b/src/features/PluginsUI/Render/DefaultType/SystemJsRender/index.tsx @@ -1,4 +1,4 @@ -import type {PluginRender, PluginRenderProps} from '@lobehub/chat-plugin-sdk/client'; +import { type PluginRender, type PluginRenderProps } from '@lobehub/chat-plugin-sdk/client'; import { Skeleton } from '@lobehub/ui'; import { memo, useEffect, useState } from 'react'; diff --git a/src/features/PluginsUI/Render/MCPType/index.tsx b/src/features/PluginsUI/Render/MCPType/index.tsx index 36f347195b..164e070ca1 100644 --- a/src/features/PluginsUI/Render/MCPType/index.tsx +++ b/src/features/PluginsUI/Render/MCPType/index.tsx @@ -2,7 +2,7 @@ import { Flexbox, Image, Markdown } from '@lobehub/ui'; import { memo } from 'react'; import Arguments from '@/features/Conversation/Messages/AssistantGroup/Tool/Detail/Arguments'; -import type {ToolCallResult} from '@/libs/mcp'; +import { type ToolCallResult } from '@/libs/mcp'; export interface MCPTypeProps { apiName?: string; diff --git a/src/features/PluginsUI/Render/StandaloneType/Iframe.tsx b/src/features/PluginsUI/Render/StandaloneType/Iframe.tsx index f789dcf206..0d4b9ead9c 100644 --- a/src/features/PluginsUI/Render/StandaloneType/Iframe.tsx +++ b/src/features/PluginsUI/Render/StandaloneType/Iframe.tsx @@ -1,4 +1,4 @@ -import type {PluginRequestPayload} from '@lobehub/chat-plugin-sdk'; +import { type PluginRequestPayload } from '@lobehub/chat-plugin-sdk'; import { Skeleton } from '@lobehub/ui'; import { memo, useRef, useState } from 'react'; diff --git a/src/features/PluginsUI/Render/StandaloneType/index.tsx b/src/features/PluginsUI/Render/StandaloneType/index.tsx index 8b48f851c7..c005af1818 100644 --- a/src/features/PluginsUI/Render/StandaloneType/index.tsx +++ b/src/features/PluginsUI/Render/StandaloneType/index.tsx @@ -1,4 +1,4 @@ -import type {PluginRequestPayload} from '@lobehub/chat-plugin-sdk'; +import { type PluginRequestPayload } from '@lobehub/chat-plugin-sdk'; import { memo } from 'react'; import { useToolStore } from '@/store/tool'; diff --git a/src/features/PluginsUI/Render/index.tsx b/src/features/PluginsUI/Render/index.tsx index 5752e28e43..cc6b4c9303 100644 --- a/src/features/PluginsUI/Render/index.tsx +++ b/src/features/PluginsUI/Render/index.tsx @@ -1,5 +1,5 @@ -import type {LobeToolRenderType} from '@lobechat/types'; -import type {PluginRequestPayload} from '@lobehub/chat-plugin-sdk'; +import { type LobeToolRenderType } from '@lobechat/types'; +import { type PluginRequestPayload } from '@lobehub/chat-plugin-sdk'; import { memo } from 'react'; import { ToolErrorBoundary } from '@/features/Conversation/Messages/Tool/ErrorBoundary'; diff --git a/src/features/Portal/Artifacts/index.ts b/src/features/Portal/Artifacts/index.ts index a20fff5f5f..e42fdd8e10 100644 --- a/src/features/Portal/Artifacts/index.ts +++ b/src/features/Portal/Artifacts/index.ts @@ -1,4 +1,4 @@ -import type {PortalImpl} from '../type'; +import { type PortalImpl } from '../type'; import Body from './Body'; import Title from './Title'; diff --git a/src/features/Portal/Document/Wrapper.tsx b/src/features/Portal/Document/Wrapper.tsx index 7eeebf0be4..9676998692 100644 --- a/src/features/Portal/Document/Wrapper.tsx +++ b/src/features/Portal/Document/Wrapper.tsx @@ -1,7 +1,7 @@ 'use client'; import { EditorProvider } from '@lobehub/editor/react'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { memo } from 'react'; import { useChatStore } from '@/store/chat'; diff --git a/src/features/Portal/Document/index.ts b/src/features/Portal/Document/index.ts index 96d2f1ebaf..20b62f609c 100644 --- a/src/features/Portal/Document/index.ts +++ b/src/features/Portal/Document/index.ts @@ -1,4 +1,4 @@ -import type {PortalImpl} from '../type'; +import { type PortalImpl } from '../type'; import Body from './Body'; import Header from './Header'; import Wrapper from './Wrapper'; diff --git a/src/features/Portal/FilePreview/index.ts b/src/features/Portal/FilePreview/index.ts index f9be2f9c7a..c75811e0bd 100644 --- a/src/features/Portal/FilePreview/index.ts +++ b/src/features/Portal/FilePreview/index.ts @@ -1,4 +1,4 @@ -import type {PortalImpl} from '../type'; +import { type PortalImpl } from '../type'; import Body from './Body'; import Title from './Title'; diff --git a/src/features/Portal/GroupThread/index.ts b/src/features/Portal/GroupThread/index.ts index 8e5ef5c5ee..7de758ad0b 100644 --- a/src/features/Portal/GroupThread/index.ts +++ b/src/features/Portal/GroupThread/index.ts @@ -1,4 +1,4 @@ -import type {PortalImpl} from '../type'; +import { type PortalImpl } from '../type'; import Body from './Body'; import Header from './Header'; import Title from './Title'; diff --git a/src/features/Portal/Home/Body/Files/FileList/Item.tsx b/src/features/Portal/Home/Body/Files/FileList/Item.tsx index b18c079d43..51704355e4 100644 --- a/src/features/Portal/Home/Body/Files/FileList/Item.tsx +++ b/src/features/Portal/Home/Body/Files/FileList/Item.tsx @@ -1,4 +1,4 @@ -import type {ChatFileItem} from '@lobechat/types'; +import { type ChatFileItem } from '@lobechat/types'; import { Flexbox, Text } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { memo } from 'react'; diff --git a/src/features/Portal/Home/Body/Plugins/ArtifactList/Item/index.tsx b/src/features/Portal/Home/Body/Plugins/ArtifactList/Item/index.tsx index ce6f847b75..1f9d52e6f0 100644 --- a/src/features/Portal/Home/Body/Plugins/ArtifactList/Item/index.tsx +++ b/src/features/Portal/Home/Body/Plugins/ArtifactList/Item/index.tsx @@ -1,4 +1,4 @@ -import type {ChatPluginPayload} from '@lobechat/types'; +import { type ChatPluginPayload } from '@lobechat/types'; import { Flexbox, Icon, Tag, Text } from '@lobehub/ui'; import { cx } from 'antd-style'; import isEqual from 'fast-deep-equal'; diff --git a/src/features/Portal/MessageDetail/index.ts b/src/features/Portal/MessageDetail/index.ts index 56c27ff1c1..ba1a275f44 100644 --- a/src/features/Portal/MessageDetail/index.ts +++ b/src/features/Portal/MessageDetail/index.ts @@ -1,4 +1,4 @@ -import type {PortalImpl} from '../type'; +import { type PortalImpl } from '../type'; import Body from './Body'; import Title from './Title'; diff --git a/src/features/Portal/Notebook/DocumentItem.tsx b/src/features/Portal/Notebook/DocumentItem.tsx index 2f3258baa4..2f7b6258a0 100644 --- a/src/features/Portal/Notebook/DocumentItem.tsx +++ b/src/features/Portal/Notebook/DocumentItem.tsx @@ -1,10 +1,10 @@ -import type {NotebookDocument} from '@lobechat/types'; +import { type NotebookDocument } from '@lobechat/types'; import { ActionIcon, Flexbox, Text } from '@lobehub/ui'; import { App } from 'antd'; import { createStaticStyles } from 'antd-style'; import { FileTextIcon, Trash2Icon } from 'lucide-react'; -import type {MouseEvent} from 'react'; -import { memo, useState } from 'react'; +import { type MouseEvent } from 'react'; +import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useChatStore } from '@/store/chat'; diff --git a/src/features/Portal/Notebook/index.ts b/src/features/Portal/Notebook/index.ts index 4530957358..2708d61bb1 100644 --- a/src/features/Portal/Notebook/index.ts +++ b/src/features/Portal/Notebook/index.ts @@ -1,4 +1,4 @@ -import type {PortalImpl} from '../type'; +import { type PortalImpl } from '../type'; import Body from './Body'; import Title from './Title'; diff --git a/src/features/Portal/Plugins/index.ts b/src/features/Portal/Plugins/index.ts index ca6c365726..5677a2292e 100644 --- a/src/features/Portal/Plugins/index.ts +++ b/src/features/Portal/Plugins/index.ts @@ -1,4 +1,4 @@ -import type {PortalImpl} from '../type'; +import { type PortalImpl } from '../type'; import Body from './Body'; import Title from './Title'; diff --git a/src/features/Portal/Thread/Chat/index.tsx b/src/features/Portal/Thread/Chat/index.tsx index 42b9b06a6d..9572fb49d9 100644 --- a/src/features/Portal/Thread/Chat/index.tsx +++ b/src/features/Portal/Thread/Chat/index.tsx @@ -3,20 +3,20 @@ import { Flexbox } from '@lobehub/ui'; import { memo, Suspense, useCallback, useMemo } from 'react'; -import type {ConversationContext, ConversationHooks} from '@/features/Conversation'; +import { type ConversationContext, type ConversationHooks } from '@/features/Conversation'; import { ChatInput, ChatList, ConversationProvider, conversationSelectors, MessageItem, - useConversationStore + useConversationStore, } from '@/features/Conversation'; import SkeletonList from '@/features/Conversation/components/SkeletonList'; import { useOperationState } from '@/hooks/useOperationState'; import { useChatStore } from '@/store/chat'; import { threadSelectors } from '@/store/chat/selectors'; -import type {MessageMapKeyInput} from '@/store/chat/utils/messageMapKey'; +import { type MessageMapKeyInput } from '@/store/chat/utils/messageMapKey'; import { messageMapKey } from '@/store/chat/utils/messageMapKey'; import ThreadDivider from './ThreadDivider'; diff --git a/src/features/Portal/Thread/Chat/useThreadActionsBarConfig.ts b/src/features/Portal/Thread/Chat/useThreadActionsBarConfig.ts index 444ab562e4..cf77126ca2 100644 --- a/src/features/Portal/Thread/Chat/useThreadActionsBarConfig.ts +++ b/src/features/Portal/Thread/Chat/useThreadActionsBarConfig.ts @@ -2,7 +2,7 @@ import { useMemo } from 'react'; -import type { ActionsBarConfig } from '@/features/Conversation'; +import { type ActionsBarConfig } from '@/features/Conversation'; /** * Hook to create thread-specific actionsBar configuration diff --git a/src/features/Portal/Thread/index.ts b/src/features/Portal/Thread/index.ts index 119e0ea8d3..a73682c75d 100644 --- a/src/features/Portal/Thread/index.ts +++ b/src/features/Portal/Thread/index.ts @@ -1,4 +1,4 @@ -import type {PortalImpl} from '../type'; +import { type PortalImpl } from '../type'; import Chat from './Chat'; import Header from './Header'; diff --git a/src/features/Portal/components/Header.tsx b/src/features/Portal/components/Header.tsx index 378e9b12e1..714fdb75ef 100644 --- a/src/features/Portal/components/Header.tsx +++ b/src/features/Portal/components/Header.tsx @@ -3,7 +3,7 @@ import { DESKTOP_HEADER_ICON_SIZE } from '@lobechat/const'; import { ActionIcon, Flexbox } from '@lobehub/ui'; import { ArrowLeft, PanelRightCloseIcon } from 'lucide-react'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import NavHeader from '@/features/NavHeader'; diff --git a/src/features/Portal/router.tsx b/src/features/Portal/router.tsx index 15af12afc2..d9dc96bc65 100644 --- a/src/features/Portal/router.tsx +++ b/src/features/Portal/router.tsx @@ -16,7 +16,7 @@ import { MessageDetail } from './MessageDetail'; import { Notebook } from './Notebook'; import { Plugins } from './Plugins'; import { Thread } from './Thread'; -import type {PortalImpl} from './type'; +import { type PortalImpl } from './type'; // View type to component mapping const VIEW_COMPONENTS: Record = { diff --git a/src/features/Portal/type.ts b/src/features/Portal/type.ts index af88b6f301..7751e5ac1a 100644 --- a/src/features/Portal/type.ts +++ b/src/features/Portal/type.ts @@ -1,4 +1,4 @@ -import type {FC, PropsWithChildren} from 'react'; +import { type FC, type PropsWithChildren } from 'react'; export interface PortalImpl { Body: FC; diff --git a/src/features/ProfileEditor/AgentTool.tsx b/src/features/ProfileEditor/AgentTool.tsx index 05f139839b..40761192bb 100644 --- a/src/features/ProfileEditor/AgentTool.tsx +++ b/src/features/ProfileEditor/AgentTool.tsx @@ -1,7 +1,7 @@ 'use client'; import { KLAVIS_SERVER_TYPES, LOBEHUB_SKILL_PROVIDERS } from '@lobechat/const'; -import type { ItemType } from '@lobehub/ui'; +import { type ItemType } from '@lobehub/ui'; import { Avatar, Button, Flexbox, Icon } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import isEqual from 'fast-deep-equal'; @@ -31,7 +31,7 @@ import { lobehubSkillStoreSelectors, pluginSelectors, } from '@/store/tool/selectors'; -import type { LobeToolMetaWithAvailability } from '@/store/tool/slices/builtin/selectors'; +import { type LobeToolMetaWithAvailability } from '@/store/tool/slices/builtin/selectors'; import PluginTag from './PluginTag'; import PopoverContent from './PopoverContent'; diff --git a/src/features/ProfileEditor/PluginTag.tsx b/src/features/ProfileEditor/PluginTag.tsx index 54b6d11ccb..816bae7a00 100644 --- a/src/features/ProfileEditor/PluginTag.tsx +++ b/src/features/ProfileEditor/PluginTag.tsx @@ -1,10 +1,7 @@ 'use client'; -import type {KlavisServerType, LobehubSkillProviderType} from '@lobechat/const'; -import { - KLAVIS_SERVER_TYPES, - LOBEHUB_SKILL_PROVIDERS -} from '@lobechat/const'; +import { type KlavisServerType, type LobehubSkillProviderType } from '@lobechat/const'; +import { KLAVIS_SERVER_TYPES, LOBEHUB_SKILL_PROVIDERS } from '@lobechat/const'; import { Avatar, Icon, Tag } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; import isEqual from 'fast-deep-equal'; @@ -23,7 +20,7 @@ import { lobehubSkillStoreSelectors, pluginSelectors, } from '@/store/tool/selectors'; -import type {LobeToolMetaWithAvailability} from '@/store/tool/slices/builtin/selectors'; +import { type LobeToolMetaWithAvailability } from '@/store/tool/slices/builtin/selectors'; /** * Klavis 服务器图标组件 diff --git a/src/features/ProfileEditor/PopoverContent.tsx b/src/features/ProfileEditor/PopoverContent.tsx index 4313a05cb5..58ef628254 100644 --- a/src/features/ProfileEditor/PopoverContent.tsx +++ b/src/features/ProfileEditor/PopoverContent.tsx @@ -1,5 +1,5 @@ -import type {ItemType} from '@lobehub/ui'; -import { Flexbox, Icon, Segmented } from '@lobehub/ui'; +import { type ItemType } from '@lobehub/ui'; +import { Flexbox, Icon, Segmented } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; import { ChevronRight, ExternalLink, Settings, Store } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/features/ProtocolUrlHandler/InstallPlugin/ConfigDisplay.tsx b/src/features/ProtocolUrlHandler/InstallPlugin/ConfigDisplay.tsx index 8fa1024af9..03b00c76ed 100644 --- a/src/features/ProtocolUrlHandler/InstallPlugin/ConfigDisplay.tsx +++ b/src/features/ProtocolUrlHandler/InstallPlugin/ConfigDisplay.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {McpInstallSchema} from '@lobechat/electron-client-ipc'; +import { type McpInstallSchema } from '@lobechat/electron-client-ipc'; import { Block, Flexbox, Text } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { LinkIcon, Settings2Icon } from 'lucide-react'; diff --git a/src/features/ProtocolUrlHandler/InstallPlugin/CustomPluginInstallModal.tsx b/src/features/ProtocolUrlHandler/InstallPlugin/CustomPluginInstallModal.tsx index fb7689a265..ef0759e071 100644 --- a/src/features/ProtocolUrlHandler/InstallPlugin/CustomPluginInstallModal.tsx +++ b/src/features/ProtocolUrlHandler/InstallPlugin/CustomPluginInstallModal.tsx @@ -10,12 +10,12 @@ import PluginTag from '@/components/Plugins/PluginTag'; import { useAgentStore } from '@/store/agent'; import { useToolStore } from '@/store/tool'; import { mcpStoreSelectors } from '@/store/tool/selectors'; -import type {McpConnectionParams} from '@/types/plugins'; -import type {LobeToolCustomPlugin} from '@/types/tool/plugin'; +import { type McpConnectionParams } from '@/types/plugins'; +import { type LobeToolCustomPlugin } from '@/types/tool/plugin'; import ConfigDisplay from './ConfigDisplay'; -import type {McpInstallRequest, TrustedMarketplaceId} from './types'; -import { TRUSTED_MARKETPLACES } from './types'; +import { type McpInstallRequest, type TrustedMarketplaceId } from './types'; +import { TRUSTED_MARKETPLACES } from './types'; interface CustomPluginInstallModalProps { installRequest: McpInstallRequest | null; diff --git a/src/features/ProtocolUrlHandler/InstallPlugin/OfficialPluginInstallModal/Detail.tsx b/src/features/ProtocolUrlHandler/InstallPlugin/OfficialPluginInstallModal/Detail.tsx index f50666940c..50cd2f5b39 100644 --- a/src/features/ProtocolUrlHandler/InstallPlugin/OfficialPluginInstallModal/Detail.tsx +++ b/src/features/ProtocolUrlHandler/InstallPlugin/OfficialPluginInstallModal/Detail.tsx @@ -5,10 +5,8 @@ import { memo, useState } from 'react'; import MCPInstallProgress from '@/features/MCP/MCPInstallProgress'; import Deployment from '@/features/MCPPluginDetail/Deployment'; -import type {DetailContextConfig} from '@/features/MCPPluginDetail/DetailProvider'; -import { - DetailProvider -} from '@/features/MCPPluginDetail/DetailProvider'; +import { type DetailContextConfig } from '@/features/MCPPluginDetail/DetailProvider'; +import { DetailProvider } from '@/features/MCPPluginDetail/DetailProvider'; import Header from '@/features/MCPPluginDetail/Header'; import Nav from '@/features/MCPPluginDetail/Nav'; import Overview from '@/features/MCPPluginDetail/Overview'; diff --git a/src/features/ProtocolUrlHandler/InstallPlugin/OfficialPluginInstallModal/index.tsx b/src/features/ProtocolUrlHandler/InstallPlugin/OfficialPluginInstallModal/index.tsx index 3222d7208d..14cf8476e6 100644 --- a/src/features/ProtocolUrlHandler/InstallPlugin/OfficialPluginInstallModal/index.tsx +++ b/src/features/ProtocolUrlHandler/InstallPlugin/OfficialPluginInstallModal/index.tsx @@ -11,7 +11,7 @@ import { useDiscoverStore } from '@/store/discover'; import { useToolStore } from '@/store/tool'; import { pluginSelectors } from '@/store/tool/slices/plugin/selectors'; -import type {McpInstallRequest} from '../types'; +import { type McpInstallRequest } from '../types'; import OfficialDetail from './Detail'; interface OfficialPluginInstallModalProps { diff --git a/src/features/ProtocolUrlHandler/InstallPlugin/index.tsx b/src/features/ProtocolUrlHandler/InstallPlugin/index.tsx index 84a0370c62..d56bf33507 100644 --- a/src/features/ProtocolUrlHandler/InstallPlugin/index.tsx +++ b/src/features/ProtocolUrlHandler/InstallPlugin/index.tsx @@ -4,8 +4,8 @@ import { memo } from 'react'; import CustomPluginInstallModal from './CustomPluginInstallModal'; import OfficialPluginInstallModal from './OfficialPluginInstallModal'; -import type {McpInstallRequest} from './types'; -import { PluginSource } from './types'; +import { type McpInstallRequest } from './types'; +import { PluginSource } from './types'; interface PluginInstallConfirmModalProps { installRequest: McpInstallRequest | null; diff --git a/src/features/ProtocolUrlHandler/InstallPlugin/types.ts b/src/features/ProtocolUrlHandler/InstallPlugin/types.ts index d9cc82b748..737d9df4a3 100644 --- a/src/features/ProtocolUrlHandler/InstallPlugin/types.ts +++ b/src/features/ProtocolUrlHandler/InstallPlugin/types.ts @@ -1,4 +1,4 @@ -import type {McpInstallSchema} from '@lobechat/electron-client-ipc'; +import { type McpInstallSchema } from '@lobechat/electron-client-ipc'; export enum PluginSource { CUSTOM = 'custom', diff --git a/src/features/ProtocolUrlHandler/index.tsx b/src/features/ProtocolUrlHandler/index.tsx index 607b6fce71..4fbf91c33a 100644 --- a/src/features/ProtocolUrlHandler/index.tsx +++ b/src/features/ProtocolUrlHandler/index.tsx @@ -3,7 +3,7 @@ import { useWatchBroadcast } from '@lobechat/electron-client-ipc'; import { useCallback, useState } from 'react'; -import type {McpInstallRequest} from '@/features/ProtocolUrlHandler/InstallPlugin/types'; +import { type McpInstallRequest } from '@/features/ProtocolUrlHandler/InstallPlugin/types'; import PluginInstallConfirmModal from './InstallPlugin'; diff --git a/src/features/ResourceManager/components/ChunkDrawer/ChunkList/ChunkItem.tsx b/src/features/ResourceManager/components/ChunkDrawer/ChunkList/ChunkItem.tsx index 775450dce0..5c7ffe8e6a 100644 --- a/src/features/ResourceManager/components/ChunkDrawer/ChunkList/ChunkItem.tsx +++ b/src/features/ResourceManager/components/ChunkDrawer/ChunkList/ChunkItem.tsx @@ -3,7 +3,7 @@ import { createStaticStyles, cx } from 'antd-style'; import { memo, useMemo } from 'react'; import { useFileStore } from '@/store/file'; -import type {FileChunk} from '@/types/chunk'; +import { type FileChunk } from '@/types/chunk'; const styles = createStaticStyles(({ css, cssVar }) => ({ container: css` diff --git a/src/features/ResourceManager/components/ChunkDrawer/SimilaritySearchList/Item.tsx b/src/features/ResourceManager/components/ChunkDrawer/SimilaritySearchList/Item.tsx index d7d3d03eaf..cb2f22dfd8 100644 --- a/src/features/ResourceManager/components/ChunkDrawer/SimilaritySearchList/Item.tsx +++ b/src/features/ResourceManager/components/ChunkDrawer/SimilaritySearchList/Item.tsx @@ -2,7 +2,7 @@ import { Flexbox, Tag } from '@lobehub/ui'; import { createStaticStyles, cx } from 'antd-style'; import { memo, useMemo } from 'react'; -import type {SemanticSearchChunk} from '@/types/chunk'; +import { type SemanticSearchChunk } from '@/types/chunk'; const styles = createStaticStyles(({ css, cssVar }) => ({ container: css` diff --git a/src/features/ResourceManager/components/Editor/FileCopilot.tsx b/src/features/ResourceManager/components/Editor/FileCopilot.tsx index 8d336d76d6..e4ffe3dbac 100644 --- a/src/features/ResourceManager/components/Editor/FileCopilot.tsx +++ b/src/features/ResourceManager/components/Editor/FileCopilot.tsx @@ -4,7 +4,7 @@ import { Flexbox } from '@lobehub/ui'; import { memo, useEffect } from 'react'; import DragUploadZone, { useUploadFiles } from '@/components/DragUploadZone'; -import type { ActionKeys } from '@/features/ChatInput'; +import { type ActionKeys } from '@/features/ChatInput'; import { ChatInput, ChatList } from '@/features/Conversation'; import RightPanel from '@/features/RightPanel'; import { useAgentStore } from '@/store/agent'; diff --git a/src/features/ResourceManager/components/Explorer/ItemDropdown/DropdownMenu.tsx b/src/features/ResourceManager/components/Explorer/ItemDropdown/DropdownMenu.tsx index 692bc5d771..9da0a7623a 100644 --- a/src/features/ResourceManager/components/Explorer/ItemDropdown/DropdownMenu.tsx +++ b/src/features/ResourceManager/components/Explorer/ItemDropdown/DropdownMenu.tsx @@ -1,5 +1,5 @@ import { ActionIcon, DropdownMenu as DropdownMenuUI } from '@lobehub/ui'; -import type {ItemType} from 'antd/es/menu/interface'; +import { type ItemType } from 'antd/es/menu/interface'; import { MoreHorizontalIcon } from 'lucide-react'; import { memo } from 'react'; diff --git a/src/features/ResourceManager/components/Explorer/ItemDropdown/useFileItemDropdown.tsx b/src/features/ResourceManager/components/Explorer/ItemDropdown/useFileItemDropdown.tsx index 9dd797fd52..b58dd664db 100644 --- a/src/features/ResourceManager/components/Explorer/ItemDropdown/useFileItemDropdown.tsx +++ b/src/features/ResourceManager/components/Explorer/ItemDropdown/useFileItemDropdown.tsx @@ -1,6 +1,6 @@ -import { copyToClipboard, createRawModal,Icon } from '@lobehub/ui'; +import { copyToClipboard, createRawModal, Icon } from '@lobehub/ui'; import { App } from 'antd'; -import type {ItemType} from 'antd/es/menu/interface'; +import { type ItemType } from 'antd/es/menu/interface'; import { BookMinusIcon, BookPlusIcon, diff --git a/src/features/ResourceManager/components/Explorer/ListView/ListItem/ChunkTag.tsx b/src/features/ResourceManager/components/Explorer/ListView/ListItem/ChunkTag.tsx index 47f2f701fa..637982ed39 100644 --- a/src/features/ResourceManager/components/Explorer/ListView/ListItem/ChunkTag.tsx +++ b/src/features/ResourceManager/components/Explorer/ListView/ListItem/ChunkTag.tsx @@ -2,7 +2,7 @@ import { memo } from 'react'; import FileParsingStatusTag from '@/components/FileParsingStatus'; import { fileManagerSelectors, useFileStore } from '@/store/file'; -import type {FileParsingTask} from '@/types/asyncTask'; +import { type FileParsingTask } from '@/types/asyncTask'; interface ChunkTagProps extends FileParsingTask { id: string; diff --git a/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx b/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx index 806adaabec..8f6c678ee2 100644 --- a/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx +++ b/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx @@ -5,8 +5,8 @@ import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; import { isNull } from 'es-toolkit/compat'; import { FileBoxIcon, FileText, FolderIcon } from 'lucide-react'; -import type {DragEvent} from 'react'; -import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { type DragEvent } from 'react'; +import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { shallow } from 'zustand/shallow'; @@ -20,7 +20,7 @@ import FileIcon from '@/components/FileIcon'; import { clearTreeFolderCache } from '@/features/ResourceManager/components/LibraryHierarchy'; import { PAGE_FILE_TYPE } from '@/features/ResourceManager/constants'; import { fileManagerSelectors, useFileStore } from '@/store/file'; -import type {FileListItem as FileListItemType} from '@/types/files'; +import { type FileListItem as FileListItemType } from '@/types/files'; import { formatSize } from '@/utils/format'; import { isChunkingUnsupported } from '@/utils/isChunkingUnsupported'; @@ -206,7 +206,8 @@ const FileListItem = memo( emoji: sourceType === 'document' || fileType === PAGE_FILE_TYPE ? metadata?.emoji : null, isFolder: fileType === 'custom/folder', // PDF and Office files should not be treated as pages, even if they have sourceType='document' - isPage: !isPDF && !isOfficeFile && (sourceType === 'document' || fileType === PAGE_FILE_TYPE), + isPage: + !isPDF && !isOfficeFile && (sourceType === 'document' || fileType === PAGE_FILE_TYPE), isSupportedForChunking: !isChunkingUnsupported(fileType), }; }, [fileType, sourceType, metadata?.emoji, name]); diff --git a/src/features/ResourceManager/components/Explorer/ListView/index.tsx b/src/features/ResourceManager/components/Explorer/ListView/index.tsx index f67022f02b..5a534d21d8 100644 --- a/src/features/ResourceManager/components/Explorer/ListView/index.tsx +++ b/src/features/ResourceManager/components/Explorer/ListView/index.tsx @@ -3,11 +3,11 @@ import { Center, Checkbox, Flexbox } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import debug from 'debug'; -import type {DragEvent} from 'react'; -import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { type DragEvent } from 'react'; +import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import type {VirtuosoHandle} from 'react-virtuoso'; -import { Virtuoso } from 'react-virtuoso'; +import { type VirtuosoHandle } from 'react-virtuoso'; +import { Virtuoso } from 'react-virtuoso'; import { useDragActive } from '@/app/[variants]/(main)/resource/features/DndContextWrapper'; import { useFolderPath } from '@/app/[variants]/(main)/resource/features/hooks/useFolderPath'; @@ -20,8 +20,8 @@ import { useFileStore } from '@/store/file'; import { useFetchResources } from '@/store/file/slices/resource/hooks'; import { useGlobalStore } from '@/store/global'; import { INITIAL_STATUS } from '@/store/global/initialState'; -import type {AsyncTaskStatus} from '@/types/asyncTask'; -import type {FileListItem as FileListItemType} from '@/types/files'; +import { type AsyncTaskStatus } from '@/types/asyncTask'; +import { type FileListItem as FileListItemType } from '@/types/files'; import ColumnResizeHandle from './ColumnResizeHandle'; import FileListItem from './ListItem'; @@ -332,8 +332,7 @@ const ListView = memo(function ListView() { // Leave some padding at the end when there are no more pages, // so users can clearly feel they've reached the end of the list. - if (hasMore === false && dataLength > 0) - return
; + if (hasMore === false && dataLength > 0) return
; return null; }, [columnWidths, dataLength, hasMore, isLoadingMore]); diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/DefaultFileItem.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/DefaultFileItem.tsx index 7505b8c425..3130d15804 100644 --- a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/DefaultFileItem.tsx +++ b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/DefaultFileItem.tsx @@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next'; import FileIcon from '@/components/FileIcon'; import { fileManagerSelectors, useFileStore } from '@/store/file'; -import type {AsyncTaskStatus, IAsyncTaskError} from '@/types/asyncTask'; +import { type AsyncTaskStatus, type IAsyncTaskError } from '@/types/asyncTask'; import { formatSize } from '@/utils/format'; import { isChunkingUnsupported } from '@/utils/isChunkingUnsupported'; diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/ImageFileItem.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/ImageFileItem.tsx index 477b60e0eb..a3b8f859b6 100644 --- a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/ImageFileItem.tsx +++ b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/ImageFileItem.tsx @@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next'; import FileIcon from '@/components/FileIcon'; import { fileManagerSelectors, useFileStore } from '@/store/file'; -import type {AsyncTaskStatus, IAsyncTaskError} from '@/types/asyncTask'; +import { type AsyncTaskStatus, type IAsyncTaskError } from '@/types/asyncTask'; import { formatSize } from '@/utils/format'; import { isChunkingUnsupported } from '@/utils/isChunkingUnsupported'; diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MarkdownFileItem.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MarkdownFileItem.tsx index 53b8f61179..98c8ca927e 100644 --- a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MarkdownFileItem.tsx +++ b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MarkdownFileItem.tsx @@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next'; import FileIcon from '@/components/FileIcon'; import { fileManagerSelectors, useFileStore } from '@/store/file'; -import type {AsyncTaskStatus, IAsyncTaskError} from '@/types/asyncTask'; +import { type AsyncTaskStatus, type IAsyncTaskError } from '@/types/asyncTask'; import { formatSize } from '@/utils/format'; import { isChunkingUnsupported } from '@/utils/isChunkingUnsupported'; diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MasonryItemWrapper.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MasonryItemWrapper.tsx index 87f54ec8a3..050cb406cc 100644 --- a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MasonryItemWrapper.tsx +++ b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MasonryItemWrapper.tsx @@ -1,6 +1,6 @@ import { memo } from 'react'; -import type {FileListItem} from '@/types/files'; +import { type FileListItem } from '@/types/files'; import MasonryFileItem from '.'; diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/NoteFileItem.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/NoteFileItem.tsx index 98cedb8032..907831362b 100644 --- a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/NoteFileItem.tsx +++ b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/NoteFileItem.tsx @@ -6,7 +6,7 @@ import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { fileManagerSelectors, useFileStore } from '@/store/file'; -import type {AsyncTaskStatus, IAsyncTaskError} from '@/types/asyncTask'; +import { type AsyncTaskStatus, type IAsyncTaskError } from '@/types/asyncTask'; import { isChunkingUnsupported } from '@/utils/isChunkingUnsupported'; import markdownToTxt from '@/utils/markdownToTxt'; diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/index.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/index.tsx index f6665b8580..cf56d7cb6c 100644 --- a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/index.tsx +++ b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/index.tsx @@ -8,7 +8,7 @@ import { useDragState, } from '@/app/[variants]/(main)/resource/features/DndContextWrapper'; import { documentService } from '@/services/document'; -import type {FileListItem} from '@/types/files'; +import { type FileListItem } from '@/types/files'; import { useFileItemClick } from '../../hooks/useFileItemClick'; import DropdownMenu from '../../ItemDropdown/DropdownMenu'; diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/index.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/index.tsx index e44acdd7b6..954d720dbc 100644 --- a/src/features/ResourceManager/components/Explorer/MasonryView/index.tsx +++ b/src/features/ResourceManager/components/Explorer/MasonryView/index.tsx @@ -3,15 +3,15 @@ import { Center } from '@lobehub/ui'; import { VirtuosoMasonry } from '@virtuoso.dev/masonry'; import { cssVar } from 'antd-style'; -import type {UIEvent} from 'react'; -import { memo, useCallback, useMemo, useState } from 'react'; +import { type UIEvent } from 'react'; +import { memo, useCallback, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useResourceManagerStore } from '@/app/[variants]/(main)/resource/features/store'; import { sortFileList } from '@/app/[variants]/(main)/resource/features/store/selectors'; import { useFileStore } from '@/store/file'; import { useFetchResources } from '@/store/file/slices/resource/hooks'; -import type {FileListItem} from '@/types/files'; +import { type FileListItem } from '@/types/files'; import { useMasonryColumnCount } from '../useMasonryColumnCount'; import MasonryItemWrapper from './MasonryItem/MasonryItemWrapper'; diff --git a/src/features/ResourceManager/components/Explorer/MoveToFolderModal.tsx b/src/features/ResourceManager/components/Explorer/MoveToFolderModal.tsx index 8a9b61841e..fd3fe2468c 100644 --- a/src/features/ResourceManager/components/Explorer/MoveToFolderModal.tsx +++ b/src/features/ResourceManager/components/Explorer/MoveToFolderModal.tsx @@ -4,7 +4,7 @@ import { FolderIcon } from 'lucide-react'; import { memo, useCallback, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import type {FolderTreeItem} from '@/features/ResourceManager/components/FolderTree'; +import { type FolderTreeItem } from '@/features/ResourceManager/components/FolderTree'; import FolderTree from '@/features/ResourceManager/components/FolderTree'; import { clearTreeFolderCache } from '@/features/ResourceManager/components/LibraryHierarchy'; import { fileService } from '@/services/file'; @@ -174,7 +174,6 @@ const MoveToFolderModal = memo( }); }, []); - const handleFolderClick = useCallback((folderId: string, _folderSlug?: string | null) => { // Always use the document ID, not the slug setSelectedFolderId(folderId); diff --git a/src/features/ResourceManager/components/Explorer/ToolBar/ActionIconWithChevron.tsx b/src/features/ResourceManager/components/Explorer/ToolBar/ActionIconWithChevron.tsx index 766607b32f..14acf35991 100644 --- a/src/features/ResourceManager/components/Explorer/ToolBar/ActionIconWithChevron.tsx +++ b/src/features/ResourceManager/components/Explorer/ToolBar/ActionIconWithChevron.tsx @@ -1,8 +1,8 @@ import { Button, Flexbox, Icon } from '@lobehub/ui'; import { cssVar } from 'antd-style'; -import type { LucideIcon } from 'lucide-react'; +import { type LucideIcon } from 'lucide-react'; import { ChevronDownIcon } from 'lucide-react'; -import type { ComponentProps } from 'react'; +import { type ComponentProps } from 'react'; import { memo } from 'react'; interface ActionIconWithChevronProps extends ComponentProps { diff --git a/src/features/ResourceManager/components/Explorer/ToolBar/BatchActionsDropdown.tsx b/src/features/ResourceManager/components/Explorer/ToolBar/BatchActionsDropdown.tsx index 6fb176fd1b..81e36954da 100644 --- a/src/features/ResourceManager/components/Explorer/ToolBar/BatchActionsDropdown.tsx +++ b/src/features/ResourceManager/components/Explorer/ToolBar/BatchActionsDropdown.tsx @@ -1,5 +1,5 @@ -import type {DropdownItem} from '@lobehub/ui'; -import { DropdownMenu, Icon } from '@lobehub/ui'; +import { type DropdownItem } from '@lobehub/ui'; +import { DropdownMenu, Icon } from '@lobehub/ui'; import { App } from 'antd'; import { BookMinusIcon, diff --git a/src/features/ResourceManager/components/Explorer/ToolBar/SortDropdown.tsx b/src/features/ResourceManager/components/Explorer/ToolBar/SortDropdown.tsx index ca3c3a8d3c..54a71a06e8 100644 --- a/src/features/ResourceManager/components/Explorer/ToolBar/SortDropdown.tsx +++ b/src/features/ResourceManager/components/Explorer/ToolBar/SortDropdown.tsx @@ -1,11 +1,11 @@ import { DropdownMenu, Icon } from '@lobehub/ui'; -import type {LucideIcon} from 'lucide-react'; -import { ArrowDownAZ, CalendarIcon, Check, HardDriveIcon } from 'lucide-react'; +import { type LucideIcon } from 'lucide-react'; +import { ArrowDownAZ, CalendarIcon, Check, HardDriveIcon } from 'lucide-react'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useResourceManagerStore } from '@/app/[variants]/(main)/resource/features/store'; -import type {MenuProps} from '@/components/Menu'; +import { type MenuProps } from '@/components/Menu'; import ActionIconWithChevron from './ActionIconWithChevron'; diff --git a/src/features/ResourceManager/components/Explorer/ToolBar/ViewSwitcher.tsx b/src/features/ResourceManager/components/Explorer/ToolBar/ViewSwitcher.tsx index dd3a2d1584..12666515e0 100644 --- a/src/features/ResourceManager/components/Explorer/ToolBar/ViewSwitcher.tsx +++ b/src/features/ResourceManager/components/Explorer/ToolBar/ViewSwitcher.tsx @@ -3,7 +3,7 @@ import { Check, Grid3x3Icon, ListIcon } from 'lucide-react'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -import type {MenuProps} from '@/components/Menu'; +import { type MenuProps } from '@/components/Menu'; import { useViewMode } from '../hooks/useViewMode'; import ActionIconWithChevron from './ActionIconWithChevron'; diff --git a/src/features/ResourceManager/components/Explorer/hooks/useFileSelection.ts b/src/features/ResourceManager/components/Explorer/hooks/useFileSelection.ts index e8bf106473..cd4e14c211 100644 --- a/src/features/ResourceManager/components/Explorer/hooks/useFileSelection.ts +++ b/src/features/ResourceManager/components/Explorer/hooks/useFileSelection.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect, useState } from 'react'; import { useResourceManagerStore } from '@/app/[variants]/(main)/resource/features/store'; -import type { FileListItem } from '@/types/files'; +import { type FileListItem } from '@/types/files'; /** * Hook to manage file selection with shift-click range selection support diff --git a/src/features/ResourceManager/components/Explorer/hooks/useViewMode.ts b/src/features/ResourceManager/components/Explorer/hooks/useViewMode.ts index 665e7904a1..09a9bc1216 100644 --- a/src/features/ResourceManager/components/Explorer/hooks/useViewMode.ts +++ b/src/features/ResourceManager/components/Explorer/hooks/useViewMode.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect } from 'react'; import { useResourceManagerStore } from '@/app/[variants]/(main)/resource/features/store'; -import type {ViewMode} from '@/app/[variants]/(main)/resource/features/store/initialState'; +import { type ViewMode } from '@/app/[variants]/(main)/resource/features/store/initialState'; import { parseAsStringEnum, useQueryState } from '@/hooks/useQueryParam'; /** diff --git a/src/features/ResourceManager/components/Explorer/useCheckTaskStatus.ts b/src/features/ResourceManager/components/Explorer/useCheckTaskStatus.ts index b83891f036..8b332b98ee 100644 --- a/src/features/ResourceManager/components/Explorer/useCheckTaskStatus.ts +++ b/src/features/ResourceManager/components/Explorer/useCheckTaskStatus.ts @@ -2,7 +2,7 @@ import { useEffect } from 'react'; import { revalidateResources } from '@/store/file/slices/resource/hooks'; import { AsyncTaskStatus } from '@/types/asyncTask'; -import type {FileListItem} from '@/types/files'; +import { type FileListItem } from '@/types/files'; export const useCheckTaskStatus = (data: FileListItem[] | undefined) => { const hasProcessingChunkTask = data?.some( diff --git a/src/features/ResourceManager/components/Explorer/useResourceExplorer.ts b/src/features/ResourceManager/components/Explorer/useResourceExplorer.ts index b400a27751..479237a40b 100644 --- a/src/features/ResourceManager/components/Explorer/useResourceExplorer.ts +++ b/src/features/ResourceManager/components/Explorer/useResourceExplorer.ts @@ -8,11 +8,11 @@ import { useResourceManagerFetchKnowledgeItems, useResourceManagerStore, } from '@/app/[variants]/(main)/resource/features/store'; -import type { MultiSelectActionType } from '@/app/[variants]/(main)/resource/features/store/action'; +import { type MultiSelectActionType } from '@/app/[variants]/(main)/resource/features/store/action'; import { selectors, sortFileList } from '@/app/[variants]/(main)/resource/features/store/selectors'; import { useAddFilesToKnowledgeBaseModal } from '@/features/LibraryModal'; import { fileManagerSelectors, useFileStore } from '@/store/file'; -import type {FilesTabs} from '@/types/files'; +import { type FilesTabs } from '@/types/files'; import { useFileSelection } from './hooks/useFileSelection'; import { useCheckTaskStatus } from './useCheckTaskStatus'; diff --git a/src/features/ResourceManager/components/Header/AddButton.tsx b/src/features/ResourceManager/components/Header/AddButton.tsx index 0a4773bd57..0fbad0a965 100644 --- a/src/features/ResourceManager/components/Header/AddButton.tsx +++ b/src/features/ResourceManager/components/Header/AddButton.tsx @@ -2,12 +2,12 @@ import { FILE_URL } from '@lobechat/business-const'; import { Notion } from '@lobehub/icons'; -import type {MenuProps} from '@lobehub/ui'; -import { Button, DropdownMenu, Icon } from '@lobehub/ui'; +import { type MenuProps } from '@lobehub/ui'; +import { Button, DropdownMenu, Icon } from '@lobehub/ui'; import { Upload } from 'antd'; import { FilePenLine, FileUp, FolderIcon, FolderUp, Link, Plus } from 'lucide-react'; -import type {ChangeEvent} from 'react'; -import { useCallback, useMemo, useState } from 'react'; +import { type ChangeEvent } from 'react'; +import { useCallback, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useResourceManagerStore } from '@/app/[variants]/(main)/resource/features/store'; @@ -89,7 +89,16 @@ const AddButton = () => { // Switch to page view mode with real ID setCurrentViewItemId(realId); setMode('page'); - }, [category, createResourceAndSync, currentFolderId, libraryId, setCategory, setCurrentViewItemId, setMode, t]); + }, [ + category, + createResourceAndSync, + currentFolderId, + libraryId, + setCategory, + setCurrentViewItemId, + setMode, + t, + ]); const handleCreateFolder = useCallback(async () => { // Navigate to "All" category first if not already there @@ -137,7 +146,15 @@ const AddButton = () => { message.error(t('header.actions.createFolderError')); console.error('Failed to create folder:', error); } - }, [category, createResourceAndSync, currentFolderId, libraryId, setCategory, setPendingRenameItemId, t]); + }, [ + category, + createResourceAndSync, + currentFolderId, + libraryId, + setCategory, + setPendingRenameItemId, + t, + ]); const { handleCloseNotionGuide, diff --git a/src/features/ResourceManager/components/Header/hooks/useNotionImport.ts b/src/features/ResourceManager/components/Header/hooks/useNotionImport.ts index 738841636f..d6436aff02 100644 --- a/src/features/ResourceManager/components/Header/hooks/useNotionImport.ts +++ b/src/features/ResourceManager/components/Header/hooks/useNotionImport.ts @@ -1,9 +1,9 @@ import debug from 'debug'; -import type { TFunction } from 'i18next'; -import type {ChangeEvent} from 'react'; -import { useCallback, useRef, useState } from 'react'; +import { type TFunction } from 'i18next'; +import { type ChangeEvent } from 'react'; +import { useCallback, useRef, useState } from 'react'; -import type { DocumentAction } from '@/store/file/slices/document/action'; +import { type DocumentAction } from '@/store/file/slices/document/action'; import { unzipFile } from '@/utils/unzipFile'; const log = debug('resource:notion-import'); diff --git a/src/features/ResourceManager/components/Header/hooks/useUploadFolder.ts b/src/features/ResourceManager/components/Header/hooks/useUploadFolder.ts index f1a0b40f74..96b0274d0a 100644 --- a/src/features/ResourceManager/components/Header/hooks/useUploadFolder.ts +++ b/src/features/ResourceManager/components/Header/hooks/useUploadFolder.ts @@ -1,8 +1,8 @@ -import type { TFunction } from 'i18next'; -import type {ChangeEvent} from 'react'; -import { useCallback } from 'react'; +import { type TFunction } from 'i18next'; +import { type ChangeEvent } from 'react'; +import { useCallback } from 'react'; -import type { FileManageAction } from '@/store/file/slices/fileManager/action'; +import { type FileManageAction } from '@/store/file/slices/fileManager/action'; import { filterFilesByBuiltInBlockList, filterFilesByGitignore, diff --git a/src/features/ResourceManager/components/LibraryHierarchy/HierarchyNode.tsx b/src/features/ResourceManager/components/LibraryHierarchy/HierarchyNode.tsx index 9b6d1015c4..b3c733c75b 100644 --- a/src/features/ResourceManager/components/LibraryHierarchy/HierarchyNode.tsx +++ b/src/features/ResourceManager/components/LibraryHierarchy/HierarchyNode.tsx @@ -23,7 +23,7 @@ import { useFileItemClick } from '../Explorer/hooks/useFileItemClick'; import { useFileItemDropdown } from '../Explorer/ItemDropdown/useFileItemDropdown'; import { styles } from './styles'; import { clearTreeFolderCache } from './treeState'; -import type { TreeItem } from './types'; +import { type TreeItem } from './types'; interface HierarchyNodeProps { expandedFolders: Set; diff --git a/src/features/ResourceManager/components/LibraryHierarchy/index.tsx b/src/features/ResourceManager/components/LibraryHierarchy/index.tsx index dbe0a851c0..08f822eb88 100644 --- a/src/features/ResourceManager/components/LibraryHierarchy/index.tsx +++ b/src/features/ResourceManager/components/LibraryHierarchy/index.tsx @@ -8,7 +8,7 @@ import { useFolderPath } from '@/app/[variants]/(main)/resource/features/hooks/u import { useResourceManagerStore } from '@/app/[variants]/(main)/resource/features/store'; import { fileService } from '@/services/file'; import { useFileStore } from '@/store/file'; -import type { ResourceQueryParams } from '@/types/resource'; +import { type ResourceQueryParams } from '@/types/resource'; import { HierarchyNode } from './HierarchyNode'; import TreeSkeleton from './TreeSkeleton'; @@ -18,7 +18,7 @@ import { sortTreeItems, TREE_REFRESH_EVENT, } from './treeState'; -import type { TreeItem } from './types'; +import { type TreeItem } from './types'; // Export for external use export { clearTreeFolderCache } from './treeState'; diff --git a/src/features/ResourceManager/components/LibraryHierarchy/treeState.ts b/src/features/ResourceManager/components/LibraryHierarchy/treeState.ts index 5ac2553fd7..fb5128cfad 100644 --- a/src/features/ResourceManager/components/LibraryHierarchy/treeState.ts +++ b/src/features/ResourceManager/components/LibraryHierarchy/treeState.ts @@ -1,8 +1,8 @@ import { fileService } from '@/services/file'; import { useFileStore } from '@/store/file'; -import type { ResourceItem } from '@/types/resource'; +import { type ResourceItem } from '@/types/resource'; -import type { TreeItem } from './types'; +import { type TreeItem } from './types'; export const sortTreeItems = (items: T[]): T[] => { return [...items].sort((a, b) => { diff --git a/src/features/ResourceManager/components/UploadDock/Item.tsx b/src/features/ResourceManager/components/UploadDock/Item.tsx index e8dd678818..dc01135713 100644 --- a/src/features/ResourceManager/components/UploadDock/Item.tsx +++ b/src/features/ResourceManager/components/UploadDock/Item.tsx @@ -1,13 +1,13 @@ import { ActionIcon, Flexbox, Text } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { XIcon } from 'lucide-react'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import FileIcon from '@/components/FileIcon'; import { useFileStore } from '@/store/file'; -import type { UploadFileItem } from '@/types/files/upload'; +import { type UploadFileItem } from '@/types/files/upload'; import { formatSize, formatSpeed, formatTime } from '@/utils/format'; const styles = createStaticStyles(({ css, cssVar }) => { diff --git a/src/features/RightPanel/ToggleRightPanelButton.tsx b/src/features/RightPanel/ToggleRightPanelButton.tsx index f1cca98a3d..b5de49559a 100644 --- a/src/features/RightPanel/ToggleRightPanelButton.tsx +++ b/src/features/RightPanel/ToggleRightPanelButton.tsx @@ -1,9 +1,9 @@ 'use client'; -import type {ActionIconProps} from '@lobehub/ui'; -import { ActionIcon } from '@lobehub/ui'; +import { type ActionIconProps } from '@lobehub/ui'; +import { ActionIcon } from '@lobehub/ui'; import { PanelRightClose, PanelRightOpen } from 'lucide-react'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/RightPanel/index.tsx b/src/features/RightPanel/index.tsx index 5354e8a0a5..d4defb34f4 100644 --- a/src/features/RightPanel/index.tsx +++ b/src/features/RightPanel/index.tsx @@ -1,5 +1,5 @@ -import type {DraggablePanelProps} from '@lobehub/ui'; -import { DraggablePanel } from '@lobehub/ui'; +import { type DraggablePanelProps } from '@lobehub/ui'; +import { DraggablePanel } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { memo, Suspense, useState } from 'react'; diff --git a/src/features/Setting/Footer.tsx b/src/features/Setting/Footer.tsx index 3b3204d9a8..407fe37111 100644 --- a/src/features/Setting/Footer.tsx +++ b/src/features/Setting/Footer.tsx @@ -4,8 +4,8 @@ import { BRANDING_NAME } from '@lobechat/business-const'; import { Center, Flexbox, Icon } from '@lobehub/ui'; import { createStaticStyles } from 'antd-style'; import { MessageSquareHeart } from 'lucide-react'; -import type {PropsWithChildren} from 'react'; -import { memo, useState } from 'react'; +import { type PropsWithChildren } from 'react'; +import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import GuideModal from '@/components/GuideModal'; diff --git a/src/features/Setting/SettingContainer.tsx b/src/features/Setting/SettingContainer.tsx index 7bba0603e1..adb2b52106 100644 --- a/src/features/Setting/SettingContainer.tsx +++ b/src/features/Setting/SettingContainer.tsx @@ -1,10 +1,10 @@ 'use client'; -import type {FlexboxProps} from '@lobehub/ui'; -import { Flexbox } from '@lobehub/ui'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Flexbox } from '@lobehub/ui'; import { cssVar, useTheme } from 'antd-style'; -import type {PropsWithChildren, ReactNode} from 'react'; -import { memo } from 'react'; +import { type PropsWithChildren, type ReactNode } from 'react'; +import { memo } from 'react'; interface SettingContainerProps extends FlexboxProps { addonAfter?: ReactNode; diff --git a/src/features/ShareModal/ShareImage/Preview.tsx b/src/features/ShareModal/ShareImage/Preview.tsx index b04f81a7a4..8c27f06983 100644 --- a/src/features/ShareModal/ShareImage/Preview.tsx +++ b/src/features/ShareModal/ShareImage/Preview.tsx @@ -12,7 +12,7 @@ import pkg from '../../../../package.json'; import { containerStyles } from '../style'; import ChatList from './ChatList'; import { styles } from './style'; -import type {FieldType} from './type'; +import { type FieldType } from './type'; import { WidthMode } from './type'; const Preview = memo( diff --git a/src/features/ShareModal/ShareImage/index.tsx b/src/features/ShareModal/ShareImage/index.tsx index 4d5235df3a..563568d8c6 100644 --- a/src/features/ShareModal/ShareImage/index.tsx +++ b/src/features/ShareModal/ShareImage/index.tsx @@ -1,5 +1,5 @@ -import type {FormItemProps} from '@lobehub/ui'; -import { Button, Flexbox,Form, Segmented } from '@lobehub/ui'; +import { type FormItemProps } from '@lobehub/ui'; +import { Button, Flexbox, Form, Segmented } from '@lobehub/ui'; import { Switch } from 'antd'; import { CopyIcon } from 'lucide-react'; import { memo, useState } from 'react'; @@ -14,8 +14,8 @@ import { agentSelectors } from '@/store/agent/selectors'; import { styles } from '../style'; import Preview from './Preview'; -import type {FieldType} from './type'; -import { WidthMode } from './type'; +import { type FieldType } from './type'; +import { WidthMode } from './type'; const DEFAULT_FIELD_VALUE: FieldType = { imageType: ImageType.JPG, diff --git a/src/features/ShareModal/ShareImage/type.ts b/src/features/ShareModal/ShareImage/type.ts index ec7c1b0802..64f3257d6d 100644 --- a/src/features/ShareModal/ShareImage/type.ts +++ b/src/features/ShareModal/ShareImage/type.ts @@ -1,8 +1,8 @@ -import type {ImageType} from '@/hooks/useScreenshot'; +import { type ImageType } from '@/hooks/useScreenshot'; export enum WidthMode { Narrow = 'narrow', - Wide = 'wide' + Wide = 'wide', } export type FieldType = { diff --git a/src/features/ShareModal/ShareJSON/generateFullExport.test.ts b/src/features/ShareModal/ShareJSON/generateFullExport.test.ts index 6874b878d6..5eb016db44 100644 --- a/src/features/ShareModal/ShareJSON/generateFullExport.test.ts +++ b/src/features/ShareModal/ShareJSON/generateFullExport.test.ts @@ -1,4 +1,4 @@ -import type { ChatTopic, UIChatMessage } from '@lobechat/types'; +import { type ChatTopic, type UIChatMessage } from '@lobechat/types'; import { describe, expect, it, vi } from 'vitest'; import { LOADING_FLAT } from '@/const/message'; diff --git a/src/features/ShareModal/ShareJSON/generateFullExport.ts b/src/features/ShareModal/ShareJSON/generateFullExport.ts index f1b0bbd483..e10c2d8f36 100644 --- a/src/features/ShareModal/ShareJSON/generateFullExport.ts +++ b/src/features/ShareModal/ShareJSON/generateFullExport.ts @@ -1,9 +1,9 @@ -import type {ChatTopic, ExportedTopic, UIChatMessage} from '@lobechat/types'; +import { type ChatTopic, type ExportedTopic, type UIChatMessage } from '@lobechat/types'; import { cleanObject } from '@lobechat/utils'; import { LOADING_FLAT } from '@/const/message'; -import type {BaseExportOptions} from './type'; +import { type BaseExportOptions } from './type'; interface FullExportParams extends BaseExportOptions { messages: UIChatMessage[]; diff --git a/src/features/ShareModal/ShareJSON/generateMessages.test.ts b/src/features/ShareModal/ShareJSON/generateMessages.test.ts index a949a1d88e..5ac1233bac 100644 --- a/src/features/ShareModal/ShareJSON/generateMessages.test.ts +++ b/src/features/ShareModal/ShareJSON/generateMessages.test.ts @@ -1,4 +1,4 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { describe, expect, it } from 'vitest'; import { LOADING_FLAT } from '@/const/message'; diff --git a/src/features/ShareModal/ShareJSON/generateMessages.ts b/src/features/ShareModal/ShareJSON/generateMessages.ts index 299dc44243..78d08322b4 100644 --- a/src/features/ShareModal/ShareJSON/generateMessages.ts +++ b/src/features/ShareModal/ShareJSON/generateMessages.ts @@ -1,8 +1,8 @@ -import type {UIChatMessage} from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { LOADING_FLAT } from '@/const/message'; -import type {BaseExportOptions} from './type'; +import { type BaseExportOptions } from './type'; interface JSONParams extends BaseExportOptions { messages: UIChatMessage[]; diff --git a/src/features/ShareModal/ShareJSON/index.tsx b/src/features/ShareModal/ShareJSON/index.tsx index aa3daeec6d..1aa4581807 100644 --- a/src/features/ShareModal/ShareJSON/index.tsx +++ b/src/features/ShareModal/ShareJSON/index.tsx @@ -1,8 +1,8 @@ import { FORM_STYLE } from '@lobechat/const'; -import type {TopicExportMode} from '@lobechat/types'; +import { type TopicExportMode } from '@lobechat/types'; import { exportFile } from '@lobechat/utils/client'; -import type {FormItemProps} from '@lobehub/ui'; -import { Button, copyToClipboard,Flexbox,Form } from '@lobehub/ui'; +import { type FormItemProps } from '@lobehub/ui'; +import { Button, copyToClipboard, Flexbox, Form } from '@lobehub/ui'; import { App, Segmented, Switch } from 'antd'; import isEqual from 'fast-deep-equal'; import { CopyIcon } from 'lucide-react'; @@ -19,7 +19,7 @@ import { styles } from '../style'; import { generateFullExport } from './generateFullExport'; import { generateMessages } from './generateMessages'; import Preview from './Preview'; -import type {FieldType} from './type'; +import { type FieldType } from './type'; const DEFAULT_FIELD_VALUE: FieldType = { exportMode: 'full', diff --git a/src/features/ShareModal/ShareJSON/type.ts b/src/features/ShareModal/ShareJSON/type.ts index 1960cfca49..1b691ccc6b 100644 --- a/src/features/ShareModal/ShareJSON/type.ts +++ b/src/features/ShareModal/ShareJSON/type.ts @@ -1,4 +1,4 @@ -import type {TopicExportMode} from '@lobechat/types'; +import { type TopicExportMode } from '@lobechat/types'; export interface BaseExportOptions { includeTool: boolean; diff --git a/src/features/ShareModal/SharePdf/index.tsx b/src/features/ShareModal/SharePdf/index.tsx index 03d78c211f..5a2f2433f8 100644 --- a/src/features/ShareModal/SharePdf/index.tsx +++ b/src/features/ShareModal/SharePdf/index.tsx @@ -1,6 +1,6 @@ -import type {UIChatMessage} from '@lobechat/types'; -import type {FormItemProps} from '@lobehub/ui'; -import { Button, Flexbox,Form } from '@lobehub/ui'; +import { type UIChatMessage } from '@lobechat/types'; +import { type FormItemProps } from '@lobehub/ui'; +import { Button, Flexbox, Form } from '@lobehub/ui'; import { App, Switch } from 'antd'; import { cx } from 'antd-style'; import isEqual from 'fast-deep-equal'; @@ -16,7 +16,7 @@ import { useChatStore } from '@/store/chat'; import { chatSelectors, topicSelectors } from '@/store/chat/selectors'; import { generateMarkdown } from '../ShareText/template'; -import type {FieldType} from '../ShareText/type'; +import { type FieldType } from '../ShareText/type'; import { containerStyles, styles } from '../style'; import PdfPreview from './PdfPreview'; import { usePdfGeneration } from './usePdfGeneration'; diff --git a/src/features/ShareModal/ShareText/index.tsx b/src/features/ShareModal/ShareText/index.tsx index ca5bb44cbb..7318a5d436 100644 --- a/src/features/ShareModal/ShareText/index.tsx +++ b/src/features/ShareModal/ShareText/index.tsx @@ -1,7 +1,7 @@ import { FORM_STYLE } from '@lobechat/const'; import { exportFile } from '@lobechat/utils/client'; -import type {FormItemProps} from '@lobehub/ui'; -import { Button, copyToClipboard,Flexbox,Form } from '@lobehub/ui'; +import { type FormItemProps } from '@lobehub/ui'; +import { Button, copyToClipboard, Flexbox, Form } from '@lobehub/ui'; import { App, Switch } from 'antd'; import isEqual from 'fast-deep-equal'; import { CopyIcon } from 'lucide-react'; @@ -17,7 +17,7 @@ import { displayMessageSelectors, topicSelectors } from '@/store/chat/selectors' import { styles } from '../style'; import Preview from './Preview'; import { generateMarkdown } from './template'; -import type {FieldType} from './type'; +import { type FieldType } from './type'; const DEFAULT_FIELD_VALUE: FieldType = { includeTool: true, diff --git a/src/features/ShareModal/ShareText/template.test.ts b/src/features/ShareModal/ShareText/template.test.ts index 67dc7e86ed..19e20baafd 100644 --- a/src/features/ShareModal/ShareText/template.test.ts +++ b/src/features/ShareModal/ShareText/template.test.ts @@ -1,4 +1,4 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { describe, expect, it } from 'vitest'; import { LOADING_FLAT } from '@/const/message'; diff --git a/src/features/ShareModal/ShareText/template.ts b/src/features/ShareModal/ShareText/template.ts index f93e9f2912..fc22820340 100644 --- a/src/features/ShareModal/ShareText/template.ts +++ b/src/features/ShareModal/ShareText/template.ts @@ -1,8 +1,8 @@ -import type {UIChatMessage} from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { template } from 'es-toolkit/compat'; import { LOADING_FLAT } from '@/const/message'; -import type {FieldType} from '@/features/ShareModal/ShareText/type'; +import { type FieldType } from '@/features/ShareModal/ShareText/type'; const markdownTemplate = template( `# {{title}} @@ -48,7 +48,7 @@ const markdownTemplate = template( `, { evaluate: /<%([\s\S]+?)%>/g, - interpolate: /\{{([\s\S]+?)\}}/g, + interpolate: /\{\{([\s\S]+?)\}\}/g, }, ); diff --git a/src/features/ShareModal/index.tsx b/src/features/ShareModal/index.tsx index 51bed58f92..e22aa3d6b0 100644 --- a/src/features/ShareModal/index.tsx +++ b/src/features/ShareModal/index.tsx @@ -1,5 +1,5 @@ -import type {ModalProps} from '@lobehub/ui'; -import { Flexbox,Modal, Segmented } from '@lobehub/ui'; +import { type ModalProps } from '@lobehub/ui'; +import { Flexbox, Modal, Segmented } from '@lobehub/ui'; import { memo, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/SharePopover/index.tsx b/src/features/SharePopover/index.tsx index 105b2869bf..25a770813b 100644 --- a/src/features/SharePopover/index.tsx +++ b/src/features/SharePopover/index.tsx @@ -13,8 +13,8 @@ import { } from '@lobehub/ui'; import { App, Divider } from 'antd'; import { ExternalLinkIcon, LinkIcon, LockIcon } from 'lucide-react'; -import type {ReactNode} from 'react'; -import { memo, useCallback, useEffect, useRef, useState } from 'react'; +import { type ReactNode } from 'react'; +import { memo, useCallback, useEffect, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import useSWR from 'swr'; diff --git a/src/features/SkillStore/SkillDetail/Agents.tsx b/src/features/SkillStore/SkillDetail/Agents.tsx index 7a1863a1fc..cdb01fa6f3 100644 --- a/src/features/SkillStore/SkillDetail/Agents.tsx +++ b/src/features/SkillStore/SkillDetail/Agents.tsx @@ -9,7 +9,7 @@ import { VirtuosoGrid } from 'react-virtuoso'; import { useClientDataSWR } from '@/libs/swr'; import { discoverService } from '@/services/discover'; -import type {DiscoverAssistantItem} from '@/types/discover'; +import { type DiscoverAssistantItem } from '@/types/discover'; import AgentItem from './AgentItem'; import { useDetailContext } from './DetailContext'; diff --git a/src/features/SkillStore/SkillDetail/BuiltinDetailProvider.tsx b/src/features/SkillStore/SkillDetail/BuiltinDetailProvider.tsx index c5119695be..1efba37582 100644 --- a/src/features/SkillStore/SkillDetail/BuiltinDetailProvider.tsx +++ b/src/features/SkillStore/SkillDetail/BuiltinDetailProvider.tsx @@ -1,14 +1,14 @@ 'use client'; import isEqual from 'fast-deep-equal'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useToolStore } from '@/store/tool'; import { builtinToolSelectors } from '@/store/tool/selectors'; -import type { DetailContextValue } from './DetailContext'; +import { type DetailContextValue } from './DetailContext'; import { DetailContext } from './DetailContext'; interface BuiltinDetailProviderProps { diff --git a/src/features/SkillStore/SkillDetail/DetailContext.tsx b/src/features/SkillStore/SkillDetail/DetailContext.tsx index 0d15054514..57802452a6 100644 --- a/src/features/SkillStore/SkillDetail/DetailContext.tsx +++ b/src/features/SkillStore/SkillDetail/DetailContext.tsx @@ -1,7 +1,7 @@ 'use client'; -import type { KlavisServerType, LobehubSkillProviderType } from '@lobechat/const'; -import type { Klavis } from 'klavis'; +import { type KlavisServerType, type LobehubSkillProviderType } from '@lobechat/const'; +import { type Klavis } from 'klavis'; import type React from 'react'; import { createContext, use } from 'react'; diff --git a/src/features/SkillStore/SkillDetail/KlavisDetailProvider.tsx b/src/features/SkillStore/SkillDetail/KlavisDetailProvider.tsx index b5a77b1a73..0ecd68126d 100644 --- a/src/features/SkillStore/SkillDetail/KlavisDetailProvider.tsx +++ b/src/features/SkillStore/SkillDetail/KlavisDetailProvider.tsx @@ -1,8 +1,8 @@ 'use client'; import { getKlavisServerByServerIdentifier } from '@lobechat/const'; -import type { Klavis } from 'klavis'; -import type { ReactNode } from 'react'; +import { type Klavis } from 'klavis'; +import { type ReactNode } from 'react'; import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -10,8 +10,8 @@ import { useToolStore } from '@/store/tool'; import { klavisStoreSelectors } from '@/store/tool/selectors'; import { KlavisServerStatus } from '@/store/tool/slices/klavisStore'; -import type {DetailContextValue} from './DetailContext'; -import { DetailContext } from './DetailContext'; +import { type DetailContextValue } from './DetailContext'; +import { DetailContext } from './DetailContext'; interface KlavisDetailProviderProps { children: ReactNode; diff --git a/src/features/SkillStore/SkillDetail/KlavisSkillDetailContent.tsx b/src/features/SkillStore/SkillDetail/KlavisSkillDetailContent.tsx index 238899e371..44b4313c74 100644 --- a/src/features/SkillStore/SkillDetail/KlavisSkillDetailContent.tsx +++ b/src/features/SkillStore/SkillDetail/KlavisSkillDetailContent.tsx @@ -1,6 +1,6 @@ 'use client'; -import type { Klavis } from 'klavis'; +import { type Klavis } from 'klavis'; import { KlavisDetailProvider } from './KlavisDetailProvider'; import SkillDetailInner from './SkillDetailInner'; diff --git a/src/features/SkillStore/SkillDetail/LobehubDetailProvider.tsx b/src/features/SkillStore/SkillDetail/LobehubDetailProvider.tsx index 408ee30e91..e4746d9f5a 100644 --- a/src/features/SkillStore/SkillDetail/LobehubDetailProvider.tsx +++ b/src/features/SkillStore/SkillDetail/LobehubDetailProvider.tsx @@ -1,7 +1,7 @@ 'use client'; import { getLobehubSkillProviderById } from '@lobechat/const'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -9,8 +9,8 @@ import { useToolStore } from '@/store/tool'; import { lobehubSkillStoreSelectors } from '@/store/tool/selectors'; import { LobehubSkillStatus } from '@/store/tool/slices/lobehubSkillStore/types'; -import type {DetailContextValue} from './DetailContext'; -import { DetailContext } from './DetailContext'; +import { type DetailContextValue } from './DetailContext'; +import { DetailContext } from './DetailContext'; interface LobehubDetailProviderProps { children: ReactNode; diff --git a/src/features/SkillStore/SkillDetail/SkillDetailInner.tsx b/src/features/SkillStore/SkillDetail/SkillDetailInner.tsx index d6e6b5b5ef..5d481587f3 100644 --- a/src/features/SkillStore/SkillDetail/SkillDetailInner.tsx +++ b/src/features/SkillStore/SkillDetail/SkillDetailInner.tsx @@ -5,7 +5,7 @@ import { lazy, memo, Suspense, useState } from 'react'; import Agents from './Agents'; import Header from './Header'; -import type {TabKey} from './Nav'; +import { type TabKey } from './Nav'; import Nav from './Nav'; import Overview from './Overview'; diff --git a/src/features/SkillStore/SkillDetail/index.tsx b/src/features/SkillStore/SkillDetail/index.tsx index 2e93e579b4..78c13b6ad6 100644 --- a/src/features/SkillStore/SkillDetail/index.tsx +++ b/src/features/SkillStore/SkillDetail/index.tsx @@ -2,7 +2,7 @@ import { createModal } from '@lobehub/ui'; import { t } from 'i18next'; -import type { Klavis } from 'klavis'; +import { type Klavis } from 'klavis'; import { BuiltinSkillDetailContent } from './BuiltinSkillDetailContent'; import { KlavisSkillDetailContent } from './KlavisSkillDetailContent'; diff --git a/src/features/SkillStore/SkillList/AddSkillButton.tsx b/src/features/SkillStore/SkillList/AddSkillButton.tsx index 05eb584c1e..6008b6cd4f 100644 --- a/src/features/SkillStore/SkillList/AddSkillButton.tsx +++ b/src/features/SkillStore/SkillList/AddSkillButton.tsx @@ -1,8 +1,8 @@ -import type {ButtonProps} from '@lobehub/ui'; -import { Button } from '@lobehub/ui'; +import { type ButtonProps } from '@lobehub/ui'; +import { Button } from '@lobehub/ui'; import { Grid2x2Plus } from 'lucide-react'; -import type {Ref} from 'react'; -import { useState } from 'react'; +import { type Ref } from 'react'; +import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import DevModal from '@/features/PluginDevModal'; diff --git a/src/features/SkillStore/SkillList/Community/Item.tsx b/src/features/SkillStore/SkillList/Community/Item.tsx index ccbc26f5cd..b4e19bc12e 100644 --- a/src/features/SkillStore/SkillList/Community/Item.tsx +++ b/src/features/SkillStore/SkillList/Community/Item.tsx @@ -16,7 +16,7 @@ import { useAgentStore } from '@/store/agent'; import { agentSelectors } from '@/store/agent/selectors'; import { useToolStore } from '@/store/tool'; import { mcpStoreSelectors, pluginSelectors } from '@/store/tool/selectors'; -import type {DiscoverMcpItem} from '@/types/discover'; +import { type DiscoverMcpItem } from '@/types/discover'; import { itemStyles } from '../style'; diff --git a/src/features/SkillStore/SkillList/Empty.tsx b/src/features/SkillStore/SkillList/Empty.tsx index f4e8527aaa..94cc4c0428 100644 --- a/src/features/SkillStore/SkillList/Empty.tsx +++ b/src/features/SkillStore/SkillList/Empty.tsx @@ -1,5 +1,5 @@ -import type {EmptyProps} from '@lobehub/ui'; -import { Center, Empty as EmptyComponent } from '@lobehub/ui'; +import { type EmptyProps } from '@lobehub/ui'; +import { Center, Empty as EmptyComponent } from '@lobehub/ui'; import { BlocksIcon } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/SkillStore/SkillList/LobeHub/Item.tsx b/src/features/SkillStore/SkillList/LobeHub/Item.tsx index 4a553128e3..d3852a843d 100644 --- a/src/features/SkillStore/SkillList/LobeHub/Item.tsx +++ b/src/features/SkillStore/SkillList/LobeHub/Item.tsx @@ -3,7 +3,7 @@ import { ActionIcon, Block, DropdownMenu, Flexbox, Icon } from '@lobehub/ui'; import { App } from 'antd'; import { cssVar } from 'antd-style'; -import type { Klavis } from 'klavis'; +import { type Klavis } from 'klavis'; import { Loader2, MoreVerticalIcon, Plus, Unplug } from 'lucide-react'; import React, { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/SkillStore/SkillList/LobeHub/index.tsx b/src/features/SkillStore/SkillList/LobeHub/index.tsx index a7ac5759bb..91e6170692 100644 --- a/src/features/SkillStore/SkillList/LobeHub/index.tsx +++ b/src/features/SkillStore/SkillList/LobeHub/index.tsx @@ -1,7 +1,7 @@ 'use client'; import { KLAVIS_SERVER_TYPES, LOBEHUB_SKILL_PROVIDERS } from '@lobechat/const'; -import type { LobeToolMeta } from '@lobechat/types'; +import { type LobeToolMeta } from '@lobechat/types'; import isEqual from 'fast-deep-equal'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -13,7 +13,7 @@ import { } from '@/features/SkillStore/SkillDetail'; import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig'; import { useToolStore } from '@/store/tool'; -import type { ToolStoreState } from '@/store/tool/initialState'; +import { type ToolStoreState } from '@/store/tool/initialState'; import { klavisStoreSelectors, lobehubSkillStoreSelectors } from '@/store/tool/selectors'; import { KlavisServerStatus } from '@/store/tool/slices/klavisStore'; import { LobehubSkillStatus } from '@/store/tool/slices/lobehubSkillStore/types'; diff --git a/src/features/SkillStore/SkillList/LobeHub/useSkillConnect.ts b/src/features/SkillStore/SkillList/LobeHub/useSkillConnect.ts index 691b3db042..6e379b490a 100644 --- a/src/features/SkillStore/SkillList/LobeHub/useSkillConnect.ts +++ b/src/features/SkillStore/SkillList/LobeHub/useSkillConnect.ts @@ -1,7 +1,7 @@ 'use client'; import { getLobehubSkillProviderById } from '@lobechat/const'; -import type { Klavis } from 'klavis'; +import { type Klavis } from 'klavis'; import { useCallback, useEffect, useRef, useState } from 'react'; import { useToolStore } from '@/store/tool'; diff --git a/src/features/SkillStore/SkillStoreContent.tsx b/src/features/SkillStore/SkillStoreContent.tsx index 41faafa39b..8c6b480515 100644 --- a/src/features/SkillStore/SkillStoreContent.tsx +++ b/src/features/SkillStore/SkillStoreContent.tsx @@ -1,7 +1,7 @@ 'use client'; import { Flexbox, Segmented } from '@lobehub/ui'; -import type {SegmentedOptions} from 'antd/es/segmented'; +import { type SegmentedOptions } from 'antd/es/segmented'; import { useState } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/SuggestQuestions/List.tsx b/src/features/SuggestQuestions/List.tsx index a5d9e50b7e..c1b51a21ab 100644 --- a/src/features/SuggestQuestions/List.tsx +++ b/src/features/SuggestQuestions/List.tsx @@ -7,7 +7,7 @@ import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import Item from './Item'; -import type { SuggestMode } from './useRandomQuestions'; +import { type SuggestMode } from './useRandomQuestions'; import { useRandomQuestions } from './useRandomQuestions'; interface ListProps { diff --git a/src/features/SuggestQuestions/index.tsx b/src/features/SuggestQuestions/index.tsx index 7221b3646a..dc76e519c5 100644 --- a/src/features/SuggestQuestions/index.tsx +++ b/src/features/SuggestQuestions/index.tsx @@ -5,7 +5,7 @@ import { memo, Suspense } from 'react'; import List from './List'; import Skeleton from './Skeleton'; -import type { SuggestMode } from './useRandomQuestions'; +import { type SuggestMode } from './useRandomQuestions'; interface SuggestQuestionsProps { count?: number; diff --git a/src/features/ToolTag/index.tsx b/src/features/ToolTag/index.tsx index ee49fd3568..7bf900494d 100644 --- a/src/features/ToolTag/index.tsx +++ b/src/features/ToolTag/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {KlavisServerType} from '@lobechat/const'; -import { KLAVIS_SERVER_TYPES } from '@lobechat/const'; +import { type KlavisServerType } from '@lobechat/const'; +import { KLAVIS_SERVER_TYPES } from '@lobechat/const'; import { Avatar, Icon, Tag } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; import isEqual from 'fast-deep-equal'; diff --git a/src/features/TopicEmpty.tsx b/src/features/TopicEmpty.tsx index 6c9270cacf..76d7416092 100644 --- a/src/features/TopicEmpty.tsx +++ b/src/features/TopicEmpty.tsx @@ -1,5 +1,5 @@ -import type {EmptyProps} from '@lobehub/ui'; -import { Center, Empty } from '@lobehub/ui'; +import { type EmptyProps } from '@lobehub/ui'; +import { Center, Empty } from '@lobehub/ui'; import { MessageSquareText } from 'lucide-react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/User/DataStatistics.tsx b/src/features/User/DataStatistics.tsx index 740954db56..18333059f8 100644 --- a/src/features/User/DataStatistics.tsx +++ b/src/features/User/DataStatistics.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FlexboxProps} from '@lobehub/ui'; -import { Flexbox, Tooltip } from '@lobehub/ui'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Flexbox, Tooltip } from '@lobehub/ui'; import { Badge } from 'antd'; import { createStaticStyles, cssVar } from 'antd-style'; import { isUndefined } from 'es-toolkit/compat'; diff --git a/src/features/User/UserAvatar.tsx b/src/features/User/UserAvatar.tsx index ee042215d6..87af0b7940 100644 --- a/src/features/User/UserAvatar.tsx +++ b/src/features/User/UserAvatar.tsx @@ -1,7 +1,7 @@ 'use client'; import { BRANDING_NAME } from '@lobechat/business-const'; -import type { AvatarProps } from '@lobehub/ui'; +import { type AvatarProps } from '@lobehub/ui'; import { Avatar } from '@lobehub/ui'; import { createStaticStyles, cssVar } from 'antd-style'; import { useMemo } from 'react'; diff --git a/src/features/User/UserInfo.tsx b/src/features/User/UserInfo.tsx index 2094837fc5..6a76587883 100644 --- a/src/features/User/UserInfo.tsx +++ b/src/features/User/UserInfo.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {FlexboxProps} from '@lobehub/ui'; -import { Flexbox, Text } from '@lobehub/ui'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Flexbox, Text } from '@lobehub/ui'; import { cssVar } from 'antd-style'; import { memo } from 'react'; @@ -9,7 +9,7 @@ import PlanTag from '@/features/User/PlanTag'; import { useUserStore } from '@/store/user'; import { authSelectors, userProfileSelectors } from '@/store/user/selectors'; -import type {UserAvatarProps} from './UserAvatar'; +import { type UserAvatarProps } from './UserAvatar'; import UserAvatar from './UserAvatar'; export interface UserInfoProps extends FlexboxProps { diff --git a/src/features/User/UserPanel/LangButton.tsx b/src/features/User/UserPanel/LangButton.tsx index f143ba59b6..8a96ac2370 100644 --- a/src/features/User/UserPanel/LangButton.tsx +++ b/src/features/User/UserPanel/LangButton.tsx @@ -1,10 +1,5 @@ -import type {DropdownMenuCheckboxItem, DropdownMenuProps} from '@lobehub/ui'; -import { - ActionIcon, - DropdownMenu, - Flexbox, - Text -} from '@lobehub/ui'; +import { type DropdownMenuCheckboxItem, type DropdownMenuProps } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu, Flexbox, Text } from '@lobehub/ui'; import { Languages } from 'lucide-react'; import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/User/UserPanel/ThemeButton.tsx b/src/features/User/UserPanel/ThemeButton.tsx index 3648c36db4..d300c4144e 100644 --- a/src/features/User/UserPanel/ThemeButton.tsx +++ b/src/features/User/UserPanel/ThemeButton.tsx @@ -1,8 +1,8 @@ -import type {DropdownMenuProps} from '@lobehub/ui'; -import { ActionIcon, DropdownMenu, Icon } from '@lobehub/ui'; +import { type DropdownMenuProps } from '@lobehub/ui'; +import { ActionIcon, DropdownMenu, Icon } from '@lobehub/ui'; import { Monitor, Moon, Sun } from 'lucide-react'; import { useTheme as useNextThemesTheme } from 'next-themes'; -import type { FC} from 'react'; +import { type FC } from 'react'; import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/features/User/UserPanel/UpgradeBadge.tsx b/src/features/User/UserPanel/UpgradeBadge.tsx index af360cf702..358c60a3a1 100644 --- a/src/features/User/UserPanel/UpgradeBadge.tsx +++ b/src/features/User/UserPanel/UpgradeBadge.tsx @@ -1,5 +1,5 @@ import { Flexbox, Tag } from '@lobehub/ui'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { memo } from 'react'; const UpgradeBadge = memo(({ children, showBadge }: PropsWithChildren<{ showBadge?: boolean }>) => { diff --git a/src/features/User/UserPanel/index.tsx b/src/features/User/UserPanel/index.tsx index f144c28251..0fac1c94e0 100644 --- a/src/features/User/UserPanel/index.tsx +++ b/src/features/User/UserPanel/index.tsx @@ -2,8 +2,8 @@ import { Popover } from 'antd'; import { createStaticStyles } from 'antd-style'; -import type {PropsWithChildren} from 'react'; -import { memo, Suspense, useState } from 'react'; +import { type PropsWithChildren } from 'react'; +import { memo, Suspense, useState } from 'react'; import { isDesktop } from '@/const/version'; diff --git a/src/features/User/UserPanel/useMenu.tsx b/src/features/User/UserPanel/useMenu.tsx index 146899a228..70b34d5e35 100644 --- a/src/features/User/UserPanel/useMenu.tsx +++ b/src/features/User/UserPanel/useMenu.tsx @@ -1,15 +1,15 @@ import { LOBE_CHAT_CLOUD, UTM_SOURCE } from '@lobechat/business-const'; import { DOWNLOAD_URL, isDesktop } from '@lobechat/const'; import { Flexbox, Hotkey, Icon, Tag } from '@lobehub/ui'; -import type {ItemType} from 'antd/es/menu/interface'; +import { type ItemType } from 'antd/es/menu/interface'; import { Cloudy, Download, HardDriveDownload, LogOut, Settings2 } from 'lucide-react'; -import type {PropsWithChildren} from 'react'; -import { memo, useMemo } from 'react'; +import { type PropsWithChildren } from 'react'; +import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; import useBusinessMenuItems from '@/business/client/features/User/useBusinessMenuItems'; -import type { MenuProps } from '@/components/Menu'; +import { type MenuProps } from '@/components/Menu'; import { DEFAULT_DESKTOP_HOTKEY_CONFIG } from '@/const/desktop'; import { OFFICIAL_URL } from '@/const/url'; import DataImporter from '@/features/DataImporter'; diff --git a/src/features/WideScreenContainer/index.tsx b/src/features/WideScreenContainer/index.tsx index 099966eb68..9b34832ec8 100644 --- a/src/features/WideScreenContainer/index.tsx +++ b/src/features/WideScreenContainer/index.tsx @@ -1,11 +1,11 @@ 'use client'; -import type {FlexboxProps} from '@lobehub/ui'; -import { Flexbox } from '@lobehub/ui'; +import { type FlexboxProps } from '@lobehub/ui'; +import { Flexbox } from '@lobehub/ui'; import { createStaticStyles, cssVar, cx } from 'antd-style'; import isEqual from 'fast-deep-equal'; -import type {CSSProperties} from 'react'; -import { memo, useEffect } from 'react'; +import { type CSSProperties } from 'react'; +import { memo, useEffect } from 'react'; import { CONVERSATION_MIN_WIDTH } from '@/const/layoutTokens'; import { useGlobalStore } from '@/store/global'; diff --git a/src/helpers/GlobalAgentContextManager.ts b/src/helpers/GlobalAgentContextManager.ts index 250cd307c4..b9c329d79c 100644 --- a/src/helpers/GlobalAgentContextManager.ts +++ b/src/helpers/GlobalAgentContextManager.ts @@ -74,7 +74,7 @@ class GlobalAgentContextManager { if (!template) return ''; // Updated to use replaceAll for potentially multiple occurrences - return template.replaceAll(/{{([^}]+)}}/g, (match, key) => { + return template.replaceAll(/\{\{([^}]+)\}\}/g, (match, key) => { const trimmedKey = key.trim() as keyof LobeGlobalAgentContext; return ctx[trimmedKey] !== undefined ? String(ctx[trimmedKey]) : '[N/A]'; }); diff --git a/src/helpers/parserPlaceholder/index.ts b/src/helpers/parserPlaceholder/index.ts index c344709c20..15fd61b758 100644 --- a/src/helpers/parserPlaceholder/index.ts +++ b/src/helpers/parserPlaceholder/index.ts @@ -10,7 +10,7 @@ import { userProfileSelectors } from '@/store/user/selectors'; import { globalAgentContextManager } from '../GlobalAgentContextManager'; -const placeholderVariablesRegex = /{{(.*?)}}/g; +const placeholderVariablesRegex = /\{\{(.*?)\}\}/g; /* eslint-disable sort-keys-fix/sort-keys-fix */ export const VARIABLE_GENERATORS = { diff --git a/src/helpers/toolEngineering/index.test.ts b/src/helpers/toolEngineering/index.test.ts index ffb91d7349..0dc2ebb074 100644 --- a/src/helpers/toolEngineering/index.test.ts +++ b/src/helpers/toolEngineering/index.test.ts @@ -1,4 +1,4 @@ -import type { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; import { describe, expect, it, vi } from 'vitest'; import { createAgentToolsEngine, createToolsEngine, getEnabledTools } from './index'; diff --git a/src/helpers/toolEngineering/index.ts b/src/helpers/toolEngineering/index.ts index b7fe4588a4..cb1965a47a 100644 --- a/src/helpers/toolEngineering/index.ts +++ b/src/helpers/toolEngineering/index.ts @@ -3,10 +3,10 @@ */ import { KnowledgeBaseManifest } from '@lobechat/builtin-tool-knowledge-base'; import { WebBrowsingManifest } from '@lobechat/builtin-tool-web-browsing'; -import type { PluginEnableChecker } from '@lobechat/context-engine'; +import { type PluginEnableChecker } from '@lobechat/context-engine'; import { ToolsEngine } from '@lobechat/context-engine'; -import type {ChatCompletionTool, WorkingModel} from '@lobechat/types'; -import type { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; +import { type ChatCompletionTool, type WorkingModel } from '@lobechat/types'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; import { getAgentStoreState } from '@/store/agent'; import { agentSelectors } from '@/store/agent/selectors'; diff --git a/src/hooks/useAgentOwnershipCheck.ts b/src/hooks/useAgentOwnershipCheck.ts index 926cdf3590..e30cd5fc53 100644 --- a/src/hooks/useAgentOwnershipCheck.ts +++ b/src/hooks/useAgentOwnershipCheck.ts @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth'; -import type {MarketAuthContextType} from '@/layout/AuthProvider/MarketAuth/types'; +import { type MarketAuthContextType } from '@/layout/AuthProvider/MarketAuth/types'; import { marketApiService } from '@/services/marketApi'; import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig'; diff --git a/src/hooks/useAutoScroll.ts b/src/hooks/useAutoScroll.ts index 8e95e60050..4a0080dfa9 100644 --- a/src/hooks/useAutoScroll.ts +++ b/src/hooks/useAutoScroll.ts @@ -1,5 +1,5 @@ -import type {RefObject} from 'react'; -import { useCallback, useEffect, useRef, useState } from 'react'; +import { type RefObject } from 'react'; +import { useCallback, useEffect, useRef, useState } from 'react'; interface UseAutoScrollOptions { /** diff --git a/src/hooks/useEnabledChatModels.ts b/src/hooks/useEnabledChatModels.ts index 76006142ce..37e0ec807d 100644 --- a/src/hooks/useEnabledChatModels.ts +++ b/src/hooks/useEnabledChatModels.ts @@ -1,7 +1,7 @@ import isEqual from 'fast-deep-equal'; import { useAiInfraStore } from '@/store/aiInfra'; -import type {EnabledProviderWithModels} from '@/types/aiProvider'; +import { type EnabledProviderWithModels } from '@/types/aiProvider'; export const useEnabledChatModels = (): EnabledProviderWithModels[] => { const enabledChatModelList = useAiInfraStore((s) => s.enabledChatModelList, isEqual); diff --git a/src/hooks/useHotkeys/useHotkeyById.ts b/src/hooks/useHotkeys/useHotkeyById.ts index a5ed970477..d4162fe8ec 100644 --- a/src/hooks/useHotkeys/useHotkeyById.ts +++ b/src/hooks/useHotkeys/useHotkeyById.ts @@ -1,13 +1,13 @@ import { uniq } from 'es-toolkit/compat'; -import type {DependencyList} from 'react'; -import type {HotkeyCallback, Options} from 'react-hotkeys-hook'; -import { useHotkeys } from 'react-hotkeys-hook'; +import { type DependencyList } from 'react'; +import { type HotkeyCallback, type Options } from 'react-hotkeys-hook'; +import { useHotkeys } from 'react-hotkeys-hook'; import { HOTKEYS_REGISTRATION } from '@/const/hotkeys'; import { useServerConfigStore } from '@/store/serverConfig'; import { useUserStore } from '@/store/user'; import { settingsSelectors } from '@/store/user/selectors'; -import type {HotkeyId} from '@/types/hotkey'; +import { type HotkeyId } from '@/types/hotkey'; import { isDev } from '@/utils/env'; type OptionsOrDependencyArray = Options | DependencyList; diff --git a/src/hooks/useInitBuiltinAgent.ts b/src/hooks/useInitBuiltinAgent.ts index e9023fa0d9..9eaf15d6d2 100644 --- a/src/hooks/useInitBuiltinAgent.ts +++ b/src/hooks/useInitBuiltinAgent.ts @@ -1,4 +1,4 @@ -import type {BuiltinAgentSlug} from '@lobechat/builtin-agents'; +import { type BuiltinAgentSlug } from '@lobechat/builtin-agents'; import { useAgentStore } from '@/store/agent'; import { useUserStore } from '@/store/user'; diff --git a/src/hooks/useOperationState.ts b/src/hooks/useOperationState.ts index 052ffd2033..71f6921dc7 100644 --- a/src/hooks/useOperationState.ts +++ b/src/hooks/useOperationState.ts @@ -1,7 +1,7 @@ import { useMemo } from 'react'; import { useShallow } from 'zustand/react/shallow'; -import type { ConversationContext, OperationState } from '@/features/Conversation/types'; +import { type ConversationContext, type OperationState } from '@/features/Conversation/types'; import { DEFAULT_MESSAGE_OPERATION_STATE, DEFAULT_TOOL_OPERATION_STATE, @@ -80,7 +80,7 @@ export const useOperationState = (context: ConversationContext): OperationState isRegenerating: runningOps.some((op) => op.type === 'regenerate'), }; }, - + getToolOperationState: (messageId: string, index: number, _toolCallId?: string) => { const state = useChatStore.getState(); diff --git a/src/hooks/useQueryRoute.ts b/src/hooks/useQueryRoute.ts index 9728be9329..136439b311 100644 --- a/src/hooks/useQueryRoute.ts +++ b/src/hooks/useQueryRoute.ts @@ -1,5 +1,5 @@ import { isOnServerSide } from '@lobechat/utils'; -import type {ParsedQuery} from 'query-string'; +import { type ParsedQuery } from 'query-string'; import qs from 'query-string'; import { useMemo } from 'react'; import { useNavigate } from 'react-router-dom'; diff --git a/src/hooks/useScreenshot.ts b/src/hooks/useScreenshot.ts index a28d78bbd2..62b1f87c6d 100644 --- a/src/hooks/useScreenshot.ts +++ b/src/hooks/useScreenshot.ts @@ -1,5 +1,5 @@ import { BRANDING_NAME } from '@lobechat/business-const'; -import type { SegmentedProps } from '@lobehub/ui'; +import { type SegmentedProps } from '@lobehub/ui'; import { snapdom } from '@zumer/snapdom'; import dayjs from 'dayjs'; import { useCallback, useState } from 'react'; diff --git a/src/hooks/useTTS.ts b/src/hooks/useTTS.ts index 25f7c0dc3b..92dea35bbb 100644 --- a/src/hooks/useTTS.ts +++ b/src/hooks/useTTS.ts @@ -1,10 +1,11 @@ import { ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const'; -import type {EdgeSpeechOptions, MicrosoftSpeechOptions, OpenAITTSOptions, TTSOptions} from '@lobehub/tts/react'; import { - useEdgeSpeech, - useMicrosoftSpeech, - useOpenAITTS + type EdgeSpeechOptions, + type MicrosoftSpeechOptions, + type OpenAITTSOptions, + type TTSOptions, } from '@lobehub/tts/react'; +import { useEdgeSpeech, useMicrosoftSpeech, useOpenAITTS } from '@lobehub/tts/react'; import isEqual from 'fast-deep-equal'; import { useBusinessTTSProvider } from '@/business/client/hooks/useBusinessTTSProvider'; @@ -16,7 +17,7 @@ import { useGlobalStore } from '@/store/global'; import { globalGeneralSelectors } from '@/store/global/selectors'; import { useUserStore } from '@/store/user'; import { settingsSelectors } from '@/store/user/selectors'; -import type {TTSServer} from '@/types/agent'; +import { type TTSServer } from '@/types/agent'; interface TTSConfig extends TTSOptions { onUpload?: (currentVoice: string, arraybuffers: ArrayBuffer[]) => void; diff --git a/src/hooks/useTypeScriptHappyCallback.ts b/src/hooks/useTypeScriptHappyCallback.ts index 2597515450..1568eb26cc 100644 --- a/src/hooks/useTypeScriptHappyCallback.ts +++ b/src/hooks/useTypeScriptHappyCallback.ts @@ -1,4 +1,4 @@ -import type { DependencyList } from 'react'; +import { type DependencyList } from 'react'; import { useCallback } from 'react'; export const useTypeScriptHappyCallback: ( diff --git a/src/layout/AuthProvider/BetterAuth/UserUpdater.tsx b/src/layout/AuthProvider/BetterAuth/UserUpdater.tsx index 8ef14d4f77..5eb1fe63de 100644 --- a/src/layout/AuthProvider/BetterAuth/UserUpdater.tsx +++ b/src/layout/AuthProvider/BetterAuth/UserUpdater.tsx @@ -5,7 +5,7 @@ import { createStoreUpdater } from 'zustand-utils'; import { useSession } from '@/libs/better-auth/auth-client'; import { useUserStore } from '@/store/user'; -import type {LobeUser} from '@/types/user'; +import { type LobeUser } from '@/types/user'; /** * Sync Better-Auth session state to Zustand store diff --git a/src/layout/AuthProvider/BetterAuth/index.tsx b/src/layout/AuthProvider/BetterAuth/index.tsx index a55f97d335..483dddf30d 100644 --- a/src/layout/AuthProvider/BetterAuth/index.tsx +++ b/src/layout/AuthProvider/BetterAuth/index.tsx @@ -1,4 +1,4 @@ -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import UserUpdater from './UserUpdater'; diff --git a/src/layout/AuthProvider/Desktop/index.tsx b/src/layout/AuthProvider/Desktop/index.tsx index 1d4f9ac802..a7bca32535 100644 --- a/src/layout/AuthProvider/Desktop/index.tsx +++ b/src/layout/AuthProvider/Desktop/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {PropsWithChildren} from 'react'; -import { memo, useEffect } from 'react'; +import { type PropsWithChildren } from 'react'; +import { memo, useEffect } from 'react'; import { createStoreUpdater } from 'zustand-utils'; import { useUserStore } from '@/store/user'; diff --git a/src/layout/AuthProvider/MarketAuth/MarketAuthProvider.tsx b/src/layout/AuthProvider/MarketAuth/MarketAuthProvider.tsx index 9dabdced1f..c4f187dd8b 100644 --- a/src/layout/AuthProvider/MarketAuth/MarketAuthProvider.tsx +++ b/src/layout/AuthProvider/MarketAuth/MarketAuthProvider.tsx @@ -1,8 +1,8 @@ 'use client'; import { App } from 'antd'; -import type {ReactNode} from 'react'; -import { createContext, use, useCallback, useEffect, useState } from 'react'; +import { type ReactNode } from 'react'; +import { createContext, use, useCallback, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { mutate as globalMutate } from 'swr'; @@ -17,7 +17,13 @@ import { MarketAuthError } from './errors'; import MarketAuthConfirmModal from './MarketAuthConfirmModal'; import { MarketOIDC } from './oidc'; import ProfileSetupModal from './ProfileSetupModal'; -import type {MarketAuthContextType, MarketAuthSession, MarketUserInfo, MarketUserProfile, OIDCConfig} from './types'; +import { + type MarketAuthContextType, + type MarketAuthSession, + type MarketUserInfo, + type MarketUserProfile, + type OIDCConfig, +} from './types'; import { useMarketUserProfile } from './useMarketUserProfile'; const MarketAuthContext = createContext(null); diff --git a/src/layout/AuthProvider/MarketAuth/ProfileSetupModal.tsx b/src/layout/AuthProvider/MarketAuth/ProfileSetupModal.tsx index 7161946b7a..158f32bbd1 100644 --- a/src/layout/AuthProvider/MarketAuth/ProfileSetupModal.tsx +++ b/src/layout/AuthProvider/MarketAuth/ProfileSetupModal.tsx @@ -2,8 +2,8 @@ import { SiGithub, SiX } from '@icons-pack/react-simple-icons'; import { Center, Flexbox, Icon, Input, Modal, Text, TextArea, Tooltip } from '@lobehub/ui'; -import type {UploadProps} from 'antd'; -import { App, Form, Upload } from 'antd'; +import { type UploadProps } from 'antd'; +import { App, Form, Upload } from 'antd'; import { cssVar } from 'antd-style'; import { CircleHelp, Globe, ImagePlus, Trash2 } from 'lucide-react'; import { memo, useCallback, useEffect, useState } from 'react'; @@ -19,7 +19,7 @@ import { serverConfigSelectors } from '@/store/serverConfig/selectors'; import { useUserStore } from '@/store/user'; import { userProfileSelectors } from '@/store/user/selectors'; -import type {MarketUserProfile} from './types'; +import { type MarketUserProfile } from './types'; const MAX_FILE_SIZE = 2 * 1024 * 1024; // 2MB limit diff --git a/src/layout/AuthProvider/MarketAuth/oidc.ts b/src/layout/AuthProvider/MarketAuth/oidc.ts index e850ff8f47..77f85cb881 100644 --- a/src/layout/AuthProvider/MarketAuth/oidc.ts +++ b/src/layout/AuthProvider/MarketAuth/oidc.ts @@ -2,7 +2,7 @@ import { isDesktop } from '@/const/version'; import { MARKET_OIDC_ENDPOINTS } from '@/services/_url'; import { MarketAuthError } from './errors'; -import type {OIDCConfig, PKCEParams, TokenResponse} from './types'; +import { type OIDCConfig, type PKCEParams, type TokenResponse } from './types'; /** * Market OIDC 授权工具类 diff --git a/src/layout/AuthProvider/MarketAuth/useMarketUserProfile.ts b/src/layout/AuthProvider/MarketAuth/useMarketUserProfile.ts index 35a15b9d76..7da6ec82a9 100644 --- a/src/layout/AuthProvider/MarketAuth/useMarketUserProfile.ts +++ b/src/layout/AuthProvider/MarketAuth/useMarketUserProfile.ts @@ -2,7 +2,7 @@ import useSWR from 'swr'; import { lambdaClient } from '@/libs/trpc/client'; -import type {MarketUserProfile} from './types'; +import { type MarketUserProfile } from './types'; /** * Fetcher function for user profile using tRPC diff --git a/src/layout/AuthProvider/NoAuth/index.tsx b/src/layout/AuthProvider/NoAuth/index.tsx index 5988403ede..a52a9a7255 100644 --- a/src/layout/AuthProvider/NoAuth/index.tsx +++ b/src/layout/AuthProvider/NoAuth/index.tsx @@ -1,6 +1,6 @@ 'use client'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { memo } from 'react'; import { createStoreUpdater } from 'zustand-utils'; diff --git a/src/layout/AuthProvider/index.tsx b/src/layout/AuthProvider/index.tsx index 753ba1977e..b2c25bef2b 100644 --- a/src/layout/AuthProvider/index.tsx +++ b/src/layout/AuthProvider/index.tsx @@ -1,5 +1,5 @@ import { isDesktop } from '@lobechat/const'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { authEnv } from '@/envs/auth'; diff --git a/src/layout/GlobalProvider/AppTheme.tsx b/src/layout/GlobalProvider/AppTheme.tsx index 59b8dba5d0..26ad8a3666 100644 --- a/src/layout/GlobalProvider/AppTheme.tsx +++ b/src/layout/GlobalProvider/AppTheme.tsx @@ -3,13 +3,13 @@ import 'antd/dist/reset.css'; import { TITLE_BAR_HEIGHT } from '@lobechat/desktop-bridge'; -import type { NeutralColors, PrimaryColors } from '@lobehub/ui'; +import { type NeutralColors, type PrimaryColors } from '@lobehub/ui'; import { ConfigProvider, FontLoader, ThemeProvider } from '@lobehub/ui'; import { message as antdMessage } from 'antd'; import { AppConfigContext } from 'antd/es/app/context'; import { createStaticStyles, cx, useTheme } from 'antd-style'; import * as motion from 'motion/react-m'; -import type { ReactNode } from 'react'; +import { type ReactNode } from 'react'; import { memo, useEffect, useMemo, useState } from 'react'; import AntdStaticMethods from '@/components/AntdStaticMethods'; diff --git a/src/layout/GlobalProvider/Editor.tsx b/src/layout/GlobalProvider/Editor.tsx index cda1896136..e5542f0fc6 100644 --- a/src/layout/GlobalProvider/Editor.tsx +++ b/src/layout/GlobalProvider/Editor.tsx @@ -1,8 +1,8 @@ 'use client'; import { EditorProvider } from '@lobehub/editor/react'; -import type {PropsWithChildren} from 'react'; -import { memo, useMemo } from 'react'; +import { type PropsWithChildren } from 'react'; +import { memo, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; const Editor = memo(({ children }) => { diff --git a/src/layout/GlobalProvider/FaviconProvider.tsx b/src/layout/GlobalProvider/FaviconProvider.tsx index b241c97106..ea7a85dad7 100644 --- a/src/layout/GlobalProvider/FaviconProvider.tsx +++ b/src/layout/GlobalProvider/FaviconProvider.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {ReactNode} from 'react'; -import { createContext, memo, use, useCallback, useMemo, useState } from 'react'; +import { type ReactNode } from 'react'; +import { createContext, memo, use, useCallback, useMemo, useState } from 'react'; export type FaviconState = 'default' | 'done' | 'error' | 'progress'; @@ -95,21 +95,13 @@ export const FaviconProvider = memo<{ children: ReactNode }>(({ children }) => { }); }, []); - const stateValue = useMemo( - () => ({ currentState, isDevMode }), - [currentState, isDevMode], - ); + const stateValue = useMemo(() => ({ currentState, isDevMode }), [currentState, isDevMode]); - const settersValue = useMemo( - () => ({ setFavicon, setIsDevMode }), - [setFavicon, setIsDevMode], - ); + const settersValue = useMemo(() => ({ setFavicon, setIsDevMode }), [setFavicon, setIsDevMode]); return ( - - {children} - + {children} ); }); diff --git a/src/layout/GlobalProvider/GroupWizardProvider.tsx b/src/layout/GlobalProvider/GroupWizardProvider.tsx index 72515ee2b3..ecfa528033 100644 --- a/src/layout/GlobalProvider/GroupWizardProvider.tsx +++ b/src/layout/GlobalProvider/GroupWizardProvider.tsx @@ -1,7 +1,7 @@ 'use client'; -import type {ReactNode} from 'react'; -import { createContext, lazy, memo, Suspense, use, useState } from 'react'; +import { type ReactNode } from 'react'; +import { createContext, lazy, memo, Suspense, use, useState } from 'react'; // Lazy load ChatGroupWizard to avoid bundling it globally const ChatGroupWizard = lazy(() => diff --git a/src/layout/GlobalProvider/Locale.tsx b/src/layout/GlobalProvider/Locale.tsx index 277d8d3498..6497308717 100644 --- a/src/layout/GlobalProvider/Locale.tsx +++ b/src/layout/GlobalProvider/Locale.tsx @@ -2,8 +2,8 @@ import { ConfigProvider } from 'antd'; import dayjs from 'dayjs'; -import type {PropsWithChildren} from 'react'; -import { memo, useEffect, useState } from 'react'; +import { type PropsWithChildren } from 'react'; +import { memo, useEffect, useState } from 'react'; import { isRtlLang } from 'rtl-detect'; import { createI18nNext } from '@/locales/create'; diff --git a/src/layout/GlobalProvider/NextThemeProvider.tsx b/src/layout/GlobalProvider/NextThemeProvider.tsx index 7e19682ed9..2d48876014 100644 --- a/src/layout/GlobalProvider/NextThemeProvider.tsx +++ b/src/layout/GlobalProvider/NextThemeProvider.tsx @@ -1,7 +1,7 @@ 'use client'; import { ThemeProvider as NextThemesProvider } from 'next-themes'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; interface NextThemeProviderProps { children: ReactNode; diff --git a/src/layout/GlobalProvider/Query.tsx b/src/layout/GlobalProvider/Query.tsx index 31fd8a4aa0..b896cb9087 100644 --- a/src/layout/GlobalProvider/Query.tsx +++ b/src/layout/GlobalProvider/Query.tsx @@ -2,8 +2,8 @@ import { useWatchBroadcast } from '@lobechat/electron-client-ipc'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import type {PropsWithChildren} from 'react'; -import React, { useEffect, useState } from 'react'; +import { type PropsWithChildren } from 'react'; +import React, { useEffect, useState } from 'react'; import { SWRConfig, useSWRConfig } from 'swr'; import { setScopedMutate } from '@/libs/swr'; @@ -30,7 +30,6 @@ const SWRMutateInitializer = ({ children }: PropsWithChildren) => { } }); - return <>{children}; }; diff --git a/src/layout/GlobalProvider/StyleRegistry.tsx b/src/layout/GlobalProvider/StyleRegistry.tsx index 05940b0913..e753105651 100644 --- a/src/layout/GlobalProvider/StyleRegistry.tsx +++ b/src/layout/GlobalProvider/StyleRegistry.tsx @@ -1,7 +1,7 @@ 'use client'; import { StyleProvider } from 'antd-style'; -import type {PropsWithChildren} from 'react'; +import { type PropsWithChildren } from 'react'; import { isDesktop } from '@/const/version'; import { useServerInsertedHTML } from '@/libs/next/navigation'; diff --git a/src/layout/GlobalProvider/index.tsx b/src/layout/GlobalProvider/index.tsx index 9f85b5613c..a08282231a 100644 --- a/src/layout/GlobalProvider/index.tsx +++ b/src/layout/GlobalProvider/index.tsx @@ -1,8 +1,8 @@ import { ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const'; import { ContextMenuHost, ModalHost, ToastHost, TooltipGroup } from '@lobehub/ui'; -import { domMax,LazyMotion } from 'motion/react'; -import type {ReactNode} from 'react'; -import { Suspense } from 'react'; +import { domMax, LazyMotion } from 'motion/react'; +import { type ReactNode } from 'react'; +import { Suspense } from 'react'; import { ReferralProvider } from '@/business/client/ReferralProvider'; import { LobeAnalyticsProviderWrapper } from '@/components/Analytics/LobeAnalyticsProviderWrapper'; diff --git a/src/layout/GlobalProvider/useUserStateRedirect.ts b/src/layout/GlobalProvider/useUserStateRedirect.ts index d851bd2aac..9b69883099 100644 --- a/src/layout/GlobalProvider/useUserStateRedirect.ts +++ b/src/layout/GlobalProvider/useUserStateRedirect.ts @@ -8,7 +8,7 @@ import { isDesktop } from '@/const/version'; import { useElectronStore } from '@/store/electron'; import { useUserStore } from '@/store/user'; import { onboardingSelectors } from '@/store/user/selectors'; -import type { UserInitializationState } from '@/types/user'; +import { type UserInitializationState } from '@/types/user'; const redirectIfNotOn = (currentPath: string, path: string) => { if (!currentPath.startsWith(path)) { diff --git a/src/libs/better-auth/auth-client.ts b/src/libs/better-auth/auth-client.ts index a72eb078e7..849055647d 100644 --- a/src/libs/better-auth/auth-client.ts +++ b/src/libs/better-auth/auth-client.ts @@ -6,7 +6,7 @@ import { } from 'better-auth/client/plugins'; import { createAuthClient } from 'better-auth/react'; -import type { auth } from '@/auth'; +import { type auth } from '@/auth'; export const { linkSocial, diff --git a/src/libs/better-auth/define-config.ts b/src/libs/better-auth/define-config.ts index 2e06f33532..c9d71e93ca 100644 --- a/src/libs/better-auth/define-config.ts +++ b/src/libs/better-auth/define-config.ts @@ -7,10 +7,10 @@ import * as schema from '@lobechat/database/schemas'; import bcrypt from 'bcryptjs'; import { drizzleAdapter } from 'better-auth/adapters/drizzle'; import { verifyPassword as defaultVerifyPassword } from 'better-auth/crypto'; -import type {BetterAuthOptions} from 'better-auth/minimal'; +import { type BetterAuthOptions } from 'better-auth/minimal'; import { betterAuth } from 'better-auth/minimal'; import { admin, emailOTP, genericOAuth, magicLink } from 'better-auth/plugins'; -import type {BetterAuthPlugin} from 'better-auth/types'; +import { type BetterAuthPlugin } from 'better-auth/types'; import { emailHarmony } from 'better-auth-harmony'; import { validateEmail } from 'better-auth-harmony/email'; import { ProxyAgent, setGlobalDispatcher } from 'undici'; diff --git a/src/libs/better-auth/plugins/email-whitelist.ts b/src/libs/better-auth/plugins/email-whitelist.ts index b6b6476cd6..9e3f2750d8 100644 --- a/src/libs/better-auth/plugins/email-whitelist.ts +++ b/src/libs/better-auth/plugins/email-whitelist.ts @@ -1,5 +1,5 @@ import { APIError } from 'better-auth/api'; -import type {BetterAuthPlugin} from 'better-auth/types'; +import { type BetterAuthPlugin } from 'better-auth/types'; import { authEnv } from '@/envs/auth'; diff --git a/src/libs/better-auth/sso/helpers.ts b/src/libs/better-auth/sso/helpers.ts index fdd00514e9..3a71a6370b 100644 --- a/src/libs/better-auth/sso/helpers.ts +++ b/src/libs/better-auth/sso/helpers.ts @@ -1,4 +1,4 @@ -import type { GenericOAuthConfig } from 'better-auth/plugins'; +import { type GenericOAuthConfig } from 'better-auth/plugins'; export const DEFAULT_OIDC_SCOPES = ['openid', 'email', 'profile']; diff --git a/src/libs/better-auth/sso/index.ts b/src/libs/better-auth/sso/index.ts index e438cc3d1e..36d120f0f6 100644 --- a/src/libs/better-auth/sso/index.ts +++ b/src/libs/better-auth/sso/index.ts @@ -1,5 +1,5 @@ -import type { GenericOAuthConfig } from 'better-auth/plugins'; -import type { SocialProviders } from 'better-auth/social-providers'; +import { type GenericOAuthConfig } from 'better-auth/plugins'; +import { type SocialProviders } from 'better-auth/social-providers'; import { appEnv } from '@/envs/app'; import { authEnv } from '@/envs/auth'; diff --git a/src/libs/better-auth/sso/providers/apple.ts b/src/libs/better-auth/sso/providers/apple.ts index ca8cf86355..b66efcaac5 100644 --- a/src/libs/better-auth/sso/providers/apple.ts +++ b/src/libs/better-auth/sso/providers/apple.ts @@ -1,6 +1,6 @@ import { authEnv } from '@/envs/auth'; -import type { BuiltinProviderDefinition } from '../types'; +import { type BuiltinProviderDefinition } from '../types'; const provider: BuiltinProviderDefinition< { diff --git a/src/libs/better-auth/sso/providers/auth0.ts b/src/libs/better-auth/sso/providers/auth0.ts index 11eccf80c4..303ed837d9 100644 --- a/src/libs/better-auth/sso/providers/auth0.ts +++ b/src/libs/better-auth/sso/providers/auth0.ts @@ -1,7 +1,7 @@ import { authEnv } from '@/envs/auth'; import { buildOidcConfig } from '../helpers'; -import type { GenericProviderDefinition } from '../types'; +import { type GenericProviderDefinition } from '../types'; const provider: GenericProviderDefinition<{ AUTH_AUTH0_ID: string; diff --git a/src/libs/better-auth/sso/providers/authelia.ts b/src/libs/better-auth/sso/providers/authelia.ts index b97884bc4f..77e7a0f8fe 100644 --- a/src/libs/better-auth/sso/providers/authelia.ts +++ b/src/libs/better-auth/sso/providers/authelia.ts @@ -1,7 +1,7 @@ import { authEnv } from '@/envs/auth'; import { buildOidcConfig } from '../helpers'; -import type { GenericProviderDefinition } from '../types'; +import { type GenericProviderDefinition } from '../types'; const provider: GenericProviderDefinition<{ AUTH_AUTHELIA_ID: string; diff --git a/src/libs/better-auth/sso/providers/authentik.ts b/src/libs/better-auth/sso/providers/authentik.ts index 84beefccd0..8317d86f28 100644 --- a/src/libs/better-auth/sso/providers/authentik.ts +++ b/src/libs/better-auth/sso/providers/authentik.ts @@ -1,7 +1,7 @@ import { authEnv } from '@/envs/auth'; import { buildOidcConfig } from '../helpers'; -import type { GenericProviderDefinition } from '../types'; +import { type GenericProviderDefinition } from '../types'; const provider: GenericProviderDefinition<{ AUTH_AUTHENTIK_ID: string; diff --git a/src/libs/better-auth/sso/providers/casdoor.ts b/src/libs/better-auth/sso/providers/casdoor.ts index d039535184..013a3b0689 100644 --- a/src/libs/better-auth/sso/providers/casdoor.ts +++ b/src/libs/better-auth/sso/providers/casdoor.ts @@ -1,7 +1,7 @@ import { authEnv } from '@/envs/auth'; import { buildOidcConfig } from '../helpers'; -import type { GenericProviderDefinition } from '../types'; +import { type GenericProviderDefinition } from '../types'; const provider: GenericProviderDefinition<{ AUTH_CASDOOR_ID: string; diff --git a/src/libs/better-auth/sso/providers/cloudflare-zero-trust.ts b/src/libs/better-auth/sso/providers/cloudflare-zero-trust.ts index 1cbf58928a..f01fa8ffdf 100644 --- a/src/libs/better-auth/sso/providers/cloudflare-zero-trust.ts +++ b/src/libs/better-auth/sso/providers/cloudflare-zero-trust.ts @@ -1,7 +1,7 @@ import { authEnv } from '@/envs/auth'; import { buildOidcConfig } from '../helpers'; -import type { GenericProviderDefinition } from '../types'; +import { type GenericProviderDefinition } from '../types'; const provider: GenericProviderDefinition<{ AUTH_CLOUDFLARE_ZERO_TRUST_ID: string; diff --git a/src/libs/better-auth/sso/providers/cognito.ts b/src/libs/better-auth/sso/providers/cognito.ts index 4bce703f25..0c172a0535 100644 --- a/src/libs/better-auth/sso/providers/cognito.ts +++ b/src/libs/better-auth/sso/providers/cognito.ts @@ -1,6 +1,6 @@ import { authEnv } from '@/envs/auth'; -import type { BuiltinProviderDefinition } from '../types'; +import { type BuiltinProviderDefinition } from '../types'; const provider: BuiltinProviderDefinition< { diff --git a/src/libs/better-auth/sso/providers/feishu.ts b/src/libs/better-auth/sso/providers/feishu.ts index a228080141..d763227b4c 100644 --- a/src/libs/better-auth/sso/providers/feishu.ts +++ b/src/libs/better-auth/sso/providers/feishu.ts @@ -1,6 +1,6 @@ import { authEnv } from '@/envs/auth'; -import type { GenericProviderDefinition } from '../types'; +import { type GenericProviderDefinition } from '../types'; const FEISHU_AUTHORIZATION_URL = 'https://accounts.feishu.cn/open-apis/authen/v1/authorize'; const FEISHU_TOKEN_URL = 'https://open.feishu.cn/open-apis/authen/v2/oauth/token'; diff --git a/src/libs/better-auth/sso/providers/generic-oidc.ts b/src/libs/better-auth/sso/providers/generic-oidc.ts index 3d785efaed..e675f07d13 100644 --- a/src/libs/better-auth/sso/providers/generic-oidc.ts +++ b/src/libs/better-auth/sso/providers/generic-oidc.ts @@ -1,7 +1,7 @@ import { authEnv } from '@/envs/auth'; import { buildOidcConfig } from '../helpers'; -import type { GenericProviderDefinition } from '../types'; +import { type GenericProviderDefinition } from '../types'; const provider: GenericProviderDefinition<{ AUTH_GENERIC_OIDC_ID: string; diff --git a/src/libs/better-auth/sso/providers/github.ts b/src/libs/better-auth/sso/providers/github.ts index 5b636f168b..62456044b0 100644 --- a/src/libs/better-auth/sso/providers/github.ts +++ b/src/libs/better-auth/sso/providers/github.ts @@ -1,6 +1,6 @@ import { authEnv } from '@/envs/auth'; -import type { BuiltinProviderDefinition } from '../types'; +import { type BuiltinProviderDefinition } from '../types'; const provider: BuiltinProviderDefinition< { diff --git a/src/libs/better-auth/sso/providers/google.ts b/src/libs/better-auth/sso/providers/google.ts index c2b52a0215..5089f395c3 100644 --- a/src/libs/better-auth/sso/providers/google.ts +++ b/src/libs/better-auth/sso/providers/google.ts @@ -1,6 +1,6 @@ import { authEnv } from '@/envs/auth'; -import type { BuiltinProviderDefinition } from '../types'; +import { type BuiltinProviderDefinition } from '../types'; const provider: BuiltinProviderDefinition< { diff --git a/src/libs/better-auth/sso/providers/keycloak.ts b/src/libs/better-auth/sso/providers/keycloak.ts index 94c0cc085f..726c4fbc2f 100644 --- a/src/libs/better-auth/sso/providers/keycloak.ts +++ b/src/libs/better-auth/sso/providers/keycloak.ts @@ -1,7 +1,7 @@ import { authEnv } from '@/envs/auth'; import { buildOidcConfig } from '../helpers'; -import type { GenericProviderDefinition } from '../types'; +import { type GenericProviderDefinition } from '../types'; const provider: GenericProviderDefinition<{ AUTH_KEYCLOAK_ID: string; diff --git a/src/libs/better-auth/sso/providers/logto.ts b/src/libs/better-auth/sso/providers/logto.ts index c0c7fc9dec..b5a2b34862 100644 --- a/src/libs/better-auth/sso/providers/logto.ts +++ b/src/libs/better-auth/sso/providers/logto.ts @@ -1,7 +1,7 @@ import { authEnv } from '@/envs/auth'; import { buildOidcConfig } from '../helpers'; -import type { GenericProviderDefinition } from '../types'; +import { type GenericProviderDefinition } from '../types'; const provider: GenericProviderDefinition<{ AUTH_LOGTO_ID: string; diff --git a/src/libs/better-auth/sso/providers/microsoft.ts b/src/libs/better-auth/sso/providers/microsoft.ts index 782d144ec6..dabbbd361f 100644 --- a/src/libs/better-auth/sso/providers/microsoft.ts +++ b/src/libs/better-auth/sso/providers/microsoft.ts @@ -1,6 +1,6 @@ import { authEnv } from '@/envs/auth'; -import type { BuiltinProviderDefinition } from '../types'; +import { type BuiltinProviderDefinition } from '../types'; type MicrosoftEnv = { AUTH_MICROSOFT_AUTHORITY_URL?: string; diff --git a/src/libs/better-auth/sso/providers/okta.ts b/src/libs/better-auth/sso/providers/okta.ts index 390d273b41..2b4789fbcf 100644 --- a/src/libs/better-auth/sso/providers/okta.ts +++ b/src/libs/better-auth/sso/providers/okta.ts @@ -1,7 +1,7 @@ import { authEnv } from '@/envs/auth'; import { buildOidcConfig } from '../helpers'; -import type { GenericProviderDefinition } from '../types'; +import { type GenericProviderDefinition } from '../types'; const provider: GenericProviderDefinition<{ AUTH_OKTA_ID: string; diff --git a/src/libs/better-auth/sso/providers/wechat.ts b/src/libs/better-auth/sso/providers/wechat.ts index 0a3af1d887..04835d9467 100644 --- a/src/libs/better-auth/sso/providers/wechat.ts +++ b/src/libs/better-auth/sso/providers/wechat.ts @@ -1,6 +1,6 @@ import { authEnv } from '@/envs/auth'; -import type { GenericProviderDefinition } from '../types'; +import { type GenericProviderDefinition } from '../types'; const WECHAT_AUTHORIZATION_URL = 'https://open.weixin.qq.com/connect/qrconnect'; const WECHAT_TOKEN_URL = 'https://api.weixin.qq.com/sns/oauth2/access_token'; @@ -43,7 +43,7 @@ const provider: GenericProviderDefinition<{ * and returns openid/unionid alongside tokens, so we exchange the code * manually instead of proxying through a custom API route. */ -getToken: async ({ code }) => { + getToken: async ({ code }) => { const tokenUrl = new URL(WECHAT_TOKEN_URL); tokenUrl.searchParams.set('appid', clientId); tokenUrl.searchParams.set('secret', clientSecret); @@ -74,11 +74,11 @@ getToken: async ({ code }) => { tokenType: data.token_type ?? 'Bearer', }; }, - + /** * Use openid/unionid returned in the token response; no custom scope encoding needed. */ -getUserInfo: async (tokens) => { + getUserInfo: async (tokens) => { const accessToken = tokens.accessToken; const openId = (tokens as { raw?: WeChatTokenResponse }).raw?.openid; const unionId = (tokens as { raw?: WeChatTokenResponse }).raw?.unionid; @@ -115,7 +115,7 @@ getUserInfo: async (tokens) => { ...profile, }; }, - + pkce: false, providerId: 'wechat', diff --git a/src/libs/better-auth/sso/providers/zitadel.ts b/src/libs/better-auth/sso/providers/zitadel.ts index 5d5933abd2..97e057e7d6 100644 --- a/src/libs/better-auth/sso/providers/zitadel.ts +++ b/src/libs/better-auth/sso/providers/zitadel.ts @@ -1,7 +1,7 @@ import { authEnv } from '@/envs/auth'; import { buildOidcConfig } from '../helpers'; -import type { GenericProviderDefinition } from '../types'; +import { type GenericProviderDefinition } from '../types'; type ZitadelEnv = { AUTH_ZITADEL_ID?: string; diff --git a/src/libs/better-auth/sso/types.ts b/src/libs/better-auth/sso/types.ts index 8ff2ec0e69..d6cbe3e1ab 100644 --- a/src/libs/better-auth/sso/types.ts +++ b/src/libs/better-auth/sso/types.ts @@ -1,5 +1,5 @@ -import type { GenericOAuthConfig } from 'better-auth/plugins'; -import type { SocialProviders } from 'better-auth/social-providers'; +import { type GenericOAuthConfig } from 'better-auth/plugins'; +import { type SocialProviders } from 'better-auth/social-providers'; export type BuiltinProviderDefinition< E extends Record, diff --git a/src/libs/langchain/loaders/code/index.ts b/src/libs/langchain/loaders/code/index.ts index 523bb81077..27ca2a7c9e 100644 --- a/src/libs/langchain/loaders/code/index.ts +++ b/src/libs/langchain/loaders/code/index.ts @@ -1,7 +1,5 @@ -import type {SupportedTextSplitterLanguage} from 'langchain/text_splitter'; -import { - RecursiveCharacterTextSplitter -} from 'langchain/text_splitter'; +import { type SupportedTextSplitterLanguage } from 'langchain/text_splitter'; +import { RecursiveCharacterTextSplitter } from 'langchain/text_splitter'; import { loaderConfig } from '@/libs/langchain/loaders/config'; diff --git a/src/libs/langchain/loaders/index.ts b/src/libs/langchain/loaders/index.ts index feb7e936f5..78ec7f0bd2 100644 --- a/src/libs/langchain/loaders/index.ts +++ b/src/libs/langchain/loaders/index.ts @@ -1,10 +1,8 @@ -import type {SupportedTextSplitterLanguage} from 'langchain/text_splitter'; -import { - SupportedTextSplitterLanguages -} from 'langchain/text_splitter'; +import { type SupportedTextSplitterLanguage } from 'langchain/text_splitter'; +import { SupportedTextSplitterLanguages } from 'langchain/text_splitter'; import { LANGCHAIN_SUPPORT_TEXT_LIST } from '@/libs/langchain/file'; -import type {LangChainLoaderType} from '@/libs/langchain/types'; +import { type LangChainLoaderType } from '@/libs/langchain/types'; import { CodeLoader } from './code'; import { CsVLoader } from './csv'; diff --git a/src/libs/mcp/client.ts b/src/libs/mcp/client.ts index 008902ed3b..442318dff5 100644 --- a/src/libs/mcp/client.ts +++ b/src/libs/mcp/client.ts @@ -6,14 +6,19 @@ import { StdioClientTransport, } from '@modelcontextprotocol/sdk/client/stdio.js'; import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js'; -import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.d.ts'; -import type { Progress } from '@modelcontextprotocol/sdk/types.js'; +import { type Transport } from '@modelcontextprotocol/sdk/shared/transport.d.ts'; +import { type Progress } from '@modelcontextprotocol/sdk/types.js'; import debug from 'debug'; -import type {MCPClientParams, MCPError, McpPrompt, McpResource, McpTool, ToolCallResult} from './types'; import { - createMCPError + type MCPClientParams, + type MCPError, + type McpPrompt, + type McpResource, + type McpTool, + type ToolCallResult, } from './types'; +import { createMCPError } from './types'; const log = debug('lobe-mcp:client'); // MCP tool call timeout (milliseconds), configurable via the environment variable MCP_TOOL_TIMEOUT, default is 60000 diff --git a/src/libs/next/config/define-config.ts b/src/libs/next/config/define-config.ts index 4a14c0e48b..e0d05b364d 100644 --- a/src/libs/next/config/define-config.ts +++ b/src/libs/next/config/define-config.ts @@ -1,8 +1,8 @@ import analyzer from '@next/bundle-analyzer'; import withSerwistInit from '@serwist/next'; import { codeInspectorPlugin } from 'code-inspector-plugin'; -import type { NextConfig } from 'next'; -import type { Header, Redirect } from 'next/dist/lib/load-custom-routes'; +import { type NextConfig } from 'next'; +import { type Header, type Redirect } from 'next/dist/lib/load-custom-routes'; import ReactComponentName from 'react-scan/react-component-name/webpack'; interface CustomNextConfig { diff --git a/src/libs/next/proxy/createRouteMatcher.test.ts b/src/libs/next/proxy/createRouteMatcher.test.ts index 427ff30183..8a9bfbd285 100644 --- a/src/libs/next/proxy/createRouteMatcher.test.ts +++ b/src/libs/next/proxy/createRouteMatcher.test.ts @@ -1,4 +1,4 @@ -import type {NextRequest} from 'next/server'; +import { type NextRequest } from 'next/server'; import { describe, expect, it } from 'vitest'; import { createRouteMatcher } from './createRouteMatcher'; @@ -57,7 +57,6 @@ describe('createRouteMatcher', () => { expect(matcher(createMockRequest('/trpc/user.get'))).toBe(true); expect(matcher(createMockRequest('/trpc/chat.create'))).toBe(true); }); - }); describe('multiple patterns', () => { diff --git a/src/libs/next/proxy/createRouteMatcher.ts b/src/libs/next/proxy/createRouteMatcher.ts index 7d1fce790f..57fbb5e95d 100644 --- a/src/libs/next/proxy/createRouteMatcher.ts +++ b/src/libs/next/proxy/createRouteMatcher.ts @@ -1,4 +1,4 @@ -import type {NextRequest} from 'next/server'; +import { type NextRequest } from 'next/server'; /** * Creates a route matcher function that checks if a request path matches any of the given patterns diff --git a/src/libs/next/proxy/define-config.ts b/src/libs/next/proxy/define-config.ts index 10007eeccd..262c1dee7e 100644 --- a/src/libs/next/proxy/define-config.ts +++ b/src/libs/next/proxy/define-config.ts @@ -1,6 +1,6 @@ import debug from 'debug'; -import type {NextRequest} from 'next/server'; -import { NextResponse } from 'next/server'; +import { type NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; import { UAParser } from 'ua-parser-js'; import urlJoin from 'url-join'; @@ -9,7 +9,7 @@ import { LOBE_LOCALE_COOKIE } from '@/const/locale'; import { isDesktop } from '@/const/version'; import { appEnv } from '@/envs/app'; import { authEnv } from '@/envs/auth'; -import type {Locales} from '@/locales/resources'; +import { type Locales } from '@/locales/resources'; import { parseBrowserLanguage } from '@/utils/locale'; import { RouteVariants } from '@/utils/server/routeVariants'; diff --git a/src/libs/observability/traceparent.test.ts b/src/libs/observability/traceparent.test.ts index bf0790a867..a761ae8a1c 100644 --- a/src/libs/observability/traceparent.test.ts +++ b/src/libs/observability/traceparent.test.ts @@ -1,4 +1,4 @@ -import type { Mock } from 'vitest'; +import { type Mock } from 'vitest'; import { afterEach, describe, expect, it, vi } from 'vitest'; // eslint-disable-next-line import/first diff --git a/src/libs/observability/traceparent.ts b/src/libs/observability/traceparent.ts index 81a527a1f9..0e9be0919e 100644 --- a/src/libs/observability/traceparent.ts +++ b/src/libs/observability/traceparent.ts @@ -1,4 +1,8 @@ -import type { Context as OtContext, Span, TextMapGetter } from '@lobechat/observability-otel/api'; +import { + type Context as OtContext, + type Span, + type TextMapGetter, +} from '@lobechat/observability-otel/api'; import { context as otContext, propagation, trace } from '@lobechat/observability-otel/api'; // NOTICE: do not try to optimize this into .repeat(...) or similar, diff --git a/src/libs/oidc-provider/adapter.ts b/src/libs/oidc-provider/adapter.ts index ec6fb89625..4e5a604b3b 100644 --- a/src/libs/oidc-provider/adapter.ts +++ b/src/libs/oidc-provider/adapter.ts @@ -1,4 +1,4 @@ -import type {LobeChatDatabase} from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { oidcAccessTokens, oidcAuthorizationCodes, diff --git a/src/libs/oidc-provider/config.ts b/src/libs/oidc-provider/config.ts index d08f2bf230..ddee452962 100644 --- a/src/libs/oidc-provider/config.ts +++ b/src/libs/oidc-provider/config.ts @@ -1,4 +1,4 @@ -import type {ClientMetadata} from 'oidc-provider'; +import { type ClientMetadata } from 'oidc-provider'; import urlJoin from 'url-join'; import { appEnv } from '@/envs/app'; diff --git a/src/libs/oidc-provider/http-adapter.ts b/src/libs/oidc-provider/http-adapter.ts index ec022fa80c..a5e0d15bce 100644 --- a/src/libs/oidc-provider/http-adapter.ts +++ b/src/libs/oidc-provider/http-adapter.ts @@ -1,8 +1,8 @@ -import type {IncomingMessage, ServerResponse} from 'node:http'; +import { type IncomingMessage, type ServerResponse } from 'node:http'; import debug from 'debug'; import { cookies } from 'next/headers'; -import type {NextRequest} from 'next/server'; +import { type NextRequest } from 'next/server'; import urlJoin from 'url-join'; import { appEnv } from '@/envs/app'; diff --git a/src/libs/oidc-provider/provider.ts b/src/libs/oidc-provider/provider.ts index 8db1821a30..7a0de5452f 100644 --- a/src/libs/oidc-provider/provider.ts +++ b/src/libs/oidc-provider/provider.ts @@ -1,7 +1,7 @@ -import type {LobeChatDatabase} from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import debug from 'debug'; -import type {Configuration, KoaContextWithOIDC} from 'oidc-provider'; -import Provider, { errors } from 'oidc-provider'; +import { type Configuration, type KoaContextWithOIDC } from 'oidc-provider'; +import Provider, { errors } from 'oidc-provider'; import urlJoin from 'url-join'; import { serverDBEnv } from '@/config/db'; diff --git a/src/libs/pdfjs/index.tsx b/src/libs/pdfjs/index.tsx index 63cff1dee1..9e4fd3e38b 100644 --- a/src/libs/pdfjs/index.tsx +++ b/src/libs/pdfjs/index.tsx @@ -1,7 +1,7 @@ 'use client'; -import type { ComponentProps } from 'react'; -import type { Page as PdfPage} from 'react-pdf'; +import { type ComponentProps } from 'react'; +import { type Page as PdfPage } from 'react-pdf'; import { Document as PdfDocument, pdfjs } from 'react-pdf'; const workerSrc = `https://registry.npmmirror.com/pdfjs-dist/${pdfjs.version}/files/build/pdf.worker.min.mjs`; @@ -20,7 +20,4 @@ export const Document = (props: DocumentProps) => { return ; }; - - - -export {Page, pdfjs} from 'react-pdf'; \ No newline at end of file +export { Page, pdfjs } from 'react-pdf'; diff --git a/src/libs/redis/manager.test.ts b/src/libs/redis/manager.test.ts index 1ae37e8794..70e7e6962d 100644 --- a/src/libs/redis/manager.test.ts +++ b/src/libs/redis/manager.test.ts @@ -1,7 +1,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest'; import { initializeRedis, RedisManager, resetRedisClient } from './manager'; -import type { RedisConfig } from './types'; +import { type RedisConfig } from './types'; const { mockIoRedisInitialize, mockIoRedisDisconnect } = vi.hoisted(() => ({ mockIoRedisInitialize: vi.fn().mockResolvedValue(undefined), diff --git a/src/libs/redis/manager.ts b/src/libs/redis/manager.ts index 4f49744878..8723aeb69d 100644 --- a/src/libs/redis/manager.ts +++ b/src/libs/redis/manager.ts @@ -1,5 +1,5 @@ import { IoRedisRedisProvider } from './redis'; -import type {BaseRedisProvider, RedisConfig} from './types'; +import { type BaseRedisProvider, type RedisConfig } from './types'; export const isRedisDisabledByEnv = () => !!process.env.DISABLE_REDIS; diff --git a/src/libs/redis/redis.test.ts b/src/libs/redis/redis.test.ts index beaf7947b5..c1d8ebc0fa 100644 --- a/src/libs/redis/redis.test.ts +++ b/src/libs/redis/redis.test.ts @@ -1,6 +1,6 @@ import { afterEach, describe, expect, it, vi } from 'vitest'; -import type { RedisConfig } from './types'; +import { type RedisConfig } from './types'; const buildRedisConfig = (): RedisConfig | null => { const url = process.env.REDIS_URL; diff --git a/src/libs/redis/redis.ts b/src/libs/redis/redis.ts index 23d8e8fa1a..312f90b1cc 100644 --- a/src/libs/redis/redis.ts +++ b/src/libs/redis/redis.ts @@ -1,7 +1,15 @@ import debug from 'debug'; -import type { Redis } from 'ioredis'; +import { type Redis } from 'ioredis'; -import type {BaseRedisProvider, RedisConfig, RedisKey, RedisMSetArgument, RedisSetResult, RedisValue, SetOptions} from './types'; +import { + type BaseRedisProvider, + type RedisConfig, + type RedisKey, + type RedisMSetArgument, + type RedisSetResult, + type RedisValue, + type SetOptions, +} from './types'; import { buildIORedisSetArgs, normalizeMsetValues } from './utils'; const log = debug('lobe:redis'); diff --git a/src/libs/redis/utils.ts b/src/libs/redis/utils.ts index b5674fc436..65a7bb0c58 100644 --- a/src/libs/redis/utils.ts +++ b/src/libs/redis/utils.ts @@ -1,4 +1,4 @@ -import type {RedisKey, RedisMSetArgument, RedisValue, SetOptions} from './types'; +import { type RedisKey, type RedisMSetArgument, type RedisValue, type SetOptions } from './types'; export const normalizeRedisKey = (key: RedisKey) => typeof key === 'string' ? key : key.toString(); diff --git a/src/libs/router/Link.tsx b/src/libs/router/Link.tsx index 94644f5dab..c4c92e7a3b 100644 --- a/src/libs/router/Link.tsx +++ b/src/libs/router/Link.tsx @@ -5,8 +5,8 @@ * @see RFC 147 */ import React, { memo } from 'react'; -import type {LinkProps as ReactRouterLinkProps} from 'react-router-dom'; -import { Link as ReactRouterLink } from 'react-router-dom'; +import { type LinkProps as ReactRouterLinkProps } from 'react-router-dom'; +import { Link as ReactRouterLink } from 'react-router-dom'; interface LinkProps extends Omit { children?: React.ReactNode; diff --git a/src/libs/swr/index.ts b/src/libs/swr/index.ts index 34df161022..f4cfc4a05d 100644 --- a/src/libs/swr/index.ts +++ b/src/libs/swr/index.ts @@ -1,4 +1,4 @@ -import type {SWRHook} from 'swr'; +import { type SWRHook } from 'swr'; import useSWR from 'swr'; /** diff --git a/src/libs/swr/mutate.ts b/src/libs/swr/mutate.ts index 87e10333fd..9c8549843b 100644 --- a/src/libs/swr/mutate.ts +++ b/src/libs/swr/mutate.ts @@ -18,7 +18,7 @@ * import { mutate } from '@/libs/swr'; * ``` */ -import type { ScopedMutator } from 'swr/_internal'; +import { type ScopedMutator } from 'swr/_internal'; // Mutable container to hold the scoped mutate reference // Using an object allows us to update the reference while keeping the same export diff --git a/src/libs/swr/useClientDataSWRWithSync.ts b/src/libs/swr/useClientDataSWRWithSync.ts index f58e2268c7..89be72a019 100644 --- a/src/libs/swr/useClientDataSWRWithSync.ts +++ b/src/libs/swr/useClientDataSWRWithSync.ts @@ -6,7 +6,7 @@ */ import { useEffect, useRef } from 'react'; -import type { SWRConfiguration, SWRResponse } from 'swr'; +import { type SWRConfiguration, type SWRResponse } from 'swr'; import { useClientDataSWR } from './index'; diff --git a/src/libs/traces/event.test.ts b/src/libs/traces/event.test.ts index e60e274cd9..4dacef99d2 100644 --- a/src/libs/traces/event.test.ts +++ b/src/libs/traces/event.test.ts @@ -1,6 +1,6 @@ import { TraceEventType } from '@lobechat/types'; import { diffChars } from 'diff'; -import type { LangfuseTraceClient } from 'langfuse-core'; +import { type LangfuseTraceClient } from 'langfuse-core'; import { describe, expect, it } from 'vitest'; import { EventScore, TraceEventClient } from './event'; diff --git a/src/libs/traces/event.ts b/src/libs/traces/event.ts index 23ed1517a9..f2067214a8 100644 --- a/src/libs/traces/event.ts +++ b/src/libs/traces/event.ts @@ -1,8 +1,14 @@ import { TraceEventType } from '@lobechat/types'; import { diffChars } from 'diff'; -import type {LangfuseTraceClient} from 'langfuse-core'; +import { type LangfuseTraceClient } from 'langfuse-core'; -import type {TraceEventBasePayload, TraceEventCopyMessage, TraceEventDeleteAndRegenerateMessage, TraceEventModifyMessage, TraceEventRegenerateMessage} from '@/types/trace'; +import { + type TraceEventBasePayload, + type TraceEventCopyMessage, + type TraceEventDeleteAndRegenerateMessage, + type TraceEventModifyMessage, + type TraceEventRegenerateMessage, +} from '@/types/trace'; /** * trace 事件得分 diff --git a/src/libs/traces/index.test.ts b/src/libs/traces/index.test.ts index 3bfb6975fa..74d41476f5 100644 --- a/src/libs/traces/index.test.ts +++ b/src/libs/traces/index.test.ts @@ -1,6 +1,6 @@ // @vitest-environment node import { Langfuse } from 'langfuse'; -import type { CreateLangfuseTraceBody } from 'langfuse-core'; +import { type CreateLangfuseTraceBody } from 'langfuse-core'; import { describe, expect, it, vi } from 'vitest'; import * as server from '@/envs/langfuse'; diff --git a/src/libs/traces/index.ts b/src/libs/traces/index.ts index df5fcc2fd8..cc813e8d5a 100644 --- a/src/libs/traces/index.ts +++ b/src/libs/traces/index.ts @@ -1,6 +1,6 @@ import { CURRENT_VERSION } from '@lobechat/const'; import { Langfuse } from 'langfuse'; -import type {CreateLangfuseTraceBody} from 'langfuse-core'; +import { type CreateLangfuseTraceBody } from 'langfuse-core'; import { getLangfuseConfig } from '@/envs/langfuse'; import { TraceEventClient } from '@/libs/traces/event'; diff --git a/src/libs/trpc/async/asyncAuth.ts b/src/libs/trpc/async/asyncAuth.ts index 29c28417d7..5ab6d768a0 100644 --- a/src/libs/trpc/async/asyncAuth.ts +++ b/src/libs/trpc/async/asyncAuth.ts @@ -1,4 +1,4 @@ -import type {LobeChatDatabase} from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { TRPCError } from '@trpc/server'; import debug from 'debug'; diff --git a/src/libs/trpc/async/context.ts b/src/libs/trpc/async/context.ts index 0040a57a9f..84b0e94449 100644 --- a/src/libs/trpc/async/context.ts +++ b/src/libs/trpc/async/context.ts @@ -1,6 +1,6 @@ -import type {LobeChatDatabase} from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import debug from 'debug'; -import type {NextRequest} from 'next/server'; +import { type NextRequest } from 'next/server'; import { LOBE_CHAT_AUTH_HEADER } from '@/envs/auth'; import { KeyVaultsGateKeeper } from '@/server/modules/KeyVaultsEncrypt'; diff --git a/src/libs/trpc/async/init.ts b/src/libs/trpc/async/init.ts index 2033602054..cdabb4c66f 100644 --- a/src/libs/trpc/async/init.ts +++ b/src/libs/trpc/async/init.ts @@ -2,7 +2,7 @@ import { initTRPC } from '@trpc/server'; import debug from 'debug'; import superjson from 'superjson'; -import type {AsyncContext} from './context'; +import { type AsyncContext } from './context'; const log = debug('lobe-async:init'); diff --git a/src/libs/trpc/client/async.ts b/src/libs/trpc/client/async.ts index 37e17427a8..642708f4de 100644 --- a/src/libs/trpc/client/async.ts +++ b/src/libs/trpc/client/async.ts @@ -2,7 +2,7 @@ import { createTRPCClient, httpBatchLink } from '@trpc/client'; import superjson from 'superjson'; import { withElectronProtocolIfElectron } from '@/const/protocol'; -import type {AsyncRouter} from '@/server/routers/async'; +import { type AsyncRouter } from '@/server/routers/async'; export const asyncClient = createTRPCClient({ links: [ diff --git a/src/libs/trpc/client/lambda.ts b/src/libs/trpc/client/lambda.ts index 55ff6d7514..8698d81490 100644 --- a/src/libs/trpc/client/lambda.ts +++ b/src/libs/trpc/client/lambda.ts @@ -1,14 +1,14 @@ -import type {TRPCLink} from '@trpc/client'; +import { type TRPCLink } from '@trpc/client'; import { createTRPCClient, httpBatchLink, httpLink, splitLink } from '@trpc/client'; import { createTRPCReact } from '@trpc/react-query'; import { observable } from '@trpc/server/observable'; import debug from 'debug'; -import type {ModelProvider} from 'model-bank'; +import { type ModelProvider } from 'model-bank'; import superjson from 'superjson'; import { withElectronProtocolIfElectron } from '@/const/protocol'; import { isDesktop } from '@/const/version'; -import type { LambdaRouter } from '@/server/routers/lambda'; +import { type LambdaRouter } from '@/server/routers/lambda'; const log = debug('lobe-image:lambda-client'); @@ -76,23 +76,20 @@ const errorHandlingLink: TRPCLink = () => { // 2. Shared link options const linkOptions = { - fetch: async (input: RequestInfo | URL, init?: RequestInit) => { // Ensure credentials are included to send cookies (like mp_token) - + const fetchOptions: RequestInit = { ...init, credentials: 'include', }; if (isDesktop) { - const res = await fetch(input as string, fetchOptions); if (res) return res; } - return await fetch(input, fetchOptions); }, headers: async () => { diff --git a/src/libs/trpc/client/tools.ts b/src/libs/trpc/client/tools.ts index 792d106825..71d4ea7678 100644 --- a/src/libs/trpc/client/tools.ts +++ b/src/libs/trpc/client/tools.ts @@ -2,7 +2,7 @@ import { createTRPCClient, httpBatchLink } from '@trpc/client'; import superjson from 'superjson'; import { withElectronProtocolIfElectron } from '@/const/protocol'; -import type { ToolsRouter } from '@/server/routers/tools'; +import { type ToolsRouter } from '@/server/routers/tools'; export const toolsClient = createTRPCClient({ links: [ diff --git a/src/libs/trpc/lambda/context.ts b/src/libs/trpc/lambda/context.ts index d512dc5871..fd9a6cf2ed 100644 --- a/src/libs/trpc/lambda/context.ts +++ b/src/libs/trpc/lambda/context.ts @@ -1,11 +1,11 @@ -import type { Context as OtContext } from '@lobechat/observability-otel/api'; -import type {ClientSecretPayload} from '@lobechat/types'; +import { type Context as OtContext } from '@lobechat/observability-otel/api'; +import { type ClientSecretPayload } from '@lobechat/types'; import { parse } from 'cookie'; import debug from 'debug'; -import type {NextRequest} from 'next/server'; +import { type NextRequest } from 'next/server'; import { auth } from '@/auth'; -import { authEnv,LOBE_CHAT_AUTH_HEADER, LOBE_CHAT_OIDC_AUTH_HEADER } from '@/envs/auth'; +import { authEnv, LOBE_CHAT_AUTH_HEADER, LOBE_CHAT_OIDC_AUTH_HEADER } from '@/envs/auth'; import { extractTraceContext } from '@/libs/observability/traceparent'; import { validateOIDCJWT } from '@/libs/oidc-provider/jwt'; @@ -145,9 +145,9 @@ export const createLambdaContext = async (request: NextRequest): Promise().create({ /** diff --git a/src/libs/trpc/lambda/middleware/marketSDK.ts b/src/libs/trpc/lambda/middleware/marketSDK.ts index 1944d48660..01c7427351 100644 --- a/src/libs/trpc/lambda/middleware/marketSDK.ts +++ b/src/libs/trpc/lambda/middleware/marketSDK.ts @@ -1,4 +1,4 @@ -import type {TrustedClientUserInfo} from '@/libs/trusted-client'; +import { type TrustedClientUserInfo } from '@/libs/trusted-client'; import { MarketService } from '@/server/services/market'; import { trpc } from '../init'; diff --git a/src/libs/trpc/lambda/middleware/marketUserInfo.ts b/src/libs/trpc/lambda/middleware/marketUserInfo.ts index 0adac0c35c..bc8a7af3b1 100644 --- a/src/libs/trpc/lambda/middleware/marketUserInfo.ts +++ b/src/libs/trpc/lambda/middleware/marketUserInfo.ts @@ -1,7 +1,7 @@ -import type { LobeChatDatabase } from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { UserModel } from '@/database/models/user'; -import type { TrustedClientUserInfo } from '@/libs/trusted-client'; +import { type TrustedClientUserInfo } from '@/libs/trusted-client'; import { trpc } from '../init'; diff --git a/src/libs/trpc/lambda/middleware/telemetry.test.ts b/src/libs/trpc/lambda/middleware/telemetry.test.ts index 1d0319c519..67c5558f5d 100644 --- a/src/libs/trpc/lambda/middleware/telemetry.test.ts +++ b/src/libs/trpc/lambda/middleware/telemetry.test.ts @@ -3,7 +3,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { appEnv } from '@/envs/app'; -import type {TelemetryContext } from './telemetry'; +import { type TelemetryContext } from './telemetry'; import { checkTelemetryEnabled } from './telemetry'; const { mockGetUserSettings, mockGetUserPreference, MockUserModel } = vi.hoisted(() => { diff --git a/src/libs/trpc/lambda/middleware/telemetry.ts b/src/libs/trpc/lambda/middleware/telemetry.ts index a9953f6ed2..7c896b2268 100644 --- a/src/libs/trpc/lambda/middleware/telemetry.ts +++ b/src/libs/trpc/lambda/middleware/telemetry.ts @@ -1,5 +1,5 @@ -import type { LobeChatDatabase } from '@lobechat/database'; -import type { UserGeneralConfig } from '@lobechat/types'; +import { type LobeChatDatabase } from '@lobechat/database'; +import { type UserGeneralConfig } from '@lobechat/types'; import { UserModel } from '@/database/models/user'; import { appEnv } from '@/envs/app'; diff --git a/src/libs/trpc/middleware/openTelemetry.ts b/src/libs/trpc/middleware/openTelemetry.ts index c2ba242d93..da0af45b8c 100644 --- a/src/libs/trpc/middleware/openTelemetry.ts +++ b/src/libs/trpc/middleware/openTelemetry.ts @@ -1,6 +1,6 @@ import { env } from 'node:process'; -import type { Attributes, Span } from '@lobechat/observability-otel/api'; +import { type Attributes, type Span } from '@lobechat/observability-otel/api'; import { context, diag, SpanKind, SpanStatusCode, trace } from '@lobechat/observability-otel/api'; import { ATTR_ERROR_TYPE, diff --git a/src/libs/trpc/middleware/userAuth.test.ts b/src/libs/trpc/middleware/userAuth.test.ts index d4142db8a2..2345b06c86 100644 --- a/src/libs/trpc/middleware/userAuth.test.ts +++ b/src/libs/trpc/middleware/userAuth.test.ts @@ -2,7 +2,7 @@ import { TRPCError } from '@trpc/server'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { createCallerFactory } from '@/libs/trpc/lambda'; -import type { AuthContext} from '@/libs/trpc/lambda/context'; +import { type AuthContext } from '@/libs/trpc/lambda/context'; import { createContextInner } from '@/libs/trpc/lambda/context'; import { trpc } from '../lambda/init'; diff --git a/src/libs/trpc/utils/request-adapter.ts b/src/libs/trpc/utils/request-adapter.ts index 5e50576905..5db6fbd07e 100644 --- a/src/libs/trpc/utils/request-adapter.ts +++ b/src/libs/trpc/utils/request-adapter.ts @@ -1,4 +1,4 @@ -import type {NextRequest} from 'next/server'; +import { type NextRequest } from 'next/server'; /** * Prepare Request object for tRPC fetchRequestHandler diff --git a/src/libs/trpc/utils/responseMeta.ts b/src/libs/trpc/utils/responseMeta.ts index 804379a052..c11900d1f8 100644 --- a/src/libs/trpc/utils/responseMeta.ts +++ b/src/libs/trpc/utils/responseMeta.ts @@ -1,5 +1,5 @@ import { AUTH_REQUIRED_HEADER, TRPC_ERROR_CODE_UNAUTHORIZED } from '@lobechat/desktop-bridge'; -import type { TRPCError } from '@trpc/server'; +import { type TRPCError } from '@trpc/server'; interface ResponseMetaParams { ctx?: unknown; @@ -22,8 +22,7 @@ export function createResponseMeta({ ctx, errors }: ResponseMetaParams): { } { const resHeaders = ctx && typeof ctx === 'object' && 'resHeaders' in ctx - ? - (ctx as { resHeaders?: HeadersInit }).resHeaders + ? (ctx as { resHeaders?: HeadersInit }).resHeaders : undefined; const headers = resHeaders ? new Headers(resHeaders) : new Headers(); diff --git a/src/libs/trusted-client/getSessionUser.ts b/src/libs/trusted-client/getSessionUser.ts index c80a26cd45..abd24a1923 100644 --- a/src/libs/trusted-client/getSessionUser.ts +++ b/src/libs/trusted-client/getSessionUser.ts @@ -1,6 +1,6 @@ import { headers } from 'next/headers'; -import type { TrustedClientUserInfo } from './index'; +import { type TrustedClientUserInfo } from './index'; /** * Get user info from the current session for trusted client authentication diff --git a/src/server/globalConfig/genServerAiProviderConfig.ts b/src/server/globalConfig/genServerAiProviderConfig.ts index 8874c9c033..7c0f2f2a5c 100644 --- a/src/server/globalConfig/genServerAiProviderConfig.ts +++ b/src/server/globalConfig/genServerAiProviderConfig.ts @@ -1,6 +1,6 @@ -import type {ProviderConfig} from '@lobechat/types'; -import type {AiFullModelCard} from 'model-bank'; -import { ModelProvider } from 'model-bank'; +import { type ProviderConfig } from '@lobechat/types'; +import { type AiFullModelCard } from 'model-bank'; +import { ModelProvider } from 'model-bank'; import * as AiModels from 'model-bank'; import { getLLMConfig } from '@/envs/llm'; diff --git a/src/server/globalConfig/index.test.ts b/src/server/globalConfig/index.test.ts index ab4ebee5e7..3c5715b2b1 100644 --- a/src/server/globalConfig/index.test.ts +++ b/src/server/globalConfig/index.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it, vi } from 'vitest'; import { getAppConfig } from '@/envs/app'; -import type { SystemEmbeddingConfig } from '@/types/knowledgeBase'; -import type { FilesConfigItem } from '@/types/user/settings/filesConfig'; +import { type SystemEmbeddingConfig } from '@/types/knowledgeBase'; +import { type FilesConfigItem } from '@/types/user/settings/filesConfig'; import { getServerDefaultAgentConfig, getServerDefaultFilesConfig } from './index'; import { parseAgentConfig } from './parseDefaultAgent'; diff --git a/src/server/globalConfig/index.ts b/src/server/globalConfig/index.ts index 158dd7b072..ae6c2c553c 100644 --- a/src/server/globalConfig/index.ts +++ b/src/server/globalConfig/index.ts @@ -10,7 +10,7 @@ import { knowledgeEnv } from '@/envs/knowledge'; import { langfuseEnv } from '@/envs/langfuse'; import { parseSSOProviders } from '@/libs/better-auth/utils/server'; import { parseSystemAgent } from '@/server/globalConfig/parseSystemAgent'; -import type {GlobalServerConfig} from '@/types/serverConfig'; +import { type GlobalServerConfig } from '@/types/serverConfig'; import { cleanObject } from '@/utils/object'; import { genServerAiProvidersConfig } from './genServerAiProviderConfig'; diff --git a/src/server/globalConfig/parseFilesConfig.ts b/src/server/globalConfig/parseFilesConfig.ts index fb3623097c..0f836afeeb 100644 --- a/src/server/globalConfig/parseFilesConfig.ts +++ b/src/server/globalConfig/parseFilesConfig.ts @@ -1,6 +1,6 @@ import { DEFAULT_FILES_CONFIG } from '@/const/settings/knowledge'; -import type {SystemEmbeddingConfig} from '@/types/knowledgeBase'; -import type {FilesConfig} from '@/types/user/settings/filesConfig'; +import { type SystemEmbeddingConfig } from '@/types/knowledgeBase'; +import { type FilesConfig } from '@/types/user/settings/filesConfig'; const protectedKeys = Object.keys({ embedding_model: null, diff --git a/src/server/globalConfig/parseMemoryExtractionConfig.ts b/src/server/globalConfig/parseMemoryExtractionConfig.ts index aa8bd68bbb..266cd6f5a2 100644 --- a/src/server/globalConfig/parseMemoryExtractionConfig.ts +++ b/src/server/globalConfig/parseMemoryExtractionConfig.ts @@ -1,7 +1,12 @@ import { DEFAULT_MINI_PROVIDER } from '@lobechat/business-const'; import { DEFAULT_MINI_MODEL, DEFAULT_USER_MEMORY_EMBEDDING_MODEL_ITEM } from '@lobechat/const'; -import type {GlobalMemoryExtractionConfig, GlobalMemoryLayer, MemoryAgentPublicConfig, MemoryLayerExtractorPublicConfig} from '@/types/serverConfig'; +import { + type GlobalMemoryExtractionConfig, + type GlobalMemoryLayer, + type MemoryAgentPublicConfig, + type MemoryLayerExtractorPublicConfig, +} from '@/types/serverConfig'; const MEMORY_LAYERS: GlobalMemoryLayer[] = [ 'activity', diff --git a/src/server/globalConfig/parseSystemAgent.ts b/src/server/globalConfig/parseSystemAgent.ts index ec28487935..ea0d9e3bfb 100644 --- a/src/server/globalConfig/parseSystemAgent.ts +++ b/src/server/globalConfig/parseSystemAgent.ts @@ -1,5 +1,5 @@ import { DEFAULT_SYSTEM_AGENT_CONFIG } from '@/const/settings'; -import type {UserSystemAgentConfig} from '@/types/user/settings'; +import { type UserSystemAgentConfig } from '@/types/user/settings'; const protectedKeys = Object.keys(DEFAULT_SYSTEM_AGENT_CONFIG); diff --git a/src/server/ld.ts b/src/server/ld.ts index 4f0ce746b1..ae6e7a22aa 100644 --- a/src/server/ld.ts +++ b/src/server/ld.ts @@ -5,7 +5,7 @@ import urlJoin from 'url-join'; import { DEFAULT_LANG } from '@/const/locale'; import { OFFICIAL_SITE, OFFICIAL_URL } from '@/const/url'; -import type {Locales} from '@/locales/resources'; +import { type Locales } from '@/locales/resources'; import { getCanonicalUrl } from '@/server/utils/url'; import pkg from '../../package.json'; diff --git a/src/server/metadata.ts b/src/server/metadata.ts index dbdb62dc45..ea0bdf30c6 100644 --- a/src/server/metadata.ts +++ b/src/server/metadata.ts @@ -1,12 +1,12 @@ import { BRANDING_NAME, ORG_NAME } from '@lobechat/business-const'; -import type {Metadata} from 'next'; +import { type Metadata } from 'next'; import qs from 'query-string'; import { DEFAULT_LANG } from '@/const/locale'; import { OG_URL } from '@/const/url'; import { isCustomORG } from '@/const/version'; -import type {Locales} from '@/locales/resources'; -import { locales } from '@/locales/resources'; +import { type Locales } from '@/locales/resources'; +import { locales } from '@/locales/resources'; import { getCanonicalUrl } from '@/server/utils/url'; import { formatDescLength, formatTitleLength } from '@/utils/genOG'; @@ -32,9 +32,8 @@ export class Meta { type?: 'website' | 'article'; url: string; }): Metadata { - const formatedTitle = formatTitleLength(title, 21); - + const formatedDescription = formatDescLength(description, tags); const siteTitle = title.includes(BRANDING_NAME) ? title : title + ` · ${BRANDING_NAME}`; return { diff --git a/src/server/modules/AgentRuntime/AgentRuntimeCoordinator.ts b/src/server/modules/AgentRuntime/AgentRuntimeCoordinator.ts index 7dfcb495d1..6129fe3d2d 100644 --- a/src/server/modules/AgentRuntime/AgentRuntimeCoordinator.ts +++ b/src/server/modules/AgentRuntime/AgentRuntimeCoordinator.ts @@ -1,9 +1,9 @@ -import type {AgentState} from '@lobechat/agent-runtime'; +import { type AgentState } from '@lobechat/agent-runtime'; import debug from 'debug'; -import type {AgentOperationMetadata, StepResult} from './AgentStateManager'; +import { type AgentOperationMetadata, type StepResult } from './AgentStateManager'; import { createAgentStateManager, createStreamEventManager } from './factory'; -import type { IAgentStateManager, IStreamEventManager } from './types'; +import { type IAgentStateManager, type IStreamEventManager } from './types'; const log = debug('lobe-server:agent-runtime:coordinator'); diff --git a/src/server/modules/AgentRuntime/AgentStateManager.ts b/src/server/modules/AgentRuntime/AgentStateManager.ts index 4589fb94e6..d0d7c17a97 100644 --- a/src/server/modules/AgentRuntime/AgentStateManager.ts +++ b/src/server/modules/AgentRuntime/AgentStateManager.ts @@ -1,6 +1,10 @@ -import type {AgentEvent, AgentRuntimeContext, AgentState} from '@lobechat/agent-runtime'; +import { + type AgentEvent, + type AgentRuntimeContext, + type AgentState, +} from '@lobechat/agent-runtime'; import debug from 'debug'; -import type { Redis } from 'ioredis'; +import { type Redis } from 'ioredis'; import { getAgentRuntimeRedisClient } from './redis'; diff --git a/src/server/modules/AgentRuntime/InMemoryAgentStateManager.ts b/src/server/modules/AgentRuntime/InMemoryAgentStateManager.ts index 6940abcf7d..479c163acf 100644 --- a/src/server/modules/AgentRuntime/InMemoryAgentStateManager.ts +++ b/src/server/modules/AgentRuntime/InMemoryAgentStateManager.ts @@ -1,8 +1,8 @@ -import type { AgentState } from '@lobechat/agent-runtime'; +import { type AgentState } from '@lobechat/agent-runtime'; import debug from 'debug'; -import type { AgentOperationMetadata, StepResult } from './AgentStateManager'; -import type { IAgentStateManager } from './types'; +import { type AgentOperationMetadata, type StepResult } from './AgentStateManager'; +import { type IAgentStateManager } from './types'; const log = debug('lobe-server:agent-runtime:in-memory-state-manager'); diff --git a/src/server/modules/AgentRuntime/InMemoryStreamEventManager.ts b/src/server/modules/AgentRuntime/InMemoryStreamEventManager.ts index e97c50f125..ee83b2674d 100644 --- a/src/server/modules/AgentRuntime/InMemoryStreamEventManager.ts +++ b/src/server/modules/AgentRuntime/InMemoryStreamEventManager.ts @@ -1,7 +1,7 @@ import debug from 'debug'; -import type { StreamChunkData, StreamEvent } from './StreamEventManager'; -import type { IStreamEventManager } from './types'; +import { type StreamChunkData, type StreamEvent } from './StreamEventManager'; +import { type IStreamEventManager } from './types'; const log = debug('lobe-server:agent-runtime:in-memory-stream-event-manager'); @@ -180,7 +180,6 @@ export class InMemoryStreamEventManager implements IStreamEventManager { ): Promise { return new Promise((resolve, reject) => { const timer = setTimeout(() => { - unsubscribe(); reject(new Error(`Timeout waiting for event ${eventType}`)); }, timeout); diff --git a/src/server/modules/AgentRuntime/RuntimeExecutors.ts b/src/server/modules/AgentRuntime/RuntimeExecutors.ts index 1a096a0926..4799e3034b 100644 --- a/src/server/modules/AgentRuntime/RuntimeExecutors.ts +++ b/src/server/modules/AgentRuntime/RuntimeExecutors.ts @@ -1,19 +1,23 @@ -import type {AgentEvent, AgentInstruction, CallLLMPayload, GeneralAgentCallLLMResultPayload, InstructionExecutor} from '@lobechat/agent-runtime'; import { - UsageCounter + type AgentEvent, + type AgentInstruction, + type CallLLMPayload, + type GeneralAgentCallLLMResultPayload, + type InstructionExecutor, } from '@lobechat/agent-runtime'; +import { UsageCounter } from '@lobechat/agent-runtime'; import { ToolNameResolver } from '@lobechat/context-engine'; import { consumeStreamUntilDone } from '@lobechat/model-runtime'; -import type {ChatToolPayload, MessageToolCall} from '@lobechat/types'; +import { type ChatToolPayload, type MessageToolCall } from '@lobechat/types'; import { serializePartsForStorage } from '@lobechat/utils'; import debug from 'debug'; -import type {MessageModel} from '@/database/models/message'; -import type {LobeChatDatabase} from '@/database/type'; +import { type MessageModel } from '@/database/models/message'; +import { type LobeChatDatabase } from '@/database/type'; import { initModelRuntimeFromDB } from '@/server/modules/ModelRuntime'; -import type {ToolExecutionService} from '@/server/services/toolExecution'; +import { type ToolExecutionService } from '@/server/services/toolExecution'; -import type { IStreamEventManager } from './types'; +import { type IStreamEventManager } from './types'; const log = debug('lobe-server:agent-runtime:streaming-executors'); const timing = debug('lobe-server:agent-runtime:timing'); @@ -141,9 +145,9 @@ export const createRuntimeExecutors = ( const BUFFER_INTERVAL = 50; let textBuffer = ''; let reasoningBuffer = ''; - + let textBufferTimer: NodeJS.Timeout | null = null; - + let reasoningBufferTimer: NodeJS.Timeout | null = null; const flushTextBuffer = async () => { diff --git a/src/server/modules/AgentRuntime/StreamEventManager.ts b/src/server/modules/AgentRuntime/StreamEventManager.ts index 71afc3a8b1..8f68f46ff7 100644 --- a/src/server/modules/AgentRuntime/StreamEventManager.ts +++ b/src/server/modules/AgentRuntime/StreamEventManager.ts @@ -1,6 +1,6 @@ -import type {ChatToolPayload} from '@lobechat/types'; +import { type ChatToolPayload } from '@lobechat/types'; import debug from 'debug'; -import type { Redis } from 'ioredis'; +import { type Redis } from 'ioredis'; import { getAgentRuntimeRedisClient } from './redis'; diff --git a/src/server/modules/AgentRuntime/__tests__/RuntimeExecutors.test.ts b/src/server/modules/AgentRuntime/__tests__/RuntimeExecutors.test.ts index 6c386a7d3c..e718eb6ca2 100644 --- a/src/server/modules/AgentRuntime/__tests__/RuntimeExecutors.test.ts +++ b/src/server/modules/AgentRuntime/__tests__/RuntimeExecutors.test.ts @@ -1,7 +1,7 @@ -import type { AgentState } from '@lobechat/agent-runtime'; +import { type AgentState } from '@lobechat/agent-runtime'; import { beforeEach, describe, expect, it, vi } from 'vitest'; -import type {RuntimeExecutorContext } from '../RuntimeExecutors'; +import { type RuntimeExecutorContext } from '../RuntimeExecutors'; import { createRuntimeExecutors } from '../RuntimeExecutors'; // Mock dependencies diff --git a/src/server/modules/AgentRuntime/factory.ts b/src/server/modules/AgentRuntime/factory.ts index 78de25b822..f3f1350596 100644 --- a/src/server/modules/AgentRuntime/factory.ts +++ b/src/server/modules/AgentRuntime/factory.ts @@ -7,7 +7,7 @@ import { inMemoryAgentStateManager } from './InMemoryAgentStateManager'; import { inMemoryStreamEventManager } from './InMemoryStreamEventManager'; import { getAgentRuntimeRedisClient } from './redis'; import { StreamEventManager } from './StreamEventManager'; -import type { IAgentStateManager, IStreamEventManager } from './types'; +import { type IAgentStateManager, type IStreamEventManager } from './types'; const log = debug('lobe-server:agent-runtime:factory'); diff --git a/src/server/modules/AgentRuntime/types.ts b/src/server/modules/AgentRuntime/types.ts index a98421a3d5..a647a061a5 100644 --- a/src/server/modules/AgentRuntime/types.ts +++ b/src/server/modules/AgentRuntime/types.ts @@ -1,7 +1,7 @@ -import type { AgentState } from '@lobechat/agent-runtime'; +import { type AgentState } from '@lobechat/agent-runtime'; -import type { AgentOperationMetadata, StepResult } from './AgentStateManager'; -import type { StreamChunkData, StreamEvent } from './StreamEventManager'; +import { type AgentOperationMetadata, type StepResult } from './AgentStateManager'; +import { type StreamChunkData, type StreamEvent } from './StreamEventManager'; /** * Agent State Manager Interface diff --git a/src/server/modules/AssistantStore/index.ts b/src/server/modules/AssistantStore/index.ts index 3f5f6bd7f4..2341b6d283 100644 --- a/src/server/modules/AssistantStore/index.ts +++ b/src/server/modules/AssistantStore/index.ts @@ -3,8 +3,8 @@ import urlJoin from 'url-join'; import { DEFAULT_LANG, isLocaleNotSupport } from '@/const/locale'; import { appEnv } from '@/envs/app'; -import type {Locales} from '@/locales/resources'; -import { normalizeLocale } from '@/locales/resources'; +import { type Locales } from '@/locales/resources'; +import { normalizeLocale } from '@/locales/resources'; import { CacheRevalidate, CacheTag } from '@/types/discover'; export class AssistantStore { diff --git a/src/server/modules/ContentChunk/index.ts b/src/server/modules/ContentChunk/index.ts index c14b35866d..28c60cc108 100644 --- a/src/server/modules/ContentChunk/index.ts +++ b/src/server/modules/ContentChunk/index.ts @@ -1,8 +1,8 @@ -import type { NewChunkItem, NewUnstructuredChunkItem } from '@/database/schemas'; +import { type NewChunkItem, type NewUnstructuredChunkItem } from '@/database/schemas'; import { knowledgeEnv } from '@/envs/knowledge'; import { ChunkingLoader } from '@/libs/langchain'; -import type { ChunkingService } from './rules'; +import { type ChunkingService } from './rules'; import { ChunkingRuleParser } from './rules'; export interface ChunkContentParams { diff --git a/src/server/modules/KeyVaultsEncrypt/index.ts b/src/server/modules/KeyVaultsEncrypt/index.ts index edef28b3aa..bcc1d55a97 100644 --- a/src/server/modules/KeyVaultsEncrypt/index.ts +++ b/src/server/modules/KeyVaultsEncrypt/index.ts @@ -1,5 +1,5 @@ import { getServerDBConfig } from '@/config/db'; -import type {UserKeyVaults} from '@/types/user/settings'; +import { type UserKeyVaults } from '@/types/user/settings'; interface DecryptionResult { plaintext: string; diff --git a/src/server/modules/Mecha/AgentToolsEngine/__tests__/index.test.ts b/src/server/modules/Mecha/AgentToolsEngine/__tests__/index.test.ts index bb68ab424d..079b49b8ff 100644 --- a/src/server/modules/Mecha/AgentToolsEngine/__tests__/index.test.ts +++ b/src/server/modules/Mecha/AgentToolsEngine/__tests__/index.test.ts @@ -8,7 +8,7 @@ import { describe, expect, it } from 'vitest'; import { builtinTools } from '@/tools'; import { createServerAgentToolsEngine, createServerToolsEngine } from '../index'; -import type { InstalledPlugin, ServerAgentToolsContext } from '../types'; +import { type InstalledPlugin, type ServerAgentToolsContext } from '../types'; // Mock installed plugins const mockInstalledPlugins: InstalledPlugin[] = [ diff --git a/src/server/modules/Mecha/AgentToolsEngine/index.ts b/src/server/modules/Mecha/AgentToolsEngine/index.ts index 3cb957a4b1..1a4d36febd 100644 --- a/src/server/modules/Mecha/AgentToolsEngine/index.ts +++ b/src/server/modules/Mecha/AgentToolsEngine/index.ts @@ -12,16 +12,16 @@ import { KnowledgeBaseManifest } from '@lobechat/builtin-tool-knowledge-base'; import { LocalSystemManifest } from '@lobechat/builtin-tool-local-system'; import { WebBrowsingManifest } from '@lobechat/builtin-tool-web-browsing'; -import type {LobeToolManifest} from '@lobechat/context-engine'; -import { ToolsEngine } from '@lobechat/context-engine'; +import { type LobeToolManifest } from '@lobechat/context-engine'; +import { ToolsEngine } from '@lobechat/context-engine'; import debug from 'debug'; import { builtinTools } from '@/tools'; -import type { - ServerAgentToolsContext, - ServerAgentToolsEngineConfig, - ServerCreateAgentToolsEngineParams, +import { + type ServerAgentToolsContext, + type ServerAgentToolsEngineConfig, + type ServerCreateAgentToolsEngineParams, } from './types'; export type { diff --git a/src/server/modules/Mecha/AgentToolsEngine/types.ts b/src/server/modules/Mecha/AgentToolsEngine/types.ts index 2cea29faea..93c10e0bfe 100644 --- a/src/server/modules/Mecha/AgentToolsEngine/types.ts +++ b/src/server/modules/Mecha/AgentToolsEngine/types.ts @@ -1,5 +1,5 @@ -import type { LobeToolManifest, PluginEnableChecker } from '@lobechat/context-engine'; -import type { LobeTool } from '@lobechat/types'; +import { type LobeToolManifest, type PluginEnableChecker } from '@lobechat/context-engine'; +import { type LobeTool } from '@lobechat/types'; /** * Installed plugin with manifest diff --git a/src/server/modules/Mecha/ContextEngineering/__tests__/serverMessagesEngine.test.ts b/src/server/modules/Mecha/ContextEngineering/__tests__/serverMessagesEngine.test.ts index dc060557af..50c4e4f503 100644 --- a/src/server/modules/Mecha/ContextEngineering/__tests__/serverMessagesEngine.test.ts +++ b/src/server/modules/Mecha/ContextEngineering/__tests__/serverMessagesEngine.test.ts @@ -1,4 +1,4 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { describe, expect, it, vi } from 'vitest'; import { serverMessagesEngine } from '../index'; diff --git a/src/server/modules/Mecha/ContextEngineering/index.ts b/src/server/modules/Mecha/ContextEngineering/index.ts index 9f92e4a513..2e065b425e 100644 --- a/src/server/modules/Mecha/ContextEngineering/index.ts +++ b/src/server/modules/Mecha/ContextEngineering/index.ts @@ -1,7 +1,7 @@ import { MessagesEngine } from '@lobechat/context-engine'; -import type { OpenAIChatMessage } from '@lobechat/types'; +import { type OpenAIChatMessage } from '@lobechat/types'; -import type { ServerMessagesEngineParams } from './types'; +import { type ServerMessagesEngineParams } from './types'; /** * Create server-side variable generators with runtime context diff --git a/src/server/modules/Mecha/ContextEngineering/types.ts b/src/server/modules/Mecha/ContextEngineering/types.ts index 7c4b3c5101..ef365d065e 100644 --- a/src/server/modules/Mecha/ContextEngineering/types.ts +++ b/src/server/modules/Mecha/ContextEngineering/types.ts @@ -1,12 +1,12 @@ -import type { - AgentBuilderContext, - FileContent, - KnowledgeBaseInfo, - LobeToolManifest, - UserMemoryData, +import { + type AgentBuilderContext, + type FileContent, + type KnowledgeBaseInfo, + type LobeToolManifest, + type UserMemoryData, } from '@lobechat/context-engine'; -import type { PageContentContext } from '@lobechat/prompts'; -import type { UIChatMessage } from '@lobechat/types'; +import { type PageContentContext } from '@lobechat/prompts'; +import { type UIChatMessage } from '@lobechat/types'; /** * Model capability checker functions for server-side diff --git a/src/server/modules/ModelRuntime/index.test.ts b/src/server/modules/ModelRuntime/index.test.ts index 39a03f4c6d..a8174fb8e9 100644 --- a/src/server/modules/ModelRuntime/index.test.ts +++ b/src/server/modules/ModelRuntime/index.test.ts @@ -22,7 +22,7 @@ import { ModelRuntime, } from '@lobechat/model-runtime'; import { LobeVertexAI } from '@lobechat/model-runtime/vertexai'; -import type { ClientSecretPayload } from '@lobechat/types'; +import { type ClientSecretPayload } from '@lobechat/types'; import { ModelProvider } from 'model-bank'; import { describe, expect, it, vi } from 'vitest'; diff --git a/src/server/modules/ModelRuntime/index.ts b/src/server/modules/ModelRuntime/index.ts index ee59636875..f3fec3aaff 100644 --- a/src/server/modules/ModelRuntime/index.ts +++ b/src/server/modules/ModelRuntime/index.ts @@ -1,12 +1,21 @@ -import type {GoogleGenAIOptions} from '@google/genai'; +import { type GoogleGenAIOptions } from '@google/genai'; import { ModelRuntime } from '@lobechat/model-runtime'; import { LobeVertexAI } from '@lobechat/model-runtime/vertexai'; -import type {AWSBedrockKeyVault, AzureOpenAIKeyVault, ClientSecretPayload, CloudflareKeyVault, ComfyUIKeyVault, GithubCopilotKeyVault, OpenAICompatibleKeyVault, VertexAIKeyVault} from '@lobechat/types'; +import { + type AWSBedrockKeyVault, + type AzureOpenAIKeyVault, + type ClientSecretPayload, + type CloudflareKeyVault, + type ComfyUIKeyVault, + type GithubCopilotKeyVault, + type OpenAICompatibleKeyVault, + type VertexAIKeyVault, +} from '@lobechat/types'; import { safeParseJSON } from '@lobechat/utils'; import { ModelProvider } from 'model-bank'; import { AiProviderModel } from '@/database/models/aiProvider'; -import type {LobeChatDatabase} from '@/database/type'; +import { type LobeChatDatabase } from '@/database/type'; import { getLLMConfig } from '@/envs/llm'; import { KeyVaultsGateKeeper } from '../KeyVaultsEncrypt'; diff --git a/src/server/modules/ModelRuntime/trace.ts b/src/server/modules/ModelRuntime/trace.ts index f35546fda6..3a92adecf4 100644 --- a/src/server/modules/ModelRuntime/trace.ts +++ b/src/server/modules/ModelRuntime/trace.ts @@ -1,7 +1,7 @@ import { INBOX_SESSION_ID, LOBE_CHAT_OBSERVATION_ID, LOBE_CHAT_TRACE_ID } from '@lobechat/const'; -import type {ChatStreamCallbacks, ChatStreamPayload} from '@lobechat/model-runtime'; -import type {TracePayload} from '@lobechat/types'; -import { TraceTagMap } from '@lobechat/types'; +import { type ChatStreamCallbacks, type ChatStreamPayload } from '@lobechat/model-runtime'; +import { type TracePayload } from '@lobechat/types'; +import { TraceTagMap } from '@lobechat/types'; import { after } from 'next/server'; import { TraceClient } from '@/libs/traces'; diff --git a/src/server/modules/PluginStore/index.ts b/src/server/modules/PluginStore/index.ts index c8dde81004..33b1508e53 100644 --- a/src/server/modules/PluginStore/index.ts +++ b/src/server/modules/PluginStore/index.ts @@ -2,8 +2,8 @@ import urlJoin from 'url-join'; import { DEFAULT_LANG, isLocaleNotSupport } from '@/const/locale'; import { appEnv } from '@/envs/app'; -import type {Locales} from '@/locales/resources'; -import { normalizeLocale } from '@/locales/resources'; +import { type Locales } from '@/locales/resources'; +import { normalizeLocale } from '@/locales/resources'; export class PluginStore { private readonly baseUrl: string; diff --git a/src/server/routers/async/caller.ts b/src/server/routers/async/caller.ts index 1131dc8e51..9c4a7239f0 100644 --- a/src/server/routers/async/caller.ts +++ b/src/server/routers/async/caller.ts @@ -8,7 +8,7 @@ import { createAsyncCallerFactory } from '@/libs/trpc/async'; import { signInternalJWT } from '@/libs/trpc/utils/internalJwt'; import { KeyVaultsGateKeeper } from '@/server/modules/KeyVaultsEncrypt'; -import type { AsyncRouter } from './index'; +import { type AsyncRouter } from './index'; import { asyncRouter } from './index'; export const createAsyncServerClient = async (userId: string) => { diff --git a/src/server/routers/async/file.ts b/src/server/routers/async/file.ts index 0f7bed768f..5cb70cf818 100644 --- a/src/server/routers/async/file.ts +++ b/src/server/routers/async/file.ts @@ -11,19 +11,15 @@ import { AsyncTaskModel } from '@/database/models/asyncTask'; import { ChunkModel } from '@/database/models/chunk'; import { EmbeddingModel } from '@/database/models/embedding'; import { FileModel } from '@/database/models/file'; -import type {NewChunkItem, NewEmbeddingsItem} from '@/database/schemas'; +import { type NewChunkItem, type NewEmbeddingsItem } from '@/database/schemas'; import { fileEnv } from '@/envs/file'; import { asyncAuthedProcedure, asyncRouter as router } from '@/libs/trpc/async'; import { getServerDefaultFilesConfig } from '@/server/globalConfig'; import { initModelRuntimeFromDB } from '@/server/modules/ModelRuntime'; import { ChunkService } from '@/server/services/chunk'; import { FileService } from '@/server/services/file'; -import type {IAsyncTaskError} from '@/types/asyncTask'; -import { - AsyncTaskError, - AsyncTaskErrorType, - AsyncTaskStatus -} from '@/types/asyncTask'; +import { type IAsyncTaskError } from '@/types/asyncTask'; +import { AsyncTaskError, AsyncTaskErrorType, AsyncTaskStatus } from '@/types/asyncTask'; import { safeParseJSON } from '@/utils/safeParseJSON'; import { sanitizeUTF8 } from '@/utils/sanitizeUTF8'; diff --git a/src/server/routers/async/image.ts b/src/server/routers/async/image.ts index c7fcf7aa7c..332b573e7e 100644 --- a/src/server/routers/async/image.ts +++ b/src/server/routers/async/image.ts @@ -4,7 +4,7 @@ import { AgentRuntimeErrorType } from '@lobechat/model-runtime'; import { AsyncTaskError, AsyncTaskErrorType, AsyncTaskStatus } from '@lobechat/types'; import { TRPCError } from '@trpc/server'; import debug from 'debug'; -import type {RuntimeImageGenParams} from 'model-bank'; +import { type RuntimeImageGenParams } from 'model-bank'; import { z } from 'zod'; import { chargeAfterGenerate } from '@/business/server/image-generation/chargeAfterGenerate'; diff --git a/src/server/routers/lambda/__tests__/aiAgent.execGroupSubAgentTask.test.ts b/src/server/routers/lambda/__tests__/aiAgent.execGroupSubAgentTask.test.ts index 3eb9ae8089..891367e75e 100644 --- a/src/server/routers/lambda/__tests__/aiAgent.execGroupSubAgentTask.test.ts +++ b/src/server/routers/lambda/__tests__/aiAgent.execGroupSubAgentTask.test.ts @@ -1,5 +1,5 @@ // @vitest-environment node -import type { LobeChatDatabase } from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { agents, chatGroups, sessions, topics } from '@lobechat/database/schemas'; import { getTestDB } from '@lobechat/database/test-utils'; import { TRPCError } from '@trpc/server'; diff --git a/src/server/routers/lambda/__tests__/aiAgent.getTaskStatus.test.ts b/src/server/routers/lambda/__tests__/aiAgent.getTaskStatus.test.ts index a19e2826ae..8a70631678 100644 --- a/src/server/routers/lambda/__tests__/aiAgent.getTaskStatus.test.ts +++ b/src/server/routers/lambda/__tests__/aiAgent.getTaskStatus.test.ts @@ -1,5 +1,5 @@ // @vitest-environment node -import type { LobeChatDatabase } from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { agents, chatGroups, diff --git a/src/server/routers/lambda/__tests__/aiAgent.interruptTask.test.ts b/src/server/routers/lambda/__tests__/aiAgent.interruptTask.test.ts index f5ed0e02bc..c8089addcd 100644 --- a/src/server/routers/lambda/__tests__/aiAgent.interruptTask.test.ts +++ b/src/server/routers/lambda/__tests__/aiAgent.interruptTask.test.ts @@ -1,5 +1,5 @@ // @vitest-environment node -import type { LobeChatDatabase } from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { agents, chatGroups, sessions, threads, topics } from '@lobechat/database/schemas'; import { getTestDB } from '@lobechat/database/test-utils'; import { ThreadStatus, ThreadType } from '@lobechat/types'; diff --git a/src/server/routers/lambda/__tests__/aiAgent.test.ts b/src/server/routers/lambda/__tests__/aiAgent.test.ts index 4ec6252fe6..5cfffbe9b6 100644 --- a/src/server/routers/lambda/__tests__/aiAgent.test.ts +++ b/src/server/routers/lambda/__tests__/aiAgent.test.ts @@ -1,5 +1,5 @@ // @vitest-environment node -import type { LobeChatDatabase } from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { agents, agentsToSessions, sessions, threads, topics } from '@lobechat/database/schemas'; import { getTestDB } from '@lobechat/database/test-utils'; import { eq } from 'drizzle-orm'; diff --git a/src/server/routers/lambda/__tests__/aiProvider.test.ts b/src/server/routers/lambda/__tests__/aiProvider.test.ts index 81da0f50e7..d4b25ea90e 100644 --- a/src/server/routers/lambda/__tests__/aiProvider.test.ts +++ b/src/server/routers/lambda/__tests__/aiProvider.test.ts @@ -4,7 +4,7 @@ import { AiProviderModel } from '@/database/models/aiProvider'; import { AiInfraRepos } from '@/database/repositories/aiInfra'; import { getServerGlobalConfig } from '@/server/globalConfig'; import { KeyVaultsGateKeeper } from '@/server/modules/KeyVaultsEncrypt'; -import type { AiProviderDetailItem, AiProviderRuntimeState } from '@/types/aiProvider'; +import { type AiProviderDetailItem, type AiProviderRuntimeState } from '@/types/aiProvider'; import { aiProviderRouter } from '../aiProvider'; diff --git a/src/server/routers/lambda/__tests__/generationBatch.test.ts b/src/server/routers/lambda/__tests__/generationBatch.test.ts index 40d5f7159b..17c0749c98 100644 --- a/src/server/routers/lambda/__tests__/generationBatch.test.ts +++ b/src/server/routers/lambda/__tests__/generationBatch.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from 'vitest'; import { GenerationBatchModel } from '@/database/models/generationBatch'; -import type { GenerationBatchItem } from '@/database/schemas/generation'; +import { type GenerationBatchItem } from '@/database/schemas/generation'; import { FileService } from '@/server/services/file'; import { generationBatchRouter } from '../generationBatch'; diff --git a/src/server/routers/lambda/__tests__/generationTopic.test.ts b/src/server/routers/lambda/__tests__/generationTopic.test.ts index 93e5f04a97..27efce1f50 100644 --- a/src/server/routers/lambda/__tests__/generationTopic.test.ts +++ b/src/server/routers/lambda/__tests__/generationTopic.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from 'vitest'; import { GenerationTopicModel } from '@/database/models/generationTopic'; -import type { GenerationTopicItem } from '@/database/schemas/generation'; +import { type GenerationTopicItem } from '@/database/schemas/generation'; import { FileService } from '@/server/services/file'; import { GenerationService } from '@/server/services/generation'; diff --git a/src/server/routers/lambda/__tests__/importer.test.ts b/src/server/routers/lambda/__tests__/importer.test.ts index 3b53016ee3..614f92fc5c 100644 --- a/src/server/routers/lambda/__tests__/importer.test.ts +++ b/src/server/routers/lambda/__tests__/importer.test.ts @@ -1,7 +1,7 @@ import { TRPCError } from '@trpc/server'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import type { ImportResultData } from '@/types/importer'; +import { type ImportResultData } from '@/types/importer'; import { importerRouter } from '../importer'; 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 0e603133bb..56de76d03f 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 @@ -1,5 +1,5 @@ // @vitest-environment node -import type { LobeChatDatabase } from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { agents, chatGroups, 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 c312cd4321..d12183cea8 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 @@ -1,6 +1,13 @@ // @vitest-environment node -import type { LobeChatDatabase } from '@lobechat/database'; -import { agents, chatGroups, messages, sessions, threads, topics } from '@lobechat/database/schemas'; +import { type LobeChatDatabase } from '@lobechat/database'; +import { + agents, + chatGroups, + messages, + sessions, + threads, + topics, +} from '@lobechat/database/schemas'; import { getTestDB } from '@lobechat/database/test-utils'; import { ThreadStatus, ThreadType } from '@lobechat/types'; import { eq } from 'drizzle-orm'; @@ -374,8 +381,14 @@ describe('createClientTaskThread Integration', () => { expect(result2.success).toBe(true); // Verify threads have different agentIds - const [thread1] = await serverDB.select().from(threads).where(eq(threads.id, result1.threadId)); - const [thread2] = await serverDB.select().from(threads).where(eq(threads.id, result2.threadId)); + const [thread1] = await serverDB + .select() + .from(threads) + .where(eq(threads.id, result1.threadId)); + const [thread2] = await serverDB + .select() + .from(threads) + .where(eq(threads.id, result2.threadId)); expect(thread1.agentId).toBe(testAgentId); expect(thread2.agentId).toBe(agent2.id); diff --git a/src/server/routers/lambda/__tests__/integration/aiAgent.task.integration.test.ts b/src/server/routers/lambda/__tests__/integration/aiAgent.task.integration.test.ts index e36b2f2347..37cb51f9e5 100644 --- a/src/server/routers/lambda/__tests__/integration/aiAgent.task.integration.test.ts +++ b/src/server/routers/lambda/__tests__/integration/aiAgent.task.integration.test.ts @@ -1,5 +1,5 @@ // @vitest-environment node -import type { LobeChatDatabase } from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { agents, chatGroups, sessions, threads, topics } from '@lobechat/database/schemas'; import { getTestDB } from '@lobechat/database/test-utils'; import { ThreadStatus, ThreadType } from '@lobechat/types'; diff --git a/src/server/routers/lambda/__tests__/integration/aiAgent/execAgent.integration.test.ts b/src/server/routers/lambda/__tests__/integration/aiAgent/execAgent.integration.test.ts index 555c436fbf..374e349866 100644 --- a/src/server/routers/lambda/__tests__/integration/aiAgent/execAgent.integration.test.ts +++ b/src/server/routers/lambda/__tests__/integration/aiAgent/execAgent.integration.test.ts @@ -5,7 +5,7 @@ * Note: AgentStateManager and StreamEventManager will automatically use * InMemory implementations when Redis is not available (test environment). */ -import type { LobeChatDatabase } from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { agents, messages, threads, topics } from '@lobechat/database/schemas'; import { getTestDB } from '@lobechat/database/test-utils'; import { and, eq } from 'drizzle-orm'; @@ -40,7 +40,6 @@ vi.mock('@/server/services/file', () => ({ })), })); - let mockResponsesCreate: any; let serverDB: LobeChatDatabase; @@ -95,7 +94,9 @@ describe('execAgent', () => { expect(result.success).toBe(true); expect(result.operationId).toBeDefined(); - expect(result.operationId).toMatch(/^op_\d+_agt_.+_tpc_.(?:[^\n\r_\u2028\u2029]*_[^\w\n\r\u2028\u2029])*[^\n\r_\u2028\u2029]*_\w+(?:[^\w\n\r\u2028\u2029](?:[^\n\r_\u2028\u2029]*_[^\w\n\r\u2028\u2029])*[^\n\r_\u2028\u2029]*_\w+)*$/); + expect(result.operationId).toMatch( + /^op_\d+_agt_.+_tpc_.(?:[^\n\r_\u2028\u2029]*_[^\w\n\r\u2028\u2029])*[^\n\r_\u2028\u2029]*_\w+(?:[^\w\n\r\u2028\u2029](?:[^\n\r_\u2028\u2029]*_[^\w\n\r\u2028\u2029])*[^\n\r_\u2028\u2029]*_\w+)*$/, + ); // Verify topic was created const createdTopics = await serverDB diff --git a/src/server/routers/lambda/__tests__/integration/aiAgent/execAgents.integration.test.ts b/src/server/routers/lambda/__tests__/integration/aiAgent/execAgents.integration.test.ts index df414b7ce8..8d76f7a26d 100644 --- a/src/server/routers/lambda/__tests__/integration/aiAgent/execAgents.integration.test.ts +++ b/src/server/routers/lambda/__tests__/integration/aiAgent/execAgents.integration.test.ts @@ -5,7 +5,7 @@ * Note: AgentStateManager and StreamEventManager will automatically use * InMemory implementations when Redis is not available (test environment). */ -import type { LobeChatDatabase } from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { agents, topics } from '@lobechat/database/schemas'; import { getTestDB } from '@lobechat/database/test-utils'; import { eq } from 'drizzle-orm'; @@ -35,7 +35,6 @@ vi.mock('@/server/services/file', () => ({ })), })); - let mockResponsesCreate: any; let serverDB: LobeChatDatabase; @@ -120,12 +119,16 @@ describe('Batch Execution (execAgents)', () => { expect(result.results[0]).toMatchObject({ success: true, taskIndex: 0, - operationId: expect.stringMatching(/^op_\d+_agt_.+_tpc_.(?:[^\n\r_\u2028\u2029]*_[^\w\n\r\u2028\u2029])*[^\n\r_\u2028\u2029]*_\w+(?:[^\w\n\r\u2028\u2029](?:[^\n\r_\u2028\u2029]*_[^\w\n\r\u2028\u2029])*[^\n\r_\u2028\u2029]*_\w+)*$/), + operationId: expect.stringMatching( + /^op_\d+_agt_.+_tpc_.(?:[^\n\r_\u2028\u2029]*_[^\w\n\r\u2028\u2029])*[^\n\r_\u2028\u2029]*_\w+(?:[^\w\n\r\u2028\u2029](?:[^\n\r_\u2028\u2029]*_[^\w\n\r\u2028\u2029])*[^\n\r_\u2028\u2029]*_\w+)*$/, + ), }); expect(result.results[1]).toMatchObject({ success: true, taskIndex: 1, - operationId: expect.stringMatching(/^op_\d+_agt_.+_tpc_.(?:[^\n\r_\u2028\u2029]*_[^\w\n\r\u2028\u2029])*[^\n\r_\u2028\u2029]*_\w+(?:[^\w\n\r\u2028\u2029](?:[^\n\r_\u2028\u2029]*_[^\w\n\r\u2028\u2029])*[^\n\r_\u2028\u2029]*_\w+)*$/), + operationId: expect.stringMatching( + /^op_\d+_agt_.+_tpc_.(?:[^\n\r_\u2028\u2029]*_[^\w\n\r\u2028\u2029])*[^\n\r_\u2028\u2029]*_\w+(?:[^\w\n\r\u2028\u2029](?:[^\n\r_\u2028\u2029]*_[^\w\n\r\u2028\u2029])*[^\n\r_\u2028\u2029]*_\w+)*$/, + ), }); expect(result.results[0].operationId).not.toBe(result.results[1].operationId); diff --git a/src/server/routers/lambda/__tests__/integration/aiAgent/execGroupAgent.integration.test.ts b/src/server/routers/lambda/__tests__/integration/aiAgent/execGroupAgent.integration.test.ts index e4d63ee705..53fd872bd0 100644 --- a/src/server/routers/lambda/__tests__/integration/aiAgent/execGroupAgent.integration.test.ts +++ b/src/server/routers/lambda/__tests__/integration/aiAgent/execGroupAgent.integration.test.ts @@ -6,7 +6,7 @@ * Note: AgentStateManager and StreamEventManager will automatically use * InMemory implementations when Redis is not available (test environment). */ -import type { LobeChatDatabase } from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { agents, chatGroups, messages, topics } from '@lobechat/database/schemas'; import { getTestDB } from '@lobechat/database/test-utils'; import { and, eq } from 'drizzle-orm'; @@ -42,7 +42,7 @@ let serverDB: LobeChatDatabase; let userId: string; let testAgentId: string; let testGroupId: string; - + let mockResponsesCreate: any; const createTestCallerContext = (uid: string) => ({ diff --git a/src/server/routers/lambda/__tests__/integration/aiAgent/helpers.ts b/src/server/routers/lambda/__tests__/integration/aiAgent/helpers.ts index 042917b9da..4ebf7d37a2 100644 --- a/src/server/routers/lambda/__tests__/integration/aiAgent/helpers.ts +++ b/src/server/routers/lambda/__tests__/integration/aiAgent/helpers.ts @@ -1,10 +1,10 @@ /** * Shared helpers for aiAgent integration tests */ -import type {AgentState} from '@lobechat/agent-runtime'; +import { type AgentState } from '@lobechat/agent-runtime'; import { vi } from 'vitest'; -import type {IAgentStateManager} from '@/server/modules/AgentRuntime/types'; +import { type IAgentStateManager } from '@/server/modules/AgentRuntime/types'; /** * Wait for an operation to complete (or reach terminal state) diff --git a/src/server/routers/lambda/__tests__/integration/aiAgent/multiRoundTools.integration.test.ts b/src/server/routers/lambda/__tests__/integration/aiAgent/multiRoundTools.integration.test.ts index 667387c3cf..34153c3cc4 100644 --- a/src/server/routers/lambda/__tests__/integration/aiAgent/multiRoundTools.integration.test.ts +++ b/src/server/routers/lambda/__tests__/integration/aiAgent/multiRoundTools.integration.test.ts @@ -6,7 +6,7 @@ * Note: AgentStateManager and StreamEventManager will automatically use * InMemory implementations when Redis is not available (test environment). */ -import type { LobeChatDatabase } from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { agents, messages } from '@lobechat/database/schemas'; import { getTestDB } from '@lobechat/database/test-utils'; import { eq } from 'drizzle-orm'; @@ -37,7 +37,6 @@ vi.mock('@/server/services/file', () => ({ })), })); - let mockResponsesCreate: any; let serverDB: LobeChatDatabase; 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 f96559c1e2..d4821edfac 100644 --- a/src/server/routers/lambda/__tests__/integration/message.integration.test.ts +++ b/src/server/routers/lambda/__tests__/integration/message.integration.test.ts @@ -1,5 +1,5 @@ // @vitest-environment node -import type { LobeChatDatabase } from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { messages, sessions, topics } from '@lobechat/database/schemas'; import { getTestDB } from '@lobechat/database/test-utils'; import { eq } from 'drizzle-orm'; diff --git a/src/server/routers/lambda/__tests__/integration/setup.ts b/src/server/routers/lambda/__tests__/integration/setup.ts index 535819a77c..bcda00150e 100644 --- a/src/server/routers/lambda/__tests__/integration/setup.ts +++ b/src/server/routers/lambda/__tests__/integration/setup.ts @@ -1,7 +1,7 @@ /** * 集成测试通用设置 */ -import type {LobeChatDatabase} from '@/database/type'; +import { type LobeChatDatabase } from '@/database/type'; import { uuid } from '@/utils/uuid'; /** diff --git a/src/server/routers/lambda/__tests__/integration/topic.integration.test.ts b/src/server/routers/lambda/__tests__/integration/topic.integration.test.ts index 026b476e6e..e799ce7ca0 100644 --- a/src/server/routers/lambda/__tests__/integration/topic.integration.test.ts +++ b/src/server/routers/lambda/__tests__/integration/topic.integration.test.ts @@ -1,5 +1,5 @@ // @vitest-environment node -import type { LobeChatDatabase } from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { sessions, topics } from '@lobechat/database/schemas'; import { getTestDB } from '@lobechat/database/test-utils'; import { eq } from 'drizzle-orm'; diff --git a/src/server/routers/lambda/__tests__/message.test.ts b/src/server/routers/lambda/__tests__/message.test.ts index 5ac2500ef8..e3a64df2de 100644 --- a/src/server/routers/lambda/__tests__/message.test.ts +++ b/src/server/routers/lambda/__tests__/message.test.ts @@ -1,4 +1,8 @@ -import type { CreateMessageParams, UIChatMessage, UpdateMessageRAGParams } from '@lobechat/types'; +import { + type CreateMessageParams, + type UIChatMessage, + type UpdateMessageRAGParams, +} from '@lobechat/types'; import { TRPCError } from '@trpc/server'; import { describe, expect, it, vi } from 'vitest'; diff --git a/src/server/routers/lambda/_helpers/resolveContext.ts b/src/server/routers/lambda/_helpers/resolveContext.ts index 6b4be02f1f..c41b64d4a9 100644 --- a/src/server/routers/lambda/_helpers/resolveContext.ts +++ b/src/server/routers/lambda/_helpers/resolveContext.ts @@ -1,9 +1,9 @@ import { and, eq, inArray } from 'drizzle-orm'; import { agentsToSessions } from '@/database/schemas'; -import type {LobeChatDatabase} from '@/database/type'; +import { type LobeChatDatabase } from '@/database/type'; -import type {ConversationContextInput} from '../_schema/context'; +import { type ConversationContextInput } from '../_schema/context'; export interface ResolvedContext { agentId: string | null; @@ -97,7 +97,9 @@ export const batchResolveAgentIdFromSessions = async ( const relations = await db .select({ agentId: agentsToSessions.agentId, sessionId: agentsToSessions.sessionId }) .from(agentsToSessions) - .where(and(eq(agentsToSessions.userId, userId), inArray(agentsToSessions.sessionId, sessionIds))); + .where( + and(eq(agentsToSessions.userId, userId), inArray(agentsToSessions.sessionId, sessionIds)), + ); return new Map(relations.map((r) => [r.sessionId, r.agentId])); }; diff --git a/src/server/routers/lambda/_template.ts b/src/server/routers/lambda/_template.ts index 4d5de327f2..091a968586 100644 --- a/src/server/routers/lambda/_template.ts +++ b/src/server/routers/lambda/_template.ts @@ -4,7 +4,7 @@ import { SessionGroupModel } from '@/database/models/sessionGroup'; import { insertSessionGroupSchema } from '@/database/schemas'; import { authedProcedure, router } from '@/libs/trpc/lambda'; import { serverDatabase } from '@/libs/trpc/lambda/middleware'; -import type {SessionGroupItem} from '@/types/session'; +import { type SessionGroupItem } from '@/types/session'; const sessionProcedure = authedProcedure.use(serverDatabase).use(async (opts) => { const { ctx } = opts; diff --git a/src/server/routers/lambda/agent.ts b/src/server/routers/lambda/agent.ts index 8b56826c1c..7a5e05e210 100644 --- a/src/server/routers/lambda/agent.ts +++ b/src/server/routers/lambda/agent.ts @@ -1,6 +1,6 @@ import { DEFAULT_AGENT_CONFIG, INBOX_SESSION_ID } from '@lobechat/const'; -import type {KnowledgeItem} from '@lobechat/types'; -import { KnowledgeType } from '@lobechat/types'; +import { type KnowledgeItem } from '@lobechat/types'; +import { KnowledgeType } from '@lobechat/types'; import { z } from 'zod'; import { AgentModel } from '@/database/models/agent'; diff --git a/src/server/routers/lambda/agentCronJob.ts b/src/server/routers/lambda/agentCronJob.ts index 42b86ea263..6a47920142 100644 --- a/src/server/routers/lambda/agentCronJob.ts +++ b/src/server/routers/lambda/agentCronJob.ts @@ -1,8 +1,5 @@ -import type {InsertAgentCronJob, UpdateAgentCronJob} from '@lobechat/types'; -import { - InsertAgentCronJobSchema, - UpdateAgentCronJobSchema -} from '@lobechat/types'; +import { type InsertAgentCronJob, type UpdateAgentCronJob } from '@lobechat/types'; +import { InsertAgentCronJobSchema, UpdateAgentCronJobSchema } from '@lobechat/types'; import { TRPCError } from '@trpc/server'; import { z } from 'zod'; diff --git a/src/server/routers/lambda/agentGroup.ts b/src/server/routers/lambda/agentGroup.ts index e8d6030436..fadf4c9454 100644 --- a/src/server/routers/lambda/agentGroup.ts +++ b/src/server/routers/lambda/agentGroup.ts @@ -6,7 +6,7 @@ import { ChatGroupModel } from '@/database/models/chatGroup'; import { UserModel } from '@/database/models/user'; import { AgentGroupRepository } from '@/database/repositories/agentGroup'; import { insertAgentSchema } from '@/database/schemas'; -import type {ChatGroupConfig} from '@/database/types/chatGroup'; +import { type ChatGroupConfig } from '@/database/types/chatGroup'; import { authedProcedure, router } from '@/libs/trpc/lambda'; import { serverDatabase } from '@/libs/trpc/lambda/middleware'; import { AgentGroupService } from '@/server/services/agentGroup'; @@ -161,10 +161,7 @@ export const agentGroupRouter = router({ // 2. Create group with supervisor and member agents // Filter out null/undefined values from supervisorConfig const supervisorConfig = input.supervisorConfig - ? Object.fromEntries( - - Object.entries(input.supervisorConfig).filter(([_, v]) => v != null), - ) + ? Object.fromEntries(Object.entries(input.supervisorConfig).filter(([_, v]) => v != null)) : undefined; const normalizedConfig = ctx.agentGroupService.normalizeGroupConfig( diff --git a/src/server/routers/lambda/aiAgent.ts b/src/server/routers/lambda/aiAgent.ts index b63eabc069..9a4f091f7a 100644 --- a/src/server/routers/lambda/aiAgent.ts +++ b/src/server/routers/lambda/aiAgent.ts @@ -1,10 +1,7 @@ -import type {AgentRuntimeContext} from '@lobechat/agent-runtime'; +import { type AgentRuntimeContext } from '@lobechat/agent-runtime'; import { parse } from '@lobechat/conversation-flow'; -import type {TaskCurrentActivity, TaskStatusResult} from '@lobechat/types'; -import { - ThreadStatus, - ThreadType -} from '@lobechat/types'; +import { type TaskCurrentActivity, type TaskStatusResult } from '@lobechat/types'; +import { ThreadStatus, ThreadType } from '@lobechat/types'; import { TRPCError } from '@trpc/server'; import debug from 'debug'; import pMap from 'p-map'; diff --git a/src/server/routers/lambda/aiChat.ts b/src/server/routers/lambda/aiChat.ts index 44c782a4b0..57bfcdbe79 100644 --- a/src/server/routers/lambda/aiChat.ts +++ b/src/server/routers/lambda/aiChat.ts @@ -1,8 +1,5 @@ -import type {SendMessageServerResponse} from '@lobechat/types'; -import { - AiSendMessageServerSchema, - StructureOutputSchema -} from '@lobechat/types'; +import { type SendMessageServerResponse } from '@lobechat/types'; +import { AiSendMessageServerSchema, StructureOutputSchema } from '@lobechat/types'; import debug from 'debug'; import { LOADING_FLAT } from '@/const/message'; diff --git a/src/server/routers/lambda/aiModel.ts b/src/server/routers/lambda/aiModel.ts index 79cf69012e..015db79f5b 100644 --- a/src/server/routers/lambda/aiModel.ts +++ b/src/server/routers/lambda/aiModel.ts @@ -1,9 +1,9 @@ -import type {AiProviderModelListItem} from 'model-bank'; +import { type AiProviderModelListItem } from 'model-bank'; import { AiModelTypeSchema, CreateAiModelSchema, ToggleAiModelEnableSchema, - UpdateAiModelSchema + UpdateAiModelSchema, } from 'model-bank'; import { z } from 'zod'; @@ -14,7 +14,7 @@ import { authedProcedure, router } from '@/libs/trpc/lambda'; import { serverDatabase } from '@/libs/trpc/lambda/middleware'; import { getServerGlobalConfig } from '@/server/globalConfig'; import { KeyVaultsGateKeeper } from '@/server/modules/KeyVaultsEncrypt'; -import type {ProviderConfig} from '@/types/user/settings'; +import { type ProviderConfig } from '@/types/user/settings'; const aiModelProcedure = authedProcedure.use(serverDatabase).use(async (opts) => { const { ctx } = opts; diff --git a/src/server/routers/lambda/aiProvider.ts b/src/server/routers/lambda/aiProvider.ts index f247ee6b05..cb83890d37 100644 --- a/src/server/routers/lambda/aiProvider.ts +++ b/src/server/routers/lambda/aiProvider.ts @@ -7,13 +7,13 @@ import { authedProcedure, router } from '@/libs/trpc/lambda'; import { serverDatabase } from '@/libs/trpc/lambda/middleware'; import { getServerGlobalConfig } from '@/server/globalConfig'; import { KeyVaultsGateKeeper } from '@/server/modules/KeyVaultsEncrypt'; -import type {AiProviderDetailItem, AiProviderRuntimeState} from '@/types/aiProvider'; +import { type AiProviderDetailItem, type AiProviderRuntimeState } from '@/types/aiProvider'; import { CreateAiProviderSchema, UpdateAiProviderConfigSchema, - UpdateAiProviderSchema + UpdateAiProviderSchema, } from '@/types/aiProvider'; -import type {ProviderConfig} from '@/types/user/settings'; +import { type ProviderConfig } from '@/types/user/settings'; const aiProviderProcedure = authedProcedure.use(serverDatabase).use(async (opts) => { const { ctx } = opts; diff --git a/src/server/routers/lambda/chunk.ts b/src/server/routers/lambda/chunk.ts index d3395942d3..67965da63b 100644 --- a/src/server/routers/lambda/chunk.ts +++ b/src/server/routers/lambda/chunk.ts @@ -1,8 +1,6 @@ import { DEFAULT_FILE_EMBEDDING_MODEL_ITEM } from '@lobechat/const'; -import type {ChatSemanticSearchChunk, FileSearchResult} from '@lobechat/types'; -import { - SemanticSearchSchema -} from '@lobechat/types'; +import { type ChatSemanticSearchChunk, type FileSearchResult } from '@lobechat/types'; +import { SemanticSearchSchema } from '@lobechat/types'; import { TRPCError } from '@trpc/server'; import { inArray } from 'drizzle-orm'; import pMap from 'p-map'; diff --git a/src/server/routers/lambda/comfyui.ts b/src/server/routers/lambda/comfyui.ts index 368ff281a8..9445b82e75 100644 --- a/src/server/routers/lambda/comfyui.ts +++ b/src/server/routers/lambda/comfyui.ts @@ -1,4 +1,4 @@ -import type { ComfyUIKeyVault } from '@lobechat/types'; +import { type ComfyUIKeyVault } from '@lobechat/types'; import { z } from 'zod'; import { authedProcedure, router } from '@/libs/trpc/lambda'; @@ -7,7 +7,7 @@ import { ComfyUIClientService } from '@/server/services/comfyui/core/comfyUIClie import { ImageService } from '@/server/services/comfyui/core/imageService'; import { ModelResolverService } from '@/server/services/comfyui/core/modelResolverService'; import { WorkflowBuilderService } from '@/server/services/comfyui/core/workflowBuilderService'; -import type { WorkflowContext } from '@/server/services/comfyui/types'; +import { type WorkflowContext } from '@/server/services/comfyui/types'; // ComfyUI params validation - only validate required fields // Other RuntimeImageGenParams fields are passed through automatically diff --git a/src/server/routers/lambda/config/index.test.ts b/src/server/routers/lambda/config/index.test.ts index bcb527537c..dcdd11c04d 100644 --- a/src/server/routers/lambda/config/index.test.ts +++ b/src/server/routers/lambda/config/index.test.ts @@ -5,7 +5,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; * This file contains the root router of your tRPC-backend */ import { createCallerFactory } from '@/libs/trpc/lambda'; -import type { AuthContext} from '@/libs/trpc/lambda/context'; +import { type AuthContext } from '@/libs/trpc/lambda/context'; import { createContextInner } from '@/libs/trpc/lambda/context'; import { configRouter } from './index'; diff --git a/src/server/routers/lambda/config/index.ts b/src/server/routers/lambda/config/index.ts index 4aaddc95b6..e327981eee 100644 --- a/src/server/routers/lambda/config/index.ts +++ b/src/server/routers/lambda/config/index.ts @@ -4,7 +4,7 @@ import { businessConfigEndpoints } from '@/business/server/lambda-routers/config import { getServerFeatureFlagsStateFromEdgeConfig } from '@/config/featureFlags'; import { publicProcedure, router } from '@/libs/trpc/lambda'; import { getServerDefaultAgentConfig, getServerGlobalConfig } from '@/server/globalConfig'; -import type {GlobalRuntimeConfig} from '@/types/serverConfig'; +import { type GlobalRuntimeConfig } from '@/types/serverConfig'; const log = debug('config-router'); diff --git a/src/server/routers/lambda/exporter.ts b/src/server/routers/lambda/exporter.ts index 9716a7d0b3..64a44dfc89 100644 --- a/src/server/routers/lambda/exporter.ts +++ b/src/server/routers/lambda/exporter.ts @@ -8,7 +8,7 @@ import { SessionModel } from '@/database/models/session'; import { DataExporterRepos } from '@/database/repositories/dataExporter'; import { authedProcedure, router } from '@/libs/trpc/lambda'; import { serverDatabase } from '@/libs/trpc/lambda/middleware'; -import type {ExportDatabaseData} from '@/types/export'; +import { type ExportDatabaseData } from '@/types/export'; const exportProcedure = authedProcedure.use(serverDatabase).use(async (opts) => { const { ctx } = opts; @@ -22,7 +22,6 @@ const exportProcedure = authedProcedure.use(serverDatabase).use(async (opts) => }); }); - const REGULAR_FONT_URL = 'https://cdn.jsdelivr.net/gh/adobe-fonts/source-han-sans@2.004R/OTF/SimplifiedChinese/SourceHanSansSC-Regular.otf'; diff --git a/src/server/routers/lambda/file.ts b/src/server/routers/lambda/file.ts index f1a3069c03..5cd4d3a4fc 100644 --- a/src/server/routers/lambda/file.ts +++ b/src/server/routers/lambda/file.ts @@ -14,8 +14,8 @@ import { authedProcedure, router } from '@/libs/trpc/lambda'; import { serverDatabase } from '@/libs/trpc/lambda/middleware'; import { FileService } from '@/server/services/file'; import { AsyncTaskStatus, AsyncTaskType } from '@/types/asyncTask'; -import type {FileListItem} from '@/types/files'; -import { QueryFileListSchema, UploadFileSchema } from '@/types/files'; +import { type FileListItem } from '@/types/files'; +import { QueryFileListSchema, UploadFileSchema } from '@/types/files'; /** * Generate file proxy URL diff --git a/src/server/routers/lambda/generation.ts b/src/server/routers/lambda/generation.ts index 248e8323d1..d6b2fd7171 100644 --- a/src/server/routers/lambda/generation.ts +++ b/src/server/routers/lambda/generation.ts @@ -6,9 +6,9 @@ import { GenerationModel } from '@/database/models/generation'; import { authedProcedure, router } from '@/libs/trpc/lambda'; import { serverDatabase } from '@/libs/trpc/lambda/middleware'; import { FileService } from '@/server/services/file'; -import type {AsyncTaskError} from '@/types/asyncTask'; -import { AsyncTaskStatus } from '@/types/asyncTask'; -import type {Generation} from '@/types/generation'; +import { type AsyncTaskError } from '@/types/asyncTask'; +import { AsyncTaskStatus } from '@/types/asyncTask'; +import { type Generation } from '@/types/generation'; const generationProcedure = authedProcedure.use(serverDatabase).use(async (opts) => { const { ctx } = opts; diff --git a/src/server/routers/lambda/generationTopic.ts b/src/server/routers/lambda/generationTopic.ts index a62b9f4511..068da4f9c0 100644 --- a/src/server/routers/lambda/generationTopic.ts +++ b/src/server/routers/lambda/generationTopic.ts @@ -1,7 +1,7 @@ import { z } from 'zod'; import { GenerationTopicModel } from '@/database/models/generationTopic'; -import type {GenerationTopicItem} from '@/database/schemas/generation'; +import { type GenerationTopicItem } from '@/database/schemas/generation'; import { authedProcedure, router } from '@/libs/trpc/lambda'; import { serverDatabase } from '@/libs/trpc/lambda/middleware'; import { FileService } from '@/server/services/file'; diff --git a/src/server/routers/lambda/image/index.ts b/src/server/routers/lambda/image/index.ts index b0becb2a18..3f8ec4e6f7 100644 --- a/src/server/routers/lambda/image/index.ts +++ b/src/server/routers/lambda/image/index.ts @@ -4,12 +4,8 @@ import { z } from 'zod'; import { chargeBeforeGenerate } from '@/business/server/image-generation/chargeBeforeGenerate'; import { AsyncTaskModel } from '@/database/models/asyncTask'; -import type {NewGeneration, NewGenerationBatch} from '@/database/schemas'; -import { - asyncTasks, - generationBatches, - generations -} from '@/database/schemas'; +import { type NewGeneration, type NewGenerationBatch } from '@/database/schemas'; +import { asyncTasks, generationBatches, generations } from '@/database/schemas'; import { authedProcedure, router } from '@/libs/trpc/lambda'; import { keyVaults, serverDatabase } from '@/libs/trpc/lambda/middleware'; import { createAsyncCaller } from '@/server/routers/async/caller'; diff --git a/src/server/routers/lambda/importer.ts b/src/server/routers/lambda/importer.ts index 3dbcd394d7..4a922d06c6 100644 --- a/src/server/routers/lambda/importer.ts +++ b/src/server/routers/lambda/importer.ts @@ -5,8 +5,8 @@ import { DataImporterRepos } from '@/database/repositories/dataImporter'; import { authedProcedure, router } from '@/libs/trpc/lambda'; import { serverDatabase } from '@/libs/trpc/lambda/middleware'; import { FileService } from '@/server/services/file'; -import type {ImportPgDataStructure} from '@/types/export'; -import type {ImporterEntryData, ImportResultData} from '@/types/importer'; +import { type ImportPgDataStructure } from '@/types/export'; +import { type ImporterEntryData, type ImportResultData } from '@/types/importer'; const importProcedure = authedProcedure.use(serverDatabase).use(async (opts) => { const { ctx } = opts; diff --git a/src/server/routers/lambda/klavis.ts b/src/server/routers/lambda/klavis.ts index ed8fefec3f..88ebfb7c42 100644 --- a/src/server/routers/lambda/klavis.ts +++ b/src/server/routers/lambda/klavis.ts @@ -1,4 +1,4 @@ -import type { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; import { z } from 'zod'; import { PluginModel } from '@/database/models/plugin'; diff --git a/src/server/routers/lambda/knowledge.ts b/src/server/routers/lambda/knowledge.ts index c426fbc505..202418864f 100644 --- a/src/server/routers/lambda/knowledge.ts +++ b/src/server/routers/lambda/knowledge.ts @@ -7,8 +7,8 @@ import { authedProcedure, router } from '@/libs/trpc/lambda'; import { serverDatabase } from '@/libs/trpc/lambda/middleware'; import { FileService } from '@/server/services/file'; import { AsyncTaskStatus, AsyncTaskType } from '@/types/asyncTask'; -import type {FileListItem} from '@/types/files'; -import { QueryFileListSchema } from '@/types/files'; +import { type FileListItem } from '@/types/files'; +import { QueryFileListSchema } from '@/types/files'; const knowledgeProcedure = authedProcedure.use(serverDatabase).use(async (opts) => { const { ctx } = opts; diff --git a/src/server/routers/lambda/knowledgeBase.ts b/src/server/routers/lambda/knowledgeBase.ts index faa25831e0..d2db6d9da4 100644 --- a/src/server/routers/lambda/knowledgeBase.ts +++ b/src/server/routers/lambda/knowledgeBase.ts @@ -5,7 +5,7 @@ import { KnowledgeBaseModel } from '@/database/models/knowledgeBase'; import { insertKnowledgeBasesSchema } from '@/database/schemas'; import { authedProcedure, router } from '@/libs/trpc/lambda'; import { serverDatabase } from '@/libs/trpc/lambda/middleware'; -import type {KnowledgeBaseItem} from '@/types/knowledgeBase'; +import { type KnowledgeBaseItem } from '@/types/knowledgeBase'; const knowledgeBaseProcedure = authedProcedure.use(serverDatabase).use(async (opts) => { const { ctx } = opts; @@ -22,7 +22,10 @@ export const knowledgeBaseRouter = router({ .input(z.object({ ids: z.array(z.string()), knowledgeBaseId: z.string() })) .mutation(async ({ input, ctx }) => { try { - return await ctx.knowledgeBaseModel.addFilesToKnowledgeBase(input.knowledgeBaseId, input.ids); + return await ctx.knowledgeBaseModel.addFilesToKnowledgeBase( + input.knowledgeBaseId, + input.ids, + ); } catch (e: any) { // Check for PostgreSQL unique constraint violation (code 23505) const pgErrorCode = e?.cause?.cause?.code || e?.cause?.code || e?.code; diff --git a/src/server/routers/lambda/market/agent.ts b/src/server/routers/lambda/market/agent.ts index 4aa05901ff..1d12d88055 100644 --- a/src/server/routers/lambda/market/agent.ts +++ b/src/server/routers/lambda/market/agent.ts @@ -5,7 +5,7 @@ import { z } from 'zod'; import { authedProcedure, router } from '@/libs/trpc/lambda'; import { marketSDK, marketUserInfo, serverDatabase } from '@/libs/trpc/lambda/middleware'; -import type {TrustedClientUserInfo} from '@/libs/trusted-client'; +import { type TrustedClientUserInfo } from '@/libs/trusted-client'; import { generateTrustedClientToken } from '@/libs/trusted-client'; const MARKET_BASE_URL = process.env.NEXT_PUBLIC_MARKET_BASE_URL || 'https://market.lobehub.com'; diff --git a/src/server/routers/lambda/market/agentGroup.ts b/src/server/routers/lambda/market/agentGroup.ts index 5d89379265..a45a91406c 100644 --- a/src/server/routers/lambda/market/agentGroup.ts +++ b/src/server/routers/lambda/market/agentGroup.ts @@ -5,7 +5,7 @@ import { z } from 'zod'; import { authedProcedure, router } from '@/libs/trpc/lambda'; import { marketSDK, marketUserInfo, serverDatabase } from '@/libs/trpc/lambda/middleware'; -import type {TrustedClientUserInfo} from '@/libs/trusted-client'; +import { type TrustedClientUserInfo } from '@/libs/trusted-client'; import { generateTrustedClientToken } from '@/libs/trusted-client'; const MARKET_BASE_URL = process.env.NEXT_PUBLIC_MARKET_BASE_URL || 'https://market.lobehub.com'; diff --git a/src/server/routers/lambda/notebook.ts b/src/server/routers/lambda/notebook.ts index af3e6810fd..124c533996 100644 --- a/src/server/routers/lambda/notebook.ts +++ b/src/server/routers/lambda/notebook.ts @@ -1,4 +1,4 @@ -import type {NotebookDocument} from '@lobechat/types'; +import { type NotebookDocument } from '@lobechat/types'; import { z } from 'zod'; import { DocumentModel } from '@/database/models/document'; diff --git a/src/server/routers/lambda/plugin.ts b/src/server/routers/lambda/plugin.ts index 2d66ad1301..37c4bccde3 100644 --- a/src/server/routers/lambda/plugin.ts +++ b/src/server/routers/lambda/plugin.ts @@ -1,4 +1,4 @@ -import type {LobeTool} from '@lobechat/types'; +import { type LobeTool } from '@lobechat/types'; import { z } from 'zod'; import { PluginModel } from '@/database/models/plugin'; diff --git a/src/server/routers/lambda/ragEval.ts b/src/server/routers/lambda/ragEval.ts index a087a63e16..74dd524156 100644 --- a/src/server/routers/lambda/ragEval.ts +++ b/src/server/routers/lambda/ragEval.ts @@ -1,10 +1,14 @@ /* eslint-disable sort-keys-fix/sort-keys-fix */ -import type {EvalDatasetRecord, InsertEvalDatasetRecord, RAGEvalDataSetItem} from '@lobechat/types'; +import { + type EvalDatasetRecord, + type InsertEvalDatasetRecord, + type RAGEvalDataSetItem, +} from '@lobechat/types'; import { EvalEvaluationStatus, insertEvalDatasetRecordSchema, insertEvalDatasetsSchema, - insertEvalEvaluationSchema + insertEvalEvaluationSchema, } from '@lobechat/types'; import { TRPCError } from '@trpc/server'; import dayjs from 'dayjs'; diff --git a/src/server/routers/lambda/session.ts b/src/server/routers/lambda/session.ts index 66c4352ba6..87b6669653 100644 --- a/src/server/routers/lambda/session.ts +++ b/src/server/routers/lambda/session.ts @@ -9,8 +9,8 @@ import { authedProcedure, publicProcedure, router } from '@/libs/trpc/lambda'; import { serverDatabase } from '@/libs/trpc/lambda/middleware'; import { AgentChatConfigSchema } from '@/types/agent'; import { LobeMetaDataSchema } from '@/types/meta'; -import type {BatchTaskResult} from '@/types/service'; -import type {ChatSessionList, LobeGroupSession} from '@/types/session'; +import { type BatchTaskResult } from '@/types/service'; +import { type ChatSessionList, type LobeGroupSession } from '@/types/session'; const sessionProcedure = authedProcedure.use(serverDatabase).use(async (opts) => { const { ctx } = opts; diff --git a/src/server/routers/lambda/sessionGroup.ts b/src/server/routers/lambda/sessionGroup.ts index 9b5bfbc0fc..93284d54b3 100644 --- a/src/server/routers/lambda/sessionGroup.ts +++ b/src/server/routers/lambda/sessionGroup.ts @@ -4,7 +4,7 @@ import { SessionGroupModel } from '@/database/models/sessionGroup'; import { insertSessionGroupSchema } from '@/database/schemas'; import { authedProcedure, router } from '@/libs/trpc/lambda'; import { serverDatabase } from '@/libs/trpc/lambda/middleware'; -import type {SessionGroupItem} from '@/types/session'; +import { type SessionGroupItem } from '@/types/session'; const sessionProcedure = authedProcedure.use(serverDatabase).use(async (opts) => { const { ctx } = opts; diff --git a/src/server/routers/lambda/share.ts b/src/server/routers/lambda/share.ts index 03a656e706..f92c9b31b3 100644 --- a/src/server/routers/lambda/share.ts +++ b/src/server/routers/lambda/share.ts @@ -1,4 +1,4 @@ -import type { SharedTopicData } from '@lobechat/types'; +import { type SharedTopicData } from '@lobechat/types'; import { z } from 'zod'; import { TopicShareModel } from '@/database/models/topicShare'; diff --git a/src/server/routers/lambda/thread.ts b/src/server/routers/lambda/thread.ts index 565eefa6c6..c0c9b5611e 100644 --- a/src/server/routers/lambda/thread.ts +++ b/src/server/routers/lambda/thread.ts @@ -5,7 +5,7 @@ import { ThreadModel } from '@/database/models/thread'; import { insertThreadSchema } from '@/database/schemas'; import { authedProcedure, router } from '@/libs/trpc/lambda'; import { serverDatabase } from '@/libs/trpc/lambda/middleware'; -import type {ThreadItem} from '@/types/topic/thread'; +import { type ThreadItem } from '@/types/topic/thread'; import { createThreadSchema } from '@/types/topic/thread'; const threadProcedure = authedProcedure.use(serverDatabase).use(async (opts) => { diff --git a/src/server/routers/lambda/topic.ts b/src/server/routers/lambda/topic.ts index 54b42c8575..c507550c8f 100644 --- a/src/server/routers/lambda/topic.ts +++ b/src/server/routers/lambda/topic.ts @@ -1,4 +1,8 @@ -import type {RecentTopic, RecentTopicGroup, RecentTopicGroupMember} from '@lobechat/types'; +import { + type RecentTopic, + type RecentTopicGroup, + type RecentTopicGroupMember, +} from '@lobechat/types'; import { cleanObject } from '@lobechat/utils'; import { eq, inArray } from 'drizzle-orm'; import { after } from 'next/server'; @@ -11,7 +15,7 @@ import { TopicImporterRepo } from '@/database/repositories/topicImporter'; import { agents, chatGroups, chatGroupsAgents } from '@/database/schemas'; import { authedProcedure, router } from '@/libs/trpc/lambda'; import { serverDatabase } from '@/libs/trpc/lambda/middleware'; -import type {BatchTaskResult} from '@/types/service'; +import { type BatchTaskResult } from '@/types/service'; import { batchResolveAgentIdFromSessions, diff --git a/src/server/routers/lambda/user.ts b/src/server/routers/lambda/user.ts index a0220de93b..cb88e721ee 100644 --- a/src/server/routers/lambda/user.ts +++ b/src/server/routers/lambda/user.ts @@ -1,11 +1,15 @@ import { isDesktop } from '@lobechat/const'; -import type {UserInitializationState, UserPreference, UserSettings} from '@lobechat/types'; +import { + type UserInitializationState, + type UserPreference, + type UserSettings, +} from '@lobechat/types'; import { Plans, UserGuideSchema, UserOnboardingSchema, UserPreferenceSchema, - UserSettingsSchema + UserSettingsSchema, } from '@lobechat/types'; import { TRPCError } from '@trpc/server'; import { after } from 'next/server'; diff --git a/src/server/routers/lambda/userMemories.ts b/src/server/routers/lambda/userMemories.ts index e76c2c59e6..5b77049c0a 100644 --- a/src/server/routers/lambda/userMemories.ts +++ b/src/server/routers/lambda/userMemories.ts @@ -4,7 +4,7 @@ import { DEFAULT_USER_MEMORY_EMBEDDING_DIMENSIONS, DEFAULT_USER_MEMORY_EMBEDDING_MODEL_ITEM, } from '@lobechat/const'; -import type {LobeChatDatabase} from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { ActivityMemoryItemSchema, AddIdentityActionSchema, @@ -14,19 +14,22 @@ import { RemoveIdentityActionSchema, UpdateIdentityActionSchema, } from '@lobechat/memory-user-memory'; -import type {SearchMemoryResult} from '@lobechat/types'; -import { LayersEnum, searchMemorySchema } from '@lobechat/types'; -import type {SQL} from 'drizzle-orm'; +import { type SearchMemoryResult } from '@lobechat/types'; +import { LayersEnum, searchMemorySchema } from '@lobechat/types'; +import { type SQL } from 'drizzle-orm'; import { and, asc, eq, gte, lte } from 'drizzle-orm'; import pMap from 'p-map'; import { z } from 'zod'; -import type {IdentityEntryBasePayload, IdentityEntryPayload} from '@/database/models/userMemory'; +import { + type IdentityEntryBasePayload, + type IdentityEntryPayload, +} from '@/database/models/userMemory'; import { UserMemoryActivityModel, UserMemoryExperienceModel, UserMemoryIdentityModel, - UserMemoryModel + UserMemoryModel, } from '@/database/models/userMemory'; import { UserMemoryTopicRepository } from '@/database/repositories/userMemory'; import { diff --git a/src/server/routers/mobile/topic.ts b/src/server/routers/mobile/topic.ts index 9ffbeeadfa..13e9562dac 100644 --- a/src/server/routers/mobile/topic.ts +++ b/src/server/routers/mobile/topic.ts @@ -4,7 +4,7 @@ import { TopicModel } from '@/database/models/topic'; import { getServerDB } from '@/database/server'; import { authedProcedure, publicProcedure, router } from '@/libs/trpc/lambda'; import { serverDatabase } from '@/libs/trpc/lambda/middleware'; -import type {BatchTaskResult} from '@/types/service'; +import { type BatchTaskResult } from '@/types/service'; const topicProcedure = authedProcedure.use(serverDatabase).use(async (opts) => { const { ctx } = opts; diff --git a/src/server/routers/tools/_helpers/scheduleToolCallReport.ts b/src/server/routers/tools/_helpers/scheduleToolCallReport.ts index 25ddc18475..cfb4b52e11 100644 --- a/src/server/routers/tools/_helpers/scheduleToolCallReport.ts +++ b/src/server/routers/tools/_helpers/scheduleToolCallReport.ts @@ -1,5 +1,5 @@ import { CURRENT_VERSION } from '@lobechat/const'; -import type {CallReportRequest} from '@lobehub/market-types'; +import { type CallReportRequest } from '@lobehub/market-types'; import { after } from 'next/server'; import { DiscoverService } from '@/server/services/discover'; diff --git a/src/server/routers/tools/market.ts b/src/server/routers/tools/market.ts index e6f551ca8b..74d5fae238 100644 --- a/src/server/routers/tools/market.ts +++ b/src/server/routers/tools/market.ts @@ -1,10 +1,10 @@ -import type {CodeInterpreterToolName} from '@lobehub/market-sdk'; +import { type CodeInterpreterToolName } from '@lobehub/market-sdk'; import { TRPCError } from '@trpc/server'; import debug from 'debug'; import { sha256 } from 'js-sha256'; import { z } from 'zod'; -import type {ToolCallContent} from '@/libs/mcp'; +import { type ToolCallContent } from '@/libs/mcp'; import { authedProcedure, router } from '@/libs/trpc/lambda'; import { marketUserInfo, serverDatabase, telemetry } from '@/libs/trpc/lambda/middleware'; import { marketSDK, requireMarketAuth } from '@/libs/trpc/lambda/middleware/marketSDK'; diff --git a/src/server/routers/tools/mcp.ts b/src/server/routers/tools/mcp.ts index d975d8a2a2..9e01c039ff 100644 --- a/src/server/routers/tools/mcp.ts +++ b/src/server/routers/tools/mcp.ts @@ -6,7 +6,7 @@ import { import { TRPCError } from '@trpc/server'; import { z } from 'zod'; -import type {ToolCallContent} from '@/libs/mcp'; +import { type ToolCallContent } from '@/libs/mcp'; import { authedProcedure, router } from '@/libs/trpc/lambda'; import { serverDatabase, telemetry } from '@/libs/trpc/lambda/middleware'; import { FileService } from '@/server/services/file'; diff --git a/src/server/services/agent/index.ts b/src/server/services/agent/index.ts index 5347313276..f872860b64 100644 --- a/src/server/services/agent/index.ts +++ b/src/server/services/agent/index.ts @@ -1,20 +1,25 @@ -import type {BuiltinAgentSlug} from '@lobechat/builtin-agents'; -import { BUILTIN_AGENTS } from '@lobechat/builtin-agents'; +import { type BuiltinAgentSlug } from '@lobechat/builtin-agents'; +import { BUILTIN_AGENTS } from '@lobechat/builtin-agents'; import { DEFAULT_AGENT_CONFIG } from '@lobechat/const'; -import type {LobeChatDatabase} from '@lobechat/database'; -import type {AgentItem, LobeAgentConfig} from '@lobechat/types'; +import { type LobeChatDatabase } from '@lobechat/database'; +import { type AgentItem, type LobeAgentConfig } from '@lobechat/types'; import { cleanObject, merge } from '@lobechat/utils'; import debug from 'debug'; -import type { PartialDeep } from 'type-fest'; +import { type PartialDeep } from 'type-fest'; import { AgentModel } from '@/database/models/agent'; import { SessionModel } from '@/database/models/session'; import { UserModel } from '@/database/models/user'; import { getRedisConfig } from '@/envs/redis'; -import { initializeRedisWithPrefix, isRedisEnabled,RedisKeyNamespace, RedisKeys } from '@/libs/redis'; +import { + initializeRedisWithPrefix, + isRedisEnabled, + RedisKeyNamespace, + RedisKeys, +} from '@/libs/redis'; import { getServerDefaultAgentConfig } from '@/server/globalConfig'; -import type {UpdateAgentResult} from './type'; +import { type UpdateAgentResult } from './type'; const log = debug('lobe-agent:service'); diff --git a/src/server/services/agent/type.ts b/src/server/services/agent/type.ts index 4ef85f3762..a60a453ec9 100644 --- a/src/server/services/agent/type.ts +++ b/src/server/services/agent/type.ts @@ -1,4 +1,4 @@ -import type {LobeAgentConfig} from '@/types/agent'; +import { type LobeAgentConfig } from '@/types/agent'; export interface UpdateAgentResult { agent?: LobeAgentConfig; diff --git a/src/server/services/agentGroup/index.ts b/src/server/services/agentGroup/index.ts index 6417f9b54f..ad564e3351 100644 --- a/src/server/services/agentGroup/index.ts +++ b/src/server/services/agentGroup/index.ts @@ -1,14 +1,14 @@ import { DEFAULT_AGENT_CONFIG, DEFAULT_CHAT_GROUP_CHAT_CONFIG } from '@lobechat/const'; -import type {LobeChatDatabase} from '@lobechat/database'; -import type {LobeAgentConfig} from '@lobechat/types'; +import { type LobeChatDatabase } from '@lobechat/database'; +import { type LobeAgentConfig } from '@lobechat/types'; import { cleanObject, merge } from '@lobechat/utils'; -import type { PartialDeep } from 'type-fest'; +import { type PartialDeep } from 'type-fest'; import { AgentModel } from '@/database/models/agent'; import { ChatGroupModel } from '@/database/models/chatGroup'; -import type {UserModel} from '@/database/models/user'; +import { type UserModel } from '@/database/models/user'; import { AgentGroupRepository } from '@/database/repositories/agentGroup'; -import type {ChatGroupConfig} from '@/database/types/chatGroup'; +import { type ChatGroupConfig } from '@/database/types/chatGroup'; import { getServerDefaultAgentConfig } from '@/server/globalConfig'; type DefaultAgentConfig = Awaited>; diff --git a/src/server/services/agentRuntime/AgentRuntimeService.test.ts b/src/server/services/agentRuntime/AgentRuntimeService.test.ts index 79d6177532..b6f053baea 100644 --- a/src/server/services/agentRuntime/AgentRuntimeService.test.ts +++ b/src/server/services/agentRuntime/AgentRuntimeService.test.ts @@ -4,7 +4,11 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { AgentRuntimeService } from './AgentRuntimeService'; -import type { AgentExecutionParams, OperationCreationParams, StartExecutionParams } from './types'; +import { + type AgentExecutionParams, + type OperationCreationParams, + type StartExecutionParams, +} from './types'; // Mock trusted client to avoid server-side env access vi.mock('@/libs/trusted-client', () => ({ diff --git a/src/server/services/agentRuntime/AgentRuntimeService.ts b/src/server/services/agentRuntime/AgentRuntimeService.ts index b2c7486e13..53808af419 100644 --- a/src/server/services/agentRuntime/AgentRuntimeService.ts +++ b/src/server/services/agentRuntime/AgentRuntimeService.ts @@ -1,26 +1,18 @@ -import type {AgentRuntimeContext, AgentState} from '@lobechat/agent-runtime'; -import { - AgentRuntime, - GeneralChatAgent -} from '@lobechat/agent-runtime'; -import type {ChatMessageError} from '@lobechat/types'; -import { AgentRuntimeErrorType, ChatErrorType } from '@lobechat/types'; +import { type AgentRuntimeContext, type AgentState } from '@lobechat/agent-runtime'; +import { AgentRuntime, GeneralChatAgent } from '@lobechat/agent-runtime'; +import { type ChatMessageError } from '@lobechat/types'; +import { AgentRuntimeErrorType, ChatErrorType } from '@lobechat/types'; import debug from 'debug'; import urlJoin from 'url-join'; import { MessageModel } from '@/database/models/message'; -import type {LobeChatDatabase} from '@/database/type'; +import { type LobeChatDatabase } from '@/database/type'; import { appEnv } from '@/envs/app'; -import type {AgentRuntimeCoordinatorOptions} from '@/server/modules/AgentRuntime'; -import { - AgentRuntimeCoordinator, - createStreamEventManager -} from '@/server/modules/AgentRuntime'; -import type {RuntimeExecutorContext} from '@/server/modules/AgentRuntime/RuntimeExecutors'; -import { - createRuntimeExecutors -} from '@/server/modules/AgentRuntime/RuntimeExecutors'; -import type { IStreamEventManager } from '@/server/modules/AgentRuntime/types'; +import { type AgentRuntimeCoordinatorOptions } from '@/server/modules/AgentRuntime'; +import { AgentRuntimeCoordinator, createStreamEventManager } from '@/server/modules/AgentRuntime'; +import { type RuntimeExecutorContext } from '@/server/modules/AgentRuntime/RuntimeExecutors'; +import { createRuntimeExecutors } from '@/server/modules/AgentRuntime/RuntimeExecutors'; +import { type IStreamEventManager } from '@/server/modules/AgentRuntime/types'; import { mcpService } from '@/server/services/mcp'; import { PluginGatewayService } from '@/server/services/pluginGateway'; import { QueueService } from '@/server/services/queue'; @@ -28,17 +20,17 @@ import { LocalQueueServiceImpl } from '@/server/services/queue/impls'; import { ToolExecutionService } from '@/server/services/toolExecution'; import { BuiltinToolsExecutor } from '@/server/services/toolExecution/builtin'; -import type { - AgentExecutionParams, - AgentExecutionResult, - OperationCreationParams, - OperationCreationResult, - OperationStatusResult, - PendingInterventionsResult, - StartExecutionParams, - StartExecutionResult, - StepCompletionReason, - StepLifecycleCallbacks, +import { + type AgentExecutionParams, + type AgentExecutionResult, + type OperationCreationParams, + type OperationCreationResult, + type OperationStatusResult, + type PendingInterventionsResult, + type StartExecutionParams, + type StartExecutionResult, + type StepCompletionReason, + type StepLifecycleCallbacks, } from './types'; const log = debug('lobe-server:agent-runtime-service'); diff --git a/src/server/services/agentRuntime/__tests__/executeSync.test.ts b/src/server/services/agentRuntime/__tests__/executeSync.test.ts index c8889b5037..46bb1f1623 100644 --- a/src/server/services/agentRuntime/__tests__/executeSync.test.ts +++ b/src/server/services/agentRuntime/__tests__/executeSync.test.ts @@ -1,4 +1,4 @@ -import type { AgentRuntimeContext } from '@lobechat/agent-runtime'; +import { type AgentRuntimeContext } from '@lobechat/agent-runtime'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { diff --git a/src/server/services/agentRuntime/__tests__/stepLifecycleCallbacks.test.ts b/src/server/services/agentRuntime/__tests__/stepLifecycleCallbacks.test.ts index f6a1c610b3..818eb99811 100644 --- a/src/server/services/agentRuntime/__tests__/stepLifecycleCallbacks.test.ts +++ b/src/server/services/agentRuntime/__tests__/stepLifecycleCallbacks.test.ts @@ -1,4 +1,4 @@ -import type { AgentRuntimeContext} from '@lobechat/agent-runtime'; +import { type AgentRuntimeContext } from '@lobechat/agent-runtime'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { @@ -7,7 +7,7 @@ import { } from '@/server/modules/AgentRuntime'; import { AgentRuntimeService } from '../AgentRuntimeService'; -import type { StepCompletionReason, StepLifecycleCallbacks } from '../types'; +import { type StepCompletionReason, type StepLifecycleCallbacks } from '../types'; // Mock database models vi.mock('@/database/models/message', () => ({ diff --git a/src/server/services/agentRuntime/types.ts b/src/server/services/agentRuntime/types.ts index 408dec36bb..f54de8b30b 100644 --- a/src/server/services/agentRuntime/types.ts +++ b/src/server/services/agentRuntime/types.ts @@ -1,6 +1,6 @@ -import type {AgentRuntimeContext, AgentState} from '@lobechat/agent-runtime'; -import type {LobeToolManifest} from '@lobechat/context-engine'; -import type { UserInterventionConfig } from '@lobechat/types'; +import { type AgentRuntimeContext, type AgentState } from '@lobechat/agent-runtime'; +import { type LobeToolManifest } from '@lobechat/context-engine'; +import { type UserInterventionConfig } from '@lobechat/types'; // ==================== Step Lifecycle Callbacks ==================== diff --git a/src/server/services/aiAgent/index.ts b/src/server/services/aiAgent/index.ts index 1c807ab8d4..cb21cff6c0 100644 --- a/src/server/services/aiAgent/index.ts +++ b/src/server/services/aiAgent/index.ts @@ -1,14 +1,14 @@ -import type { AgentRuntimeContext, AgentState } from '@lobechat/agent-runtime'; -import type { LobeToolManifest } from '@lobechat/context-engine'; -import type {LobeChatDatabase} from '@lobechat/database'; -import type { - ExecAgentParams, - ExecAgentResult, - ExecGroupAgentParams, - ExecGroupAgentResult, - ExecSubAgentTaskParams, - ExecSubAgentTaskResult, - UserInterventionConfig, +import { type AgentRuntimeContext, type AgentState } from '@lobechat/agent-runtime'; +import { type LobeToolManifest } from '@lobechat/context-engine'; +import { type LobeChatDatabase } from '@lobechat/database'; +import { + type ExecAgentParams, + type ExecAgentResult, + type ExecGroupAgentParams, + type ExecGroupAgentResult, + type ExecSubAgentTaskParams, + type ExecSubAgentTaskResult, + type UserInterventionConfig, } from '@lobechat/types'; import { ThreadStatus, ThreadType } from '@lobechat/types'; import { nanoid } from '@lobechat/utils'; @@ -20,14 +20,11 @@ import { MessageModel } from '@/database/models/message'; import { PluginModel } from '@/database/models/plugin'; import { ThreadModel } from '@/database/models/thread'; import { TopicModel } from '@/database/models/topic'; -import type {ServerAgentToolsContext} from '@/server/modules/Mecha'; -import { - createServerAgentToolsEngine, - serverMessagesEngine -} from '@/server/modules/Mecha'; +import { type ServerAgentToolsContext } from '@/server/modules/Mecha'; +import { createServerAgentToolsEngine, serverMessagesEngine } from '@/server/modules/Mecha'; import { AgentService } from '@/server/services/agent'; import { AgentRuntimeService } from '@/server/services/agentRuntime'; -import type { StepLifecycleCallbacks } from '@/server/services/agentRuntime/types'; +import { type StepLifecycleCallbacks } from '@/server/services/agentRuntime/types'; import { KlavisService } from '@/server/services/klavis'; import { MarketService } from '@/server/services/market'; diff --git a/src/server/services/aiChat/index.test.ts b/src/server/services/aiChat/index.test.ts index 335f070b2d..83ca722665 100644 --- a/src/server/services/aiChat/index.test.ts +++ b/src/server/services/aiChat/index.test.ts @@ -1,4 +1,4 @@ -import type { LobeChatDatabase } from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { describe, expect, it, vi } from 'vitest'; import { MessageModel } from '@/database/models/message'; diff --git a/src/server/services/aiChat/index.ts b/src/server/services/aiChat/index.ts index ed71147a23..b3c30486ef 100644 --- a/src/server/services/aiChat/index.ts +++ b/src/server/services/aiChat/index.ts @@ -1,4 +1,4 @@ -import type {LobeChatDatabase} from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { MessageModel } from '@/database/models/message'; import { TopicModel } from '@/database/models/topic'; diff --git a/src/server/services/changelog/index.test.ts b/src/server/services/changelog/index.test.ts index 51d55379c4..2d6bcf5602 100644 --- a/src/server/services/changelog/index.test.ts +++ b/src/server/services/changelog/index.test.ts @@ -1,7 +1,7 @@ // @vitest-environment node import { beforeEach, describe, expect, it, vi } from 'vitest'; -import type { ChangelogIndexItem } from '@/types/changelog'; +import { type ChangelogIndexItem } from '@/types/changelog'; import { ChangelogService } from './index'; diff --git a/src/server/services/changelog/index.ts b/src/server/services/changelog/index.ts index bc7abfbe94..03f5f4032b 100644 --- a/src/server/services/changelog/index.ts +++ b/src/server/services/changelog/index.ts @@ -5,8 +5,8 @@ import semver from 'semver'; import urlJoin from 'url-join'; import { FetchCacheTag } from '@/const/cacheControl'; -import type {Locales} from '@/locales/resources'; -import type {ChangelogIndexItem} from '@/types/changelog'; +import { type Locales } from '@/locales/resources'; +import { type ChangelogIndexItem } from '@/types/changelog'; import { markdownToTxt } from '@/utils/markdownToTxt'; const URL_TEMPLATE = 'https://raw.githubusercontent.com/{{user}}/{{repo}}/{{branch}}/{{path}}'; @@ -186,7 +186,9 @@ export class ChangelogService { private genUrl(path: string) { // Custom delimiter set to {{}} - const compiledTemplate = template(this.config.urlTemplate, { interpolate: /\{{([\s\S]+?)\}}/g }); + const compiledTemplate = template(this.config.urlTemplate, { + interpolate: /\{\{([\s\S]+?)\}\}/g, + }); return compiledTemplate({ ...this.config, path }); } diff --git a/src/server/services/chunk/index.ts b/src/server/services/chunk/index.ts index 3c2db4c7b8..10434df8f3 100644 --- a/src/server/services/chunk/index.ts +++ b/src/server/services/chunk/index.ts @@ -1,9 +1,9 @@ -import type {LobeChatDatabase} from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { AsyncTaskModel } from '@/database/models/asyncTask'; import { FileModel } from '@/database/models/file'; -import type {ChunkContentParams} from '@/server/modules/ContentChunk'; -import { ContentChunk } from '@/server/modules/ContentChunk'; +import { type ChunkContentParams } from '@/server/modules/ContentChunk'; +import { ContentChunk } from '@/server/modules/ContentChunk'; import { createAsyncCaller } from '@/server/routers/async'; import { AsyncTaskError, diff --git a/src/server/services/comfyui/__tests__/core/comfyUIAuthService.test.ts b/src/server/services/comfyui/__tests__/core/comfyUIAuthService.test.ts index eb5026b1b3..98b0171ab9 100644 --- a/src/server/services/comfyui/__tests__/core/comfyUIAuthService.test.ts +++ b/src/server/services/comfyui/__tests__/core/comfyUIAuthService.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest'; import { ComfyUIAuthService } from '@/server/services/comfyui/core/comfyUIAuthService'; import { ServicesError } from '@/server/services/comfyui/errors'; -import type { ComfyUIKeyVault } from '@/types/user/settings/keyVaults'; +import { type ComfyUIKeyVault } from '@/types/user/settings/keyVaults'; describe('ComfyUIAuthService', () => { describe('Constructor and initialization', () => { diff --git a/src/server/services/comfyui/__tests__/core/comfyuiClient.test.ts b/src/server/services/comfyui/__tests__/core/comfyuiClient.test.ts index 452825673f..b4f7327a3e 100644 --- a/src/server/services/comfyui/__tests__/core/comfyuiClient.test.ts +++ b/src/server/services/comfyui/__tests__/core/comfyuiClient.test.ts @@ -5,7 +5,7 @@ import { ComfyUIAuthService } from '@/server/services/comfyui/core/comfyUIAuthSe import { ComfyUIClientService } from '@/server/services/comfyui/core/comfyUIClientService'; import { ComfyUIConnectionService } from '@/server/services/comfyui/core/comfyUIConnectionService'; import { ServicesError } from '@/server/services/comfyui/errors'; -import type { ComfyUIKeyVault } from '@/types/user/settings/keyVaults'; +import { type ComfyUIKeyVault } from '@/types/user/settings/keyVaults'; // Mock the SDK vi.mock('@saintno/comfyui-sdk', () => ({ diff --git a/src/server/services/comfyui/__tests__/core/imageService.test.ts b/src/server/services/comfyui/__tests__/core/imageService.test.ts index ec67b7dea5..beba49e44a 100644 --- a/src/server/services/comfyui/__tests__/core/imageService.test.ts +++ b/src/server/services/comfyui/__tests__/core/imageService.test.ts @@ -1,5 +1,5 @@ -import type { CreateImagePayload } from '@lobechat/model-runtime'; -import { AgentRuntimeErrorType } from '@lobechat/model-runtime'; +import { type CreateImagePayload } from '@lobechat/model-runtime'; +import { AgentRuntimeErrorType } from '@lobechat/model-runtime'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { ComfyUIClientService } from '@/server/services/comfyui/core/comfyUIClientService'; diff --git a/src/server/services/comfyui/__tests__/core/modelResolver.test.ts b/src/server/services/comfyui/__tests__/core/modelResolver.test.ts index 8299c2b7cf..da8a6883f3 100644 --- a/src/server/services/comfyui/__tests__/core/modelResolver.test.ts +++ b/src/server/services/comfyui/__tests__/core/modelResolver.test.ts @@ -6,7 +6,7 @@ import { TEST_MODEL_SETS, TEST_SD35_MODELS, } from '@/server/services/comfyui/__tests__/fixtures/testModels'; -import type { ComfyUIClientService } from '@/server/services/comfyui/core/comfyUIClientService'; +import { type ComfyUIClientService } from '@/server/services/comfyui/core/comfyUIClientService'; import { ModelResolverService } from '@/server/services/comfyui/core/modelResolverService'; import { ModelResolverError } from '@/server/services/comfyui/errors/modelResolverError'; diff --git a/src/server/services/comfyui/__tests__/core/workflowBuilder.test.ts b/src/server/services/comfyui/__tests__/core/workflowBuilder.test.ts index ec8710edea..ce6ed95a55 100644 --- a/src/server/services/comfyui/__tests__/core/workflowBuilder.test.ts +++ b/src/server/services/comfyui/__tests__/core/workflowBuilder.test.ts @@ -5,13 +5,10 @@ import { TEST_COMPONENTS, TEST_MODELS, } from '@/server/services/comfyui/__tests__/helpers/realConfigData'; -import type { ComfyUIClientService } from '@/server/services/comfyui/core/comfyUIClientService'; -import type { ModelResolverService } from '@/server/services/comfyui/core/modelResolverService'; -import type { - WorkflowContext} from '@/server/services/comfyui/core/workflowBuilderService'; -import { - WorkflowBuilderService -} from '@/server/services/comfyui/core/workflowBuilderService'; +import { type ComfyUIClientService } from '@/server/services/comfyui/core/comfyUIClientService'; +import { type ModelResolverService } from '@/server/services/comfyui/core/modelResolverService'; +import { type WorkflowContext } from '@/server/services/comfyui/core/workflowBuilderService'; +import { WorkflowBuilderService } from '@/server/services/comfyui/core/workflowBuilderService'; import { WorkflowError } from '@/server/services/comfyui/errors'; // Mock dependencies (must be before other imports) diff --git a/src/server/services/comfyui/__tests__/helpers/mockContext.ts b/src/server/services/comfyui/__tests__/helpers/mockContext.ts index b053e95be0..a00e6c3e29 100644 --- a/src/server/services/comfyui/__tests__/helpers/mockContext.ts +++ b/src/server/services/comfyui/__tests__/helpers/mockContext.ts @@ -4,7 +4,7 @@ import { TEST_COMPONENTS, TEST_FLUX_MODELS, } from '@/server/services/comfyui/__tests__/fixtures/testModels'; -import type { WorkflowContext } from '@/server/services/comfyui/core/workflowBuilderService'; +import { type WorkflowContext } from '@/server/services/comfyui/core/workflowBuilderService'; /** * Create a mock WorkflowContext for testing diff --git a/src/server/services/comfyui/__tests__/utils/imageResizer.test.ts b/src/server/services/comfyui/__tests__/utils/imageResizer.test.ts index 9dcc9abb2d..0dca589072 100644 --- a/src/server/services/comfyui/__tests__/utils/imageResizer.test.ts +++ b/src/server/services/comfyui/__tests__/utils/imageResizer.test.ts @@ -1,10 +1,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; -import type {Architecture} from '@/server/services/comfyui/utils/imageResizer'; -import { - ImageResizer, - imageResizer -} from '@/server/services/comfyui/utils/imageResizer'; +import { type Architecture } from '@/server/services/comfyui/utils/imageResizer'; +import { ImageResizer, imageResizer } from '@/server/services/comfyui/utils/imageResizer'; // Mock debug module vi.mock('debug', () => ({ diff --git a/src/server/services/comfyui/__tests__/utils/workflowDetector.test.ts b/src/server/services/comfyui/__tests__/utils/workflowDetector.test.ts index f3d4b07bb9..96a9b44ea6 100644 --- a/src/server/services/comfyui/__tests__/utils/workflowDetector.test.ts +++ b/src/server/services/comfyui/__tests__/utils/workflowDetector.test.ts @@ -1,12 +1,10 @@ -import type {Mock} from 'vitest'; -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { type Mock } from 'vitest'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; -import type { ModelConfig } from '@/server/services/comfyui/config/modelRegistry'; +import { type ModelConfig } from '@/server/services/comfyui/config/modelRegistry'; import { resolveModel } from '@/server/services/comfyui/utils/staticModelLookup'; -import type {SD3Variant} from '@/server/services/comfyui/utils/workflowDetector'; -import { - WorkflowDetector -} from '@/server/services/comfyui/utils/workflowDetector'; +import { type SD3Variant } from '@/server/services/comfyui/utils/workflowDetector'; +import { WorkflowDetector } from '@/server/services/comfyui/utils/workflowDetector'; // Mock static model lookup functions vi.mock('../../utils/staticModelLookup', () => ({ diff --git a/src/server/services/comfyui/config/fluxModelRegistry.ts b/src/server/services/comfyui/config/fluxModelRegistry.ts index 688e0a4b99..d0ae9918c6 100644 --- a/src/server/services/comfyui/config/fluxModelRegistry.ts +++ b/src/server/services/comfyui/config/fluxModelRegistry.ts @@ -2,7 +2,7 @@ * FLUX Model Registry - Separated for maintainability * Contains all FLUX model family registrations */ -import type { ModelConfig } from './modelRegistry'; +import { type ModelConfig } from './modelRegistry'; /* eslint-disable sort-keys-fix/sort-keys-fix */ export const FLUX_MODEL_REGISTRY: Record = { diff --git a/src/server/services/comfyui/config/sdModelRegistry.ts b/src/server/services/comfyui/config/sdModelRegistry.ts index 58effd51bc..df4d40d8ab 100644 --- a/src/server/services/comfyui/config/sdModelRegistry.ts +++ b/src/server/services/comfyui/config/sdModelRegistry.ts @@ -2,7 +2,7 @@ * Stable Diffusion Model Registry - Separated for maintainability * Contains all SD1.5, SDXL, and SD3.5 model family registrations */ -import type { ModelConfig } from './modelRegistry'; +import { type ModelConfig } from './modelRegistry'; /* eslint-disable sort-keys-fix/sort-keys-fix */ export const SD_MODEL_REGISTRY: Record = { diff --git a/src/server/services/comfyui/config/workflowRegistry.ts b/src/server/services/comfyui/config/workflowRegistry.ts index 67d702c9dc..52219c626b 100644 --- a/src/server/services/comfyui/config/workflowRegistry.ts +++ b/src/server/services/comfyui/config/workflowRegistry.ts @@ -1,6 +1,6 @@ -import type { PromptBuilder } from '@saintno/comfyui-sdk'; +import { type PromptBuilder } from '@saintno/comfyui-sdk'; -import type { WorkflowContext } from '@/server/services/comfyui/core/workflowBuilderService'; +import { type WorkflowContext } from '@/server/services/comfyui/core/workflowBuilderService'; // Import all workflow builders import { buildFluxDevWorkflow } from '@/server/services/comfyui/workflows/flux-dev'; import { buildFluxKontextWorkflow } from '@/server/services/comfyui/workflows/flux-kontext'; diff --git a/src/server/services/comfyui/core/comfyUIAuthService.ts b/src/server/services/comfyui/core/comfyUIAuthService.ts index 1ce3f62feb..36b4fd14e5 100644 --- a/src/server/services/comfyui/core/comfyUIAuthService.ts +++ b/src/server/services/comfyui/core/comfyUIAuthService.ts @@ -4,12 +4,12 @@ * Handles all authentication-related logic for ComfyUI connections * Supports 4 authentication modes: none, basic, bearer, custom */ -import type { ComfyUIKeyVault } from '@lobechat/types'; +import { type ComfyUIKeyVault } from '@lobechat/types'; import { createBasicAuthCredentials } from '@lobechat/utils'; -import type { - BasicCredentials, - BearerTokenCredentials, - CustomCredentials, +import { + type BasicCredentials, + type BearerTokenCredentials, + type CustomCredentials, } from '@saintno/comfyui-sdk'; import debug from 'debug'; diff --git a/src/server/services/comfyui/core/comfyUIClientService.ts b/src/server/services/comfyui/core/comfyUIClientService.ts index 95b00ba329..d03618cb5d 100644 --- a/src/server/services/comfyui/core/comfyUIClientService.ts +++ b/src/server/services/comfyui/core/comfyUIClientService.ts @@ -5,9 +5,9 @@ * Provides unified error handling and abstraction over SDK * Uses modular services for authentication, connection, and caching */ -import type { ComfyUIKeyVault } from '@lobechat/types'; -import type {PromptBuilder} from '@saintno/comfyui-sdk'; -import { CallWrapper, ComfyApi } from '@saintno/comfyui-sdk'; +import { type ComfyUIKeyVault } from '@lobechat/types'; +import { type PromptBuilder } from '@saintno/comfyui-sdk'; +import { CallWrapper, ComfyApi } from '@saintno/comfyui-sdk'; import debug from 'debug'; import { COMFYUI_DEFAULTS } from '@/server/services/comfyui/config/constants'; diff --git a/src/server/services/comfyui/core/errorHandlerService.ts b/src/server/services/comfyui/core/errorHandlerService.ts index 3076bbb736..ab396272ca 100644 --- a/src/server/services/comfyui/core/errorHandlerService.ts +++ b/src/server/services/comfyui/core/errorHandlerService.ts @@ -4,11 +4,8 @@ * Centralized error handling for ComfyUI runtime * Maps internal errors to framework errors */ -import type {ILobeAgentRuntimeErrorType} from '@lobechat/model-runtime'; -import { - AgentRuntimeError, - AgentRuntimeErrorType -} from '@lobechat/model-runtime'; +import { type ILobeAgentRuntimeErrorType } from '@lobechat/model-runtime'; +import { AgentRuntimeError, AgentRuntimeErrorType } from '@lobechat/model-runtime'; import { TRPCError } from '@trpc/server'; import { SYSTEM_COMPONENTS } from '@/server/services/comfyui/config/systemComponents'; diff --git a/src/server/services/comfyui/core/imageService.ts b/src/server/services/comfyui/core/imageService.ts index c5f5e50efb..0152a72d4f 100644 --- a/src/server/services/comfyui/core/imageService.ts +++ b/src/server/services/comfyui/core/imageService.ts @@ -4,14 +4,14 @@ * Business logic for image processing including URL fetching * and workflow execution */ -import type { CreateImagePayload, CreateImageResponse } from '@lobechat/model-runtime'; -import type {PromptBuilder} from '@saintno/comfyui-sdk'; +import { type CreateImagePayload, type CreateImageResponse } from '@lobechat/model-runtime'; +import { type PromptBuilder } from '@saintno/comfyui-sdk'; import debug from 'debug'; -import type {ComfyUIClientService} from '@/server/services/comfyui/core/comfyUIClientService'; +import { type ComfyUIClientService } from '@/server/services/comfyui/core/comfyUIClientService'; import { ErrorHandlerService } from '@/server/services/comfyui/core/errorHandlerService'; -import type {ModelResolverService} from '@/server/services/comfyui/core/modelResolverService'; -import type {WorkflowBuilderService} from '@/server/services/comfyui/core/workflowBuilderService'; +import { type ModelResolverService } from '@/server/services/comfyui/core/modelResolverService'; +import { type WorkflowBuilderService } from '@/server/services/comfyui/core/workflowBuilderService'; import { ServicesError } from '@/server/services/comfyui/errors'; import { imageResizer } from '@/server/services/comfyui/utils/imageResizer'; import { WorkflowDetector } from '@/server/services/comfyui/utils/workflowDetector'; diff --git a/src/server/services/comfyui/core/modelResolverService.ts b/src/server/services/comfyui/core/modelResolverService.ts index 85d968620e..60b0c3cc77 100644 --- a/src/server/services/comfyui/core/modelResolverService.ts +++ b/src/server/services/comfyui/core/modelResolverService.ts @@ -16,7 +16,7 @@ import { MODEL_REGISTRY, } from '@/server/services/comfyui/config/modelRegistry'; import { SYSTEM_COMPONENTS } from '@/server/services/comfyui/config/systemComponents'; -import type {ComfyUIClientService} from '@/server/services/comfyui/core/comfyUIClientService'; +import { type ComfyUIClientService } from '@/server/services/comfyui/core/comfyUIClientService'; import { ModelResolverError } from '@/server/services/comfyui/errors/modelResolverError'; import { TTLCacheManager } from '@/server/services/comfyui/utils/cacheManager'; import { getModelsByVariant } from '@/server/services/comfyui/utils/staticModelLookup'; diff --git a/src/server/services/comfyui/core/workflowBuilderService.ts b/src/server/services/comfyui/core/workflowBuilderService.ts index 2e14fc607f..79e05d0799 100644 --- a/src/server/services/comfyui/core/workflowBuilderService.ts +++ b/src/server/services/comfyui/core/workflowBuilderService.ts @@ -4,14 +4,14 @@ * Coordinator service for routing workflow requests to specific implementations * Maintains clean separation between coordination and business logic */ -import type {PromptBuilder} from '@saintno/comfyui-sdk'; +import { type PromptBuilder } from '@saintno/comfyui-sdk'; import debug from 'debug'; import { getWorkflowBuilder } from '@/server/services/comfyui/config/workflowRegistry'; -import type {ComfyUIClientService} from '@/server/services/comfyui/core/comfyUIClientService'; -import type {ModelResolverService} from '@/server/services/comfyui/core/modelResolverService'; +import { type ComfyUIClientService } from '@/server/services/comfyui/core/comfyUIClientService'; +import { type ModelResolverService } from '@/server/services/comfyui/core/modelResolverService'; import { WorkflowError } from '@/server/services/comfyui/errors'; -import type { WorkflowDetectionResult } from '@/server/services/comfyui/utils/workflowDetector'; +import { type WorkflowDetectionResult } from '@/server/services/comfyui/utils/workflowDetector'; const log = debug('lobe-image:comfyui:workflow-builder'); diff --git a/src/server/services/comfyui/types/index.ts b/src/server/services/comfyui/types/index.ts index d1617e6f36..6f13491a1c 100644 --- a/src/server/services/comfyui/types/index.ts +++ b/src/server/services/comfyui/types/index.ts @@ -1,4 +1,4 @@ -import type { ComfyUIKeyVault } from '@lobechat/types'; +import { type ComfyUIKeyVault } from '@lobechat/types'; export interface ComfyUIServiceConfig { baseURL: string; diff --git a/src/server/services/comfyui/utils/staticModelLookup.ts b/src/server/services/comfyui/utils/staticModelLookup.ts index fee7588fad..8a1c64207e 100644 --- a/src/server/services/comfyui/utils/staticModelLookup.ts +++ b/src/server/services/comfyui/utils/staticModelLookup.ts @@ -6,10 +6,10 @@ */ import debug from 'debug'; -import type {ModelConfig} from '@/server/services/comfyui/config/modelRegistry'; +import { type ModelConfig } from '@/server/services/comfyui/config/modelRegistry'; import { MODEL_ID_VARIANT_MAP, - MODEL_REGISTRY + MODEL_REGISTRY, } from '@/server/services/comfyui/config/modelRegistry'; const log = debug('lobe-image:comfyui:static-model-lookup'); diff --git a/src/server/services/comfyui/workflows/flux-dev.ts b/src/server/services/comfyui/workflows/flux-dev.ts index 5c5094b372..d62dd6c5bb 100644 --- a/src/server/services/comfyui/workflows/flux-dev.ts +++ b/src/server/services/comfyui/workflows/flux-dev.ts @@ -2,7 +2,7 @@ import { generateUniqueSeeds } from '@lobechat/utils'; import { PromptBuilder } from '@saintno/comfyui-sdk'; import { WORKFLOW_DEFAULTS } from '@/server/services/comfyui/config/constants'; -import type { WorkflowContext } from '@/server/services/comfyui/core/workflowBuilderService'; +import { type WorkflowContext } from '@/server/services/comfyui/core/workflowBuilderService'; import { splitPromptForDualCLIP } from '@/server/services/comfyui/utils/promptSplitter'; import { selectOptimalWeightDtype } from '@/server/services/comfyui/utils/weightDType'; import { getWorkflowFilenamePrefix } from '@/server/services/comfyui/utils/workflowUtils'; diff --git a/src/server/services/comfyui/workflows/flux-kontext.ts b/src/server/services/comfyui/workflows/flux-kontext.ts index a217521467..fe4e21bc17 100644 --- a/src/server/services/comfyui/workflows/flux-kontext.ts +++ b/src/server/services/comfyui/workflows/flux-kontext.ts @@ -2,7 +2,7 @@ import { generateUniqueSeeds } from '@lobechat/utils'; import { PromptBuilder } from '@saintno/comfyui-sdk'; import { WORKFLOW_DEFAULTS } from '@/server/services/comfyui/config/constants'; -import type { WorkflowContext } from '@/server/services/comfyui/core/workflowBuilderService'; +import { type WorkflowContext } from '@/server/services/comfyui/core/workflowBuilderService'; import { splitPromptForDualCLIP } from '@/server/services/comfyui/utils/promptSplitter'; import { selectOptimalWeightDtype } from '@/server/services/comfyui/utils/weightDType'; import { getWorkflowFilenamePrefix } from '@/server/services/comfyui/utils/workflowUtils'; diff --git a/src/server/services/comfyui/workflows/flux-schnell.ts b/src/server/services/comfyui/workflows/flux-schnell.ts index dd64520169..cbe064efe9 100644 --- a/src/server/services/comfyui/workflows/flux-schnell.ts +++ b/src/server/services/comfyui/workflows/flux-schnell.ts @@ -2,7 +2,7 @@ import { generateUniqueSeeds } from '@lobechat/utils'; import { PromptBuilder } from '@saintno/comfyui-sdk'; import { WORKFLOW_DEFAULTS } from '@/server/services/comfyui/config/constants'; -import type { WorkflowContext } from '@/server/services/comfyui/core/workflowBuilderService'; +import { type WorkflowContext } from '@/server/services/comfyui/core/workflowBuilderService'; import { splitPromptForDualCLIP } from '@/server/services/comfyui/utils/promptSplitter'; import { selectOptimalWeightDtype } from '@/server/services/comfyui/utils/weightDType'; import { getWorkflowFilenamePrefix } from '@/server/services/comfyui/utils/workflowUtils'; diff --git a/src/server/services/comfyui/workflows/sd35.ts b/src/server/services/comfyui/workflows/sd35.ts index f8c371e22c..fffdf0d133 100644 --- a/src/server/services/comfyui/workflows/sd35.ts +++ b/src/server/services/comfyui/workflows/sd35.ts @@ -13,7 +13,7 @@ import { DEFAULT_NEGATIVE_PROMPT, WORKFLOW_DEFAULTS, } from '@/server/services/comfyui/config/constants'; -import type { WorkflowContext } from '@/server/services/comfyui/core/workflowBuilderService'; +import { type WorkflowContext } from '@/server/services/comfyui/core/workflowBuilderService'; import { WorkflowError } from '@/server/services/comfyui/errors'; import { getWorkflowFilenamePrefix } from '@/server/services/comfyui/utils/workflowUtils'; diff --git a/src/server/services/comfyui/workflows/simple-sd.ts b/src/server/services/comfyui/workflows/simple-sd.ts index 5ed52f241d..5aa40a448b 100644 --- a/src/server/services/comfyui/workflows/simple-sd.ts +++ b/src/server/services/comfyui/workflows/simple-sd.ts @@ -18,8 +18,8 @@ import { DEFAULT_NEGATIVE_PROMPT, WORKFLOW_DEFAULTS, } from '@/server/services/comfyui/config/constants'; -import type {ModelConfig} from '@/server/services/comfyui/config/modelRegistry'; -import type { WorkflowContext } from '@/server/services/comfyui/core/workflowBuilderService'; +import { type ModelConfig } from '@/server/services/comfyui/config/modelRegistry'; +import { type WorkflowContext } from '@/server/services/comfyui/core/workflowBuilderService'; import { getModelConfig } from '@/server/services/comfyui/utils/staticModelLookup'; import { getWorkflowFilenamePrefix } from '@/server/services/comfyui/utils/workflowUtils'; diff --git a/src/server/services/desktopRelease/index.test.ts b/src/server/services/desktopRelease/index.test.ts index 5291bfafbe..dfb86c4001 100644 --- a/src/server/services/desktopRelease/index.test.ts +++ b/src/server/services/desktopRelease/index.test.ts @@ -1,10 +1,7 @@ import { describe, expect, it } from 'vitest'; -import type {DesktopDownloadType} from './index'; -import { - resolveDesktopDownload, - resolveDesktopDownloadFromUrls -} from './index'; +import { type DesktopDownloadType } from './index'; +import { resolveDesktopDownload, resolveDesktopDownloadFromUrls } from './index'; const mockRelease = { assets: [ diff --git a/src/server/services/discover/index.ts b/src/server/services/discover/index.ts index a4d204dd46..6ce2430b36 100644 --- a/src/server/services/discover/index.ts +++ b/src/server/services/discover/index.ts @@ -6,7 +6,31 @@ import { isDesktop, KLAVIS_SERVER_TYPES, } from '@lobechat/const'; -import type {AgentStatus, AssistantListResponse, AssistantMarketSource, AssistantQueryParams, DiscoverAssistantDetail, DiscoverAssistantItem, DiscoverMcpDetail, DiscoverModelDetail, DiscoverModelItem, DiscoverPluginDetail, DiscoverPluginItem, DiscoverProviderDetail, DiscoverProviderItem, DiscoverUserProfile, IdentifiersResponse, McpListResponse, McpQueryParams, ModelListResponse, ModelQueryParams, PluginListResponse, PluginQueryParams, ProviderListResponse, ProviderQueryParams} from '@lobechat/types'; +import { + type AgentStatus, + type AssistantListResponse, + type AssistantMarketSource, + type AssistantQueryParams, + type DiscoverAssistantDetail, + type DiscoverAssistantItem, + type DiscoverMcpDetail, + type DiscoverModelDetail, + type DiscoverModelItem, + type DiscoverPluginDetail, + type DiscoverPluginItem, + type DiscoverProviderDetail, + type DiscoverProviderItem, + type DiscoverUserProfile, + type IdentifiersResponse, + type McpListResponse, + type McpQueryParams, + type ModelListResponse, + type ModelQueryParams, + type PluginListResponse, + type PluginQueryParams, + type ProviderListResponse, + type ProviderQueryParams, +} from '@lobechat/types'; import { AssistantCategory, AssistantSorts, @@ -16,24 +40,24 @@ import { McpSorts, ModelSorts, PluginSorts, - ProviderSorts + ProviderSorts, } from '@lobechat/types'; import { getAudioInputUnitRate, getTextInputUnitRate, getTextOutputUnitRate, } from '@lobechat/utils'; -import type { - CategoryItem, - CategoryListQuery, - MarketSDK, - UserInfoResponse, +import { + type CategoryItem, + type CategoryListQuery, + type MarketSDK, + type UserInfoResponse, } from '@lobehub/market-sdk'; -import type { - AgentEventRequest, - CallReportRequest, - InstallReportRequest, - PluginEventRequest, +import { + type AgentEventRequest, + type CallReportRequest, + type InstallReportRequest, + type PluginEventRequest, } from '@lobehub/market-types'; import dayjs from 'dayjs'; import debug from 'debug'; @@ -41,7 +65,7 @@ import { cloneDeep, countBy, isString, merge, uniq, uniqBy } from 'es-toolkit/co import matter from 'gray-matter'; import urlJoin from 'url-join'; -import type {TrustedClientUserInfo} from '@/libs/trusted-client'; +import { type TrustedClientUserInfo } from '@/libs/trusted-client'; import { normalizeLocale } from '@/locales/resources'; import { AssistantStore } from '@/server/modules/AssistantStore'; import { PluginStore } from '@/server/modules/PluginStore'; diff --git a/src/server/services/document/index.ts b/src/server/services/document/index.ts index 6e37dc0dc3..3348f45fe5 100644 --- a/src/server/services/document/index.ts +++ b/src/server/services/document/index.ts @@ -1,13 +1,13 @@ -import type {LobeChatDatabase} from '@lobechat/database'; -import type {DocumentItem} from '@lobechat/database/schemas'; -import { documents, files } from '@lobechat/database/schemas'; +import { type LobeChatDatabase } from '@lobechat/database'; +import { type DocumentItem } from '@lobechat/database/schemas'; +import { documents, files } from '@lobechat/database/schemas'; import { loadFile } from '@lobechat/file-loaders'; import debug from 'debug'; import { and, eq } from 'drizzle-orm'; import { DocumentModel } from '@/database/models/document'; import { FileModel } from '@/database/models/file'; -import type {LobeDocument} from '@/types/document'; +import { type LobeDocument } from '@/types/document'; import { FileService } from '../file'; diff --git a/src/server/services/email/impls/index.ts b/src/server/services/email/impls/index.ts index a354b99520..dd3813bb8e 100644 --- a/src/server/services/email/impls/index.ts +++ b/src/server/services/email/impls/index.ts @@ -1,6 +1,6 @@ import { NodemailerImpl } from './nodemailer'; import { ResendImpl } from './resend'; -import type {EmailServiceImpl} from './type'; +import { type EmailServiceImpl } from './type'; /** * Available email service implementations diff --git a/src/server/services/email/impls/nodemailer/index.ts b/src/server/services/email/impls/nodemailer/index.ts index 4d5dc065dc..dfb5deb451 100644 --- a/src/server/services/email/impls/nodemailer/index.ts +++ b/src/server/services/email/impls/nodemailer/index.ts @@ -1,12 +1,12 @@ import { TRPCError } from '@trpc/server'; import debug from 'debug'; -import type { Transporter } from 'nodemailer'; +import { type Transporter } from 'nodemailer'; import nodemailer from 'nodemailer'; import { emailEnv } from '@/envs/email'; -import type {EmailPayload, EmailResponse, EmailServiceImpl} from '../type'; -import type {NodemailerConfig} from './type'; +import { type EmailPayload, type EmailResponse, type EmailServiceImpl } from '../type'; +import { type NodemailerConfig } from './type'; const log = debug('lobe-email:Nodemailer'); diff --git a/src/server/services/email/impls/resend/index.ts b/src/server/services/email/impls/resend/index.ts index 6b7963e460..714d388c0b 100644 --- a/src/server/services/email/impls/resend/index.ts +++ b/src/server/services/email/impls/resend/index.ts @@ -1,11 +1,11 @@ import { TRPCError } from '@trpc/server'; import debug from 'debug'; -import type { CreateEmailOptions } from 'resend'; +import { type CreateEmailOptions } from 'resend'; import { Resend } from 'resend'; import { emailEnv } from '@/envs/email'; -import type {EmailPayload, EmailResponse, EmailServiceImpl} from '../type'; +import { type EmailPayload, type EmailResponse, type EmailServiceImpl } from '../type'; const log = debug('lobe-email:Resend'); diff --git a/src/server/services/email/index.ts b/src/server/services/email/index.ts index b900a43295..7a8a46c43c 100644 --- a/src/server/services/email/index.ts +++ b/src/server/services/email/index.ts @@ -1,7 +1,7 @@ import { emailEnv } from '@/envs/email'; -import type {EmailPayload, EmailResponse, EmailServiceImpl} from './impls'; -import { createEmailServiceImpl , EmailImplType } from './impls'; +import { type EmailPayload, type EmailResponse, type EmailServiceImpl } from './impls'; +import { createEmailServiceImpl, EmailImplType } from './impls'; /** * Email service class diff --git a/src/server/services/file/impls/index.ts b/src/server/services/file/impls/index.ts index 0bdb9ae7f8..0a78a4f6c2 100644 --- a/src/server/services/file/impls/index.ts +++ b/src/server/services/file/impls/index.ts @@ -1,7 +1,7 @@ -import type { LobeChatDatabase } from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { S3StaticFileImpl } from './s3'; -import type {FileServiceImpl} from './type'; +import { type FileServiceImpl } from './type'; /** * Create file service module diff --git a/src/server/services/file/impls/s3.ts b/src/server/services/file/impls/s3.ts index 475b40943a..535b74eaf4 100644 --- a/src/server/services/file/impls/s3.ts +++ b/src/server/services/file/impls/s3.ts @@ -1,11 +1,11 @@ -import type { LobeChatDatabase } from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import urlJoin from 'url-join'; import { FileModel } from '@/database/models/file'; import { fileEnv } from '@/envs/file'; import { FileS3 } from '@/server/modules/S3'; -import type {FileServiceImpl} from './type'; +import { type FileServiceImpl } from './type'; /** * S3-based file service implementation diff --git a/src/server/services/file/index.ts b/src/server/services/file/index.ts index ee69897c7a..a2209fd39e 100644 --- a/src/server/services/file/index.ts +++ b/src/server/services/file/index.ts @@ -1,16 +1,16 @@ -import type {LobeChatDatabase} from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { inferContentTypeFromImageUrl, nanoid, uuid } from '@lobechat/utils'; import { TRPCError } from '@trpc/server'; import { sha256 } from 'js-sha256'; import { serverDBEnv } from '@/config/db'; import { FileModel } from '@/database/models/file'; -import type {FileItem} from '@/database/schemas'; +import { type FileItem } from '@/database/schemas'; import { appEnv } from '@/envs/app'; import { TempFileManager } from '@/server/utils/tempFileManager'; import { createFileServiceModule } from './impls'; -import type {FileServiceImpl} from './impls/type'; +import { type FileServiceImpl } from './impls/type'; /** * File service class diff --git a/src/server/services/generation/index.ts b/src/server/services/generation/index.ts index abdd2ffec7..be3eb6c43e 100644 --- a/src/server/services/generation/index.ts +++ b/src/server/services/generation/index.ts @@ -1,4 +1,4 @@ -import type {LobeChatDatabase} from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { parseDataUri } from '@lobechat/model-runtime'; import debug from 'debug'; import { sha256 } from 'js-sha256'; diff --git a/src/server/services/klavis/index.ts b/src/server/services/klavis/index.ts index 8662e46ae8..c0081c9eaf 100644 --- a/src/server/services/klavis/index.ts +++ b/src/server/services/klavis/index.ts @@ -1,10 +1,10 @@ -import type { LobeToolManifest } from '@lobechat/context-engine'; -import type { LobeChatDatabase } from '@lobechat/database'; +import { type LobeToolManifest } from '@lobechat/context-engine'; +import { type LobeChatDatabase } from '@lobechat/database'; import debug from 'debug'; import { PluginModel } from '@/database/models/plugin'; import { getKlavisClient, isKlavisClientAvailable } from '@/libs/klavis'; -import type {ToolExecutionResult} from '@/server/services/toolExecution/types'; +import { type ToolExecutionResult } from '@/server/services/toolExecution/types'; const log = debug('lobe-server:klavis-service'); diff --git a/src/server/services/market/index.ts b/src/server/services/market/index.ts index abf4546f6b..2464f26add 100644 --- a/src/server/services/market/index.ts +++ b/src/server/services/market/index.ts @@ -1,13 +1,10 @@ -import type { LobeToolManifest } from '@lobechat/context-engine'; +import { type LobeToolManifest } from '@lobechat/context-engine'; import { MarketSDK } from '@lobehub/market-sdk'; import debug from 'debug'; -import type {NextRequest} from 'next/server'; +import { type NextRequest } from 'next/server'; -import type {TrustedClientUserInfo} from '@/libs/trusted-client'; -import { - generateTrustedClientToken, - getTrustedClientTokenForSession -} from '@/libs/trusted-client'; +import { type TrustedClientUserInfo } from '@/libs/trusted-client'; +import { generateTrustedClientToken, getTrustedClientTokenForSession } from '@/libs/trusted-client'; const log = debug('lobe-server:market-service'); diff --git a/src/server/services/mcp/contentProcessor.ts b/src/server/services/mcp/contentProcessor.ts index 315eb9ed90..3ce0fec365 100644 --- a/src/server/services/mcp/contentProcessor.ts +++ b/src/server/services/mcp/contentProcessor.ts @@ -4,8 +4,8 @@ import urlJoin from 'url-join'; import { appEnv } from '@/envs/app'; import { fileEnv } from '@/envs/file'; -import type {AudioContent, ImageContent, ToolCallContent} from '@/libs/mcp'; -import type {FileService} from '@/server/services/file'; +import { type AudioContent, type ImageContent, type ToolCallContent } from '@/libs/mcp'; +import { type FileService } from '@/server/services/file'; import { nanoid } from '@/utils/uuid'; const log = debug('lobe-mcp:content-processor'); diff --git a/src/server/services/mcp/deps/MCPSystemDepsCheckService.test.ts b/src/server/services/mcp/deps/MCPSystemDepsCheckService.test.ts index dc726bfe50..784c3628b8 100644 --- a/src/server/services/mcp/deps/MCPSystemDepsCheckService.test.ts +++ b/src/server/services/mcp/deps/MCPSystemDepsCheckService.test.ts @@ -1,9 +1,9 @@ -import type { DeploymentOption, SystemDependency } from '@lobehub/market-sdk'; +import { type DeploymentOption, type SystemDependency } from '@lobehub/market-sdk'; import { beforeEach, describe, expect, it, vi } from 'vitest'; // Import after mock setup import { mcpSystemDepsCheckService } from './MCPSystemDepsCheckService'; -import type { InstallationChecker } from './types'; +import { type InstallationChecker } from './types'; // Hoist the mock to ensure it's available in the factory const { mockExecPromise } = vi.hoisted(() => { diff --git a/src/server/services/mcp/deps/MCPSystemDepsCheckService.ts b/src/server/services/mcp/deps/MCPSystemDepsCheckService.ts index fddf548314..7e58f8bd10 100644 --- a/src/server/services/mcp/deps/MCPSystemDepsCheckService.ts +++ b/src/server/services/mcp/deps/MCPSystemDepsCheckService.ts @@ -1,12 +1,12 @@ import { exec } from 'node:child_process'; import { promisify } from 'node:util'; -import type {DeploymentOption, SystemDependency} from '@lobehub/market-sdk'; +import { type DeploymentOption, type SystemDependency } from '@lobehub/market-sdk'; import debug from 'debug'; -import type {SystemDependencyCheckResult} from '@/types/plugins'; +import { type SystemDependencyCheckResult } from '@/types/plugins'; -import type {InstallationChecker, PackageInstallCheckResult} from './types'; +import { type InstallationChecker, type PackageInstallCheckResult } from './types'; const execPromise = promisify(exec); const log = debug('lobe-mcp:deps-check'); @@ -200,11 +200,11 @@ class MCPSystemDepsCheckService { const configSchema = option.connection?.configSchema; const needsConfig = Boolean( configSchema && - // Check if there's a non-empty required array - ((Array.isArray(configSchema.required) && configSchema.required.length > 0) || - // Check if any field in properties is marked as required - (configSchema.properties && - Object.values(configSchema.properties).some((prop: any) => prop.required === true))), + // Check if there's a non-empty required array + ((Array.isArray(configSchema.required) && configSchema.required.length > 0) || + // Check if any field in properties is marked as required + (configSchema.properties && + Object.values(configSchema.properties).some((prop: any) => prop.required === true))), ); log( diff --git a/src/server/services/mcp/deps/checkers/ManualInstallationChecker.ts b/src/server/services/mcp/deps/checkers/ManualInstallationChecker.ts index 26b482700b..ea4c251c39 100644 --- a/src/server/services/mcp/deps/checkers/ManualInstallationChecker.ts +++ b/src/server/services/mcp/deps/checkers/ManualInstallationChecker.ts @@ -1,4 +1,4 @@ -import type {InstallationChecker, PackageInstallCheckResult} from '../types'; +import { type InstallationChecker, type PackageInstallCheckResult } from '../types'; /** * Manual Installation Checker diff --git a/src/server/services/mcp/deps/checkers/NpmInstallationChecker.ts b/src/server/services/mcp/deps/checkers/NpmInstallationChecker.ts index 846ec4198d..28e94cf7d9 100644 --- a/src/server/services/mcp/deps/checkers/NpmInstallationChecker.ts +++ b/src/server/services/mcp/deps/checkers/NpmInstallationChecker.ts @@ -1,7 +1,7 @@ import { exec } from 'node:child_process'; import { promisify } from 'node:util'; -import type {InstallationChecker, PackageInstallCheckResult} from '../types'; +import { type InstallationChecker, type PackageInstallCheckResult } from '../types'; const execPromise = promisify(exec); diff --git a/src/server/services/mcp/deps/checkers/PythonInstallationChecker.ts b/src/server/services/mcp/deps/checkers/PythonInstallationChecker.ts index 009c5aee93..a1066bc4cb 100644 --- a/src/server/services/mcp/deps/checkers/PythonInstallationChecker.ts +++ b/src/server/services/mcp/deps/checkers/PythonInstallationChecker.ts @@ -1,7 +1,7 @@ import { exec } from 'node:child_process'; import { promisify } from 'node:util'; -import type {InstallationChecker, PackageInstallCheckResult} from '../types'; +import { type InstallationChecker, type PackageInstallCheckResult } from '../types'; const execPromise = promisify(exec); diff --git a/src/server/services/mcp/index.ts b/src/server/services/mcp/index.ts index f9fe2083da..54a0ca8bff 100644 --- a/src/server/services/mcp/index.ts +++ b/src/server/services/mcp/index.ts @@ -1,19 +1,27 @@ -import type {CheckMcpInstallResult, CustomPluginMetadata} from '@lobechat/types'; +import { type CheckMcpInstallResult, type CustomPluginMetadata } from '@lobechat/types'; import { safeParseJSON } from '@lobechat/utils'; -import type { LobeChatPluginApi, LobeChatPluginManifest, PluginSchema } from '@lobehub/chat-plugin-sdk'; -import type {DeploymentOption} from '@lobehub/market-sdk'; +import { + type LobeChatPluginApi, + type LobeChatPluginManifest, + type PluginSchema, +} from '@lobehub/chat-plugin-sdk'; +import { type DeploymentOption } from '@lobehub/market-sdk'; import { McpError } from '@modelcontextprotocol/sdk/types.js'; import { TRPCError } from '@trpc/server'; import retry from 'async-retry'; import debug from 'debug'; -import type {MCPClientParams, McpPrompt, McpResource, McpTool, StdioMCPParams} from '@/libs/mcp'; import { - MCPClient + type MCPClientParams, + type McpPrompt, + type McpResource, + type McpTool, + type StdioMCPParams, } from '@/libs/mcp'; +import { MCPClient } from '@/libs/mcp'; -import type {ProcessContentBlocksFn} from './contentProcessor'; -import { contentBlocksToString } from './contentProcessor'; +import { type ProcessContentBlocksFn } from './contentProcessor'; +import { contentBlocksToString } from './contentProcessor'; import { mcpSystemDepsCheckService } from './deps'; const log = debug('lobe-mcp:service'); @@ -74,7 +82,7 @@ export class MCPService { private sanitizeForLogging = >(obj: T): Omit => { if (!obj) return obj; - + const { env: _, ...rest } = obj; return rest as Omit; }; diff --git a/src/server/services/memory/userMemory/__tests__/extract.payload.test.ts b/src/server/services/memory/userMemory/__tests__/extract.payload.test.ts index 4f54e7c447..ab20320d49 100644 --- a/src/server/services/memory/userMemory/__tests__/extract.payload.test.ts +++ b/src/server/services/memory/userMemory/__tests__/extract.payload.test.ts @@ -2,11 +2,11 @@ import { describe, expect, it } from 'vitest'; import { LayersEnum, MemorySourceType } from '@/types/userMemory'; -import type {MemoryExtractionNormalizedPayload, MemoryExtractionPayloadInput} from '../extract'; import { - buildWorkflowPayloadInput, - normalizeMemoryExtractionPayload + type MemoryExtractionNormalizedPayload, + type MemoryExtractionPayloadInput, } from '../extract'; +import { buildWorkflowPayloadInput, normalizeMemoryExtractionPayload } from '../extract'; describe('normalizeMemoryExtractionPayload', () => { it('normalizes sources, layers, ids, and dates with fallback baseUrl', () => { diff --git a/src/server/services/memory/userMemory/__tests__/extract.runtime.test.ts b/src/server/services/memory/userMemory/__tests__/extract.runtime.test.ts index d131fc34c6..4b1836ca84 100644 --- a/src/server/services/memory/userMemory/__tests__/extract.runtime.test.ts +++ b/src/server/services/memory/userMemory/__tests__/extract.runtime.test.ts @@ -1,8 +1,8 @@ -import type { AiProviderRuntimeState } from '@lobechat/types'; -import type { EnabledAiModel } from 'model-bank'; +import { type AiProviderRuntimeState } from '@lobechat/types'; +import { type EnabledAiModel } from 'model-bank'; import { describe, expect, it, vi } from 'vitest'; -import type { MemoryExtractionPrivateConfig } from '@/server/globalConfig/parseMemoryExtractionConfig'; +import { type MemoryExtractionPrivateConfig } from '@/server/globalConfig/parseMemoryExtractionConfig'; import { MemoryExtractionExecutor } from '../extract'; @@ -48,7 +48,6 @@ const createExecutor = (privateOverrides?: Partial ['news'].includes(cat)), + // Exa only supports news type + category: params?.searchCategories?.find((cat) => ['news'].includes(cat)), }; log('Constructed request body: %o', body); diff --git a/src/server/services/search/impls/firecrawl/index.ts b/src/server/services/search/impls/firecrawl/index.ts index 69e58f7f85..96a0d53758 100644 --- a/src/server/services/search/impls/firecrawl/index.ts +++ b/src/server/services/search/impls/firecrawl/index.ts @@ -1,10 +1,14 @@ -import type {SearchParams, UniformSearchResponse, UniformSearchResult} from '@lobechat/types'; +import { + type SearchParams, + type UniformSearchResponse, + type UniformSearchResult, +} from '@lobechat/types'; import { TRPCError } from '@trpc/server'; import debug from 'debug'; import urlJoin from 'url-join'; -import type {SearchServiceImpl} from '../type'; -import type {FirecrawlResponse, FirecrawlSearchParameters} from './type'; +import { type SearchServiceImpl } from '../type'; +import { type FirecrawlResponse, type FirecrawlSearchParameters } from './type'; const log = debug('lobe-search:Firecrawl'); diff --git a/src/server/services/search/impls/google/index.ts b/src/server/services/search/impls/google/index.ts index 9d67dfbc20..38c046bd50 100644 --- a/src/server/services/search/impls/google/index.ts +++ b/src/server/services/search/impls/google/index.ts @@ -1,10 +1,14 @@ -import type {SearchParams, UniformSearchResponse, UniformSearchResult} from '@lobechat/types'; +import { + type SearchParams, + type UniformSearchResponse, + type UniformSearchResult, +} from '@lobechat/types'; import { TRPCError } from '@trpc/server'; import debug from 'debug'; import urlJoin from 'url-join'; -import type {SearchServiceImpl} from '../type'; -import type {GoogleResponse, GoogleSearchParameters} from './type'; +import { type SearchServiceImpl } from '../type'; +import { type GoogleResponse, type GoogleSearchParameters } from './type'; const log = debug('lobe-search:Google'); diff --git a/src/server/services/search/impls/index.ts b/src/server/services/search/impls/index.ts index 550e21b1e0..81d462aeb9 100644 --- a/src/server/services/search/impls/index.ts +++ b/src/server/services/search/impls/index.ts @@ -9,7 +9,7 @@ import { KagiImpl } from './kagi'; import { Search1APIImpl } from './search1api'; import { SearXNGImpl } from './searxng'; import { TavilyImpl } from './tavily'; -import type {SearchServiceImpl} from './type'; +import { type SearchServiceImpl } from './type'; /** * Available search service implementations diff --git a/src/server/services/search/impls/jina/index.ts b/src/server/services/search/impls/jina/index.ts index e68795d7c8..ba382d102b 100644 --- a/src/server/services/search/impls/jina/index.ts +++ b/src/server/services/search/impls/jina/index.ts @@ -1,10 +1,14 @@ -import type {SearchParams, UniformSearchResponse, UniformSearchResult} from '@lobechat/types'; +import { + type SearchParams, + type UniformSearchResponse, + type UniformSearchResult, +} from '@lobechat/types'; import { TRPCError } from '@trpc/server'; import debug from 'debug'; import urlJoin from 'url-join'; -import type {SearchServiceImpl} from '../type'; -import type {JinaResponse, JinaSearchParameters} from './type'; +import { type SearchServiceImpl } from '../type'; +import { type JinaResponse, type JinaSearchParameters } from './type'; const log = debug('lobe-search:Jina'); diff --git a/src/server/services/search/impls/kagi/index.ts b/src/server/services/search/impls/kagi/index.ts index 2bb64a5523..7c35980ef8 100644 --- a/src/server/services/search/impls/kagi/index.ts +++ b/src/server/services/search/impls/kagi/index.ts @@ -1,10 +1,14 @@ -import type {SearchParams, UniformSearchResponse, UniformSearchResult} from '@lobechat/types'; +import { + type SearchParams, + type UniformSearchResponse, + type UniformSearchResult, +} from '@lobechat/types'; import { TRPCError } from '@trpc/server'; import debug from 'debug'; import urlJoin from 'url-join'; -import type {SearchServiceImpl} from '../type'; -import type {KagiResponse, KagiSearchParameters} from './type'; +import { type SearchServiceImpl } from '../type'; +import { type KagiResponse, type KagiSearchParameters } from './type'; const log = debug('lobe-search:Kagi'); diff --git a/src/server/services/search/impls/search1api/index.ts b/src/server/services/search/impls/search1api/index.ts index 106143f2f8..e10199d55b 100644 --- a/src/server/services/search/impls/search1api/index.ts +++ b/src/server/services/search/impls/search1api/index.ts @@ -1,10 +1,14 @@ -import type {SearchParams, UniformSearchResponse, UniformSearchResult} from '@lobechat/types'; +import { + type SearchParams, + type UniformSearchResponse, + type UniformSearchResult, +} from '@lobechat/types'; import { TRPCError } from '@trpc/server'; import debug from 'debug'; import urlJoin from 'url-join'; -import type {SearchServiceImpl} from '../type'; -import type {Search1ApiResponse} from './type'; +import { type SearchServiceImpl } from '../type'; +import { type Search1ApiResponse } from './type'; interface Search1APIQueryParams { crawl_results?: 0 | 1; diff --git a/src/server/services/search/impls/searxng/fixtures/searXNG.ts b/src/server/services/search/impls/searxng/fixtures/searXNG.ts index 97cec401a5..248505d796 100644 --- a/src/server/services/search/impls/searxng/fixtures/searXNG.ts +++ b/src/server/services/search/impls/searxng/fixtures/searXNG.ts @@ -1,4 +1,4 @@ -import type {SearXNGSearchResponse} from '../client'; +import { type SearXNGSearchResponse } from '../client'; export const hetongxue: SearXNGSearchResponse = { answers: [ diff --git a/src/server/services/search/impls/searxng/index.ts b/src/server/services/search/impls/searxng/index.ts index 89cd1122d7..5bc669d021 100644 --- a/src/server/services/search/impls/searxng/index.ts +++ b/src/server/services/search/impls/searxng/index.ts @@ -1,11 +1,11 @@ -import type {UniformSearchResponse} from '@lobechat/types'; -import { SEARCH_SEARXNG_NOT_CONFIG } from '@lobechat/types'; +import { type UniformSearchResponse } from '@lobechat/types'; +import { SEARCH_SEARXNG_NOT_CONFIG } from '@lobechat/types'; import { TRPCError } from '@trpc/server'; import { toolsEnv } from '@/envs/tools'; import { SearXNGClient } from '@/server/services/search/impls/searxng/client'; -import type {SearchServiceImpl} from '../type'; +import { type SearchServiceImpl } from '../type'; /** * SearXNG implementation of the search service diff --git a/src/server/services/search/impls/tavily/index.ts b/src/server/services/search/impls/tavily/index.ts index 3a58af4629..5f5d356418 100644 --- a/src/server/services/search/impls/tavily/index.ts +++ b/src/server/services/search/impls/tavily/index.ts @@ -1,10 +1,14 @@ -import type {SearchParams, UniformSearchResponse, UniformSearchResult} from '@lobechat/types'; +import { + type SearchParams, + type UniformSearchResponse, + type UniformSearchResult, +} from '@lobechat/types'; import { TRPCError } from '@trpc/server'; import debug from 'debug'; import urlJoin from 'url-join'; -import type {SearchServiceImpl} from '../type'; -import type {TavilyResponse, TavilySearchParameters} from './type'; +import { type SearchServiceImpl } from '../type'; +import { type TavilyResponse, type TavilySearchParameters } from './type'; const log = debug('lobe-search:Tavily'); @@ -42,8 +46,8 @@ export class TavilyImpl implements SearchServiceImpl { params?.searchTimeRange && params.searchTimeRange !== 'anytime' ? params.searchTimeRange : undefined, - topic: // Tavily only supports news and general types - params?.searchCategories?.find((cat) => ['news', 'general'].includes(cat)), + // Tavily only supports news and general types + topic: params?.searchCategories?.find((cat) => ['news', 'general'].includes(cat)), }; log('Constructed request body: %o', body); diff --git a/src/server/services/search/impls/type.ts b/src/server/services/search/impls/type.ts index 301b2a326c..9c22fb6c6c 100644 --- a/src/server/services/search/impls/type.ts +++ b/src/server/services/search/impls/type.ts @@ -1,4 +1,4 @@ -import type {SearchParams, UniformSearchResponse} from '@lobechat/types'; +import { type SearchParams, type UniformSearchResponse } from '@lobechat/types'; /** * Search service implementation interface diff --git a/src/server/services/search/index.ts b/src/server/services/search/index.ts index e534804c4a..2da4066656 100644 --- a/src/server/services/search/index.ts +++ b/src/server/services/search/index.ts @@ -1,11 +1,11 @@ -import type {SearchParams, SearchQuery} from '@lobechat/types'; -import type {CrawlImplType} from '@lobechat/web-crawler'; +import { type SearchParams, type SearchQuery } from '@lobechat/types'; +import { type CrawlImplType } from '@lobechat/web-crawler'; import pMap from 'p-map'; import { toolsEnv } from '@/envs/tools'; -import type {SearchImplType, SearchServiceImpl} from './impls'; -import { createSearchServiceImpl } from './impls'; +import { type SearchImplType, type SearchServiceImpl } from './impls'; +import { createSearchServiceImpl } from './impls'; const parseImplEnv = (envString: string = '') => { // Handle full-width commas and extra whitespace diff --git a/src/server/services/toolExecution/builtin.ts b/src/server/services/toolExecution/builtin.ts index 87ffac54f8..dc936dac97 100644 --- a/src/server/services/toolExecution/builtin.ts +++ b/src/server/services/toolExecution/builtin.ts @@ -1,5 +1,5 @@ -import type {LobeChatDatabase} from '@lobechat/database'; -import type {ChatToolPayload} from '@lobechat/types'; +import { type LobeChatDatabase } from '@lobechat/database'; +import { type ChatToolPayload } from '@lobechat/types'; import { safeParseJSON } from '@lobechat/utils'; import debug from 'debug'; @@ -7,7 +7,7 @@ import { KlavisService } from '@/server/services/klavis'; import { MarketService } from '@/server/services/market'; import { getServerRuntime, hasServerRuntime } from './serverRuntimes'; -import type {IToolExecutor, ToolExecutionContext, ToolExecutionResult} from './types'; +import { type IToolExecutor, type ToolExecutionContext, type ToolExecutionResult } from './types'; const log = debug('lobe-server:builtin-tools-executor'); diff --git a/src/server/services/toolExecution/index.ts b/src/server/services/toolExecution/index.ts index 566996698d..28086108a2 100644 --- a/src/server/services/toolExecution/index.ts +++ b/src/server/services/toolExecution/index.ts @@ -1,8 +1,8 @@ -import type {ChatToolPayload} from '@lobechat/types'; +import { type ChatToolPayload } from '@lobechat/types'; import { safeParseJSON } from '@lobechat/utils'; import debug from 'debug'; -import type {CloudMCPParams, ToolCallContent} from '@/libs/mcp'; +import { type CloudMCPParams, type ToolCallContent } from '@/libs/mcp'; import { contentBlocksToString } from '@/server/services/mcp/contentProcessor'; import { DEFAULT_TOOL_RESULT_MAX_LENGTH, @@ -10,10 +10,14 @@ import { } from '@/server/utils/truncateToolResult'; import { DiscoverService } from '../discover'; -import type {MCPService} from '../mcp'; -import type {PluginGatewayService} from '../pluginGateway'; -import type {BuiltinToolsExecutor} from './builtin'; -import type {ToolExecutionContext, ToolExecutionResult, ToolExecutionResultResponse} from './types'; +import { type MCPService } from '../mcp'; +import { type PluginGatewayService } from '../pluginGateway'; +import { type BuiltinToolsExecutor } from './builtin'; +import { + type ToolExecutionContext, + type ToolExecutionResult, + type ToolExecutionResultResponse, +} from './types'; const log = debug('lobe-server:tool-execution-service'); @@ -189,7 +193,7 @@ export class ToolExecutionService { private async executeCloudMCPTool( payload: ChatToolPayload, context: ToolExecutionContext, - + _mcpParams: CloudMCPParams, ): Promise { const { identifier, apiName, arguments: args } = payload; diff --git a/src/server/services/toolExecution/serverRuntimes/cloudSandbox.ts b/src/server/services/toolExecution/serverRuntimes/cloudSandbox.ts index dba8447d1d..5b230b4af4 100644 --- a/src/server/services/toolExecution/serverRuntimes/cloudSandbox.ts +++ b/src/server/services/toolExecution/serverRuntimes/cloudSandbox.ts @@ -7,7 +7,7 @@ import { FileService } from '@/server/services/file'; import { MarketService } from '@/server/services/market'; import { ServerSandboxService } from '@/server/services/sandbox'; -import type {ServerRuntimeRegistration} from './types'; +import { type ServerRuntimeRegistration } from './types'; /** * CloudSandbox Server Runtime diff --git a/src/server/services/toolExecution/serverRuntimes/types.ts b/src/server/services/toolExecution/serverRuntimes/types.ts index 5daa1a30f0..fb7d352d96 100644 --- a/src/server/services/toolExecution/serverRuntimes/types.ts +++ b/src/server/services/toolExecution/serverRuntimes/types.ts @@ -1,4 +1,4 @@ -import type {ToolExecutionContext} from '../types'; +import { type ToolExecutionContext } from '../types'; /** * Factory function type for creating server runtimes diff --git a/src/server/services/toolExecution/serverRuntimes/webBrowsing.ts b/src/server/services/toolExecution/serverRuntimes/webBrowsing.ts index ddb52f3b52..dbb384ae88 100644 --- a/src/server/services/toolExecution/serverRuntimes/webBrowsing.ts +++ b/src/server/services/toolExecution/serverRuntimes/webBrowsing.ts @@ -3,7 +3,7 @@ import { WebBrowsingExecutionRuntime } from '@lobechat/builtin-tool-web-browsing import { SearchService } from '@/server/services/search'; -import type {ServerRuntimeRegistration} from './types'; +import { type ServerRuntimeRegistration } from './types'; // Pre-instantiated (no per-request context needed) const runtime = new WebBrowsingExecutionRuntime({ diff --git a/src/server/services/toolExecution/types.ts b/src/server/services/toolExecution/types.ts index e5e3fd530c..dd5e73ede1 100644 --- a/src/server/services/toolExecution/types.ts +++ b/src/server/services/toolExecution/types.ts @@ -1,6 +1,6 @@ -import type {LobeToolManifest} from '@lobechat/context-engine'; -import type {LobeChatDatabase} from '@lobechat/database'; -import type {ChatToolPayload} from '@lobechat/types'; +import { type LobeToolManifest } from '@lobechat/context-engine'; +import { type LobeChatDatabase } from '@lobechat/database'; +import { type ChatToolPayload } from '@lobechat/types'; export interface ToolExecutionContext { /** Server database for LobeHub Skills execution */ @@ -28,5 +28,8 @@ export interface ToolExecutionResultResponse extends ToolExecutionResult { } export interface IToolExecutor { - execute: (payload: ChatToolPayload, context: ToolExecutionContext) => Promise; + execute: ( + payload: ChatToolPayload, + context: ToolExecutionContext, + ) => Promise; } diff --git a/src/server/services/usage/index.test.ts b/src/server/services/usage/index.test.ts index caafb6660f..4c4ed2c70b 100644 --- a/src/server/services/usage/index.test.ts +++ b/src/server/services/usage/index.test.ts @@ -1,8 +1,8 @@ import dayjs from 'dayjs'; import { beforeEach, describe, expect, it, vi } from 'vitest'; -import type { LobeChatDatabase } from '@/database/type'; -import type { MessageMetadata } from '@/types/message'; +import { type LobeChatDatabase } from '@/database/type'; +import { type MessageMetadata } from '@/types/message'; import { UsageRecordService } from './index'; diff --git a/src/server/services/usage/index.ts b/src/server/services/usage/index.ts index 271faa1ffd..12b72cf3c6 100644 --- a/src/server/services/usage/index.ts +++ b/src/server/services/usage/index.ts @@ -3,10 +3,10 @@ import debug from 'debug'; import { desc, eq } from 'drizzle-orm'; import { messages } from '@/database/schemas'; -import type {LobeChatDatabase} from '@/database/type'; +import { type LobeChatDatabase } from '@/database/type'; import { genRangeWhere, genWhere } from '@/database/utils/genWhere'; -import type {MessageMetadata} from '@/types/message'; -import type {UsageLog, UsageRecordItem} from '@/types/usage/usageRecord'; +import { type MessageMetadata } from '@/types/message'; +import { type UsageLog, type UsageRecordItem } from '@/types/usage/usageRecord'; import { formatDate } from '@/utils/format'; const log = debug('lobe-usage:service'); diff --git a/src/server/services/user/index.ts b/src/server/services/user/index.ts index 3862addbb3..bbbfa1738b 100644 --- a/src/server/services/user/index.ts +++ b/src/server/services/user/index.ts @@ -1,5 +1,5 @@ import { ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const'; -import type {LobeChatDatabase} from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { initNewUserForBusiness } from '@/business/server/user'; import { UserModel } from '@/database/models/user'; diff --git a/src/server/services/webhookUser/index.ts b/src/server/services/webhookUser/index.ts index ae44931638..64311675f6 100644 --- a/src/server/services/webhookUser/index.ts +++ b/src/server/services/webhookUser/index.ts @@ -1,10 +1,10 @@ -import type {LobeChatDatabase} from '@lobechat/database'; +import { type LobeChatDatabase } from '@lobechat/database'; import { and, eq } from 'drizzle-orm'; import { NextResponse } from 'next/server'; import { UserModel } from '@/database/models/user'; -import type {UserItem} from '@/database/schemas'; -import { account, nextauthAccounts, session, users } from '@/database/schemas'; +import { type UserItem } from '@/database/schemas'; +import { account, nextauthAccounts, session, users } from '@/database/schemas'; export class WebhookUserService { private db: LobeChatDatabase; diff --git a/src/server/sitemap.ts b/src/server/sitemap.ts index b6d3ec2dcf..c6a9d2cb23 100644 --- a/src/server/sitemap.ts +++ b/src/server/sitemap.ts @@ -1,13 +1,13 @@ import { flatten } from 'es-toolkit/compat'; -import type {MetadataRoute} from 'next'; +import { type MetadataRoute } from 'next'; import qs from 'query-string'; import urlJoin from 'url-join'; import { serverFeatureFlags } from '@/config/featureFlags'; import { DEFAULT_LANG } from '@/const/locale'; import { SITEMAP_BASE_URL } from '@/const/url'; -import type {Locales} from '@/locales/resources'; -import { locales as allLocales } from '@/locales/resources'; +import { type Locales } from '@/locales/resources'; +import { locales as allLocales } from '@/locales/resources'; import { DiscoverService } from '@/server/services/discover'; import { getCanonicalUrl } from '@/server/utils/url'; import { isDev } from '@/utils/env'; diff --git a/src/server/translation.ts b/src/server/translation.ts index 7249551f86..cb146a729e 100644 --- a/src/server/translation.ts +++ b/src/server/translation.ts @@ -1,6 +1,6 @@ import { DEFAULT_LANG } from '@/const/locale'; -import type {Locales, NS} from '@/locales/resources'; -import { normalizeLocale } from '@/locales/resources'; +import { type Locales, type NS } from '@/locales/resources'; +import { normalizeLocale } from '@/locales/resources'; import { unwrapESMModule } from '@/utils/esm/unwrapESMModule'; import { loadI18nNamespaceModuleWithFallback } from '../utils/i18n/loadI18nNamespaceModule'; diff --git a/src/services/__tests__/generationTopic.test.ts b/src/services/__tests__/generationTopic.test.ts index 9f6aa2e103..0c838b902a 100644 --- a/src/services/__tests__/generationTopic.test.ts +++ b/src/services/__tests__/generationTopic.test.ts @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { lambdaClient } from '@/libs/trpc/client'; -import type { UpdateTopicValue } from '@/server/routers/lambda/generationTopic'; +import { type UpdateTopicValue } from '@/server/routers/lambda/generationTopic'; import { ServerService } from '../generationTopic'; diff --git a/src/services/__tests__/global.test.ts b/src/services/__tests__/global.test.ts index a87ef764c0..a484ee7ea8 100644 --- a/src/services/__tests__/global.test.ts +++ b/src/services/__tests__/global.test.ts @@ -1,8 +1,8 @@ -import type { Mock} from 'vitest'; +import { type Mock } from 'vitest'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { lambdaClient } from '@/libs/trpc/client'; -import type { GlobalRuntimeConfig } from '@/types/serverConfig'; +import { type GlobalRuntimeConfig } from '@/types/serverConfig'; import { globalService } from '../global'; diff --git a/src/services/__tests__/models.test.ts b/src/services/__tests__/models.test.ts index ef13929a7e..3700b3fc1c 100644 --- a/src/services/__tests__/models.test.ts +++ b/src/services/__tests__/models.test.ts @@ -1,4 +1,4 @@ -import type { Mock} from 'vitest'; +import { type Mock } from 'vitest'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { aiProviderSelectors } from '@/store/aiInfra'; diff --git a/src/services/_auth.ts b/src/services/_auth.ts index 8a2ab3aa9a..c3d0e30650 100644 --- a/src/services/_auth.ts +++ b/src/services/_auth.ts @@ -1,4 +1,12 @@ -import type {AWSBedrockKeyVault, AzureOpenAIKeyVault, ClientSecretPayload, CloudflareKeyVault, ComfyUIKeyVault, OpenAICompatibleKeyVault, VertexAIKeyVault} from '@lobechat/types'; +import { + type AWSBedrockKeyVault, + type AzureOpenAIKeyVault, + type ClientSecretPayload, + type CloudflareKeyVault, + type ComfyUIKeyVault, + type OpenAICompatibleKeyVault, + type VertexAIKeyVault, +} from '@lobechat/types'; import { clientApiKeyManager } from '@lobechat/utils/client'; import { ModelProvider } from 'model-bank'; @@ -103,14 +111,14 @@ const createAuthTokenWithPayload = (payload = {}) => { }; interface AuthParams { - headers?: HeadersInit; payload?: Record; provider?: string; } export const createPayloadWithKeyVaults = (provider: string) => { - const keyVaults = aiProviderSelectors.providerKeyVaults(provider)(useAiInfraStore.getState()) || {}; + const keyVaults = + aiProviderSelectors.providerKeyVaults(provider)(useAiInfraStore.getState()) || {}; const runtimeProvider = resolveRuntimeProvider(provider); @@ -125,7 +133,6 @@ export const createXorKeyVaultsPayload = (provider: string) => { return obfuscatePayloadWithXOR(payload, SECRET_XOR_KEY); }; - export const createHeaderWithAuth = async (params?: AuthParams): Promise => { let payload = params?.payload || {}; @@ -135,6 +142,5 @@ export const createHeaderWithAuth = async (params?: AuthParams): Promise { diff --git a/src/services/chat/chat.test.ts b/src/services/chat/chat.test.ts index 1889361195..9106141b8d 100644 --- a/src/services/chat/chat.test.ts +++ b/src/services/chat/chat.test.ts @@ -1,6 +1,6 @@ import { WebBrowsingManifest } from '@lobechat/builtin-tool-web-browsing'; -import type {ChatStreamPayload, LobeTool, UIChatMessage} from '@lobechat/types'; -import { ChatErrorType } from '@lobechat/types'; +import { type ChatStreamPayload, type LobeTool, type UIChatMessage } from '@lobechat/types'; +import { ChatErrorType } from '@lobechat/types'; import { act } from '@testing-library/react'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; @@ -11,7 +11,7 @@ import { aiModelSelectors } from '@/store/aiInfra'; import { useToolStore } from '@/store/tool'; import { chatService } from './index'; -import type { ResolvedAgentConfig } from './mecha'; +import { type ResolvedAgentConfig } from './mecha'; /** * Default mock resolvedAgentConfig for tests diff --git a/src/services/chat/index.ts b/src/services/chat/index.ts index e409cf2167..84afdb54d0 100644 --- a/src/services/chat/index.ts +++ b/src/services/chat/index.ts @@ -1,23 +1,19 @@ import { AgentBuilderIdentifier } from '@lobechat/builtin-tool-agent-builder'; import { KLAVIS_SERVER_TYPES, LOBEHUB_SKILL_PROVIDERS } from '@lobechat/const'; -import type { OfficialToolItem } from '@lobechat/context-engine'; -import type {FetchSSEOptions} from '@lobechat/fetch-sse'; +import { type OfficialToolItem } from '@lobechat/context-engine'; +import { type FetchSSEOptions } from '@lobechat/fetch-sse'; +import { fetchSSE, getMessageError, standardizeAnimationStyle } from '@lobechat/fetch-sse'; +import { type ChatCompletionErrorPayload } from '@lobechat/model-runtime'; +import { AgentRuntimeError } from '@lobechat/model-runtime'; import { - fetchSSE, - getMessageError, - standardizeAnimationStyle -} from '@lobechat/fetch-sse'; -import type {ChatCompletionErrorPayload} from '@lobechat/model-runtime'; -import { AgentRuntimeError } from '@lobechat/model-runtime'; -import type {RuntimeInitialContext, RuntimeStepContext, TracePayload, UIChatMessage} from '@lobechat/types'; -import { - ChatErrorType, - TraceTagMap + type RuntimeInitialContext, + type RuntimeStepContext, + type TracePayload, + type UIChatMessage, } from '@lobechat/types'; -import type {PluginRequestPayload} from '@lobehub/chat-plugin-sdk'; -import { - createHeadersWithPluginSettings -} from '@lobehub/chat-plugin-sdk'; +import { ChatErrorType, TraceTagMap } from '@lobechat/types'; +import { type PluginRequestPayload } from '@lobehub/chat-plugin-sdk'; +import { createHeadersWithPluginSettings } from '@lobehub/chat-plugin-sdk'; import { merge } from 'es-toolkit/compat'; import { ModelProvider } from 'model-bank'; @@ -45,21 +41,21 @@ import { userGeneralSettingsSelectors, userProfileSelectors, } from '@/store/user/selectors'; -import type { ChatStreamPayload, OpenAIChatMessage } from '@/types/openai/chat'; +import { type ChatStreamPayload, type OpenAIChatMessage } from '@/types/openai/chat'; import { createErrorResponse } from '@/utils/errorResponse'; import { createTraceHeader, getTraceId } from '@/utils/trace'; import { createHeaderWithAuth } from '../_auth'; import { API_ENDPOINTS } from '../_url'; import { findDeploymentName, isEnableFetchOnClient, resolveRuntimeProvider } from './helper'; -import type {ResolvedAgentConfig} from './mecha'; +import { type ResolvedAgentConfig } from './mecha'; import { contextEngineering, getTargetAgentId, initializeWithClientStore, - resolveModelExtendParams + resolveModelExtendParams, } from './mecha'; -import type {FetchOptions} from './types'; +import { type FetchOptions } from './types'; interface GetChatCompletionPayload extends Partial> { agentId?: string; diff --git a/src/services/chat/mecha/agentConfigResolver.ts b/src/services/chat/mecha/agentConfigResolver.ts index 1d9ba4c304..1e0ec6bd4f 100644 --- a/src/services/chat/mecha/agentConfigResolver.ts +++ b/src/services/chat/mecha/agentConfigResolver.ts @@ -1,11 +1,13 @@ -import type {BuiltinAgentSlug} from '@lobechat/builtin-agents'; -import { - BUILTIN_AGENT_SLUGS, - getAgentRuntimeConfig -} from '@lobechat/builtin-agents'; +import { type BuiltinAgentSlug } from '@lobechat/builtin-agents'; +import { BUILTIN_AGENT_SLUGS, getAgentRuntimeConfig } from '@lobechat/builtin-agents'; import { PageAgentIdentifier } from '@lobechat/builtin-tool-page-agent'; -import type { LobeToolManifest } from '@lobechat/context-engine'; -import type {ChatCompletionTool, LobeAgentChatConfig, LobeAgentConfig, MessageMapScope} from '@lobechat/types'; +import { type LobeToolManifest } from '@lobechat/context-engine'; +import { + type ChatCompletionTool, + type LobeAgentChatConfig, + type LobeAgentConfig, + type MessageMapScope, +} from '@lobechat/types'; import debug from 'debug'; import { produce } from 'immer'; diff --git a/src/services/chat/mecha/clientModelRuntime.test.ts b/src/services/chat/mecha/clientModelRuntime.test.ts index e51b007472..a5fc197923 100644 --- a/src/services/chat/mecha/clientModelRuntime.test.ts +++ b/src/services/chat/mecha/clientModelRuntime.test.ts @@ -1,5 +1,4 @@ -import type { - LobeOpenAICompatibleRuntime} from '@lobechat/model-runtime'; +import { type LobeOpenAICompatibleRuntime } from '@lobechat/model-runtime'; import { LobeAnthropicAI, LobeAzureOpenAI, diff --git a/src/services/chat/mecha/contextEngineering.test.ts b/src/services/chat/mecha/contextEngineering.test.ts index b1b312d0ff..d0d16a1488 100644 --- a/src/services/chat/mecha/contextEngineering.test.ts +++ b/src/services/chat/mecha/contextEngineering.test.ts @@ -1,4 +1,4 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { afterEach, describe, expect, it, vi } from 'vitest'; import * as isCanUseFCModule from '@/helpers/isCanUseFC'; diff --git a/src/services/chat/mecha/contextEngineering.ts b/src/services/chat/mecha/contextEngineering.ts index 00d162e48b..73468ada4f 100644 --- a/src/services/chat/mecha/contextEngineering.ts +++ b/src/services/chat/mecha/contextEngineering.ts @@ -1,13 +1,23 @@ import { AgentBuilderIdentifier } from '@lobechat/builtin-tool-agent-builder'; import { GroupAgentBuilderIdentifier } from '@lobechat/builtin-tool-group-agent-builder'; import { GTDIdentifier } from '@lobechat/builtin-tool-gtd'; -import { isDesktop,KLAVIS_SERVER_TYPES, LOBEHUB_SKILL_PROVIDERS } from '@lobechat/const'; -import type {AgentBuilderContext, AgentGroupConfig, GroupAgentBuilderContext, GroupOfficialToolItem, GTDConfig, LobeToolManifest} from '@lobechat/context-engine'; +import { isDesktop, KLAVIS_SERVER_TYPES, LOBEHUB_SKILL_PROVIDERS } from '@lobechat/const'; import { - MessagesEngine + type AgentBuilderContext, + type AgentGroupConfig, + type GroupAgentBuilderContext, + type GroupOfficialToolItem, + type GTDConfig, + type LobeToolManifest, } from '@lobechat/context-engine'; +import { MessagesEngine } from '@lobechat/context-engine'; import { historySummaryPrompt } from '@lobechat/prompts'; -import type {OpenAIChatMessage, RuntimeInitialContext, RuntimeStepContext, UIChatMessage} from '@lobechat/types'; +import { + type OpenAIChatMessage, + type RuntimeInitialContext, + type RuntimeStepContext, + type UIChatMessage, +} from '@lobechat/types'; import debug from 'debug'; import { isCanUseFC } from '@/helpers/isCanUseFC'; diff --git a/src/services/chat/mecha/memoryManager.ts b/src/services/chat/mecha/memoryManager.ts index e70ce8d276..9902701a28 100644 --- a/src/services/chat/mecha/memoryManager.ts +++ b/src/services/chat/mecha/memoryManager.ts @@ -1,5 +1,5 @@ -import type { UserMemoryData, UserMemoryIdentityItem } from '@lobechat/context-engine'; -import type { RetrieveMemoryResult } from '@lobechat/types'; +import { type UserMemoryData, type UserMemoryIdentityItem } from '@lobechat/context-engine'; +import { type RetrieveMemoryResult } from '@lobechat/types'; import { getChatStoreState } from '@/store/chat'; import { getUserMemoryStoreState } from '@/store/userMemory'; diff --git a/src/services/chat/mecha/modelParamsResolver.ts b/src/services/chat/mecha/modelParamsResolver.ts index 457d859fb8..acf1091e4e 100644 --- a/src/services/chat/mecha/modelParamsResolver.ts +++ b/src/services/chat/mecha/modelParamsResolver.ts @@ -1,4 +1,4 @@ -import type {LobeAgentChatConfig} from '@lobechat/types'; +import { type LobeAgentChatConfig } from '@lobechat/types'; import { aiModelSelectors, getAiInfraStoreState } from '@/store/aiInfra'; diff --git a/src/services/chat/types.ts b/src/services/chat/types.ts index 71c8bcc823..e1292bf66b 100644 --- a/src/services/chat/types.ts +++ b/src/services/chat/types.ts @@ -1,5 +1,9 @@ -import type {FetchSSEOptions} from '@lobechat/fetch-sse'; -import type {RuntimeInitialContext, RuntimeStepContext, TracePayload} from '@lobechat/types'; +import { type FetchSSEOptions } from '@lobechat/fetch-sse'; +import { + type RuntimeInitialContext, + type RuntimeStepContext, + type TracePayload, +} from '@lobechat/types'; export interface FetchOptions extends FetchSSEOptions { agentId?: string; diff --git a/src/services/chatGroup/index.ts b/src/services/chatGroup/index.ts index 28aed2cab0..313fcd7c0f 100644 --- a/src/services/chatGroup/index.ts +++ b/src/services/chatGroup/index.ts @@ -1,6 +1,11 @@ -import type {AgentGroupDetail, AgentItem} from '@lobechat/types'; +import { type AgentGroupDetail, type AgentItem } from '@lobechat/types'; -import type {ChatGroupAgentItem, ChatGroupItem, NewChatGroup, NewChatGroupAgent} from '@/database/schemas'; +import { + type ChatGroupAgentItem, + type ChatGroupItem, + type NewChatGroup, + type NewChatGroupAgent, +} from '@/database/schemas'; import { lambdaClient } from '@/libs/trpc/client'; export interface GroupMemberConfig { diff --git a/src/services/cloudSandbox.ts b/src/services/cloudSandbox.ts index bd222eb37f..52e4677979 100644 --- a/src/services/cloudSandbox.ts +++ b/src/services/cloudSandbox.ts @@ -1,9 +1,9 @@ import { toolsClient } from '@/libs/trpc/client'; -import type { - CallCodeInterpreterToolInput, - CallToolResult, - ExportAndUploadFileInput, - ExportAndUploadFileResult, +import { + type CallCodeInterpreterToolInput, + type CallToolResult, + type ExportAndUploadFileInput, + type ExportAndUploadFileResult, } from '@/server/routers/tools/market'; class CloudSandboxService { diff --git a/src/services/config.ts b/src/services/config.ts index 13521ea7b6..b3d6a10987 100644 --- a/src/services/config.ts +++ b/src/services/config.ts @@ -2,7 +2,7 @@ import { BRANDING_NAME } from '@lobechat/business-const'; import { downloadFile, exportJSONFile } from '@lobechat/utils/client'; import dayjs from 'dayjs'; -import type {ImportPgDataStructure} from '@/types/export'; +import { type ImportPgDataStructure } from '@/types/export'; import { exportService } from './export'; diff --git a/src/services/discover.ts b/src/services/discover.ts index f128bed879..8d46c76a81 100644 --- a/src/services/discover.ts +++ b/src/services/discover.ts @@ -1,17 +1,41 @@ -import type {CategoryItem, CategoryListQuery, PluginManifest} from '@lobehub/market-sdk'; -import type { - AgentEventRequest, - CallReportRequest, - InstallReportRequest, - PluginEventRequest, +import { + type CategoryItem, + type CategoryListQuery, + type PluginManifest, +} from '@lobehub/market-sdk'; +import { + type AgentEventRequest, + type CallReportRequest, + type InstallReportRequest, + type PluginEventRequest, } from '@lobehub/market-types'; import { lambdaClient } from '@/libs/trpc/client'; import { globalHelpers } from '@/store/global/helpers'; import { useUserStore } from '@/store/user'; import { userGeneralSettingsSelectors } from '@/store/user/selectors'; -import type {AssistantListResponse, AssistantMarketSource, AssistantQueryParams, DiscoverAssistantDetail, DiscoverMcpDetail, DiscoverModelDetail, DiscoverPluginDetail, DiscoverProviderDetail, DiscoverUserProfile, GroupAgentQueryParams, IdentifiersResponse, McpListResponse, McpQueryParams, ModelListResponse, ModelQueryParams, PluginListResponse, PluginQueryParams, ProviderListResponse, ProviderQueryParams} from '@/types/discover'; -import type {MCPPluginListParams} from '@/types/plugins'; +import { + type AssistantListResponse, + type AssistantMarketSource, + type AssistantQueryParams, + type DiscoverAssistantDetail, + type DiscoverMcpDetail, + type DiscoverModelDetail, + type DiscoverPluginDetail, + type DiscoverProviderDetail, + type DiscoverUserProfile, + type GroupAgentQueryParams, + type IdentifiersResponse, + type McpListResponse, + type McpQueryParams, + type ModelListResponse, + type ModelQueryParams, + type PluginListResponse, + type PluginQueryParams, + type ProviderListResponse, + type ProviderQueryParams, +} from '@/types/discover'; +import { type MCPPluginListParams } from '@/types/plugins'; import { cleanObject } from '@/utils/object'; class DiscoverService { diff --git a/src/services/document/index.ts b/src/services/document/index.ts index 0a4a262857..f82c3f379f 100644 --- a/src/services/document/index.ts +++ b/src/services/document/index.ts @@ -1,4 +1,4 @@ -import type {DocumentItem} from '@lobechat/database/schemas'; +import { type DocumentItem } from '@lobechat/database/schemas'; import { lambdaClient } from '@/libs/trpc/client'; diff --git a/src/services/electron/desktopNotification.ts b/src/services/electron/desktopNotification.ts index 34fe410994..87fb71b9b9 100644 --- a/src/services/electron/desktopNotification.ts +++ b/src/services/electron/desktopNotification.ts @@ -1,4 +1,7 @@ -import type {DesktopNotificationResult, ShowDesktopNotificationParams} from '@lobechat/electron-client-ipc'; +import { + type DesktopNotificationResult, + type ShowDesktopNotificationParams, +} from '@lobechat/electron-client-ipc'; import { ensureElectronIpc } from '@/utils/electron/ipc'; diff --git a/src/services/electron/remoteServer.ts b/src/services/electron/remoteServer.ts index 909e4b2359..03771b4ae5 100644 --- a/src/services/electron/remoteServer.ts +++ b/src/services/electron/remoteServer.ts @@ -1,4 +1,4 @@ -import type {DataSyncConfig, MarketAuthorizationParams} from '@lobechat/electron-client-ipc'; +import { type DataSyncConfig, type MarketAuthorizationParams } from '@lobechat/electron-client-ipc'; import { ensureElectronIpc } from '@/utils/electron/ipc'; diff --git a/src/services/electron/settings.ts b/src/services/electron/settings.ts index feca1b52e7..5f10764400 100644 --- a/src/services/electron/settings.ts +++ b/src/services/electron/settings.ts @@ -1,4 +1,7 @@ -import type {NetworkProxySettings, ShortcutUpdateResult} from '@lobechat/electron-client-ipc'; +import { + type NetworkProxySettings, + type ShortcutUpdateResult, +} from '@lobechat/electron-client-ipc'; import { ensureElectronIpc } from '@/utils/electron/ipc'; diff --git a/src/services/electron/system.ts b/src/services/electron/system.ts index 53d6ffb4fb..ce61eca8a7 100644 --- a/src/services/electron/system.ts +++ b/src/services/electron/system.ts @@ -1,7 +1,7 @@ -import type { - ElectronAppState, - WindowMinimumSizeParams, - WindowSizeParams, +import { + type ElectronAppState, + type WindowMinimumSizeParams, + type WindowSizeParams, } from '@lobechat/electron-client-ipc'; import { ensureElectronIpc } from '@/utils/electron/ipc'; diff --git a/src/services/electron/toolDetector.ts b/src/services/electron/toolDetector.ts index 5f3e35a7f6..fe33a94568 100644 --- a/src/services/electron/toolDetector.ts +++ b/src/services/electron/toolDetector.ts @@ -1,4 +1,4 @@ -import type {ToolCategory, ToolInfo, ToolStatus} from '@lobechat/electron-client-ipc'; +import { type ToolCategory, type ToolInfo, type ToolStatus } from '@lobechat/electron-client-ipc'; import { ensureElectronIpc } from '@/utils/electron/ipc'; diff --git a/src/services/export/index.ts b/src/services/export/index.ts index 6196916913..7e34fac22e 100644 --- a/src/services/export/index.ts +++ b/src/services/export/index.ts @@ -1,5 +1,5 @@ import { lambdaClient } from '@/libs/trpc/client'; -import type {ExportDatabaseData} from '@/types/export'; +import { type ExportDatabaseData } from '@/types/export'; class ExportService { exportData = async (): Promise => { diff --git a/src/services/file/index.ts b/src/services/file/index.ts index 0a4d42835f..2cf44a6c18 100644 --- a/src/services/file/index.ts +++ b/src/services/file/index.ts @@ -1,5 +1,12 @@ import { lambdaClient } from '@/libs/trpc/client'; -import type {CheckFileHashResult, FileItem, FileListItem, QueryFileListParams, QueryFileListSchemaType, UploadFileParams} from '@/types/files'; +import { + type CheckFileHashResult, + type FileItem, + type FileListItem, + type QueryFileListParams, + type QueryFileListSchemaType, + type UploadFileParams, +} from '@/types/files'; interface CreateFileParams extends Omit { knowledgeBaseId?: string; @@ -59,7 +66,7 @@ export class FileService { // Document (including folders) - use document endpoint const doc = await lambdaClient.document.getDocumentById.query({ id }); if (!doc) return null; - + // Convert document to FileListItem format return { chunkCount: null, diff --git a/src/services/generationBatch.ts b/src/services/generationBatch.ts index 0946dcf332..1dd0f01175 100644 --- a/src/services/generationBatch.ts +++ b/src/services/generationBatch.ts @@ -1,6 +1,6 @@ -import type {GenerationBatchItem} from '@/database/schemas'; +import { type GenerationBatchItem } from '@/database/schemas'; import { lambdaClient } from '@/libs/trpc/client'; -import type {Generation, GenerationBatch} from '@/types/generation'; +import { type Generation, type GenerationBatch } from '@/types/generation'; type GenerationBatchWithAsyncTaskId = GenerationBatch & { generations: (Generation & { asyncTaskId?: string | null })[]; diff --git a/src/services/generationTopic.ts b/src/services/generationTopic.ts index f37349b073..a94dc28167 100644 --- a/src/services/generationTopic.ts +++ b/src/services/generationTopic.ts @@ -1,7 +1,7 @@ -import type {GenerationTopicItem} from '@/database/schemas'; +import { type GenerationTopicItem } from '@/database/schemas'; import { lambdaClient } from '@/libs/trpc/client'; -import type {UpdateTopicValue} from '@/server/routers/lambda/generationTopic'; -import type {ImageGenerationTopic} from '@/types/generation'; +import { type UpdateTopicValue } from '@/server/routers/lambda/generationTopic'; +import { type ImageGenerationTopic } from '@/types/generation'; export class ServerService { async getAllGenerationTopics(): Promise { diff --git a/src/services/global.ts b/src/services/global.ts index 07b2245ee1..7cc8903643 100644 --- a/src/services/global.ts +++ b/src/services/global.ts @@ -1,13 +1,13 @@ import { isDesktop } from '@lobechat/const'; -import type { PartialDeep } from 'type-fest'; +import { type PartialDeep } from 'type-fest'; -import type { VersionResponseData } from '@/app/(backend)/api/version/route'; +import { type VersionResponseData } from '@/app/(backend)/api/version/route'; import { BusinessGlobalService } from '@/business/client/services/BusinessGlobalService'; import { lambdaClient } from '@/libs/trpc/client'; import { getElectronStoreState } from '@/store/electron'; import { electronSyncSelectors } from '@/store/electron/selectors'; -import type {LobeAgentConfig} from '@/types/agent'; -import type {GlobalRuntimeConfig} from '@/types/serverConfig'; +import { type LobeAgentConfig } from '@/types/agent'; +import { type GlobalRuntimeConfig } from '@/types/serverConfig'; const VERSION_URL = 'https://registry.npmmirror.com/@lobehub/chat/latest'; const SERVER_VERSION_URL = '/api/version'; diff --git a/src/services/home/index.ts b/src/services/home/index.ts index 7ae97d0aae..05f49ca111 100644 --- a/src/services/home/index.ts +++ b/src/services/home/index.ts @@ -1,4 +1,4 @@ -import type { SidebarAgentItem, SidebarAgentListResponse } from '@/database/repositories/home'; +import { type SidebarAgentItem, type SidebarAgentListResponse } from '@/database/repositories/home'; import { lambdaClient } from '@/libs/trpc/client'; export class HomeService { diff --git a/src/services/image.ts b/src/services/image.ts index 349afba241..0c42650a6b 100644 --- a/src/services/image.ts +++ b/src/services/image.ts @@ -1,7 +1,7 @@ import debug from 'debug'; import { lambdaClient } from '@/libs/trpc/client'; -import type {CreateImageServicePayload} from '@/server/routers/lambda/image'; +import { type CreateImageServicePayload } from '@/server/routers/lambda/image'; // Create debug logger const log = debug('lobe-image:service'); diff --git a/src/services/import/index.ts b/src/services/import/index.ts index b3dbd79852..99c30af108 100644 --- a/src/services/import/index.ts +++ b/src/services/import/index.ts @@ -1,12 +1,12 @@ -import type {DefaultErrorShape} from '@trpc/server/unstable-core-do-not-import'; +import { type DefaultErrorShape } from '@trpc/server/unstable-core-do-not-import'; import { lambdaClient } from '@/libs/trpc/client'; import { uploadService } from '@/services/upload'; import { useUserStore } from '@/store/user'; -import type {ImportPgDataStructure} from '@/types/export'; -import type {ImporterEntryData, OnImportCallbacks} from '@/types/importer'; -import { ImportStage } from '@/types/importer'; -import type {UserSettings} from '@/types/user/settings'; +import { type ImportPgDataStructure } from '@/types/export'; +import { type ImporterEntryData, type OnImportCallbacks } from '@/types/importer'; +import { ImportStage } from '@/types/importer'; +import { type UserSettings } from '@/types/user/settings'; import { uuid } from '@/utils/uuid'; class ImportService { diff --git a/src/services/knowledgeBase.ts b/src/services/knowledgeBase.ts index aafbcfbe11..df92fed362 100644 --- a/src/services/knowledgeBase.ts +++ b/src/services/knowledgeBase.ts @@ -1,5 +1,5 @@ import { lambdaClient } from '@/libs/trpc/client'; -import type {CreateKnowledgeBaseParams} from '@/types/knowledgeBase'; +import { type CreateKnowledgeBaseParams } from '@/types/knowledgeBase'; class KnowledgeBaseService { createKnowledgeBase = async (params: CreateKnowledgeBaseParams) => { diff --git a/src/services/marketApi.ts b/src/services/marketApi.ts index 659f37340a..9f164d5d5d 100644 --- a/src/services/marketApi.ts +++ b/src/services/marketApi.ts @@ -1,15 +1,19 @@ -import type {AgentCreateResponse, AgentItemDetail, AgentListResponse} from '@lobehub/market-sdk'; +import { + type AgentCreateResponse, + type AgentItemDetail, + type AgentListResponse, +} from '@lobehub/market-sdk'; import { lambdaClient } from '@/libs/trpc/client'; -import type { - AgentForkRequest, - AgentForkResponse, - AgentForkSourceResponse, - AgentForksResponse, - AgentGroupForkRequest, - AgentGroupForkResponse, - AgentGroupForkSourceResponse, - AgentGroupForksResponse, +import { + type AgentForkRequest, + type AgentForkResponse, + type AgentForkSourceResponse, + type AgentForksResponse, + type AgentGroupForkRequest, + type AgentGroupForkResponse, + type AgentGroupForkSourceResponse, + type AgentGroupForksResponse, } from '@/types/discover'; interface GetOwnAgentsParams { @@ -22,7 +26,7 @@ export class MarketApiService { * @deprecated This method is no longer needed as authentication is now handled * automatically through tRPC middleware. Keeping for backward compatibility. */ - + setAccessToken(_token: string) { // No-op: Authentication is now handled through tRPC authedProcedure middleware } @@ -41,7 +45,9 @@ export class MarketApiService { } // Get agent detail by identifier - async getAgentDetail(identifier: string): Promise { + async getAgentDetail( + identifier: string, + ): Promise { return lambdaClient.market.agent.getAgentDetail.query({ identifier, }) as Promise; diff --git a/src/services/mcp.test.ts b/src/services/mcp.test.ts index c90e628e1e..01ed2f6d45 100644 --- a/src/services/mcp.test.ts +++ b/src/services/mcp.test.ts @@ -1,5 +1,5 @@ -import type { ChatToolPayload } from '@lobechat/types'; -import type { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; +import { type ChatToolPayload } from '@lobechat/types'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; import superjson from 'superjson'; import { beforeEach, describe, expect, it, vi } from 'vitest'; diff --git a/src/services/mcp.ts b/src/services/mcp.ts index 295c04028e..b14a2426bb 100644 --- a/src/services/mcp.ts +++ b/src/services/mcp.ts @@ -1,11 +1,15 @@ import { CURRENT_VERSION, isDesktop } from '@lobechat/const'; -import type {ChatToolPayload, CheckMcpInstallResult, CustomPluginMetadata} from '@lobechat/types'; +import { + type ChatToolPayload, + type CheckMcpInstallResult, + type CustomPluginMetadata, +} from '@lobechat/types'; import { isLocalOrPrivateUrl, safeParseJSON } from '@lobechat/utils'; -import type {PluginManifest} from '@lobehub/market-sdk'; -import type {CallReportRequest} from '@lobehub/market-types'; +import { type PluginManifest } from '@lobehub/market-sdk'; +import { type CallReportRequest } from '@lobehub/market-types'; import superjson from 'superjson'; -import type {MCPToolCallResult} from '@/libs/mcp'; +import { type MCPToolCallResult } from '@/libs/mcp'; import { toolsClient } from '@/libs/trpc/client'; import { ensureElectronIpc } from '@/utils/electron/ipc'; diff --git a/src/services/message/index.ts b/src/services/message/index.ts index 5187732859..26495fbe31 100644 --- a/src/services/message/index.ts +++ b/src/services/message/index.ts @@ -1,5 +1,19 @@ -import type {ChatMessageError, ChatMessagePluginError, ChatTranslate, ChatTTS, CreateMessageParams, CreateMessageResult, MessageMetadata, MessagePluginItem, ModelRankItem, UIChatMessage, UpdateMessageParams, UpdateMessageRAGParams, UpdateMessageResult} from '@lobechat/types'; -import type { HeatmapsProps } from '@lobehub/charts'; +import { + type ChatMessageError, + type ChatMessagePluginError, + type ChatTranslate, + type ChatTTS, + type CreateMessageParams, + type CreateMessageResult, + type MessageMetadata, + type MessagePluginItem, + type ModelRankItem, + type UIChatMessage, + type UpdateMessageParams, + type UpdateMessageRAGParams, + type UpdateMessageResult, +} from '@lobechat/types'; +import { type HeatmapsProps } from '@lobehub/charts'; import { lambdaClient } from '@/libs/trpc/client'; diff --git a/src/services/models.ts b/src/services/models.ts index 16c5b666f5..ba816cf1cb 100644 --- a/src/services/models.ts +++ b/src/services/models.ts @@ -2,7 +2,7 @@ import { getMessageError } from '@lobechat/fetch-sse'; import { createHeaderWithAuth } from '@/services/_auth'; import { aiProviderSelectors, getAiInfraStoreState } from '@/store/aiInfra'; -import type {ChatModelCard} from '@/types/llm'; +import { type ChatModelCard } from '@/types/llm'; import { API_ENDPOINTS } from './_url'; import { resolveRuntimeProvider } from './chat/helper'; @@ -131,7 +131,6 @@ export class ModelsService { const reader = response.body?.getReader(); if (!reader) return; - while (true) { const { done, value } = await reader.read(); if (done) break; diff --git a/src/services/notebook.ts b/src/services/notebook.ts index 8689bee372..c2d8835ff9 100644 --- a/src/services/notebook.ts +++ b/src/services/notebook.ts @@ -1,4 +1,4 @@ -import type {DocumentType} from '@lobechat/builtin-tool-notebook'; +import { type DocumentType } from '@lobechat/builtin-tool-notebook'; import { lambdaClient } from '@/libs/trpc/client'; diff --git a/src/services/plugin/index.ts b/src/services/plugin/index.ts index edd1c440ce..a1dda6a6c3 100644 --- a/src/services/plugin/index.ts +++ b/src/services/plugin/index.ts @@ -1,8 +1,8 @@ -import type {LobeTool} from '@lobechat/types'; -import type {LobeChatPluginManifest} from '@lobehub/chat-plugin-sdk'; +import { type LobeTool } from '@lobechat/types'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; import { lambdaClient } from '@/libs/trpc/client'; -import type {LobeToolCustomPlugin} from '@/types/tool/plugin'; +import { type LobeToolCustomPlugin } from '@/types/tool/plugin'; export interface InstallPluginParams { customParams?: Record; diff --git a/src/services/python.ts b/src/services/python.ts index a9c4f2010a..913b43903d 100644 --- a/src/services/python.ts +++ b/src/services/python.ts @@ -1,5 +1,5 @@ import { PythonInterpreter } from '@lobechat/python-interpreter'; -import type {CodeInterpreterResponse} from '@lobechat/types'; +import { type CodeInterpreterResponse } from '@lobechat/types'; class PythonService { async runPython( diff --git a/src/services/rag.ts b/src/services/rag.ts index 3c351df52c..781867bc32 100644 --- a/src/services/rag.ts +++ b/src/services/rag.ts @@ -1,5 +1,5 @@ import { lambdaClient } from '@/libs/trpc/client'; -import type {SemanticSearchSchemaType} from '@/types/rag'; +import { type SemanticSearchSchemaType } from '@/types/rag'; class RAGService { parseFileContent = async (id: string, skipExist?: boolean) => { diff --git a/src/services/ragEval.ts b/src/services/ragEval.ts index c4fa16a1e2..fd41fa6bb7 100644 --- a/src/services/ragEval.ts +++ b/src/services/ragEval.ts @@ -1,4 +1,11 @@ -import type {CreateNewEvalDatasets, CreateNewEvalEvaluation, EvalDatasetRecord, insertEvalDatasetsSchema,RAGEvalDataSetItem, RAGEvalEvaluationItem} from '@lobechat/types'; +import { + type CreateNewEvalDatasets, + type CreateNewEvalEvaluation, + type EvalDatasetRecord, + type insertEvalDatasetsSchema, + type RAGEvalDataSetItem, + type RAGEvalEvaluationItem, +} from '@lobechat/types'; import { lambdaClient } from '@/libs/trpc/client'; import { uploadService } from '@/services/upload'; diff --git a/src/services/resource/index.ts b/src/services/resource/index.ts index 51a65d25e0..5d5ccb34b1 100644 --- a/src/services/resource/index.ts +++ b/src/services/resource/index.ts @@ -1,13 +1,13 @@ -import type { FileListItem } from '@/types/files'; -import type { - CreateResourceParams, - ResourceItem, - ResourceQueryParams, - UpdateResourceParams, +import { type FileListItem } from '@/types/files'; +import { + type CreateResourceParams, + type ResourceItem, + type ResourceQueryParams, + type UpdateResourceParams, } from '@/types/resource'; -import type {CreateDocumentParams} from '../document'; -import { documentService } from '../document'; +import { type CreateDocumentParams } from '../document'; +import { documentService } from '../document'; import { fileService } from '../file'; /** diff --git a/src/services/search.ts b/src/services/search.ts index 7062748b24..a0c903d8df 100644 --- a/src/services/search.ts +++ b/src/services/search.ts @@ -1,4 +1,4 @@ -import type {SearchQuery} from '@lobechat/types'; +import { type SearchQuery } from '@lobechat/types'; import { toolsClient } from '@/libs/trpc/client'; diff --git a/src/services/session/index.ts b/src/services/session/index.ts index 7dbc08787c..73a6f36d3e 100644 --- a/src/services/session/index.ts +++ b/src/services/session/index.ts @@ -1,10 +1,17 @@ - -import type { PartialDeep } from 'type-fest'; +import { type PartialDeep } from 'type-fest'; import { lambdaClient } from '@/libs/trpc/client'; -import type {LobeAgentChatConfig, LobeAgentConfig} from '@/types/agent'; -import type {MetaData} from '@/types/meta'; -import type {ChatSessionList, LobeAgentSession, LobeSessions, LobeSessionType, SessionGroupItem, SessionRankItem, UpdateSessionParams} from '@/types/session'; +import { type LobeAgentChatConfig, type LobeAgentConfig } from '@/types/agent'; +import { type MetaData } from '@/types/meta'; +import { + type ChatSessionList, + type LobeAgentSession, + type LobeSessions, + type LobeSessionType, + type SessionGroupItem, + type SessionRankItem, + type UpdateSessionParams, +} from '@/types/session'; export class SessionService { hasSessions = async (): Promise => { diff --git a/src/services/share.ts b/src/services/share.ts index 47e63c6dad..177be8d5b2 100644 --- a/src/services/share.ts +++ b/src/services/share.ts @@ -1,7 +1,7 @@ -import type { PartialDeep } from 'type-fest'; +import { type PartialDeep } from 'type-fest'; import { LOBE_URL_IMPORT_NAME } from '@/const/url'; -import type {UserSettings} from '@/types/user/settings'; +import { type UserSettings } from '@/types/user/settings'; class ShareService { /** diff --git a/src/services/thread/index.ts b/src/services/thread/index.ts index dc57e304e7..310182d5c3 100644 --- a/src/services/thread/index.ts +++ b/src/services/thread/index.ts @@ -1,8 +1,8 @@ -import type {CreateMessageParams} from '@lobechat/types'; +import { type CreateMessageParams } from '@lobechat/types'; import { INBOX_SESSION_ID } from '@/const/session'; import { lambdaClient } from '@/libs/trpc/client'; -import type {CreateThreadParams, ThreadItem} from '@/types/topic'; +import { type CreateThreadParams, type ThreadItem } from '@/types/topic'; interface CreateThreadWithMessageParams extends CreateThreadParams { message: CreateMessageParams; diff --git a/src/services/tool.ts b/src/services/tool.ts index 0e4ea8cd14..55c6deb634 100644 --- a/src/services/tool.ts +++ b/src/services/tool.ts @@ -1,6 +1,6 @@ import { lambdaClient } from '@/libs/trpc/client'; import { globalHelpers } from '@/store/global/helpers'; -import type {PluginQueryParams} from '@/types/discover'; +import { type PluginQueryParams } from '@/types/discover'; import { convertOpenAIManifestToLobeManifest, getToolManifest } from '@/utils/toolManifest'; class ToolService { diff --git a/src/services/topic/index.ts b/src/services/topic/index.ts index a995ef6e4e..616e5fccb5 100644 --- a/src/services/topic/index.ts +++ b/src/services/topic/index.ts @@ -1,7 +1,13 @@ import { INBOX_SESSION_ID } from '@/const/session'; import { lambdaClient } from '@/libs/trpc/client'; -import type {BatchTaskResult} from '@/types/service'; -import type {ChatTopic, CreateTopicParams, QueryTopicParams, RecentTopic, TopicRankItem} from '@/types/topic'; +import { type BatchTaskResult } from '@/types/service'; +import { + type ChatTopic, + type CreateTopicParams, + type QueryTopicParams, + type RecentTopic, + type TopicRankItem, +} from '@/types/topic'; export class TopicService { createTopic = (params: CreateTopicParams): Promise => { diff --git a/src/services/trace.ts b/src/services/trace.ts index f298962da7..d3a1b60f98 100644 --- a/src/services/trace.ts +++ b/src/services/trace.ts @@ -1,7 +1,7 @@ import { API_ENDPOINTS } from '@/services/_url'; import { useUserStore } from '@/store/user'; import { userGeneralSettingsSelectors } from '@/store/user/selectors'; -import type {TraceEventBasePayload, TraceEventPayloads} from '@/types/trace'; +import { type TraceEventBasePayload, type TraceEventPayloads } from '@/types/trace'; class TraceService { private request = async (data: T) => { diff --git a/src/services/upload.ts b/src/services/upload.ts index 3d481c7cb2..fb964b528f 100644 --- a/src/services/upload.ts +++ b/src/services/upload.ts @@ -6,8 +6,8 @@ import { sha256 } from 'js-sha256'; import { fileEnv } from '@/envs/file'; import { lambdaClient } from '@/libs/trpc/client'; import { API_ENDPOINTS } from '@/services/_url'; -import type {FileMetadata, UploadBase64ToS3Result} from '@/types/files'; -import type {FileUploadState, FileUploadStatus} from '@/types/files/upload'; +import { type FileMetadata, type UploadBase64ToS3Result } from '@/types/files'; +import { type FileUploadState, type FileUploadStatus } from '@/types/files/upload'; export const UPLOAD_NETWORK_ERROR = 'NetWorkError'; diff --git a/src/services/user/index.ts b/src/services/user/index.ts index 92976ca1c4..557fb2a8f2 100644 --- a/src/services/user/index.ts +++ b/src/services/user/index.ts @@ -1,8 +1,14 @@ -import type { PartialDeep } from 'type-fest'; +import { type PartialDeep } from 'type-fest'; import { lambdaClient } from '@/libs/trpc/client'; -import type {SSOProvider, UserGuide, UserInitializationState, UserOnboarding, UserPreference} from '@/types/user'; -import type {UserSettings} from '@/types/user/settings'; +import { + type SSOProvider, + type UserGuide, + type UserInitializationState, + type UserOnboarding, + type UserPreference, +} from '@/types/user'; +import { type UserSettings } from '@/types/user/settings'; export class UserService { getUserRegistrationDuration = async (): Promise<{ diff --git a/src/services/userMemory/crud.ts b/src/services/userMemory/crud.ts index 00b2bb1fc8..41d473a641 100644 --- a/src/services/userMemory/crud.ts +++ b/src/services/userMemory/crud.ts @@ -1,4 +1,4 @@ -import type {NewUserMemoryIdentity} from '@lobechat/types'; +import { type NewUserMemoryIdentity } from '@lobechat/types'; import { lambdaClient } from '@/libs/trpc/client'; diff --git a/src/services/userMemory/extraction.ts b/src/services/userMemory/extraction.ts index 1a43672e49..1c7153fd68 100644 --- a/src/services/userMemory/extraction.ts +++ b/src/services/userMemory/extraction.ts @@ -1,4 +1,8 @@ -import type { AsyncTaskStatus, IAsyncTaskError, UserMemoryExtractionMetadata } from '@lobechat/types'; +import { + type AsyncTaskStatus, + type IAsyncTaskError, + type UserMemoryExtractionMetadata, +} from '@lobechat/types'; import { lambdaClient } from '@/libs/trpc/client'; diff --git a/src/services/userMemory/index.ts b/src/services/userMemory/index.ts index 997cf8eeee..245d5cdc37 100644 --- a/src/services/userMemory/index.ts +++ b/src/services/userMemory/index.ts @@ -1,14 +1,32 @@ -import type { - ActivityMemoryItemSchema, - AddIdentityActionSchema, - ContextMemoryItemSchema, - ExperienceMemoryItemSchema, - PreferenceMemoryItemSchema, - RemoveIdentityActionSchema, - UpdateIdentityActionSchema, +import { + type ActivityMemoryItemSchema, + type AddIdentityActionSchema, + type ContextMemoryItemSchema, + type ExperienceMemoryItemSchema, + type PreferenceMemoryItemSchema, + type RemoveIdentityActionSchema, + type UpdateIdentityActionSchema, } from '@lobechat/memory-user-memory/schemas'; -import type {ActivityListParams, ActivityListResult, AddActivityMemoryResult, AddContextMemoryResult, AddExperienceMemoryResult, AddIdentityMemoryResult, AddPreferenceMemoryResult, ExperienceListParams, ExperienceListResult, IdentityListParams, IdentityListResult, LayersEnum, RemoveIdentityMemoryResult, SearchMemoryParams, SearchMemoryResult, TypesEnum, UpdateIdentityMemoryResult} from '@lobechat/types'; -import type {z} from 'zod'; +import { + type ActivityListParams, + type ActivityListResult, + type AddActivityMemoryResult, + type AddContextMemoryResult, + type AddExperienceMemoryResult, + type AddIdentityMemoryResult, + type AddPreferenceMemoryResult, + type ExperienceListParams, + type ExperienceListResult, + type IdentityListParams, + type IdentityListResult, + type LayersEnum, + type RemoveIdentityMemoryResult, + type SearchMemoryParams, + type SearchMemoryResult, + type TypesEnum, + type UpdateIdentityMemoryResult, +} from '@lobechat/types'; +import { type z } from 'zod'; import { lambdaClient } from '@/libs/trpc/client'; diff --git a/src/store/agent/initialState.ts b/src/store/agent/initialState.ts index 39675b01c7..cc94c66379 100644 --- a/src/store/agent/initialState.ts +++ b/src/store/agent/initialState.ts @@ -1,7 +1,7 @@ -import type {AgentSliceState} from './slices/agent'; -import { initialAgentSliceState } from './slices/agent'; -import type {BuiltinAgentSliceState} from './slices/builtin'; -import { initialBuiltinAgentSliceState } from './slices/builtin'; +import { type AgentSliceState } from './slices/agent'; +import { initialAgentSliceState } from './slices/agent'; +import { type BuiltinAgentSliceState } from './slices/builtin'; +import { initialBuiltinAgentSliceState } from './slices/builtin'; export type AgentStoreState = AgentSliceState & BuiltinAgentSliceState; diff --git a/src/store/agent/selectors/agentByIdSelectors.ts b/src/store/agent/selectors/agentByIdSelectors.ts index d74926125c..9dd400a722 100644 --- a/src/store/agent/selectors/agentByIdSelectors.ts +++ b/src/store/agent/selectors/agentByIdSelectors.ts @@ -1,9 +1,9 @@ import { DEFAULT_PROVIDER } from '@lobechat/business-const'; import { DEFAULT_MODEL, DEFAUTT_AGENT_TTS_CONFIG } from '@lobechat/const'; -import type { AgentBuilderContext } from '@lobechat/context-engine'; -import type {AgentMode, LobeAgentTTSConfig, LocalSystemConfig} from '@lobechat/types'; +import { type AgentBuilderContext } from '@lobechat/context-engine'; +import { type AgentMode, type LobeAgentTTSConfig, type LocalSystemConfig } from '@lobechat/types'; -import type { AgentStoreState } from '../initialState'; +import { type AgentStoreState } from '../initialState'; import { agentSelectors } from './selectors'; /** diff --git a/src/store/agent/selectors/builtinAgentSelectors.test.ts b/src/store/agent/selectors/builtinAgentSelectors.test.ts index 0bfd9486b0..9cf426f8a3 100644 --- a/src/store/agent/selectors/builtinAgentSelectors.test.ts +++ b/src/store/agent/selectors/builtinAgentSelectors.test.ts @@ -2,7 +2,7 @@ import { BUILTIN_AGENT_SLUGS } from '@lobechat/builtin-agents'; import { INBOX_SESSION_ID } from '@lobechat/const'; import { describe, expect, it } from 'vitest'; -import type { AgentStoreState } from '@/store/agent/initialState'; +import { type AgentStoreState } from '@/store/agent/initialState'; import { initialAgentSliceState } from '@/store/agent/slices/agent/initialState'; import { initialBuiltinAgentSliceState } from '@/store/agent/slices/builtin'; diff --git a/src/store/agent/selectors/builtinAgentSelectors.ts b/src/store/agent/selectors/builtinAgentSelectors.ts index 82e7343aa9..7fb20e8a1a 100644 --- a/src/store/agent/selectors/builtinAgentSelectors.ts +++ b/src/store/agent/selectors/builtinAgentSelectors.ts @@ -1,7 +1,7 @@ import { BUILTIN_AGENT_SLUGS } from '@lobechat/builtin-agents'; import { INBOX_SESSION_ID } from '@lobechat/const'; -import type {AgentStoreState} from '@/store/agent/initialState'; +import { type AgentStoreState } from '@/store/agent/initialState'; /** * Get builtin agent ID by slug diff --git a/src/store/agent/selectors/chatConfigByIdSelectors.test.ts b/src/store/agent/selectors/chatConfigByIdSelectors.test.ts index 417978ad6b..95423fdd86 100644 --- a/src/store/agent/selectors/chatConfigByIdSelectors.test.ts +++ b/src/store/agent/selectors/chatConfigByIdSelectors.test.ts @@ -1,7 +1,7 @@ import { DEFAULT_AGENT_CHAT_CONFIG, DEFAULT_AGENT_SEARCH_FC_MODEL } from '@lobechat/const'; import { describe, expect, it, vi } from 'vitest'; -import type { AgentStoreState } from '@/store/agent/initialState'; +import { type AgentStoreState } from '@/store/agent/initialState'; import { initialAgentSliceState } from '@/store/agent/slices/agent/initialState'; import { initialBuiltinAgentSliceState } from '@/store/agent/slices/builtin/initialState'; diff --git a/src/store/agent/selectors/chatConfigByIdSelectors.ts b/src/store/agent/selectors/chatConfigByIdSelectors.ts index e2428e04a1..605d157df2 100644 --- a/src/store/agent/selectors/chatConfigByIdSelectors.ts +++ b/src/store/agent/selectors/chatConfigByIdSelectors.ts @@ -1,8 +1,8 @@ import { DEFAULT_AGENT_CHAT_CONFIG, DEFAULT_AGENT_SEARCH_FC_MODEL } from '@lobechat/const'; import { isContextCachingModel, isThinkingWithToolClaudeModel } from '@lobechat/model-runtime'; -import type {LobeAgentChatConfig} from '@lobechat/types'; +import { type LobeAgentChatConfig } from '@lobechat/types'; -import type {AgentStoreState} from '@/store/agent/initialState'; +import { type AgentStoreState } from '@/store/agent/initialState'; import { agentSelectors } from './selectors'; diff --git a/src/store/agent/selectors/chatConfigSelectors.test.ts b/src/store/agent/selectors/chatConfigSelectors.test.ts index 4452fffe97..ebf0650b14 100644 --- a/src/store/agent/selectors/chatConfigSelectors.test.ts +++ b/src/store/agent/selectors/chatConfigSelectors.test.ts @@ -1,7 +1,7 @@ import { DEFAULT_AGENT_CHAT_CONFIG, DEFAULT_AGENT_SEARCH_FC_MODEL } from '@lobechat/const'; import { describe, expect, it, vi } from 'vitest'; -import type { AgentStoreState } from '@/store/agent/initialState'; +import { type AgentStoreState } from '@/store/agent/initialState'; import { initialAgentSliceState } from '@/store/agent/slices/agent/initialState'; import { initialBuiltinAgentSliceState } from '@/store/agent/slices/builtin/initialState'; diff --git a/src/store/agent/selectors/chatConfigSelectors.ts b/src/store/agent/selectors/chatConfigSelectors.ts index 62219b2c7e..21a6f275ac 100644 --- a/src/store/agent/selectors/chatConfigSelectors.ts +++ b/src/store/agent/selectors/chatConfigSelectors.ts @@ -1,6 +1,6 @@ -import type {LobeAgentChatConfig} from '@lobechat/types'; +import { type LobeAgentChatConfig } from '@lobechat/types'; -import type {AgentStoreState} from '@/store/agent/initialState'; +import { type AgentStoreState } from '@/store/agent/initialState'; import { chatConfigByIdSelectors } from './chatConfigByIdSelectors'; diff --git a/src/store/agent/selectors/selectors.test.ts b/src/store/agent/selectors/selectors.test.ts index e2c9edb86a..c2066a1f8e 100644 --- a/src/store/agent/selectors/selectors.test.ts +++ b/src/store/agent/selectors/selectors.test.ts @@ -9,7 +9,7 @@ import { import { KnowledgeType } from '@lobechat/types'; import { describe, expect, it, vi } from 'vitest'; -import type { AgentStoreState } from '@/store/agent/initialState'; +import { type AgentStoreState } from '@/store/agent/initialState'; import { initialAgentSliceState } from '@/store/agent/slices/agent/initialState'; import { initialBuiltinAgentSliceState } from '@/store/agent/slices/builtin'; diff --git a/src/store/agent/selectors/selectors.ts b/src/store/agent/selectors/selectors.ts index 3f3c37d0ce..847829d03e 100644 --- a/src/store/agent/selectors/selectors.ts +++ b/src/store/agent/selectors/selectors.ts @@ -6,16 +6,21 @@ import { DEFAULT_MODEL, DEFAUTT_AGENT_TTS_CONFIG, } from '@lobechat/const'; -import type {AgentMode, KnowledgeItem, LobeAgentConfig, LobeAgentTTSConfig, LocalSystemConfig, MetaData} from '@lobechat/types'; import { - KnowledgeType + type AgentMode, + type KnowledgeItem, + type LobeAgentConfig, + type LobeAgentTTSConfig, + type LocalSystemConfig, + type MetaData, } from '@lobechat/types'; +import { KnowledgeType } from '@lobechat/types'; import { VoiceList } from '@lobehub/tts'; import { DEFAULT_OPENING_QUESTIONS } from '@/features/AgentSetting/store/selectors'; import { filterToolIds } from '@/helpers/toolFilters'; -import type { AgentStoreState } from '../initialState'; +import { type AgentStoreState } from '../initialState'; import { builtinAgentSelectors } from './builtinAgentSelectors'; // ========== Meta ============== // diff --git a/src/store/agent/slices/agent/action.test.ts b/src/store/agent/slices/agent/action.test.ts index ead012f280..6a1bc4cd37 100644 --- a/src/store/agent/slices/agent/action.test.ts +++ b/src/store/agent/slices/agent/action.test.ts @@ -2,7 +2,7 @@ import { act, renderHook, waitFor } from '@testing-library/react'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { agentService } from '@/services/agent'; -import type { LobeAgentConfig } from '@/types/agent'; +import { type LobeAgentConfig } from '@/types/agent'; import { withSWR } from '~test-utils'; import { useAgentStore } from '../../store'; diff --git a/src/store/agent/slices/agent/action.ts b/src/store/agent/slices/agent/action.ts index c899dd0c8c..72b93c8f82 100644 --- a/src/store/agent/slices/agent/action.ts +++ b/src/store/agent/slices/agent/action.ts @@ -1,22 +1,26 @@ import { getSingletonAnalyticsOptional } from '@lobehub/analytics'; import isEqual from 'fast-deep-equal'; import { produce } from 'immer'; -import type { SWRResponse } from 'swr'; -import type { PartialDeep } from 'type-fest'; +import { type SWRResponse } from 'swr'; +import { type PartialDeep } from 'type-fest'; import { MESSAGE_CANCEL_FLAT } from '@/const/message'; import { mutate, useClientDataSWR } from '@/libs/swr'; -import type {CreateAgentParams, CreateAgentResult} from '@/services/agent'; -import { agentService } from '@/services/agent'; -import type {StoreSetter} from '@/store/types'; +import { type CreateAgentParams, type CreateAgentResult } from '@/services/agent'; +import { agentService } from '@/services/agent'; +import { type StoreSetter } from '@/store/types'; import { getUserStoreState } from '@/store/user'; import { userProfileSelectors } from '@/store/user/selectors'; -import type {LobeAgentChatConfig, LobeAgentConfig, LocalSystemConfig} from '@/types/agent'; -import type {MetaData} from '@/types/meta'; +import { + type LobeAgentChatConfig, + type LobeAgentConfig, + type LocalSystemConfig, +} from '@/types/agent'; +import { type MetaData } from '@/types/meta'; import { merge } from '@/utils/merge'; -import type { AgentStore } from '../../store'; -import type {AgentSliceState, LoadingState, SaveStatus} from './initialState'; +import { type AgentStore } from '../../store'; +import { type AgentSliceState, type LoadingState, type SaveStatus } from './initialState'; const FETCH_AGENT_CONFIG_KEY = 'FETCH_AGENT_CONFIG'; diff --git a/src/store/agent/slices/agent/initialState.ts b/src/store/agent/slices/agent/initialState.ts index 3a05dbeff7..3bf79334e8 100644 --- a/src/store/agent/slices/agent/initialState.ts +++ b/src/store/agent/slices/agent/initialState.ts @@ -1,8 +1,8 @@ -import type { PartialDeep } from 'type-fest'; +import { type PartialDeep } from 'type-fest'; -import type {AgentSettingsInstance} from '@/features/AgentSetting'; -import type {AgentItem} from '@/types/agent'; -import type {MetaData} from '@/types/meta'; +import { type AgentSettingsInstance } from '@/features/AgentSetting'; +import { type AgentItem } from '@/types/agent'; +import { type MetaData } from '@/types/meta'; export type LoadingState = Record | string, boolean>; export type SaveStatus = 'idle' | 'saving' | 'saved'; diff --git a/src/store/agent/slices/builtin/action.ts b/src/store/agent/slices/builtin/action.ts index 1a9db71fc7..07f1ca5d45 100644 --- a/src/store/agent/slices/builtin/action.ts +++ b/src/store/agent/slices/builtin/action.ts @@ -1,12 +1,12 @@ -import type {AgentItem, LobeAgentConfig} from '@lobechat/types'; -import type {SWRResponse} from 'swr'; -import type { PartialDeep } from 'type-fest'; +import { type AgentItem, type LobeAgentConfig } from '@lobechat/types'; +import { type SWRResponse } from 'swr'; +import { type PartialDeep } from 'type-fest'; import { useOnlyFetchOnceSWR } from '@/libs/swr'; import { agentService } from '@/services/agent'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; -import type { AgentStore } from '../../store'; +import { type AgentStore } from '../../store'; interface UseInitBuiltinAgentContext { /** diff --git a/src/store/agent/slices/cron/action.ts b/src/store/agent/slices/cron/action.ts index e684c7ab54..75145d0382 100644 --- a/src/store/agent/slices/cron/action.ts +++ b/src/store/agent/slices/cron/action.ts @@ -1,12 +1,12 @@ -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; -import type { AgentCronJob } from '@/database/schemas/agentCronJob'; +import { type AgentCronJob } from '@/database/schemas/agentCronJob'; import { mutate, useClientDataSWR } from '@/libs/swr'; import { lambdaClient } from '@/libs/trpc/client/lambda'; import { agentCronJobService } from '@/services/agentCronJob'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; -import type { AgentStore } from '../../store'; +import { type AgentStore } from '../../store'; const FETCH_CRON_TOPICS_WITH_JOB_INFO_KEY = 'cronTopicsWithJobInfo'; diff --git a/src/store/agent/slices/knowledge/action.ts b/src/store/agent/slices/knowledge/action.ts index a5e05e146b..ed4774229b 100644 --- a/src/store/agent/slices/knowledge/action.ts +++ b/src/store/agent/slices/knowledge/action.ts @@ -1,11 +1,11 @@ -import type {KnowledgeItem} from '@lobechat/types'; -import type { SWRResponse } from 'swr'; +import { type KnowledgeItem } from '@lobechat/types'; +import { type SWRResponse } from 'swr'; import { mutate, useClientDataSWR } from '@/libs/swr'; import { agentService } from '@/services/agent'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; -import type { AgentStore } from '../../store'; +import { type AgentStore } from '../../store'; const FETCH_AGENT_KNOWLEDGE_KEY = 'FETCH_AGENT_KNOWLEDGE'; diff --git a/src/store/agent/slices/plugin/action.ts b/src/store/agent/slices/plugin/action.ts index 298edb7f6e..8035435d62 100644 --- a/src/store/agent/slices/plugin/action.ts +++ b/src/store/agent/slices/plugin/action.ts @@ -1,9 +1,9 @@ import { produce } from 'immer'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { agentSelectors } from '../../selectors'; -import type { AgentStore } from '../../store'; +import { type AgentStore } from '../../store'; /** * Plugin Slice Actions diff --git a/src/store/agent/store.ts b/src/store/agent/store.ts index 401f7d7f4c..572a23948a 100644 --- a/src/store/agent/store.ts +++ b/src/store/agent/store.ts @@ -1,20 +1,20 @@ import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {AgentStoreState} from './initialState'; -import { initialState } from './initialState'; -import type {AgentSliceAction} from './slices/agent'; -import { createAgentSlice } from './slices/agent'; -import type {BuiltinAgentSliceAction} from './slices/builtin'; -import { createBuiltinAgentSlice } from './slices/builtin'; -import type {CronSliceAction} from './slices/cron'; +import { type AgentStoreState } from './initialState'; +import { initialState } from './initialState'; +import { type AgentSliceAction } from './slices/agent'; +import { createAgentSlice } from './slices/agent'; +import { type BuiltinAgentSliceAction } from './slices/builtin'; +import { createBuiltinAgentSlice } from './slices/builtin'; +import { type CronSliceAction } from './slices/cron'; import { createCronSlice } from './slices/cron'; -import type {KnowledgeSliceAction} from './slices/knowledge'; +import { type KnowledgeSliceAction } from './slices/knowledge'; import { createKnowledgeSlice } from './slices/knowledge'; -import type {PluginSliceAction} from './slices/plugin'; +import { type PluginSliceAction } from './slices/plugin'; import { createPluginSlice } from './slices/plugin'; // =============== aggregate createStoreFn ============ // diff --git a/src/store/agentGroup/action.ts b/src/store/agentGroup/action.ts index 1f858ba64b..37462eb189 100644 --- a/src/store/agentGroup/action.ts +++ b/src/store/agentGroup/action.ts @@ -1,23 +1,21 @@ -import type { AgentGroupDetail } from '@lobechat/types'; +import { type AgentGroupDetail } from '@lobechat/types'; import isEqual from 'fast-deep-equal'; import { produce } from 'immer'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; -import type { ChatGroupItem } from '@/database/schemas/chatGroup'; +import { type ChatGroupItem } from '@/database/schemas/chatGroup'; import { mutate, useClientDataSWRWithSync } from '@/libs/swr'; import { chatGroupService } from '@/services/chatGroup'; import { getAgentStoreState } from '@/store/agent'; -import type {ChatGroupStore} from '@/store/agentGroup/store'; +import { type ChatGroupStore } from '@/store/agentGroup/store'; import { useChatStore } from '@/store/chat'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { flattenActions } from '@/store/utils/flattenActions'; import { setNamespace } from '@/utils/storeDebug'; -import type {ChatGroupState} from './initialState'; -import type {ChatGroupDispatchPayloads, ChatGroupReducer} from './reducers'; -import { - chatGroupReducers -} from './reducers'; +import { type ChatGroupState } from './initialState'; +import { type ChatGroupDispatchPayloads, type ChatGroupReducer } from './reducers'; +import { chatGroupReducers } from './reducers'; import { ChatGroupCurdAction } from './slices/curd'; import { ChatGroupLifecycleAction } from './slices/lifecycle'; import { ChatGroupMemberAction } from './slices/member'; diff --git a/src/store/agentGroup/initialState.ts b/src/store/agentGroup/initialState.ts index 37a740de8b..9522aee385 100644 --- a/src/store/agentGroup/initialState.ts +++ b/src/store/agentGroup/initialState.ts @@ -1,7 +1,7 @@ -import type { AgentGroupDetail } from '@lobechat/types'; -import type { ParsedQuery } from 'query-string'; +import { type AgentGroupDetail } from '@lobechat/types'; +import { type ParsedQuery } from 'query-string'; -import type { ChatGroupItem } from '@/database/schemas/chatGroup'; +import { type ChatGroupItem } from '@/database/schemas/chatGroup'; export interface QueryRouter { push: (url: string, options?: { query?: ParsedQuery; replace?: boolean }) => void; diff --git a/src/store/agentGroup/reducers.ts b/src/store/agentGroup/reducers.ts index d3ea8afa8c..9453e30219 100644 --- a/src/store/agentGroup/reducers.ts +++ b/src/store/agentGroup/reducers.ts @@ -1,9 +1,9 @@ -import type { AgentGroupDetail } from '@lobechat/types'; +import { type AgentGroupDetail } from '@lobechat/types'; import { produce } from 'immer'; -import type {ChatGroupItem} from '@/database/schemas/chatGroup'; +import { type ChatGroupItem } from '@/database/schemas/chatGroup'; -import type {ChatGroupState} from './initialState'; +import { type ChatGroupState } from './initialState'; /** * Convert ChatGroupItem to AgentGroupDetail by adding empty agents array diff --git a/src/store/agentGroup/selectors/byId.test.ts b/src/store/agentGroup/selectors/byId.test.ts index cf04a04da2..287a0ccad8 100644 --- a/src/store/agentGroup/selectors/byId.test.ts +++ b/src/store/agentGroup/selectors/byId.test.ts @@ -1,7 +1,7 @@ -import type { AgentGroupDetail } from '@lobechat/types'; +import { type AgentGroupDetail } from '@lobechat/types'; import { describe, expect, it } from 'vitest'; -import type { ChatGroupStore } from '../store'; +import { type ChatGroupStore } from '../store'; import { agentGroupByIdSelectors } from './byId'; // Helper to create mock AgentGroupDetail with required fields diff --git a/src/store/agentGroup/selectors/byId.ts b/src/store/agentGroup/selectors/byId.ts index 35326cf4c5..558c4492c2 100644 --- a/src/store/agentGroup/selectors/byId.ts +++ b/src/store/agentGroup/selectors/byId.ts @@ -1,10 +1,10 @@ -import type { AgentGroupDetail, AgentGroupMember, AgentItem } from '@lobechat/types'; +import { type AgentGroupDetail, type AgentGroupMember, type AgentItem } from '@lobechat/types'; import { DEFAULT_CHAT_GROUP_CHAT_CONFIG, DEFAULT_CHAT_GROUP_META_CONFIG } from '@/const/settings'; import { merge } from '@/utils/merge'; -import type { ChatGroupState } from '../initialState'; -import type { ChatGroupStore } from '../store'; +import { type ChatGroupState } from '../initialState'; +import { type ChatGroupStore } from '../store'; const groupById = (id: string) => diff --git a/src/store/agentGroup/selectors/current.ts b/src/store/agentGroup/selectors/current.ts index 4eb16b652c..99eb3465dd 100644 --- a/src/store/agentGroup/selectors/current.ts +++ b/src/store/agentGroup/selectors/current.ts @@ -3,10 +3,10 @@ import { DEFAULT_CHAT_GROUP_CHAT_CONFIG, DEFAULT_CHAT_GROUP_META_CONFIG, } from '@lobechat/const'; -import type { AgentGroupDetail, AgentGroupMember } from '@lobechat/types'; +import { type AgentGroupDetail, type AgentGroupMember } from '@lobechat/types'; -import type { ChatGroupState } from '../initialState'; -import type { ChatGroupStore } from '../store'; +import { type ChatGroupState } from '../initialState'; +import { type ChatGroupStore } from '../store'; import { agentGroupByIdSelectors } from './byId'; const activeGroupId = (s: ChatGroupState): string | undefined => s.activeGroupId; diff --git a/src/store/agentGroup/slices/curd.test.ts b/src/store/agentGroup/slices/curd.test.ts index bff422bb93..b0e43ab93a 100644 --- a/src/store/agentGroup/slices/curd.test.ts +++ b/src/store/agentGroup/slices/curd.test.ts @@ -1,4 +1,4 @@ -import type { AgentGroupDetail } from '@lobechat/types'; +import { type AgentGroupDetail } from '@lobechat/types'; import { act, renderHook } from '@testing-library/react'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; diff --git a/src/store/agentGroup/slices/curd.ts b/src/store/agentGroup/slices/curd.ts index 70e39777b1..980dc8c9c9 100644 --- a/src/store/agentGroup/slices/curd.ts +++ b/src/store/agentGroup/slices/curd.ts @@ -1,10 +1,10 @@ -import type { LobeChatGroupConfig } from '@lobechat/types'; +import { type LobeChatGroupConfig } from '@lobechat/types'; import { DEFAULT_CHAT_GROUP_CHAT_CONFIG } from '@/const/settings'; -import type { ChatGroupItem } from '@/database/schemas/chatGroup'; +import { type ChatGroupItem } from '@/database/schemas/chatGroup'; import { chatGroupService } from '@/services/chatGroup'; -import type {ChatGroupStore} from '@/store/agentGroup/store'; -import type {StoreSetter} from '@/store/types'; +import { type ChatGroupStore } from '@/store/agentGroup/store'; +import { type StoreSetter } from '@/store/types'; import { agentGroupSelectors } from '../selectors'; diff --git a/src/store/agentGroup/slices/lifecycle.ts b/src/store/agentGroup/slices/lifecycle.ts index 1c81d41f2e..6ad5d304c0 100644 --- a/src/store/agentGroup/slices/lifecycle.ts +++ b/src/store/agentGroup/slices/lifecycle.ts @@ -1,11 +1,11 @@ -import type { NewChatGroup } from '@lobechat/types'; +import { type NewChatGroup } from '@lobechat/types'; import urlJoin from 'url-join'; import { chatGroupService } from '@/services/chatGroup'; import { useChatStore } from '@/store/chat'; import { getHomeStoreState } from '@/store/home'; -import type { ChatGroupStore } from '../store'; +import { type ChatGroupStore } from '../store'; type ChatGroupStoreWithSwitchTopic = ChatGroupStore & { switchTopic: (topicId?: string | null) => void; diff --git a/src/store/agentGroup/slices/member.ts b/src/store/agentGroup/slices/member.ts index 1d4556ffb7..8195152ed9 100644 --- a/src/store/agentGroup/slices/member.ts +++ b/src/store/agentGroup/slices/member.ts @@ -1,9 +1,9 @@ -import type { LobeAgentConfig } from '@lobechat/types'; -import type { PartialDeep } from 'type-fest'; +import { type LobeAgentConfig } from '@lobechat/types'; +import { type PartialDeep } from 'type-fest'; import { chatGroupService } from '@/services/chatGroup'; import { getAgentStoreState } from '@/store/agent'; -import type {ChatGroupStore} from '@/store/agentGroup/store'; +import { type ChatGroupStore } from '@/store/agentGroup/store'; type ChatGroupStoreWithRefresh = ChatGroupStore & { refreshGroupDetail: (groupId: string) => Promise; diff --git a/src/store/agentGroup/store.ts b/src/store/agentGroup/store.ts index 5e858b0d7f..7b16c3508e 100644 --- a/src/store/agentGroup/store.ts +++ b/src/store/agentGroup/store.ts @@ -1,12 +1,12 @@ import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; -import type {ChatGroupAction} from './action'; -import { chatGroupAction } from './action'; -import type {ChatGroupState} from './initialState'; -import { initialChatGroupState } from './initialState'; +import { type ChatGroupAction } from './action'; +import { chatGroupAction } from './action'; +import { type ChatGroupState } from './initialState'; +import { initialChatGroupState } from './initialState'; export type ChatGroupStore = ChatGroupState & ChatGroupAction; diff --git a/src/store/aiInfra/initialState.ts b/src/store/aiInfra/initialState.ts index 26c48a23aa..109d016e35 100644 --- a/src/store/aiInfra/initialState.ts +++ b/src/store/aiInfra/initialState.ts @@ -1,7 +1,7 @@ -import type {AIModelsState} from './slices/aiModel'; -import { initialAIModelState } from './slices/aiModel'; -import type {AIProviderState} from './slices/aiProvider'; -import { initialAIProviderState } from './slices/aiProvider'; +import { type AIModelsState } from './slices/aiModel'; +import { initialAIModelState } from './slices/aiModel'; +import { type AIProviderState } from './slices/aiProvider'; +import { initialAIProviderState } from './slices/aiProvider'; export interface AIProviderStoreState extends AIProviderState, AIModelsState { /* empty */ diff --git a/src/store/aiInfra/slices/aiModel/action.test.ts b/src/store/aiInfra/slices/aiModel/action.test.ts index 23612dcd4b..b3ef835d11 100644 --- a/src/store/aiInfra/slices/aiModel/action.test.ts +++ b/src/store/aiInfra/slices/aiModel/action.test.ts @@ -1,5 +1,5 @@ import { act, renderHook, waitFor } from '@testing-library/react'; -import type { AiProviderModelListItem } from 'model-bank'; +import { type AiProviderModelListItem } from 'model-bank'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { mutate } from '@/libs/swr'; diff --git a/src/store/aiInfra/slices/aiModel/action.ts b/src/store/aiInfra/slices/aiModel/action.ts index b2c1bf6064..47475bb359 100644 --- a/src/store/aiInfra/slices/aiModel/action.ts +++ b/src/store/aiInfra/slices/aiModel/action.ts @@ -1,11 +1,16 @@ import isEqual from 'fast-deep-equal'; -import type {AiModelSortMap, AiProviderModelListItem, CreateAiModelParams, ToggleAiModelEnableParams} from 'model-bank'; -import type { SWRResponse } from 'swr'; +import { + type AiModelSortMap, + type AiProviderModelListItem, + type CreateAiModelParams, + type ToggleAiModelEnableParams, +} from 'model-bank'; +import { type SWRResponse } from 'swr'; import { mutate, useClientDataSWR } from '@/libs/swr'; import { aiModelService } from '@/services/aiModel'; -import type {AiInfraStore} from '@/store/aiInfra/store'; -import type {StoreSetter} from '@/store/types'; +import { type AiInfraStore } from '@/store/aiInfra/store'; +import { type StoreSetter } from '@/store/types'; const FETCH_AI_PROVIDER_MODEL_LIST_KEY = 'FETCH_AI_PROVIDER_MODELS'; diff --git a/src/store/aiInfra/slices/aiModel/initialState.ts b/src/store/aiInfra/slices/aiModel/initialState.ts index 8da74ae99f..a786ab3026 100644 --- a/src/store/aiInfra/slices/aiModel/initialState.ts +++ b/src/store/aiInfra/slices/aiModel/initialState.ts @@ -1,4 +1,4 @@ -import type {AiProviderModelListItem, LobeDefaultAiModelListItem} from 'model-bank'; +import { type AiProviderModelListItem, type LobeDefaultAiModelListItem } from 'model-bank'; export interface AIModelsState { aiModelLoadingIds: string[]; diff --git a/src/store/aiInfra/slices/aiModel/selectors.test.ts b/src/store/aiInfra/slices/aiModel/selectors.test.ts index d6ba891401..01f6803a69 100644 --- a/src/store/aiInfra/slices/aiModel/selectors.test.ts +++ b/src/store/aiInfra/slices/aiModel/selectors.test.ts @@ -1,7 +1,7 @@ import { AiModelSourceEnum } from 'model-bank'; import { describe, expect, it } from 'vitest'; -import type { AIProviderStoreState } from '@/store/aiInfra/initialState'; +import { type AIProviderStoreState } from '@/store/aiInfra/initialState'; import { aiModelSelectors } from './selectors'; diff --git a/src/store/aiInfra/slices/aiModel/selectors.ts b/src/store/aiInfra/slices/aiModel/selectors.ts index b10af272b4..b77fe792c7 100644 --- a/src/store/aiInfra/slices/aiModel/selectors.ts +++ b/src/store/aiInfra/slices/aiModel/selectors.ts @@ -1,6 +1,6 @@ import { AiModelSourceEnum } from 'model-bank'; -import type {AIProviderStoreState} from '@/store/aiInfra/initialState'; +import { type AIProviderStoreState } from '@/store/aiInfra/initialState'; import { ModelSearchImplement } from '@/types/search'; const aiProviderChatModelListIds = (s: AIProviderStoreState) => diff --git a/src/store/aiInfra/slices/aiProvider/__tests__/action.test.ts b/src/store/aiInfra/slices/aiProvider/__tests__/action.test.ts index a3cc3be5f7..b82900ad3f 100644 --- a/src/store/aiInfra/slices/aiProvider/__tests__/action.test.ts +++ b/src/store/aiInfra/slices/aiProvider/__tests__/action.test.ts @@ -1,5 +1,5 @@ import * as runtimeModule from '@lobechat/model-runtime'; -import type { AIImageModelCard, EnabledAiModel, ModelParamsSchema } from 'model-bank'; +import { type AIImageModelCard, type EnabledAiModel, type ModelParamsSchema } from 'model-bank'; import { afterEach, describe, expect, it, vi } from 'vitest'; import { diff --git a/src/store/aiInfra/slices/aiProvider/action.ts b/src/store/aiInfra/slices/aiProvider/action.ts index 1fcbbfcdba..6e20eddac1 100644 --- a/src/store/aiInfra/slices/aiProvider/action.ts +++ b/src/store/aiInfra/slices/aiProvider/action.ts @@ -1,18 +1,33 @@ import { getModelPropertyWithFallback, resolveImageSinglePrice } from '@lobechat/model-runtime'; import { uniqBy } from 'es-toolkit/compat'; -import type {AIImageModelCard, EnabledAiModel, LobeDefaultAiModelListItem, ModelAbilities, ModelParamsSchema, Pricing} from 'model-bank'; -import type { SWRResponse } from 'swr'; +import { + type AIImageModelCard, + type EnabledAiModel, + type LobeDefaultAiModelListItem, + type ModelAbilities, + type ModelParamsSchema, + type Pricing, +} from 'model-bank'; +import { type SWRResponse } from 'swr'; import { mutate, useClientDataSWR } from '@/libs/swr'; import { aiProviderService } from '@/services/aiProvider'; -import type {AiInfraStore} from '@/store/aiInfra/store'; -import type {StoreSetter} from '@/store/types'; +import { type AiInfraStore } from '@/store/aiInfra/store'; +import { type StoreSetter } from '@/store/types'; import { useUserStore } from '@/store/user'; import { authSelectors } from '@/store/user/selectors'; -import type {AiProviderDetailItem, AiProviderListItem, AiProviderRuntimeState, AiProviderSortMap, CreateAiProviderParams, EnabledProvider, EnabledProviderWithModels, UpdateAiProviderConfigParams, UpdateAiProviderParams} from '@/types/aiProvider'; import { - AiProviderSourceEnum + type AiProviderDetailItem, + type AiProviderListItem, + type AiProviderRuntimeState, + type AiProviderSortMap, + type CreateAiProviderParams, + type EnabledProvider, + type EnabledProviderWithModels, + type UpdateAiProviderConfigParams, + type UpdateAiProviderParams, } from '@/types/aiProvider'; +import { AiProviderSourceEnum } from '@/types/aiProvider'; export type ProviderModelListItem = { abilities: ModelAbilities; diff --git a/src/store/aiInfra/slices/aiProvider/initialState.ts b/src/store/aiInfra/slices/aiProvider/initialState.ts index d3ff8b4086..89b3901d62 100644 --- a/src/store/aiInfra/slices/aiProvider/initialState.ts +++ b/src/store/aiInfra/slices/aiProvider/initialState.ts @@ -1,6 +1,12 @@ -import type {EnabledAiModel} from 'model-bank'; +import { type EnabledAiModel } from 'model-bank'; -import type {AiProviderDetailItem, AiProviderListItem, AiProviderRuntimeConfig, EnabledProvider, EnabledProviderWithModels} from '@/types/aiProvider'; +import { + type AiProviderDetailItem, + type AiProviderListItem, + type AiProviderRuntimeConfig, + type EnabledProvider, + type EnabledProviderWithModels, +} from '@/types/aiProvider'; export interface AIProviderState { activeAiProvider?: string; diff --git a/src/store/aiInfra/slices/aiProvider/selectors.ts b/src/store/aiInfra/slices/aiProvider/selectors.ts index 0f11623943..982a392543 100644 --- a/src/store/aiInfra/slices/aiProvider/selectors.ts +++ b/src/store/aiInfra/slices/aiProvider/selectors.ts @@ -1,9 +1,9 @@ import { isProviderDisableBrowserRequest } from 'model-bank/modelProviders'; -import type {AIProviderStoreState} from '@/store/aiInfra/initialState'; -import type {AiProviderRuntimeConfig} from '@/types/aiProvider'; -import { AiProviderSourceEnum } from '@/types/aiProvider'; -import type {GlobalLLMProviderKey} from '@/types/user/settings'; +import { type AIProviderStoreState } from '@/store/aiInfra/initialState'; +import { type AiProviderRuntimeConfig } from '@/types/aiProvider'; +import { AiProviderSourceEnum } from '@/types/aiProvider'; +import { type GlobalLLMProviderKey } from '@/types/user/settings'; // List const enabledAiProviderList = (s: AIProviderStoreState) => diff --git a/src/store/aiInfra/store.ts b/src/store/aiInfra/store.ts index 19ef85c959..27a9ab1c76 100644 --- a/src/store/aiInfra/store.ts +++ b/src/store/aiInfra/store.ts @@ -1,15 +1,15 @@ import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {AIProviderStoreState} from './initialState'; -import { initialState } from './initialState'; -import type {AiModelAction} from './slices/aiModel'; -import { createAiModelSlice } from './slices/aiModel'; -import type {AiProviderAction} from './slices/aiProvider'; -import { createAiProviderSlice } from './slices/aiProvider'; +import { type AIProviderStoreState } from './initialState'; +import { initialState } from './initialState'; +import { type AiModelAction } from './slices/aiModel'; +import { createAiModelSlice } from './slices/aiModel'; +import { type AiProviderAction } from './slices/aiProvider'; +import { createAiProviderSlice } from './slices/aiProvider'; // =============== Aggregate createStoreFn ============ // diff --git a/src/store/chat/agents/GroupOrchestration/__tests__/batch-exec-async-tasks.test.ts b/src/store/chat/agents/GroupOrchestration/__tests__/batch-exec-async-tasks.test.ts index 0e74fc52fd..17114f3a7b 100644 --- a/src/store/chat/agents/GroupOrchestration/__tests__/batch-exec-async-tasks.test.ts +++ b/src/store/chat/agents/GroupOrchestration/__tests__/batch-exec-async-tasks.test.ts @@ -1,10 +1,10 @@ -import type { AgentState } from '@lobechat/agent-runtime'; +import { type AgentState } from '@lobechat/agent-runtime'; import { ThreadStatus } from '@lobechat/types'; import { nanoid } from '@lobechat/utils'; import { describe, expect, it, vi } from 'vitest'; import { aiAgentService } from '@/services/aiAgent'; -import type { ChatStore } from '@/store/chat/store'; +import { type ChatStore } from '@/store/chat/store'; import { createGroupOrchestrationExecutors } from '../createGroupOrchestrationExecutors'; diff --git a/src/store/chat/agents/GroupOrchestration/__tests__/call-supervisor.test.ts b/src/store/chat/agents/GroupOrchestration/__tests__/call-supervisor.test.ts index 436d626d49..ceb5a25b31 100644 --- a/src/store/chat/agents/GroupOrchestration/__tests__/call-supervisor.test.ts +++ b/src/store/chat/agents/GroupOrchestration/__tests__/call-supervisor.test.ts @@ -1,9 +1,9 @@ -import type { AgentState } from '@lobechat/agent-runtime'; -import type { UIChatMessage } from '@lobechat/types'; +import { type AgentState } from '@lobechat/agent-runtime'; +import { type UIChatMessage } from '@lobechat/types'; import { nanoid } from '@lobechat/utils'; import { describe, expect, it, vi } from 'vitest'; -import type { ChatStore } from '@/store/chat/store'; +import { type ChatStore } from '@/store/chat/store'; import { createGroupOrchestrationExecutors } from '../createGroupOrchestrationExecutors'; diff --git a/src/store/chat/agents/GroupOrchestration/createGroupOrchestrationExecutors.ts b/src/store/chat/agents/GroupOrchestration/createGroupOrchestrationExecutors.ts index 5c3991ae2c..a0eca2a1d8 100644 --- a/src/store/chat/agents/GroupOrchestration/createGroupOrchestrationExecutors.ts +++ b/src/store/chat/agents/GroupOrchestration/createGroupOrchestrationExecutors.ts @@ -1,22 +1,22 @@ -import type { - GroupOrchestrationEvent, - GroupOrchestrationExecutor, - GroupOrchestrationExecutorOutput, - SupervisorInstruction, - SupervisorInstructionBatchExecAsyncTasks, - SupervisorInstructionCallAgent, - SupervisorInstructionCallSupervisor, - SupervisorInstructionDelegate, - SupervisorInstructionExecAsyncTask, - SupervisorInstructionExecClientAsyncTask, - SupervisorInstructionParallelCallAgents, +import { + type GroupOrchestrationEvent, + type GroupOrchestrationExecutor, + type GroupOrchestrationExecutorOutput, + type SupervisorInstruction, + type SupervisorInstructionBatchExecAsyncTasks, + type SupervisorInstructionCallAgent, + type SupervisorInstructionCallSupervisor, + type SupervisorInstructionDelegate, + type SupervisorInstructionExecAsyncTask, + type SupervisorInstructionExecClientAsyncTask, + type SupervisorInstructionParallelCallAgents, } from '@lobechat/agent-runtime'; -import type { ConversationContext, UIChatMessage } from '@lobechat/types'; +import { type ConversationContext, type UIChatMessage } from '@lobechat/types'; import debug from 'debug'; import { aiAgentService } from '@/services/aiAgent'; import { dbMessageSelectors } from '@/store/chat/slices/message/selectors'; -import type { ChatStore } from '@/store/chat/store'; +import { type ChatStore } from '@/store/chat/store'; import { messageMapKey } from '@/store/chat/utils/messageMapKey'; const log = debug('lobe-store:group-orchestration-executors'); diff --git a/src/store/chat/agents/__tests__/createAgentExecutors/call-llm.test.ts b/src/store/chat/agents/__tests__/createAgentExecutors/call-llm.test.ts index e4de3570b1..00af02f79a 100644 --- a/src/store/chat/agents/__tests__/createAgentExecutors/call-llm.test.ts +++ b/src/store/chat/agents/__tests__/createAgentExecutors/call-llm.test.ts @@ -1,6 +1,6 @@ -import type { GeneralAgentCallLLMResultPayload } from '@lobechat/agent-runtime'; +import { type GeneralAgentCallLLMResultPayload } from '@lobechat/agent-runtime'; import { LOADING_FLAT } from '@lobechat/const'; -import type { ChatToolPayload } from '@lobechat/types'; +import { type ChatToolPayload } from '@lobechat/types'; import { describe, expect, it, vi } from 'vitest'; import { 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 558f76ddc1..12f2ca5f06 100644 --- a/src/store/chat/agents/__tests__/createAgentExecutors/call-tool.test.ts +++ b/src/store/chat/agents/__tests__/createAgentExecutors/call-tool.test.ts @@ -1,9 +1,9 @@ -import type { GeneralAgentCallToolResultPayload } from '@lobechat/agent-runtime'; -import type { ChatToolPayload } from '@lobechat/types'; -import type { Mock } from 'vitest'; +import { type GeneralAgentCallToolResultPayload } from '@lobechat/agent-runtime'; +import { type ChatToolPayload } from '@lobechat/types'; +import { type Mock } from 'vitest'; import { describe, expect, it, vi } from 'vitest'; -import type { OperationCancelContext } from '@/store/chat/slices/operation/types'; +import { type OperationCancelContext } from '@/store/chat/slices/operation/types'; import { createAssistantMessage, createCallToolInstruction, createMockStore } from './fixtures'; import { @@ -1826,13 +1826,15 @@ describe('call_tool executor', () => { originalCompleteOperation(opId); // Check if this is the createToolMessage operation completing const op = mockStore.operations[opId]; - if (op?.type === 'createToolMessage' && // Abort parent toolCalling operation right after message creation completes - toolCallingOpId) { - const parentOp = mockStore.operations[toolCallingOpId]; - if (parentOp) { - parentOp.abortController.abort(); - } + if ( + op?.type === 'createToolMessage' && // Abort parent toolCalling operation right after message creation completes + toolCallingOpId + ) { + const parentOp = mockStore.operations[toolCallingOpId]; + if (parentOp) { + parentOp.abortController.abort(); } + } }); const originalStartOperation = mockStore.startOperation; diff --git a/src/store/chat/agents/__tests__/createAgentExecutors/exec-task.test.ts b/src/store/chat/agents/__tests__/createAgentExecutors/exec-task.test.ts index 6d405e9416..e8aca8d5e9 100644 --- a/src/store/chat/agents/__tests__/createAgentExecutors/exec-task.test.ts +++ b/src/store/chat/agents/__tests__/createAgentExecutors/exec-task.test.ts @@ -1,5 +1,5 @@ -import type { AgentRuntimeContext, TaskResultPayload } from '@lobechat/agent-runtime'; -import type { Mock } from 'vitest'; +import { type AgentRuntimeContext, type TaskResultPayload } from '@lobechat/agent-runtime'; +import { type Mock } from 'vitest'; import { describe, expect, it, vi } from 'vitest'; import { aiAgentService } from '@/services/aiAgent'; diff --git a/src/store/chat/agents/__tests__/createAgentExecutors/exec-tasks.test.ts b/src/store/chat/agents/__tests__/createAgentExecutors/exec-tasks.test.ts index 7e187a9520..b03032828b 100644 --- a/src/store/chat/agents/__tests__/createAgentExecutors/exec-tasks.test.ts +++ b/src/store/chat/agents/__tests__/createAgentExecutors/exec-tasks.test.ts @@ -1,5 +1,5 @@ -import type { AgentRuntimeContext, TasksBatchResultPayload } from '@lobechat/agent-runtime'; -import type { Mock } from 'vitest'; +import { type AgentRuntimeContext, type TasksBatchResultPayload } from '@lobechat/agent-runtime'; +import { type Mock } from 'vitest'; import { describe, expect, it, vi } from 'vitest'; import { aiAgentService } from '@/services/aiAgent'; diff --git a/src/store/chat/agents/__tests__/createAgentExecutors/finish.test.ts b/src/store/chat/agents/__tests__/createAgentExecutors/finish.test.ts index 121e12c327..1fc119a269 100644 --- a/src/store/chat/agents/__tests__/createAgentExecutors/finish.test.ts +++ b/src/store/chat/agents/__tests__/createAgentExecutors/finish.test.ts @@ -1,4 +1,4 @@ -import type { AgentEventDone } from '@lobechat/agent-runtime'; +import { type AgentEventDone } from '@lobechat/agent-runtime'; import { describe, expect, it } from 'vitest'; import { createFinishInstruction } from './fixtures'; diff --git a/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockInstructions.ts b/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockInstructions.ts index 7afe8399c7..68e7fadf20 100644 --- a/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockInstructions.ts +++ b/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockInstructions.ts @@ -1,14 +1,14 @@ -import type { - AgentInstruction, - AgentInstructionCallLlm, - AgentInstructionCallTool, - AgentInstructionExecTask, - AgentInstructionExecTasks, - ExecTaskItem, - GeneralAgentCallingToolInstructionPayload, - GeneralAgentCallLLMInstructionPayload, +import { + type AgentInstruction, + type AgentInstructionCallLlm, + type AgentInstructionCallTool, + type AgentInstructionExecTask, + type AgentInstructionExecTasks, + type ExecTaskItem, + type GeneralAgentCallingToolInstructionPayload, + type GeneralAgentCallLLMInstructionPayload, } from '@lobechat/agent-runtime'; -import type { ChatToolPayload } from '@lobechat/types'; +import { type ChatToolPayload } from '@lobechat/types'; import { nanoid } from '@lobechat/utils'; /** diff --git a/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockMessages.ts b/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockMessages.ts index 8d34c36ccf..8cca406729 100644 --- a/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockMessages.ts +++ b/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockMessages.ts @@ -1,4 +1,4 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { nanoid } from '@lobechat/utils'; /** diff --git a/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockOperations.ts b/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockOperations.ts index f36173cc99..5d7dc96083 100644 --- a/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockOperations.ts +++ b/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockOperations.ts @@ -1,6 +1,6 @@ import { nanoid } from '@lobechat/utils'; -import type { Operation, OperationType } from '@/store/chat/slices/operation/types'; +import { type Operation, type OperationType } from '@/store/chat/slices/operation/types'; /** * Create a mock Operation object for testing @@ -60,7 +60,7 @@ export const createCompletedOperation = ( export const createFailedOperation = ( type: OperationType, context: Record = {}, - + error: { message: string; type: string } = { message: 'Test error', type: 'TestError' }, ): Operation => { return createMockOperation(type, context, { diff --git a/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockStore.ts b/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockStore.ts index 08463fce78..c3102fe7fd 100644 --- a/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockStore.ts +++ b/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockStore.ts @@ -1,7 +1,7 @@ import { nanoid } from '@lobechat/utils'; import { vi } from 'vitest'; -import type { ChatStore } from '@/store/chat/store'; +import { type ChatStore } from '@/store/chat/store'; /** * Create a mock ChatStore for testing executors diff --git a/src/store/chat/agents/__tests__/createAgentExecutors/helpers/assertions.ts b/src/store/chat/agents/__tests__/createAgentExecutors/helpers/assertions.ts index 5bc4a5fb46..424cfae2ee 100644 --- a/src/store/chat/agents/__tests__/createAgentExecutors/helpers/assertions.ts +++ b/src/store/chat/agents/__tests__/createAgentExecutors/helpers/assertions.ts @@ -1,7 +1,7 @@ import { expect } from 'vitest'; -import type { OperationType } from '@/store/chat/slices/operation/types'; -import type { ChatStore } from '@/store/chat/store'; +import { type OperationType } from '@/store/chat/slices/operation/types'; +import { type ChatStore } from '@/store/chat/store'; /** * Assert that an operation was created with specific type diff --git a/src/store/chat/agents/__tests__/createAgentExecutors/helpers/operationTestUtils.ts b/src/store/chat/agents/__tests__/createAgentExecutors/helpers/operationTestUtils.ts index bc9fafd9af..dde954be70 100644 --- a/src/store/chat/agents/__tests__/createAgentExecutors/helpers/operationTestUtils.ts +++ b/src/store/chat/agents/__tests__/createAgentExecutors/helpers/operationTestUtils.ts @@ -1,4 +1,4 @@ -import type { Operation } from '@/store/chat/slices/operation/types'; +import { type Operation } from '@/store/chat/slices/operation/types'; /** * Simulate operation cancellation diff --git a/src/store/chat/agents/__tests__/createAgentExecutors/helpers/testExecutor.ts b/src/store/chat/agents/__tests__/createAgentExecutors/helpers/testExecutor.ts index 60c0ecad6e..f242e2bd06 100644 --- a/src/store/chat/agents/__tests__/createAgentExecutors/helpers/testExecutor.ts +++ b/src/store/chat/agents/__tests__/createAgentExecutors/helpers/testExecutor.ts @@ -1,10 +1,10 @@ -import type { AgentInstruction, AgentState } from '@lobechat/agent-runtime'; +import { type AgentInstruction, type AgentState } from '@lobechat/agent-runtime'; import { DEFAULT_AGENT_CHAT_CONFIG, DEFAULT_AGENT_CONFIG } from '@/const/settings'; -import type { ResolvedAgentConfig } from '@/services/chat/mecha'; +import { type ResolvedAgentConfig } from '@/services/chat/mecha'; import { createAgentExecutors } from '@/store/chat/agents/createAgentExecutors'; -import type { OperationType } from '@/store/chat/slices/operation/types'; -import type { ChatStore } from '@/store/chat/store'; +import { type OperationType } from '@/store/chat/slices/operation/types'; +import { type ChatStore } from '@/store/chat/store'; /** * Create a mock ResolvedAgentConfig for testing diff --git a/src/store/chat/agents/__tests__/createAgentExecutors/request-human-approve.test.ts b/src/store/chat/agents/__tests__/createAgentExecutors/request-human-approve.test.ts index 5f617252e8..18d0938532 100644 --- a/src/store/chat/agents/__tests__/createAgentExecutors/request-human-approve.test.ts +++ b/src/store/chat/agents/__tests__/createAgentExecutors/request-human-approve.test.ts @@ -1,4 +1,4 @@ -import type { ChatToolPayload } from '@lobechat/types'; +import { type ChatToolPayload } from '@lobechat/types'; import { describe, expect, it, vi } from 'vitest'; import { diff --git a/src/store/chat/agents/__tests__/createAgentExecutors/resolve-aborted-tools.test.ts b/src/store/chat/agents/__tests__/createAgentExecutors/resolve-aborted-tools.test.ts index 7f9b46605d..be9826b311 100644 --- a/src/store/chat/agents/__tests__/createAgentExecutors/resolve-aborted-tools.test.ts +++ b/src/store/chat/agents/__tests__/createAgentExecutors/resolve-aborted-tools.test.ts @@ -1,5 +1,5 @@ -import type { AgentEventDone } from '@lobechat/agent-runtime'; -import type { ChatToolPayload } from '@lobechat/types'; +import { type AgentEventDone } from '@lobechat/agent-runtime'; +import { type ChatToolPayload } from '@lobechat/types'; import { describe, expect, it } from 'vitest'; import { @@ -7,11 +7,7 @@ import { createMockStore, createResolveAbortedToolsInstruction, } from './fixtures'; -import { - createInitialState, - createTestContext, - executeWithMockContext, -} from './helpers'; +import { createInitialState, createTestContext, executeWithMockContext } from './helpers'; describe('resolve_aborted_tools executor', () => { describe('Basic Behavior', () => { diff --git a/src/store/chat/agents/createAgentExecutors.ts b/src/store/chat/agents/createAgentExecutors.ts index 0152ca6362..76b678ca7b 100644 --- a/src/store/chat/agents/createAgentExecutors.ts +++ b/src/store/chat/agents/createAgentExecutors.ts @@ -1,22 +1,42 @@ -import type {AgentEvent, AgentInstruction, AgentInstructionCallLlm, AgentInstructionCallTool, AgentInstructionCompressContext, AgentInstructionExecClientTask, AgentInstructionExecClientTasks, AgentInstructionExecTask, AgentInstructionExecTasks, AgentRuntimeContext, GeneralAgentCallingToolInstructionPayload, GeneralAgentCallLLMInstructionPayload, GeneralAgentCallLLMResultPayload, GeneralAgentCallToolResultPayload, GeneralAgentCompressionResultPayload, InstructionExecutor, TaskResultPayload, TasksBatchResultPayload} from '@lobechat/agent-runtime'; import { - calculateMessageTokens, - UsageCounter + type AgentEvent, + type AgentInstruction, + type AgentInstructionCallLlm, + type AgentInstructionCallTool, + type AgentInstructionCompressContext, + type AgentInstructionExecClientTask, + type AgentInstructionExecClientTasks, + type AgentInstructionExecTask, + type AgentInstructionExecTasks, + type AgentRuntimeContext, + type GeneralAgentCallingToolInstructionPayload, + type GeneralAgentCallLLMInstructionPayload, + type GeneralAgentCallLLMResultPayload, + type GeneralAgentCallToolResultPayload, + type GeneralAgentCompressionResultPayload, + type InstructionExecutor, + type TaskResultPayload, + type TasksBatchResultPayload, } from '@lobechat/agent-runtime'; +import { calculateMessageTokens, UsageCounter } from '@lobechat/agent-runtime'; import { isDesktop } from '@lobechat/const'; import { chainCompressContext } from '@lobechat/prompts'; -import type { ChatToolPayload, ConversationContext, CreateMessageParams } from '@lobechat/types'; +import { + type ChatToolPayload, + type ConversationContext, + type CreateMessageParams, +} from '@lobechat/types'; import debug from 'debug'; import pMap from 'p-map'; import { LOADING_FLAT } from '@/const/message'; import { aiAgentService } from '@/services/aiAgent'; import { chatService } from '@/services/chat'; -import type { ResolvedAgentConfig } from '@/services/chat/mecha'; +import { type ResolvedAgentConfig } from '@/services/chat/mecha'; import { messageService } from '@/services/message'; import { agentByIdSelectors } from '@/store/agent/selectors'; import { getAgentStoreState } from '@/store/agent/store'; -import type { ChatStore } from '@/store/chat/store'; +import { type ChatStore } from '@/store/chat/store'; import { messageMapKey } from '@/store/chat/utils/messageMapKey'; import { sleep } from '@/utils/sleep'; diff --git a/src/store/chat/helpers.test.ts b/src/store/chat/helpers.test.ts index 7bd98e9941..90ca54c360 100644 --- a/src/store/chat/helpers.test.ts +++ b/src/store/chat/helpers.test.ts @@ -1,4 +1,8 @@ -import type { LobeAgentChatConfig , OpenAIChatMessage,UIChatMessage } from '@lobechat/types'; +import { + type LobeAgentChatConfig, + type OpenAIChatMessage, + type UIChatMessage, +} from '@lobechat/types'; import { describe, expect, it, vi } from 'vitest'; import * as tokenizerObj from '@/utils/tokenizer'; diff --git a/src/store/chat/helpers.ts b/src/store/chat/helpers.ts index 2bd5e89bbc..810eef79f3 100644 --- a/src/store/chat/helpers.ts +++ b/src/store/chat/helpers.ts @@ -1,4 +1,4 @@ -import type {OpenAIChatMessage, UIChatMessage} from '@lobechat/types'; +import { type OpenAIChatMessage, type UIChatMessage } from '@lobechat/types'; import { encodeAsync } from '@/utils/tokenizer'; diff --git a/src/store/chat/initialState.ts b/src/store/chat/initialState.ts index 1cb9b95588..12137bf937 100644 --- a/src/store/chat/initialState.ts +++ b/src/store/chat/initialState.ts @@ -1,20 +1,20 @@ // sort-imports-ignore -import type {ChatAIAgentState} from './slices/aiAgent/initialState'; +import { type ChatAIAgentState } from './slices/aiAgent/initialState'; import { initialAiAgentState } from './slices/aiAgent/initialState'; -import type {ChatAIChatState} from './slices/aiChat/initialState'; -import { initialAiChatState } from './slices/aiChat/initialState'; -import type {ChatToolState} from './slices/builtinTool/initialState'; -import { initialToolState } from './slices/builtinTool/initialState'; -import type {ChatMessageState} from './slices/message/initialState'; -import { initialMessageState } from './slices/message/initialState'; -import type {ChatOperationState} from './slices/operation/initialState'; -import { initialOperationState } from './slices/operation/initialState'; -import type {ChatPortalState} from './slices/portal/initialState'; -import { initialChatPortalState } from './slices/portal/initialState'; -import type {ChatThreadState} from './slices/thread/initialState'; -import { initialThreadState } from './slices/thread/initialState'; -import type {ChatTopicState} from './slices/topic/initialState'; -import { initialTopicState } from './slices/topic/initialState'; +import { type ChatAIChatState } from './slices/aiChat/initialState'; +import { initialAiChatState } from './slices/aiChat/initialState'; +import { type ChatToolState } from './slices/builtinTool/initialState'; +import { initialToolState } from './slices/builtinTool/initialState'; +import { type ChatMessageState } from './slices/message/initialState'; +import { initialMessageState } from './slices/message/initialState'; +import { type ChatOperationState } from './slices/operation/initialState'; +import { initialOperationState } from './slices/operation/initialState'; +import { type ChatPortalState } from './slices/portal/initialState'; +import { initialChatPortalState } from './slices/portal/initialState'; +import { type ChatThreadState } from './slices/thread/initialState'; +import { initialThreadState } from './slices/thread/initialState'; +import { type ChatTopicState } from './slices/topic/initialState'; +import { initialTopicState } from './slices/topic/initialState'; export type ChatStoreState = ChatTopicState & ChatMessageState & diff --git a/src/store/chat/slices/aiAgent/actions/__tests__/runAgent.test.ts b/src/store/chat/slices/aiAgent/actions/__tests__/runAgent.test.ts index 8eb9cb71c1..0dad6fb11f 100644 --- a/src/store/chat/slices/aiAgent/actions/__tests__/runAgent.test.ts +++ b/src/store/chat/slices/aiAgent/actions/__tests__/runAgent.test.ts @@ -1,7 +1,7 @@ import { act, renderHook } from '@testing-library/react'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import type { StreamEvent } from '@/services/agentRuntime'; +import { type StreamEvent } from '@/services/agentRuntime'; import { useChatStore } from '@/store/chat/store'; // Keep zustand mock as it's needed globally diff --git a/src/store/chat/slices/aiAgent/actions/agentGroup.ts b/src/store/chat/slices/aiAgent/actions/agentGroup.ts index 0439ff3f77..ab7a4404b7 100644 --- a/src/store/chat/slices/aiAgent/actions/agentGroup.ts +++ b/src/store/chat/slices/aiAgent/actions/agentGroup.ts @@ -1,14 +1,14 @@ // Disable the auto sort key eslint rule to make the code more logic and readable import { LOADING_FLAT } from '@lobechat/const'; -import type {SendGroupMessageParams} from '@lobechat/types'; +import { type SendGroupMessageParams } from '@lobechat/types'; import { nanoid } from '@lobechat/utils'; import debug from 'debug'; import { lambdaClient } from '@/libs/trpc/client'; -import type {StreamEvent} from '@/services/agentRuntime'; +import { type StreamEvent } from '@/services/agentRuntime'; import { agentRuntimeClient } from '@/services/agentRuntime'; -import type {ChatStore} from '@/store/chat/store'; -import type {StoreSetter} from '@/store/types'; +import { type ChatStore } from '@/store/chat/store'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; const log = debug('store:chat:ai-agent:agentGroup'); diff --git a/src/store/chat/slices/aiAgent/actions/groupOrchestration.ts b/src/store/chat/slices/aiAgent/actions/groupOrchestration.ts index 630031cb08..986a22efd5 100644 --- a/src/store/chat/slices/aiAgent/actions/groupOrchestration.ts +++ b/src/store/chat/slices/aiAgent/actions/groupOrchestration.ts @@ -1,16 +1,16 @@ /* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */ -import type { AgentState, ExecutorResult } from '@lobechat/agent-runtime'; +import { type AgentState, type ExecutorResult } from '@lobechat/agent-runtime'; import { GroupOrchestrationRuntime, GroupOrchestrationSupervisor } from '@lobechat/agent-runtime'; -import type {TaskStatusResult} from '@lobechat/types'; +import { type TaskStatusResult } from '@lobechat/types'; import debug from 'debug'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import { useClientDataSWR } from '@/libs/swr'; import { aiAgentService } from '@/services/aiAgent'; import { createGroupOrchestrationExecutors } from '@/store/chat/agents/GroupOrchestration'; -import type {ChatStore} from '@/store/chat/store'; -import type { GroupOrchestrationCallbacks } from '@/store/tool/slices/builtin/types'; -import type {StoreSetter} from '@/store/types'; +import { type ChatStore } from '@/store/chat/store'; +import { type GroupOrchestrationCallbacks } from '@/store/tool/slices/builtin/types'; +import { type StoreSetter } from '@/store/types'; const log = debug('lobe-store:group-orchestration'); diff --git a/src/store/chat/slices/aiAgent/actions/index.ts b/src/store/chat/slices/aiAgent/actions/index.ts index f45d9b7c5d..002ad960da 100644 --- a/src/store/chat/slices/aiAgent/actions/index.ts +++ b/src/store/chat/slices/aiAgent/actions/index.ts @@ -1,19 +1,17 @@ -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; -import type {ChatStore} from '@/store/chat/store'; +import { type ChatStore } from '@/store/chat/store'; import { flattenActions } from '@/store/utils/flattenActions'; -import type {ChatGroupChatAction} from './agentGroup'; -import { ChatGroupChatActionImpl } from './agentGroup'; -import type {GroupOrchestrationAction} from './groupOrchestration'; -import { GroupOrchestrationActionImpl } from './groupOrchestration'; -import type {AgentAction} from './runAgent'; -import { AgentActionImpl } from './runAgent'; +import { type ChatGroupChatAction } from './agentGroup'; +import { ChatGroupChatActionImpl } from './agentGroup'; +import { type GroupOrchestrationAction } from './groupOrchestration'; +import { GroupOrchestrationActionImpl } from './groupOrchestration'; +import { type AgentAction } from './runAgent'; +import { AgentActionImpl } from './runAgent'; export type ChatAIAgentAction = AgentAction & ChatGroupChatAction & GroupOrchestrationAction; - - export const chatAiAgent: StateCreator< ChatStore, [['zustand/devtools', never]], diff --git a/src/store/chat/slices/aiAgent/actions/runAgent.ts b/src/store/chat/slices/aiAgent/actions/runAgent.ts index d806e0de1a..0382e9e76f 100644 --- a/src/store/chat/slices/aiAgent/actions/runAgent.ts +++ b/src/store/chat/slices/aiAgent/actions/runAgent.ts @@ -1,15 +1,15 @@ import { isDesktop } from '@lobechat/const'; -import type { ChatToolPayload } from '@lobechat/types'; +import { type ChatToolPayload } from '@lobechat/types'; import debug from 'debug'; import i18n from 'i18next'; -import type { StreamEvent } from '@/services/agentRuntime'; +import { type StreamEvent } from '@/services/agentRuntime'; import { agentRuntimeService } from '@/services/agentRuntime'; import { getAgentStoreState } from '@/store/agent'; import { agentSelectors } from '@/store/agent/selectors'; -import type { ChatStore } from '@/store/chat/store'; +import { type ChatStore } from '@/store/chat/store'; import { topicMapKey } from '@/store/chat/utils/topicMapKey'; -import type { StoreSetter } from '@/store/types'; +import { type StoreSetter } from '@/store/types'; const log = debug('store:chat:ai-agent:runAgent'); diff --git a/src/store/chat/slices/aiChat/actions/StreamingHandler.test.ts b/src/store/chat/slices/aiChat/actions/StreamingHandler.test.ts index 49280b7a09..a821a05439 100644 --- a/src/store/chat/slices/aiChat/actions/StreamingHandler.test.ts +++ b/src/store/chat/slices/aiChat/actions/StreamingHandler.test.ts @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { StreamingHandler } from './StreamingHandler'; -import type { StreamingCallbacks, StreamingContext } from './types/streaming'; +import { type StreamingCallbacks, type StreamingContext } from './types/streaming'; const createMockCallbacks = (): StreamingCallbacks => ({ onContentUpdate: vi.fn(), diff --git a/src/store/chat/slices/aiChat/actions/StreamingHandler.ts b/src/store/chat/slices/aiChat/actions/StreamingHandler.ts index 3b79a7aebb..ccb2101ec0 100644 --- a/src/store/chat/slices/aiChat/actions/StreamingHandler.ts +++ b/src/store/chat/slices/aiChat/actions/StreamingHandler.ts @@ -1,8 +1,8 @@ -import type { - ChatImageItem, - ChatToolPayload, - MessageContentPart, - MessageToolCall, +import { + type ChatImageItem, + type ChatToolPayload, + type MessageContentPart, + type MessageToolCall, } from '@lobechat/types'; import { serializePartsForStorage } from '@lobechat/utils'; import debug from 'debug'; @@ -10,14 +10,14 @@ import { throttle } from 'es-toolkit/compat'; import pMap from 'p-map'; import { cleanSpeakerTag } from '../../../utils/cleanSpeakerTag'; -import type { - FinishData, - GroundingData, - ReasoningState, - StreamChunk, - StreamingCallbacks, - StreamingContext, - StreamingResult, +import { + type FinishData, + type GroundingData, + type ReasoningState, + type StreamChunk, + type StreamingCallbacks, + type StreamingContext, + type StreamingResult, } from './types/streaming'; const log = debug('lobe-store:streaming-handler'); diff --git a/src/store/chat/slices/aiChat/actions/__tests__/conversationControl.test.ts b/src/store/chat/slices/aiChat/actions/__tests__/conversationControl.test.ts index 3f7f576aec..3e494a76b4 100644 --- a/src/store/chat/slices/aiChat/actions/__tests__/conversationControl.test.ts +++ b/src/store/chat/slices/aiChat/actions/__tests__/conversationControl.test.ts @@ -1,10 +1,10 @@ -import type { ConversationContext } from '@lobechat/types'; +import { type ConversationContext } from '@lobechat/types'; import { act, renderHook } from '@testing-library/react'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { useChatStore } from '../../../../store'; import { messageMapKey } from '../../../../utils/messageMapKey'; -import { createMockMessage, createMockResolvedAgentConfig,TEST_IDS } from './fixtures'; +import { createMockMessage, createMockResolvedAgentConfig, TEST_IDS } from './fixtures'; import { resetTestEnvironment } from './helpers'; // Keep zustand mock as it's needed globally diff --git a/src/store/chat/slices/aiChat/actions/__tests__/fixtures.ts b/src/store/chat/slices/aiChat/actions/__tests__/fixtures.ts index a38d9e690c..12806e7d7d 100644 --- a/src/store/chat/slices/aiChat/actions/__tests__/fixtures.ts +++ b/src/store/chat/slices/aiChat/actions/__tests__/fixtures.ts @@ -1,7 +1,7 @@ -import type {UIChatMessage} from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { DEFAULT_AGENT_CHAT_CONFIG, DEFAULT_AGENT_CONFIG } from '@/const/settings'; -import type { ResolvedAgentConfig } from '@/services/chat/mecha'; +import { type ResolvedAgentConfig } from '@/services/chat/mecha'; // Test Constants export const TEST_IDS = { diff --git a/src/store/chat/slices/aiChat/actions/__tests__/streamingExecutor.test.ts b/src/store/chat/slices/aiChat/actions/__tests__/streamingExecutor.test.ts index 77263f4a44..0a354ad843 100644 --- a/src/store/chat/slices/aiChat/actions/__tests__/streamingExecutor.test.ts +++ b/src/store/chat/slices/aiChat/actions/__tests__/streamingExecutor.test.ts @@ -1,4 +1,4 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { act, renderHook } from '@testing-library/react'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; diff --git a/src/store/chat/slices/aiChat/actions/conversationControl.ts b/src/store/chat/slices/aiChat/actions/conversationControl.ts index a3dd939375..cab53dd4ac 100644 --- a/src/store/chat/slices/aiChat/actions/conversationControl.ts +++ b/src/store/chat/slices/aiChat/actions/conversationControl.ts @@ -1,15 +1,15 @@ /* 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 { type AgentRuntimeContext } from '@lobechat/agent-runtime'; import { MESSAGE_CANCEL_FLAT } from '@lobechat/const'; -import type {ConversationContext} from '@lobechat/types'; +import { type ConversationContext } from '@lobechat/types'; -import type {ChatStore} from '@/store/chat/store'; -import type {StoreSetter} from '@/store/types'; +import { type ChatStore } from '@/store/chat/store'; +import { type StoreSetter } from '@/store/types'; import { displayMessageSelectors } from '../../../selectors'; import { messageMapKey } from '../../../utils/messageMapKey'; -import type {OptimisticUpdateContext} from '../../message/actions/optimisticUpdate'; +import { type OptimisticUpdateContext } from '../../message/actions/optimisticUpdate'; import { dbMessageSelectors } from '../../message/selectors'; /** diff --git a/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts b/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts index 9642780338..b3597950ee 100644 --- a/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts +++ b/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts @@ -2,7 +2,13 @@ // 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'; -import type {ChatImageItem, ChatVideoItem, ConversationContext, SendMessageParams, SendMessageServerResponse} from '@lobechat/types'; +import { + type ChatImageItem, + type ChatVideoItem, + type ConversationContext, + type SendMessageParams, + type SendMessageServerResponse, +} from '@lobechat/types'; import { nanoid } from '@lobechat/utils'; import { TRPCClientError } from '@trpc/client'; import { t } from 'i18next'; @@ -12,11 +18,11 @@ import { aiChatService } from '@/services/aiChat'; import { getAgentStoreState } from '@/store/agent'; import { agentSelectors } from '@/store/agent/selectors'; import { agentGroupByIdSelectors, getChatGroupStoreState } from '@/store/agentGroup'; -import type {ChatStore} from '@/store/chat/store'; +import { type ChatStore } from '@/store/chat/store'; import { getFileStoreState } from '@/store/file/store'; import { useGlobalStore } from '@/store/global'; import { systemStatusSelectors } from '@/store/global/selectors'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { useUserMemoryStore } from '@/store/userMemory'; import { dbMessageSelectors, displayMessageSelectors, topicSelectors } from '../../../selectors'; diff --git a/src/store/chat/slices/aiChat/actions/index.ts b/src/store/chat/slices/aiChat/actions/index.ts index d0f23d8d9e..664ee43843 100644 --- a/src/store/chat/slices/aiChat/actions/index.ts +++ b/src/store/chat/slices/aiChat/actions/index.ts @@ -1,22 +1,18 @@ -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; -import type {ChatStore} from '@/store/chat/store'; +import { type ChatStore } from '@/store/chat/store'; import { flattenActions } from '@/store/utils/flattenActions'; -import type {ConversationControlAction} from './conversationControl'; -import { - ConversationControlActionImpl -} from './conversationControl'; -import type {ConversationLifecycleAction} from './conversationLifecycle'; -import { - ConversationLifecycleActionImpl -} from './conversationLifecycle'; -import type {ChatMemoryAction} from './memory'; -import { ChatMemoryActionImpl } from './memory'; -import type {StreamingExecutorAction} from './streamingExecutor'; -import { StreamingExecutorActionImpl } from './streamingExecutor'; -import type {StreamingStatesAction} from './streamingStates'; -import { StreamingStatesActionImpl } from './streamingStates'; +import { type ConversationControlAction } from './conversationControl'; +import { ConversationControlActionImpl } from './conversationControl'; +import { type ConversationLifecycleAction } from './conversationLifecycle'; +import { ConversationLifecycleActionImpl } from './conversationLifecycle'; +import { type ChatMemoryAction } from './memory'; +import { ChatMemoryActionImpl } from './memory'; +import { type StreamingExecutorAction } from './streamingExecutor'; +import { StreamingExecutorActionImpl } from './streamingExecutor'; +import { type StreamingStatesAction } from './streamingStates'; +import { StreamingStatesActionImpl } from './streamingStates'; export type ChatAIChatAction = ChatMemoryAction & ConversationLifecycleAction & diff --git a/src/store/chat/slices/aiChat/actions/memory.ts b/src/store/chat/slices/aiChat/actions/memory.ts index a15008e9fc..fcdbd66427 100644 --- a/src/store/chat/slices/aiChat/actions/memory.ts +++ b/src/store/chat/slices/aiChat/actions/memory.ts @@ -1,11 +1,11 @@ import { chainSummaryHistory } from '@lobechat/prompts'; -import type {UIChatMessage} from '@lobechat/types'; -import { TraceNameMap } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; +import { TraceNameMap } from '@lobechat/types'; import { chatService } from '@/services/chat'; import { topicService } from '@/services/topic'; -import type {ChatStore} from '@/store/chat'; -import type {StoreSetter} from '@/store/types'; +import { type ChatStore } from '@/store/chat'; +import { type StoreSetter } from '@/store/types'; import { useUserStore } from '@/store/user'; import { systemAgentSelectors } from '@/store/user/selectors'; diff --git a/src/store/chat/slices/aiChat/actions/streamingExecutor.ts b/src/store/chat/slices/aiChat/actions/streamingExecutor.ts index 303b8c44a9..f131827079 100644 --- a/src/store/chat/slices/aiChat/actions/streamingExecutor.ts +++ b/src/store/chat/slices/aiChat/actions/streamingExecutor.ts @@ -1,18 +1,23 @@ /* 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, AgentState, Cost, Usage } from '@lobechat/agent-runtime'; +import { + type AgentRuntimeContext, + type AgentState, + type Cost, + type Usage, +} from '@lobechat/agent-runtime'; import { AgentRuntime, computeStepContext, GeneralChatAgent } from '@lobechat/agent-runtime'; import { PageAgentIdentifier } from '@lobechat/builtin-tool-page-agent'; import { isDesktop } from '@lobechat/const'; -import type { - ChatToolPayload, - ConversationContext, - MessageMapScope, - MessageToolCall, - ModelUsage, - RuntimeInitialContext, - RuntimeStepContext, - UIChatMessage, +import { + type ChatToolPayload, + type ConversationContext, + type MessageMapScope, + type MessageToolCall, + type ModelUsage, + type RuntimeInitialContext, + type RuntimeStepContext, + type UIChatMessage, } from '@lobechat/types'; import { TraceNameMap } from '@lobechat/types'; import debug from 'debug'; @@ -20,16 +25,16 @@ import { t } from 'i18next'; import { createAgentToolsEngine } from '@/helpers/toolEngineering'; import { chatService } from '@/services/chat'; -import type { ResolvedAgentConfig } from '@/services/chat/mecha'; +import { type ResolvedAgentConfig } from '@/services/chat/mecha'; import { resolveAgentConfig } from '@/services/chat/mecha'; import { messageService } from '@/services/message'; import { getAgentStoreState } from '@/store/agent'; import { agentSelectors } from '@/store/agent/selectors'; import { createAgentExecutors } from '@/store/chat/agents/createAgentExecutors'; -import type { ChatStore } from '@/store/chat/store'; +import { type ChatStore } from '@/store/chat/store'; import { getFileStoreState } from '@/store/file/store'; import { pageAgentRuntime } from '@/store/tool/slices/builtin/executors/lobe-page-agent'; -import type { StoreSetter } from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { toolInterventionSelectors } from '@/store/user/selectors'; import { getUserStoreState } from '@/store/user/store'; import { markdownToTxt } from '@/utils/markdownToTxt'; @@ -39,7 +44,7 @@ import { messageMapKey } from '../../../utils/messageMapKey'; import { topicMapKey } from '../../../utils/topicMapKey'; import { selectTodosFromMessages } from '../../message/selectors/dbMessage'; import { StreamingHandler } from './StreamingHandler'; -import type { StreamChunk } from './types/streaming'; +import { type StreamChunk } from './types/streaming'; const log = debug('lobe-store:streaming-executor'); diff --git a/src/store/chat/slices/aiChat/actions/streamingStates.ts b/src/store/chat/slices/aiChat/actions/streamingStates.ts index f57e537e03..14cd117493 100644 --- a/src/store/chat/slices/aiChat/actions/streamingStates.ts +++ b/src/store/chat/slices/aiChat/actions/streamingStates.ts @@ -1,8 +1,8 @@ import isEqual from 'fast-deep-equal'; import { produce } from 'immer'; -import type {ChatStore} from '@/store/chat/store'; -import type {StoreSetter} from '@/store/types'; +import { type ChatStore } from '@/store/chat/store'; +import { type StoreSetter } from '@/store/types'; /** * Manages loading states during streaming operations diff --git a/src/store/chat/slices/aiChat/actions/types/streaming.ts b/src/store/chat/slices/aiChat/actions/types/streaming.ts index c701ac92ca..31a0f8fcf2 100644 --- a/src/store/chat/slices/aiChat/actions/types/streaming.ts +++ b/src/store/chat/slices/aiChat/actions/types/streaming.ts @@ -1,11 +1,11 @@ -import type { - ChatImageItem, - ChatToolPayload, - GroundingSearch, - MessageContentPart, - MessageToolCall, - ModelPerformance, - ModelUsage, +import { + type ChatImageItem, + type ChatToolPayload, + type GroundingSearch, + type MessageContentPart, + type MessageToolCall, + type ModelPerformance, + type ModelUsage, } from '@lobechat/types'; /** diff --git a/src/store/chat/slices/aiChat/initialState.ts b/src/store/chat/slices/aiChat/initialState.ts index 1d4017de2e..c0adb1116f 100644 --- a/src/store/chat/slices/aiChat/initialState.ts +++ b/src/store/chat/slices/aiChat/initialState.ts @@ -1,4 +1,4 @@ -import type { ChatInputEditor } from '@/features/ChatInput'; +import { type ChatInputEditor } from '@/features/ChatInput'; export interface ChatAIChatState { inputFiles: File[]; diff --git a/src/store/chat/slices/aiChat/selectors.ts b/src/store/chat/slices/aiChat/selectors.ts index 490911f21f..af3d8961da 100644 --- a/src/store/chat/slices/aiChat/selectors.ts +++ b/src/store/chat/slices/aiChat/selectors.ts @@ -1,6 +1,6 @@ import { messageMapKey } from '@/store/chat/utils/messageMapKey'; -import type { ChatStoreState } from '../../initialState'; +import { type ChatStoreState } from '../../initialState'; import { operationSelectors } from '../operation/selectors'; const isMessageInReasoning = (id: string) => (s: ChatStoreState) => diff --git a/src/store/chat/slices/builtinTool/actions/__tests__/search.test.ts b/src/store/chat/slices/builtinTool/actions/__tests__/search.test.ts index db7412d51d..370bcd14e6 100644 --- a/src/store/chat/slices/builtinTool/actions/__tests__/search.test.ts +++ b/src/store/chat/slices/builtinTool/actions/__tests__/search.test.ts @@ -1,7 +1,7 @@ import { WebBrowsingApiName, WebBrowsingManifest } from '@lobechat/builtin-tool-web-browsing'; -import type { SearchQuery, UIChatMessage } from '@lobechat/types'; +import { type SearchQuery, type UIChatMessage } from '@lobechat/types'; import { act, renderHook } from '@testing-library/react'; -import type { Mock} from 'vitest'; +import { type Mock } from 'vitest'; import { beforeEach, describe, expect, it, vi } from 'vitest'; // Import after mocks diff --git a/src/store/chat/slices/builtinTool/actions/index.ts b/src/store/chat/slices/builtinTool/actions/index.ts index 2154f080ca..2c0440a5b1 100644 --- a/src/store/chat/slices/builtinTool/actions/index.ts +++ b/src/store/chat/slices/builtinTool/actions/index.ts @@ -1,12 +1,12 @@ -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; -import type {ChatStore} from '@/store/chat/store'; +import { type ChatStore } from '@/store/chat/store'; import { flattenActions } from '@/store/utils/flattenActions'; -import type {ChatCodeInterpreterAction} from './interpreter'; -import { ChatCodeInterpreterActionImpl } from './interpreter'; -import type {SearchAction} from './search'; -import { SearchActionImpl } from './search'; +import { type ChatCodeInterpreterAction } from './interpreter'; +import { ChatCodeInterpreterActionImpl } from './interpreter'; +import { type SearchAction } from './search'; +import { SearchActionImpl } from './search'; export type ChatBuiltinToolAction = SearchAction & ChatCodeInterpreterAction; diff --git a/src/store/chat/slices/builtinTool/actions/interpreter.ts b/src/store/chat/slices/builtinTool/actions/interpreter.ts index 5ef4e1399b..8d8ffcffeb 100644 --- a/src/store/chat/slices/builtinTool/actions/interpreter.ts +++ b/src/store/chat/slices/builtinTool/actions/interpreter.ts @@ -1,17 +1,21 @@ import { CloudSandboxIdentifier } from '@lobechat/builtin-tool-cloud-sandbox'; -import type {CodeInterpreterFileItem, CodeInterpreterParams, CodeInterpreterResponse} from '@lobechat/types'; +import { + type CodeInterpreterFileItem, + type CodeInterpreterParams, + type CodeInterpreterResponse, +} from '@lobechat/types'; import debug from 'debug'; import { produce } from 'immer'; import pMap from 'p-map'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import { useClientDataSWR } from '@/libs/swr'; import { fileService } from '@/services/file'; import { pythonService } from '@/services/python'; import { dbMessageSelectors } from '@/store/chat/selectors'; -import type {ChatStore} from '@/store/chat/store'; +import { type ChatStore } from '@/store/chat/store'; import { useFileStore } from '@/store/file'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; const n = setNamespace('codeInterpreter'); diff --git a/src/store/chat/slices/builtinTool/actions/search.ts b/src/store/chat/slices/builtinTool/actions/search.ts index a86338f4c8..79a444d209 100644 --- a/src/store/chat/slices/builtinTool/actions/search.ts +++ b/src/store/chat/slices/builtinTool/actions/search.ts @@ -1,10 +1,10 @@ import { WebBrowsingApiName, WebBrowsingManifest } from '@lobechat/builtin-tool-web-browsing'; -import type {ChatToolPayload, CreateMessageParams, SearchQuery} from '@lobechat/types'; +import { type ChatToolPayload, type CreateMessageParams, type SearchQuery } from '@lobechat/types'; import { nanoid } from '@lobechat/utils'; import { dbMessageSelectors } from '@/store/chat/selectors'; -import type {ChatStore} from '@/store/chat/store'; -import type {StoreSetter} from '@/store/types'; +import { type ChatStore } from '@/store/chat/store'; +import { type StoreSetter } from '@/store/types'; type Setter = StoreSetter; export const searchSlice = (set: Setter, get: () => ChatStore, _api?: unknown) => diff --git a/src/store/chat/slices/builtinTool/initialState.ts b/src/store/chat/slices/builtinTool/initialState.ts index 7be6517db6..7955b48a26 100644 --- a/src/store/chat/slices/builtinTool/initialState.ts +++ b/src/store/chat/slices/builtinTool/initialState.ts @@ -1,4 +1,4 @@ -import type {FileItem} from '@/types/files'; +import { type FileItem } from '@/types/files'; export interface ChatToolState { activePageContentUrl?: string; diff --git a/src/store/chat/slices/builtinTool/selectors.ts b/src/store/chat/slices/builtinTool/selectors.ts index 52dad8c045..0b3a12101c 100644 --- a/src/store/chat/slices/builtinTool/selectors.ts +++ b/src/store/chat/slices/builtinTool/selectors.ts @@ -1,4 +1,4 @@ -import type {ChatStoreState} from '@/store/chat'; +import { type ChatStoreState } from '@/store/chat'; const isInterpreterExecuting = (id: string) => (s: ChatStoreState) => { // Check if there's a running builtinToolInterpreter operation for this message diff --git a/src/store/chat/slices/message/action.test.ts b/src/store/chat/slices/message/action.test.ts index f384db5063..09e63b37f9 100644 --- a/src/store/chat/slices/message/action.test.ts +++ b/src/store/chat/slices/message/action.test.ts @@ -1,8 +1,8 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { TraceEventType } from '@lobechat/types'; import * as lobeUIModules from '@lobehub/ui'; import { act, renderHook } from '@testing-library/react'; -import type { Mock} from 'vitest'; +import { type Mock } from 'vitest'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { mutate } from '@/libs/swr'; diff --git a/src/store/chat/slices/message/actions/index.ts b/src/store/chat/slices/message/actions/index.ts index a0ca8c8ec2..b7dec1145c 100644 --- a/src/store/chat/slices/message/actions/index.ts +++ b/src/store/chat/slices/message/actions/index.ts @@ -1,20 +1,18 @@ -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; -import type {ChatStore} from '@/store/chat/store'; +import { type ChatStore } from '@/store/chat/store'; import { flattenActions } from '@/store/utils/flattenActions'; -import type {MessageInternalsAction} from './internals'; -import { MessageInternalsActionImpl } from './internals'; -import type {MessageOptimisticUpdateAction} from './optimisticUpdate'; -import { - MessageOptimisticUpdateActionImpl -} from './optimisticUpdate'; -import type {MessagePublicApiAction} from './publicApi'; -import { MessagePublicApiActionImpl } from './publicApi'; -import type {MessageQueryAction} from './query'; -import { MessageQueryActionImpl } from './query'; -import type {MessageRuntimeStateAction} from './runtimeState'; -import { MessageRuntimeStateActionImpl } from './runtimeState'; +import { type MessageInternalsAction } from './internals'; +import { MessageInternalsActionImpl } from './internals'; +import { type MessageOptimisticUpdateAction } from './optimisticUpdate'; +import { MessageOptimisticUpdateActionImpl } from './optimisticUpdate'; +import { type MessagePublicApiAction } from './publicApi'; +import { MessagePublicApiActionImpl } from './publicApi'; +import { type MessageQueryAction } from './query'; +import { MessageQueryActionImpl } from './query'; +import { type MessageRuntimeStateAction } from './runtimeState'; +import { MessageRuntimeStateActionImpl } from './runtimeState'; export type ChatMessageAction = MessagePublicApiAction & MessageOptimisticUpdateAction & diff --git a/src/store/chat/slices/message/actions/internals.ts b/src/store/chat/slices/message/actions/internals.ts index d5480887f9..2aa3bbd2fb 100644 --- a/src/store/chat/slices/message/actions/internals.ts +++ b/src/store/chat/slices/message/actions/internals.ts @@ -1,16 +1,16 @@ import { parse } from '@lobechat/conversation-flow'; -import type {TraceEventPayloads} from '@lobechat/types'; +import { type TraceEventPayloads } from '@lobechat/types'; import debug from 'debug'; import isEqual from 'fast-deep-equal'; import { traceService } from '@/services/trace'; -import type {ChatStore} from '@/store/chat/store'; -import type {StoreSetter} from '@/store/types'; +import { type ChatStore } from '@/store/chat/store'; +import { type StoreSetter } from '@/store/types'; import { displayMessageSelectors } from '../../../selectors'; import { messageMapKey } from '../../../utils/messageMapKey'; -import type {MessageDispatch} from '../reducer'; -import { messagesReducer } from '../reducer'; +import { type MessageDispatch } from '../reducer'; +import { messagesReducer } from '../reducer'; const log = debug('lobe-store:message-internals'); diff --git a/src/store/chat/slices/message/actions/optimisticUpdate.ts b/src/store/chat/slices/message/actions/optimisticUpdate.ts index 994b892a4f..d7369ea5b9 100644 --- a/src/store/chat/slices/message/actions/optimisticUpdate.ts +++ b/src/store/chat/slices/message/actions/optimisticUpdate.ts @@ -1,12 +1,22 @@ -import type {ChatImageItem, ChatMessageError, ChatMessagePluginError, ChatToolPayload, CreateMessageParams, GroundingSearch, MessageMetadata, MessagePluginItem, ModelReasoning, UIChatMessage, UpdateMessageRAGParams} from '@lobechat/types'; import { - ChatErrorType + type ChatImageItem, + type ChatMessageError, + type ChatMessagePluginError, + type ChatToolPayload, + type CreateMessageParams, + type GroundingSearch, + type MessageMetadata, + type MessagePluginItem, + type ModelReasoning, + type UIChatMessage, + type UpdateMessageRAGParams, } from '@lobechat/types'; +import { ChatErrorType } from '@lobechat/types'; import { nanoid } from '@lobechat/utils'; import { messageService } from '@/services/message'; -import type {ChatStore} from '@/store/chat/store'; -import type {StoreSetter} from '@/store/types'; +import { type ChatStore } from '@/store/chat/store'; +import { type StoreSetter } from '@/store/types'; /** * Context for optimistic updates to specify session/topic isolation diff --git a/src/store/chat/slices/message/actions/publicApi.ts b/src/store/chat/slices/message/actions/publicApi.ts index 97bc6d664b..2aa44e95a4 100644 --- a/src/store/chat/slices/message/actions/publicApi.ts +++ b/src/store/chat/slices/message/actions/publicApi.ts @@ -5,13 +5,13 @@ import isEqual from 'fast-deep-equal'; import { messageService } from '@/services/message'; import { topicService } from '@/services/topic'; -import type {ChatStore} from '@/store/chat/store'; -import type {StoreSetter} from '@/store/types'; +import { type ChatStore } from '@/store/chat/store'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; import { dbMessageSelectors, displayMessageSelectors } from '../../../selectors'; import { toggleBooleanList } from '../../../utils'; -import type {OptimisticUpdateContext} from './optimisticUpdate'; +import { type OptimisticUpdateContext } from './optimisticUpdate'; const n = setNamespace('m'); diff --git a/src/store/chat/slices/message/actions/query.ts b/src/store/chat/slices/message/actions/query.ts index 917091351b..d83cc33d11 100644 --- a/src/store/chat/slices/message/actions/query.ts +++ b/src/store/chat/slices/message/actions/query.ts @@ -1,14 +1,14 @@ import { parse } from '@lobechat/conversation-flow'; -import type {ConversationContext, UIChatMessage} from '@lobechat/types'; +import { type ConversationContext, type UIChatMessage } from '@lobechat/types'; import isEqual from 'fast-deep-equal'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import { mutate, useClientDataSWRWithSync } from '@/libs/swr'; import { messageService } from '@/services/message'; -import type {ChatStore} from '@/store/chat/store'; -import type {StoreSetter} from '@/store/types'; +import { type ChatStore } from '@/store/chat/store'; +import { type StoreSetter } from '@/store/types'; -import type {MessageMapKeyInput} from '../../../utils/messageMapKey'; +import { type MessageMapKeyInput } from '../../../utils/messageMapKey'; import { messageMapKey } from '../../../utils/messageMapKey'; const SWR_USE_FETCH_MESSAGES = 'SWR_USE_FETCH_MESSAGES'; diff --git a/src/store/chat/slices/message/actions/runtimeState.ts b/src/store/chat/slices/message/actions/runtimeState.ts index 93d6537a6b..33e040e83c 100644 --- a/src/store/chat/slices/message/actions/runtimeState.ts +++ b/src/store/chat/slices/message/actions/runtimeState.ts @@ -1,8 +1,8 @@ -import type {ChatStore} from '@/store/chat/store'; -import type {StoreSetter} from '@/store/types'; -import type {Action} from '@/utils/storeDebug'; +import { type ChatStore } from '@/store/chat/store'; +import { type StoreSetter } from '@/store/types'; +import { type Action } from '@/utils/storeDebug'; -import type { ChatStoreState } from '../../../initialState'; +import { type ChatStoreState } from '../../../initialState'; import { preventLeavingFn, toggleBooleanList } from '../../../utils'; /** diff --git a/src/store/chat/slices/message/initialState.ts b/src/store/chat/slices/message/initialState.ts index 22b580e9ea..202098c97d 100644 --- a/src/store/chat/slices/message/initialState.ts +++ b/src/store/chat/slices/message/initialState.ts @@ -1,6 +1,6 @@ -import type {UIChatMessage} from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; -import type {ChatGroupAgentItem} from '@/database/schemas/chatGroup'; +import { type ChatGroupAgentItem } from '@/database/schemas/chatGroup'; export interface ChatMessageState { activeAgentId: string; diff --git a/src/store/chat/slices/message/reducer.test.ts b/src/store/chat/slices/message/reducer.test.ts index 89e5c4c379..820ca03959 100644 --- a/src/store/chat/slices/message/reducer.test.ts +++ b/src/store/chat/slices/message/reducer.test.ts @@ -1,7 +1,7 @@ -import type { ChatToolPayload, UIChatMessage } from '@lobechat/types'; +import { type ChatToolPayload, type UIChatMessage } from '@lobechat/types'; import i18n from 'i18next'; -import type { MessageDispatch} from './reducer'; +import { type MessageDispatch } from './reducer'; import { messagesReducer } from './reducer'; describe('messagesReducer', () => { diff --git a/src/store/chat/slices/message/reducer.ts b/src/store/chat/slices/message/reducer.ts index 1577a70630..01dd71dd1c 100644 --- a/src/store/chat/slices/message/reducer.ts +++ b/src/store/chat/slices/message/reducer.ts @@ -1,4 +1,11 @@ -import type {ChatMessageExtra, ChatPluginPayload, ChatToolPayload, CreateMessageParams, MessagePluginItem, UIChatMessage} from '@lobechat/types'; +import { + type ChatMessageExtra, + type ChatPluginPayload, + type ChatToolPayload, + type CreateMessageParams, + type MessagePluginItem, + type UIChatMessage, +} from '@lobechat/types'; import isEqual from 'fast-deep-equal'; import i18n from 'i18next'; import { produce } from 'immer'; diff --git a/src/store/chat/slices/message/selectors/chat.test.ts b/src/store/chat/slices/message/selectors/chat.test.ts index e16f04e4da..376783ca98 100644 --- a/src/store/chat/slices/message/selectors/chat.test.ts +++ b/src/store/chat/slices/message/selectors/chat.test.ts @@ -1,7 +1,7 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { describe, expect, it } from 'vitest'; -import type { ChatStore } from '@/store/chat'; +import { type ChatStore } from '@/store/chat'; import { initialState } from '@/store/chat/initialState'; import { messageMapKey } from '@/store/chat/utils/messageMapKey'; import { createServerConfigStore } from '@/store/serverConfig/store'; diff --git a/src/store/chat/slices/message/selectors/chat.ts b/src/store/chat/slices/message/selectors/chat.ts index f855572cb8..0aaada761b 100644 --- a/src/store/chat/slices/message/selectors/chat.ts +++ b/src/store/chat/slices/message/selectors/chat.ts @@ -31,9 +31,9 @@ * Before: chatSelectors.getMessageById(id)(state) // For display * After: displayMessageSelectors.getDisplayMessageById(id)(state) */ -import type {ChatFileItem} from '@lobechat/types'; +import { type ChatFileItem } from '@lobechat/types'; -import type { ChatStoreState } from '../../../initialState'; +import { type ChatStoreState } from '../../../initialState'; import { dbMessageSelectors } from './dbMessage'; import { displayMessageSelectors } from './displayMessage'; diff --git a/src/store/chat/slices/message/selectors/dbMessage.test.ts b/src/store/chat/slices/message/selectors/dbMessage.test.ts index 4e0f49bb6e..3bf9339cb6 100644 --- a/src/store/chat/slices/message/selectors/dbMessage.test.ts +++ b/src/store/chat/slices/message/selectors/dbMessage.test.ts @@ -1,4 +1,4 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { describe, expect, it } from 'vitest'; import { selectTodosFromMessages } from './dbMessage'; diff --git a/src/store/chat/slices/message/selectors/dbMessage.ts b/src/store/chat/slices/message/selectors/dbMessage.ts index 19b1dc0780..9c0b89c9a8 100644 --- a/src/store/chat/slices/message/selectors/dbMessage.ts +++ b/src/store/chat/slices/message/selectors/dbMessage.ts @@ -1,7 +1,7 @@ -import type {StepContextTodos, UIChatMessage} from '@lobechat/types'; +import { type StepContextTodos, type UIChatMessage } from '@lobechat/types'; import { chatHelpers } from '../../../helpers'; -import type { ChatStoreState } from '../../../initialState'; +import { type ChatStoreState } from '../../../initialState'; import { messageMapKey } from '../../../utils/messageMapKey'; /** diff --git a/src/store/chat/slices/message/selectors/displayMessage.test.ts b/src/store/chat/slices/message/selectors/displayMessage.test.ts index 1e21b06d28..784338b52e 100644 --- a/src/store/chat/slices/message/selectors/displayMessage.test.ts +++ b/src/store/chat/slices/message/selectors/displayMessage.test.ts @@ -1,10 +1,10 @@ -import type {UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { act } from '@testing-library/react'; import { describe, expect, it } from 'vitest'; import { INBOX_SESSION_ID } from '@/const/session'; import { useAgentStore } from '@/store/agent'; -import type { ChatStore } from '@/store/chat'; +import { type ChatStore } from '@/store/chat'; import { initialState } from '@/store/chat/initialState'; import { messageMapKey } from '@/store/chat/utils/messageMapKey'; import { createServerConfigStore } from '@/store/serverConfig/store'; diff --git a/src/store/chat/slices/message/selectors/displayMessage.ts b/src/store/chat/slices/message/selectors/displayMessage.ts index 40603114fa..9caf631cb7 100644 --- a/src/store/chat/slices/message/selectors/displayMessage.ts +++ b/src/store/chat/slices/message/selectors/displayMessage.ts @@ -1,11 +1,11 @@ -import type {AssistantContentBlock, UIChatMessage} from '@lobechat/types'; +import { type AssistantContentBlock, type UIChatMessage } from '@lobechat/types'; import { INBOX_SESSION_ID } from '@/const/session'; import { useAgentStore } from '@/store/agent'; import { agentChatConfigSelectors } from '@/store/agent/selectors'; import { chatHelpers } from '../../../helpers'; -import type { ChatStoreState } from '../../../initialState'; +import { type ChatStoreState } from '../../../initialState'; import { messageMapKey } from '../../../utils/messageMapKey'; /** diff --git a/src/store/chat/slices/message/selectors/messageState.test.ts b/src/store/chat/slices/message/selectors/messageState.test.ts index 9eb0b6418e..ba5fc83afd 100644 --- a/src/store/chat/slices/message/selectors/messageState.test.ts +++ b/src/store/chat/slices/message/selectors/messageState.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { ChatStore } from '@/store/chat'; +import { type ChatStore } from '@/store/chat'; import { messageStateSelectors } from './messageState'; diff --git a/src/store/chat/slices/message/selectors/messageState.ts b/src/store/chat/slices/message/selectors/messageState.ts index c216906822..f241abe224 100644 --- a/src/store/chat/slices/message/selectors/messageState.ts +++ b/src/store/chat/slices/message/selectors/messageState.ts @@ -1,4 +1,4 @@ -import type { ChatStoreState } from '../../../initialState'; +import { type ChatStoreState } from '../../../initialState'; import { operationSelectors } from '../../operation/selectors'; import { mainDisplayChatIDs } from './chat'; import { getDbMessageByToolCallId } from './dbMessage'; diff --git a/src/store/chat/slices/message/supervisor.test.ts b/src/store/chat/slices/message/supervisor.test.ts index dcd84c8175..7b239b51cd 100644 --- a/src/store/chat/slices/message/supervisor.test.ts +++ b/src/store/chat/slices/message/supervisor.test.ts @@ -2,8 +2,8 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { aiChatService } from '@/services/aiChat'; -import type {SupervisorContext} from './supervisor'; -import { GroupChatSupervisor } from './supervisor'; +import { type SupervisorContext } from './supervisor'; +import { GroupChatSupervisor } from './supervisor'; vi.mock('@lobechat/prompts', () => ({ contextSupervisorMakeDecision: vi.fn(() => ({ diff --git a/src/store/chat/slices/message/supervisor.ts b/src/store/chat/slices/message/supervisor.ts index 0f43978c4f..bde4047f40 100644 --- a/src/store/chat/slices/message/supervisor.ts +++ b/src/store/chat/slices/message/supervisor.ts @@ -1,5 +1,5 @@ import { contextSupervisorMakeDecision } from '@lobechat/prompts'; -import type {GroupMemberWithAgent, UIChatMessage} from '@lobechat/types'; +import { type GroupMemberWithAgent, type UIChatMessage } from '@lobechat/types'; import { aiChatService } from '@/services/aiChat'; diff --git a/src/store/chat/slices/operation/actions.ts b/src/store/chat/slices/operation/actions.ts index 0e8ca746f9..17eae66c0e 100644 --- a/src/store/chat/slices/operation/actions.ts +++ b/src/store/chat/slices/operation/actions.ts @@ -2,21 +2,21 @@ import { nanoid } from '@lobechat/utils'; import debug from 'debug'; import { produce } from 'immer'; -import type { ChatStore } from '@/store/chat/store'; -import type { MessageMapKeyInput } from '@/store/chat/utils/messageMapKey'; +import { type ChatStore } from '@/store/chat/store'; +import { type MessageMapKeyInput } from '@/store/chat/utils/messageMapKey'; import { messageMapKey } from '@/store/chat/utils/messageMapKey'; -import type { StoreSetter } from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; -import type { - AfterCompletionCallback, - Operation, - OperationCancelContext, - OperationContext, - OperationFilter, - OperationMetadata, - OperationStatus, - OperationType, +import { + type AfterCompletionCallback, + type Operation, + type OperationCancelContext, + type OperationContext, + type OperationFilter, + type OperationMetadata, + type OperationStatus, + type OperationType, } from './types'; const n = setNamespace('operation'); diff --git a/src/store/chat/slices/operation/initialState.ts b/src/store/chat/slices/operation/initialState.ts index d6267544c0..5358aa548c 100644 --- a/src/store/chat/slices/operation/initialState.ts +++ b/src/store/chat/slices/operation/initialState.ts @@ -1,4 +1,4 @@ -import type { Operation, OperationType } from './types'; +import { type Operation, type OperationType } from './types'; /** * Chat Operation State diff --git a/src/store/chat/slices/operation/selectors.ts b/src/store/chat/slices/operation/selectors.ts index 809001d976..fee3d87dd9 100644 --- a/src/store/chat/slices/operation/selectors.ts +++ b/src/store/chat/slices/operation/selectors.ts @@ -1,7 +1,7 @@ -import type { ChatStoreState } from '@/store/chat/initialState'; +import { type ChatStoreState } from '@/store/chat/initialState'; import { messageMapKey } from '@/store/chat/utils/messageMapKey'; -import type { Operation, OperationType } from './types'; +import { type Operation, type OperationType } from './types'; import { AI_RUNTIME_OPERATION_TYPES } from './types'; // === Basic Queries === diff --git a/src/store/chat/slices/operation/types.ts b/src/store/chat/slices/operation/types.ts index e7e0eb6f0f..ae631ea4a0 100644 --- a/src/store/chat/slices/operation/types.ts +++ b/src/store/chat/slices/operation/types.ts @@ -1,5 +1,5 @@ /* eslint-disable typescript-sort-keys/interface, sort-keys-fix/sort-keys-fix */ -import type { ConversationContext } from '@lobechat/types'; +import { type ConversationContext } from '@lobechat/types'; /** * Operation Type Definitions diff --git a/src/store/chat/slices/plugin/action.test.ts b/src/store/chat/slices/plugin/action.test.ts index 0f6ef3699f..fa02a6311a 100644 --- a/src/store/chat/slices/plugin/action.test.ts +++ b/src/store/chat/slices/plugin/action.test.ts @@ -1,12 +1,9 @@ -import { - PLUGIN_SCHEMA_API_MD5_PREFIX, - PLUGIN_SCHEMA_SEPARATOR, -} from '@lobechat/const'; +import { PLUGIN_SCHEMA_API_MD5_PREFIX, PLUGIN_SCHEMA_SEPARATOR } from '@lobechat/const'; import { ToolNameResolver } from '@lobechat/context-engine'; -import type { ChatToolPayload, MessageToolCall, UIChatMessage } from '@lobechat/types'; +import { type ChatToolPayload, type MessageToolCall, type UIChatMessage } from '@lobechat/types'; import { act, renderHook } from '@testing-library/react'; import i18n from 'i18next'; -import type { Mock} from 'vitest'; +import { type Mock } from 'vitest'; import { afterEach, describe, expect, it, vi } from 'vitest'; import { chatService } from '@/services/chat'; diff --git a/src/store/chat/slices/plugin/actions/exector.ts b/src/store/chat/slices/plugin/actions/exector.ts index 4067bcdfb6..b34f111421 100644 --- a/src/store/chat/slices/plugin/actions/exector.ts +++ b/src/store/chat/slices/plugin/actions/exector.ts @@ -1,7 +1,7 @@ -import type {MCPToolCallResult} from '@/libs/mcp'; +import { type MCPToolCallResult } from '@/libs/mcp'; import { truncateToolResult } from '@/server/utils/truncateToolResult'; import { useToolStore } from '@/store/tool'; -import type {ChatToolPayload} from '@/types/message'; +import { type ChatToolPayload } from '@/types/message'; import { safeParseJSON } from '@/utils/safeParseJSON'; /** diff --git a/src/store/chat/slices/plugin/actions/index.ts b/src/store/chat/slices/plugin/actions/index.ts index 0e655d02ca..0fd7e15e1c 100644 --- a/src/store/chat/slices/plugin/actions/index.ts +++ b/src/store/chat/slices/plugin/actions/index.ts @@ -1,20 +1,18 @@ -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; -import type {ChatStore} from '@/store/chat/store'; +import { type ChatStore } from '@/store/chat/store'; import { flattenActions } from '@/store/utils/flattenActions'; -import type {PluginInternalsAction} from './internals'; -import { PluginInternalsActionImpl } from './internals'; -import type {PluginOptimisticUpdateAction} from './optimisticUpdate'; -import { - PluginOptimisticUpdateActionImpl -} from './optimisticUpdate'; -import type {PluginTypesAction} from './pluginTypes'; -import { PluginTypesActionImpl } from './pluginTypes'; -import type {PluginPublicApiAction} from './publicApi'; -import { PluginPublicApiActionImpl } from './publicApi'; -import type {PluginWorkflowAction} from './workflow'; -import { PluginWorkflowActionImpl } from './workflow'; +import { type PluginInternalsAction } from './internals'; +import { PluginInternalsActionImpl } from './internals'; +import { type PluginOptimisticUpdateAction } from './optimisticUpdate'; +import { PluginOptimisticUpdateActionImpl } from './optimisticUpdate'; +import { type PluginTypesAction } from './pluginTypes'; +import { PluginTypesActionImpl } from './pluginTypes'; +import { type PluginPublicApiAction } from './publicApi'; +import { PluginPublicApiActionImpl } from './publicApi'; +import { type PluginWorkflowAction } from './workflow'; +import { PluginWorkflowActionImpl } from './workflow'; export type ChatPluginAction = PluginPublicApiAction & PluginOptimisticUpdateAction & diff --git a/src/store/chat/slices/plugin/actions/internals.ts b/src/store/chat/slices/plugin/actions/internals.ts index 1484b69ce8..36fefd17d7 100644 --- a/src/store/chat/slices/plugin/actions/internals.ts +++ b/src/store/chat/slices/plugin/actions/internals.ts @@ -1,16 +1,16 @@ /* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */ import { ToolArgumentsRepairer, ToolNameResolver } from '@lobechat/context-engine'; -import type {ChatToolPayload, MessageToolCall} from '@lobechat/types'; -import type {LobeChatPluginManifest} from '@lobehub/chat-plugin-sdk'; +import { type ChatToolPayload, type MessageToolCall } from '@lobechat/types'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; -import type {ChatStore} from '@/store/chat/store'; +import { type ChatStore } from '@/store/chat/store'; import { useToolStore } from '@/store/tool'; import { klavisStoreSelectors, lobehubSkillStoreSelectors, pluginSelectors, } from '@/store/tool/selectors'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { builtinTools } from '@/tools'; /** diff --git a/src/store/chat/slices/plugin/actions/optimisticUpdate.ts b/src/store/chat/slices/plugin/actions/optimisticUpdate.ts index 2b13b71a32..47d1f5e71d 100644 --- a/src/store/chat/slices/plugin/actions/optimisticUpdate.ts +++ b/src/store/chat/slices/plugin/actions/optimisticUpdate.ts @@ -1,11 +1,16 @@ /* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */ -import type {ChatMessageError, ChatMessagePluginError, ChatToolPayload, MessagePluginItem} from '@lobechat/types'; +import { + type ChatMessageError, + type ChatMessagePluginError, + type ChatToolPayload, + type MessagePluginItem, +} from '@lobechat/types'; import isEqual from 'fast-deep-equal'; import { messageService } from '@/services/message'; -import type {OptimisticUpdateContext} from '@/store/chat/slices/message/actions/optimisticUpdate'; -import type {ChatStore} from '@/store/chat/store'; -import type {StoreSetter} from '@/store/types'; +import { type OptimisticUpdateContext } from '@/store/chat/slices/message/actions/optimisticUpdate'; +import { type ChatStore } from '@/store/chat/store'; +import { type StoreSetter } from '@/store/types'; import { merge } from '@/utils/merge'; import { safeParseJSON } from '@/utils/safeParseJSON'; diff --git a/src/store/chat/slices/plugin/actions/pluginTypes.ts b/src/store/chat/slices/plugin/actions/pluginTypes.ts index 48478cb517..c658880e09 100644 --- a/src/store/chat/slices/plugin/actions/pluginTypes.ts +++ b/src/store/chat/slices/plugin/actions/pluginTypes.ts @@ -1,23 +1,23 @@ /* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */ -import type {ChatToolPayload, RuntimeStepContext} from '@lobechat/types'; +import { type ChatToolPayload, type RuntimeStepContext } from '@lobechat/types'; import { PluginErrorType } from '@lobehub/chat-plugin-sdk'; import debug from 'debug'; import { t } from 'i18next'; -import type {MCPToolCallResult} from '@/libs/mcp'; +import { type MCPToolCallResult } from '@/libs/mcp'; import { truncateToolResult } from '@/server/utils/truncateToolResult'; import { chatService } from '@/services/chat'; import { mcpService } from '@/services/mcp'; import { messageService } from '@/services/message'; import { AI_RUNTIME_OPERATION_TYPES } from '@/store/chat/slices/operation'; -import type {ChatStore} from '@/store/chat/store'; +import { type ChatStore } from '@/store/chat/store'; import { useToolStore } from '@/store/tool'; import { hasExecutor } from '@/store/tool/slices/builtin/executors'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { safeParseJSON } from '@/utils/safeParseJSON'; import { dbMessageSelectors } from '../../message/selectors'; -import type { RemoteToolExecutor} from './exector'; +import { type RemoteToolExecutor } from './exector'; import { klavisExecutor, lobehubSkillExecutor } from './exector'; const log = debug('lobe-store:plugin-types'); diff --git a/src/store/chat/slices/plugin/actions/publicApi.ts b/src/store/chat/slices/plugin/actions/publicApi.ts index 2cfe1b1950..43a321d92a 100644 --- a/src/store/chat/slices/plugin/actions/publicApi.ts +++ b/src/store/chat/slices/plugin/actions/publicApi.ts @@ -1,11 +1,11 @@ /* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */ -import type {ChatToolPayload, RuntimeStepContext, UIChatMessage} from '@lobechat/types'; +import { type ChatToolPayload, type RuntimeStepContext, type UIChatMessage } from '@lobechat/types'; import i18n from 'i18next'; -import type {ChatStore} from '@/store/chat/store'; -import type {StoreSetter} from '@/store/types'; +import { type ChatStore } from '@/store/chat/store'; +import { type StoreSetter } from '@/store/types'; -import type {OptimisticUpdateContext} from '../../message/actions/optimisticUpdate'; +import { type OptimisticUpdateContext } from '../../message/actions/optimisticUpdate'; import { displayMessageSelectors } from '../../message/selectors'; /** diff --git a/src/store/chat/slices/plugin/actions/workflow.ts b/src/store/chat/slices/plugin/actions/workflow.ts index 9e9950a947..f8bdf89954 100644 --- a/src/store/chat/slices/plugin/actions/workflow.ts +++ b/src/store/chat/slices/plugin/actions/workflow.ts @@ -1,9 +1,9 @@ /* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */ -import type {CreateMessageParams} from '@lobechat/types'; +import { type CreateMessageParams } from '@lobechat/types'; import { messageService } from '@/services/message'; -import type {ChatStore} from '@/store/chat/store'; -import type {StoreSetter} from '@/store/types'; +import { type ChatStore } from '@/store/chat/store'; +import { type StoreSetter } from '@/store/types'; import { dbMessageSelectors, displayMessageSelectors } from '../../message/selectors'; import { threadSelectors } from '../../thread/selectors'; diff --git a/src/store/chat/slices/portal/action.ts b/src/store/chat/slices/portal/action.ts index 2d4718dfc1..5099d10b60 100644 --- a/src/store/chat/slices/portal/action.ts +++ b/src/store/chat/slices/portal/action.ts @@ -1,9 +1,9 @@ -import type {ChatStore} from '@/store/chat/store'; -import type {StoreSetter} from '@/store/types'; -import type {PortalArtifact} from '@/types/artifact'; +import { type ChatStore } from '@/store/chat/store'; +import { type StoreSetter } from '@/store/types'; +import { type PortalArtifact } from '@/types/artifact'; -import type {PortalFile, PortalViewData} from './initialState'; -import { PortalViewType } from './initialState'; +import { type PortalFile, type PortalViewData } from './initialState'; +import { PortalViewType } from './initialState'; // Helper to get current view type from stack const getCurrentViewType = (portalStack: PortalViewData[]): PortalViewType | null => { diff --git a/src/store/chat/slices/portal/initialState.ts b/src/store/chat/slices/portal/initialState.ts index 5525d286c2..de27590399 100644 --- a/src/store/chat/slices/portal/initialState.ts +++ b/src/store/chat/slices/portal/initialState.ts @@ -1,4 +1,4 @@ -import type {PortalArtifact} from '@/types/artifact'; +import { type PortalArtifact } from '@/types/artifact'; export enum ArtifactDisplayMode { Code = 'code', diff --git a/src/store/chat/slices/portal/selectors.test.ts b/src/store/chat/slices/portal/selectors.test.ts index 3b4990c031..9804d1ad45 100644 --- a/src/store/chat/slices/portal/selectors.test.ts +++ b/src/store/chat/slices/portal/selectors.test.ts @@ -1,7 +1,7 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { describe, expect, it } from 'vitest'; -import type { ChatStoreState } from '@/store/chat'; +import { type ChatStoreState } from '@/store/chat'; import { PortalViewType } from './initialState'; import { chatPortalSelectors } from './selectors'; diff --git a/src/store/chat/slices/portal/selectors.ts b/src/store/chat/slices/portal/selectors.ts index b7e93634c1..2d0c865142 100644 --- a/src/store/chat/slices/portal/selectors.ts +++ b/src/store/chat/slices/portal/selectors.ts @@ -1,10 +1,10 @@ import { ARTIFACT_TAG_CLOSED_REGEX, ARTIFACT_TAG_REGEX } from '@/const/plugin'; -import type { ChatStoreState } from '@/store/chat'; -import type {PortalArtifact} from '@/types/artifact'; +import { type ChatStoreState } from '@/store/chat'; +import { type PortalArtifact } from '@/types/artifact'; import { dbMessageSelectors } from '../message/selectors'; -import type {PortalFile, PortalViewData} from './initialState'; -import { PortalViewType } from './initialState'; +import { type PortalFile, type PortalViewData } from './initialState'; +import { PortalViewType } from './initialState'; // ============== Core Stack Selectors ============== diff --git a/src/store/chat/slices/portal/selectors/thread.ts b/src/store/chat/slices/portal/selectors/thread.ts index 20bf60873b..818e1ad0c4 100644 --- a/src/store/chat/slices/portal/selectors/thread.ts +++ b/src/store/chat/slices/portal/selectors/thread.ts @@ -1,7 +1,7 @@ -import type { ChatStoreState } from '@/store/chat'; +import { type ChatStoreState } from '@/store/chat'; -import type {PortalViewData} from '../initialState'; -import { PortalViewType } from '../initialState'; +import { type PortalViewData } from '../initialState'; +import { PortalViewType } from '../initialState'; // Helper to get current view const getCurrentView = (s: ChatStoreState): PortalViewData | null => { diff --git a/src/store/chat/slices/thread/action.test.ts b/src/store/chat/slices/thread/action.test.ts index 20949a18f0..81a001952f 100644 --- a/src/store/chat/slices/thread/action.test.ts +++ b/src/store/chat/slices/thread/action.test.ts @@ -1,12 +1,12 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { act, renderHook, waitFor } from '@testing-library/react'; -import type { Mock} from 'vitest'; +import { type Mock } from 'vitest'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { mutate } from '@/libs/swr'; import { chatService } from '@/services/chat'; import { threadService } from '@/services/thread'; -import type { ThreadItem} from '@/types/topic'; +import { type ThreadItem } from '@/types/topic'; import { ThreadStatus, ThreadType } from '@/types/topic'; import { useChatStore } from '../../store'; diff --git a/src/store/chat/slices/thread/action.ts b/src/store/chat/slices/thread/action.ts index 5c04de123d..bccd35901e 100644 --- a/src/store/chat/slices/thread/action.ts +++ b/src/store/chat/slices/thread/action.ts @@ -2,17 +2,22 @@ // 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'; -import type {CreateMessageParams, IThreadType, ThreadItem, UIChatMessage} from '@lobechat/types'; +import { + type CreateMessageParams, + type IThreadType, + type ThreadItem, + type UIChatMessage, +} from '@lobechat/types'; import isEqual from 'fast-deep-equal'; -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; import { mutate, useClientDataSWR } from '@/libs/swr'; import { chatService } from '@/services/chat'; import { threadService } from '@/services/thread'; import { threadSelectors } from '@/store/chat/selectors'; -import type {ChatStore} from '@/store/chat/store'; +import { type ChatStore } from '@/store/chat/store'; import { globalHelpers } from '@/store/global/helpers'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { useUserStore } from '@/store/user'; import { systemAgentSelectors } from '@/store/user/selectors'; import { merge } from '@/utils/merge'; @@ -20,8 +25,8 @@ import { setNamespace } from '@/utils/storeDebug'; import { displayMessageSelectors } from '../message/selectors'; import { PortalViewType } from '../portal/initialState'; -import type {ThreadDispatch} from './reducer'; -import { threadReducer } from './reducer'; +import { type ThreadDispatch } from './reducer'; +import { threadReducer } from './reducer'; import { genParentMessages } from './selectors'; const n = setNamespace('thd'); diff --git a/src/store/chat/slices/thread/initialState.ts b/src/store/chat/slices/thread/initialState.ts index c43a3310e9..f8a2e1b971 100644 --- a/src/store/chat/slices/thread/initialState.ts +++ b/src/store/chat/slices/thread/initialState.ts @@ -1,5 +1,5 @@ -import type {IThreadType, ThreadItem} from '@lobechat/types'; -import { ThreadType } from '@lobechat/types'; +import { type IThreadType, type ThreadItem } from '@lobechat/types'; +import { ThreadType } from '@lobechat/types'; export interface ChatThreadState { activeThreadId?: string; diff --git a/src/store/chat/slices/thread/reducer.ts b/src/store/chat/slices/thread/reducer.ts index d4a58e2bf5..885ade35c8 100644 --- a/src/store/chat/slices/thread/reducer.ts +++ b/src/store/chat/slices/thread/reducer.ts @@ -1,6 +1,6 @@ import { produce } from 'immer'; -import type {ThreadItem} from '@/types/topic'; +import { type ThreadItem } from '@/types/topic'; type UpdateThreadAction = { id: string; diff --git a/src/store/chat/slices/thread/selectors/index.ts b/src/store/chat/slices/thread/selectors/index.ts index 1cf6c4a136..ecdbd533de 100644 --- a/src/store/chat/slices/thread/selectors/index.ts +++ b/src/store/chat/slices/thread/selectors/index.ts @@ -1,8 +1,8 @@ -import type {ThreadItem, UIChatMessage} from '@lobechat/types'; +import { type ThreadItem, type UIChatMessage } from '@lobechat/types'; import { useAgentStore } from '@/store/agent'; import { agentChatConfigSelectors } from '@/store/agent/selectors'; -import type { ChatStoreState } from '@/store/chat'; +import { type ChatStoreState } from '@/store/chat'; import { chatHelpers } from '@/store/chat/helpers'; import { displayMessageSelectors } from '../../message/selectors'; diff --git a/src/store/chat/slices/thread/selectors/util.ts b/src/store/chat/slices/thread/selectors/util.ts index a7f63da50f..8e3455a158 100644 --- a/src/store/chat/slices/thread/selectors/util.ts +++ b/src/store/chat/slices/thread/selectors/util.ts @@ -1,5 +1,5 @@ -import type {IThreadType, UIChatMessage} from '@lobechat/types'; -import { ThreadType } from '@lobechat/types'; +import { type IThreadType, type UIChatMessage } from '@lobechat/types'; +import { ThreadType } from '@lobechat/types'; /** * Generate parent messages for thread display diff --git a/src/store/chat/slices/topic/action.test.ts b/src/store/chat/slices/topic/action.test.ts index e1891d4080..b15583a0d6 100644 --- a/src/store/chat/slices/topic/action.test.ts +++ b/src/store/chat/slices/topic/action.test.ts @@ -1,6 +1,6 @@ -import type { UIChatMessage } from '@lobechat/types'; +import { type UIChatMessage } from '@lobechat/types'; import { act, renderHook, waitFor } from '@testing-library/react'; -import type { Mock} from 'vitest'; +import { type Mock } from 'vitest'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { LOADING_FLAT } from '@/const/message'; @@ -11,7 +11,7 @@ import { topicService } from '@/services/topic'; import { messageMapKey } from '@/store/chat/utils/messageMapKey'; import { topicMapKey } from '@/store/chat/utils/topicMapKey'; import { useSessionStore } from '@/store/session'; -import type { ChatTopic } from '@/types/topic'; +import { type ChatTopic } from '@/types/topic'; import { useChatStore } from '../../store'; diff --git a/src/store/chat/slices/topic/action.ts b/src/store/chat/slices/topic/action.ts index 06ff5d77a2..96979d0454 100644 --- a/src/store/chat/slices/topic/action.ts +++ b/src/store/chat/slices/topic/action.ts @@ -2,11 +2,11 @@ // 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'; -import type { ChatTopicMetadata, MessageMapScope, UIChatMessage } from '@lobechat/types'; +import { type ChatTopicMetadata, type MessageMapScope, type UIChatMessage } from '@lobechat/types'; import { TraceNameMap } from '@lobechat/types'; import isEqual from 'fast-deep-equal'; import { t } from 'i18next'; -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; import { message } from '@/components/AntdStaticMethods'; @@ -15,20 +15,20 @@ import { mutate, useClientDataSWRWithSync } from '@/libs/swr'; import { chatService } from '@/services/chat'; import { messageService } from '@/services/message'; import { topicService } from '@/services/topic'; -import type { ChatStore } from '@/store/chat'; +import { type ChatStore } from '@/store/chat'; import { topicMapKey } from '@/store/chat/utils/topicMapKey'; import { useGlobalStore } from '@/store/global'; import { globalHelpers } from '@/store/global/helpers'; -import type { StoreSetter } from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { useUserStore } from '@/store/user'; import { systemAgentSelectors } from '@/store/user/selectors'; -import type { ChatTopic, CreateTopicParams } from '@/types/topic'; +import { type ChatTopic, type CreateTopicParams } from '@/types/topic'; import { merge } from '@/utils/merge'; import { setNamespace } from '@/utils/storeDebug'; import { displayMessageSelectors } from '../message/selectors'; -import type { TopicData } from './initialState'; -import type { ChatTopicDispatch } from './reducer'; +import { type TopicData } from './initialState'; +import { type ChatTopicDispatch } from './reducer'; import { topicReducer } from './reducer'; import { topicSelectors } from './selectors'; diff --git a/src/store/chat/slices/topic/initialState.ts b/src/store/chat/slices/topic/initialState.ts index e2800d0438..b1c16d1c57 100644 --- a/src/store/chat/slices/topic/initialState.ts +++ b/src/store/chat/slices/topic/initialState.ts @@ -1,4 +1,4 @@ -import type {ChatTopic} from '@/types/topic'; +import { type ChatTopic } from '@/types/topic'; /** * Unified topic data structure for each agent diff --git a/src/store/chat/slices/topic/reducer.test.ts b/src/store/chat/slices/topic/reducer.test.ts index 8d8b84b77e..9ee52ec123 100644 --- a/src/store/chat/slices/topic/reducer.test.ts +++ b/src/store/chat/slices/topic/reducer.test.ts @@ -1,8 +1,8 @@ import { expect } from 'vitest'; -import type { ChatTopic } from '@/types/topic'; +import { type ChatTopic } from '@/types/topic'; -import type { ChatTopicDispatch} from './reducer'; +import { type ChatTopicDispatch } from './reducer'; import { topicReducer } from './reducer'; describe('topicReducer', () => { diff --git a/src/store/chat/slices/topic/reducer.ts b/src/store/chat/slices/topic/reducer.ts index f77a3836b0..8c7730df94 100644 --- a/src/store/chat/slices/topic/reducer.ts +++ b/src/store/chat/slices/topic/reducer.ts @@ -1,7 +1,7 @@ import isEqual from 'fast-deep-equal'; import { produce } from 'immer'; -import type {ChatTopic, CreateTopicParams} from '@/types/topic'; +import { type ChatTopic, type CreateTopicParams } from '@/types/topic'; type AddChatTopicAction = { type: 'addTopic'; diff --git a/src/store/chat/slices/topic/selectors.test.ts b/src/store/chat/slices/topic/selectors.test.ts index 59f676a075..3faaa67532 100644 --- a/src/store/chat/slices/topic/selectors.test.ts +++ b/src/store/chat/slices/topic/selectors.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { ChatStore } from '@/store/chat'; +import { type ChatStore } from '@/store/chat'; import { initialState } from '@/store/chat/initialState'; import { topicMapKey } from '@/store/chat/utils/topicMapKey'; import { merge } from '@/utils/merge'; diff --git a/src/store/chat/slices/topic/selectors.ts b/src/store/chat/slices/topic/selectors.ts index 91e0980856..586d201e62 100644 --- a/src/store/chat/slices/topic/selectors.ts +++ b/src/store/chat/slices/topic/selectors.ts @@ -1,11 +1,11 @@ import { t } from 'i18next'; -import type {ChatTopic, ChatTopicSummary, GroupedTopic} from '@/types/topic'; +import { type ChatTopic, type ChatTopicSummary, type GroupedTopic } from '@/types/topic'; import { groupTopicsByTime } from '@/utils/client/topic'; -import type {ChatStoreState} from '../../initialState'; +import { type ChatStoreState } from '../../initialState'; import { topicMapKey } from '../../utils/topicMapKey'; -import type {TopicData} from './initialState'; +import { type TopicData } from './initialState'; // Helper selector: get current topic data based on session context const currentTopicData = (s: ChatStoreState): TopicData | undefined => { diff --git a/src/store/chat/slices/translate/action.test.ts b/src/store/chat/slices/translate/action.test.ts index b6110bbe6d..c1bcbadb1a 100644 --- a/src/store/chat/slices/translate/action.test.ts +++ b/src/store/chat/slices/translate/action.test.ts @@ -1,5 +1,5 @@ import { act, renderHook } from '@testing-library/react'; -import type { Mock} from 'vitest'; +import { type Mock } from 'vitest'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { chatService } from '@/services/chat'; diff --git a/src/store/chat/slices/translate/action.ts b/src/store/chat/slices/translate/action.ts index 686c9d881b..3f9ca1057b 100644 --- a/src/store/chat/slices/translate/action.ts +++ b/src/store/chat/slices/translate/action.ts @@ -1,14 +1,14 @@ import { chainLangDetect, chainTranslate } from '@lobechat/prompts'; -import type {ChatTranslate, TracePayload} from '@lobechat/types'; -import { TraceNameMap } from '@lobechat/types'; +import { type ChatTranslate, type TracePayload } from '@lobechat/types'; +import { TraceNameMap } from '@lobechat/types'; import { merge } from '@lobechat/utils'; import { supportLocales } from '@/locales/resources'; import { chatService } from '@/services/chat'; import { messageService } from '@/services/message'; import { dbMessageSelectors } from '@/store/chat/selectors'; -import type {ChatStore} from '@/store/chat/store'; -import type {StoreSetter} from '@/store/types'; +import { type ChatStore } from '@/store/chat/store'; +import { type StoreSetter } from '@/store/types'; import { useUserStore } from '@/store/user'; import { systemAgentSelectors } from '@/store/user/selectors'; diff --git a/src/store/chat/slices/tts/action.ts b/src/store/chat/slices/tts/action.ts index 3bd71c4b1e..ec8f65dabb 100644 --- a/src/store/chat/slices/tts/action.ts +++ b/src/store/chat/slices/tts/action.ts @@ -1,8 +1,8 @@ -import type {ChatTTS} from '@lobechat/types'; +import { type ChatTTS } from '@lobechat/types'; import { messageService } from '@/services/message'; -import type {ChatStore} from '@/store/chat/store'; -import type {StoreSetter} from '@/store/types'; +import { type ChatStore } from '@/store/chat/store'; +import { type StoreSetter } from '@/store/types'; /** * enhance chat action like translate,tts diff --git a/src/store/chat/store.ts b/src/store/chat/store.ts index efa7457aab..893047045d 100644 --- a/src/store/chat/store.ts +++ b/src/store/chat/store.ts @@ -2,34 +2,34 @@ import { subscribeWithSelector } from 'zustand/middleware'; import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {ChatStoreState} from './initialState'; -import { initialState } from './initialState'; -import type {ChatAIAgentAction} from './slices/aiAgent/actions'; +import { type ChatStoreState } from './initialState'; +import { initialState } from './initialState'; +import { type ChatAIAgentAction } from './slices/aiAgent/actions'; import { chatAiAgent } from './slices/aiAgent/actions'; -import type {ChatAIChatAction} from './slices/aiChat/actions'; +import { type ChatAIChatAction } from './slices/aiChat/actions'; import { chatAiChat } from './slices/aiChat/actions'; -import type {ChatBuiltinToolAction} from './slices/builtinTool/actions'; -import { chatToolSlice } from './slices/builtinTool/actions'; -import type {ChatMessageAction} from './slices/message/actions'; +import { type ChatBuiltinToolAction } from './slices/builtinTool/actions'; +import { chatToolSlice } from './slices/builtinTool/actions'; +import { type ChatMessageAction } from './slices/message/actions'; import { chatMessage } from './slices/message/actions'; -import type {OperationActions} from './slices/operation/actions'; -import { OperationActionsImpl } from './slices/operation/actions'; -import type {ChatPluginAction} from './slices/plugin/actions'; +import { type OperationActions } from './slices/operation/actions'; +import { OperationActionsImpl } from './slices/operation/actions'; +import { type ChatPluginAction } from './slices/plugin/actions'; import { chatPlugin } from './slices/plugin/actions'; -import type {ChatPortalAction} from './slices/portal/action'; -import { ChatPortalActionImpl } from './slices/portal/action'; -import type {ChatThreadAction} from './slices/thread/action'; -import { ChatThreadActionImpl } from './slices/thread/action'; -import type {ChatTopicAction} from './slices/topic/action'; -import { ChatTopicActionImpl } from './slices/topic/action'; -import type {ChatTranslateAction} from './slices/translate/action'; -import { ChatTranslateActionImpl } from './slices/translate/action'; -import type {ChatTTSAction} from './slices/tts/action'; -import { ChatTTSActionImpl } from './slices/tts/action'; +import { type ChatPortalAction } from './slices/portal/action'; +import { ChatPortalActionImpl } from './slices/portal/action'; +import { type ChatThreadAction } from './slices/thread/action'; +import { ChatThreadActionImpl } from './slices/thread/action'; +import { type ChatTopicAction } from './slices/topic/action'; +import { ChatTopicActionImpl } from './slices/topic/action'; +import { type ChatTranslateAction } from './slices/translate/action'; +import { ChatTranslateActionImpl } from './slices/translate/action'; +import { type ChatTTSAction } from './slices/tts/action'; +import { ChatTTSActionImpl } from './slices/tts/action'; export type ChatStoreAction = ChatMessageAction & ChatThreadAction & diff --git a/src/store/chat/utils/messageMapKey.ts b/src/store/chat/utils/messageMapKey.ts index 8539f7f4eb..425da68c71 100644 --- a/src/store/chat/utils/messageMapKey.ts +++ b/src/store/chat/utils/messageMapKey.ts @@ -1,4 +1,4 @@ -import type {MessageMapContext, MessageMapScope} from '@lobechat/types'; +import { type MessageMapContext, type MessageMapScope } from '@lobechat/types'; /** * Input context for messageMapKey function diff --git a/src/store/discover/slices/assistant/action.ts b/src/store/discover/slices/assistant/action.ts index ebd1458193..6515c51af8 100644 --- a/src/store/discover/slices/assistant/action.ts +++ b/src/store/discover/slices/assistant/action.ts @@ -1,12 +1,18 @@ -import type {CategoryItem, CategoryListQuery} from '@lobehub/market-sdk'; -import type {SWRResponse} from 'swr'; +import { type CategoryItem, type CategoryListQuery } from '@lobehub/market-sdk'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; import { discoverService } from '@/services/discover'; -import type {DiscoverStore} from '@/store/discover'; +import { type DiscoverStore } from '@/store/discover'; import { globalHelpers } from '@/store/global/helpers'; -import type {StoreSetter} from '@/store/types'; -import type {AssistantListResponse, AssistantMarketSource, AssistantQueryParams, DiscoverAssistantDetail, IdentifiersResponse} from '@/types/discover'; +import { type StoreSetter } from '@/store/types'; +import { + type AssistantListResponse, + type AssistantMarketSource, + type AssistantQueryParams, + type DiscoverAssistantDetail, + type IdentifiersResponse, +} from '@/types/discover'; type Setter = StoreSetter; export const createAssistantSlice = (set: Setter, get: () => DiscoverStore, _api?: unknown) => diff --git a/src/store/discover/slices/groupAgent/action.ts b/src/store/discover/slices/groupAgent/action.ts index 7c5b9be991..b42c2a16b5 100644 --- a/src/store/discover/slices/groupAgent/action.ts +++ b/src/store/discover/slices/groupAgent/action.ts @@ -1,12 +1,17 @@ -import type {CategoryItem, CategoryListQuery} from '@lobehub/market-sdk'; -import type {SWRResponse} from 'swr'; +import { type CategoryItem, type CategoryListQuery } from '@lobehub/market-sdk'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; import { discoverService } from '@/services/discover'; -import type {DiscoverStore} from '@/store/discover'; +import { type DiscoverStore } from '@/store/discover'; import { globalHelpers } from '@/store/global/helpers'; -import type {StoreSetter} from '@/store/types'; -import type {DiscoverGroupAgentDetail, GroupAgentListResponse, GroupAgentQueryParams, IdentifiersResponse} from '@/types/discover'; +import { type StoreSetter } from '@/store/types'; +import { + type DiscoverGroupAgentDetail, + type GroupAgentListResponse, + type GroupAgentQueryParams, + type IdentifiersResponse, +} from '@/types/discover'; type Setter = StoreSetter; export const createGroupAgentSlice = (set: Setter, get: () => DiscoverStore, _api?: unknown) => diff --git a/src/store/discover/slices/mcp/action.ts b/src/store/discover/slices/mcp/action.ts index c392e0c3b4..a84056a96b 100644 --- a/src/store/discover/slices/mcp/action.ts +++ b/src/store/discover/slices/mcp/action.ts @@ -1,12 +1,16 @@ -import type {CategoryItem, CategoryListQuery} from '@lobehub/market-sdk'; -import type {SWRResponse} from 'swr'; +import { type CategoryItem, type CategoryListQuery } from '@lobehub/market-sdk'; +import { type SWRResponse } from 'swr'; import { useClientDataSWR } from '@/libs/swr'; import { discoverService } from '@/services/discover'; -import type {DiscoverStore} from '@/store/discover'; +import { type DiscoverStore } from '@/store/discover'; import { globalHelpers } from '@/store/global/helpers'; -import type {StoreSetter} from '@/store/types'; -import type {DiscoverMcpDetail, McpListResponse, McpQueryParams} from '@/types/discover'; +import { type StoreSetter } from '@/store/types'; +import { + type DiscoverMcpDetail, + type McpListResponse, + type McpQueryParams, +} from '@/types/discover'; type Setter = StoreSetter; export const createMCPSlice = (set: Setter, get: () => DiscoverStore, _api?: unknown) => diff --git a/src/store/discover/slices/model/action.ts b/src/store/discover/slices/model/action.ts index 2080c3bcdb..55038f4fa4 100644 --- a/src/store/discover/slices/model/action.ts +++ b/src/store/discover/slices/model/action.ts @@ -1,12 +1,17 @@ -import type {CategoryItem, CategoryListQuery} from '@lobehub/market-sdk'; -import type {SWRResponse} from 'swr'; +import { type CategoryItem, type CategoryListQuery } from '@lobehub/market-sdk'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; import { discoverService } from '@/services/discover'; -import type {DiscoverStore} from '@/store/discover'; +import { type DiscoverStore } from '@/store/discover'; import { globalHelpers } from '@/store/global/helpers'; -import type {StoreSetter} from '@/store/types'; -import type {DiscoverModelDetail, IdentifiersResponse, ModelListResponse, ModelQueryParams} from '@/types/discover'; +import { type StoreSetter } from '@/store/types'; +import { + type DiscoverModelDetail, + type IdentifiersResponse, + type ModelListResponse, + type ModelQueryParams, +} from '@/types/discover'; type Setter = StoreSetter; export const createModelSlice = (set: Setter, get: () => DiscoverStore, _api?: unknown) => diff --git a/src/store/discover/slices/plugin/action.ts b/src/store/discover/slices/plugin/action.ts index 804d421321..521add4dde 100644 --- a/src/store/discover/slices/plugin/action.ts +++ b/src/store/discover/slices/plugin/action.ts @@ -1,12 +1,17 @@ -import type {DiscoverPluginDetail, IdentifiersResponse, PluginListResponse, PluginQueryParams} from '@lobechat/types'; -import type {CategoryItem, CategoryListQuery} from '@lobehub/market-sdk'; -import type {SWRResponse} from 'swr'; +import { + type DiscoverPluginDetail, + type IdentifiersResponse, + type PluginListResponse, + type PluginQueryParams, +} from '@lobechat/types'; +import { type CategoryItem, type CategoryListQuery } from '@lobehub/market-sdk'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; import { discoverService } from '@/services/discover'; -import type {DiscoverStore} from '@/store/discover'; +import { type DiscoverStore } from '@/store/discover'; import { globalHelpers } from '@/store/global/helpers'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; type Setter = StoreSetter; export const createPluginSlice = (set: Setter, get: () => DiscoverStore, _api?: unknown) => diff --git a/src/store/discover/slices/provider/action.ts b/src/store/discover/slices/provider/action.ts index 07ec029713..e9b01b7918 100644 --- a/src/store/discover/slices/provider/action.ts +++ b/src/store/discover/slices/provider/action.ts @@ -1,11 +1,16 @@ -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; import { discoverService } from '@/services/discover'; -import type {DiscoverStore} from '@/store/discover'; +import { type DiscoverStore } from '@/store/discover'; import { globalHelpers } from '@/store/global/helpers'; -import type {StoreSetter} from '@/store/types'; -import type {DiscoverProviderDetail, IdentifiersResponse, ProviderListResponse, ProviderQueryParams} from '@/types/discover'; +import { type StoreSetter } from '@/store/types'; +import { + type DiscoverProviderDetail, + type IdentifiersResponse, + type ProviderListResponse, + type ProviderQueryParams, +} from '@/types/discover'; type Setter = StoreSetter; export const createProviderSlice = (set: Setter, get: () => DiscoverStore, _api?: unknown) => diff --git a/src/store/discover/slices/social/action.ts b/src/store/discover/slices/social/action.ts index 728710bc0f..0030abfbec 100644 --- a/src/store/discover/slices/social/action.ts +++ b/src/store/discover/slices/social/action.ts @@ -1,12 +1,18 @@ -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR, { mutate } from 'swr'; -import type {FavoriteAgentItem, FavoritePluginItem, FollowCounts, FollowStatus, FollowUserItem, PaginatedResponse, SocialTargetType} from '@/services/social'; import { - socialService + type FavoriteAgentItem, + type FavoritePluginItem, + type FollowCounts, + type FollowStatus, + type FollowUserItem, + type PaginatedResponse, + type SocialTargetType, } from '@/services/social'; -import type {DiscoverStore} from '@/store/discover'; -import type {StoreSetter} from '@/store/types'; +import { socialService } from '@/services/social'; +import { type DiscoverStore } from '@/store/discover'; +import { type StoreSetter } from '@/store/types'; type Setter = StoreSetter; export const createSocialSlice = (set: Setter, get: () => DiscoverStore, _api?: unknown) => diff --git a/src/store/discover/slices/user/action.ts b/src/store/discover/slices/user/action.ts index 9634e23118..63b14d267d 100644 --- a/src/store/discover/slices/user/action.ts +++ b/src/store/discover/slices/user/action.ts @@ -1,11 +1,11 @@ -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; import { discoverService } from '@/services/discover'; -import type {DiscoverStore} from '@/store/discover'; +import { type DiscoverStore } from '@/store/discover'; import { globalHelpers } from '@/store/global/helpers'; -import type {StoreSetter} from '@/store/types'; -import type {DiscoverUserProfile} from '@/types/discover'; +import { type StoreSetter } from '@/store/types'; +import { type DiscoverUserProfile } from '@/types/discover'; type Setter = StoreSetter; export const createUserSlice = (set: Setter, get: () => DiscoverStore, _api?: unknown) => diff --git a/src/store/discover/store.ts b/src/store/discover/store.ts index 00c142a7cd..0645f7ed99 100644 --- a/src/store/discover/store.ts +++ b/src/store/discover/store.ts @@ -1,24 +1,24 @@ import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {AssistantAction} from './slices/assistant/action'; -import { createAssistantSlice } from './slices/assistant/action'; -import type {GroupAgentAction} from './slices/groupAgent/action'; +import { type AssistantAction } from './slices/assistant/action'; +import { createAssistantSlice } from './slices/assistant/action'; +import { type GroupAgentAction } from './slices/groupAgent/action'; import { createGroupAgentSlice } from './slices/groupAgent/action'; -import type {MCPAction} from './slices/mcp'; +import { type MCPAction } from './slices/mcp'; import { createMCPSlice } from './slices/mcp'; -import type {ModelAction} from './slices/model/action'; +import { type ModelAction } from './slices/model/action'; import { createModelSlice } from './slices/model/action'; -import type {PluginAction} from './slices/plugin/action'; +import { type PluginAction } from './slices/plugin/action'; import { createPluginSlice } from './slices/plugin/action'; -import type {ProviderAction} from './slices/provider/action'; +import { type ProviderAction } from './slices/provider/action'; import { createProviderSlice } from './slices/provider/action'; -import type {SocialAction} from './slices/social'; +import { type SocialAction } from './slices/social'; import { createSocialSlice } from './slices/social'; -import type {UserAction} from './slices/user'; +import { type UserAction } from './slices/user'; import { createUserSlice } from './slices/user'; // =============== Aggregate createStoreFn ============ // diff --git a/src/store/document/slices/document/action.ts b/src/store/document/slices/document/action.ts index b18327c637..694cbdc4de 100644 --- a/src/store/document/slices/document/action.ts +++ b/src/store/document/slices/document/action.ts @@ -1,18 +1,18 @@ 'use client'; import { EDITOR_DEBOUNCE_TIME, EDITOR_MAX_WAIT } from '@lobechat/const'; -import type {DocumentItem} from '@lobechat/database/schemas'; -import type {IEditor} from '@lobehub/editor'; +import { type DocumentItem } from '@lobechat/database/schemas'; +import { type IEditor } from '@lobehub/editor'; import { debounce } from 'es-toolkit/compat'; -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; import { useClientDataSWRWithSync } from '@/libs/swr'; import { documentService } from '@/services/document'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; -import type { DocumentStore } from '../../store'; -import type {DocumentSourceType} from '../editor/initialState'; +import { type DocumentStore } from '../../store'; +import { type DocumentSourceType } from '../editor/initialState'; const n = setNamespace('document/document'); diff --git a/src/store/document/slices/editor/action.ts b/src/store/document/slices/editor/action.ts index 40aed96a3f..55c794b5d7 100644 --- a/src/store/document/slices/editor/action.ts +++ b/src/store/document/slices/editor/action.ts @@ -1,16 +1,16 @@ 'use client'; -import type { IEditor } from '@lobehub/editor/es/types'; -import type {EditorState as LobehubEditorState} from '@lobehub/editor/react'; +import { type IEditor } from '@lobehub/editor/es/types'; +import { type EditorState as LobehubEditorState } from '@lobehub/editor/react'; import isEqual from 'fast-deep-equal'; import { documentService } from '@/services/document'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; -import type { DocumentStore } from '../../store'; -import type {DocumentDispatch} from './reducer'; -import { documentReducer } from './reducer'; +import { type DocumentStore } from '../../store'; +import { type DocumentDispatch } from './reducer'; +import { documentReducer } from './reducer'; const n = setNamespace('document/editor'); diff --git a/src/store/document/slices/editor/initialState.ts b/src/store/document/slices/editor/initialState.ts index 6ee685583b..367ff82c27 100644 --- a/src/store/document/slices/editor/initialState.ts +++ b/src/store/document/slices/editor/initialState.ts @@ -1,7 +1,7 @@ 'use client'; -import type {IEditor} from '@lobehub/editor'; -import type {EditorState as LobehubEditorState} from '@lobehub/editor/react'; +import { type IEditor } from '@lobehub/editor'; +import { type EditorState as LobehubEditorState } from '@lobehub/editor/react'; /** * Document source type - determines which service to use for persistence diff --git a/src/store/document/slices/editor/reducer.test.ts b/src/store/document/slices/editor/reducer.test.ts index d9448d68e5..d4431bea48 100644 --- a/src/store/document/slices/editor/reducer.test.ts +++ b/src/store/document/slices/editor/reducer.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest'; -import type {EditorContentState} from './initialState'; -import type {DocumentDispatch} from './reducer'; -import { documentReducer } from './reducer'; +import { type EditorContentState } from './initialState'; +import { type DocumentDispatch } from './reducer'; +import { documentReducer } from './reducer'; describe('documentReducer', () => { let state: Record; diff --git a/src/store/document/slices/editor/reducer.ts b/src/store/document/slices/editor/reducer.ts index d5ec1801a2..fd5f4aabb7 100644 --- a/src/store/document/slices/editor/reducer.ts +++ b/src/store/document/slices/editor/reducer.ts @@ -1,6 +1,6 @@ import { produce } from 'immer'; -import type {EditorContentState} from './initialState'; +import { type EditorContentState } from './initialState'; import { createInitialEditorContentState } from './initialState'; // ============ Action Types ============ diff --git a/src/store/document/slices/editor/selectors.test.ts b/src/store/document/slices/editor/selectors.test.ts index 12207cbd42..a998c68654 100644 --- a/src/store/document/slices/editor/selectors.test.ts +++ b/src/store/document/slices/editor/selectors.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { DocumentStore } from '../../store'; +import { type DocumentStore } from '../../store'; import { editorSelectors } from './selectors'; describe('DocumentStore - Editor Selectors', () => { diff --git a/src/store/document/slices/editor/selectors.ts b/src/store/document/slices/editor/selectors.ts index f993161b73..6d2134361b 100644 --- a/src/store/document/slices/editor/selectors.ts +++ b/src/store/document/slices/editor/selectors.ts @@ -1,6 +1,6 @@ /* eslint-disable sort-keys-fix/sort-keys-fix */ -import type { DocumentStore } from '../../store'; -import type { EditorContentState } from './initialState'; +import { type DocumentStore } from '../../store'; +import { type EditorContentState } from './initialState'; // ===== Active Document Selectors ===== diff --git a/src/store/document/store.ts b/src/store/document/store.ts index 7a23924c2d..b4dad575cb 100644 --- a/src/store/document/store.ts +++ b/src/store/document/store.ts @@ -1,16 +1,13 @@ import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {DocumentAction} from './slices/document'; +import { type DocumentAction } from './slices/document'; import { createDocumentSlice } from './slices/document'; -import type {EditorAction, EditorState} from './slices/editor'; -import { - createEditorSlice, - initialEditorState -} from './slices/editor'; +import { type EditorAction, type EditorState } from './slices/editor'; +import { createEditorSlice, initialEditorState } from './slices/editor'; // State type export type DocumentState = EditorState; diff --git a/src/store/electron/actions/app.ts b/src/store/electron/actions/app.ts index 35a021a9c1..6c4158aafd 100644 --- a/src/store/electron/actions/app.ts +++ b/src/store/electron/actions/app.ts @@ -1,16 +1,16 @@ -import type {ElectronAppState} from '@lobechat/electron-client-ipc'; -import type {SWRResponse} from 'swr'; +import { type ElectronAppState } from '@lobechat/electron-client-ipc'; +import { type SWRResponse } from 'swr'; import { globalAgentContextManager } from '@/helpers/GlobalAgentContextManager'; import { useOnlyFetchOnceSWR } from '@/libs/swr'; // Import for type usage import { electronSystemService } from '@/services/electron/system'; -import type {StoreSetter} from '@/store/types'; -import type {LocaleMode} from '@/types/locale'; +import { type StoreSetter } from '@/store/types'; +import { type LocaleMode } from '@/types/locale'; import { switchLang } from '@/utils/client/switchLang'; import { merge } from '@/utils/merge'; -import type { ElectronStore } from '../store'; +import { type ElectronStore } from '../store'; // ======== Action Interface ======== // diff --git a/src/store/electron/actions/navigationHistory.ts b/src/store/electron/actions/navigationHistory.ts index 39160e1b4e..4ff2703e61 100644 --- a/src/store/electron/actions/navigationHistory.ts +++ b/src/store/electron/actions/navigationHistory.ts @@ -1,6 +1,6 @@ -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; -import type { ElectronStore } from '../store'; +import { type ElectronStore } from '../store'; // ======== Types ======== // diff --git a/src/store/electron/actions/recentPages.ts b/src/store/electron/actions/recentPages.ts index 7fd6896cb6..83a3ba1204 100644 --- a/src/store/electron/actions/recentPages.ts +++ b/src/store/electron/actions/recentPages.ts @@ -2,10 +2,13 @@ import { getPinnedPages, savePinnedPages, } from '@/features/Electron/titlebar/RecentlyViewed/storage'; -import type {CachedPageData, PageReference} from '@/features/Electron/titlebar/RecentlyViewed/types'; -import type {StoreSetter} from '@/store/types'; +import { + type CachedPageData, + type PageReference, +} from '@/features/Electron/titlebar/RecentlyViewed/types'; +import { type StoreSetter } from '@/store/types'; -import type { ElectronStore } from '../store'; +import { type ElectronStore } from '../store'; // ======== Constants ======== // diff --git a/src/store/electron/actions/settings.ts b/src/store/electron/actions/settings.ts index fb519d3ec5..54d15d6bfa 100644 --- a/src/store/electron/actions/settings.ts +++ b/src/store/electron/actions/settings.ts @@ -1,13 +1,16 @@ -import type {NetworkProxySettings, ShortcutUpdateResult} from '@lobechat/electron-client-ipc'; +import { + type NetworkProxySettings, + type ShortcutUpdateResult, +} from '@lobechat/electron-client-ipc'; import isEqual from 'fast-deep-equal'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; import { mutate } from '@/libs/swr'; import { desktopSettingsService } from '@/services/electron/settings'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; -import type { ElectronStore } from '../store'; +import { type ElectronStore } from '../store'; /** * Settings actions diff --git a/src/store/electron/actions/sync.ts b/src/store/electron/actions/sync.ts index 307cf62b97..737cee5f47 100644 --- a/src/store/electron/actions/sync.ts +++ b/src/store/electron/actions/sync.ts @@ -1,14 +1,14 @@ -import type {DataSyncConfig} from '@lobechat/electron-client-ipc'; +import { type DataSyncConfig } from '@lobechat/electron-client-ipc'; import isEqual from 'fast-deep-equal'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; import { mutate } from '@/libs/swr'; import { remoteServerService } from '@/services/electron/remoteServer'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { initialState } from '../initialState'; -import type { ElectronStore } from '../store'; +import { type ElectronStore } from '../store'; /** * Remote server actions diff --git a/src/store/electron/initialState.ts b/src/store/electron/initialState.ts index 7c581fd533..cd7bdd9e68 100644 --- a/src/store/electron/initialState.ts +++ b/src/store/electron/initialState.ts @@ -1,11 +1,13 @@ -import type {DataSyncConfig, ElectronAppState, NetworkProxySettings} from '@lobechat/electron-client-ipc'; - -import type {NavigationHistoryState} from './actions/navigationHistory'; import { - navigationHistoryInitialState -} from './actions/navigationHistory'; -import type {RecentPagesState} from './actions/recentPages'; -import { recentPagesInitialState } from './actions/recentPages'; + type DataSyncConfig, + type ElectronAppState, + type NetworkProxySettings, +} from '@lobechat/electron-client-ipc'; + +import { type NavigationHistoryState } from './actions/navigationHistory'; +import { navigationHistoryInitialState } from './actions/navigationHistory'; +import { type RecentPagesState } from './actions/recentPages'; +import { recentPagesInitialState } from './actions/recentPages'; export type RemoteServerError = 'CONFIG_ERROR' | 'AUTH_ERROR' | 'DISCONNECT_ERROR'; diff --git a/src/store/electron/selectors/__tests__/desktopState.test.ts b/src/store/electron/selectors/__tests__/desktopState.test.ts index 10923a7d3f..d38d03910f 100644 --- a/src/store/electron/selectors/__tests__/desktopState.test.ts +++ b/src/store/electron/selectors/__tests__/desktopState.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { ElectronState} from '@/store/electron/initialState'; +import { type ElectronState } from '@/store/electron/initialState'; import { initialState } from '@/store/electron/initialState'; import { merge } from '@/utils/merge'; diff --git a/src/store/electron/selectors/desktopState.ts b/src/store/electron/selectors/desktopState.ts index d881a28316..f9f991f93b 100644 --- a/src/store/electron/selectors/desktopState.ts +++ b/src/store/electron/selectors/desktopState.ts @@ -1,4 +1,4 @@ -import type {ElectronState} from '@/store/electron/initialState'; +import { type ElectronState } from '@/store/electron/initialState'; const userPath = (s: ElectronState) => s.appState.userPath; const userHomePath = (s: ElectronState) => userPath(s)?.home || ''; diff --git a/src/store/electron/selectors/hotkey.ts b/src/store/electron/selectors/hotkey.ts index 173bd00985..b69b7efd66 100644 --- a/src/store/electron/selectors/hotkey.ts +++ b/src/store/electron/selectors/hotkey.ts @@ -1,5 +1,5 @@ import { DEFAULT_DESKTOP_HOTKEY_CONFIG } from '@/const/desktop'; -import type {ElectronState} from '@/store/electron/initialState'; +import { type ElectronState } from '@/store/electron/initialState'; import { merge } from '@/utils/merge'; const hotkeys = (s: ElectronState) => merge(DEFAULT_DESKTOP_HOTKEY_CONFIG, s.desktopHotkeys); diff --git a/src/store/electron/selectors/sync.ts b/src/store/electron/selectors/sync.ts index e5e8785153..85d768812c 100644 --- a/src/store/electron/selectors/sync.ts +++ b/src/store/electron/selectors/sync.ts @@ -1,6 +1,6 @@ import { OFFICIAL_URL } from '@lobechat/const'; -import type {ElectronState} from '../initialState'; +import { type ElectronState } from '../initialState'; const isSyncActive = (s: ElectronState) => s.dataSyncConfig.active; diff --git a/src/store/electron/store.ts b/src/store/electron/store.ts index 07baa3e1e9..beddb66a7d 100644 --- a/src/store/electron/store.ts +++ b/src/store/electron/store.ts @@ -1,23 +1,21 @@ import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {ElectronAppAction} from './actions/app'; +import { type ElectronAppAction } from './actions/app'; import { createElectronAppSlice } from './actions/app'; -import type {NavigationHistoryAction} from './actions/navigationHistory'; -import { - createNavigationHistorySlice -} from './actions/navigationHistory'; -import type {RecentPagesAction} from './actions/recentPages'; +import { type NavigationHistoryAction } from './actions/navigationHistory'; +import { createNavigationHistorySlice } from './actions/navigationHistory'; +import { type RecentPagesAction } from './actions/recentPages'; import { createRecentPagesSlice } from './actions/recentPages'; -import type {ElectronSettingsAction} from './actions/settings'; -import { settingsSlice } from './actions/settings'; -import type {ElectronRemoteServerAction} from './actions/sync'; -import { remoteSyncSlice } from './actions/sync'; -import type {ElectronState} from './initialState'; -import { initialState } from './initialState'; +import { type ElectronSettingsAction } from './actions/settings'; +import { settingsSlice } from './actions/settings'; +import { type ElectronRemoteServerAction } from './actions/sync'; +import { remoteSyncSlice } from './actions/sync'; +import { type ElectronState } from './initialState'; +import { initialState } from './initialState'; // =============== Aggregate createStoreFn ============ // diff --git a/src/store/file/initialState.ts b/src/store/file/initialState.ts index fae7939a35..413b58d6d4 100644 --- a/src/store/file/initialState.ts +++ b/src/store/file/initialState.ts @@ -1,12 +1,12 @@ -import type {ImageFileState} from './slices/chat'; -import { initialImageFileState } from './slices/chat'; -import type {FileChunkState} from './slices/chunk'; -import { initialFileChunkState } from './slices/chunk'; -import type {DocumentState} from './slices/document'; -import { initialDocumentState } from './slices/document'; -import type {FileManagerState} from './slices/fileManager'; -import { initialFileManagerState } from './slices/fileManager'; -import type {ResourceState} from './slices/resource/initialState'; +import { type ImageFileState } from './slices/chat'; +import { initialImageFileState } from './slices/chat'; +import { type FileChunkState } from './slices/chunk'; +import { initialFileChunkState } from './slices/chunk'; +import { type DocumentState } from './slices/document'; +import { initialDocumentState } from './slices/document'; +import { type FileManagerState } from './slices/fileManager'; +import { initialFileManagerState } from './slices/fileManager'; +import { type ResourceState } from './slices/resource/initialState'; import { initialResourceState } from './slices/resource/initialState'; export type FilesStoreState = ImageFileState & diff --git a/src/store/file/reducers/uploadFileList.test.ts b/src/store/file/reducers/uploadFileList.test.ts index 764bd4fb6d..449112ed43 100644 --- a/src/store/file/reducers/uploadFileList.test.ts +++ b/src/store/file/reducers/uploadFileList.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { UploadFileItem } from '@/types/files/upload'; +import { type UploadFileItem } from '@/types/files/upload'; import { uploadFileListReducer } from './uploadFileList'; diff --git a/src/store/file/reducers/uploadFileList.ts b/src/store/file/reducers/uploadFileList.ts index dcbb3ff9b8..72c2ade909 100644 --- a/src/store/file/reducers/uploadFileList.ts +++ b/src/store/file/reducers/uploadFileList.ts @@ -1,6 +1,10 @@ import { produce } from 'immer'; -import type {FileUploadState, FileUploadStatus, UploadFileItem} from '@/types/files/upload'; +import { + type FileUploadState, + type FileUploadStatus, + type UploadFileItem, +} from '@/types/files/upload'; interface AddFile { atStart?: boolean; diff --git a/src/store/file/slices/chat/action.ts b/src/store/file/slices/chat/action.ts index bf5ba696b4..2895fad011 100644 --- a/src/store/file/slices/chat/action.ts +++ b/src/store/file/slices/chat/action.ts @@ -1,4 +1,4 @@ -import type {ChatContextContent} from '@lobechat/types'; +import { type ChatContextContent } from '@lobechat/types'; import { t } from 'i18next'; import { notification } from '@/components/AntdStaticMethods'; @@ -6,18 +6,16 @@ import { FILE_UPLOAD_BLACKLIST } from '@/const/file'; import { fileService } from '@/services/file'; import { ragService } from '@/services/rag'; import { UPLOAD_NETWORK_ERROR } from '@/services/upload'; -import type {UploadFileListDispatch} from '@/store/file/reducers/uploadFileList'; -import { - uploadFileListReducer -} from '@/store/file/reducers/uploadFileList'; -import type {StoreSetter} from '@/store/types'; -import type {FileListItem} from '@/types/files'; -import type {UploadFileItem} from '@/types/files/upload'; +import { type UploadFileListDispatch } from '@/store/file/reducers/uploadFileList'; +import { uploadFileListReducer } from '@/store/file/reducers/uploadFileList'; +import { type StoreSetter } from '@/store/types'; +import { type FileListItem } from '@/types/files'; +import { type UploadFileItem } from '@/types/files/upload'; import { isChunkingUnsupported } from '@/utils/isChunkingUnsupported'; import { sleep } from '@/utils/sleep'; import { setNamespace } from '@/utils/storeDebug'; -import type {FileStore} from '../../store'; +import { type FileStore } from '../../store'; const n = setNamespace('chat'); diff --git a/src/store/file/slices/chat/initialState.ts b/src/store/file/slices/chat/initialState.ts index 8bfc708e95..5141f04fc0 100644 --- a/src/store/file/slices/chat/initialState.ts +++ b/src/store/file/slices/chat/initialState.ts @@ -1,6 +1,6 @@ -import type {ChatContextContent} from '@lobechat/types'; +import { type ChatContextContent } from '@lobechat/types'; -import type {UploadFileItem} from '@/types/files/upload'; +import { type UploadFileItem } from '@/types/files/upload'; export interface ImageFileState { chatContextSelections: ChatContextContent[]; diff --git a/src/store/file/slices/chat/selectors.test.ts b/src/store/file/slices/chat/selectors.test.ts index e9589e9009..de6f512388 100644 --- a/src/store/file/slices/chat/selectors.test.ts +++ b/src/store/file/slices/chat/selectors.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest'; -import type { FilesStoreState} from '@/store/file/initialState'; +import { type FilesStoreState } from '@/store/file/initialState'; import { initialState } from '@/store/file/initialState'; -import type { UploadFileItem } from '@/types/files/upload'; +import { type UploadFileItem } from '@/types/files/upload'; import { UPLOAD_STATUS_SET } from '@/types/files/upload'; import { fileChatSelectors, filesSelectors } from './selectors'; diff --git a/src/store/file/slices/chat/selectors.ts b/src/store/file/slices/chat/selectors.ts index ccf37a53f2..dec935219f 100644 --- a/src/store/file/slices/chat/selectors.ts +++ b/src/store/file/slices/chat/selectors.ts @@ -1,6 +1,6 @@ import { UPLOAD_STATUS_SET } from '@/types/files/upload'; -import type {FilesStoreState} from '../../initialState'; +import { type FilesStoreState } from '../../initialState'; const chatUploadFileList = (s: FilesStoreState) => s.chatUploadFileList; const chatContextSelections = (s: FilesStoreState) => s.chatContextSelections; diff --git a/src/store/file/slices/chunk/action.ts b/src/store/file/slices/chunk/action.ts index 3cc39b425f..908bf7c0d8 100644 --- a/src/store/file/slices/chunk/action.ts +++ b/src/store/file/slices/chunk/action.ts @@ -1,7 +1,7 @@ import { ragService } from '@/services/rag'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; -import type {FileStore} from '../../store'; +import { type FileStore } from '../../store'; type Setter = StoreSetter; export const createFileChunkSlice = (set: Setter, get: () => FileStore, _api?: unknown) => diff --git a/src/store/file/slices/chunk/initialState.ts b/src/store/file/slices/chunk/initialState.ts index e66cfb3a5a..9f6fae4d10 100644 --- a/src/store/file/slices/chunk/initialState.ts +++ b/src/store/file/slices/chunk/initialState.ts @@ -1,4 +1,4 @@ -import type {SemanticSearchChunk} from '@/types/chunk'; +import { type SemanticSearchChunk } from '@/types/chunk'; export interface FileChunkState { chunkDetailId: string | null; diff --git a/src/store/file/slices/chunk/selectors.ts b/src/store/file/slices/chunk/selectors.ts index aa8ce45cc9..9bba6fdf2a 100644 --- a/src/store/file/slices/chunk/selectors.ts +++ b/src/store/file/slices/chunk/selectors.ts @@ -1,4 +1,4 @@ -import type {FilesStoreState} from '@/store/file/initialState'; +import { type FilesStoreState } from '@/store/file/initialState'; const showSimilaritySearchResult = (s: FilesStoreState) => s.isSimilaritySearch; const enabledChunkFileId = (s: FilesStoreState) => s.chunkDetailId; diff --git a/src/store/file/slices/document/action.ts b/src/store/file/slices/document/action.ts index 11ce580691..138aedfcb2 100644 --- a/src/store/file/slices/document/action.ts +++ b/src/store/file/slices/document/action.ts @@ -1,16 +1,16 @@ import { createNanoId } from '@lobechat/utils'; -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; import { useClientDataSWRWithSync } from '@/libs/swr'; import { documentService } from '@/services/document'; import { useGlobalStore } from '@/store/global'; -import type {StoreSetter} from '@/store/types'; -import type {LobeDocument} from '@/types/document'; -import { DocumentSourceType } from '@/types/document'; +import { type StoreSetter } from '@/store/types'; +import { type LobeDocument } from '@/types/document'; +import { DocumentSourceType } from '@/types/document'; import { setNamespace } from '@/utils/storeDebug'; -import type {FileStore} from '../../store'; -import type {DocumentQueryFilter} from './initialState'; +import { type FileStore } from '../../store'; +import { type DocumentQueryFilter } from './initialState'; const n = setNamespace('document'); diff --git a/src/store/file/slices/document/initialState.ts b/src/store/file/slices/document/initialState.ts index 7898d45431..cfac42bdf4 100644 --- a/src/store/file/slices/document/initialState.ts +++ b/src/store/file/slices/document/initialState.ts @@ -1,4 +1,4 @@ -import type {LobeDocument} from '@/types/document'; +import { type LobeDocument } from '@/types/document'; export interface DocumentQueryFilter { fileTypes?: string[]; diff --git a/src/store/file/slices/document/selectors.ts b/src/store/file/slices/document/selectors.ts index 73d779d159..f46c32eb8c 100644 --- a/src/store/file/slices/document/selectors.ts +++ b/src/store/file/slices/document/selectors.ts @@ -1,6 +1,6 @@ -import type {LobeDocument} from '@/types/document'; +import { type LobeDocument } from '@/types/document'; -import type {FilesStoreState} from '../../initialState'; +import { type FilesStoreState } from '../../initialState'; const getDocumentById = (documentId: string | undefined) => (s: FilesStoreState) => { if (!documentId) return undefined; diff --git a/src/store/file/slices/fileManager/action.test.ts b/src/store/file/slices/fileManager/action.test.ts index 1e08c67b40..c894793d30 100644 --- a/src/store/file/slices/fileManager/action.test.ts +++ b/src/store/file/slices/fileManager/action.test.ts @@ -6,8 +6,8 @@ import { mutate } from '@/libs/swr'; import { lambdaClient } from '@/libs/trpc/client'; import { fileService } from '@/services/file'; import { ragService } from '@/services/rag'; -import type { FileListItem } from '@/types/files'; -import type { UploadFileItem } from '@/types/files/upload'; +import { type FileListItem } from '@/types/files'; +import { type UploadFileItem } from '@/types/files/upload'; import { unzipFile } from '@/utils/unzipFile'; import { withSWR } from '~test-utils'; diff --git a/src/store/file/slices/fileManager/action.ts b/src/store/file/slices/fileManager/action.ts index 2747091251..dec69b85d8 100644 --- a/src/store/file/slices/fileManager/action.ts +++ b/src/store/file/slices/fileManager/action.ts @@ -6,7 +6,7 @@ import { } from '@lobechat/utils'; import { t } from 'i18next'; import pMap from 'p-map'; -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; import { message } from '@/components/AntdStaticMethods'; import { FILE_UPLOAD_BLACKLIST, MAX_UPLOAD_FILE_COUNT } from '@/const/file'; @@ -14,16 +14,14 @@ import { mutate, useClientDataSWR } from '@/libs/swr'; import { documentService } from '@/services/document'; import { FileService, fileService } from '@/services/file'; import { ragService } from '@/services/rag'; -import type {UploadFileListDispatch} from '@/store/file/reducers/uploadFileList'; -import { - uploadFileListReducer -} from '@/store/file/reducers/uploadFileList'; -import type {StoreSetter} from '@/store/types'; -import type {FileListItem, QueryFileListParams} from '@/types/files'; +import { type UploadFileListDispatch } from '@/store/file/reducers/uploadFileList'; +import { uploadFileListReducer } from '@/store/file/reducers/uploadFileList'; +import { type StoreSetter } from '@/store/types'; +import { type FileListItem, type QueryFileListParams } from '@/types/files'; import { isChunkingUnsupported } from '@/utils/isChunkingUnsupported'; import { unzipFile } from '@/utils/unzipFile'; -import type {FileStore} from '../../store'; +import { type FileStore } from '../../store'; import { fileManagerSelectors } from './selectors'; const serverFileService = new FileService(); diff --git a/src/store/file/slices/fileManager/initialState.ts b/src/store/file/slices/fileManager/initialState.ts index bdc0e8856b..a8b62cd3f7 100644 --- a/src/store/file/slices/fileManager/initialState.ts +++ b/src/store/file/slices/fileManager/initialState.ts @@ -1,5 +1,5 @@ -import type {FileListItem, QueryFileListParams} from '@/types/files'; -import type {UploadFileItem} from '@/types/files/upload'; +import { type FileListItem, type QueryFileListParams } from '@/types/files'; +import { type UploadFileItem } from '@/types/files/upload'; export interface FileManagerState { creatingChunkingTaskIds: string[]; diff --git a/src/store/file/slices/fileManager/selectors.ts b/src/store/file/slices/fileManager/selectors.ts index 96e7be9e84..76a2f2a0a1 100644 --- a/src/store/file/slices/fileManager/selectors.ts +++ b/src/store/file/slices/fileManager/selectors.ts @@ -1,5 +1,5 @@ -import type {FilesStoreState} from '@/store/file/initialState'; -import type {FileUploadStatus} from '@/types/files/upload'; +import { type FilesStoreState } from '@/store/file/initialState'; +import { type FileUploadStatus } from '@/types/files/upload'; const uploadStatusArray = new Set(['uploading', 'pending', 'processing']); diff --git a/src/store/file/slices/resource/action.ts b/src/store/file/slices/resource/action.ts index cc7f375213..a0215880cc 100644 --- a/src/store/file/slices/resource/action.ts +++ b/src/store/file/slices/resource/action.ts @@ -3,11 +3,15 @@ import debug from 'debug'; import { documentService } from '@/services/document'; import { fileService } from '@/services/file'; import { resourceService } from '@/services/resource'; -import type {StoreSetter} from '@/store/types'; -import type { CreateResourceParams, ResourceItem, UpdateResourceParams } from '@/types/resource'; +import { type StoreSetter } from '@/store/types'; +import { + type CreateResourceParams, + type ResourceItem, + type UpdateResourceParams, +} from '@/types/resource'; -import type { FileStore } from '../../store'; -import type {ResourceState} from './initialState'; +import { type FileStore } from '../../store'; +import { type ResourceState } from './initialState'; import { initialResourceState } from './initialState'; import { ResourceSyncEngine } from './syncEngine'; diff --git a/src/store/file/slices/resource/hooks.ts b/src/store/file/slices/resource/hooks.ts index 08fb3fb324..840413e264 100644 --- a/src/store/file/slices/resource/hooks.ts +++ b/src/store/file/slices/resource/hooks.ts @@ -3,7 +3,7 @@ import { shallow } from 'zustand/shallow'; import { mutate, useClientDataSWR } from '@/libs/swr'; import { resourceService } from '@/services/resource'; -import type { ResourceQueryParams } from '@/types/resource'; +import { type ResourceQueryParams } from '@/types/resource'; import { useFileStore } from '../../store'; diff --git a/src/store/file/slices/resource/initialState.ts b/src/store/file/slices/resource/initialState.ts index 7193b580ef..9a3d19ca07 100644 --- a/src/store/file/slices/resource/initialState.ts +++ b/src/store/file/slices/resource/initialState.ts @@ -1,4 +1,4 @@ -import type { ResourceItem, ResourceQueryParams, SyncOperation } from '@/types/resource'; +import { type ResourceItem, type ResourceQueryParams, type SyncOperation } from '@/types/resource'; /** * Resource slice state diff --git a/src/store/file/slices/resource/syncEngine.ts b/src/store/file/slices/resource/syncEngine.ts index 051b845667..1659393ae6 100644 --- a/src/store/file/slices/resource/syncEngine.ts +++ b/src/store/file/slices/resource/syncEngine.ts @@ -1,9 +1,9 @@ import { debounce } from 'es-toolkit'; -import type { DebouncedFunc } from 'es-toolkit/compat'; +import { type DebouncedFunc } from 'es-toolkit/compat'; import pMap from 'p-map'; import { resourceService } from '@/services/resource'; -import type { ResourceItem, SyncOperation } from '@/types/resource'; +import { type ResourceItem, type SyncOperation } from '@/types/resource'; /** * Sync configuration diff --git a/src/store/file/slices/tts/action.ts b/src/store/file/slices/tts/action.ts index e683abf859..ff81165648 100644 --- a/src/store/file/slices/tts/action.ts +++ b/src/store/file/slices/tts/action.ts @@ -1,11 +1,11 @@ -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import { useClientDataSWR } from '@/libs/swr'; import { fileService } from '@/services/file'; -import type {StoreSetter} from '@/store/types'; -import type {FileItem} from '@/types/files'; +import { type StoreSetter } from '@/store/types'; +import { type FileItem } from '@/types/files'; -import type {FileStore} from '../../store'; +import { type FileStore } from '../../store'; const FETCH_TTS_FILE = 'fetchTTSFile'; diff --git a/src/store/file/slices/upload/action.ts b/src/store/file/slices/upload/action.ts index f11ef4a633..7e8c2de055 100644 --- a/src/store/file/slices/upload/action.ts +++ b/src/store/file/slices/upload/action.ts @@ -5,11 +5,11 @@ import { sha256 } from 'js-sha256'; import { message, notification } from '@/components/AntdStaticMethods'; import { fileService } from '@/services/file'; import { uploadService } from '@/services/upload'; -import type {StoreSetter} from '@/store/types'; -import type {FileMetadata, UploadFileItem} from '@/types/files'; +import { type StoreSetter } from '@/store/types'; +import { type FileMetadata, type UploadFileItem } from '@/types/files'; import { getImageDimensions } from '@/utils/client/imageDimensions'; -import type {FileStore} from '../../store'; +import { type FileStore } from '../../store'; type OnStatusUpdate = ( data: diff --git a/src/store/file/store.ts b/src/store/file/store.ts index 67cdd3e0e3..f42ce547cb 100644 --- a/src/store/file/store.ts +++ b/src/store/file/store.ts @@ -1,25 +1,25 @@ import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {FilesStoreState} from './initialState'; -import { initialState } from './initialState'; -import type {FileAction} from './slices/chat'; +import { type FilesStoreState } from './initialState'; +import { initialState } from './initialState'; +import { type FileAction } from './slices/chat'; import { createFileSlice } from './slices/chat'; -import type {FileChunkAction} from './slices/chunk'; +import { type FileChunkAction } from './slices/chunk'; import { createFileChunkSlice } from './slices/chunk'; -import type {DocumentAction} from './slices/document'; +import { type DocumentAction } from './slices/document'; import { createDocumentSlice } from './slices/document'; -import type {FileManageAction} from './slices/fileManager'; +import { type FileManageAction } from './slices/fileManager'; import { createFileManageSlice } from './slices/fileManager'; -import type {ResourceAction} from './slices/resource/action'; +import { type ResourceAction } from './slices/resource/action'; import { createResourceSlice } from './slices/resource/action'; -import type {ResourceState} from './slices/resource/initialState'; -import type {TTSFileAction} from './slices/tts'; +import { type ResourceState } from './slices/resource/initialState'; +import { type TTSFileAction } from './slices/tts'; import { createTTSFileSlice } from './slices/tts'; -import type {FileUploadAction} from './slices/upload/action'; +import { type FileUploadAction } from './slices/upload/action'; import { createFileUploadSlice } from './slices/upload/action'; // =============== Aggregate createStoreFn ============ // diff --git a/src/store/global/actions/general.ts b/src/store/global/actions/general.ts index 65850bea46..e841a0a88b 100644 --- a/src/store/global/actions/general.ts +++ b/src/store/global/actions/general.ts @@ -1,20 +1,20 @@ import isEqual from 'fast-deep-equal'; import { gt, parse, valid } from 'semver'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import { CURRENT_VERSION, isDesktop } from '@/const/version'; import { useOnlyFetchOnceSWR } from '@/libs/swr'; import { globalService } from '@/services/global'; import { getElectronStoreState } from '@/store/electron'; import { electronSyncSelectors } from '@/store/electron/selectors'; -import type { SystemStatus } from '@/store/global/initialState'; -import type {StoreSetter} from '@/store/types'; -import type {LocaleMode} from '@/types/locale'; +import { type SystemStatus } from '@/store/global/initialState'; +import { type StoreSetter } from '@/store/types'; +import { type LocaleMode } from '@/types/locale'; import { switchLang } from '@/utils/client/switchLang'; import { merge } from '@/utils/merge'; import { setNamespace } from '@/utils/storeDebug'; -import type { GlobalStore } from '../store'; +import { type GlobalStore } from '../store'; const n = setNamespace('g'); diff --git a/src/store/global/actions/workspacePane.ts b/src/store/global/actions/workspacePane.ts index 97339f9f58..29910cd971 100644 --- a/src/store/global/actions/workspacePane.ts +++ b/src/store/global/actions/workspacePane.ts @@ -2,8 +2,8 @@ import { produce } from 'immer'; import { INBOX_SESSION_ID } from '@/const/session'; import { SESSION_CHAT_URL } from '@/const/url'; -import type { GlobalStore } from '@/store/global'; -import type {StoreSetter} from '@/store/types'; +import { type GlobalStore } from '@/store/global'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; const n = setNamespace('w'); diff --git a/src/store/global/initialState.ts b/src/store/global/initialState.ts index b61e082506..e40733777c 100644 --- a/src/store/global/initialState.ts +++ b/src/store/global/initialState.ts @@ -1,8 +1,8 @@ -import type { NavigateFunction } from 'react-router-dom'; +import { type NavigateFunction } from 'react-router-dom'; -import type {MigrationSQL, MigrationTableItem} from '@/types/clientDB'; -import { DatabaseLoadingState } from '@/types/clientDB'; -import type {LocaleMode} from '@/types/locale'; +import { type MigrationSQL, type MigrationTableItem } from '@/types/clientDB'; +import { DatabaseLoadingState } from '@/types/clientDB'; +import { type LocaleMode } from '@/types/locale'; import { SessionDefaultGroup } from '@/types/session'; import { AsyncLocalStorage } from '@/utils/localStorage'; diff --git a/src/store/global/selectors/clientDB.ts b/src/store/global/selectors/clientDB.ts index ff14fb15df..b95019740a 100644 --- a/src/store/global/selectors/clientDB.ts +++ b/src/store/global/selectors/clientDB.ts @@ -1,4 +1,4 @@ -import type {GlobalState} from '@/store/global/initialState'; +import { type GlobalState } from '@/store/global/initialState'; const initClientDBMigrationSqls = (s: GlobalState) => { return s.initClientDBMigrations?.sqls || []; diff --git a/src/store/global/selectors/general.test.ts b/src/store/global/selectors/general.test.ts index ce35f1b63a..36c5e3e585 100644 --- a/src/store/global/selectors/general.test.ts +++ b/src/store/global/selectors/general.test.ts @@ -1,4 +1,4 @@ -import type { GlobalState} from '@/store/global/initialState'; +import { type GlobalState } from '@/store/global/initialState'; import { initialState } from '@/store/global/initialState'; import { merge } from '@/utils/merge'; diff --git a/src/store/global/selectors/general.ts b/src/store/global/selectors/general.ts index c8c12173d4..d1c10078d0 100644 --- a/src/store/global/selectors/general.ts +++ b/src/store/global/selectors/general.ts @@ -1,8 +1,8 @@ import { DEFAULT_LANG } from '@/const/locale'; -import type {Locales} from '@/locales/resources'; +import { type Locales } from '@/locales/resources'; import { isOnServerSide } from '@/utils/env'; -import type {GlobalState} from '../initialState'; +import { type GlobalState } from '../initialState'; import { systemStatus } from './systemStatus'; const language = (s: GlobalState) => systemStatus(s).language || 'auto'; diff --git a/src/store/global/selectors/systemStatus.test.ts b/src/store/global/selectors/systemStatus.test.ts index bc2624b984..69431e6ea7 100644 --- a/src/store/global/selectors/systemStatus.test.ts +++ b/src/store/global/selectors/systemStatus.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it, vi } from 'vitest'; import { merge } from '@/utils/merge'; -import type { GlobalState} from '../initialState'; +import { type GlobalState } from '../initialState'; import { INITIAL_STATUS, initialState } from '../initialState'; import { systemStatusSelectors } from './systemStatus'; diff --git a/src/store/global/selectors/systemStatus.ts b/src/store/global/selectors/systemStatus.ts index 1d2e0105bc..4a2d97031d 100644 --- a/src/store/global/selectors/systemStatus.ts +++ b/src/store/global/selectors/systemStatus.ts @@ -1,5 +1,5 @@ -import type {GlobalState} from '../initialState'; -import { INITIAL_STATUS } from '../initialState'; +import { type GlobalState } from '../initialState'; +import { INITIAL_STATUS } from '../initialState'; export const systemStatus = (s: GlobalState) => s.status; diff --git a/src/store/global/store.ts b/src/store/global/store.ts index 9ac1c09bc4..799e4f47a7 100644 --- a/src/store/global/store.ts +++ b/src/store/global/store.ts @@ -1,16 +1,16 @@ import { subscribeWithSelector } from 'zustand/middleware'; import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {GlobalGeneralAction} from './actions/general'; +import { type GlobalGeneralAction } from './actions/general'; import { generalActionSlice } from './actions/general'; -import type {GlobalWorkspacePaneAction} from './actions/workspacePane'; -import { globalWorkspaceSlice } from './actions/workspacePane'; -import type {GlobalState} from './initialState'; -import { initialState } from './initialState'; +import { type GlobalWorkspacePaneAction } from './actions/workspacePane'; +import { globalWorkspaceSlice } from './actions/workspacePane'; +import { type GlobalState } from './initialState'; +import { initialState } from './initialState'; // =============== Aggregate createStoreFn ============ // diff --git a/src/store/groupProfile/action.ts b/src/store/groupProfile/action.ts index ca56f3e383..f314cc74ed 100644 --- a/src/store/groupProfile/action.ts +++ b/src/store/groupProfile/action.ts @@ -1,11 +1,11 @@ import { debounce } from 'es-toolkit/compat'; -import type {StateCreator} from 'zustand'; +import { type StateCreator } from 'zustand'; import { EDITOR_DEBOUNCE_TIME, EDITOR_MAX_WAIT } from '@/const/index'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; -import type {SaveState, SaveStatus, State} from './initialState'; -import { initialState } from './initialState'; +import { type SaveState, type SaveStatus, type State } from './initialState'; +import { initialState } from './initialState'; type SaveContentPayload = { content: string; diff --git a/src/store/groupProfile/index.ts b/src/store/groupProfile/index.ts index 8db7ca4896..7898280a3b 100644 --- a/src/store/groupProfile/index.ts +++ b/src/store/groupProfile/index.ts @@ -5,8 +5,8 @@ import { createWithEqualityFn } from 'zustand/traditional'; import { createDevtools } from '@/store/middleware/createDevtools'; -import type {Store} from './action'; -import { store } from './action'; +import { type Store } from './action'; +import { store } from './action'; export type { PublicState, State } from './initialState'; diff --git a/src/store/groupProfile/initialState.ts b/src/store/groupProfile/initialState.ts index a27ad9a304..0ceb2b3376 100644 --- a/src/store/groupProfile/initialState.ts +++ b/src/store/groupProfile/initialState.ts @@ -1,4 +1,4 @@ -import type {IEditor} from '@lobehub/editor'; +import { type IEditor } from '@lobehub/editor'; export type SaveStatus = 'idle' | 'saving' | 'saved'; @@ -7,7 +7,6 @@ export interface SaveState { saveStatus: SaveStatus; } - export interface PublicState {} export interface State extends PublicState { diff --git a/src/store/groupProfile/selectors.ts b/src/store/groupProfile/selectors.ts index 2128db7a29..18bbdd6788 100644 --- a/src/store/groupProfile/selectors.ts +++ b/src/store/groupProfile/selectors.ts @@ -1,5 +1,5 @@ -import type {Store} from './action'; -import type {SaveState} from './initialState'; +import { type Store } from './action'; +import { type SaveState } from './initialState'; const DEFAULT_SAVE_STATE: SaveState = { lastUpdatedTime: null, saveStatus: 'idle' }; diff --git a/src/store/home/initialState.ts b/src/store/home/initialState.ts index 176a2715fe..dc34ef7980 100644 --- a/src/store/home/initialState.ts +++ b/src/store/home/initialState.ts @@ -1,10 +1,10 @@ -import type {AgentListState} from './slices/agentList/initialState'; -import { initialAgentListState } from './slices/agentList/initialState'; -import type {HomeInputState} from './slices/homeInput/initialState'; -import { initialHomeInputState } from './slices/homeInput/initialState'; -import type {RecentState} from './slices/recent/initialState'; +import { type AgentListState } from './slices/agentList/initialState'; +import { initialAgentListState } from './slices/agentList/initialState'; +import { type HomeInputState } from './slices/homeInput/initialState'; +import { initialHomeInputState } from './slices/homeInput/initialState'; +import { type RecentState } from './slices/recent/initialState'; import { initialRecentState } from './slices/recent/initialState'; -import type {SidebarUIState} from './slices/sidebarUI/initialState'; +import { type SidebarUIState } from './slices/sidebarUI/initialState'; import { initialSidebarUIState } from './slices/sidebarUI/initialState'; export interface HomeStoreState diff --git a/src/store/home/slices/agentList/action.ts b/src/store/home/slices/agentList/action.ts index 05a82c1804..c4765f30ff 100644 --- a/src/store/home/slices/agentList/action.ts +++ b/src/store/home/slices/agentList/action.ts @@ -1,11 +1,11 @@ import isEqual from 'fast-deep-equal'; -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; -import type { SidebarAgentItem, SidebarAgentListResponse } from '@/database/repositories/home'; +import { type SidebarAgentItem, type SidebarAgentListResponse } from '@/database/repositories/home'; import { mutate, useClientDataSWR, useClientDataSWRWithSync } from '@/libs/swr'; import { homeService } from '@/services/home'; -import type { HomeStore } from '@/store/home/store'; -import type {StoreSetter} from '@/store/types'; +import { type HomeStore } from '@/store/home/store'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; import { mapResponseToState } from './initialState'; diff --git a/src/store/home/slices/agentList/initialState.ts b/src/store/home/slices/agentList/initialState.ts index b9f55f91f2..5df2831838 100644 --- a/src/store/home/slices/agentList/initialState.ts +++ b/src/store/home/slices/agentList/initialState.ts @@ -1,7 +1,7 @@ -import type { - SidebarAgentItem, - SidebarAgentListResponse, - SidebarGroup, +import { + type SidebarAgentItem, + type SidebarAgentListResponse, + type SidebarGroup, } from '@/database/repositories/home'; export interface AgentListState { diff --git a/src/store/home/slices/agentList/selectors.ts b/src/store/home/slices/agentList/selectors.ts index 0ae630673a..68c74590aa 100644 --- a/src/store/home/slices/agentList/selectors.ts +++ b/src/store/home/slices/agentList/selectors.ts @@ -1,5 +1,5 @@ -import type { SidebarAgentItem, SidebarGroup } from '@/database/repositories/home'; -import type { HomeStore } from '@/store/home/store'; +import { type SidebarAgentItem, type SidebarGroup } from '@/database/repositories/home'; +import { type HomeStore } from '@/store/home/store'; /** * Get all pinned agents diff --git a/src/store/home/slices/group/action.ts b/src/store/home/slices/group/action.ts index 5fc160b2dd..f70b08ed31 100644 --- a/src/store/home/slices/group/action.ts +++ b/src/store/home/slices/group/action.ts @@ -1,5 +1,5 @@ -import type { HomeStore } from '@/store/home/store'; -import type {StoreSetter} from '@/store/types'; +import { type HomeStore } from '@/store/home/store'; +import { type StoreSetter } from '@/store/types'; type Setter = StoreSetter; export const createGroupSlice = (set: Setter, get: () => HomeStore, _api?: unknown) => diff --git a/src/store/home/slices/homeInput/action.ts b/src/store/home/slices/homeInput/action.ts index 683ba42640..34d7502b63 100644 --- a/src/store/home/slices/homeInput/action.ts +++ b/src/store/home/slices/homeInput/action.ts @@ -1,4 +1,4 @@ -import type { NavigateFunction } from 'react-router-dom'; +import { type NavigateFunction } from 'react-router-dom'; import { chatGroupService } from '@/services/chatGroup'; import { documentService } from '@/services/document'; @@ -6,11 +6,11 @@ import { getAgentStoreState } from '@/store/agent'; import { agentSelectors, builtinAgentSelectors } from '@/store/agent/selectors'; import { getChatGroupStoreState } from '@/store/agentGroup'; import { useChatStore } from '@/store/chat'; -import type { HomeStore } from '@/store/home/store'; -import type {StoreSetter} from '@/store/types'; +import { type HomeStore } from '@/store/home/store'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; -import type { StarterMode } from './initialState'; +import { type StarterMode } from './initialState'; const n = setNamespace('homeInput'); diff --git a/src/store/home/slices/homeInput/initialState.ts b/src/store/home/slices/homeInput/initialState.ts index fe5156f760..c2abae89cd 100644 --- a/src/store/home/slices/homeInput/initialState.ts +++ b/src/store/home/slices/homeInput/initialState.ts @@ -1,4 +1,4 @@ -import type { NavigateFunction } from 'react-router-dom'; +import { type NavigateFunction } from 'react-router-dom'; export type StarterMode = 'agent' | 'group' | 'write' | 'research' | null; diff --git a/src/store/home/slices/recent/action.ts b/src/store/home/slices/recent/action.ts index 3b2ab001a4..5ccf3d3f4d 100644 --- a/src/store/home/slices/recent/action.ts +++ b/src/store/home/slices/recent/action.ts @@ -1,13 +1,13 @@ import isEqual from 'fast-deep-equal'; -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; import { useClientDataSWRWithSync } from '@/libs/swr'; import { fileService } from '@/services/file'; import { topicService } from '@/services/topic'; -import type { HomeStore } from '@/store/home/store'; -import type {StoreSetter} from '@/store/types'; -import type { FileListItem } from '@/types/files'; -import type { RecentTopic } from '@/types/topic'; +import { type HomeStore } from '@/store/home/store'; +import { type StoreSetter } from '@/store/types'; +import { type FileListItem } from '@/types/files'; +import { type RecentTopic } from '@/types/topic'; import { setNamespace } from '@/utils/storeDebug'; const n = setNamespace('recent'); diff --git a/src/store/home/slices/recent/initialState.ts b/src/store/home/slices/recent/initialState.ts index 8410ddbe78..d8a5917cd6 100644 --- a/src/store/home/slices/recent/initialState.ts +++ b/src/store/home/slices/recent/initialState.ts @@ -1,5 +1,5 @@ -import type { FileListItem } from '@/types/files'; -import type { RecentTopic } from '@/types/topic'; +import { type FileListItem } from '@/types/files'; +import { type RecentTopic } from '@/types/topic'; export interface RecentState { isRecentPagesInit: boolean; diff --git a/src/store/home/slices/recent/selectors.ts b/src/store/home/slices/recent/selectors.ts index c91e734da8..94305a2a54 100644 --- a/src/store/home/slices/recent/selectors.ts +++ b/src/store/home/slices/recent/selectors.ts @@ -1,4 +1,4 @@ -import type { HomeStore } from '@/store/home/store'; +import { type HomeStore } from '@/store/home/store'; const recentTopics = (s: HomeStore) => s.recentTopics; const recentResources = (s: HomeStore) => s.recentResources; diff --git a/src/store/home/slices/sidebarUI/action.ts b/src/store/home/slices/sidebarUI/action.ts index 562ab70ab4..f35fabe2cf 100644 --- a/src/store/home/slices/sidebarUI/action.ts +++ b/src/store/home/slices/sidebarUI/action.ts @@ -7,9 +7,9 @@ import { chatGroupService } from '@/services/chatGroup'; import { homeService } from '@/services/home'; import { sessionService } from '@/services/session'; import { getAgentStoreState } from '@/store/agent'; -import type { HomeStore } from '@/store/home/store'; -import type {StoreSetter} from '@/store/types'; -import type {SessionGroupItem} from '@/types/session'; +import { type HomeStore } from '@/store/home/store'; +import { type StoreSetter } from '@/store/types'; +import { type SessionGroupItem } from '@/types/session'; import { setNamespace } from '@/utils/storeDebug'; const n = setNamespace('sidebarUI'); diff --git a/src/store/home/store.ts b/src/store/home/store.ts index ab0b79e657..4748a7db88 100644 --- a/src/store/home/store.ts +++ b/src/store/home/store.ts @@ -1,23 +1,23 @@ import { subscribeWithSelector } from 'zustand/middleware'; import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type { StateCreator } from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { isDev } from '@/utils/env'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {HomeStoreState} from './initialState'; -import { initialState } from './initialState'; -import type {AgentListAction} from './slices/agentList/action'; -import { createAgentListSlice } from './slices/agentList/action'; -import type {GroupAction} from './slices/group/action'; +import { type HomeStoreState } from './initialState'; +import { initialState } from './initialState'; +import { type AgentListAction } from './slices/agentList/action'; +import { createAgentListSlice } from './slices/agentList/action'; +import { type GroupAction } from './slices/group/action'; import { createGroupSlice } from './slices/group/action'; -import type {HomeInputAction} from './slices/homeInput/action'; +import { type HomeInputAction } from './slices/homeInput/action'; import { createHomeInputSlice } from './slices/homeInput/action'; -import type {RecentAction} from './slices/recent/action'; +import { type RecentAction } from './slices/recent/action'; import { createRecentSlice } from './slices/recent/action'; -import type {SidebarUIAction} from './slices/sidebarUI/action'; +import { type SidebarUIAction } from './slices/sidebarUI/action'; import { createSidebarUISlice } from './slices/sidebarUI/action'; // =============== Aggregate createStoreFn ============ // diff --git a/src/store/image/initialState.ts b/src/store/image/initialState.ts index 3c19128e8a..8c72e4b842 100644 --- a/src/store/image/initialState.ts +++ b/src/store/image/initialState.ts @@ -1,17 +1,11 @@ -import type {CreateImageState} from './slices/createImage/initialState'; -import { initialCreateImageState } from './slices/createImage/initialState'; -import type {GenerationBatchState} from './slices/generationBatch/initialState'; -import { - initialGenerationBatchState -} from './slices/generationBatch/initialState'; -import type {GenerationConfigState} from './slices/generationConfig/initialState'; -import { - initialGenerationConfigState -} from './slices/generationConfig/initialState'; -import type {GenerationTopicState} from './slices/generationTopic/initialState'; -import { - initialGenerationTopicState -} from './slices/generationTopic/initialState'; +import { type CreateImageState } from './slices/createImage/initialState'; +import { initialCreateImageState } from './slices/createImage/initialState'; +import { type GenerationBatchState } from './slices/generationBatch/initialState'; +import { initialGenerationBatchState } from './slices/generationBatch/initialState'; +import { type GenerationConfigState } from './slices/generationConfig/initialState'; +import { initialGenerationConfigState } from './slices/generationConfig/initialState'; +import { type GenerationTopicState } from './slices/generationTopic/initialState'; +import { initialGenerationTopicState } from './slices/generationTopic/initialState'; export type ImageStoreState = GenerationConfigState & GenerationTopicState & diff --git a/src/store/image/slices/createImage/action.ts b/src/store/image/slices/createImage/action.ts index fe2666d29a..47182ed0f8 100644 --- a/src/store/image/slices/createImage/action.ts +++ b/src/store/image/slices/createImage/action.ts @@ -2,9 +2,9 @@ import { ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const'; import { markUserValidAction } from '@/business/client/markUserValidAction'; import { imageService } from '@/services/image'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; -import type {ImageStore} from '../../store'; +import { type ImageStore } from '../../store'; import { generationBatchSelectors } from '../generationBatch/selectors'; import { imageGenerationConfigSelectors } from '../generationConfig/selectors'; import { generationTopicSelectors } from '../generationTopic'; diff --git a/src/store/image/slices/createImage/selectors.test.ts b/src/store/image/slices/createImage/selectors.test.ts index 896491078d..0283ef8471 100644 --- a/src/store/image/slices/createImage/selectors.test.ts +++ b/src/store/image/slices/createImage/selectors.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest'; import { merge } from '@/utils/merge'; -import type { ImageStore } from '../../store'; +import { type ImageStore } from '../../store'; import { initialCreateImageState } from './initialState'; import { createImageSelectors } from './selectors'; diff --git a/src/store/image/slices/createImage/selectors.ts b/src/store/image/slices/createImage/selectors.ts index 621e392573..6f4abc3663 100644 --- a/src/store/image/slices/createImage/selectors.ts +++ b/src/store/image/slices/createImage/selectors.ts @@ -1,4 +1,4 @@ -import type {ImageStore} from '../../store'; +import { type ImageStore } from '../../store'; const isCreating = (state: ImageStore) => state.isCreating; const isCreatingWithNewTopic = (state: ImageStore) => state.isCreatingWithNewTopic; diff --git a/src/store/image/slices/generationBatch/action.test.ts b/src/store/image/slices/generationBatch/action.test.ts index 579ef5a47f..365f29b7a4 100644 --- a/src/store/image/slices/generationBatch/action.test.ts +++ b/src/store/image/slices/generationBatch/action.test.ts @@ -8,7 +8,7 @@ import { generationBatchService } from '@/services/generationBatch'; import { useImageStore } from '@/store/image'; import { generationBatchSelectors } from '@/store/image/slices/generationBatch/selectors'; import { AsyncTaskStatus } from '@/types/asyncTask'; -import type { GenerationBatch } from '@/types/generation'; +import { type GenerationBatch } from '@/types/generation'; // Mock services and dependencies vi.mock('@/services/generation', () => ({ diff --git a/src/store/image/slices/generationBatch/action.ts b/src/store/image/slices/generationBatch/action.ts index 38fa0002a6..b8ecb77678 100644 --- a/src/store/image/slices/generationBatch/action.ts +++ b/src/store/image/slices/generationBatch/action.ts @@ -1,20 +1,20 @@ import { isEqual } from 'es-toolkit/compat'; import { useRef } from 'react'; -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; import { mutate, useClientDataSWR } from '@/libs/swr'; -import type {GetGenerationStatusResult} from '@/server/routers/lambda/generation'; +import { type GetGenerationStatusResult } from '@/server/routers/lambda/generation'; import { generationService } from '@/services/generation'; import { generationBatchService } from '@/services/generationBatch'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { AsyncTaskStatus } from '@/types/asyncTask'; -import type {GenerationBatch} from '@/types/generation'; +import { type GenerationBatch } from '@/types/generation'; import { setNamespace } from '@/utils/storeDebug'; -import type {ImageStore} from '../../store'; +import { type ImageStore } from '../../store'; import { generationTopicSelectors } from '../generationTopic/selectors'; -import type {GenerationBatchDispatch} from './reducer'; -import { generationBatchReducer } from './reducer'; +import { type GenerationBatchDispatch } from './reducer'; +import { generationBatchReducer } from './reducer'; const n = setNamespace('generationBatch'); diff --git a/src/store/image/slices/generationBatch/initialState.ts b/src/store/image/slices/generationBatch/initialState.ts index 2158c89d83..1a50e516db 100644 --- a/src/store/image/slices/generationBatch/initialState.ts +++ b/src/store/image/slices/generationBatch/initialState.ts @@ -1,4 +1,4 @@ -import type {GenerationBatch} from '@/types/generation'; +import { type GenerationBatch } from '@/types/generation'; export interface GenerationBatchState { /** diff --git a/src/store/image/slices/generationBatch/reducer.test.ts b/src/store/image/slices/generationBatch/reducer.test.ts index 4f648fff61..1b5d3ac091 100644 --- a/src/store/image/slices/generationBatch/reducer.test.ts +++ b/src/store/image/slices/generationBatch/reducer.test.ts @@ -1,7 +1,7 @@ import { AsyncTaskStatus } from '@/types/asyncTask'; -import type { Generation, GenerationBatch } from '@/types/generation'; +import { type Generation, type GenerationBatch } from '@/types/generation'; -import type { GenerationBatchDispatch} from './reducer'; +import { type GenerationBatchDispatch } from './reducer'; import { generationBatchReducer } from './reducer'; // Test data factory functions diff --git a/src/store/image/slices/generationBatch/reducer.ts b/src/store/image/slices/generationBatch/reducer.ts index 26bd563c09..79b1583111 100644 --- a/src/store/image/slices/generationBatch/reducer.ts +++ b/src/store/image/slices/generationBatch/reducer.ts @@ -1,6 +1,6 @@ import { produce } from 'immer'; -import type {Generation, GenerationBatch} from '@/types/generation'; +import { type Generation, type GenerationBatch } from '@/types/generation'; type UpdateGenerationInBatchAction = { batchId: string; diff --git a/src/store/image/slices/generationBatch/selectors.test.ts b/src/store/image/slices/generationBatch/selectors.test.ts index 21d72ef0ae..37f306f739 100644 --- a/src/store/image/slices/generationBatch/selectors.test.ts +++ b/src/store/image/slices/generationBatch/selectors.test.ts @@ -1,9 +1,9 @@ import { describe, expect, it } from 'vitest'; -import type { ImageStore } from '@/store/image'; +import { type ImageStore } from '@/store/image'; import { initialState } from '@/store/image/initialState'; import { AsyncTaskStatus } from '@/types/asyncTask'; -import type { Generation, GenerationBatch } from '@/types/generation'; +import { type Generation, type GenerationBatch } from '@/types/generation'; import { merge } from '@/utils/merge'; import { generationBatchSelectors } from './selectors'; diff --git a/src/store/image/slices/generationBatch/selectors.ts b/src/store/image/slices/generationBatch/selectors.ts index 6e8e0c9b28..1191521741 100644 --- a/src/store/image/slices/generationBatch/selectors.ts +++ b/src/store/image/slices/generationBatch/selectors.ts @@ -1,6 +1,6 @@ -import type {GenerationBatch} from '@/types/generation'; +import { type GenerationBatch } from '@/types/generation'; -import type {ImageStoreState} from '../../initialState'; +import { type ImageStoreState } from '../../initialState'; import { generationTopicSelectors } from '../generationTopic/selectors'; // ====== topic batch selectors ====== // diff --git a/src/store/image/slices/generationConfig/action.test.ts b/src/store/image/slices/generationConfig/action.test.ts index 97ae53d761..9420af570e 100644 --- a/src/store/image/slices/generationConfig/action.test.ts +++ b/src/store/image/slices/generationConfig/action.test.ts @@ -1,6 +1,10 @@ import { act, renderHook } from '@testing-library/react'; -import type {AIImageModelCard,ModelParamsSchema, RuntimeImageGenParams } from 'model-bank'; -import { extractDefaultValues, fluxSchnellParamsSchema } from 'model-bank'; +import { + type AIImageModelCard, + type ModelParamsSchema, + type RuntimeImageGenParams, +} from 'model-bank'; +import { extractDefaultValues, fluxSchnellParamsSchema } from 'model-bank'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { useImageStore } from '@/store/image'; diff --git a/src/store/image/slices/generationConfig/action.ts b/src/store/image/slices/generationConfig/action.ts index 276907ee82..1f73032f06 100644 --- a/src/store/image/slices/generationConfig/action.ts +++ b/src/store/image/slices/generationConfig/action.ts @@ -1,16 +1,20 @@ -import type {AIImageModelCard, ModelParamsSchema, RuntimeImageGenParams, RuntimeImageGenParamsKeys, RuntimeImageGenParamsValue} from 'model-bank'; import { - extractDefaultValues + type AIImageModelCard, + type ModelParamsSchema, + type RuntimeImageGenParams, + type RuntimeImageGenParamsKeys, + type RuntimeImageGenParamsValue, } from 'model-bank'; +import { extractDefaultValues } from 'model-bank'; import { aiProviderSelectors, getAiInfraStoreState } from '@/store/aiInfra'; import { useGlobalStore } from '@/store/global'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { useUserStore } from '@/store/user'; import { authSelectors } from '@/store/user/selectors'; import { settingsSelectors } from '@/store/user/slices/settings/selectors'; -import type { ImageStore } from '../../store'; +import { type ImageStore } from '../../store'; import { calculateInitialAspectRatio } from '../../utils/aspectRatio'; import { adaptSizeToRatio, parseRatio } from '../../utils/size'; diff --git a/src/store/image/slices/generationConfig/hooks.test.ts b/src/store/image/slices/generationConfig/hooks.test.ts index 4c231d0891..8dcdf1cba7 100644 --- a/src/store/image/slices/generationConfig/hooks.test.ts +++ b/src/store/image/slices/generationConfig/hooks.test.ts @@ -1,6 +1,10 @@ import { act, renderHook } from '@testing-library/react'; -import type {AIImageModelCard, ModelParamsSchema, RuntimeImageGenParams} from 'model-bank'; -import { fluxSchnellParamsSchema } from 'model-bank'; +import { + type AIImageModelCard, + type ModelParamsSchema, + type RuntimeImageGenParams, +} from 'model-bank'; +import { fluxSchnellParamsSchema } from 'model-bank'; import { describe, expect, it, vi } from 'vitest'; import { useImageStore } from '@/store/image'; diff --git a/src/store/image/slices/generationConfig/hooks.ts b/src/store/image/slices/generationConfig/hooks.ts index 26e1d7640b..015ea1b054 100644 --- a/src/store/image/slices/generationConfig/hooks.ts +++ b/src/store/image/slices/generationConfig/hooks.ts @@ -1,8 +1,5 @@ -import type {RuntimeImageGenParams, RuntimeImageGenParamsKeys} from 'model-bank'; -import { - DEFAULT_ASPECT_RATIO, - PRESET_ASPECT_RATIOS -} from 'model-bank'; +import { type RuntimeImageGenParams, type RuntimeImageGenParamsKeys } from 'model-bank'; +import { DEFAULT_ASPECT_RATIO, PRESET_ASPECT_RATIOS } from 'model-bank'; import { useCallback, useMemo } from 'react'; import { useImageStore } from '../../store'; diff --git a/src/store/image/slices/generationConfig/initialState.ts b/src/store/image/slices/generationConfig/initialState.ts index 1e5e2d3b63..573555808b 100644 --- a/src/store/image/slices/generationConfig/initialState.ts +++ b/src/store/image/slices/generationConfig/initialState.ts @@ -1,9 +1,6 @@ /* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */ -import type {ModelParamsSchema, RuntimeImageGenParams} from 'model-bank'; -import { - extractDefaultValues, - ModelProvider -} from 'model-bank'; +import { type ModelParamsSchema, type RuntimeImageGenParams } from 'model-bank'; +import { extractDefaultValues, ModelProvider } from 'model-bank'; import { nanoBananaProParameters } from 'model-bank/google'; import { DEFAULT_IMAGE_CONFIG } from '@/const/settings'; diff --git a/src/store/image/slices/generationConfig/selectors.test.ts b/src/store/image/slices/generationConfig/selectors.test.ts index 0a461af3da..bc7ca4ed6a 100644 --- a/src/store/image/slices/generationConfig/selectors.test.ts +++ b/src/store/image/slices/generationConfig/selectors.test.ts @@ -1,8 +1,12 @@ -import type { AIImageModelCard,ModelParamsSchema, RuntimeImageGenParams} from 'model-bank'; -import {gptImage1ParamsSchema } from 'model-bank'; +import { + type AIImageModelCard, + type ModelParamsSchema, + type RuntimeImageGenParams, +} from 'model-bank'; +import { gptImage1ParamsSchema } from 'model-bank'; import { describe, expect, it, vi } from 'vitest'; -import type { ImageStore } from '@/store/image'; +import { type ImageStore } from '@/store/image'; import { initialState } from '@/store/image/initialState'; import { merge } from '@/utils/merge'; diff --git a/src/store/image/slices/generationConfig/selectors.ts b/src/store/image/slices/generationConfig/selectors.ts index bb8bef6171..e1cb6ae4f5 100644 --- a/src/store/image/slices/generationConfig/selectors.ts +++ b/src/store/image/slices/generationConfig/selectors.ts @@ -1,6 +1,6 @@ -import type {RuntimeImageGenParamsKeys} from 'model-bank'; +import { type RuntimeImageGenParamsKeys } from 'model-bank'; -import type {GenerationConfigState} from './initialState'; +import { type GenerationConfigState } from './initialState'; export const model = (s: GenerationConfigState) => s.model; export const provider = (s: GenerationConfigState) => s.provider; diff --git a/src/store/image/slices/generationTopic/action.test.ts b/src/store/image/slices/generationTopic/action.test.ts index 642df85944..af434e205e 100644 --- a/src/store/image/slices/generationTopic/action.test.ts +++ b/src/store/image/slices/generationTopic/action.test.ts @@ -6,7 +6,7 @@ import { mutate } from '@/libs/swr'; import { chatService } from '@/services/chat'; import { generationTopicService } from '@/services/generationTopic'; import { useImageStore } from '@/store/image'; -import type { ImageGenerationTopic } from '@/types/generation'; +import { type ImageGenerationTopic } from '@/types/generation'; // Mock @/libs/swr mutate vi.mock('@/libs/swr', async () => { diff --git a/src/store/image/slices/generationTopic/action.ts b/src/store/image/slices/generationTopic/action.ts index aacb518095..4c16526603 100644 --- a/src/store/image/slices/generationTopic/action.ts +++ b/src/store/image/slices/generationTopic/action.ts @@ -1,23 +1,23 @@ import { chainSummaryGenerationTitle } from '@lobechat/prompts'; import isEqual from 'fast-deep-equal'; -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; import { LOADING_FLAT } from '@/const/message'; import { mutate, useClientDataSWR } from '@/libs/swr'; -import type {UpdateTopicValue} from '@/server/routers/lambda/generationTopic'; +import { type UpdateTopicValue } from '@/server/routers/lambda/generationTopic'; import { chatService } from '@/services/chat'; import { generationTopicService } from '@/services/generationTopic'; import { globalHelpers } from '@/store/global/helpers'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { useUserStore } from '@/store/user'; import { systemAgentSelectors } from '@/store/user/selectors'; -import type {ImageGenerationTopic} from '@/types/generation'; +import { type ImageGenerationTopic } from '@/types/generation'; import { merge } from '@/utils/merge'; import { setNamespace } from '@/utils/storeDebug'; -import type { ImageStore } from '../../store'; -import type {GenerationTopicDispatch} from './reducer'; -import { generationTopicReducer } from './reducer'; +import { type ImageStore } from '../../store'; +import { type GenerationTopicDispatch } from './reducer'; +import { generationTopicReducer } from './reducer'; import { generationTopicSelectors } from './selectors'; const FETCH_GENERATION_TOPICS_KEY = 'fetchGenerationTopics'; diff --git a/src/store/image/slices/generationTopic/initialState.ts b/src/store/image/slices/generationTopic/initialState.ts index 9c8b2f35c0..2208aa6e61 100644 --- a/src/store/image/slices/generationTopic/initialState.ts +++ b/src/store/image/slices/generationTopic/initialState.ts @@ -1,4 +1,4 @@ -import type {ImageGenerationTopic} from '@/types/generation'; +import { type ImageGenerationTopic } from '@/types/generation'; export interface GenerationTopicState { activeGenerationTopicId: string | null; diff --git a/src/store/image/slices/generationTopic/reducer.test.ts b/src/store/image/slices/generationTopic/reducer.test.ts index 608213680c..3c1f72c939 100644 --- a/src/store/image/slices/generationTopic/reducer.test.ts +++ b/src/store/image/slices/generationTopic/reducer.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest'; -import type { ImageGenerationTopic } from '@/types/generation'; +import { type ImageGenerationTopic } from '@/types/generation'; -import type { GenerationTopicDispatch} from './reducer'; +import { type GenerationTopicDispatch } from './reducer'; import { generationTopicReducer } from './reducer'; describe('generationTopicReducer', () => { diff --git a/src/store/image/slices/generationTopic/reducer.ts b/src/store/image/slices/generationTopic/reducer.ts index ae43994639..1b1ed62ce5 100644 --- a/src/store/image/slices/generationTopic/reducer.ts +++ b/src/store/image/slices/generationTopic/reducer.ts @@ -1,7 +1,7 @@ import { produce } from 'immer'; -import type {UpdateTopicValue} from '@/server/routers/lambda/generationTopic'; -import type {ImageGenerationTopic} from '@/types/generation'; +import { type UpdateTopicValue } from '@/server/routers/lambda/generationTopic'; +import { type ImageGenerationTopic } from '@/types/generation'; type AddGenerationTopicAction = { type: 'addTopic'; diff --git a/src/store/image/slices/generationTopic/selectors.test.ts b/src/store/image/slices/generationTopic/selectors.test.ts index 5236e984f0..ff0b1f9c23 100644 --- a/src/store/image/slices/generationTopic/selectors.test.ts +++ b/src/store/image/slices/generationTopic/selectors.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest'; -import type { ImageStore } from '@/store/image'; +import { type ImageStore } from '@/store/image'; import { initialState } from '@/store/image/initialState'; -import type { ImageGenerationTopic } from '@/types/generation'; +import { type ImageGenerationTopic } from '@/types/generation'; import { merge } from '@/utils/merge'; import { generationTopicSelectors } from './selectors'; diff --git a/src/store/image/slices/generationTopic/selectors.ts b/src/store/image/slices/generationTopic/selectors.ts index 1175f61bb6..cf1842fb07 100644 --- a/src/store/image/slices/generationTopic/selectors.ts +++ b/src/store/image/slices/generationTopic/selectors.ts @@ -1,4 +1,4 @@ -import type {ImageStoreState} from '../../initialState'; +import { type ImageStoreState } from '../../initialState'; const activeGenerationTopicId = (s: ImageStoreState) => s.activeGenerationTopicId; const generationTopics = (s: ImageStoreState) => s.generationTopics; diff --git a/src/store/image/store.ts b/src/store/image/store.ts index 1014030422..ab41005c00 100644 --- a/src/store/image/store.ts +++ b/src/store/image/store.ts @@ -1,26 +1,20 @@ import { subscribeWithSelector } from 'zustand/middleware'; import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {ImageStoreState} from './initialState'; -import { initialState } from './initialState'; -import type {CreateImageAction} from './slices/createImage/action'; +import { type ImageStoreState } from './initialState'; +import { initialState } from './initialState'; +import { type CreateImageAction } from './slices/createImage/action'; import { createCreateImageSlice } from './slices/createImage/action'; -import type {GenerationBatchAction} from './slices/generationBatch/action'; -import { - createGenerationBatchSlice -} from './slices/generationBatch/action'; -import type {GenerationConfigAction} from './slices/generationConfig/action'; -import { - createGenerationConfigSlice -} from './slices/generationConfig/action'; -import type {GenerationTopicAction} from './slices/generationTopic/action'; -import { - createGenerationTopicSlice -} from './slices/generationTopic/action'; +import { type GenerationBatchAction } from './slices/generationBatch/action'; +import { createGenerationBatchSlice } from './slices/generationBatch/action'; +import { type GenerationConfigAction } from './slices/generationConfig/action'; +import { createGenerationConfigSlice } from './slices/generationConfig/action'; +import { type GenerationTopicAction } from './slices/generationTopic/action'; +import { createGenerationTopicSlice } from './slices/generationTopic/action'; // =============== aggregate createStoreFn ============ // diff --git a/src/store/image/utils/aspectRatio.test.ts b/src/store/image/utils/aspectRatio.test.ts index 0cccf90b15..142631aa0f 100644 --- a/src/store/image/utils/aspectRatio.test.ts +++ b/src/store/image/utils/aspectRatio.test.ts @@ -1,4 +1,4 @@ -import type { ModelParamsSchema } from 'model-bank'; +import { type ModelParamsSchema } from 'model-bank'; import { describe, expect, it } from 'vitest'; import { calculateInitialAspectRatio, supportsVirtualAspectRatio } from './aspectRatio'; diff --git a/src/store/image/utils/aspectRatio.ts b/src/store/image/utils/aspectRatio.ts index 8147a06e81..f00cc10ce5 100644 --- a/src/store/image/utils/aspectRatio.ts +++ b/src/store/image/utils/aspectRatio.ts @@ -1,4 +1,4 @@ -import type {ModelParamsSchema} from 'model-bank'; +import { type ModelParamsSchema } from 'model-bank'; /** * Calculate initial aspect ratio for image generation models diff --git a/src/store/library/initialState.ts b/src/store/library/initialState.ts index 909ef2303a..fec7a302b5 100644 --- a/src/store/library/initialState.ts +++ b/src/store/library/initialState.ts @@ -1,6 +1,6 @@ -import type {KnowledgeBaseState} from '../library/slices/crud'; +import { type KnowledgeBaseState } from '../library/slices/crud'; import { initialKnowledgeBaseState } from '../library/slices/crud'; -import type {RAGEvalState} from '../library/slices/ragEval'; +import { type RAGEvalState } from '../library/slices/ragEval'; import { initialDatasetState } from '../library/slices/ragEval'; export type KnowledgeBaseStoreState = KnowledgeBaseState & RAGEvalState; diff --git a/src/store/library/slices/content/action.ts b/src/store/library/slices/content/action.ts index 2d4d0b3547..af71b6d5d4 100644 --- a/src/store/library/slices/content/action.ts +++ b/src/store/library/slices/content/action.ts @@ -1,7 +1,7 @@ import { knowledgeBaseService } from '@/services/knowledgeBase'; import { revalidateResources } from '@/store/file/slices/resource/hooks'; -import type {KnowledgeBaseStore} from '@/store/library/store'; -import type {StoreSetter} from '@/store/types'; +import { type KnowledgeBaseStore } from '@/store/library/store'; +import { type StoreSetter } from '@/store/types'; type Setter = StoreSetter; export const createContentSlice = (set: Setter, get: () => KnowledgeBaseStore, _api?: unknown) => diff --git a/src/store/library/slices/crud/action.test.ts b/src/store/library/slices/crud/action.test.ts index ddf4d045a1..081c1007fc 100644 --- a/src/store/library/slices/crud/action.test.ts +++ b/src/store/library/slices/crud/action.test.ts @@ -2,7 +2,7 @@ import { act, renderHook, waitFor } from '@testing-library/react'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { knowledgeBaseService } from '@/services/knowledgeBase'; -import type { CreateKnowledgeBaseParams, KnowledgeBaseItem } from '@/types/knowledgeBase'; +import { type CreateKnowledgeBaseParams, type KnowledgeBaseItem } from '@/types/knowledgeBase'; import { withSWR } from '~test-utils'; import { useKnowledgeBaseStore } from '../../store'; diff --git a/src/store/library/slices/crud/action.ts b/src/store/library/slices/crud/action.ts index f20c3f57cf..104619fb29 100644 --- a/src/store/library/slices/crud/action.ts +++ b/src/store/library/slices/crud/action.ts @@ -1,10 +1,10 @@ -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; import { mutate, useClientDataSWR } from '@/libs/swr'; import { knowledgeBaseService } from '@/services/knowledgeBase'; -import type {KnowledgeBaseStore} from '@/store/library/store'; -import type {StoreSetter} from '@/store/types'; -import type {CreateKnowledgeBaseParams, KnowledgeBaseItem} from '@/types/knowledgeBase'; +import { type KnowledgeBaseStore } from '@/store/library/store'; +import { type StoreSetter } from '@/store/types'; +import { type CreateKnowledgeBaseParams, type KnowledgeBaseItem } from '@/types/knowledgeBase'; const FETCH_KNOWLEDGE_BASE_LIST_KEY = 'FETCH_KNOWLEDGE_BASE'; const FETCH_KNOWLEDGE_BASE_ITEM_KEY = 'FETCH_KNOWLEDGE_BASE_ITEM'; diff --git a/src/store/library/slices/crud/initialState.ts b/src/store/library/slices/crud/initialState.ts index 52d64aec4a..738c57d886 100644 --- a/src/store/library/slices/crud/initialState.ts +++ b/src/store/library/slices/crud/initialState.ts @@ -1,4 +1,4 @@ -import type {KnowledgeBaseItem} from '@/types/knowledgeBase'; +import { type KnowledgeBaseItem } from '@/types/knowledgeBase'; export interface KnowledgeBaseState { activeKnowledgeBaseId: string | null; diff --git a/src/store/library/slices/crud/selectors.ts b/src/store/library/slices/crud/selectors.ts index 3080ceb332..c6c1686f77 100644 --- a/src/store/library/slices/crud/selectors.ts +++ b/src/store/library/slices/crud/selectors.ts @@ -1,4 +1,4 @@ -import type {KnowledgeBaseStoreState} from '@/store/library/initialState'; +import { type KnowledgeBaseStoreState } from '@/store/library/initialState'; const activeKnowledgeBaseId = (s: KnowledgeBaseStoreState) => s.activeKnowledgeBaseId; diff --git a/src/store/library/slices/ragEval/actions/dataset.ts b/src/store/library/slices/ragEval/actions/dataset.ts index 33848d191b..e94edfd6bb 100644 --- a/src/store/library/slices/ragEval/actions/dataset.ts +++ b/src/store/library/slices/ragEval/actions/dataset.ts @@ -1,15 +1,17 @@ -import type {CreateNewEvalDatasets, EvalDatasetRecord, RAGEvalDataSetItem} from '@lobechat/types'; import { - insertEvalDatasetRecordSchema + type CreateNewEvalDatasets, + type EvalDatasetRecord, + type RAGEvalDataSetItem, } from '@lobechat/types'; +import { insertEvalDatasetRecordSchema } from '@lobechat/types'; import i18n from 'i18next'; -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; import { notification } from '@/components/AntdStaticMethods'; import { mutate, useClientDataSWR } from '@/libs/swr'; import { ragEvalService } from '@/services/ragEval'; -import type {KnowledgeBaseStore} from '@/store/library/store'; -import type {StoreSetter} from '@/store/types'; +import { type KnowledgeBaseStore } from '@/store/library/store'; +import { type StoreSetter } from '@/store/types'; const FETCH_DATASET_LIST_KEY = 'FETCH_DATASET_LIST'; const FETCH_DATASET_RECORD_KEY = 'FETCH_DATASET_RECORD_KEY'; diff --git a/src/store/library/slices/ragEval/actions/evaluation.ts b/src/store/library/slices/ragEval/actions/evaluation.ts index 2d6b988bac..fcc45a7959 100644 --- a/src/store/library/slices/ragEval/actions/evaluation.ts +++ b/src/store/library/slices/ragEval/actions/evaluation.ts @@ -1,10 +1,10 @@ -import type {CreateNewEvalEvaluation, RAGEvalDataSetItem} from '@lobechat/types'; -import type { SWRResponse } from 'swr'; +import { type CreateNewEvalEvaluation, type RAGEvalDataSetItem } from '@lobechat/types'; +import { type SWRResponse } from 'swr'; import { mutate, useClientDataSWR } from '@/libs/swr'; import { ragEvalService } from '@/services/ragEval'; -import type {KnowledgeBaseStore} from '@/store/library/store'; -import type {StoreSetter} from '@/store/types'; +import { type KnowledgeBaseStore } from '@/store/library/store'; +import { type StoreSetter } from '@/store/types'; const FETCH_EVALUATION_LIST_KEY = 'FETCH_EVALUATION_LIST_KEY'; diff --git a/src/store/library/slices/ragEval/actions/index.ts b/src/store/library/slices/ragEval/actions/index.ts index 2650efdd12..4db527670e 100644 --- a/src/store/library/slices/ragEval/actions/index.ts +++ b/src/store/library/slices/ragEval/actions/index.ts @@ -1,12 +1,12 @@ -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; -import type {KnowledgeBaseStore} from '@/store/library/store'; +import { type KnowledgeBaseStore } from '@/store/library/store'; import { flattenActions } from '@/store/utils/flattenActions'; -import type {RAGEvalDatasetAction} from './dataset'; -import { createRagEvalDatasetSlice } from './dataset'; -import type {RAGEvalEvaluationAction} from './evaluation'; -import { createRagEvalEvaluationSlice } from './evaluation'; +import { type RAGEvalDatasetAction } from './dataset'; +import { createRagEvalDatasetSlice } from './dataset'; +import { type RAGEvalEvaluationAction } from './evaluation'; +import { createRagEvalEvaluationSlice } from './evaluation'; export type RAGEvalAction = RAGEvalDatasetAction & RAGEvalEvaluationAction; diff --git a/src/store/library/store.ts b/src/store/library/store.ts index 29a0a62c02..1c3aa1ddd3 100644 --- a/src/store/library/store.ts +++ b/src/store/library/store.ts @@ -1,16 +1,16 @@ import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {KnowledgeBaseStoreState} from './initialState'; +import { type KnowledgeBaseStoreState } from './initialState'; import { initialState } from './initialState'; -import type {KnowledgeBaseContentAction} from './slices/content'; +import { type KnowledgeBaseContentAction } from './slices/content'; import { createContentSlice } from './slices/content'; -import type {KnowledgeBaseCrudAction} from './slices/crud'; +import { type KnowledgeBaseCrudAction } from './slices/crud'; import { createCrudSlice } from './slices/crud'; -import type {RAGEvalAction} from './slices/ragEval'; +import { type RAGEvalAction } from './slices/ragEval'; import { createRagEvalSlice } from './slices/ragEval'; // =============== Aggregate createStoreFn ============ // diff --git a/src/store/mention/action.ts b/src/store/mention/action.ts index 647df2cbfc..093fb123c2 100644 --- a/src/store/mention/action.ts +++ b/src/store/mention/action.ts @@ -1,6 +1,6 @@ -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; -import type {MentionStore} from './store'; +import { type MentionStore } from './store'; type Setter = StoreSetter; export const createMentionSlice = (set: Setter, get: () => MentionStore, _api?: unknown) => diff --git a/src/store/mention/selectors.ts b/src/store/mention/selectors.ts index 42967b3d11..8b483ce44a 100644 --- a/src/store/mention/selectors.ts +++ b/src/store/mention/selectors.ts @@ -1,4 +1,4 @@ -import type {MentionState} from './initialState'; +import { type MentionState } from './initialState'; const mentionedUsers = (s: MentionState) => s.mentionedUsers; const hasMentionedUsers = (s: MentionState) => s.mentionedUsers.length > 0; diff --git a/src/store/mention/store.ts b/src/store/mention/store.ts index 496c28caed..338a2129ba 100644 --- a/src/store/mention/store.ts +++ b/src/store/mention/store.ts @@ -1,12 +1,12 @@ import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {MentionAction} from './action'; +import { type MentionAction } from './action'; import { createMentionSlice } from './action'; -import type {MentionState} from './initialState'; +import { type MentionState } from './initialState'; import { initialMentionState } from './initialState'; export type MentionStore = MentionState & MentionAction; diff --git a/src/store/middleware/createDevtools.ts b/src/store/middleware/createDevtools.ts index 60008d1019..85286c4da0 100644 --- a/src/store/middleware/createDevtools.ts +++ b/src/store/middleware/createDevtools.ts @@ -1,4 +1,4 @@ -import type {devtools as _devtools} from 'zustand/middleware'; +import { type devtools as _devtools } from 'zustand/middleware'; import { optionalDevtools } from 'zustand-utils'; import { isDev } from '@/utils/env'; diff --git a/src/store/notebook/action.ts b/src/store/notebook/action.ts index fc99a6db4b..5f018d1283 100644 --- a/src/store/notebook/action.ts +++ b/src/store/notebook/action.ts @@ -1,17 +1,17 @@ -import type {DocumentType} from '@lobechat/builtin-tool-notebook'; -import type {DocumentItem} from '@lobechat/database/schemas'; -import type {NotebookDocument} from '@lobechat/types'; +import { type DocumentType } from '@lobechat/builtin-tool-notebook'; +import { type DocumentItem } from '@lobechat/database/schemas'; +import { type NotebookDocument } from '@lobechat/types'; import isEqual from 'fast-deep-equal'; -import type {SWRResponse} from 'swr'; -import { mutate } from 'swr'; +import { type SWRResponse } from 'swr'; +import { mutate } from 'swr'; import { useClientDataSWR } from '@/libs/swr'; import { notebookService } from '@/services/notebook'; import { useChatStore } from '@/store/chat'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; -import type { NotebookStore } from './store'; +import { type NotebookStore } from './store'; const n = setNamespace('notebook'); diff --git a/src/store/notebook/initialState.ts b/src/store/notebook/initialState.ts index 3bba54d159..84a479e1b1 100644 --- a/src/store/notebook/initialState.ts +++ b/src/store/notebook/initialState.ts @@ -1,4 +1,4 @@ -import type {NotebookDocument} from '@lobechat/types'; +import { type NotebookDocument } from '@lobechat/types'; export interface NotebookState { /** diff --git a/src/store/notebook/selectors.ts b/src/store/notebook/selectors.ts index 1a35ad9b4b..fa350d2d66 100644 --- a/src/store/notebook/selectors.ts +++ b/src/store/notebook/selectors.ts @@ -1,4 +1,4 @@ -import type { NotebookStore } from './store'; +import { type NotebookStore } from './store'; const getDocumentById = (topicId: string | undefined, documentId: string | undefined) => (s: NotebookStore) => { diff --git a/src/store/notebook/store.ts b/src/store/notebook/store.ts index 245fa6902c..e6dae451ad 100644 --- a/src/store/notebook/store.ts +++ b/src/store/notebook/store.ts @@ -1,12 +1,12 @@ import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {NotebookAction} from './action'; +import { type NotebookAction } from './action'; import { createNotebookAction } from './action'; -import type {NotebookState} from './initialState'; +import { type NotebookState } from './initialState'; import { initialNotebookState } from './initialState'; export type NotebookStore = NotebookState & NotebookAction; diff --git a/src/store/page/initialState.ts b/src/store/page/initialState.ts index 641925af32..fb8036c47a 100644 --- a/src/store/page/initialState.ts +++ b/src/store/page/initialState.ts @@ -1,6 +1,6 @@ -import type { NavigateFunction } from 'react-router-dom'; +import { type NavigateFunction } from 'react-router-dom'; -import type {LobeDocument} from '@/types/document'; +import { type LobeDocument } from '@/types/document'; export interface PageQueryFilter { fileTypes?: string[]; diff --git a/src/store/page/slices/crud/action.ts b/src/store/page/slices/crud/action.ts index 8c9bd447b5..fca12d4d32 100644 --- a/src/store/page/slices/crud/action.ts +++ b/src/store/page/slices/crud/action.ts @@ -1,14 +1,14 @@ -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; import { useClientDataSWRWithSync } from '@/libs/swr'; import { documentService } from '@/services/document'; -import type {StoreSetter} from '@/store/types'; -import type {LobeDocument} from '@/types/document'; -import { DocumentSourceType } from '@/types/document'; +import { type StoreSetter } from '@/store/types'; +import { type LobeDocument } from '@/types/document'; +import { DocumentSourceType } from '@/types/document'; import { standardizeIdentifier } from '@/utils/identifier'; import { setNamespace } from '@/utils/storeDebug'; -import type {PageStore} from '../../store'; +import { type PageStore } from '../../store'; const n = setNamespace('page/crud'); diff --git a/src/store/page/slices/internal/action.ts b/src/store/page/slices/internal/action.ts index 77df741d8a..a1ee8f44b7 100644 --- a/src/store/page/slices/internal/action.ts +++ b/src/store/page/slices/internal/action.ts @@ -1,11 +1,11 @@ import isEqual from 'fast-deep-equal'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; -import type {PageStore} from '../../store'; -import type {DocumentsDispatch} from './reducer'; -import { documentsReducer } from './reducer'; +import { type PageStore } from '../../store'; +import { type DocumentsDispatch } from './reducer'; +import { documentsReducer } from './reducer'; const n = setNamespace('page/internal'); diff --git a/src/store/page/slices/internal/reducer.ts b/src/store/page/slices/internal/reducer.ts index 1ae003b944..88bc35e573 100644 --- a/src/store/page/slices/internal/reducer.ts +++ b/src/store/page/slices/internal/reducer.ts @@ -1,6 +1,6 @@ import { produce } from 'immer'; -import type {LobeDocument} from '@/types/document'; +import { type LobeDocument } from '@/types/document'; // ============ Action Types ============ diff --git a/src/store/page/slices/list/action.ts b/src/store/page/slices/list/action.ts index 6376e9ca45..d2f4eeb14a 100644 --- a/src/store/page/slices/list/action.ts +++ b/src/store/page/slices/list/action.ts @@ -1,14 +1,14 @@ -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; import { useClientDataSWRWithSync } from '@/libs/swr'; import { documentService } from '@/services/document'; import { useGlobalStore } from '@/store/global'; -import type {StoreSetter} from '@/store/types'; -import type {LobeDocument} from '@/types/document'; +import { type StoreSetter } from '@/store/types'; +import { type LobeDocument } from '@/types/document'; import { setNamespace } from '@/utils/storeDebug'; -import type {PageQueryFilter} from '../../initialState'; -import type {PageStore} from '../../store'; +import { type PageQueryFilter } from '../../initialState'; +import { type PageStore } from '../../store'; const n = setNamespace('page/list'); diff --git a/src/store/page/slices/list/initialState.ts b/src/store/page/slices/list/initialState.ts index 0f6f8c4948..a561855889 100644 --- a/src/store/page/slices/list/initialState.ts +++ b/src/store/page/slices/list/initialState.ts @@ -1,6 +1,6 @@ -import type {LobeDocument} from '@/types/document'; +import { type LobeDocument } from '@/types/document'; -import type {PageQueryFilter} from '../../initialState'; +import { type PageQueryFilter } from '../../initialState'; export interface ListState { currentPage: number; diff --git a/src/store/page/slices/list/selectors.ts b/src/store/page/slices/list/selectors.ts index 4d51237d69..d57f7341b5 100644 --- a/src/store/page/slices/list/selectors.ts +++ b/src/store/page/slices/list/selectors.ts @@ -1,7 +1,7 @@ import { useGlobalStore } from '@/store/global'; -import type {LobeDocument} from '@/types/document'; +import { type LobeDocument } from '@/types/document'; -import type {PageState} from '../../initialState'; +import { type PageState } from '../../initialState'; /** * Check if documents are still loading (undefined means not yet loaded) diff --git a/src/store/page/slices/selection/action.ts b/src/store/page/slices/selection/action.ts index 06d01b3688..be3ac13047 100644 --- a/src/store/page/slices/selection/action.ts +++ b/src/store/page/slices/selection/action.ts @@ -1,7 +1,7 @@ -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; -import type {PageStore} from '../../store'; +import { type PageStore } from '../../store'; const n = setNamespace('page/selection'); diff --git a/src/store/page/store.ts b/src/store/page/store.ts index 0f6b9eeecd..a7d032efb1 100644 --- a/src/store/page/store.ts +++ b/src/store/page/store.ts @@ -1,18 +1,18 @@ import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {PageState} from './initialState'; +import { type PageState } from './initialState'; import { initialState } from './initialState'; -import type {CrudAction} from './slices/crud'; +import { type CrudAction } from './slices/crud'; import { createCrudSlice } from './slices/crud'; -import type {InternalAction} from './slices/internal'; +import { type InternalAction } from './slices/internal'; import { createInternalSlice } from './slices/internal'; -import type {ListAction} from './slices/list'; +import { type ListAction } from './slices/list'; import { createListSlice } from './slices/list'; -import type {SelectionAction} from './slices/selection'; +import { type SelectionAction } from './slices/selection'; import { createSelectionSlice } from './slices/selection'; // =============== Aggregate createStoreFn ============ // diff --git a/src/store/serverConfig/Provider.tsx b/src/store/serverConfig/Provider.tsx index 51163ff093..f4d6f92b39 100644 --- a/src/store/serverConfig/Provider.tsx +++ b/src/store/serverConfig/Provider.tsx @@ -1,13 +1,13 @@ 'use client'; -import type {ReactNode} from 'react'; +import { type ReactNode } from 'react'; import { memo } from 'react'; -import type {IFeatureFlags} from '@/config/featureFlags'; -import { mapFeatureFlagsEnvToState } from '@/config/featureFlags'; -import type {GlobalServerConfig} from '@/types/serverConfig'; +import { type IFeatureFlags } from '@/config/featureFlags'; +import { mapFeatureFlagsEnvToState } from '@/config/featureFlags'; +import { type GlobalServerConfig } from '@/types/serverConfig'; -import { createServerConfigStore,Provider } from './store'; +import { createServerConfigStore, Provider } from './store'; interface GlobalStoreProviderProps { children: ReactNode; diff --git a/src/store/serverConfig/action.test.ts b/src/store/serverConfig/action.test.ts index 96718088a2..d586b9a670 100644 --- a/src/store/serverConfig/action.test.ts +++ b/src/store/serverConfig/action.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import type { GlobalRuntimeConfig } from '@/types/serverConfig'; +import { type GlobalRuntimeConfig } from '@/types/serverConfig'; import { createServerConfigStore } from './store'; diff --git a/src/store/serverConfig/action.ts b/src/store/serverConfig/action.ts index 09772a9248..9d877879ce 100644 --- a/src/store/serverConfig/action.ts +++ b/src/store/serverConfig/action.ts @@ -1,11 +1,11 @@ -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import { useOnlyFetchOnceSWR } from '@/libs/swr'; import { globalService } from '@/services/global'; -import type {StoreSetter} from '@/store/types'; -import type {GlobalRuntimeConfig} from '@/types/serverConfig'; +import { type StoreSetter } from '@/store/types'; +import { type GlobalRuntimeConfig } from '@/types/serverConfig'; -import type { ServerConfigStore } from './store'; +import { type ServerConfigStore } from './store'; const FETCH_SERVER_CONFIG_KEY = 'FETCH_SERVER_CONFIG'; diff --git a/src/store/serverConfig/selectors.ts b/src/store/serverConfig/selectors.ts index c0727740ba..b17d39e25a 100644 --- a/src/store/serverConfig/selectors.ts +++ b/src/store/serverConfig/selectors.ts @@ -1,4 +1,4 @@ -import type {ServerConfigStore} from './store'; +import { type ServerConfigStore } from './store'; export const featureFlagsSelectors = (s: ServerConfigStore) => s.featureFlags; diff --git a/src/store/serverConfig/store.test.ts b/src/store/serverConfig/store.test.ts index 31be57ac41..9c6988aff3 100644 --- a/src/store/serverConfig/store.test.ts +++ b/src/store/serverConfig/store.test.ts @@ -3,7 +3,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { DEFAULT_FEATURE_FLAGS, mapFeatureFlagsEnvToState } from '@/config/featureFlags'; -import type {ServerConfigStore } from './store'; +import { type ServerConfigStore } from './store'; import { createServerConfigStore, initServerConfigStore } from './store'; describe('createServerConfigStore', () => { diff --git a/src/store/serverConfig/store.ts b/src/store/serverConfig/store.ts index 4e76771c8e..13c32ac99c 100644 --- a/src/store/serverConfig/store.ts +++ b/src/store/serverConfig/store.ts @@ -1,22 +1,19 @@ -import type {StoreApiWithSelector} from '@lobechat/types'; -import type {StoreApi} from 'zustand'; +import { type StoreApiWithSelector } from '@lobechat/types'; +import { type StoreApi } from 'zustand'; import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createContext } from 'zustand-utils'; -import type {IFeatureFlagsState} from '@/config/featureFlags'; -import { - DEFAULT_FEATURE_FLAGS, - mapFeatureFlagsEnvToState -} from '@/config/featureFlags'; +import { type IFeatureFlagsState } from '@/config/featureFlags'; +import { DEFAULT_FEATURE_FLAGS, mapFeatureFlagsEnvToState } from '@/config/featureFlags'; import { createDevtools } from '@/store/middleware/createDevtools'; -import type {GlobalServerConfig} from '@/types/serverConfig'; +import { type GlobalServerConfig } from '@/types/serverConfig'; import { merge } from '@/utils/merge'; import { flattenActions } from '../utils/flattenActions'; -import type {ServerConfigAction} from './action'; -import { createServerConfigSlice } from './action'; +import { type ServerConfigAction } from './action'; +import { createServerConfigSlice } from './action'; interface ServerConfigState { featureFlags: IFeatureFlagsState; diff --git a/src/store/session/initialState.ts b/src/store/session/initialState.ts index 719e6f8a76..33becb5971 100644 --- a/src/store/session/initialState.ts +++ b/src/store/session/initialState.ts @@ -1,10 +1,10 @@ -import type {HomeInputState} from './slices/homeInput/initialState'; -import { initialHomeInputState } from './slices/homeInput/initialState'; -import type {RecentState} from './slices/recent/initialState'; +import { type HomeInputState } from './slices/homeInput/initialState'; +import { initialHomeInputState } from './slices/homeInput/initialState'; +import { type RecentState } from './slices/recent/initialState'; import { initialRecentState } from './slices/recent/initialState'; -import type {SessionState} from './slices/session/initialState'; +import { type SessionState } from './slices/session/initialState'; import { initialSessionState } from './slices/session/initialState'; -import type {SessionGroupState} from './slices/sessionGroup/initialState'; +import { type SessionGroupState } from './slices/sessionGroup/initialState'; import { initSessionGroupState } from './slices/sessionGroup/initialState'; export interface SessionStoreState diff --git a/src/store/session/slices/homeInput/action.ts b/src/store/session/slices/homeInput/action.ts index 12d5067fb9..d718e2c141 100644 --- a/src/store/session/slices/homeInput/action.ts +++ b/src/store/session/slices/homeInput/action.ts @@ -1,11 +1,11 @@ import { documentService } from '@/services/document'; import { useChatStore } from '@/store/chat'; import { useGlobalStore } from '@/store/global'; -import type { SessionStore } from '@/store/session/store'; -import type {StoreSetter} from '@/store/types'; +import { type SessionStore } from '@/store/session/store'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; -import type { StarterMode } from './initialState'; +import { type StarterMode } from './initialState'; const n = setNamespace('homeInput'); diff --git a/src/store/session/slices/recent/action.ts b/src/store/session/slices/recent/action.ts index 4df659f93c..30309fb8db 100644 --- a/src/store/session/slices/recent/action.ts +++ b/src/store/session/slices/recent/action.ts @@ -1,15 +1,15 @@ import isEqual from 'fast-deep-equal'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import { useClientDataSWR } from '@/libs/swr'; import { fileService } from '@/services/file'; import { topicService } from '@/services/topic'; -import type {StoreSetter} from '@/store/types'; -import type {FileListItem} from '@/types/files'; -import type {RecentTopic} from '@/types/topic'; +import { type StoreSetter } from '@/store/types'; +import { type FileListItem } from '@/types/files'; +import { type RecentTopic } from '@/types/topic'; import { setNamespace } from '@/utils/storeDebug'; -import type {SessionStore} from '../../store'; +import { type SessionStore } from '../../store'; const n = setNamespace('recent'); diff --git a/src/store/session/slices/recent/initialState.ts b/src/store/session/slices/recent/initialState.ts index 25f45bf210..d8a5917cd6 100644 --- a/src/store/session/slices/recent/initialState.ts +++ b/src/store/session/slices/recent/initialState.ts @@ -1,5 +1,5 @@ -import type {FileListItem} from '@/types/files'; -import type {RecentTopic} from '@/types/topic'; +import { type FileListItem } from '@/types/files'; +import { type RecentTopic } from '@/types/topic'; export interface RecentState { isRecentPagesInit: boolean; diff --git a/src/store/session/slices/recent/selectors.ts b/src/store/session/slices/recent/selectors.ts index e73c0c90dd..0e8671086d 100644 --- a/src/store/session/slices/recent/selectors.ts +++ b/src/store/session/slices/recent/selectors.ts @@ -1,4 +1,4 @@ -import type {SessionStoreState} from '../../initialState'; +import { type SessionStoreState } from '../../initialState'; const isRecentTopicsInit = (s: SessionStoreState) => s.isRecentTopicsInit; const isRecentResourcesInit = (s: SessionStoreState) => s.isRecentResourcesInit; diff --git a/src/store/session/slices/session/action.ts b/src/store/session/slices/session/action.ts index d6cb838b85..d4798d30ee 100644 --- a/src/store/session/slices/session/action.ts +++ b/src/store/session/slices/session/action.ts @@ -1,9 +1,9 @@ import { getSingletonAnalyticsOptional } from '@lobehub/analytics'; import isEqual from 'fast-deep-equal'; import { t } from 'i18next'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; -import type { PartialDeep } from 'type-fest'; +import { type PartialDeep } from 'type-fest'; import { message } from '@/components/AntdStaticMethods'; import { DEFAULT_AGENT_LOBE_SESSION, INBOX_SESSION_ID } from '@/const/session'; @@ -11,19 +11,23 @@ import { mutate, useClientDataSWR } from '@/libs/swr'; import { chatGroupService } from '@/services/chatGroup'; import { sessionService } from '@/services/session'; import { getChatGroupStoreState } from '@/store/agentGroup'; -import type {SessionStore} from '@/store/session'; -import type {StoreSetter} from '@/store/types'; +import { type SessionStore } from '@/store/session'; +import { type StoreSetter } from '@/store/types'; import { getUserStoreState, useUserStore } from '@/store/user'; import { settingsSelectors, userProfileSelectors } from '@/store/user/selectors'; -import type {ChatSessionList, LobeAgentSession, LobeSessionGroups, LobeSessions, UpdateSessionParams} from '@/types/session'; import { - LobeSessionType + type ChatSessionList, + type LobeAgentSession, + type LobeSessionGroups, + type LobeSessions, + type UpdateSessionParams, } from '@/types/session'; +import { LobeSessionType } from '@/types/session'; import { merge } from '@/utils/merge'; import { setNamespace } from '@/utils/storeDebug'; -import type {SessionDispatch} from './reducers'; -import { sessionsReducer } from './reducers'; +import { type SessionDispatch } from './reducers'; +import { sessionsReducer } from './reducers'; import { sessionSelectors } from './selectors'; import { sessionMetaSelectors } from './selectors/meta'; diff --git a/src/store/session/slices/session/helpers.ts b/src/store/session/slices/session/helpers.ts index 99843dc848..8252275ba3 100644 --- a/src/store/session/slices/session/helpers.ts +++ b/src/store/session/slices/session/helpers.ts @@ -2,8 +2,13 @@ import { t } from 'i18next'; import { DEFAULT_AVATAR } from '@/const/meta'; import { DEFAULT_AGENT_LOBE_SESSION } from '@/const/session'; -import type {MetaData} from '@/types/meta'; -import type {LobeAgentSession, LobeGroupSession, LobeSession, LobeSessions} from '@/types/session'; +import { type MetaData } from '@/types/meta'; +import { + type LobeAgentSession, + type LobeGroupSession, + type LobeSession, + type LobeSessions, +} from '@/types/session'; export const getSessionPinned = (session: LobeSession) => session.pinned; diff --git a/src/store/session/slices/session/initialState.ts b/src/store/session/slices/session/initialState.ts index 30baf4c345..3b4a127fbb 100644 --- a/src/store/session/slices/session/initialState.ts +++ b/src/store/session/slices/session/initialState.ts @@ -1,4 +1,4 @@ -import type {LobeSessions} from '@/types/session'; +import { type LobeSessions } from '@/types/session'; export interface SessionState { activeAgentId?: string; diff --git a/src/store/session/slices/session/reducers.test.ts b/src/store/session/slices/session/reducers.test.ts index 8b1067dba9..899ce904a3 100644 --- a/src/store/session/slices/session/reducers.test.ts +++ b/src/store/session/slices/session/reducers.test.ts @@ -1,9 +1,9 @@ import { nanoid } from 'nanoid'; import { describe, expect, it } from 'vitest'; -import type { LobeSessions } from '@/types/session'; +import { type LobeSessions } from '@/types/session'; -import type { SessionDispatch} from './reducers'; +import { type SessionDispatch } from './reducers'; import { sessionsReducer } from './reducers'; describe('sessionsReducer', () => { diff --git a/src/store/session/slices/session/reducers.ts b/src/store/session/slices/session/reducers.ts index a5d61ae265..139bcf0920 100644 --- a/src/store/session/slices/session/reducers.ts +++ b/src/store/session/slices/session/reducers.ts @@ -1,6 +1,6 @@ import { produce } from 'immer'; -import type {LobeSession, LobeSessions} from '@/types/session'; +import { type LobeSession, type LobeSessions } from '@/types/session'; interface AddSession { session: LobeSession; diff --git a/src/store/session/slices/session/selectors/list.test.ts b/src/store/session/slices/session/selectors/list.test.ts index e67a46a41b..95eacc1cf1 100644 --- a/src/store/session/slices/session/selectors/list.test.ts +++ b/src/store/session/slices/session/selectors/list.test.ts @@ -1,6 +1,6 @@ import { DEFAULT_AGENT_LOBE_SESSION } from '@/const/session'; -import type { SessionStore } from '@/store/session'; -import type { LobeAgentSession} from '@/types/session'; +import { type SessionStore } from '@/store/session'; +import { type LobeAgentSession } from '@/types/session'; import { LobeSessionType } from '@/types/session'; import { sessionSelectors } from './list'; diff --git a/src/store/session/slices/session/selectors/list.ts b/src/store/session/slices/session/selectors/list.ts index 97fc59308e..cf7ff2034d 100644 --- a/src/store/session/slices/session/selectors/list.ts +++ b/src/store/session/slices/session/selectors/list.ts @@ -1,9 +1,15 @@ import { DEFAULT_AGENT_LOBE_SESSION, INBOX_SESSION_ID } from '@/const/session'; import { sessionHelpers } from '@/store/session/slices/session/helpers'; -import type {MetaData} from '@/types/meta'; -import type {CustomSessionGroup, GroupMemberWithAgent, LobeGroupSession, LobeSession, LobeSessions} from '@/types/session'; +import { type MetaData } from '@/types/meta'; +import { + type CustomSessionGroup, + type GroupMemberWithAgent, + type LobeGroupSession, + type LobeSession, + type LobeSessions, +} from '@/types/session'; -import type {SessionStore} from '../../../store'; +import { type SessionStore } from '../../../store'; const defaultSessions = (s: SessionStore): LobeSessions => s.defaultSessions; diff --git a/src/store/session/slices/session/selectors/meta.test.ts b/src/store/session/slices/session/selectors/meta.test.ts index 60a4d0e26c..1aaae81ca3 100644 --- a/src/store/session/slices/session/selectors/meta.test.ts +++ b/src/store/session/slices/session/selectors/meta.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest'; import { DEFAULT_AVATAR } from '@/const/meta'; -import type { MetaData } from '@/types/meta'; +import { type MetaData } from '@/types/meta'; import { sessionMetaSelectors } from './meta'; diff --git a/src/store/session/slices/session/selectors/meta.ts b/src/store/session/slices/session/selectors/meta.ts index be110b8aab..27b1c958a5 100644 --- a/src/store/session/slices/session/selectors/meta.ts +++ b/src/store/session/slices/session/selectors/meta.ts @@ -1,8 +1,8 @@ import { t } from 'i18next'; import { DEFAULT_AVATAR } from '@/const/meta'; -import type { SessionStore } from '@/store/session'; -import type {MetaData} from '@/types/meta'; +import { type SessionStore } from '@/store/session'; +import { type MetaData } from '@/types/meta'; import { merge } from '@/utils/merge'; import { sessionSelectors } from './list'; diff --git a/src/store/session/slices/sessionGroup/action.ts b/src/store/session/slices/sessionGroup/action.ts index 362e403493..bdf9e6cd9e 100644 --- a/src/store/session/slices/sessionGroup/action.ts +++ b/src/store/session/slices/sessionGroup/action.ts @@ -2,17 +2,15 @@ import { t } from 'i18next'; import { message } from '@/components/AntdStaticMethods'; import { sessionService } from '@/services/session'; -import type {SessionStore} from '@/store/session'; -import type {StoreSetter} from '@/store/types'; -import type {SessionGroupItem} from '@/types/session'; +import { type SessionStore } from '@/store/session'; +import { type StoreSetter } from '@/store/types'; +import { type SessionGroupItem } from '@/types/session'; -import type {SessionGroupsDispatch} from './reducer'; -import { sessionGroupsReducer } from './reducer'; +import { type SessionGroupsDispatch } from './reducer'; +import { sessionGroupsReducer } from './reducer'; /* eslint-disable typescript-sort-keys/interface */ - - type Setter = StoreSetter; export const createSessionGroupSlice = (set: Setter, get: () => SessionStore, _api?: unknown) => new SessionGroupActionImpl(set, get, _api); diff --git a/src/store/session/slices/sessionGroup/initialState.ts b/src/store/session/slices/sessionGroup/initialState.ts index bc65e03396..2ec8dde531 100644 --- a/src/store/session/slices/sessionGroup/initialState.ts +++ b/src/store/session/slices/sessionGroup/initialState.ts @@ -1,4 +1,4 @@ -import type {CustomSessionGroup, LobeSessionGroups} from '@/types/session'; +import { type CustomSessionGroup, type LobeSessionGroups } from '@/types/session'; export interface SessionGroupState { customSessionGroups: CustomSessionGroup[]; diff --git a/src/store/session/slices/sessionGroup/reducer.test.ts b/src/store/session/slices/sessionGroup/reducer.test.ts index 5c5b713fb7..3ff030d322 100644 --- a/src/store/session/slices/sessionGroup/reducer.test.ts +++ b/src/store/session/slices/sessionGroup/reducer.test.ts @@ -1,7 +1,7 @@ import { nanoid } from 'nanoid'; import { describe, expect, it } from 'vitest'; -import type { SessionGroupItem } from '@/types/session'; +import { type SessionGroupItem } from '@/types/session'; import { sessionGroupsReducer } from './reducer'; diff --git a/src/store/session/slices/sessionGroup/reducer.ts b/src/store/session/slices/sessionGroup/reducer.ts index 6146ec4f78..0daee15fd1 100644 --- a/src/store/session/slices/sessionGroup/reducer.ts +++ b/src/store/session/slices/sessionGroup/reducer.ts @@ -1,4 +1,4 @@ -import type {SessionGroupItem} from '@/types/session'; +import { type SessionGroupItem } from '@/types/session'; export type AddSessionGroupAction = { item: SessionGroupItem; type: 'addSessionGroupItem' }; export type DeleteSessionGroupAction = { id: string; type: 'deleteSessionGroupItem' }; diff --git a/src/store/session/slices/sessionGroup/selectors.ts b/src/store/session/slices/sessionGroup/selectors.ts index 3351940112..12bbab60e8 100644 --- a/src/store/session/slices/sessionGroup/selectors.ts +++ b/src/store/session/slices/sessionGroup/selectors.ts @@ -1,4 +1,4 @@ -import type {SessionStore} from '@/store/session'; +import { type SessionStore } from '@/store/session'; const sessionGroupItems = (s: SessionStore) => s.sessionGroups; diff --git a/src/store/session/store.ts b/src/store/session/store.ts index fc761b8f84..8fdd73d17f 100644 --- a/src/store/session/store.ts +++ b/src/store/session/store.ts @@ -1,21 +1,21 @@ import { subscribeWithSelector } from 'zustand/middleware'; import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { isDev } from '@/utils/env'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {SessionStoreState} from './initialState'; +import { type SessionStoreState } from './initialState'; import { initialState } from './initialState'; -import type {HomeInputAction} from './slices/homeInput/action'; +import { type HomeInputAction } from './slices/homeInput/action'; import { createHomeInputSlice } from './slices/homeInput/action'; -import type {RecentAction} from './slices/recent/action'; +import { type RecentAction } from './slices/recent/action'; import { createRecentSlice } from './slices/recent/action'; -import type {SessionAction} from './slices/session/action'; +import { type SessionAction } from './slices/session/action'; import { createSessionSlice } from './slices/session/action'; -import type {SessionGroupAction} from './slices/sessionGroup/action'; +import { type SessionGroupAction } from './slices/sessionGroup/action'; import { createSessionGroupSlice } from './slices/sessionGroup/action'; // =============== Aggregate createStoreFn ============ // diff --git a/src/store/tool/helpers.ts b/src/store/tool/helpers.ts index 4db34744a4..2d049bb4c4 100644 --- a/src/store/tool/helpers.ts +++ b/src/store/tool/helpers.ts @@ -1,7 +1,7 @@ -import type {LobeTool} from '@lobechat/types'; -import type { PluginSchema } from '@lobehub/chat-plugin-sdk'; +import { type LobeTool } from '@lobechat/types'; +import { type PluginSchema } from '@lobehub/chat-plugin-sdk'; -import type {MetaData} from '@/types/meta'; +import { type MetaData } from '@/types/meta'; const getPluginFormList = (list: LobeTool[], id: string) => list?.find((p) => p.identifier === id); diff --git a/src/store/tool/initialState.ts b/src/store/tool/initialState.ts index 334466ebea..4c19478265 100644 --- a/src/store/tool/initialState.ts +++ b/src/store/tool/initialState.ts @@ -1,20 +1,16 @@ -import type {BuiltinToolState} from './slices/builtin/initialState'; -import { initialBuiltinToolState } from './slices/builtin/initialState'; -import type {CustomPluginState} from './slices/customPlugin/initialState'; -import { - initialCustomPluginState -} from './slices/customPlugin/initialState'; -import type {KlavisStoreState} from './slices/klavisStore/initialState'; +import { type BuiltinToolState } from './slices/builtin/initialState'; +import { initialBuiltinToolState } from './slices/builtin/initialState'; +import { type CustomPluginState } from './slices/customPlugin/initialState'; +import { initialCustomPluginState } from './slices/customPlugin/initialState'; +import { type KlavisStoreState } from './slices/klavisStore/initialState'; import { initialKlavisStoreState } from './slices/klavisStore/initialState'; -import type {LobehubSkillStoreState} from './slices/lobehubSkillStore/initialState'; -import { - initialLobehubSkillStoreState -} from './slices/lobehubSkillStore/initialState'; -import type {MCPStoreState} from './slices/mcpStore/initialState'; +import { type LobehubSkillStoreState } from './slices/lobehubSkillStore/initialState'; +import { initialLobehubSkillStoreState } from './slices/lobehubSkillStore/initialState'; +import { type MCPStoreState } from './slices/mcpStore/initialState'; import { initialMCPStoreState } from './slices/mcpStore/initialState'; -import type {PluginStoreState} from './slices/oldStore/initialState'; +import { type PluginStoreState } from './slices/oldStore/initialState'; import { initialPluginStoreState } from './slices/oldStore/initialState'; -import type {PluginState} from './slices/plugin/initialState'; +import { type PluginState } from './slices/plugin/initialState'; import { initialPluginState } from './slices/plugin/initialState'; export type ToolStoreState = PluginState & diff --git a/src/store/tool/selectors/tool.test.ts b/src/store/tool/selectors/tool.test.ts index 9c509a0cd2..46031fb6e9 100644 --- a/src/store/tool/selectors/tool.test.ts +++ b/src/store/tool/selectors/tool.test.ts @@ -1,7 +1,7 @@ -import type { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; import { describe, expect, it } from 'vitest'; -import type { ToolStoreState } from '../initialState'; +import { type ToolStoreState } from '../initialState'; import { initialState } from '../initialState'; import { toolSelectors } from './tool'; diff --git a/src/store/tool/selectors/tool.ts b/src/store/tool/selectors/tool.ts index 8043665732..7df9399380 100644 --- a/src/store/tool/selectors/tool.ts +++ b/src/store/tool/selectors/tool.ts @@ -1,10 +1,10 @@ -import type {RenderDisplayControl} from '@lobechat/types'; -import type { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; +import { type RenderDisplayControl } from '@lobechat/types'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; -import type {MetaData} from '@/types/meta'; -import type {LobeToolMeta} from '@/types/tool/tool'; +import { type MetaData } from '@/types/meta'; +import { type LobeToolMeta } from '@/types/tool/tool'; -import type {ToolStoreState} from '../initialState'; +import { type ToolStoreState } from '../initialState'; import { builtinToolSelectors } from '../slices/builtin/selectors'; import { lobehubSkillStoreSelectors } from '../slices/lobehubSkillStore/selectors'; import { pluginSelectors } from '../slices/plugin/selectors'; diff --git a/src/store/tool/slices/builtin/action.ts b/src/store/tool/slices/builtin/action.ts index 1fd7c154e8..2697705b5b 100644 --- a/src/store/tool/slices/builtin/action.ts +++ b/src/store/tool/slices/builtin/action.ts @@ -1,15 +1,15 @@ import debug from 'debug'; -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; import { mutate } from '@/libs/swr'; import { userService } from '@/services/user'; -import type { StoreSetter } from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; -import type { ToolStore } from '../../store'; +import { type ToolStore } from '../../store'; import { invokeExecutor } from './executors/index'; -import type { BuiltinToolContext, BuiltinToolResult } from './types'; +import { type BuiltinToolContext, type BuiltinToolResult } from './types'; const n = setNamespace('builtinTool'); const log = debug('lobe-store:builtin-tool'); diff --git a/src/store/tool/slices/builtin/executors/__tests__/BaseExecutor.test.ts b/src/store/tool/slices/builtin/executors/__tests__/BaseExecutor.test.ts index 4b0bde436e..c21c7a3303 100644 --- a/src/store/tool/slices/builtin/executors/__tests__/BaseExecutor.test.ts +++ b/src/store/tool/slices/builtin/executors/__tests__/BaseExecutor.test.ts @@ -1,8 +1,8 @@ /** * Tests for BaseExecutor */ -import type {BuiltinToolContext, BuiltinToolResult} from '@lobechat/types'; -import { BaseExecutor } from '@lobechat/types'; +import { type BuiltinToolContext, type BuiltinToolResult } from '@lobechat/types'; +import { BaseExecutor } from '@lobechat/types'; import { describe, expect, it } from 'vitest'; // Test API enum diff --git a/src/store/tool/slices/builtin/executors/__tests__/lobe-web-browsing.test.ts b/src/store/tool/slices/builtin/executors/__tests__/lobe-web-browsing.test.ts index c0543ad256..4d5dd51904 100644 --- a/src/store/tool/slices/builtin/executors/__tests__/lobe-web-browsing.test.ts +++ b/src/store/tool/slices/builtin/executors/__tests__/lobe-web-browsing.test.ts @@ -5,7 +5,7 @@ import { WebBrowsingApiName } from '@lobechat/builtin-tool-web-browsing'; import { SEARCH_SEARXNG_NOT_CONFIG } from '@lobechat/types'; import { beforeEach, describe, expect, it, vi } from 'vitest'; -import type { BuiltinToolContext } from '../../types'; +import { type BuiltinToolContext } from '../../types'; import { webBrowsing } from '../lobe-web-browsing'; // Mock searchService diff --git a/src/store/tool/slices/builtin/executors/lobe-web-browsing.ts b/src/store/tool/slices/builtin/executors/lobe-web-browsing.ts index ceb9930c53..90cfbea594 100644 --- a/src/store/tool/slices/builtin/executors/lobe-web-browsing.ts +++ b/src/store/tool/slices/builtin/executors/lobe-web-browsing.ts @@ -5,12 +5,15 @@ */ import { WebBrowsingApiName, WebBrowsingManifest } from '@lobechat/builtin-tool-web-browsing'; import { WebBrowsingExecutionRuntime } from '@lobechat/builtin-tool-web-browsing/executionRuntime'; -import type {BuiltinToolContext, BuiltinToolResult, CrawlMultiPagesQuery, CrawlPluginState, SearchQuery} from '@lobechat/types'; import { - BaseExecutor, - SEARCH_SEARXNG_NOT_CONFIG + type BuiltinToolContext, + type BuiltinToolResult, + type CrawlMultiPagesQuery, + type CrawlPluginState, + type SearchQuery, } from '@lobechat/types'; -import type {CrawlSuccessResult} from '@lobechat/web-crawler'; +import { BaseExecutor, SEARCH_SEARXNG_NOT_CONFIG } from '@lobechat/types'; +import { type CrawlSuccessResult } from '@lobechat/web-crawler'; import { notebookService } from '@/services/notebook'; import { searchService } from '@/services/search'; diff --git a/src/store/tool/slices/builtin/initialState.ts b/src/store/tool/slices/builtin/initialState.ts index 2e25f68897..e09e1de02b 100644 --- a/src/store/tool/slices/builtin/initialState.ts +++ b/src/store/tool/slices/builtin/initialState.ts @@ -1,4 +1,4 @@ -import type { LobeBuiltinTool } from '@lobechat/types'; +import { type LobeBuiltinTool } from '@lobechat/types'; import { builtinTools } from '@/tools'; diff --git a/src/store/tool/slices/builtin/selectors.test.ts b/src/store/tool/slices/builtin/selectors.test.ts index 4b99fee8c2..19415d70e2 100644 --- a/src/store/tool/slices/builtin/selectors.test.ts +++ b/src/store/tool/slices/builtin/selectors.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { ToolStoreState } from '../../initialState'; +import { type ToolStoreState } from '../../initialState'; import { initialState } from '../../initialState'; import { builtinToolSelectors } from './selectors'; diff --git a/src/store/tool/slices/builtin/selectors.ts b/src/store/tool/slices/builtin/selectors.ts index 4e2b4df1d1..637594e733 100644 --- a/src/store/tool/slices/builtin/selectors.ts +++ b/src/store/tool/slices/builtin/selectors.ts @@ -1,8 +1,8 @@ -import type { LobeToolMeta } from '@lobechat/types'; +import { type LobeToolMeta } from '@lobechat/types'; import { shouldEnableTool } from '@/helpers/toolFilters'; -import type { ToolStoreState } from '../../initialState'; +import { type ToolStoreState } from '../../initialState'; import { KlavisServerStatus } from '../klavisStore'; export interface LobeToolMetaWithAvailability extends LobeToolMeta { diff --git a/src/store/tool/slices/customPlugin/action.test.ts b/src/store/tool/slices/customPlugin/action.test.ts index 369ea6d9a8..7a02f797c2 100644 --- a/src/store/tool/slices/customPlugin/action.test.ts +++ b/src/store/tool/slices/customPlugin/action.test.ts @@ -2,7 +2,7 @@ import { act, renderHook } from '@testing-library/react'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { pluginService } from '@/services/plugin'; -import type { LobeToolCustomPlugin } from '@/types/tool/plugin'; +import { type LobeToolCustomPlugin } from '@/types/tool/plugin'; import { useToolStore } from '../../store'; import { defaultCustomPlugin } from './initialState'; diff --git a/src/store/tool/slices/customPlugin/action.ts b/src/store/tool/slices/customPlugin/action.ts index fe983572fb..c914789006 100644 --- a/src/store/tool/slices/customPlugin/action.ts +++ b/src/store/tool/slices/customPlugin/action.ts @@ -1,4 +1,4 @@ -import type {LobeChatPluginManifest} from '@lobehub/chat-plugin-sdk'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; import { merge } from 'es-toolkit/compat'; import { t } from 'i18next'; @@ -7,11 +7,11 @@ import { mcpService } from '@/services/mcp'; import { pluginService } from '@/services/plugin'; import { toolService } from '@/services/tool'; import { pluginHelpers } from '@/store/tool/helpers'; -import type {StoreSetter} from '@/store/types'; -import type {LobeToolCustomPlugin, PluginInstallError} from '@/types/tool/plugin'; +import { type StoreSetter } from '@/store/types'; +import { type LobeToolCustomPlugin, type PluginInstallError } from '@/types/tool/plugin'; import { setNamespace } from '@/utils/storeDebug'; -import type {ToolStore} from '../../store'; +import { type ToolStore } from '../../store'; import { pluginSelectors } from '../plugin/selectors'; import { defaultCustomPlugin } from './initialState'; diff --git a/src/store/tool/slices/customPlugin/initialState.ts b/src/store/tool/slices/customPlugin/initialState.ts index 3e05e9aa1f..5e7ee4413c 100644 --- a/src/store/tool/slices/customPlugin/initialState.ts +++ b/src/store/tool/slices/customPlugin/initialState.ts @@ -1,4 +1,4 @@ -import type {LobeToolCustomPlugin} from '@/types/tool/plugin'; +import { type LobeToolCustomPlugin } from '@/types/tool/plugin'; export interface CustomPluginState { customPluginSearchKeywords?: string; diff --git a/src/store/tool/slices/customPlugin/reducers/customPluginList.ts b/src/store/tool/slices/customPlugin/reducers/customPluginList.ts index 98fbb973f4..adebffacf3 100644 --- a/src/store/tool/slices/customPlugin/reducers/customPluginList.ts +++ b/src/store/tool/slices/customPlugin/reducers/customPluginList.ts @@ -1,6 +1,6 @@ import { produce } from 'immer'; -import type {LobeToolCustomPlugin} from '@/types/tool/plugin'; +import { type LobeToolCustomPlugin } from '@/types/tool/plugin'; export type DevListState = LobeToolCustomPlugin[]; diff --git a/src/store/tool/slices/customPlugin/selectors.test.ts b/src/store/tool/slices/customPlugin/selectors.test.ts index fc9fef0cfd..19779b6791 100644 --- a/src/store/tool/slices/customPlugin/selectors.test.ts +++ b/src/store/tool/slices/customPlugin/selectors.test.ts @@ -1,7 +1,7 @@ -import type { LobeChatPluginManifest, LobeChatPluginMeta } from '@lobehub/chat-plugin-sdk'; +import { type LobeChatPluginManifest, type LobeChatPluginMeta } from '@lobehub/chat-plugin-sdk'; import { describe, expect, it } from 'vitest'; -import type {ToolStoreState } from '../../initialState'; +import { type ToolStoreState } from '../../initialState'; import { initialState } from '../../initialState'; import { customPluginSelectors } from './selectors'; diff --git a/src/store/tool/slices/customPlugin/selectors.ts b/src/store/tool/slices/customPlugin/selectors.ts index e69580553b..3c841fc924 100644 --- a/src/store/tool/slices/customPlugin/selectors.ts +++ b/src/store/tool/slices/customPlugin/selectors.ts @@ -1,5 +1,5 @@ import { pluginHelpers } from '../../helpers'; -import type { ToolStoreState } from '../../initialState'; +import { type ToolStoreState } from '../../initialState'; const isCustomPlugin = (id: string) => (s: ToolStoreState) => pluginHelpers.isCustomPlugin(id, s.installedPlugins); diff --git a/src/store/tool/slices/klavisStore/action.ts b/src/store/tool/slices/klavisStore/action.ts index b66ee9a671..feb66c8c90 100644 --- a/src/store/tool/slices/klavisStore/action.ts +++ b/src/store/tool/slices/klavisStore/action.ts @@ -1,17 +1,21 @@ import { enableMapSet, produce } from 'immer'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; import { lambdaClient, toolsClient } from '@/libs/trpc/client'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; -import type {ToolStore} from '../../store'; -import type {KlavisStoreState} from './initialState'; -import type {CallKlavisToolParams, CallKlavisToolResult, CreateKlavisServerParams, KlavisServer, KlavisTool} from './types'; +import { type ToolStore } from '../../store'; +import { type KlavisStoreState } from './initialState'; import { - KlavisServerStatus + type CallKlavisToolParams, + type CallKlavisToolResult, + type CreateKlavisServerParams, + type KlavisServer, + type KlavisTool, } from './types'; +import { KlavisServerStatus } from './types'; enableMapSet(); diff --git a/src/store/tool/slices/klavisStore/initialState.ts b/src/store/tool/slices/klavisStore/initialState.ts index c8e16440aa..fd55466c64 100644 --- a/src/store/tool/slices/klavisStore/initialState.ts +++ b/src/store/tool/slices/klavisStore/initialState.ts @@ -1,4 +1,4 @@ -import type {KlavisServer} from './types'; +import { type KlavisServer } from './types'; /** * Klavis Store state interface diff --git a/src/store/tool/slices/klavisStore/selectors.test.ts b/src/store/tool/slices/klavisStore/selectors.test.ts index 1ba0cd5c6f..f6bcf1d34c 100644 --- a/src/store/tool/slices/klavisStore/selectors.test.ts +++ b/src/store/tool/slices/klavisStore/selectors.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest'; import { initialState } from '../../initialState'; -import type { ToolStore } from '../../store'; +import { type ToolStore } from '../../store'; import { klavisStoreSelectors } from './selectors'; import { KlavisServerStatus } from './types'; diff --git a/src/store/tool/slices/klavisStore/selectors.ts b/src/store/tool/slices/klavisStore/selectors.ts index e2302aeba1..3a8b32a313 100644 --- a/src/store/tool/slices/klavisStore/selectors.ts +++ b/src/store/tool/slices/klavisStore/selectors.ts @@ -1,6 +1,6 @@ -import type {ToolStore} from '../../store'; -import type {KlavisServer} from './types'; -import { KlavisServerStatus } from './types'; +import { type ToolStore } from '../../store'; +import { type KlavisServer } from './types'; +import { KlavisServerStatus } from './types'; /** * Klavis Store Selectors diff --git a/src/store/tool/slices/lobehubSkillStore/action.ts b/src/store/tool/slices/lobehubSkillStore/action.ts index 97bad93d8c..bd8ea09454 100644 --- a/src/store/tool/slices/lobehubSkillStore/action.ts +++ b/src/store/tool/slices/lobehubSkillStore/action.ts @@ -1,18 +1,21 @@ import { getLobehubSkillProviderById } from '@lobechat/const'; import { enableMapSet, produce } from 'immer'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; import { toolsClient } from '@/libs/trpc/client'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; -import type {ToolStore} from '../../store'; -import type {LobehubSkillStoreState} from './initialState'; -import type {CallLobehubSkillToolParams, CallLobehubSkillToolResult, LobehubSkillServer, LobehubSkillTool} from './types'; +import { type ToolStore } from '../../store'; +import { type LobehubSkillStoreState } from './initialState'; import { - LobehubSkillStatus + type CallLobehubSkillToolParams, + type CallLobehubSkillToolResult, + type LobehubSkillServer, + type LobehubSkillTool, } from './types'; +import { LobehubSkillStatus } from './types'; enableMapSet(); diff --git a/src/store/tool/slices/lobehubSkillStore/initialState.ts b/src/store/tool/slices/lobehubSkillStore/initialState.ts index fa9b1e24f2..035775f7c6 100644 --- a/src/store/tool/slices/lobehubSkillStore/initialState.ts +++ b/src/store/tool/slices/lobehubSkillStore/initialState.ts @@ -1,4 +1,4 @@ -import type {LobehubSkillServer} from './types'; +import { type LobehubSkillServer } from './types'; /** * LobeHub Skill Store state interface diff --git a/src/store/tool/slices/lobehubSkillStore/selectors.test.ts b/src/store/tool/slices/lobehubSkillStore/selectors.test.ts index 207a25333b..a718428da8 100644 --- a/src/store/tool/slices/lobehubSkillStore/selectors.test.ts +++ b/src/store/tool/slices/lobehubSkillStore/selectors.test.ts @@ -1,10 +1,10 @@ import { describe, expect, it } from 'vitest'; import { initialState } from '../../initialState'; -import type {ToolStore} from '../../store'; +import { type ToolStore } from '../../store'; import { lobehubSkillStoreSelectors } from './selectors'; -import type {LobehubSkillServer} from './types'; -import { LobehubSkillStatus } from './types'; +import { type LobehubSkillServer } from './types'; +import { LobehubSkillStatus } from './types'; describe('lobehubSkillStoreSelectors', () => { describe('getServers', () => { diff --git a/src/store/tool/slices/lobehubSkillStore/selectors.ts b/src/store/tool/slices/lobehubSkillStore/selectors.ts index e1a4238c62..a7af9d1b02 100644 --- a/src/store/tool/slices/lobehubSkillStore/selectors.ts +++ b/src/store/tool/slices/lobehubSkillStore/selectors.ts @@ -1,6 +1,6 @@ -import type {ToolStoreState} from '../../initialState'; -import type {LobehubSkillServer} from './types'; -import { LobehubSkillStatus } from './types'; +import { type ToolStoreState } from '../../initialState'; +import { type LobehubSkillServer } from './types'; +import { LobehubSkillStatus } from './types'; /** * LobeHub Skill Store Selectors diff --git a/src/store/tool/slices/mcpStore/action.test.ts b/src/store/tool/slices/mcpStore/action.test.ts index 29d1fc7b3a..06a5677c24 100644 --- a/src/store/tool/slices/mcpStore/action.test.ts +++ b/src/store/tool/slices/mcpStore/action.test.ts @@ -1,5 +1,5 @@ -import type { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; -import type { PluginItem } from '@lobehub/market-sdk'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; +import { type PluginItem } from '@lobehub/market-sdk'; import { act, renderHook, waitFor } from '@testing-library/react'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; @@ -7,7 +7,7 @@ import { discoverService } from '@/services/discover'; import { mcpService } from '@/services/mcp'; import { pluginService } from '@/services/plugin'; import { globalHelpers } from '@/store/global/helpers'; -import type { CheckMcpInstallResult} from '@/types/plugins'; +import { type CheckMcpInstallResult } from '@/types/plugins'; import { MCPInstallStep } from '@/types/plugins'; import { useToolStore } from '../../store'; diff --git a/src/store/tool/slices/mcpStore/action.ts b/src/store/tool/slices/mcpStore/action.ts index f82c86023f..cb3bc8d6cc 100644 --- a/src/store/tool/slices/mcpStore/action.ts +++ b/src/store/tool/slices/mcpStore/action.ts @@ -1,32 +1,36 @@ import { CURRENT_VERSION, isDesktop } from '@lobechat/const'; -import type {LobeChatPluginManifest} from '@lobehub/chat-plugin-sdk'; -import type {PluginItem, PluginListResponse} from '@lobehub/market-sdk'; -import type {TRPCClientError} from '@trpc/client'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; +import { type PluginItem, type PluginListResponse } from '@lobehub/market-sdk'; +import { type TRPCClientError } from '@trpc/client'; import debug from 'debug'; import { uniqBy } from 'es-toolkit/compat'; import { produce } from 'immer'; import { gt, valid } from 'semver'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; -import type {MCPErrorData} from '@/libs/mcp/types'; -import { parseStdioErrorMessage } from '@/libs/mcp/types'; +import { type MCPErrorData } from '@/libs/mcp/types'; +import { parseStdioErrorMessage } from '@/libs/mcp/types'; import { discoverService } from '@/services/discover'; import { mcpService } from '@/services/mcp'; import { pluginService } from '@/services/plugin'; import { globalHelpers } from '@/store/global/helpers'; import { mcpStoreSelectors } from '@/store/tool/selectors'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { McpConnectionType } from '@/types/discover'; -import type {CheckMcpInstallResult, McpConnectionParams, MCPErrorInfo, MCPInstallProgress, MCPPluginListParams} from '@/types/plugins'; import { - MCPInstallStep + type CheckMcpInstallResult, + type McpConnectionParams, + type MCPErrorInfo, + type MCPInstallProgress, + type MCPPluginListParams, } from '@/types/plugins'; +import { MCPInstallStep } from '@/types/plugins'; import { sleep } from '@/utils/sleep'; import { setNamespace } from '@/utils/storeDebug'; -import type {ToolStore} from '../../store'; -import type {MCPStoreState} from './initialState'; +import { type ToolStore } from '../../store'; +import { type MCPStoreState } from './initialState'; const log = debug('lobe-mcp:store:action'); diff --git a/src/store/tool/slices/mcpStore/initialState.ts b/src/store/tool/slices/mcpStore/initialState.ts index 1a97b0d7aa..634ebacf4d 100644 --- a/src/store/tool/slices/mcpStore/initialState.ts +++ b/src/store/tool/slices/mcpStore/initialState.ts @@ -1,6 +1,6 @@ -import type {PluginItem} from '@lobehub/market-sdk'; +import { type PluginItem } from '@lobehub/market-sdk'; -import type {MCPInstallProgressMap} from '@/types/plugins'; +import { type MCPInstallProgressMap } from '@/types/plugins'; export interface MCPStoreState { activeMCPIdentifier?: string; diff --git a/src/store/tool/slices/mcpStore/selectors.ts b/src/store/tool/slices/mcpStore/selectors.ts index 25336501ef..2e32aae073 100644 --- a/src/store/tool/slices/mcpStore/selectors.ts +++ b/src/store/tool/slices/mcpStore/selectors.ts @@ -1,6 +1,6 @@ -import type {InstallPluginMeta} from '@/types/tool/plugin'; +import { type InstallPluginMeta } from '@/types/tool/plugin'; -import type { ToolStoreState } from '../../initialState'; +import { type ToolStoreState } from '../../initialState'; const mcpPluginList = (s: ToolStoreState) => { const installedPluginIds = new Set(s.installedPlugins.map((i) => i.identifier)); diff --git a/src/store/tool/slices/oldStore/action.test.ts b/src/store/tool/slices/oldStore/action.test.ts index b2e91a8d98..3d2e967037 100644 --- a/src/store/tool/slices/oldStore/action.test.ts +++ b/src/store/tool/slices/oldStore/action.test.ts @@ -1,12 +1,12 @@ -import type { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; import { act, renderHook, waitFor } from '@testing-library/react'; -import type { Mock} from 'vitest'; +import { type Mock } from 'vitest'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { notification } from '@/components/AntdStaticMethods'; import { pluginService } from '@/services/plugin'; import { toolService } from '@/services/tool'; -import type { DiscoverPluginItem } from '@/types/discover'; +import { type DiscoverPluginItem } from '@/types/discover'; import { useToolStore } from '../../store'; diff --git a/src/store/tool/slices/oldStore/action.ts b/src/store/tool/slices/oldStore/action.ts index aa9a9b6855..f33fd5e589 100644 --- a/src/store/tool/slices/oldStore/action.ts +++ b/src/store/tool/slices/oldStore/action.ts @@ -1,8 +1,8 @@ -import type {LobeTool} from '@lobechat/types'; +import { type LobeTool } from '@lobechat/types'; import { uniqBy } from 'es-toolkit/compat'; import { t } from 'i18next'; import { produce } from 'immer'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; import { notification } from '@/components/AntdStaticMethods'; @@ -11,17 +11,19 @@ import { pluginService } from '@/services/plugin'; import { toolService } from '@/services/tool'; import { globalHelpers } from '@/store/global/helpers'; import { pluginStoreSelectors } from '@/store/tool/selectors'; -import type {StoreSetter} from '@/store/types'; -import type {DiscoverPluginItem, PluginListResponse, PluginQueryParams} from '@/types/discover'; -import type {PluginInstallError} from '@/types/tool/plugin'; +import { type StoreSetter } from '@/store/types'; +import { + type DiscoverPluginItem, + type PluginListResponse, + type PluginQueryParams, +} from '@/types/discover'; +import { type PluginInstallError } from '@/types/tool/plugin'; import { sleep } from '@/utils/sleep'; import { setNamespace } from '@/utils/storeDebug'; -import type {ToolStore} from '../../store'; -import type {PluginInstallProgress, PluginStoreState} from './initialState'; -import { - PluginInstallStep -} from './initialState'; +import { type ToolStore } from '../../store'; +import { type PluginInstallProgress, type PluginStoreState } from './initialState'; +import { PluginInstallStep } from './initialState'; const n = setNamespace('pluginStore'); diff --git a/src/store/tool/slices/oldStore/initialState.ts b/src/store/tool/slices/oldStore/initialState.ts index 3264b54655..3f2a131fb8 100644 --- a/src/store/tool/slices/oldStore/initialState.ts +++ b/src/store/tool/slices/oldStore/initialState.ts @@ -1,4 +1,4 @@ -import type {DiscoverPluginItem} from '@/types/discover'; +import { type DiscoverPluginItem } from '@/types/discover'; export type PluginInstallLoadingMap = Record; @@ -15,7 +15,6 @@ export enum PluginInstallStep { FETCHING_MANIFEST = 'FETCHING_MANIFEST', INSTALLING_PLUGIN = 'INSTALLING_PLUGIN', } - export interface PluginInstallProgress { // Error message diff --git a/src/store/tool/slices/oldStore/selectors.test.ts b/src/store/tool/slices/oldStore/selectors.test.ts index c5e16f06ff..af68b974e2 100644 --- a/src/store/tool/slices/oldStore/selectors.test.ts +++ b/src/store/tool/slices/oldStore/selectors.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type {ToolStoreState } from '../../initialState'; +import { type ToolStoreState } from '../../initialState'; import { initialState } from '../../initialState'; import { pluginStoreSelectors } from './selectors'; diff --git a/src/store/tool/slices/oldStore/selectors.ts b/src/store/tool/slices/oldStore/selectors.ts index c7bc4db5c0..5bd0d4ec0f 100644 --- a/src/store/tool/slices/oldStore/selectors.ts +++ b/src/store/tool/slices/oldStore/selectors.ts @@ -1,7 +1,7 @@ import { PluginStoreTabs } from '@/store/tool/slices/oldStore/initialState'; -import type {InstallPluginMeta} from '@/types/tool/plugin'; +import { type InstallPluginMeta } from '@/types/tool/plugin'; -import type { ToolStoreState } from '../../initialState'; +import { type ToolStoreState } from '../../initialState'; const onlinePluginStore = (s: ToolStoreState) => { const installedPluginIds = new Set(s.installedPlugins.map((i) => i.identifier)); diff --git a/src/store/tool/slices/plugin/action.test.ts b/src/store/tool/slices/plugin/action.test.ts index 5a952d9b7b..9a6e07279f 100644 --- a/src/store/tool/slices/plugin/action.test.ts +++ b/src/store/tool/slices/plugin/action.test.ts @@ -1,9 +1,9 @@ -import type { LobeTool } from '@lobechat/types'; +import { type LobeTool } from '@lobechat/types'; import { act, renderHook } from '@testing-library/react'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { pluginService } from '@/services/plugin'; -import type { DiscoverPluginItem } from '@/types/discover'; +import { type DiscoverPluginItem } from '@/types/discover'; import { merge } from '@/utils/merge'; import { useToolStore } from '../../store'; diff --git a/src/store/tool/slices/plugin/action.ts b/src/store/tool/slices/plugin/action.ts index f3ffa7074d..a531485560 100644 --- a/src/store/tool/slices/plugin/action.ts +++ b/src/store/tool/slices/plugin/action.ts @@ -1,13 +1,13 @@ -import type {Schema, ValidationResult} from '@cfworker/json-schema'; -import type {SWRResponse} from 'swr'; +import { type Schema, type ValidationResult } from '@cfworker/json-schema'; +import { type SWRResponse } from 'swr'; import { MESSAGE_CANCEL_FLAT } from '@/const/message'; import { useClientDataSWR } from '@/libs/swr'; import { pluginService } from '@/services/plugin'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { merge } from '@/utils/merge'; -import type {ToolStore} from '../../store'; +import { type ToolStore } from '../../store'; import { pluginStoreSelectors } from '../oldStore/selectors'; import { pluginSelectors } from './selectors'; diff --git a/src/store/tool/slices/plugin/initialState.ts b/src/store/tool/slices/plugin/initialState.ts index 34782edbe0..3e77a9369c 100644 --- a/src/store/tool/slices/plugin/initialState.ts +++ b/src/store/tool/slices/plugin/initialState.ts @@ -1,4 +1,4 @@ -import type {LobeTool} from '@lobechat/types'; +import { type LobeTool } from '@lobechat/types'; export type PluginsSettings = Record; diff --git a/src/store/tool/slices/plugin/reducers/manifest.ts b/src/store/tool/slices/plugin/reducers/manifest.ts index 346af955e8..77e0cf2110 100644 --- a/src/store/tool/slices/plugin/reducers/manifest.ts +++ b/src/store/tool/slices/plugin/reducers/manifest.ts @@ -1,7 +1,7 @@ -import type {LobeChatPluginManifest} from '@lobehub/chat-plugin-sdk'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; import { produce } from 'immer'; -import type {PluginManifestMap} from '@/types/tool/plugin'; +import { type PluginManifestMap } from '@/types/tool/plugin'; type AddManifestDispatch = { id: string; plugin: LobeChatPluginManifest; type: 'addManifest' }; type DeleteManifestDispatch = { id: string; type: 'deleteManifest' }; diff --git a/src/store/tool/slices/plugin/selectors.test.ts b/src/store/tool/slices/plugin/selectors.test.ts index 0e3f88b519..f8878f58db 100644 --- a/src/store/tool/slices/plugin/selectors.test.ts +++ b/src/store/tool/slices/plugin/selectors.test.ts @@ -1,10 +1,10 @@ -import type { LobeChatPluginManifest} from '@lobehub/chat-plugin-sdk'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; import { describe, expect, it } from 'vitest'; -import type { DiscoverPluginItem } from '@/types/discover'; +import { type DiscoverPluginItem } from '@/types/discover'; -import type { ToolStoreState } from '../../initialState'; -import { initialState } from '../../initialState'; +import { type ToolStoreState } from '../../initialState'; +import { initialState } from '../../initialState'; import { pluginSelectors } from './selectors'; const mockState = { diff --git a/src/store/tool/slices/plugin/selectors.ts b/src/store/tool/slices/plugin/selectors.ts index ddc4871a5e..6b6c09d115 100644 --- a/src/store/tool/slices/plugin/selectors.ts +++ b/src/store/tool/slices/plugin/selectors.ts @@ -1,9 +1,9 @@ -import type {LobeChatPluginManifest} from '@lobehub/chat-plugin-sdk'; +import { type LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk'; import { uniq } from 'es-toolkit/compat'; -import type {InstallPluginMeta, LobeToolCustomPlugin} from '@/types/tool/plugin'; +import { type InstallPluginMeta, type LobeToolCustomPlugin } from '@/types/tool/plugin'; -import type { ToolStoreState } from '../../initialState'; +import { type ToolStoreState } from '../../initialState'; const installedPlugins = (s: ToolStoreState) => s.installedPlugins; diff --git a/src/store/tool/store.ts b/src/store/tool/store.ts index 21b36443d0..5b28e2e3b6 100644 --- a/src/store/tool/store.ts +++ b/src/store/tool/store.ts @@ -1,26 +1,24 @@ import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {ToolStoreState} from './initialState'; +import { type ToolStoreState } from './initialState'; import { initialState } from './initialState'; -import type {BuiltinToolAction} from './slices/builtin'; -import { createBuiltinToolSlice } from './slices/builtin'; -import type {CustomPluginAction} from './slices/customPlugin'; +import { type BuiltinToolAction } from './slices/builtin'; +import { createBuiltinToolSlice } from './slices/builtin'; +import { type CustomPluginAction } from './slices/customPlugin'; import { createCustomPluginSlice } from './slices/customPlugin'; -import type {KlavisStoreAction} from './slices/klavisStore'; +import { type KlavisStoreAction } from './slices/klavisStore'; import { createKlavisStoreSlice } from './slices/klavisStore'; -import type {LobehubSkillStoreAction} from './slices/lobehubSkillStore'; -import { - createLobehubSkillStoreSlice -} from './slices/lobehubSkillStore'; -import type {PluginMCPStoreAction} from './slices/mcpStore'; +import { type LobehubSkillStoreAction } from './slices/lobehubSkillStore'; +import { createLobehubSkillStoreSlice } from './slices/lobehubSkillStore'; +import { type PluginMCPStoreAction } from './slices/mcpStore'; import { createMCPPluginStoreSlice } from './slices/mcpStore'; -import type {PluginStoreAction} from './slices/oldStore'; +import { type PluginStoreAction } from './slices/oldStore'; import { createPluginStoreSlice } from './slices/oldStore'; -import type {PluginAction} from './slices/plugin'; +import { type PluginAction } from './slices/plugin'; import { createPluginSlice } from './slices/plugin'; // =============== Aggregate createStoreFn ============ // diff --git a/src/store/user/initialState.ts b/src/store/user/initialState.ts index 109a015803..5956cf98f8 100644 --- a/src/store/user/initialState.ts +++ b/src/store/user/initialState.ts @@ -1,12 +1,12 @@ -import type {UserAuthState} from './slices/auth/initialState'; +import { type UserAuthState } from './slices/auth/initialState'; import { initialAuthState } from './slices/auth/initialState'; -import type {CommonState} from './slices/common/initialState'; -import { initialCommonState } from './slices/common/initialState'; -import type {OnboardingState} from './slices/onboarding/initialState'; +import { type CommonState } from './slices/common/initialState'; +import { initialCommonState } from './slices/common/initialState'; +import { type OnboardingState } from './slices/onboarding/initialState'; import { initialOnboardingState } from './slices/onboarding/initialState'; -import type {UserPreferenceState} from './slices/preference/initialState'; +import { type UserPreferenceState } from './slices/preference/initialState'; import { initialPreferenceState } from './slices/preference/initialState'; -import type {UserSettingsState} from './slices/settings/initialState'; +import { type UserSettingsState } from './slices/settings/initialState'; import { initialSettingsState } from './slices/settings/initialState'; export type UserState = UserSettingsState & diff --git a/src/store/user/slices/auth/action.ts b/src/store/user/slices/auth/action.ts index 4173e157b3..3e507b97fb 100644 --- a/src/store/user/slices/auth/action.ts +++ b/src/store/user/slices/auth/action.ts @@ -1,8 +1,8 @@ -import type {SSOProvider} from '@lobechat/types'; +import { type SSOProvider } from '@lobechat/types'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; -import type { UserStore } from '../../store'; +import { type UserStore } from '../../store'; interface AuthProvidersData { hasPasswordAccount: boolean; diff --git a/src/store/user/slices/auth/initialState.ts b/src/store/user/slices/auth/initialState.ts index e8b87cde40..9ba2da2e42 100644 --- a/src/store/user/slices/auth/initialState.ts +++ b/src/store/user/slices/auth/initialState.ts @@ -1,6 +1,6 @@ -import type {SSOProvider} from '@lobechat/types'; +import { type SSOProvider } from '@lobechat/types'; -import type {LobeUser} from '@/types/user'; +import { type LobeUser } from '@/types/user'; export interface UserAuthState { authProviders?: SSOProvider[]; diff --git a/src/store/user/slices/auth/selectors.test.ts b/src/store/user/slices/auth/selectors.test.ts index c4ea2920f5..43e411767c 100644 --- a/src/store/user/slices/auth/selectors.test.ts +++ b/src/store/user/slices/auth/selectors.test.ts @@ -1,7 +1,7 @@ import { t } from 'i18next'; import { afterEach, describe, expect, it, vi } from 'vitest'; -import type { UserStore } from '@/store/user'; +import { type UserStore } from '@/store/user'; import { authSelectors, userProfileSelectors } from './selectors'; diff --git a/src/store/user/slices/auth/selectors.ts b/src/store/user/slices/auth/selectors.ts index 2253d0e64e..d520946574 100644 --- a/src/store/user/slices/auth/selectors.ts +++ b/src/store/user/slices/auth/selectors.ts @@ -1,7 +1,7 @@ -import type {LobeUser, SSOProvider} from '@lobechat/types'; +import { type LobeUser, type SSOProvider } from '@lobechat/types'; import { t } from 'i18next'; -import type { UserStore } from '@/store/user'; +import { type UserStore } from '@/store/user'; const nickName = (s: UserStore) => { const defaultNickName = s.user?.fullName || s.user?.username; diff --git a/src/store/user/slices/common/action.test.ts b/src/store/user/slices/common/action.test.ts index c6228a54fc..2ed8dca7b4 100644 --- a/src/store/user/slices/common/action.test.ts +++ b/src/store/user/slices/common/action.test.ts @@ -5,8 +5,8 @@ import { DEFAULT_PREFERENCE } from '@/const/user'; import { userService } from '@/services/user'; import { useUserStore } from '@/store/user'; import { userGeneralSettingsSelectors } from '@/store/user/selectors'; -import type { GlobalServerConfig } from '@/types/serverConfig'; -import type { UserInitializationState, UserPreference } from '@/types/user'; +import { type GlobalServerConfig } from '@/types/serverConfig'; +import { type UserInitializationState, type UserPreference } from '@/types/user'; import { withSWR } from '~test-utils'; vi.mock('zustand/traditional'); diff --git a/src/store/user/slices/common/action.ts b/src/store/user/slices/common/action.ts index 39980b3f65..9929eb13ba 100644 --- a/src/store/user/slices/common/action.ts +++ b/src/store/user/slices/common/action.ts @@ -1,17 +1,17 @@ import { isDesktop } from '@lobechat/const'; import { getSingletonAnalyticsOptional } from '@lobehub/analytics'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; -import type { PartialDeep } from 'type-fest'; +import { type PartialDeep } from 'type-fest'; import { DEFAULT_PREFERENCE } from '@/const/user'; import { mutate, useOnlyFetchOnceSWR } from '@/libs/swr'; import { userService } from '@/services/user'; -import type {StoreSetter} from '@/store/types'; -import type { UserStore } from '@/store/user'; -import type { GlobalServerConfig } from '@/types/serverConfig'; -import type {LobeUser, UserInitializationState} from '@/types/user'; -import type { UserSettings } from '@/types/user/settings'; +import { type StoreSetter } from '@/store/types'; +import { type UserStore } from '@/store/user'; +import { type GlobalServerConfig } from '@/types/serverConfig'; +import { type LobeUser, type UserInitializationState } from '@/types/user'; +import { type UserSettings } from '@/types/user/settings'; import { merge } from '@/utils/merge'; import { setNamespace } from '@/utils/storeDebug'; diff --git a/src/store/user/slices/common/initialState.ts b/src/store/user/slices/common/initialState.ts index b2b28cc370..90c45f853c 100644 --- a/src/store/user/slices/common/initialState.ts +++ b/src/store/user/slices/common/initialState.ts @@ -1,4 +1,4 @@ -import type {Plans, ReferralStatusString} from '@lobechat/types'; +import { type Plans, type ReferralStatusString } from '@lobechat/types'; export interface CommonState { isFreePlan?: boolean; diff --git a/src/store/user/slices/onboarding/action.ts b/src/store/user/slices/onboarding/action.ts index b20b4bc1ca..24841ce4db 100644 --- a/src/store/user/slices/onboarding/action.ts +++ b/src/store/user/slices/onboarding/action.ts @@ -3,8 +3,8 @@ import { MAX_ONBOARDING_STEPS } from '@lobechat/types'; import { userService } from '@/services/user'; import { getAgentStoreState } from '@/store/agent'; -import type {StoreSetter} from '@/store/types'; -import type { UserStore } from '@/store/user'; +import { type StoreSetter } from '@/store/types'; +import { type UserStore } from '@/store/user'; import { settingsSelectors } from '../settings/selectors'; import { onboardingSelectors } from './selectors'; diff --git a/src/store/user/slices/onboarding/initialState.ts b/src/store/user/slices/onboarding/initialState.ts index c4b9b91a2e..5e2b2b08bb 100644 --- a/src/store/user/slices/onboarding/initialState.ts +++ b/src/store/user/slices/onboarding/initialState.ts @@ -1,4 +1,4 @@ -import type {UserOnboarding} from '@/types/user'; +import { type UserOnboarding } from '@/types/user'; export interface OnboardingState { /** diff --git a/src/store/user/slices/onboarding/selectors.test.ts b/src/store/user/slices/onboarding/selectors.test.ts index f8ce20cb57..3721ba43e9 100644 --- a/src/store/user/slices/onboarding/selectors.test.ts +++ b/src/store/user/slices/onboarding/selectors.test.ts @@ -2,7 +2,7 @@ import { CURRENT_ONBOARDING_VERSION } from '@lobechat/const'; import { MAX_ONBOARDING_STEPS } from '@lobechat/types'; import { describe, expect, it } from 'vitest'; -import type { UserStore } from '@/store/user'; +import { type UserStore } from '@/store/user'; import { initialOnboardingState } from './initialState'; import { onboardingSelectors } from './selectors'; diff --git a/src/store/user/slices/onboarding/selectors.ts b/src/store/user/slices/onboarding/selectors.ts index ed611b88db..85f2d1e9d2 100644 --- a/src/store/user/slices/onboarding/selectors.ts +++ b/src/store/user/slices/onboarding/selectors.ts @@ -1,7 +1,7 @@ import { CURRENT_ONBOARDING_VERSION } from '@lobechat/const'; import { MAX_ONBOARDING_STEPS } from '@lobechat/types'; -import type { UserStore } from '../../store'; +import { type UserStore } from '../../store'; /** * Returns the current step for UI display. diff --git a/src/store/user/slices/preference/action.test.ts b/src/store/user/slices/preference/action.test.ts index aa9e72bea9..de2f730c7d 100644 --- a/src/store/user/slices/preference/action.test.ts +++ b/src/store/user/slices/preference/action.test.ts @@ -2,7 +2,7 @@ import { act, renderHook } from '@testing-library/react'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { useUserStore } from '@/store/user'; -import type { UserGuide} from '@/types/user'; +import { type UserGuide } from '@/types/user'; beforeEach(() => { vi.clearAllMocks(); diff --git a/src/store/user/slices/preference/action.ts b/src/store/user/slices/preference/action.ts index b47ae95be6..e9690986cb 100644 --- a/src/store/user/slices/preference/action.ts +++ b/src/store/user/slices/preference/action.ts @@ -1,7 +1,7 @@ import { userService } from '@/services/user'; -import type {StoreSetter} from '@/store/types'; -import type { UserStore } from '@/store/user'; -import type {UserGuide, UserLab, UserPreference} from '@/types/user'; +import { type StoreSetter } from '@/store/types'; +import { type UserStore } from '@/store/user'; +import { type UserGuide, type UserLab, type UserPreference } from '@/types/user'; import { merge } from '@/utils/merge'; import { setNamespace } from '@/utils/storeDebug'; diff --git a/src/store/user/slices/preference/initialState.ts b/src/store/user/slices/preference/initialState.ts index cdcc0aa575..1570f580f7 100644 --- a/src/store/user/slices/preference/initialState.ts +++ b/src/store/user/slices/preference/initialState.ts @@ -1,5 +1,5 @@ import { DEFAULT_PREFERENCE } from '@/const/user'; -import type {UserPreference} from '@/types/user'; +import { type UserPreference } from '@/types/user'; export interface UserPreferenceState { /** diff --git a/src/store/user/slices/preference/selectors.test.ts b/src/store/user/slices/preference/selectors.test.ts index c91ed35ee4..c07e62c066 100644 --- a/src/store/user/slices/preference/selectors.test.ts +++ b/src/store/user/slices/preference/selectors.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import type { UserStore } from '@/store/user'; +import { type UserStore } from '@/store/user'; import { initialPreferenceState } from './initialState'; import { preferenceSelectors } from './selectors'; diff --git a/src/store/user/slices/preference/selectors/labPrefer.ts b/src/store/user/slices/preference/selectors/labPrefer.ts index 1b82fe8c1e..2d870b316c 100644 --- a/src/store/user/slices/preference/selectors/labPrefer.ts +++ b/src/store/user/slices/preference/selectors/labPrefer.ts @@ -1,6 +1,6 @@ import { DEFAULT_PREFERENCE } from '@lobechat/const'; -import type { UserState } from '@/store/user/initialState'; +import { type UserState } from '@/store/user/initialState'; export const labPreferSelectors = { enableInputMarkdown: (s: UserState): boolean => diff --git a/src/store/user/slices/preference/selectors/preference.ts b/src/store/user/slices/preference/selectors/preference.ts index 1fc870bdf2..b6e1aacbf8 100644 --- a/src/store/user/slices/preference/selectors/preference.ts +++ b/src/store/user/slices/preference/selectors/preference.ts @@ -1,6 +1,6 @@ import { DEFAULT_PREFERENCE } from '@lobechat/const'; -import type { UserStore } from '@/store/user'; +import { type UserStore } from '@/store/user'; const useCmdEnterToSend = (s: UserStore): boolean => s.preference.useCmdEnterToSend || false; const topicDisplayMode = (s: UserStore) => diff --git a/src/store/user/slices/settings/action.test.ts b/src/store/user/slices/settings/action.test.ts index 56223d2a14..d8a8e395f4 100644 --- a/src/store/user/slices/settings/action.test.ts +++ b/src/store/user/slices/settings/action.test.ts @@ -1,12 +1,12 @@ import { DEFAULT_SETTINGS } from '@lobechat/config'; import { act, renderHook } from '@testing-library/react'; -import type { PartialDeep } from 'type-fest'; +import { type PartialDeep } from 'type-fest'; import { describe, expect, it, vi } from 'vitest'; import { userService } from '@/services/user'; import { useUserStore } from '@/store/user'; -import type { LobeAgentSettings } from '@/types/session'; -import type { UserSettings } from '@/types/user/settings'; +import { type LobeAgentSettings } from '@/types/session'; +import { type UserSettings } from '@/types/user/settings'; import { merge } from '@/utils/merge'; vi.mock('zustand/traditional'); diff --git a/src/store/user/slices/settings/action.ts b/src/store/user/slices/settings/action.ts index 1a7e299dd8..e29cdb5985 100644 --- a/src/store/user/slices/settings/action.ts +++ b/src/store/user/slices/settings/action.ts @@ -1,13 +1,19 @@ import isEqual from 'fast-deep-equal'; -import type { PartialDeep } from 'type-fest'; +import { type PartialDeep } from 'type-fest'; import { MESSAGE_CANCEL_FLAT } from '@/const/message'; import { shareService } from '@/services/share'; import { userService } from '@/services/user'; -import type {StoreSetter} from '@/store/types'; -import type { UserStore } from '@/store/user'; -import type {LobeAgentSettings} from '@/types/session'; -import type {SystemAgentItem, UserGeneralConfig, UserKeyVaults, UserSettings, UserSystemAgentConfigKey} from '@/types/user/settings'; +import { type StoreSetter } from '@/store/types'; +import { type UserStore } from '@/store/user'; +import { type LobeAgentSettings } from '@/types/session'; +import { + type SystemAgentItem, + type UserGeneralConfig, + type UserKeyVaults, + type UserSettings, + type UserSystemAgentConfigKey, +} from '@/types/user/settings'; import { difference } from '@/utils/difference'; import { merge } from '@/utils/merge'; diff --git a/src/store/user/slices/settings/initialState.ts b/src/store/user/slices/settings/initialState.ts index 0f10d7e9f9..4fa699eb1c 100644 --- a/src/store/user/slices/settings/initialState.ts +++ b/src/store/user/slices/settings/initialState.ts @@ -1,6 +1,6 @@ import { DEFAULT_SETTINGS } from '@lobechat/config'; -import type {UserSettings} from '@lobechat/types'; -import type { PartialDeep } from 'type-fest'; +import { type UserSettings } from '@lobechat/types'; +import { type PartialDeep } from 'type-fest'; export interface UserSettingsState { defaultSettings: UserSettings; diff --git a/src/store/user/slices/settings/selectors/general.test.ts b/src/store/user/slices/settings/selectors/general.test.ts index 7328431027..8c8ef53c68 100644 --- a/src/store/user/slices/settings/selectors/general.test.ts +++ b/src/store/user/slices/settings/selectors/general.test.ts @@ -1,5 +1,5 @@ -import type { UserStore } from '@/store/user'; -import type {UserState } from '@/store/user/initialState'; +import { type UserStore } from '@/store/user'; +import { type UserState } from '@/store/user/initialState'; import { initialState } from '@/store/user/initialState'; import { merge } from '@/utils/merge'; diff --git a/src/store/user/slices/settings/selectors/general.ts b/src/store/user/slices/settings/selectors/general.ts index 32abfbd64d..bd68df6b5e 100644 --- a/src/store/user/slices/settings/selectors/general.ts +++ b/src/store/user/slices/settings/selectors/general.ts @@ -1,6 +1,6 @@ import { isDesktop } from '@lobechat/const'; -import type {UserStore} from '../../../store'; +import { type UserStore } from '../../../store'; import { currentSettings } from './settings'; const generalConfig = (s: UserStore) => currentSettings(s).general || {}; diff --git a/src/store/user/slices/settings/selectors/keyVaults.ts b/src/store/user/slices/settings/selectors/keyVaults.ts index 4839c5edb1..0653843eb7 100644 --- a/src/store/user/slices/settings/selectors/keyVaults.ts +++ b/src/store/user/slices/settings/selectors/keyVaults.ts @@ -1,5 +1,5 @@ -import type {UserStore} from '@/store/user'; -import type {UserKeyVaults} from '@/types/user/settings'; +import { type UserStore } from '@/store/user'; +import { type UserKeyVaults } from '@/types/user/settings'; import { currentSettings } from './settings'; diff --git a/src/store/user/slices/settings/selectors/settings.test.ts b/src/store/user/slices/settings/selectors/settings.test.ts index a1e2e67a21..bba7f3d520 100644 --- a/src/store/user/slices/settings/selectors/settings.test.ts +++ b/src/store/user/slices/settings/selectors/settings.test.ts @@ -1,7 +1,7 @@ -import type { HotkeyId } from '@/types/hotkey'; -import type { GlobalLLMProviderKey } from '@/types/user/settings'; +import { type HotkeyId } from '@/types/hotkey'; +import { type GlobalLLMProviderKey } from '@/types/user/settings'; -import type { UserStore } from '../../../store'; +import { type UserStore } from '../../../store'; import { settingsSelectors } from './settings'; describe('settingsSelectors', () => { diff --git a/src/store/user/slices/settings/selectors/settings.ts b/src/store/user/slices/settings/selectors/settings.ts index 0b50a014a5..58e334e725 100644 --- a/src/store/user/slices/settings/selectors/settings.ts +++ b/src/store/user/slices/settings/selectors/settings.ts @@ -7,9 +7,15 @@ import { DEFAULT_SYSTEM_AGENT_CONFIG, DEFAULT_TTS_CONFIG, } from '@lobechat/const'; -import type {GlobalLLMProviderKey, HotkeyId, ProviderConfig, UserModelProviderConfig, UserSettings} from '@lobechat/types'; +import { + type GlobalLLMProviderKey, + type HotkeyId, + type ProviderConfig, + type UserModelProviderConfig, + type UserSettings, +} from '@lobechat/types'; -import type { UserStore } from '@/store/user'; +import { type UserStore } from '@/store/user'; import { merge } from '@/utils/merge'; export const currentSettings = (s: UserStore): UserSettings => merge(s.defaultSettings, s.settings); diff --git a/src/store/user/slices/settings/selectors/systemAgent.ts b/src/store/user/slices/settings/selectors/systemAgent.ts index 48419d7a12..7228a4cd42 100644 --- a/src/store/user/slices/settings/selectors/systemAgent.ts +++ b/src/store/user/slices/settings/selectors/systemAgent.ts @@ -1,5 +1,5 @@ import { DEFAULT_SYSTEM_AGENT_CONFIG } from '@/const/settings'; -import type { UserStore } from '@/store/user'; +import { type UserStore } from '@/store/user'; import { merge } from '@/utils/merge'; import { currentSettings } from './settings'; diff --git a/src/store/user/slices/settings/selectors/toolIntervention.test.ts b/src/store/user/slices/settings/selectors/toolIntervention.test.ts index 61ad0650a4..476e4dada8 100644 --- a/src/store/user/slices/settings/selectors/toolIntervention.test.ts +++ b/src/store/user/slices/settings/selectors/toolIntervention.test.ts @@ -1,5 +1,5 @@ -import type { UserStore } from '@/store/user'; -import type {UserState } from '@/store/user/initialState'; +import { type UserStore } from '@/store/user'; +import { type UserState } from '@/store/user/initialState'; import { initialState } from '@/store/user/initialState'; import { merge } from '@/utils/merge'; diff --git a/src/store/user/slices/settings/selectors/toolIntervention.ts b/src/store/user/slices/settings/selectors/toolIntervention.ts index 1bf7188941..f4ae022260 100644 --- a/src/store/user/slices/settings/selectors/toolIntervention.ts +++ b/src/store/user/slices/settings/selectors/toolIntervention.ts @@ -1,4 +1,4 @@ -import type { UserStore } from '@/store/user'; +import { type UserStore } from '@/store/user'; import { currentSettings } from './settings'; diff --git a/src/store/user/store.ts b/src/store/user/store.ts index 499bd98f5d..86162945c1 100644 --- a/src/store/user/store.ts +++ b/src/store/user/store.ts @@ -1,21 +1,21 @@ import { subscribeWithSelector } from 'zustand/middleware'; import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {UserState} from './initialState'; +import { type UserState } from './initialState'; import { initialState } from './initialState'; -import type {UserAuthAction} from './slices/auth/action'; +import { type UserAuthAction } from './slices/auth/action'; import { createAuthSlice } from './slices/auth/action'; -import type {CommonAction} from './slices/common/action'; -import { createCommonSlice } from './slices/common/action'; -import type {OnboardingAction} from './slices/onboarding/action'; +import { type CommonAction } from './slices/common/action'; +import { createCommonSlice } from './slices/common/action'; +import { type OnboardingAction } from './slices/onboarding/action'; import { createOnboardingSlice } from './slices/onboarding/action'; -import type {PreferenceAction} from './slices/preference/action'; +import { type PreferenceAction } from './slices/preference/action'; import { createPreferenceSlice } from './slices/preference/action'; -import type {UserSettingsAction} from './slices/settings/action'; +import { type UserSettingsAction } from './slices/settings/action'; import { createSettingsSlice } from './slices/settings/action'; // =============== Aggregate createStoreFn ============ // diff --git a/src/store/userMemory/initialState.ts b/src/store/userMemory/initialState.ts index fae935bd30..fb917e1ecf 100644 --- a/src/store/userMemory/initialState.ts +++ b/src/store/userMemory/initialState.ts @@ -1,16 +1,16 @@ -import type { RetrieveMemoryParams, RetrieveMemoryResult } from '@lobechat/types'; +import { type RetrieveMemoryParams, type RetrieveMemoryResult } from '@lobechat/types'; -import type {ActivitySliceState} from './slices/activity'; +import { type ActivitySliceState } from './slices/activity'; import { activityInitialState } from './slices/activity'; -import type {AgentMemorySliceState} from './slices/agent'; +import { type AgentMemorySliceState } from './slices/agent'; import { agentMemoryInitialState } from './slices/agent'; -import type {ContextSliceState} from './slices/context'; +import { type ContextSliceState } from './slices/context'; import { contextInitialState } from './slices/context'; -import type {ExperienceSliceState} from './slices/experience'; +import { type ExperienceSliceState } from './slices/experience'; import { experienceInitialState } from './slices/experience'; -import type {IdentitySliceState} from './slices/identity'; +import { type IdentitySliceState } from './slices/identity'; import { identityInitialState } from './slices/identity'; -import type {PreferenceSliceState} from './slices/preference'; +import { type PreferenceSliceState } from './slices/preference'; import { preferenceInitialState } from './slices/preference'; export interface PersonaData { diff --git a/src/store/userMemory/selectors.ts b/src/store/userMemory/selectors.ts index 8714d42321..3f04d925d7 100644 --- a/src/store/userMemory/selectors.ts +++ b/src/store/userMemory/selectors.ts @@ -1,6 +1,6 @@ -import type { RetrieveMemoryParams, RetrieveMemoryResult } from '@lobechat/types'; +import { type RetrieveMemoryParams, type RetrieveMemoryResult } from '@lobechat/types'; -import type { UserMemoryStoreState } from './initialState'; +import { type UserMemoryStoreState } from './initialState'; import { userMemoryCacheKey } from './utils/cacheKey'; const EMPTY_RESULT: RetrieveMemoryResult = { diff --git a/src/store/userMemory/slices/activity/action.ts b/src/store/userMemory/slices/activity/action.ts index f01c360e8b..b156102832 100644 --- a/src/store/userMemory/slices/activity/action.ts +++ b/src/store/userMemory/slices/activity/action.ts @@ -1,14 +1,14 @@ -import type { ActivityListResult } from '@lobechat/types'; +import { type ActivityListResult } from '@lobechat/types'; import { uniqBy } from 'es-toolkit/compat'; import { produce } from 'immer'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; -import { memoryCRUDService,userMemoryService } from '@/services/userMemory'; -import type { StoreSetter } from '@/store/types'; +import { memoryCRUDService, userMemoryService } from '@/services/userMemory'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; -import type {UserMemoryStore} from '../../store'; +import { type UserMemoryStore } from '../../store'; const n = setNamespace('userMemory/activity'); diff --git a/src/store/userMemory/slices/activity/initialState.ts b/src/store/userMemory/slices/activity/initialState.ts index 9f4b10dead..aea1da6971 100644 --- a/src/store/userMemory/slices/activity/initialState.ts +++ b/src/store/userMemory/slices/activity/initialState.ts @@ -1,4 +1,4 @@ -import type { ActivityListItem } from '@lobechat/types'; +import { type ActivityListItem } from '@lobechat/types'; export interface ActivitySliceState { activities: ActivityListItem[]; diff --git a/src/store/userMemory/slices/agent/action.ts b/src/store/userMemory/slices/agent/action.ts index d84e281992..0d9553644e 100644 --- a/src/store/userMemory/slices/agent/action.ts +++ b/src/store/userMemory/slices/agent/action.ts @@ -1,13 +1,13 @@ import { omit } from 'es-toolkit'; -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; import { useClientDataSWRWithSync } from '@/libs/swr'; import { userMemoryService } from '@/services/userMemory'; -import type {StoreSetter} from '@/store/types'; -import type { RetrieveMemoryResult } from '@/types/userMemory'; +import { type StoreSetter } from '@/store/types'; +import { type RetrieveMemoryResult } from '@/types/userMemory'; import { setNamespace } from '@/utils/storeDebug'; -import type {UserMemoryStore} from '../../store'; +import { type UserMemoryStore } from '../../store'; const n = setNamespace('userMemory/agent'); diff --git a/src/store/userMemory/slices/agent/initialState.ts b/src/store/userMemory/slices/agent/initialState.ts index 2b783721d9..82c6f7debe 100644 --- a/src/store/userMemory/slices/agent/initialState.ts +++ b/src/store/userMemory/slices/agent/initialState.ts @@ -1,4 +1,4 @@ -import type { RetrieveMemoryResult } from '@/types/userMemory'; +import { type RetrieveMemoryResult } from '@/types/userMemory'; export interface AgentMemorySliceState { /** diff --git a/src/store/userMemory/slices/agent/selectors.ts b/src/store/userMemory/slices/agent/selectors.ts index 71b8cce422..486cad381e 100644 --- a/src/store/userMemory/slices/agent/selectors.ts +++ b/src/store/userMemory/slices/agent/selectors.ts @@ -1,6 +1,6 @@ -import type { RetrieveMemoryResult } from '@/types/userMemory'; +import { type RetrieveMemoryResult } from '@/types/userMemory'; -import type { UserMemoryStoreState } from '../../initialState'; +import { type UserMemoryStoreState } from '../../initialState'; export const agentMemorySelectors = { /** diff --git a/src/store/userMemory/slices/base/action.ts b/src/store/userMemory/slices/base/action.ts index c3e14543f3..57f388b199 100644 --- a/src/store/userMemory/slices/base/action.ts +++ b/src/store/userMemory/slices/base/action.ts @@ -1,16 +1,16 @@ import isEqual from 'fast-deep-equal'; -import type { SWRResponse } from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; import { mutate, useClientDataSWR, useClientDataSWRWithSync } from '@/libs/swr'; import { userMemoryService } from '@/services/userMemory'; -import type {StoreSetter} from '@/store/types'; -import type { RetrieveMemoryParams, RetrieveMemoryResult } from '@/types/userMemory'; +import { type StoreSetter } from '@/store/types'; +import { type RetrieveMemoryParams, type RetrieveMemoryResult } from '@/types/userMemory'; import { LayersEnum } from '@/types/userMemory'; import { setNamespace } from '@/utils/storeDebug'; -import type {UserMemoryStore} from '../../store'; -import type { IdentityForInjection } from '../../types'; +import { type UserMemoryStore } from '../../store'; +import { type IdentityForInjection } from '../../types'; import { userMemoryCacheKey } from '../../utils/cacheKey'; import { createMemorySearchParams } from '../../utils/searchParams'; diff --git a/src/store/userMemory/slices/context/action.ts b/src/store/userMemory/slices/context/action.ts index 6133e90ae5..a46b866d0d 100644 --- a/src/store/userMemory/slices/context/action.ts +++ b/src/store/userMemory/slices/context/action.ts @@ -1,15 +1,15 @@ import { uniqBy } from 'es-toolkit/compat'; import { produce } from 'immer'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; -import type {DisplayContextMemory} from '@/database/repositories/userMemory'; -import { memoryCRUDService,userMemoryService } from '@/services/userMemory'; -import type { StoreSetter } from '@/store/types'; +import { type DisplayContextMemory } from '@/database/repositories/userMemory'; +import { memoryCRUDService, userMemoryService } from '@/services/userMemory'; +import { type StoreSetter } from '@/store/types'; import { LayersEnum } from '@/types/userMemory'; import { setNamespace } from '@/utils/storeDebug'; -import type {UserMemoryStore} from '../../store'; +import { type UserMemoryStore } from '../../store'; const n = setNamespace('userMemory/context'); diff --git a/src/store/userMemory/slices/context/initialState.ts b/src/store/userMemory/slices/context/initialState.ts index 9a5c1dda13..2297887200 100644 --- a/src/store/userMemory/slices/context/initialState.ts +++ b/src/store/userMemory/slices/context/initialState.ts @@ -1,4 +1,4 @@ -import type {DisplayContextMemory} from '@/database/repositories/userMemory'; +import { type DisplayContextMemory } from '@/database/repositories/userMemory'; export interface ContextSliceState { contexts: DisplayContextMemory[]; diff --git a/src/store/userMemory/slices/experience/action.ts b/src/store/userMemory/slices/experience/action.ts index 14c9ff8412..36b466fe0d 100644 --- a/src/store/userMemory/slices/experience/action.ts +++ b/src/store/userMemory/slices/experience/action.ts @@ -1,14 +1,14 @@ -import type { ExperienceListResult } from '@lobechat/types'; +import { type ExperienceListResult } from '@lobechat/types'; import { uniqBy } from 'es-toolkit/compat'; import { produce } from 'immer'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; -import { memoryCRUDService,userMemoryService } from '@/services/userMemory'; -import type { StoreSetter } from '@/store/types'; +import { memoryCRUDService, userMemoryService } from '@/services/userMemory'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; -import type {UserMemoryStore} from '../../store'; +import { type UserMemoryStore } from '../../store'; const n = setNamespace('userMemory/experience'); diff --git a/src/store/userMemory/slices/experience/initialState.ts b/src/store/userMemory/slices/experience/initialState.ts index 8d0c99da1b..5877990133 100644 --- a/src/store/userMemory/slices/experience/initialState.ts +++ b/src/store/userMemory/slices/experience/initialState.ts @@ -1,4 +1,4 @@ -import type { ExperienceListItem } from '@lobechat/types'; +import { type ExperienceListItem } from '@lobechat/types'; export interface ExperienceSliceState { experiences: ExperienceListItem[]; diff --git a/src/store/userMemory/slices/home/action.ts b/src/store/userMemory/slices/home/action.ts index a556e80504..fc2059be5f 100644 --- a/src/store/userMemory/slices/home/action.ts +++ b/src/store/userMemory/slices/home/action.ts @@ -1,12 +1,12 @@ -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; -import type {QueryIdentityRolesResult} from '@/database/models/userMemory'; +import { type QueryIdentityRolesResult } from '@/database/models/userMemory'; import { useClientDataSWR } from '@/libs/swr'; import { userMemoryService } from '@/services/userMemory'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; -import type {PersonaData} from '../../initialState'; -import type { UserMemoryStore } from '../../store'; +import { type PersonaData } from '../../initialState'; +import { type UserMemoryStore } from '../../store'; const FETCH_TAGS_KEY = 'useFetchTags'; const FETCH_PERSONA_KEY = 'useFetchPersona'; diff --git a/src/store/userMemory/slices/identity/action.ts b/src/store/userMemory/slices/identity/action.ts index db955a4f4a..c6b773a2b3 100644 --- a/src/store/userMemory/slices/identity/action.ts +++ b/src/store/userMemory/slices/identity/action.ts @@ -1,15 +1,19 @@ -import type {IdentityListResult, NewUserMemoryIdentity, UpdateUserMemoryIdentity} from '@lobechat/types'; +import { + type IdentityListResult, + type NewUserMemoryIdentity, + type UpdateUserMemoryIdentity, +} from '@lobechat/types'; import { uniqBy } from 'es-toolkit/compat'; import { produce } from 'immer'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; -import type {AddIdentityEntryResult} from '@/database/models/userMemory'; +import { type AddIdentityEntryResult } from '@/database/models/userMemory'; import { memoryCRUDService, userMemoryService } from '@/services/userMemory'; -import type {StoreSetter} from '@/store/types'; +import { type StoreSetter } from '@/store/types'; import { setNamespace } from '@/utils/storeDebug'; -import type {UserMemoryStore} from '../../store'; +import { type UserMemoryStore } from '../../store'; const n = setNamespace('userMemory/identity'); diff --git a/src/store/userMemory/slices/identity/initialState.ts b/src/store/userMemory/slices/identity/initialState.ts index 14a30057e7..0e207d39fb 100644 --- a/src/store/userMemory/slices/identity/initialState.ts +++ b/src/store/userMemory/slices/identity/initialState.ts @@ -1,6 +1,6 @@ -import type { IdentityListItem, IdentityListSort } from '@lobechat/types'; +import { type IdentityListItem, type IdentityListSort } from '@lobechat/types'; -import type { IdentityForInjection } from '../../types'; +import { type IdentityForInjection } from '../../types'; export interface IdentitySliceState { /** Global identities fetched at app initialization for injection into chat context */ diff --git a/src/store/userMemory/slices/identity/selectors.ts b/src/store/userMemory/slices/identity/selectors.ts index 12c3b1824f..77113e0c33 100644 --- a/src/store/userMemory/slices/identity/selectors.ts +++ b/src/store/userMemory/slices/identity/selectors.ts @@ -1,5 +1,5 @@ -import type { UserMemoryStoreState } from '../../initialState'; -import type { IdentityForInjection } from '../../types'; +import { type UserMemoryStoreState } from '../../initialState'; +import { type IdentityForInjection } from '../../types'; export const identitySelectors = { /** diff --git a/src/store/userMemory/slices/preference/action.ts b/src/store/userMemory/slices/preference/action.ts index a255300088..30d0065bf4 100644 --- a/src/store/userMemory/slices/preference/action.ts +++ b/src/store/userMemory/slices/preference/action.ts @@ -1,15 +1,15 @@ import { uniqBy } from 'es-toolkit/compat'; import { produce } from 'immer'; -import type {SWRResponse} from 'swr'; +import { type SWRResponse } from 'swr'; import useSWR from 'swr'; -import type {DisplayPreferenceMemory} from '@/database/repositories/userMemory'; -import { memoryCRUDService,userMemoryService } from '@/services/userMemory'; -import type { StoreSetter } from '@/store/types'; +import { type DisplayPreferenceMemory } from '@/database/repositories/userMemory'; +import { memoryCRUDService, userMemoryService } from '@/services/userMemory'; +import { type StoreSetter } from '@/store/types'; import { LayersEnum } from '@/types/userMemory'; import { setNamespace } from '@/utils/storeDebug'; -import type {UserMemoryStore} from '../../store'; +import { type UserMemoryStore } from '../../store'; const n = setNamespace('userMemory/preference'); diff --git a/src/store/userMemory/slices/preference/initialState.ts b/src/store/userMemory/slices/preference/initialState.ts index 4f4bd7721b..f2e1c2d89b 100644 --- a/src/store/userMemory/slices/preference/initialState.ts +++ b/src/store/userMemory/slices/preference/initialState.ts @@ -1,4 +1,4 @@ -import type {DisplayPreferenceMemory} from '@/database/repositories/userMemory'; +import { type DisplayPreferenceMemory } from '@/database/repositories/userMemory'; export interface PreferenceSliceState { preferences: DisplayPreferenceMemory[]; diff --git a/src/store/userMemory/store.ts b/src/store/userMemory/store.ts index 0707bc4e15..d1d363c1f8 100644 --- a/src/store/userMemory/store.ts +++ b/src/store/userMemory/store.ts @@ -1,26 +1,26 @@ import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; -import type {StateCreator} from 'zustand/vanilla'; +import { type StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; import { flattenActions } from '../utils/flattenActions'; -import type {UserMemoryStoreState} from './initialState'; +import { type UserMemoryStoreState } from './initialState'; import { initialState } from './initialState'; -import type {ActivityAction} from './slices/activity'; -import { createActivitySlice } from './slices/activity'; -import type {AgentMemoryAction} from './slices/agent'; -import { createAgentMemorySlice } from './slices/agent'; -import type {BaseAction} from './slices/base'; -import { createBaseSlice } from './slices/base'; -import type {ContextAction} from './slices/context'; -import { createContextSlice } from './slices/context'; -import type {ExperienceAction} from './slices/experience'; +import { type ActivityAction } from './slices/activity'; +import { createActivitySlice } from './slices/activity'; +import { type AgentMemoryAction } from './slices/agent'; +import { createAgentMemorySlice } from './slices/agent'; +import { type BaseAction } from './slices/base'; +import { createBaseSlice } from './slices/base'; +import { type ContextAction } from './slices/context'; +import { createContextSlice } from './slices/context'; +import { type ExperienceAction } from './slices/experience'; import { createExperienceSlice } from './slices/experience'; -import type {HomeAction} from './slices/home'; +import { type HomeAction } from './slices/home'; import { createHomeSlice } from './slices/home'; -import type {IdentityAction} from './slices/identity'; +import { type IdentityAction } from './slices/identity'; import { createIdentitySlice } from './slices/identity'; -import type {PreferenceAction} from './slices/preference'; +import { type PreferenceAction } from './slices/preference'; import { createPreferenceSlice } from './slices/preference'; export type UserMemoryStore = UserMemoryStoreState & diff --git a/src/store/userMemory/utils/cacheKey.ts b/src/store/userMemory/utils/cacheKey.ts index 578ba80644..a4e4194826 100644 --- a/src/store/userMemory/utils/cacheKey.ts +++ b/src/store/userMemory/utils/cacheKey.ts @@ -1,4 +1,4 @@ -import type { RetrieveMemoryParams } from '@/types/userMemory'; +import { type RetrieveMemoryParams } from '@/types/userMemory'; export const userMemoryCacheKey = (params: RetrieveMemoryParams): string => { const { query, topK } = params; diff --git a/src/store/userMemory/utils/searchParams.ts b/src/store/userMemory/utils/searchParams.ts index 9c7efc49c2..8ac986ff5c 100644 --- a/src/store/userMemory/utils/searchParams.ts +++ b/src/store/userMemory/utils/searchParams.ts @@ -1,7 +1,7 @@ import { find, isString, trim } from 'es-toolkit/compat'; import { DEFAULT_SEARCH_USER_MEMORY_TOP_K } from '@/const/userMemory'; -import type { RetrieveMemoryParams } from '@/types/userMemory'; +import { type RetrieveMemoryParams } from '@/types/userMemory'; interface MemorySearchSource { agent?: { diff --git a/src/styles/antdOverride.ts b/src/styles/antdOverride.ts index 692c6de705..8b8df0c189 100644 --- a/src/styles/antdOverride.ts +++ b/src/styles/antdOverride.ts @@ -1,5 +1,5 @@ import { isDesktop } from '@lobechat/const'; -import type {Theme} from 'antd-style'; +import { type Theme } from 'antd-style'; import { css } from 'antd-style'; import { rgba } from 'polished'; diff --git a/src/styles/global.ts b/src/styles/global.ts index 92c52ac3a4..7e12a9c6ed 100644 --- a/src/styles/global.ts +++ b/src/styles/global.ts @@ -1,5 +1,5 @@ import { CLASSNAMES } from '@lobehub/ui'; -import type { Theme } from 'antd-style'; +import { type Theme } from 'antd-style'; import { css } from 'antd-style'; // fix ios input keyboard diff --git a/src/styles/mobileHeader.ts b/src/styles/mobileHeader.ts index e0c55f8a95..82fc5dd6fa 100644 --- a/src/styles/mobileHeader.ts +++ b/src/styles/mobileHeader.ts @@ -1,4 +1,4 @@ -import type {CSSProperties} from 'react'; +import { type CSSProperties } from 'react'; export const mobileHeaderSticky: CSSProperties = { position: 'sticky', diff --git a/src/tools/artifacts/index.ts b/src/tools/artifacts/index.ts index a3955ab56c..56b63e7404 100644 --- a/src/tools/artifacts/index.ts +++ b/src/tools/artifacts/index.ts @@ -1,4 +1,4 @@ -import type {BuiltinToolManifest} from '@lobechat/types'; +import { type BuiltinToolManifest } from '@lobechat/types'; import { systemPrompt } from '@/tools/artifacts/systemRole'; diff --git a/src/tools/index.ts b/src/tools/index.ts index e176b2ec7c..776e35de63 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -10,7 +10,7 @@ import { NotebookManifest } from '@lobechat/builtin-tool-notebook'; import { PageAgentManifest } from '@lobechat/builtin-tool-page-agent'; import { WebBrowsingManifest } from '@lobechat/builtin-tool-web-browsing'; import { isDesktop } from '@lobechat/const'; -import type {LobeBuiltinTool} from '@lobechat/types'; +import { type LobeBuiltinTool } from '@lobechat/types'; import { ArtifactsManifest } from './artifacts'; diff --git a/src/tools/inspectors.ts b/src/tools/inspectors.ts index d78387ab0f..b4947fcf6d 100644 --- a/src/tools/inspectors.ts +++ b/src/tools/inspectors.ts @@ -30,7 +30,7 @@ import { WebBrowsingInspectors, WebBrowsingManifest, } from '@lobechat/builtin-tool-web-browsing/client'; -import type {BuiltinInspector} from '@lobechat/types'; +import { type BuiltinInspector } from '@lobechat/types'; /** * Builtin tools inspector registry diff --git a/src/tools/interventions.ts b/src/tools/interventions.ts index 191b02c243..959b265168 100644 --- a/src/tools/interventions.ts +++ b/src/tools/interventions.ts @@ -16,7 +16,7 @@ import { import { MemoryInterventions, MemoryManifest } from '@lobechat/builtin-tool-memory/client'; import { NotebookManifest } from '@lobechat/builtin-tool-notebook'; import { NotebookInterventions } from '@lobechat/builtin-tool-notebook/client'; -import type {BuiltinIntervention} from '@lobechat/types'; +import { type BuiltinIntervention } from '@lobechat/types'; /** * Builtin tools interventions registry diff --git a/src/tools/placeholders.ts b/src/tools/placeholders.ts index 4ac00cdc15..33520892b0 100644 --- a/src/tools/placeholders.ts +++ b/src/tools/placeholders.ts @@ -9,7 +9,7 @@ import { WebBrowsingManifest, WebBrowsingPlaceholders, } from '@lobechat/builtin-tool-web-browsing/client'; -import type {BuiltinPlaceholder} from '@lobechat/types'; +import { type BuiltinPlaceholder } from '@lobechat/types'; /** * Builtin tools placeholders registry diff --git a/src/tools/portals.ts b/src/tools/portals.ts index 43251d5c80..daf7682790 100644 --- a/src/tools/portals.ts +++ b/src/tools/portals.ts @@ -1,5 +1,5 @@ import { WebBrowsingManifest, WebBrowsingPortal } from '@lobechat/builtin-tool-web-browsing/client'; -import type {BuiltinPortal} from '@lobechat/types'; +import { type BuiltinPortal } from '@lobechat/types'; export const BuiltinToolsPortals: Record = { [WebBrowsingManifest.identifier]: WebBrowsingPortal as BuiltinPortal, diff --git a/src/tools/renders.ts b/src/tools/renders.ts index 19cb89b6de..782875c94e 100644 --- a/src/tools/renders.ts +++ b/src/tools/renders.ts @@ -21,7 +21,7 @@ import { WebBrowsingManifest, WebBrowsingRenders, } from '@lobechat/builtin-tool-web-browsing/client'; -import type {BuiltinRender} from '@lobechat/types'; +import { type BuiltinRender } from '@lobechat/types'; /** * Builtin tools renders registry diff --git a/src/tools/streamings.ts b/src/tools/streamings.ts index 412af8afb7..39ffc74274 100644 --- a/src/tools/streamings.ts +++ b/src/tools/streamings.ts @@ -21,7 +21,7 @@ import { } from '@lobechat/builtin-tool-local-system/client'; import { MemoryManifest, MemoryStreamings } from '@lobechat/builtin-tool-memory/client'; import { NotebookManifest, NotebookStreamings } from '@lobechat/builtin-tool-notebook/client'; -import type {BuiltinStreaming} from '@lobechat/types'; +import { type BuiltinStreaming } from '@lobechat/types'; /** * Builtin tools streaming renderer registry diff --git a/src/types/global.d.ts b/src/types/global.d.ts index 98c7f817ef..aa7da96974 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -1,12 +1,11 @@ import 'antd-style'; -import type { LobeCustomStylish, LobeCustomToken } from '@lobehub/ui'; -import type {AntdToken} from 'antd-style/lib/types/theme'; +import { type LobeCustomStylish, type LobeCustomToken } from '@lobehub/ui'; +import { type AntdToken } from 'antd-style/lib/types/theme'; declare module 'antd-style' { - export interface CustomToken extends LobeCustomToken {} - + export interface CustomStylish extends LobeCustomStylish {} } diff --git a/src/types/i18next.d.ts b/src/types/i18next.d.ts index 2938f6be8a..8414d6d642 100644 --- a/src/types/i18next.d.ts +++ b/src/types/i18next.d.ts @@ -1,4 +1,4 @@ -import type {DefaultResources} from '@/types/locale'; +import { type DefaultResources } from '@/types/locale'; declare module 'i18next' { interface CustomTypeOptions { diff --git a/src/types/locale.ts b/src/types/locale.ts index 0dbe3401a2..d95673450a 100644 --- a/src/types/locale.ts +++ b/src/types/locale.ts @@ -1,4 +1,4 @@ -import type {Locales} from '@/locales/resources'; +import { type Locales } from '@/locales/resources'; export type * from '@/locales/resources'; diff --git a/src/types/resource.ts b/src/types/resource.ts index 420a8b9e71..96043e5583 100644 --- a/src/types/resource.ts +++ b/src/types/resource.ts @@ -1,4 +1,4 @@ -import type { FilesTabs, SortType } from '@/types/files'; +import { type FilesTabs, type SortType } from '@/types/files'; /** * Unified resource item that represents both files and documents diff --git a/src/utils/client/switchLang.test.ts b/src/utils/client/switchLang.test.ts index af05e69240..8c86d54fd7 100644 --- a/src/utils/client/switchLang.test.ts +++ b/src/utils/client/switchLang.test.ts @@ -3,7 +3,7 @@ import { changeLanguage } from 'i18next'; import { describe, expect, it, vi } from 'vitest'; import { LOBE_LOCALE_COOKIE } from '@/const/locale'; -import type { LocaleMode } from '@/types/locale'; +import { type LocaleMode } from '@/types/locale'; import { switchLang } from './switchLang'; diff --git a/src/utils/client/switchLang.ts b/src/utils/client/switchLang.ts index 7f7d815aca..b805c099ad 100644 --- a/src/utils/client/switchLang.ts +++ b/src/utils/client/switchLang.ts @@ -2,7 +2,7 @@ import { setCookie } from '@lobechat/utils'; import { changeLanguage } from 'i18next'; import { LOBE_LOCALE_COOKIE } from '@/const/locale'; -import type {LocaleMode} from '@/types/locale'; +import { type LocaleMode } from '@/types/locale'; export const switchLang = (locale: LocaleMode) => { const lang = locale === 'auto' ? navigator.language : locale; diff --git a/src/utils/electron/ipc.ts b/src/utils/electron/ipc.ts index af492468c6..1f432ab83e 100644 --- a/src/utils/electron/ipc.ts +++ b/src/utils/electron/ipc.ts @@ -1,5 +1,5 @@ import { getElectronIpc } from '@lobechat/electron-client-ipc'; -import type { DesktopIpcServices } from '@lobehub/desktop-ipc-typings'; +import { type DesktopIpcServices } from '@lobehub/desktop-ipc-typings'; export const ensureElectronIpc = (): DesktopIpcServices => { const ipc = getElectronIpc(); diff --git a/src/utils/errorResponse.ts b/src/utils/errorResponse.ts index 9ea12f9886..81b2e641ae 100644 --- a/src/utils/errorResponse.ts +++ b/src/utils/errorResponse.ts @@ -1,8 +1,8 @@ import { AUTH_REQUIRED_HEADER } from '@lobechat/desktop-bridge'; -import type {ILobeAgentRuntimeErrorType} from '@lobechat/model-runtime'; -import { AgentRuntimeErrorType } from '@lobechat/model-runtime'; -import type {ErrorResponse, ErrorType} from '@lobechat/types'; -import { ChatErrorType } from '@lobechat/types'; +import { type ILobeAgentRuntimeErrorType } from '@lobechat/model-runtime'; +import { AgentRuntimeErrorType } from '@lobechat/model-runtime'; +import { type ErrorResponse, type ErrorType } from '@lobechat/types'; +import { ChatErrorType } from '@lobechat/types'; /** * Error types that indicate a real authentication failure. diff --git a/src/utils/locale.ts b/src/utils/locale.ts index 1d0ffe652d..93f89f3346 100644 --- a/src/utils/locale.ts +++ b/src/utils/locale.ts @@ -1,8 +1,8 @@ import { resolveAcceptLanguage } from 'resolve-accept-language'; import { DEFAULT_LANG } from '@/const/locale'; -import type {Locales} from '@/locales/resources'; -import { locales, normalizeLocale } from '@/locales/resources'; +import { type Locales } from '@/locales/resources'; +import { locales, normalizeLocale } from '@/locales/resources'; import { RouteVariants } from './server/routeVariants'; diff --git a/src/utils/router.tsx b/src/utils/router.tsx index 021926bb54..54d5f435a0 100644 --- a/src/utils/router.tsx +++ b/src/utils/router.tsx @@ -1,14 +1,7 @@ 'use client'; -import type {ComponentType, ReactElement} from 'react'; -import { - createElement, - lazy, - memo, - Suspense, - useCallback, - useEffect -} from 'react'; +import { type ComponentType, type ReactElement } from 'react'; +import { createElement, lazy, memo, Suspense, useCallback, useEffect } from 'react'; import { Navigate, Route, useNavigate, useRouteError } from 'react-router-dom'; import Loading from '@/components/Loading/BrandTextLoading'; diff --git a/src/utils/server/pageProps.ts b/src/utils/server/pageProps.ts index 0bd58c7534..82bec56457 100644 --- a/src/utils/server/pageProps.ts +++ b/src/utils/server/pageProps.ts @@ -1,5 +1,5 @@ import { translation } from '@/server/translation'; -import type {DynamicLayoutProps} from '@/types/next'; +import { type DynamicLayoutProps } from '@/types/next'; import { RouteVariants } from './routeVariants'; diff --git a/src/utils/server/parseModels.test.ts b/src/utils/server/parseModels.test.ts index f776d84105..1207584c30 100644 --- a/src/utils/server/parseModels.test.ts +++ b/src/utils/server/parseModels.test.ts @@ -1,5 +1,5 @@ -import type { AiFullModelCard } from 'model-bank'; -import { LOBE_DEFAULT_MODEL_LIST, openaiChatModels } from 'model-bank'; +import { type AiFullModelCard } from 'model-bank'; +import { LOBE_DEFAULT_MODEL_LIST, openaiChatModels } from 'model-bank'; import { describe, expect, it } from 'vitest'; import { extractEnabledModels, parseModelString, transformToAiModelList } from './parseModels'; diff --git a/src/utils/server/parseModels.ts b/src/utils/server/parseModels.ts index 2cf7432b8f..5847811624 100644 --- a/src/utils/server/parseModels.ts +++ b/src/utils/server/parseModels.ts @@ -1,7 +1,7 @@ import { getModelPropertyWithFallback } from '@lobechat/model-runtime'; import { merge } from '@lobechat/utils'; import { produce } from 'immer'; -import type {AiFullModelCard, AiModelType} from 'model-bank'; +import { type AiFullModelCard, type AiModelType } from 'model-bank'; /** * Parse model string to add or remove models. diff --git a/src/utils/server/routeVariants.test.ts b/src/utils/server/routeVariants.test.ts index 205d6a6244..a19fd9da97 100644 --- a/src/utils/server/routeVariants.test.ts +++ b/src/utils/server/routeVariants.test.ts @@ -1,9 +1,9 @@ import { describe, expect, it } from 'vitest'; import { DEFAULT_LANG } from '@/const/locale'; -import type { DynamicLayoutProps } from '@/types/next'; +import { type DynamicLayoutProps } from '@/types/next'; -import type { IRouteVariants} from './routeVariants'; +import { type IRouteVariants } from './routeVariants'; import { DEFAULT_VARIANTS, RouteVariants } from './routeVariants'; describe('RouteVariants', () => { diff --git a/src/utils/server/routeVariants.ts b/src/utils/server/routeVariants.ts index 4e1771e524..66c64f977d 100644 --- a/src/utils/server/routeVariants.ts +++ b/src/utils/server/routeVariants.ts @@ -1,6 +1,6 @@ import { RouteVariants } from '@lobechat/desktop-bridge'; -import type {DynamicLayoutProps} from '@/types/next'; +import { type DynamicLayoutProps } from '@/types/next'; export { LOBE_LOCALE_COOKIE } from '@/const/locale'; export { diff --git a/src/utils/styles.ts b/src/utils/styles.ts index 1fd5de0bee..945e85fa8b 100644 --- a/src/utils/styles.ts +++ b/src/utils/styles.ts @@ -1,4 +1,4 @@ -import type { CSSProperties } from 'react'; +import { type CSSProperties } from 'react'; export const StyleSheet = { compose: (...styles: Array): CSSProperties => { diff --git a/tests/utils.tsx b/tests/utils.tsx index 1b63a214d0..72d8823881 100644 --- a/tests/utils.tsx +++ b/tests/utils.tsx @@ -1,4 +1,4 @@ -import type { PropsWithChildren } from 'react'; +import { type PropsWithChildren } from 'react'; import { SWRConfig } from 'swr'; // 全局的 SWR 配置