diff --git a/e2e/src/features/routes/core-routes.feature b/e2e/src/features/routes/core-routes.feature index 3555aadad2..555a5c4c68 100644 --- a/e2e/src/features/routes/core-routes.feature +++ b/e2e/src/features/routes/core-routes.feature @@ -25,7 +25,7 @@ Feature: Core Routes Accessibility @ROUTES-002 @P0 Scenario Outline: Access settings routes without errors - When I navigate to "/settings?active=" + When I navigate to "/settings/" Then the response status should be less than 400 And the page should load without errors And I should see the page body @@ -36,8 +36,7 @@ Feature: Core Routes Accessibility | about | | agent | | hotkey | - | provider | + | provider/all | | proxy | | storage | - | system-agent | | tts | diff --git a/knip.ts b/knip.ts new file mode 100644 index 0000000000..2cadc500ec --- /dev/null +++ b/knip.ts @@ -0,0 +1,23 @@ +import type { KnipConfig } from 'knip'; + +const config: KnipConfig = { + entry: ['src/app/**/*.ts{x,}'], + ignore: [ + // Test files + 'src/**/__tests__/**', + 'src/**/*.test.ts{x,}', + 'src/**/*.spec.ts{x,}', + // Other directories + 'packages/**', + 'e2e/**', + 'scripts/**', + // Config files + '*.config.{js,ts,mjs,cjs}', + 'next-env.d.ts', + ], + ignoreDependencies: [], + ignoreExportsUsedInFile: true, + project: ['src/**/*.ts{x,}'], +}; + +export default config; diff --git a/next.config.ts b/next.config.ts index 42c5baa8d4..8fd62c50a0 100644 --- a/next.config.ts +++ b/next.config.ts @@ -255,40 +255,41 @@ const nextConfig: NextConfig = { source: '/manifest.json', }, { - destination: '/discover/assistant', + destination: '/community/assistant', permanent: true, - source: '/discover/assistants', + source: '/community/assistants', }, { - destination: '/discover/plugin', + destination: '/community/plugin', permanent: true, - source: '/discover/plugins', + source: '/community/plugins', }, { - destination: '/discover/model', + destination: '/community/model', permanent: true, - source: '/discover/models', + source: '/community/models', }, { - destination: '/discover/provider', + destination: '/community/provider', permanent: true, - source: '/discover/providers', + source: '/community/providers', + }, + // Legacy redirects from /discover to /community + { + destination: '/community', + permanent: true, + source: '/discover', + }, + { + destination: '/community/:path*', + permanent: true, + source: '/discover/:path*', }, // { // destination: '/settings/common', // permanent: true, // source: '/settings', // }, - // { - // destination: '/chat', - // permanent: false, - // source: '/', - // }, - { - destination: '/chat', - permanent: true, - source: '/welcome', - }, // we need back /repos url in the further { destination: '/files', @@ -306,7 +307,7 @@ const nextConfig: NextConfig = { ? void 0 : codeInspectorPlugin({ bundler: 'turbopack', - hotKeys: ['altKey'], + hotKeys: ['altKey', 'ctrlKey'], }), }, diff --git a/package.json b/package.json index b6bc544ba0..5205c5839f 100644 --- a/package.json +++ b/package.json @@ -38,8 +38,7 @@ "build-sitemap": "tsx ./scripts/buildSitemapIndex/index.ts", "build:analyze": "NODE_OPTIONS=--max-old-space-size=6144 ANALYZE=true next build --webpack", "build:docker": "npm run prebuild && NODE_OPTIONS=--max-old-space-size=6144 DOCKER=true next build --webpack && npm run build-sitemap", - "prebuild:electron": "cross-env NEXT_PUBLIC_IS_DESKTOP_APP=1 tsx scripts/prebuild.mts", - "build:electron": "cross-env NODE_OPTIONS=--max-old-space-size=6144 NEXT_PUBLIC_IS_DESKTOP_APP=1 next build --webpack", + "build:electron": "cross-env NODE_OPTIONS=--max-old-space-size=6144 NEXT_PUBLIC_IS_DESKTOP_APP=1 tsx scripts/electronWorkflow/buildNextApp.mts", "clean:node_modules": "bash -lc 'set -e; echo \"Removing all node_modules...\"; rm -rf node_modules; pnpm -r exec rm -rf node_modules; rm -rf apps/desktop/node_modules; echo \"All node_modules removed.\"'", "db:generate": "drizzle-kit generate && npm run db:generate-client && npm run workflow:dbml", "db:generate-client": "tsx ./scripts/migrateClientDB/compile-migrations.ts", @@ -50,9 +49,11 @@ "desktop:build-electron": "tsx scripts/electronWorkflow/buildElectron.ts", "desktop:build-local": "npm run desktop:build-next && npm run desktop:prepare-dist && npm run build-local --prefix=./apps/desktop", "desktop:build-next": "npm run build:electron", - "desktop:prepare-dist": "tsx scripts/electronWorkflow/moveNextStandalone.ts", + "desktop:prepare-dist": "tsx scripts/electronWorkflow/moveNextExports.ts", "dev": "next dev -p 3010", - "dev:desktop": "next dev -p 3015", + "dev:bun": "bun --bun next dev -p 3010", + "dev:desktop": "cross-env NEXT_PUBLIC_IS_DESKTOP_APP=1 tsx scripts/runNextDesktop.mts dev -p 3015", + "dev:desktop:static": "cross-env DESKTOP_RENDERER_STATIC=1 npm run electron:dev --prefix=./apps/desktop", "dev:mobile": "next dev -p 3018", "docs:i18n": "lobe-i18n md && npm run lint:md && npm run lint:mdx && prettier -c --write locales/**/*", "docs:seo": "lobe-seo && npm run lint:mdx", @@ -69,9 +70,11 @@ "lint:mdx": "npm run workflow:mdx && remark \"docs/**/*.mdx\" -r ./.remarkrc.mdx.js --silent --output && eslint \"docs/**/*.mdx\" --quiet --fix", "lint:style": "stylelint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix", "lint:ts": "eslint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix", + "lint:unused": "knip --include files,exports,types,enumMembers,duplicates", "prepare": "husky", "prettier": "prettier -c --write \"**/**\"", "pull": "git pull", + "qstash": "pnpx @upstash/qstash-cli@latest dev", "reinstall": "rm -rf .next && rm -rf node_modules && pnpm -r exec rm -rf node_modules && pnpm install", "reinstall:desktop": "rm -rf pnpm-lock.yaml && rm -rf node_modules && pnpm -r exec rm -rf node_modules && pnpm install --node-linker=hoisted", "release": "semantic-release", @@ -85,8 +88,9 @@ "test:e2e": "pnpm --filter @lobechat/e2e-tests test", "test:e2e:smoke": "pnpm --filter @lobechat/e2e-tests test:smoke", "test:update": "vitest -u", + "tunnel:cloudflare": "cloudflared tunnel --url http://localhost:3010", + "tunnel:ngrok": "ngrok http http://localhost:3011", "type-check": "tsgo --noEmit", - "webhook:ngrok": "ngrok http http://localhost:3011", "workflow:cdn": "tsx ./scripts/cdnWorkflow/index.ts", "workflow:changelog": "tsx ./scripts/changelogWorkflow/index.ts", "workflow:countCharters": "tsx scripts/countEnWord.ts", @@ -131,6 +135,8 @@ "@ant-design/icons": "^5.6.1", "@ant-design/pro-components": "^2.8.10", "@anthropic-ai/sdk": "^0.67.1", + "@atlaskit/pragmatic-drag-and-drop": "^1.7.7", + "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0", "@auth/core": "^0.40.0", "@aws-sdk/client-s3": "~3.932.0", "@aws-sdk/s3-request-presigner": "~3.932.0", @@ -144,24 +150,37 @@ "@clerk/themes": "^2.4.43", "@codesandbox/sandpack-react": "^2.20.0", "@cyntler/react-doc-viewer": "^1.17.1", + "@dnd-kit/core": "^6.3.1", + "@dnd-kit/utilities": "^3.2.2", "@electric-sql/pglite": "0.2.17", "@emotion/react": "^11.14.0", "@fal-ai/client": "^1.7.2", "@formkit/auto-animate": "^0.9.0", "@google/genai": "^1.33.0", + "@henrygd/queue": "^1.2.0", "@huggingface/inference": "^4.13.5", "@icons-pack/react-simple-icons": "^13.8.0", "@khmyznikov/pwa-install": "0.3.9", "@langchain/community": "^0.3.58", "@lobechat/agent-runtime": "workspace:*", + "@lobechat/builtin-agents": "workspace:*", + "@lobechat/builtin-tool-agent-builder": "workspace:*", + "@lobechat/builtin-tool-group-agent-builder": "workspace:*", + "@lobechat/builtin-tool-group-management": "workspace:*", + "@lobechat/builtin-tool-gtd": "workspace:*", + "@lobechat/builtin-tool-knowledge-base": "workspace:*", + "@lobechat/builtin-tool-local-system": "workspace:*", + "@lobechat/builtin-tool-memory": "workspace:*", "@lobechat/const": "workspace:*", "@lobechat/context-engine": "workspace:*", "@lobechat/conversation-flow": "workspace:*", "@lobechat/database": "workspace:*", + "@lobechat/desktop-bridge": "workspace:*", "@lobechat/electron-client-ipc": "workspace:*", "@lobechat/electron-server-ipc": "workspace:*", "@lobechat/fetch-sse": "workspace:*", "@lobechat/file-loaders": "workspace:*", + "@lobechat/memory-user-memory": "workspace:*", "@lobechat/model-runtime": "workspace:*", "@lobechat/observability-otel": "workspace:*", "@lobechat/prompts": "workspace:*", @@ -173,18 +192,20 @@ "@lobehub/chat-plugin-sdk": "^1.32.4", "@lobehub/chat-plugins-gateway": "^1.9.0", "@lobehub/desktop-ipc-typings": "workspace:*", - "@lobehub/editor": "^1.31.2", + "@lobehub/editor": "^1.34.4", "@lobehub/icons": "^2.45.0", - "@lobehub/market-sdk": "^0.23.7", + "@lobehub/market-sdk": "^0.23.8", "@lobehub/tts": "^2.0.1", - "@lobehub/ui": "^2.22.0", + "@lobehub/ui": "^2.24.2", "@modelcontextprotocol/sdk": "^1.24.3", "@neondatabase/serverless": "^1.0.2", - "@next/third-parties": "^16.0.8", + "@next/third-parties": "^16.0.10", "@opentelemetry/exporter-jaeger": "^2.2.0", "@opentelemetry/winston-transport": "^0.19.0", "@react-pdf/renderer": "^4.3.1", "@react-spring/web": "^9.7.5", + "@react-three/drei": "^10.7.7", + "@react-three/fiber": "^9.4.2", "@saintno/comfyui-sdk": "^0.2.49", "@serwist/next": "^9.2.3", "@t3-oss/env-nextjs": "^0.13.8", @@ -193,7 +214,9 @@ "@trpc/next": "^11.7.2", "@trpc/react-query": "^11.7.2", "@trpc/server": "^11.7.2", - "@upstash/redis": "^1.35.7", + "@upstash/qstash": "^2.8.4", + "@upstash/redis": "^1.35.8", + "@upstash/workflow": "^0.2.23", "@vercel/analytics": "^1.6.1", "@vercel/edge-config": "^1.4.3", "@vercel/functions": "^3.3.4", @@ -219,10 +242,10 @@ "drizzle-orm": "^0.44.7", "drizzle-zod": "^0.5.1", "epub2": "^3.0.2", + "es-toolkit": "^1.43.0", "fast-deep-equal": "^3.1.3", "fflate": "^0.8.2", "file-type": "^21.1.1", - "framer-motion": "^12.23.26", "gray-matter": "^4.0.3", "html-to-text": "^9.0.5", "i18next": "^25.7.2", @@ -230,20 +253,20 @@ "i18next-resources-to-backend": "^1.2.1", "immer": "^10.2.0", "ioredis": "^5.8.2", - "jose": "^5.10.0", + "jose": "^6.1.3", "js-sha256": "^0.11.1", "jsonl-parse-stringify": "^1.0.3", "klavis": "^2.15.0", "langchain": "^0.3.36", "langfuse": "^3.38.6", "langfuse-core": "^3.38.6", - "lodash-es": "^4.17.21", "lucide-react": "^0.553.0", "mammoth": "^1.11.0", "markdown-to-txt": "^2.0.1", "marked": "^16.4.2", "mdast-util-to-markdown": "^2.1.2", "model-bank": "workspace:*", + "motion": "^12.23.26", "nanoid": "^5.1.6", "next": "^16.0.10", "next-auth": "5.0.0-beta.30", @@ -254,12 +277,14 @@ "numeral": "^2.0.6", "nuqs": "^2.8.5", "officeparser": "5.1.1", + "ogl": "^1.0.11", "oidc-provider": "^9.6.0", "ollama": "^0.6.3", "openai": "^4.104.0", "openapi-fetch": "^0.14.1", "partial-json": "^0.1.7", "path-browserify-esm": "^1.0.6", + "pathe": "^2.0.3", "pdf-parse": "^1.1.4", "pdfjs-dist": "4.8.69", "pdfkit": "^0.17.2", @@ -297,16 +322,18 @@ "rtl-detect": "^1.1.2", "semver": "^7.7.3", "sharp": "^0.34.5", - "shiki": "^3.19.0", + "shiki": "^3.20.0", "ssrf-safe-fetch": "workspace:*", "stripe": "^17.7.0", "superjson": "^2.2.6", "svix": "^1.82.0", "swr": "^2.3.7", "systemjs": "^6.15.1", + "three": "^0.181.2", "tokenx": "^1.2.1", "ts-md5": "^2.0.1", "ua-parser-js": "^1.0.41", + "unist-builder": "^4.0.0", "unstructured-client": "^0.19.0", "url-join": "^5.0.0", "use-merge-value": "^1.2.0", @@ -314,12 +341,16 @@ "virtua": "^0.47.2", "word-extractor": "^1.0.4", "ws": "^8.18.3", + "xast-util-to-xml": "^4.0.0", + "xastscript": "^4.0.0", "yaml": "^2.8.2", "zod": "^3.25.76", + "zod-to-json-schema": "^3.25.0", "zustand": "5.0.4", "zustand-utils": "^2.1.1" }, "devDependencies": { + "@ast-grep/napi": "^0.40.0", "@commitlint/cli": "^19.8.1", "@edge-runtime/vm": "^5.0.0", "@huggingface/tasks": "^0.19.69", @@ -328,8 +359,8 @@ "@lobehub/lint": "^1.26.3", "@lobehub/market-types": "^1.11.5", "@lobehub/seo-cli": "^1.7.0", - "@next/bundle-analyzer": "^16.0.8", - "@next/eslint-plugin-next": "^15.5.7", + "@next/bundle-analyzer": "^16.0.10", + "@next/eslint-plugin-next": "^15.5.9", "@peculiar/webcrypto": "^1.5.0", "@playwright/test": "^1.57.0", "@prettier/sync": "^0.6.1", @@ -344,8 +375,6 @@ "@types/fs-extra": "^11.0.4", "@types/ip": "^1.1.3", "@types/json-schema": "^7.0.15", - "@types/lodash": "^4.17.21", - "@types/lodash-es": "^4.17.12", "@types/node": "^24.10.3", "@types/nodemailer": "^7.0.4", "@types/numeral": "^2.0.5", @@ -357,9 +386,11 @@ "@types/rtl-detect": "^1.0.3", "@types/semver": "^7.7.1", "@types/systemjs": "^6.15.4", + "@types/three": "^0.181.0", "@types/ua-parser-js": "^0.7.39", "@types/unist": "^3.0.3", "@types/ws": "^8.18.1", + "@types/xast": "^2.0.4", "@typescript/native-preview": "7.0.0-dev.20251210.1", "@vitest/coverage-v8": "^3.2.4", "ajv-keywords": "^5.1.0", @@ -383,8 +414,8 @@ "husky": "^9.1.7", "import-in-the-middle": "^2.0.0", "just-diff": "^6.0.2", + "knip": "^5.73.4", "lint-staged": "^16.2.7", - "lodash": "^4.17.21", "markdown-table": "^3.0.4", "mcp-hello-world": "^1.1.2", "mime": "^4.1.0", @@ -419,7 +450,11 @@ "@vercel/speed-insights" ], "overrides": { + "jose": "^6.1.3", "stylelint-config-clean-order": "7.0.0" + }, + "patchedDependencies": { + "@swagger-api/apidom-reference": "patches/@swagger-api__apidom-reference.patch" } } } diff --git a/patches/@swagger-api__apidom-reference.patch b/patches/@swagger-api__apidom-reference.patch new file mode 100644 index 0000000000..ed6d2c95e9 --- /dev/null +++ b/patches/@swagger-api__apidom-reference.patch @@ -0,0 +1,26 @@ +diff --git a/node_modules/.cache/logger/umi.log b/node_modules/.cache/logger/umi.log +new file mode 100644 +index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 +diff --git a/src/parse/parsers/binary/index-node.cjs b/src/parse/parsers/binary/index-node.cjs +index a88ba4d8a0ddff6f4b545ed9368739d94f893eb2..b9b78a29e3c228e7d78e0861b38d734bdef2c854 100644 +--- a/src/parse/parsers/binary/index-node.cjs ++++ b/src/parse/parsers/binary/index-node.cjs +@@ -3,7 +3,7 @@ + var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default; + exports.__esModule = true; + exports.default = void 0; +-var _buffer = require("#buffer"); ++var _buffer = require("buffer"); + var _apidomCore = require("@swagger-api/apidom-core"); + var _ParserError = _interopRequireDefault(require("../../../errors/ParserError.cjs")); + var _Parser = _interopRequireDefault(require("../Parser.cjs")); +diff --git a/src/parse/parsers/binary/index-node.mjs b/src/parse/parsers/binary/index-node.mjs +index 3abce8c52fd5eb7b92f33b66fccf6896ccbc89fe..4a3f957cf127a71c7f2b4dfa56512271b6f785ab 100644 +--- a/src/parse/parsers/binary/index-node.mjs ++++ b/src/parse/parsers/binary/index-node.mjs +@@ -1,4 +1,4 @@ +-import { Buffer } from '#buffer'; // eslint-disable-line import/order ++import { Buffer } from 'buffer'; // eslint-disable-line import/order + import { ParseResultElement, StringElement } from '@swagger-api/apidom-core'; + import ParserError from "../../../errors/ParserError.mjs"; + import Parser from "../Parser.mjs"; diff --git a/public/avatars/agent-builder.png b/public/avatars/agent-builder.png new file mode 100644 index 0000000000..04d5c1cb03 Binary files /dev/null and b/public/avatars/agent-builder.png differ diff --git a/public/avatars/agent-default.png b/public/avatars/agent-default.png new file mode 100644 index 0000000000..800abeaff8 Binary files /dev/null and b/public/avatars/agent-default.png differ diff --git a/public/avatars/doc-copilot.png b/public/avatars/doc-copilot.png new file mode 100644 index 0000000000..b8b6939d3c Binary files /dev/null and b/public/avatars/doc-copilot.png differ diff --git a/public/avatars/lobe-ai.png b/public/avatars/lobe-ai.png new file mode 100644 index 0000000000..b570c5a927 Binary files /dev/null and b/public/avatars/lobe-ai.png differ diff --git a/public/images/mode_lite_dark.webp b/public/images/mode_lite_dark.webp new file mode 100644 index 0000000000..32a85373b9 Binary files /dev/null and b/public/images/mode_lite_dark.webp differ diff --git a/public/images/mode_lite_light.webp b/public/images/mode_lite_light.webp new file mode 100644 index 0000000000..354d89a0c8 Binary files /dev/null and b/public/images/mode_lite_light.webp differ diff --git a/public/images/mode_pro_dark.webp b/public/images/mode_pro_dark.webp new file mode 100644 index 0000000000..05619d1153 Binary files /dev/null and b/public/images/mode_pro_dark.webp differ diff --git a/public/images/mode_pro_light.webp b/public/images/mode_pro_light.webp new file mode 100644 index 0000000000..787b54cae4 Binary files /dev/null and b/public/images/mode_pro_light.webp differ diff --git a/tsconfig.json b/tsconfig.json index 0706dedeb9..ab7dc80972 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,12 @@ "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { "target": "ESNext", - "lib": ["dom", "dom.iterable", "esnext", "webworker"], + "lib": [ + "dom", + "dom.iterable", + "esnext", + "webworker" + ], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -15,14 +20,33 @@ "isolatedModules": true, "jsx": "react-jsx", "incremental": true, - "types": ["vitest/globals", "@serwist/next/typings"], + "types": [ + "vitest/globals", + "@serwist/next/typings" + ], "paths": { - "@/database/*": ["./packages/database/src/*", "./src/database/*"], - "@/const/*": ["./packages/const/src/*", "./src/const/*"], - "@/utils/*": ["./packages/utils/src/*", "./src/utils/*"], - "@/types/*": ["./packages/types/src/*", "./src/types/*"], - "@/*": ["./src/*"], - "~test-utils": ["./tests/utils.tsx"] + "@/database/*": [ + "./packages/database/src/*", + "./src/database/*" + ], + "@/const/*": [ + "./packages/const/src/*", + "./src/const/*" + ], + "@/utils/*": [ + "./packages/utils/src/*", + "./src/utils/*" + ], + "@/types/*": [ + "./packages/types/src/*", + "./src/types/*" + ], + "@/*": [ + "./src/*" + ], + "~test-utils": [ + "./tests/utils.tsx" + ] }, "plugins": [ { @@ -33,17 +57,30 @@ "exclude": [ "node_modules", "public/sw.js", - "apps/desktop", - "apps/mobile", + "apps/desktop/**", + "apps/mobile/**", "tmp", "temp", ".temp", - "e2e" + "e2e/**", + "knip.ts" ], "include": [ - "**/*.d.ts", - "**/*.ts", - "**/*.tsx", + "src/**/*.d.ts", + "src/**/*.ts", + "src/**/*.tsx", + "packages/**/*.d.ts", + "packages/**/*.ts", + "packages/**/*.tsx", + "tests/**/*.d.ts", + "tests/**/*.ts", + "tests/**/*.tsx", + "scripts/**/*.ts", + "scripts/**/*.mts", + "scripts/**/*.cts", + "*.ts", + "*.mts", + "*.cts", ".next/types/**/*.ts", "next-env.d.ts", ".next/dev/types/**/*.ts" @@ -53,4 +90,4 @@ "path": "./apps/desktop" } ] -} +} \ No newline at end of file