chore: fix lint

This commit is contained in:
Innei
2026-02-09 16:07:43 +08:00
committed by arvinxx
parent 2b178010cc
commit 96627b9bb8
1931 changed files with 5236 additions and 5558 deletions
+1 -594
View File
@@ -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
}
}
}
}
+2
View File
@@ -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
@@ -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';
+2 -2
View File
@@ -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';
+2 -2
View File
@@ -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';
+2 -2
View File
@@ -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';
+1 -1
View File
@@ -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';
@@ -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';
@@ -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';
@@ -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();
@@ -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';
@@ -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';
@@ -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;
@@ -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';
@@ -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';
@@ -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';
@@ -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';
+2 -2
View File
@@ -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';
@@ -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';
+5 -7
View File
@@ -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';
@@ -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';
+2 -3
View File
@@ -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,
});
@@ -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';
+2 -2
View File
@@ -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';
+2 -2
View File
@@ -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';
+1 -1
View File
@@ -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';
@@ -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';
@@ -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';
+1 -1
View File
@@ -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';
@@ -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';
@@ -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';
@@ -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';
@@ -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';
@@ -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';
@@ -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';
+2 -2
View File
@@ -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) {
+1 -1
View File
@@ -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';
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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';
@@ -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';
+1 -1
View File
@@ -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';
+1 -1
View File
@@ -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';
+1 -1
View File
@@ -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';
@@ -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';
@@ -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';
@@ -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';
@@ -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<SignUpFormValues>();
@@ -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';
@@ -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;
@@ -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';
@@ -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';
@@ -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<FlexboxProps, 'children'> {
@@ -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';
@@ -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';
@@ -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) => {
@@ -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';
@@ -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';
+2 -2
View File
@@ -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';
@@ -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';
@@ -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';
@@ -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';
@@ -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';
@@ -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';
@@ -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';
@@ -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';
@@ -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';
@@ -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';
@@ -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';
@@ -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';
@@ -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';
@@ -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';
@@ -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)
@@ -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`
@@ -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';
@@ -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';
@@ -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';
@@ -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[];
@@ -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');
@@ -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';
@@ -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';
@@ -1,6 +1,6 @@
'use client';
import type {ConversationContext} from '@lobechat/types';
import { type ConversationContext } from '@lobechat/types';
import { useChatStore } from '@/store/chat';
@@ -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';
@@ -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) {
@@ -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,
@@ -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';
@@ -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 {
@@ -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';
@@ -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';
@@ -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';
@@ -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,
@@ -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 {
@@ -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
@@ -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 {
@@ -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
@@ -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
@@ -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';
@@ -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) =>
@@ -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<PropsWithChildren>(({ children }) => {
@@ -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<PublicState>;
@@ -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 = {

Some files were not shown because too many files have changed in this diff Show More