Skip to content

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

✨ feat(desktop): implement subscription pages embedding with webview (#12114)

Inneiaaa7b6d153e6
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 676a24aa63f..d8bb71a5733 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1225,7 +1225,7 @@
#### 🐛 Bug Fixes
-- **model-runtime**: Include tool\_calls in speed metrics & add getActiveTraceId.
+- **model-runtime**: Include tool_calls in speed metrics & add getActiveTraceId.
<br/>
@@ -1234,7 +1234,7 @@
#### What's fixed
-- **model-runtime**: Include tool\_calls in speed metrics & add getActiveTraceId, closes [#11927](https://github.com/lobehub/lobe-chat/issues/11927) ([b24da44](https://github.com/lobehub/lobe-chat/commit/b24da44))
+- **model-runtime**: Include tool_calls in speed metrics & add getActiveTraceId, closes [#11927](https://github.com/lobehub/lobe-chat/issues/11927) ([b24da44](https://github.com/lobehub/lobe-chat/commit/b24da44))
</details>
diff --git a/README.md b/README.md
index 53b571e111e..76c5828192d 100644
--- a/README.md
+++ b/README.md
@@ -104,9 +104,9 @@ By adopting the Bootstrapping approach, we aim to provide developers and users w
Whether for users or professional developers, LobeHub will be your AI Agent playground. Please be aware that LobeHub is currently under active development, and feedback is welcome for any [issues][issues-link] encountered.
-| [![](https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1065874\&theme=light\&t=1769347414733)](https://www.producthunt.com/products/lobehub?embed=true\&utm_source=badge-featured\&utm_medium=badge\&utm_campaign=badge-lobehub) | We are live on Product Hunt! We are thrilled to bring LobeHub to the world. If you believe in a future where humans and agents co-evolve, please support our journey. |
-| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [![][discord-shield-badge]][discord-link] | Join our Discord community! This is where you can connect with developers and other enthusiastic users of LobeHub. |
+| [![](https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1065874&theme=light&t=1769347414733)](https://www.producthunt.com/products/lobehub?embed=true&utm_source=badge-featured&utm_medium=badge&utm_campaign=badge-lobehub) | We are live on Product Hunt! We are thrilled to bring LobeHub to the world. If you believe in a future where humans and agents co-evolve, please support our journey. |
+| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| [![][discord-shield-badge]][discord-link] | Join our Discord community! This is where you can connect with developers and other enthusiastic users of LobeHub. |
> \[!IMPORTANT]
>
@@ -587,7 +587,7 @@ LobeHub provides Self-Hosted Version with Vercel, Alibaba Cloud, and [Docker Ima
<div align="center">
-| Deploy with Vercel | Deploy with Zeabur | Deploy with Sealos | Deploy with RepoCloud | Deploy with Alibaba Cloud |
+| Deploy with Vercel | Deploy with Zeabur | Deploy with Sealos | Deploy with RepoCloud | Deploy with Alibaba Cloud |
| :-------------------------------------: | :---------------------------------------------------------: | :---------------------------------------------------------: | :---------------------------------------------------------------: | :-----------------------------------------------------------------------: |
| [![][deploy-button-image]][deploy-link] | [![][deploy-on-zeabur-button-image]][deploy-on-zeabur-link] | [![][deploy-on-sealos-button-image]][deploy-on-sealos-link] | [![][deploy-on-repocloud-button-image]][deploy-on-repocloud-link] | [![][deploy-on-alibaba-cloud-button-image]][deploy-on-alibaba-cloud-link] |
@@ -953,7 +953,7 @@ This project is [LobeHub Community License](./LICENSE) licensed.
[share-whatsapp-shield]: https://img.shields.io/badge/-share%20on%20whatsapp-black?labelColor=black&logo=whatsapp&logoColor=white&style=flat-square
[share-x-link]: https://x.com/intent/tweet?hashtags=chatbot%2CchatGPT%2CopenAI&text=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeHub%20-%20An%20open-source%2C%20extensible%20%28Function%20Calling%29%2C%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT%2FLLM%20web%20application.&url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat
[share-x-shield]: https://img.shields.io/badge/-share%20on%20x-black?labelColor=black&logo=x&logoColor=white&style=flat-square
-[sponsor-link]: https://opencollective.com/lobehub "Become ❤️ LobeHub Sponsor"
+[sponsor-link]: https://opencollective.com/lobehub 'Become ❤️ LobeHub Sponsor'
[sponsor-shield]: https://img.shields.io/badge/-Sponsor%20LobeHub-f04f88?logo=opencollective&logoColor=white&style=flat-square
[submit-agents-link]: https://github.com/lobehub/lobe-chat-agents
[submit-agents-shield]: https://img.shields.io/badge/🤖/🏪_submit_agent-%E2%86%92-c4f042?labelColor=black&style=for-the-badge
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 344849d0a73..2392a7bcff9 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -102,9 +102,9 @@ LobeHub 是一个工作与生活空间,用于发现、构建并与会随着您
不论普通用户与专业开发者,LobeHub 旨在成为所有人的 AI Agent 实验场。LobeChat 目前正在积极开发中,有任何需求或者问题,欢迎提交 [issues][issues-link]
-| [![](https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1065874\&theme=light\&t=1769347414733)](https://www.producthunt.com/products/lobehub?embed=true\&utm_source=badge-featured\&utm_medium=badge\&utm_campaign=badge-lobehub) | 我们已在 Product Hunt 上线!我们很高兴将 LobeHub 推向世界。如果您相信人类与 Agent 共同进化的未来,请支持我们的旅程。 |
-| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------ |
-| [![][discord-shield-badge]][discord-link] | 加入我们的 Discord 社区!这是你可以与开发者和其他 LobeHub 热衷用户交流的地方 |
+| [![](https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1065874&theme=light&t=1769347414733)](https://www.producthunt.com/products/lobehub?embed=true&utm_source=badge-featured&utm_medium=badge&utm_campaign=badge-lobehub) | 我们已在 Product Hunt 上线!我们很高兴将 LobeHub 推向世界。如果您相信人类与 Agent 共同进化的未来,请支持我们的旅程。 |
+| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------- |
+| [![][discord-shield-badge]][discord-link] | 加入我们的 Discord 社区!这是你可以与开发者和其他 LobeHub 热衷用户交流的地方 |
> \[!IMPORTANT]
>
@@ -384,12 +384,12 @@ LobeHub 的插件生态系统是其核心功能的重要扩展,它极大地增
<!-- PLUGIN LIST -->
-| 最近新增 | 描述 |
-| ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
+| 最近新增 | 描述 |
+| -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| [购物工具](https://lobechat.com/discover/plugin/ShoppingTools)<br/><sup>By **shoppingtools** on **2026-01-12**</sup> | 在 eBay 和 AliExpress 上搜索产品,查找 eBay 活动和优惠券。获取快速示例。<br/>`购物` `e-bay` `ali-express` `优惠券` |
-| [SEO 助手](https://lobechat.com/discover/plugin/seo_assistant)<br/><sup>By **webfx** on **2026-01-12**</sup> | SEO 助手可以生成搜索引擎关键词信息,以帮助创建内容。<br/>`seo` `关键词` |
-| [视频字幕](https://lobechat.com/discover/plugin/VideoCaptions)<br/><sup>By **maila** on **2025-12-13**</sup> | 将 Youtube 链接转换为转录文本,使其能够提问,创建章节,并总结其内容。<br/>`视频转文字` `you-tube` |
-| [天气 GPT](https://lobechat.com/discover/plugin/WeatherGPT)<br/><sup>By **steven-tey** on **2025-12-13**</sup> | 获取特定位置的当前天气信息。<br/>`天气` |
+| [SEO 助手](https://lobechat.com/discover/plugin/seo_assistant)<br/><sup>By **webfx** on **2026-01-12**</sup> | SEO 助手可以生成搜索引擎关键词信息,以帮助创建内容。<br/>`seo` `关键词` |
+| [视频字幕](https://lobechat.com/discover/plugin/VideoCaptions)<br/><sup>By **maila** on **2025-12-13**</sup> | 将 Youtube 链接转换为转录文本,使其能够提问,创建章节,并总结其内容。<br/>`视频转文字` `you-tube` |
+| [天气 GPT](https://lobechat.com/discover/plugin/WeatherGPT)<br/><sup>By **steven-tey** on **2025-12-13**</sup> | 获取特定位置的当前天气信息。<br/>`天气` |
> 📊 Total plugins: [<kbd>**40**</kbd>](https://lobechat.com/discover/plugins)
@@ -419,12 +419,12 @@ LobeHub 的插件生态系统是其核心功能的重要扩展,它极大地增
<!-- AGENT LIST -->
-| 最近新增 | 描述 |
-| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
+| 最近新增 | 描述 |
+| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| [海龟汤主持人](https://lobechat.com/discover/assistant/lateral-thinking-puzzle)<br/><sup>By **[CSY2022](https://github.com/CSY2022)** on **2025-06-19**</sup> | 一个海龟汤主持人,需要自己提供汤面,汤底与关键点(猜中的判定条件)。<br/>`海龟汤` `推理` `互动` `谜题` `角色扮演` |
-| [学术写作助手](https://lobechat.com/discover/assistant/academic-writing-assistant)<br/><sup>By **[swarfte](https://github.com/swarfte)** on **2025-06-17**</sup> | 专业的学术研究论文写作和正式文档编写专家<br/>`学术写作` `研究` `正式风格` |
-| [美食评论员🍟](https://lobechat.com/discover/assistant/food-reviewer)<br/><sup>By **[renhai-lab](https://github.com/renhai-lab)** on **2025-06-17**</sup> | 美食评价专家<br/>`美食` `评价` `写作` |
-| [Minecraft 资深开发者](https://lobechat.com/discover/assistant/java-development)<br/><sup>By **[iamyuuk](https://github.com/iamyuuk)** on **2025-06-17**</sup> | 擅长高级 Java 开发及 Minecraft 开发<br/>`开发` `编程` `minecraft` `java` |
+| [学术写作助手](https://lobechat.com/discover/assistant/academic-writing-assistant)<br/><sup>By **[swarfte](https://github.com/swarfte)** on **2025-06-17**</sup> | 专业的学术研究论文写作和正式文档编写专家<br/>`学术写作` `研究` `正式风格` |
+| [美食评论员🍟](https://lobechat.com/discover/assistant/food-reviewer)<br/><sup>By **[renhai-lab](https://github.com/renhai-lab)** on **2025-06-17**</sup> | 美食评价专家<br/>`美食` `评价` `写作` |
+| [Minecraft 资深开发者](https://lobechat.com/discover/assistant/java-development)<br/><sup>By **[iamyuuk](https://github.com/iamyuuk)** on **2025-06-17**</sup> | 擅长高级 Java 开发及 Minecraft 开发<br/>`开发` `编程` `minecraft` `java` |
> 📊 Total agents: [<kbd>**505**</kbd> ](https://lobechat.com/discover/assistants)
@@ -561,7 +561,7 @@ LobeHub 提供了 Vercel 的 自托管版本 和 [Docker 镜像][docker-release-
<div align="center">
-| 使用 Vercel 部署 | 使用 Zeabur 部署 | 使用 Sealos 部署 | 使用阿里云计算巢部署 |
+| 使用 Vercel 部署 | 使用 Zeabur 部署 | 使用 Sealos 部署 | 使用阿里云计算巢部署 |
| :-------------------------------------: | :---------------------------------------------------------: | :---------------------------------------------------------: | :-----------------------------------------------------------------------: |
| [![][deploy-button-image]][deploy-link] | [![][deploy-on-zeabur-button-image]][deploy-on-zeabur-link] | [![][deploy-on-sealos-button-image]][deploy-on-sealos-link] | [![][deploy-on-alibaba-cloud-button-image]][deploy-on-alibaba-cloud-link] |
@@ -617,11 +617,11 @@ docker compose up -d
本项目提供了一些额外的配置项,使用环境变量进行设置:
-| 环境变量 | 类型 | 描述 | 示例 |
-| ------------------- | -- | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
-| `OPENAI_API_KEY` | 必选 | 这是你在 OpenAI 账户页面申请的 API 密钥 | `sk-xxxxxx...xxxxxx` |
-| `OPENAI_PROXY_URL` | 可选 | 如果你手动配置了 OpenAI 接口代理,可以使用此配置项来覆盖默认的 OpenAI API 请求基础 URL | `https://api.chatanywhere.cn` 或 `https://aihubmix.com/v1`<br/>默认值:<br/>`https://api.openai.com/v1` |
-| `OPENAI_MODEL_LIST` | 可选 | 用来控制模型列表,使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名` 来自定义模型的展示名,用英文逗号隔开。 | `qwen-7b-chat,+glm-6b,-gpt-3.5-turbo` |
+| 环境变量 | 类型 | 描述 | 示例 |
+| ------------------- | ---- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
+| `OPENAI_API_KEY` | 必选 | 这是你在 OpenAI 账户页面申请的 API 密钥 | `sk-xxxxxx...xxxxxx` |
+| `OPENAI_PROXY_URL` | 可选 | 如果你手动配置了 OpenAI 接口代理,可以使用此配置项来覆盖默认的 OpenAI API 请求基础 URL | `https://api.chatanywhere.cn` 或 `https://aihubmix.com/v1`<br/>默认值:<br/>`https://api.openai.com/v1` |
+| `OPENAI_MODEL_LIST` | 可选 | 用来控制模型列表,使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名` 来自定义模型的展示名,用英文逗号隔开。 | `qwen-7b-chat,+glm-6b,-gpt-3.5-turbo` |
> \[!NOTE]
>
@@ -638,7 +638,7 @@ API Key 是使用 LobeHub 进行大语言模型会话的必要信息,本节以
- 注册一个 [OpenAI 账户](https://platform.openai.com/signup),你需要使用国际手机号、非大陆邮箱进行注册;
- 注册完毕后,前往 [API Keys](https://platform.openai.com/api-keys) 页面,点击 `Create new secret key` 创建新的 API Key:
-| 步骤 1:打开创建窗口 | 步骤 2:创建 API Key | 步骤 3:获取 API Key |
+| 步骤 1:打开创建窗口 | 步骤 2:创建 API Key | 步骤 3:获取 API Key |
| -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img src="https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296253192-ff2193dd-f125-4e58-82e8-91bc376c0d68.png" height="200"/> | <img src="https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296254170-803bacf0-4471-4171-ae79-0eab08d621d1.png" height="200"/> | <img src="https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296255167-f2745f2b-f083-4ba8-bc78-9b558e0002de.png" height="200"/> |
@@ -656,8 +656,8 @@ API Key 是使用 LobeHub 进行大语言模型会话的必要信息,本节以
如果你发现注册 OpenAI 账户或者绑定外币信用卡比较麻烦,可以考虑借助一些知名的 OpenAI 第三方代理商来获取 API Key,这可以有效降低获取 OpenAI API Key 的门槛。但与此同时,一旦使用三方服务,你可能也需要承担潜在的风险,
请根据你自己的实际情况自行决策。以下是常见的第三方模型代理商列表,供你参考:
-| | 服务商 | 特性说明 | Proxy 代理地址 | 链接 |
-| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------- | ------------------------- | ----------------------------- |
+| | 服务商 | 特性说明 | Proxy 代理地址 | 链接 |
+| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | --------------------------------------------------------------- | ------------------------- | ------------------------------- |
| <img src="https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/296272721-c3ac0bf3-e433-4496-89c4-ebdc20689c17.jpg" width="48" /> | **AiHubMix** | 使用 OpenAI 企业接口,全站模型价格为官方 **86 折**(含 GPT-4 ) | `https://aihubmix.com/v1` | [获取](https://lobe.li/XHnZIUP) |
> \[!WARNING]
@@ -676,11 +676,11 @@ API Key 是使用 LobeHub 进行大语言模型会话的必要信息,本节以
## 📦 生态系统
-| NPM | 仓库 | 描述 | 版本 |
-| --------------------------------- | --------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------- |
-| [@lobehub/ui][lobe-ui-link] | [lobehub/lobe-ui][lobe-ui-github] | 构建 AIGC 网页应用程序而设计的开源 UI 组件库 | [![][lobe-ui-shield]][lobe-ui-link] |
-| [@lobehub/icons][lobe-icons-link] | [lobehub/lobe-icons][lobe-icons-github] | 主流 AI / LLM 模型和公司 SVG Logo 与 Icon 合集 | [![][lobe-icons-shield]][lobe-icons-link] |
-| [@lobehub/tts][lobe-tts-link] | [lobehub/lobe-tts][lobe-tts-github] | AI TTS / STT 语音合成 / 识别 React Hooks 库 | [![][lobe-tts-shield]][lobe-tts-link] |
+| NPM | 仓库 | 描述 | 版本 |
+| --------------------------------- | --------------------------------------- | ---------------------------------------------------------------------------------------- | ----------------------------------------- |
+| [@lobehub/ui][lobe-ui-link] | [lobehub/lobe-ui][lobe-ui-github] | 构建 AIGC 网页应用程序而设计的开源 UI 组件库 | [![][lobe-ui-shield]][lobe-ui-link] |
+| [@lobehub/icons][lobe-icons-link] | [lobehub/lobe-icons][lobe-icons-github] | 主流 AI / LLM 模型和公司 SVG Logo 与 Icon 合集 | [![][lobe-icons-shield]][lobe-icons-link] |
+| [@lobehub/tts][lobe-tts-link] | [lobehub/lobe-tts][lobe-tts-github] | AI TTS / STT 语音合成 / 识别 React Hooks 库 | [![][lobe-tts-shield]][lobe-tts-link] |
| [@lobehub/lint][lobe-lint-link] | [lobehub/lobe-lint][lobe-lint-github] | LobeHub 代码样式规范 ESlint,Stylelint,Commitlint,Prettier,Remark 和 Semantic Release | [![][lobe-lint-shield]][lobe-lint-link] |
<div align="right">
@@ -952,7 +952,7 @@ This project is [LobeHub Community License](./LICENSE) licensed.
[pr-welcome-link]: https://github.com/lobehub/lobe-chat/pulls
[pr-welcome-shield]: https://img.shields.io/badge/🤯_pr_welcome-%E2%86%92-ffcb47?labelColor=black&style=for-the-badge
[profile-link]: https://github.com/lobehub
-[share-mastodon-link]: https://mastodon.social/share?text=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeHub%20-%20An%20open-source,%20extensible%20\(Function%20Calling\),%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT/LLM%20web%20application.%20https://github.com/lobehub/lobe-chat%20#chatbot%20#chatGPT%20#openAI
+[share-mastodon-link]: https://mastodon.social/share?text=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeHub%20-%20An%20open-source,%20extensible%20(Function%20Calling),%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT/LLM%20web%20application.%20https://github.com/lobehub/lobe-chat%20#chatbot%20#chatGPT%20#openAI
[share-mastodon-shield]: https://img.shields.io/badge/-share%20on%20mastodon-black?labelColor=black&logo=mastodon&logoColor=white&style=flat-square
[share-reddit-link]: https://www.reddit.com/submit?title=%E6%8E%A8%E8%8D%90%E4%B8%80%E4%B8%AA%20GitHub%20%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE%20%F0%9F%A4%AF%20LobeHub%20-%20%E5%BC%80%E6%BA%90%E7%9A%84%E3%80%81%E5%8F%AF%E6%89%A9%E5%B1%95%E7%9A%84%EF%BC%88Function%20Calling%EF%BC%89%E9%AB%98%E6%80%A7%E8%83%BD%E8%81%8A%E5%A4%A9%E6%9C%BA%E5%99%A8%E4%BA%BA%E6%A1%86%E6%9E%B6%E3%80%82%0A%E5%AE%83%E6%94%AF%E6%8C%81%E4%B8%80%E9%94%AE%E5%85%8D%E8%B4%B9%E9%83%A8%E7%BD%B2%E7%A7%81%E4%BA%BA%20ChatGPT%2FLLM%20%E7%BD%91%E9%A1%B5%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%20%23chatbot%20%23chatGPT%20%23openAI&url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat
[share-reddit-shield]: https://img.shields.io/badge/-share%20on%20reddit-black?labelColor=black&logo=reddit&logoColor=white&style=flat-square
@@ -964,7 +964,7 @@ This project is [LobeHub Community License](./LICENSE) licensed.
[share-whatsapp-shield]: https://img.shields.io/badge/-share%20on%20whatsapp-black?labelColor=black&logo=whatsapp&logoColor=white&style=flat-square
[share-x-link]: https://x.com/intent/tweet?hashtags=chatbot%2CchatGPT%2CopenAI&text=%E6%8E%A8%E8%8D%90%E4%B8%80%E4%B8%AA%20GitHub%20%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE%20%F0%9F%A4%AF%20LobeHub%20-%20%E5%BC%80%E6%BA%90%E7%9A%84%E3%80%81%E5%8F%AF%E6%89%A9%E5%B1%95%E7%9A%84%EF%BC%88Function%20Calling%EF%BC%89%E9%AB%98%E6%80%A7%E8%83%BD%E8%81%8A%E5%A4%A9%E6%9C%BA%E5%99%A8%E4%BA%BA%E6%A1%86%E6%9E%B6%E3%80%82%0A%E5%AE%83%E6%94%AF%E6%8C%81%E4%B8%80%E9%94%AE%E5%85%8D%E8%B4%B9%E9%83%A8%E7%BD%B2%E7%A7%81%E4%BA%BA%20ChatGPT%2FLLM%20%E7%BD%91%E9%A1%B5%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F&url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat
[share-x-shield]: https://img.shields.io/badge/-share%20on%20x-black?labelColor=black&logo=x&logoColor=white&style=flat-square
-[sponsor-link]: https://opencollective.com/lobehub "Become ❤ LobeHub Sponsor"
+[sponsor-link]: https://opencollective.com/lobehub 'Become ❤ LobeHub Sponsor'
[sponsor-shield]: https://img.shields.io/badge/-Sponsor%20LobeHub-f04f88?logo=opencollective&logoColor=white&style=flat-square
[submit-agents-link]: https://github.com/lobehub/lobe-chat-agents
[submit-agents-shield]: https://img.shields.io/badge/🤖/🏪_submit_agent-%E2%86%92-c4f042?labelColor=black&style=for-the-badge
diff --git a/apps/desktop/src/main/controllers/AuthCtr.ts b/apps/desktop/src/main/controllers/AuthCtr.ts
index ebac9e1d62c..a3450c3dc8b 100644
--- a/apps/desktop/src/main/controllers/AuthCtr.ts
+++ b/apps/desktop/src/main/controllers/AuthCtr.ts
@@ -8,6 +8,7 @@ import crypto from 'node:crypto';
import querystring from 'node:querystring';
import { URL } from 'node:url';
+import { appendVercelCookie } from '@/utils/http-headers';
import { createLogger } from '@/utils/logger';
import RemoteServerConfigCtr from './RemoteServerConfigCtr';
@@ -358,12 +359,9 @@ export default class AuthCtr extends ControllerModule {
logger.debug(`Polling for credentials: ${url.toString()}`);
// Send HTTP request directly
- const response = await fetch(url.toString(), {
- headers: {
- 'Content-Type': 'application/json',
- },
- method: 'GET',
- });
+ const headers: Record<string, string> = { 'Content-Type': 'application/json' };
+ appendVercelCookie(headers);
+ const response = await fetch(url.toString(), { headers, method: 'GET' });
// Check response status
if (response.status === 404) {
@@ -477,11 +475,13 @@ export default class AuthCtr extends ControllerModule {
logger.debug('Sending token exchange request');
// Send request to get token
+ const tokenHeaders: Record<string, string> = {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ };
+ appendVercelCookie(tokenHeaders);
const response = await fetch(tokenUrl.toString(), {
body,
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded',
- },
+ headers: tokenHeaders,
method: 'POST',
});
diff --git a/apps/desktop/src/main/controllers/RemoteServerConfigCtr.ts b/apps/desktop/src/main/controllers/RemoteServerConfigCtr.ts
index cf8ece55522..48807a3a62d 100644
--- a/apps/desktop/src/main/controllers/RemoteServerConfigCtr.ts
+++ b/apps/desktop/src/main/controllers/RemoteServerConfigCtr.ts
@@ -1,10 +1,11 @@
import { DataSyncConfig } from '@lobechat/electron-client-ipc';
import retry from 'async-retry';
-import { safeStorage } from 'electron';
+import { session as electronSession, safeStorage } from 'electron';
import querystring from 'node:querystring';
import { URL } from 'node:url';
import { OFFICIAL_CLOUD_SERVER } from '@/const/env';
+import { appendVercelCookie } from '@/utils/http-headers';
import { createLogger } from '@/utils/logger';
import { ControllerModule, IpcMethod } from './index';
@@ -455,13 +456,11 @@ export default class RemoteServerConfigCtr extends ControllerModule {
logger.debug(`Sending token refresh request to ${tokenUrl.toString()}`);
// Send request
- const response = await fetch(tokenUrl.toString(), {
- body,
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded',
- },
- method: 'POST',
- });
+ const headers: Record<string, string> = {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ };
+ appendVercelCookie(headers);
+ const response = await fetch(tokenUrl.toString(), { body, headers, method: 'POST' });
if (!response.ok) {
// Try to parse error response
@@ -541,4 +540,39 @@ export default class RemoteServerConfigCtr extends ControllerModule {
return dataConfig.storageMode === 'cloud' ? OFFICIAL_CLOUD_SERVER : dataConfig.remoteServerUrl;
}
+
+ /**
+ * Setup subscription webview session with OIDC token injection
+ * This configures a webRequest interceptor on the given partition session
+ * to automatically inject the Oidc-Auth token header for official domain requests.
+ * @param params.partition The partition name for the webview session
+ */
+ @IpcMethod()
+ async setupSubscriptionWebviewSession(params: { partition: string }) {
+ const { partition } = params;
+
+ logger.info(`Setting up subscription webview session for partition: ${partition}`);
+
+ const session = electronSession.fromPartition(partition);
+
+ session.webRequest.onBeforeSendHeaders(
+ { urls: [`https://*.lobehub.com/*`] },
+ async (details, callback) => {
+ const requestHeaders = { ...details.requestHeaders };
+
+ const token = await this.getAccessToken();
+
+ if (token) {
+ requestHeaders['Oidc-Auth'] = token;
+ logger.debug(`Injected Oidc-Auth token for: ${details.url}`);
+ }
+
+ callback({ requestHeaders });
+ },
+ );
+
+ logger.debug(`Subscription webview session setup completed for partition: ${partition}`);
+
+ return { success: true };
+ }
}
diff --git a/apps/desktop/src/main/controllers/RemoteServerSyncCtr.ts b/apps/desktop/src/main/controllers/RemoteServerSyncCtr.ts
index 56196c972b7..1975667d04a 100644
--- a/apps/desktop/src/main/controllers/RemoteServerSyncCtr.ts
+++ b/apps/desktop/src/main/controllers/RemoteServerSyncCtr.ts
@@ -8,6 +8,7 @@ import https from 'node:https';
import { URL } from 'node:url';
import { defaultProxySettings } from '@/const/store';
+import { appendVercelCookie } from '@/utils/http-headers';
import { createLogger } from '@/utils/logger';
import RemoteServerConfigCtr from './RemoteServerConfigCtr';
@@ -189,6 +190,7 @@ export default class RemoteServerSyncCtr extends ControllerModule {
// Prepare headers, cloning and adding Oidc-Auth
const requestHeaders: OutgoingHttpHeaders = { ...headers }; // Use OutgoingHttpHeaders
requestHeaders['Oidc-Auth'] = accessToken;
+ appendVercelCookie(requestHeaders);
// Let node handle Host, Content-Length etc. Remove potentially problematic headers
delete requestHeaders['host'];
diff --git a/apps/desktop/src/main/core/browser/Browser.ts b/apps/desktop/src/main/core/browser/Browser.ts
index bc9f5f48824..182462ecd55 100644
--- a/apps/desktop/src/main/core/browser/Browser.ts
+++ b/apps/desktop/src/main/core/browser/Browser.ts
@@ -3,21 +3,15 @@ import { join } from 'node:path';
import { APP_WINDOW_MIN_SIZE } from '@lobechat/desktop-bridge';
import type { MainBroadcastEventKey, MainBroadcastParams } from '@lobechat/electron-client-ipc';
-import type {
- BrowserWindowConstructorOptions} from 'electron';
-import {
- BrowserWindow,
- ipcMain,
- screen,
- session as electronSession,
-} from 'electron';
+import type { BrowserWindowConstructorOptions } from 'electron';
+import { BrowserWindow, ipcMain, screen, session as electronSession } from 'electron';
import { preloadDir, resourcesDir } from '@/const/dir';
import { isMac } from '@/const/env';
import { ELECTRON_BE_PROTOCOL_SCHEME } from '@/const/protocol';
import RemoteServerConfigCtr from '@/controllers/RemoteServerConfigCtr';
import { backendProxyProtocolManager } from '@/core/infrastructure/BackendProxyProtocolManager';
-import { setResponseHeader } from '@/utils/http-headers';
+import { appendVercelCookie, setResponseHeader } from '@/utils/http-headers';
import { createLogger } from '@/utils/logger';
import type { App } from '../App';
@@ -139,6 +133,7 @@ export default class Browser {
contextIsolation: true,
preload: join(preloadDir, 'index.js'),
sandbox: false,
+ webviewTag: true,
},
width: resolvedState.width,
x: resolvedState.x,
@@ -481,6 +476,8 @@ export default class Browser {
logger.debug(`[${this.identifier}] Removed Origin header for: ${details.url}`);
}
+ appendVercelCookie(requestHeaders);
+
callback({ requestHeaders });
});
diff --git a/apps/desktop/src/main/core/infrastructure/BackendProxyProtocolManager.ts b/apps/desktop/src/main/core/infrastructure/BackendProxyProtocolManager.ts
index 694b6814615..3fbf7c00712 100644
--- a/apps/desktop/src/main/core/infrastructure/BackendProxyProtocolManager.ts
+++ b/apps/desktop/src/main/core/infrastructure/BackendProxyProtocolManager.ts
@@ -2,6 +2,7 @@ import { AUTH_REQUIRED_HEADER } from '@lobechat/desktop-bridge';
import { BrowserWindow, type Session } from 'electron';
import { isDev } from '@/const/env';
+import { appendVercelCookie } from '@/utils/http-headers';
import { createLogger } from '@/utils/logger';
interface BackendProxyProtocolManagerOptions {
@@ -116,6 +117,7 @@ export class BackendProxyProtocolManager {
if (token) {
headers.set('Oidc-Auth', token);
}
+ appendVercelCookie(headers);
// eslint-disable-next-line no-undef
const requestInit: RequestInit & { duplex?: 'half' } = {
diff --git a/apps/desktop/src/main/env.ts b/apps/desktop/src/main/env.ts
index bd894b267a9..11440c13eff 100644
--- a/apps/desktop/src/main/env.ts
+++ b/apps/desktop/src/main/env.ts
@@ -90,6 +90,9 @@ export const getDesktopEnv = memoize(() =>
// Custom update server URL (for stable channel)
// e.g., https://releases.lobehub.com/stable or https://your-bucket.s3.amazonaws.com/releases
UPDATE_SERVER_URL: z.string().optional().default(process.env.UPDATE_SERVER_URL),
+
+ // Vercel JWT for bypassing deployment protection (dev only)
+ VERCEL_JWT: z.string().optional(),
},
}),
);
diff --git a/apps/desktop/src/main/modules/networkProxy/tester.ts b/apps/desktop/src/main/modules/networkProxy/tester.ts
index 257458e11ce..d0cbe3bb476 100644
--- a/apps/desktop/src/main/modules/networkProxy/tester.ts
+++ b/apps/desktop/src/main/modules/networkProxy/tester.ts
@@ -1,6 +1,7 @@
import { NetworkProxySettings } from '@lobechat/electron-client-ipc';
import { fetch, getGlobalDispatcher, setGlobalDispatcher } from 'undici';
+import { appendVercelCookie } from '@/utils/http-headers';
import { createLogger } from '@/utils/logger';
import { ProxyDispatcherManager } from './dispatcher';
@@ -41,12 +42,9 @@ export class ProxyConnectionTester {
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), timeout);
- const response = await fetch(url, {
- headers: {
- 'User-Agent': 'LobeChat-Desktop/1.0.0',
- },
- signal: controller.signal,
- });
+ const headers: Record<string, string> = { 'User-Agent': 'LobeChat-Desktop/1.0.0' };
+ appendVercelCookie(headers);
+ const response = await fetch(url, { headers, signal: controller.signal });
clearTimeout(timeoutId);
@@ -113,11 +111,11 @@ export class ProxyConnectionTester {
setGlobalDispatcher(agent);
try {
+ const testHeaders: Record<string, string> = { 'User-Agent': 'LobeChat-Desktop/1.0.0' };
+ appendVercelCookie(testHeaders);
const response = await fetch(testUrl, {
dispatcher: agent,
- headers: {
- 'User-Agent': 'LobeChat-Desktop/1.0.0',
- },
+ headers: testHeaders,
signal: controller.signal,
});
diff --git a/apps/desktop/src/main/utils/http-headers.ts b/apps/desktop/src/main/utils/http-headers.ts
index 87bbad7e548..0d45f3744a5 100644
--- a/apps/desktop/src/main/utils/http-headers.ts
+++ b/apps/desktop/src/main/utils/http-headers.ts
@@ -4,9 +4,34 @@
* Electron's webRequest responseHeaders is a plain JS object where keys are case-sensitive,
* but HTTP headers are case-insensitive per spec. These utilities handle this mismatch.
*/
+import { getDesktopEnv } from '@/env';
type ElectronResponseHeaders = Record<string, string[]>;
+/**
+ * Append Vercel JWT cookie to headers if VERCEL_JWT env is set.
+ * Works with Headers object, plain object, or OutgoingHttpHeaders.
+ */
+export function appendVercelCookie(
+ headers: Headers | Record<string, string | number | string[] | undefined>,
+): void {
+ const vercelJwt = getDesktopEnv().VERCEL_JWT;
+ if (!vercelJwt) return;
+
+ if (headers instanceof Headers) {
+ const existing = headers.get('Cookie') || '';
+ headers.set(
+ 'Cookie',
+ existing ? `${existing}; _vercel_jwt=${vercelJwt}` : `_vercel_jwt=${vercelJwt}`,
+ );
+ } else {
+ const existing = (headers['Cookie'] as string) || '';
+ headers['Cookie'] = existing
+ ? `${existing}; _vercel_jwt=${vercelJwt}`
+ : `_vercel_jwt=${vercelJwt}`;
+ }
+}
+
/**
* Set a header value, replacing any existing header with the same name (case-insensitive)
*/
diff --git a/eslint-suppressions.json b/eslint-suppressions.json
index 5ed3b1efa0e..4929e546d48 100644
--- a/eslint-suppressions.json
+++ b/eslint-suppressions.json
@@ -1331,4 +1331,4 @@
"count": 1
}
}
-}
\ No newline at end of file
+}
diff --git a/package.json b/package.json
index 24c1ec7bd6f..ce9ec99de65 100644
--- a/package.json
+++ b/package.json
@@ -476,4 +476,4 @@
"drizzle-orm": "0.44.7"
}
}
-}
\ No newline at end of file
+}
diff --git a/packages/agent-runtime/examples/tools-calling.ts b/packages/agent-runtime/examples/tools-calling.ts
index 429771a2e71..912c05def32 100644
--- a/packages/agent-runtime/examples/tools-calling.ts
+++ b/packages/agent-runtime/examples/tools-calling.ts
@@ -300,5 +300,4 @@ async function main() {
console.log(`\n📊 总共执行了 ${state.stepCount} 个步骤`);
}
-
main().catch(console.error);
diff --git a/packages/agent-runtime/src/core/UsageCounter.ts b/packages/agent-runtime/src/core/UsageCounter.ts
index ffb63743773..efaf4bdc10a 100644
--- a/packages/agent-runtime/src/core/UsageCounter.ts
+++ b/packages/agent-runtime/src/core/UsageCounter.ts
@@ -6,7 +6,7 @@ import type { Cost, Usage } from '../types/usage';
* UsageCounter - Pure accumulator for usage and cost tracking
* Focuses only on usage/cost calculations without managing state
*/
-
+
export class UsageCounter {
/**
* Create default usage statistics
diff --git a/packages/agent-runtime/src/core/__tests__/runtime.test.ts b/packages/agent-runtime/src/core/__tests__/runtime.test.ts
index 18617dbb96b..277338d119d 100644
--- a/packages/agent-runtime/src/core/__tests__/runtime.test.ts
+++ b/packages/agent-runtime/src/core/__tests__/runtime.test.ts
@@ -10,7 +10,8 @@ import type {
CostCalculationContext,
CostLimit,
RuntimeConfig,
- Usage} from '../../types';
+ Usage,
+} from '../../types';
import { AgentRuntime } from '../runtime';
// Mock Agent for testing
diff --git a/packages/agent-runtime/src/groupOrchestration/GroupOrchestrationSupervisor.ts b/packages/agent-runtime/src/groupOrchestration/GroupOrchestrationSupervisor.ts
index daa63ef6a12..492448a7e1d 100644
--- a/packages/agent-runtime/src/groupOrchestration/GroupOrchestrationSupervisor.ts
+++ b/packages/agent-runtime/src/groupOrchestration/GroupOrchestrationSupervisor.ts
@@ -44,7 +44,7 @@ export class GroupOrchestrationSupervisor implements IGroupOrchestrationSupervis
/**
* Decide the next instruction based on the executor result
*/
-
+
async decide(result: ExecutorResult, _state: AgentState): Promise<SupervisorInstruction> {
switch (result.type) {
case 'init': {
diff --git a/packages/agent-runtime/src/groupOrchestration/__tests__/GroupOrchestrationSupervisor.test.ts b/packages/agent-runtime/src/groupOrchestration/__tests__/GroupOrchestrationSupervisor.test.ts
index 33326590ad7..c6637c29928 100644
--- a/packages/agent-runtime/src/groupOrchestration/__tests__/GroupOrchestrationSupervisor.test.ts
+++ b/packages/agent-runtime/src/groupOrchestration/__tests__/GroupOrchestrationSupervisor.test.ts
@@ -1,10 +1,8 @@
import { describe, expect, it } from 'vitest';
import type { AgentState } from '../../types/state';
-import type {GroupOrchestrationSupervisorConfig} from '../GroupOrchestrationSupervisor';
-import {
- GroupOrchestrationSupervisor
-} from '../GroupOrchestrationSupervisor';
+import type { GroupOrchestrationSupervisorConfig } from '../GroupOrchestrationSupervisor';
+import { GroupOrchestrationSupervisor } from '../GroupOrchestrationSupervisor';
import type { ExecutorResult } from '../types';
// Helper to create mock AgentState
diff --git a/packages/agent-runtime/src/types/state.ts b/packages/agent-runtime/src/types/state.ts
index 7a8c7a38f08..06016407f8f 100644
--- a/packages/agent-runtime/src/types/state.ts
+++ b/packages/agent-runtime/src/types/state.ts
@@ -1,5 +1,9 @@
/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
-import type { ChatToolPayload, SecurityBlacklistConfig, UserInterventionConfig } from '@lobechat/types';
+import type {
+ ChatToolPayload,
+ SecurityBlacklistConfig,
+ UserInterventionConfig,
+} from '@lobechat/types';
import type { Cost, CostLimit, Usage } from './usage';
diff --git a/packages/builtin-tool-agent-builder/src/ExecutionRuntime/index.ts b/packages/builtin-tool-agent-builder/src/ExecutionRuntime/index.ts
index 15b80a5d377..a8867b5045e 100644
--- a/packages/builtin-tool-agent-builder/src/ExecutionRuntime/index.ts
+++ b/packages/builtin-tool-agent-builder/src/ExecutionRuntime/index.ts
@@ -410,7 +410,6 @@ export class AgentBuilderExecutionRuntime {
window.addEventListener('message', messageHandler);
-
const checkAuthStatus = async (): Promise<boolean> => {
try {
// Check LobehubSkill status
@@ -516,7 +515,6 @@ export class AgentBuilderExecutionRuntime {
resolve(result);
};
-
const checkAuthStatus = async (): Promise<boolean> => {
try {
// Refresh server status first
@@ -603,7 +601,6 @@ export class AgentBuilderExecutionRuntime {
// Small delay for typewriter effect
if (i + chunkSize < prompt.length) {
-
await new Promise((resolve) => setTimeout(resolve, delay));
}
}
diff --git a/packages/builtin-tool-agent-builder/src/client/Inspector/index.ts b/packages/builtin-tool-agent-builder/src/client/Inspector/index.ts
index f331d1c9e56..b567252fcb3 100644
--- a/packages/builtin-tool-agent-builder/src/client/Inspector/index.ts
+++ b/packages/builtin-tool-agent-builder/src/client/Inspector/index.ts
@@ -1,4 +1,4 @@
-import type {BuiltinInspector} from '@lobechat/types';
+import type { BuiltinInspector } from '@lobechat/types';
import { AgentBuilderApiName } from '../../types';
import { GetAvailableModelsInspector } from './GetAvailableModels';
diff --git a/packages/builtin-tool-agent-builder/src/client/Render/GetAvailableModels.tsx b/packages/builtin-tool-agent-builder/src/client/Render/GetAvailableModels.tsx
index 53025c16d7d..0dfd1207ead 100644
--- a/packages/builtin-tool-agent-builder/src/client/Render/GetAvailableModels.tsx
+++ b/packages/builtin-tool-agent-builder/src/client/Render/GetAvailableModels.tsx
@@ -1,5 +1,5 @@
import type { BuiltinRenderProps } from '@lobechat/types';
-import { Flexbox , Tag } from '@lobehub/ui';
+import { Flexbox, Tag } from '@lobehub/ui';
import { memo } from 'react';
import type { GetAvailableModelsParams, GetAvailableModelsState } from '../../types';
diff --git a/packages/builtin-tool-agent-builder/src/client/Render/SearchMarketTools.tsx b/packages/builtin-tool-agent-builder/src/client/Render/SearchMarketTools.tsx
index e02f3834e1f..c7f5603a85f 100644
--- a/packages/builtin-tool-agent-builder/src/client/Render/SearchMarketTools.tsx
+++ b/packages/builtin-tool-agent-builder/src/client/Render/SearchMarketTools.tsx
@@ -1,7 +1,7 @@
'use client';
import type { BuiltinRenderProps } from '@lobechat/types';
-import { Avatar, Button, Flexbox,Tag } from '@lobehub/ui';
+import { Avatar, Button, Flexbox, Tag } from '@lobehub/ui';
import { CheckCircle, Download, Package, Search } from 'lucide-react';
import { memo, useState } from 'react';
diff --git a/packages/builtin-tool-agent-builder/src/executor.ts b/packages/builtin-tool-agent-builder/src/executor.ts
index b5d973ece89..5bcdb6a8aa2 100644
--- a/packages/builtin-tool-agent-builder/src/executor.ts
+++ b/packages/builtin-tool-agent-builder/src/executor.ts
@@ -3,15 +3,18 @@
*
* Handles all agent builder tool calls for configuring and customizing agents.
*/
-import type {BuiltinToolContext, BuiltinToolResult} from '@lobechat/types';
-import { BaseExecutor } from '@lobechat/types';
+import type { BuiltinToolContext, BuiltinToolResult } from '@lobechat/types';
+import { BaseExecutor } from '@lobechat/types';
import { AgentBuilderExecutionRuntime } from './ExecutionRuntime';
-import type {GetAvailableModelsParams, InstallPluginParams, SearchMarketToolsParams, UpdateAgentConfigParams, UpdatePromptParams} from './types';
-import {
- AgentBuilderApiName,
- AgentBuilderIdentifier
+import type {
+ GetAvailableModelsParams,
+ InstallPluginParams,
+ SearchMarketToolsParams,
+ UpdateAgentConfigParams,
+ UpdatePromptParams,
} from './types';
+import { AgentBuilderApiName, AgentBuilderIdentifier } from './types';
const runtime = new AgentBuilderExecutionRuntime();
diff --git a/packages/builtin-tool-cloud-sandbox/src/ExecutionRuntime/index.ts b/packages/builtin-tool-cloud-sandbox/src/ExecutionRuntime/index.ts
index ddf13c17f17..921274cceba 100644
--- a/packages/builtin-tool-cloud-sandbox/src/ExecutionRuntime/index.ts
+++ b/packages/builtin-tool-cloud-sandbox/src/ExecutionRuntime/index.ts
@@ -8,9 +8,39 @@ import {
formatRenameResult,
formatWriteResult,
} from '@lobechat/prompts';
-import type {BuiltinServerRuntimeOutput} from '@lobechat/types';
-
-import type {EditLocalFileParams, EditLocalFileState, ExecuteCodeParams, ExecuteCodeState, ExportFileParams, ExportFileState, GetCommandOutputParams, GetCommandOutputState, GlobFilesState, GlobLocalFilesParams, GrepContentParams, GrepContentState, ISandboxService, KillCommandParams, KillCommandState, ListLocalFilesParams, ListLocalFilesState, MoveLocalFilesParams, MoveLocalFilesState, ReadLocalFileParams, ReadLocalFileState, RenameLocalFileParams, RenameLocalFileState, RunCommandParams, RunCommandState, SearchLocalFilesParams, SearchLocalFilesState, WriteLocalFileParams, WriteLocalFileState} from '../types';
+import type { BuiltinServerRuntimeOutput } from '@lobechat/types';
+
+import type {
+ EditLocalFileParams,
+ EditLocalFileState,
+ ExecuteCodeParams,
+ ExecuteCodeState,
+ ExportFileParams,
+ ExportFileState,
+ GetCommandOutputParams,
+ GetCommandOutputState,
+ GlobFilesState,
+ GlobLocalFilesParams,
+ GrepContentParams,
+ GrepContentState,
+ ISandboxService,
+ KillCommandParams,
+ KillCommandState,
+ ListLocalFilesParams,
+ ListLocalFilesState,
+ MoveLocalFilesParams,
+ MoveLocalFilesState,
+ ReadLocalFileParams,
+ ReadLocalFileState,
+ RenameLocalFileParams,
+ RenameLocalFileState,
+ RunCommandParams,
+ RunCommandState,
+ SearchLocalFilesParams,
+ SearchLocalFilesState,
+ WriteLocalFileParams,
+ WriteLocalFileState,
+} from '../types';
/**
* Cloud Sandbox Execution Runtime
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/EditLocalFile/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/EditLocalFile/index.tsx
index e71ec34045b..b354484d1dd 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/EditLocalFile/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/EditLocalFile/index.tsx
@@ -1,16 +1,16 @@
'use client';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { Icon, Text } from '@lobehub/ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { Minus, Plus } from 'lucide-react';
-import type {ReactNode} from 'react';
-import { memo } from 'react';
+import type { ReactNode } from 'react';
+import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {EditLocalFileState} from '../../../types';
+import type { EditLocalFileState } from '../../../types';
import { FilePathDisplay } from '../../components/FilePathDisplay';
const styles = createStaticStyles(({ css, cssVar }) => ({
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/ExecuteCode/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/ExecuteCode/index.tsx
index ffcdc076878..40b1a5151e1 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/ExecuteCode/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/ExecuteCode/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { Check, X } from 'lucide-react';
import { memo } from 'react';
@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next';
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {ExecuteCodeState} from '../../../types';
+import type { ExecuteCodeState } from '../../../types';
const styles = createStaticStyles(({ css }) => ({
statusIcon: css`
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/GlobLocalFiles/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/GlobLocalFiles/index.tsx
index 13b03f283b5..9e4913d62d6 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/GlobLocalFiles/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/GlobLocalFiles/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { Check, X } from 'lucide-react';
import { memo } from 'react';
@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next';
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {GlobFilesState} from '../../../types';
+import type { GlobFilesState } from '../../../types';
const styles = createStaticStyles(({ css }) => ({
statusIcon: css`
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/GrepContent/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/GrepContent/index.tsx
index bbedfb228f4..b53f086faca 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/GrepContent/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/GrepContent/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { Text } from '@lobehub/ui';
import { cssVar, cx } from 'antd-style';
import { memo } from 'react';
@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next';
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {GrepContentState} from '../../../types';
+import type { GrepContentState } from '../../../types';
interface GrepContentParams {
include?: string;
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/ListLocalFiles/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/ListLocalFiles/index.tsx
index 15b7a9c1c40..5838394a6b3 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/ListLocalFiles/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/ListLocalFiles/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { Text } from '@lobehub/ui';
import { cssVar, cx } from 'antd-style';
import { memo } from 'react';
@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next';
import { inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {ListLocalFilesState} from '../../../types';
+import type { ListLocalFilesState } from '../../../types';
import { FilePathDisplay } from '../../components/FilePathDisplay';
interface ListLocalFilesParams {
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/ReadLocalFile/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/ReadLocalFile/index.tsx
index 17b721edea9..c0923435b9d 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/ReadLocalFile/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/ReadLocalFile/index.tsx
@@ -1,13 +1,13 @@
'use client';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { createStaticStyles, cx } from 'antd-style';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {ReadLocalFileState} from '../../../types';
+import type { ReadLocalFileState } from '../../../types';
import { FilePathDisplay } from '../../components/FilePathDisplay';
const styles = createStaticStyles(({ css }) => ({
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/RunCommand/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/RunCommand/index.tsx
index eb36b29cf4d..b95e8f66f18 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/RunCommand/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/RunCommand/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { Check, X } from 'lucide-react';
import { memo } from 'react';
@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next';
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {RunCommandState} from '../../../types';
+import type { RunCommandState } from '../../../types';
const styles = createStaticStyles(({ css }) => ({
statusIcon: css`
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/SearchLocalFiles/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/SearchLocalFiles/index.tsx
index 6af69f4ab98..fa662c0b91f 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/SearchLocalFiles/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/SearchLocalFiles/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { Text } from '@lobehub/ui';
import { cssVar, cx } from 'antd-style';
import { memo } from 'react';
@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next';
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {SearchLocalFilesState} from '../../../types';
+import type { SearchLocalFilesState } from '../../../types';
interface SearchLocalFilesParams {
path?: string;
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/WriteLocalFile/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/WriteLocalFile/index.tsx
index 136e379ab79..7641efda1b6 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Inspector/WriteLocalFile/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Inspector/WriteLocalFile/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { Icon, Text } from '@lobehub/ui';
import { cssVar, cx } from 'antd-style';
import { Plus } from 'lucide-react';
@@ -9,7 +9,7 @@ import { useTranslation } from 'react-i18next';
import { inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {WriteLocalFileState} from '../../../types';
+import type { WriteLocalFileState } from '../../../types';
import { FilePathDisplay } from '../../components/FilePathDisplay';
interface WriteLocalFileParams {
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Intervention/EditLocalFile/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Intervention/EditLocalFile/index.tsx
index 4d37f1cddc0..b804d5c9219 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Intervention/EditLocalFile/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Intervention/EditLocalFile/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinInterventionProps} from '@lobechat/types';
+import type { BuiltinInterventionProps } from '@lobechat/types';
import { Flexbox, Highlighter, Text } from '@lobehub/ui';
import { memo } from 'react';
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Intervention/ExecuteCode/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Intervention/ExecuteCode/index.tsx
index f0196fa92be..3c6442df4b1 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Intervention/ExecuteCode/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Intervention/ExecuteCode/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinInterventionProps} from '@lobechat/types';
+import type { BuiltinInterventionProps } from '@lobechat/types';
import { Flexbox, Highlighter, Text } from '@lobehub/ui';
import { memo } from 'react';
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Intervention/MoveLocalFiles/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Intervention/MoveLocalFiles/index.tsx
index e91db0fd3a4..586bc7a94c4 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Intervention/MoveLocalFiles/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Intervention/MoveLocalFiles/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinInterventionProps} from '@lobechat/types';
+import type { BuiltinInterventionProps } from '@lobechat/types';
import { Flexbox, Text } from '@lobehub/ui';
import { ArrowRight } from 'lucide-react';
import { memo } from 'react';
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Intervention/RunCommand/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Intervention/RunCommand/index.tsx
index 20cd04ab4b2..7b81c6c5839 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Intervention/RunCommand/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Intervention/RunCommand/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinInterventionProps} from '@lobechat/types';
+import type { BuiltinInterventionProps } from '@lobechat/types';
import { Flexbox, Highlighter, Text } from '@lobehub/ui';
import { memo } from 'react';
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Intervention/WriteFile/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Intervention/WriteFile/index.tsx
index 1634026f764..ea3e52f2ec9 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Intervention/WriteFile/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Intervention/WriteFile/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinInterventionProps} from '@lobechat/types';
+import type { BuiltinInterventionProps } from '@lobechat/types';
import { Flexbox, Highlighter, Text } from '@lobehub/ui';
import { memo } from 'react';
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Render/EditLocalFile/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Render/EditLocalFile/index.tsx
index 0083c3c5c5e..c2591d04991 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Render/EditLocalFile/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Render/EditLocalFile/index.tsx
@@ -1,13 +1,13 @@
'use client';
import { CheckCircleFilled, CloseCircleFilled } from '@ant-design/icons';
-import type {BuiltinRenderProps} from '@lobechat/types';
+import type { BuiltinRenderProps } from '@lobechat/types';
import { ActionIcon, Block, Flexbox, Highlighter, Text } from '@lobehub/ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { ChevronDown, ChevronUp } from 'lucide-react';
import { memo, useState } from 'react';
-import type {EditLocalFileState} from '../../../types';
+import type { EditLocalFileState } from '../../../types';
const styles = createStaticStyles(({ css }) => ({
container: css`
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Render/ExecuteCode/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Render/ExecuteCode/index.tsx
index 7e3e4fef901..6c515597af5 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Render/ExecuteCode/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Render/ExecuteCode/index.tsx
@@ -5,7 +5,7 @@ import { Block, Flexbox, Highlighter } from '@lobehub/ui';
import { createStaticStyles } from 'antd-style';
import { memo } from 'react';
-import type {ExecuteCodeState} from '../../../types';
+import type { ExecuteCodeState } from '../../../types';
const styles = createStaticStyles(({ css }) => ({
container: css`
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Render/ExportFile/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Render/ExportFile/index.tsx
index a5f8bbc9110..4f391e143da 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Render/ExportFile/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Render/ExportFile/index.tsx
@@ -1,12 +1,12 @@
'use client';
import { CheckCircleFilled, CloseCircleFilled, DownloadOutlined } from '@ant-design/icons';
-import type {BuiltinRenderProps} from '@lobechat/types';
+import type { BuiltinRenderProps } from '@lobechat/types';
import { ActionIcon, Flexbox, Text } from '@lobehub/ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { memo, useCallback } from 'react';
-import type {ExportFileState} from '../../../types';
+import type { ExportFileState } from '../../../types';
const styles = createStaticStyles(({ css }) => ({
container: css`
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Render/ListFiles/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Render/ListFiles/index.tsx
index c2b67dbf920..0a469ae534a 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Render/ListFiles/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Render/ListFiles/index.tsx
@@ -1,12 +1,12 @@
'use client';
-import type {BuiltinRenderProps} from '@lobechat/types';
+import type { BuiltinRenderProps } from '@lobechat/types';
import { Block, Flexbox, Text } from '@lobehub/ui';
import { createStaticStyles } from 'antd-style';
import { File, Folder } from 'lucide-react';
import { memo } from 'react';
-import type {ListLocalFilesState} from '../../../types';
+import type { ListLocalFilesState } from '../../../types';
const styles = createStaticStyles(({ css, cssVar }) => ({
container: css`
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Render/MoveLocalFiles/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Render/MoveLocalFiles/index.tsx
index 74204a5095e..67b808e7446 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Render/MoveLocalFiles/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Render/MoveLocalFiles/index.tsx
@@ -1,13 +1,13 @@
'use client';
import { CheckCircleFilled, CloseCircleFilled } from '@ant-design/icons';
-import type {BuiltinRenderProps} from '@lobechat/types';
+import type { BuiltinRenderProps } from '@lobechat/types';
import { Block, Flexbox, Text } from '@lobehub/ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { ArrowRight } from 'lucide-react';
import { memo } from 'react';
-import type {MoveLocalFilesState} from '../../../types';
+import type { MoveLocalFilesState } from '../../../types';
const styles = createStaticStyles(({ css, cssVar }) => ({
arrow: css`
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Render/ReadLocalFile/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Render/ReadLocalFile/index.tsx
index e1d5ea147f7..1f8b148b20a 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Render/ReadLocalFile/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Render/ReadLocalFile/index.tsx
@@ -1,11 +1,11 @@
'use client';
-import type {BuiltinRenderProps} from '@lobechat/types';
+import type { BuiltinRenderProps } from '@lobechat/types';
import { Block, Flexbox, Highlighter, Text } from '@lobehub/ui';
import { createStaticStyles } from 'antd-style';
import { memo } from 'react';
-import type {ReadLocalFileState} from '../../../types';
+import type { ReadLocalFileState } from '../../../types';
const styles = createStaticStyles(({ css }) => ({
container: css`
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Render/RunCommand/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Render/RunCommand/index.tsx
index 4b61e4b9102..1339c73ddac 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Render/RunCommand/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Render/RunCommand/index.tsx
@@ -5,7 +5,7 @@ import { Block, Flexbox, Highlighter } from '@lobehub/ui';
import { createStaticStyles } from 'antd-style';
import { memo } from 'react';
-import type {RunCommandState} from '../../../types';
+import type { RunCommandState } from '../../../types';
const styles = createStaticStyles(({ css }) => ({
container: css`
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Render/SearchFiles/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Render/SearchFiles/index.tsx
index 4d5d519edec..072c0a582e7 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Render/SearchFiles/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Render/SearchFiles/index.tsx
@@ -1,12 +1,12 @@
'use client';
-import type {BuiltinRenderProps} from '@lobechat/types';
+import type { BuiltinRenderProps } from '@lobechat/types';
import { Block, Flexbox, Text } from '@lobehub/ui';
import { createStaticStyles } from 'antd-style';
import { File, Folder } from 'lucide-react';
import { memo } from 'react';
-import type {SearchLocalFilesState} from '../../../types';
+import type { SearchLocalFilesState } from '../../../types';
const styles = createStaticStyles(({ css, cssVar }) => ({
container: css`
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Render/WriteFile/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Render/WriteFile/index.tsx
index 9b45555ae67..35dec2dc0fa 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Render/WriteFile/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Render/WriteFile/index.tsx
@@ -1,10 +1,10 @@
'use client';
-import type {BuiltinRenderProps} from '@lobechat/types';
+import type { BuiltinRenderProps } from '@lobechat/types';
import { Block, Highlighter } from '@lobehub/ui';
import { memo } from 'react';
-import type {WriteLocalFileState} from '../../../types';
+import type { WriteLocalFileState } from '../../../types';
interface WriteLocalFileParams {
content: string;
diff --git a/packages/builtin-tool-cloud-sandbox/src/client/Streaming/ExecuteCode/index.tsx b/packages/builtin-tool-cloud-sandbox/src/client/Streaming/ExecuteCode/index.tsx
index 4bced6608f4..24d1c6fdf05 100644
--- a/packages/builtin-tool-cloud-sandbox/src/client/Streaming/ExecuteCode/index.tsx
+++ b/packages/builtin-tool-cloud-sandbox/src/client/Streaming/ExecuteCode/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinStreamingProps} from '@lobechat/types';
+import type { BuiltinStreamingProps } from '@lobechat/types';
import { Highlighter } from '@lobehub/ui';
import { memo } from 'react';
diff --git a/packages/builtin-tool-cloud-sandbox/src/executor/index.ts b/packages/builtin-tool-cloud-sandbox/src/executor/index.ts
index 783d18b0c83..25d9a826fce 100644
--- a/packages/builtin-tool-cloud-sandbox/src/executor/index.ts
+++ b/packages/builtin-tool-cloud-sandbox/src/executor/index.ts
@@ -1,5 +1,5 @@
-import type {BuiltinToolContext, BuiltinToolResult} from '@lobechat/types';
-import { BaseExecutor } from '@lobechat/types';
+import type { BuiltinToolContext, BuiltinToolResult } from '@lobechat/types';
+import { BaseExecutor } from '@lobechat/types';
import { cloudSandboxService } from '@/services/cloudSandbox';
import { useUserStore } from '@/store/user';
@@ -7,10 +7,26 @@ import { userProfileSelectors } from '@/store/user/slices/auth/selectors';
import { CloudSandboxExecutionRuntime } from '../ExecutionRuntime';
import { CloudSandboxIdentifier } from '../manifest';
-import type {EditLocalFileParams, ExecuteCodeParams, ExportFileParams, GetCommandOutputParams, GlobLocalFilesParams, GrepContentParams, ISandboxService, KillCommandParams, ListLocalFilesParams, MoveLocalFilesParams, ReadLocalFileParams, RenameLocalFileParams, RunCommandParams, SandboxCallToolResult, SandboxExportFileResult, SearchLocalFilesParams, WriteLocalFileParams} from '../types';
-import {
- CloudSandboxApiName
+import type {
+ EditLocalFileParams,
+ ExecuteCodeParams,
+ ExportFileParams,
+ GetCommandOutputParams,
+ GlobLocalFilesParams,
+ GrepContentParams,
+ ISandboxService,
+ KillCommandParams,
+ ListLocalFilesParams,
+ MoveLocalFilesParams,
+ ReadLocalFileParams,
+ RenameLocalFileParams,
+ RunCommandParams,
+ SandboxCallToolResult,
+ SandboxExportFileResult,
+ SearchLocalFilesParams,
+ WriteLocalFileParams,
} from '../types';
+import { CloudSandboxApiName } from '../types';
/**
* Client-side Sandbox Service
diff --git a/packages/builtin-tool-group-agent-builder/src/ExecutionRuntime/index.ts b/packages/builtin-tool-group-agent-builder/src/ExecutionRuntime/index.ts
index 9e64de350e6..396b9b4d75a 100644
--- a/packages/builtin-tool-group-agent-builder/src/ExecutionRuntime/index.ts
+++ b/packages/builtin-tool-group-agent-builder/src/ExecutionRuntime/index.ts
@@ -2,7 +2,7 @@ import { formatAgentProfile } from '@lobechat/prompts';
import type { BuiltinServerRuntimeOutput } from '@lobechat/types';
import { agentService } from '@/services/agent';
-import type {GroupMemberConfig} from '@/services/chatGroup';
+import type { GroupMemberConfig } from '@/services/chatGroup';
import { chatGroupService } from '@/services/chatGroup';
import { useAgentStore } from '@/store/agent';
import { getChatGroupStoreState } from '@/store/agentGroup';
diff --git a/packages/builtin-tool-group-agent-builder/src/client/Inspector/InviteAgent/index.tsx b/packages/builtin-tool-group-agent-builder/src/client/Inspector/InviteAgent/index.tsx
index 55bccb6dfd0..bee0081999c 100644
--- a/packages/builtin-tool-group-agent-builder/src/client/Inspector/InviteAgent/index.tsx
+++ b/packages/builtin-tool-group-agent-builder/src/client/Inspector/InviteAgent/index.tsx
@@ -59,7 +59,9 @@ export const InviteAgentInspector = memo<
<span className={styles.title}>
{t('builtins.lobe-group-agent-builder.apiName.inviteAgent')}:
</span>
- {avatar && <Avatar avatar={avatar} shape={'square'} size={20} title={displayName || undefined} />}
+ {avatar && (
+ <Avatar avatar={avatar} shape={'square'} size={20} title={displayName || undefined} />
+ )}
{displayName && <span>{displayName}</span>}
{!isLoading && isSuccess && (
<Check className={styles.statusIcon} color={cssVar.colorSuccess} size={14} />
diff --git a/packages/builtin-tool-group-agent-builder/src/client/Inspector/RemoveAgent/index.tsx b/packages/builtin-tool-group-agent-builder/src/client/Inspector/RemoveAgent/index.tsx
index 5e32286ff59..366d3ddd19c 100644
--- a/packages/builtin-tool-group-agent-builder/src/client/Inspector/RemoveAgent/index.tsx
+++ b/packages/builtin-tool-group-agent-builder/src/client/Inspector/RemoveAgent/index.tsx
@@ -59,7 +59,9 @@ export const RemoveAgentInspector = memo<
<span className={styles.title}>
{t('builtins.lobe-group-agent-builder.apiName.removeAgent')}:
</span>
- {avatar && <Avatar avatar={avatar} shape={'square'} size={20} title={displayName || undefined} />}
+ {avatar && (
+ <Avatar avatar={avatar} shape={'square'} size={20} title={displayName || undefined} />
+ )}
{displayName && <span>{displayName}</span>}
{!isLoading && isSuccess && (
<Check className={styles.statusIcon} color={cssVar.colorSuccess} size={14} />
diff --git a/packages/builtin-tool-group-agent-builder/src/client/Inspector/index.ts b/packages/builtin-tool-group-agent-builder/src/client/Inspector/index.ts
index aff40695e86..98bea6141f2 100644
--- a/packages/builtin-tool-group-agent-builder/src/client/Inspector/index.ts
+++ b/packages/builtin-tool-group-agent-builder/src/client/Inspector/index.ts
@@ -5,7 +5,7 @@ import {
SearchMarketToolsInspector,
UpdateConfigInspector,
} from '@lobechat/builtin-tool-agent-builder/client';
-import type {BuiltinInspector} from '@lobechat/types';
+import type { BuiltinInspector } from '@lobechat/types';
import { GroupAgentBuilderApiName } from '../../types';
import { BatchCreateAgentsInspector } from './BatchCreateAgents';
diff --git a/packages/builtin-tool-group-agent-builder/src/executor.ts b/packages/builtin-tool-group-agent-builder/src/executor.ts
index 28efa4976b7..c908c6fda3d 100644
--- a/packages/builtin-tool-group-agent-builder/src/executor.ts
+++ b/packages/builtin-tool-group-agent-builder/src/executor.ts
@@ -10,15 +10,23 @@ import type {
SearchMarketToolsParams,
} from '@lobechat/builtin-tool-agent-builder';
import { AgentBuilderExecutionRuntime } from '@lobechat/builtin-tool-agent-builder/executionRuntime';
-import type {BuiltinToolContext, BuiltinToolResult} from '@lobechat/types';
-import { BaseExecutor } from '@lobechat/types';
+import type { BuiltinToolContext, BuiltinToolResult } from '@lobechat/types';
+import { BaseExecutor } from '@lobechat/types';
import { GroupAgentBuilderExecutionRuntime } from './ExecutionRuntime';
-import type {BatchCreateAgentsParams, CreateAgentParams, GetAgentInfoParams, InviteAgentParams, RemoveAgentParams, SearchAgentParams, UpdateAgentConfigWithIdParams, UpdateAgentPromptParams, UpdateGroupParams, UpdateGroupPromptParams} from './types';
-import {
- GroupAgentBuilderApiName,
- GroupAgentBuilderIdentifier
+import type {
+ BatchCreateAgentsParams,
+ CreateAgentParams,
+ GetAgentInfoParams,
+ InviteAgentParams,
+ RemoveAgentParams,
+ SearchAgentParams,
+ UpdateAgentConfigWithIdParams,
+ UpdateAgentPromptParams,
+ UpdateGroupParams,
+ UpdateGroupPromptParams,
} from './types';
+import { GroupAgentBuilderApiName, GroupAgentBuilderIdentifier } from './types';
const agentBuilderRuntime = new AgentBuilderExecutionRuntime();
const groupAgentBuilderRuntime = new GroupAgentBuilderExecutionRuntime();
diff --git a/packages/builtin-tool-group-management/src/client/Inspector/index.ts b/packages/builtin-tool-group-management/src/client/Inspector/index.ts
index c974243b44d..68f545b99e5 100644
--- a/packages/builtin-tool-group-management/src/client/Inspector/index.ts
+++ b/packages/builtin-tool-group-management/src/client/Inspector/index.ts
@@ -1,4 +1,4 @@
-import type {BuiltinInspector} from '@lobechat/types';
+import type { BuiltinInspector } from '@lobechat/types';
import { GroupManagementApiName } from '../../types';
import { BroadcastInspector } from './Broadcast';
diff --git a/packages/builtin-tool-group-management/src/client/Intervention/ExecuteTask.tsx b/packages/builtin-tool-group-management/src/client/Intervention/ExecuteTask.tsx
index ea72c96e941..76a27ccf2cc 100644
--- a/packages/builtin-tool-group-management/src/client/Intervention/ExecuteTask.tsx
+++ b/packages/builtin-tool-group-management/src/client/Intervention/ExecuteTask.tsx
@@ -6,7 +6,7 @@ import { Input, InputNumber } from 'antd';
import { createStaticStyles } from 'antd-style';
import isEqual from 'fast-deep-equal';
import { Clock } from 'lucide-react';
-import type { ChangeEvent} from 'react';
+import type { ChangeEvent } from 'react';
import { memo, useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/packages/builtin-tool-group-management/src/client/Intervention/ExecuteTasks.tsx b/packages/builtin-tool-group-management/src/client/Intervention/ExecuteTasks.tsx
index c844edb9779..ddf23e0d3cf 100644
--- a/packages/builtin-tool-group-management/src/client/Intervention/ExecuteTasks.tsx
+++ b/packages/builtin-tool-group-management/src/client/Intervention/ExecuteTasks.tsx
@@ -7,7 +7,7 @@ import { Input, InputNumber } from 'antd';
import { createStaticStyles, useTheme } from 'antd-style';
import isEqual from 'fast-deep-equal';
import { Clock, Trash2 } from 'lucide-react';
-import type { ChangeEvent} from 'react';
+import type { ChangeEvent } from 'react';
import { memo, useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/packages/builtin-tool-group-management/src/executor.ts b/packages/builtin-tool-group-management/src/executor.ts
index 12025672de4..c7195254b2f 100644
--- a/packages/builtin-tool-group-management/src/executor.ts
+++ b/packages/builtin-tool-group-management/src/executor.ts
@@ -1,4 +1,3 @@
-
/**
* Lobe Group Management Executor
*
@@ -15,13 +14,14 @@ import type {
InterruptParams,
SpeakParams,
SummarizeParams,
- VoteParams} from '@lobechat/builtin-tool-group-management';
+ VoteParams,
+} from '@lobechat/builtin-tool-group-management';
import {
GroupManagementApiName,
- GroupManagementIdentifier
+ GroupManagementIdentifier,
} from '@lobechat/builtin-tool-group-management';
-import type {BuiltinToolContext, BuiltinToolResult} from '@lobechat/types';
-import { BaseExecutor } from '@lobechat/types';
+import type { BuiltinToolContext, BuiltinToolResult } from '@lobechat/types';
+import { BaseExecutor } from '@lobechat/types';
class GroupManagementExecutor extends BaseExecutor<typeof GroupManagementApiName> {
readonly identifier = GroupManagementIdentifier;
diff --git a/packages/builtin-tool-gtd/src/client/Inspector/UpdateTodos/index.tsx b/packages/builtin-tool-gtd/src/client/Inspector/UpdateTodos/index.tsx
index b6a21943d02..e5b3cb1115c 100644
--- a/packages/builtin-tool-gtd/src/client/Inspector/UpdateTodos/index.tsx
+++ b/packages/builtin-tool-gtd/src/client/Inspector/UpdateTodos/index.tsx
@@ -4,8 +4,8 @@ import type { BuiltinInspectorProps } from '@lobechat/types';
import { Icon, Text } from '@lobehub/ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { CheckCircle, DiffIcon, Minus, Plus } from 'lucide-react';
-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 { oneLineEllipsis, shinyTextStyles } from '@/styles';
diff --git a/packages/builtin-tool-gtd/src/client/Inspector/index.ts b/packages/builtin-tool-gtd/src/client/Inspector/index.ts
index ebe872a4576..b147d614c47 100644
--- a/packages/builtin-tool-gtd/src/client/Inspector/index.ts
+++ b/packages/builtin-tool-gtd/src/client/Inspector/index.ts
@@ -1,4 +1,4 @@
-import type {BuiltinInspector} from '@lobechat/types';
+import type { BuiltinInspector } from '@lobechat/types';
import { GTDApiName } from '../../types';
import { ClearTodosInspector } from './ClearTodos';
diff --git a/packages/builtin-tool-gtd/src/client/Render/TodoList/index.tsx b/packages/builtin-tool-gtd/src/client/Render/TodoList/index.tsx
index 312f4ab3c8e..1be41bede76 100644
--- a/packages/builtin-tool-gtd/src/client/Render/TodoList/index.tsx
+++ b/packages/builtin-tool-gtd/src/client/Render/TodoList/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinRenderProps} from '@lobechat/types';
+import type { BuiltinRenderProps } from '@lobechat/types';
import { Block, Checkbox, Icon } from '@lobehub/ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { CircleArrowRight } from 'lucide-react';
diff --git a/packages/builtin-tool-gtd/src/client/components/SortableTodoList/AddItemRow.tsx b/packages/builtin-tool-gtd/src/client/components/SortableTodoList/AddItemRow.tsx
index 81696dfe070..e0baddaec1d 100644
--- a/packages/builtin-tool-gtd/src/client/components/SortableTodoList/AddItemRow.tsx
+++ b/packages/builtin-tool-gtd/src/client/components/SortableTodoList/AddItemRow.tsx
@@ -4,7 +4,7 @@ import { ActionIcon, Checkbox, Flexbox, Input } from '@lobehub/ui';
import type { InputRef } from 'antd';
import { createStaticStyles, cx } from 'antd-style';
import { Plus } from 'lucide-react';
-import type { ChangeEvent, KeyboardEvent} from 'react';
+import type { ChangeEvent, KeyboardEvent } from 'react';
import { memo, useCallback, useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/packages/builtin-tool-gtd/src/client/components/SortableTodoList/TodoItemRow.tsx b/packages/builtin-tool-gtd/src/client/components/SortableTodoList/TodoItemRow.tsx
index f9ca428c6ee..c0fa1002c9e 100644
--- a/packages/builtin-tool-gtd/src/client/components/SortableTodoList/TodoItemRow.tsx
+++ b/packages/builtin-tool-gtd/src/client/components/SortableTodoList/TodoItemRow.tsx
@@ -5,7 +5,7 @@ import type { InputRef } from 'antd';
import { Input } from 'antd';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { CircleArrowRight, Trash2 } from 'lucide-react';
-import type { ChangeEvent, KeyboardEvent} from 'react';
+import type { ChangeEvent, KeyboardEvent } from 'react';
import { memo, useCallback, useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/packages/builtin-tool-gtd/src/client/components/SortableTodoList/TodoList.tsx b/packages/builtin-tool-gtd/src/client/components/SortableTodoList/TodoList.tsx
index 0bbb988faf2..7747e422c03 100644
--- a/packages/builtin-tool-gtd/src/client/components/SortableTodoList/TodoList.tsx
+++ b/packages/builtin-tool-gtd/src/client/components/SortableTodoList/TodoList.tsx
@@ -5,7 +5,7 @@ import { memo, useCallback } from 'react';
import AddItemRow from './AddItemRow';
import SortableItem from './SortableItem';
-import type { TodoListItem} from './store';
+import type { TodoListItem } from './store';
import { useTodoListStore } from './store';
interface TodoListProps {
diff --git a/packages/builtin-tool-gtd/src/client/components/SortableTodoList/index.tsx b/packages/builtin-tool-gtd/src/client/components/SortableTodoList/index.tsx
index 4632b119658..a3e91c3ee54 100644
--- a/packages/builtin-tool-gtd/src/client/components/SortableTodoList/index.tsx
+++ b/packages/builtin-tool-gtd/src/client/components/SortableTodoList/index.tsx
@@ -4,7 +4,7 @@ import { useUnmount } from 'ahooks';
import { memo, useEffect, useMemo } from 'react';
import type { TodoItem } from '../../../types';
-import { createTodoListStore,TodoListStoreContext } from './store';
+import { createTodoListStore, TodoListStoreContext } from './store';
import TodoList from './TodoList';
export type { TodoListItem } from './store';
diff --git a/packages/builtin-tool-gtd/src/client/components/SortableTodoList/store/actions.ts b/packages/builtin-tool-gtd/src/client/components/SortableTodoList/store/actions.ts
index 91596ef48ef..900494f4264 100644
--- a/packages/builtin-tool-gtd/src/client/components/SortableTodoList/store/actions.ts
+++ b/packages/builtin-tool-gtd/src/client/components/SortableTodoList/store/actions.ts
@@ -1,7 +1,7 @@
import { debounce } from 'es-toolkit/compat';
-import type {TodoItem} from '../../../../types';
-import { getNextTodoStatus } from '../../../../types';
+import type { TodoItem } from '../../../../types';
+import { getNextTodoStatus } from '../../../../types';
import { AUTO_SAVE_DELAY, AUTO_SAVE_MAX_WAIT, initialState } from './initialState';
import type { StoreInternals, TodoListItem, TodoListStore } from './types';
import { ADD_ITEM_ID } from './types';
diff --git a/packages/builtin-tool-gtd/src/client/components/SortableTodoList/store/index.ts b/packages/builtin-tool-gtd/src/client/components/SortableTodoList/store/index.ts
index 016be9e492b..d911934d17e 100644
--- a/packages/builtin-tool-gtd/src/client/components/SortableTodoList/store/index.ts
+++ b/packages/builtin-tool-gtd/src/client/components/SortableTodoList/store/index.ts
@@ -1,5 +1,5 @@
import { createContext, useContext } from 'react';
-import type { StoreApi} from 'zustand';
+import type { StoreApi } from 'zustand';
import { createStore, useStore } from 'zustand';
import type { TodoItem } from '../../../../types';
diff --git a/packages/builtin-tool-gtd/src/executor/helper.ts b/packages/builtin-tool-gtd/src/executor/helper.ts
index 9efdb5b2667..75130ae74e5 100644
--- a/packages/builtin-tool-gtd/src/executor/helper.ts
+++ b/packages/builtin-tool-gtd/src/executor/helper.ts
@@ -1,6 +1,6 @@
-import type {BuiltinToolContext} from '@lobechat/types';
+import type { BuiltinToolContext } from '@lobechat/types';
-import type {TodoItem} from '../types';
+import type { TodoItem } from '../types';
/**
* Helper to get todos from step context or fallback to plugin state
diff --git a/packages/builtin-tool-gtd/src/executor/index.ts b/packages/builtin-tool-gtd/src/executor/index.ts
index d0faf002cf0..38356d897a9 100644
--- a/packages/builtin-tool-gtd/src/executor/index.ts
+++ b/packages/builtin-tool-gtd/src/executor/index.ts
@@ -1,15 +1,24 @@
import { formatTodoStateSummary } from '@lobechat/prompts';
-import type {BuiltinToolContext, BuiltinToolResult} from '@lobechat/types';
-import { BaseExecutor } from '@lobechat/types';
+import type { BuiltinToolContext, BuiltinToolResult } from '@lobechat/types';
+import { BaseExecutor } from '@lobechat/types';
import { notebookService } from '@/services/notebook';
import { useNotebookStore } from '@/store/notebook';
import { GTDIdentifier } from '../manifest';
-import type {ClearTodosParams, CreatePlanParams, CreateTodosParams, ExecTaskParams, ExecTasksParams, Plan, TodoItem, TodoState, UpdatePlanParams, UpdateTodosParams} from '../types';
-import {
- GTDApiName
+import type {
+ ClearTodosParams,
+ CreatePlanParams,
+ CreateTodosParams,
+ ExecTaskParams,
+ ExecTasksParams,
+ Plan,
+ TodoItem,
+ TodoState,
+ UpdatePlanParams,
+ UpdateTodosParams,
} from '../types';
+import { GTDApiName } from '../types';
import { getTodosFromContext } from './helper';
/**
diff --git a/packages/builtin-tool-knowledge-base/src/client/Inspector/ReadKnowledge/index.tsx b/packages/builtin-tool-knowledge-base/src/client/Inspector/ReadKnowledge/index.tsx
index 29a475c3d56..f8a2d4e5f40 100644
--- a/packages/builtin-tool-knowledge-base/src/client/Inspector/ReadKnowledge/index.tsx
+++ b/packages/builtin-tool-knowledge-base/src/client/Inspector/ReadKnowledge/index.tsx
@@ -1,13 +1,13 @@
'use client';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { createStaticStyles, cx } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {ReadKnowledgeArgs, ReadKnowledgeState} from '../../..';
+import type { ReadKnowledgeArgs, ReadKnowledgeState } from '../../..';
const styles = createStaticStyles(({ css, cssVar }) => ({
moreFiles: css`
diff --git a/packages/builtin-tool-knowledge-base/src/client/Inspector/SearchKnowledgeBase/index.tsx b/packages/builtin-tool-knowledge-base/src/client/Inspector/SearchKnowledgeBase/index.tsx
index 6734c9f18a3..70dfa733af8 100644
--- a/packages/builtin-tool-knowledge-base/src/client/Inspector/SearchKnowledgeBase/index.tsx
+++ b/packages/builtin-tool-knowledge-base/src/client/Inspector/SearchKnowledgeBase/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { Text } from '@lobehub/ui';
import { cssVar, cx } from 'antd-style';
import { memo } from 'react';
@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next';
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {SearchKnowledgeBaseArgs, SearchKnowledgeBaseState} from '../../..';
+import type { SearchKnowledgeBaseArgs, SearchKnowledgeBaseState } from '../../..';
export const SearchKnowledgeBaseInspector = memo<
BuiltinInspectorProps<SearchKnowledgeBaseArgs, SearchKnowledgeBaseState>
diff --git a/packages/builtin-tool-knowledge-base/src/executor/index.ts b/packages/builtin-tool-knowledge-base/src/executor/index.ts
index 7c512fc5b5b..5d02298e5b6 100644
--- a/packages/builtin-tool-knowledge-base/src/executor/index.ts
+++ b/packages/builtin-tool-knowledge-base/src/executor/index.ts
@@ -1,15 +1,19 @@
import { formatSearchResults, promptFileContents, promptNoSearchResults } from '@lobechat/prompts';
-import type {BuiltinToolContext, BuiltinToolResult} from '@lobechat/types';
-import { BaseExecutor } from '@lobechat/types';
+import type { BuiltinToolContext, BuiltinToolResult } from '@lobechat/types';
+import { BaseExecutor } from '@lobechat/types';
import { ragService } from '@/services/rag';
import { agentSelectors } from '@/store/agent/selectors';
import { getAgentStoreState } from '@/store/agent/store';
-import type {FileContentDetail, ReadKnowledgeArgs, ReadKnowledgeState, SearchKnowledgeBaseArgs, SearchKnowledgeBaseState} from '../types';
-import {
- KnowledgeBaseIdentifier
+import type {
+ FileContentDetail,
+ ReadKnowledgeArgs,
+ ReadKnowledgeState,
+ SearchKnowledgeBaseArgs,
+ SearchKnowledgeBaseState,
} from '../types';
+import { KnowledgeBaseIdentifier } from '../types';
/**
* Knowledge Base Tool Executor
diff --git a/packages/builtin-tool-local-system/src/client/Inspector/EditLocalFile/index.tsx b/packages/builtin-tool-local-system/src/client/Inspector/EditLocalFile/index.tsx
index a89cb902902..adcc684b6e5 100644
--- a/packages/builtin-tool-local-system/src/client/Inspector/EditLocalFile/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Inspector/EditLocalFile/index.tsx
@@ -1,17 +1,17 @@
'use client';
-import type {EditLocalFileParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { EditLocalFileParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { Icon, Text } from '@lobehub/ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { Minus, Plus } from 'lucide-react';
-import type {ReactNode} from 'react';
-import { memo } from 'react';
+import type { ReactNode } from 'react';
+import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {EditLocalFileState} from '../../../types';
+import type { EditLocalFileState } from '../../../types';
import { FilePathDisplay } from '../../components/FilePathDisplay';
const styles = createStaticStyles(({ css, cssVar }) => ({
diff --git a/packages/builtin-tool-local-system/src/client/Inspector/GlobLocalFiles/index.tsx b/packages/builtin-tool-local-system/src/client/Inspector/GlobLocalFiles/index.tsx
index b47f427d616..af84937ab85 100644
--- a/packages/builtin-tool-local-system/src/client/Inspector/GlobLocalFiles/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Inspector/GlobLocalFiles/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import type {GlobFilesParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { GlobFilesParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { Text } from '@lobehub/ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { Check, X } from 'lucide-react';
@@ -10,7 +10,7 @@ import { useTranslation } from 'react-i18next';
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {GlobFilesState} from '../../..';
+import type { GlobFilesState } from '../../..';
const styles = createStaticStyles(({ css }) => ({
statusIcon: css`
diff --git a/packages/builtin-tool-local-system/src/client/Inspector/GrepContent/index.tsx b/packages/builtin-tool-local-system/src/client/Inspector/GrepContent/index.tsx
index 62df7221114..61a9324b74a 100644
--- a/packages/builtin-tool-local-system/src/client/Inspector/GrepContent/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Inspector/GrepContent/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import type {GrepContentParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { GrepContentParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { Text } from '@lobehub/ui';
import { cssVar, cx } from 'antd-style';
import { memo } from 'react';
@@ -9,7 +9,7 @@ import { useTranslation } from 'react-i18next';
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {GrepContentState} from '../../..';
+import type { GrepContentState } from '../../..';
export const GrepContentInspector = memo<
BuiltinInspectorProps<GrepContentParams, GrepContentState>
diff --git a/packages/builtin-tool-local-system/src/client/Inspector/ListLocalFiles/index.tsx b/packages/builtin-tool-local-system/src/client/Inspector/ListLocalFiles/index.tsx
index 9bf4a96ef77..f4195915478 100644
--- a/packages/builtin-tool-local-system/src/client/Inspector/ListLocalFiles/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Inspector/ListLocalFiles/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import type {ListLocalFileParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { ListLocalFileParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { Text } from '@lobehub/ui';
import { cssVar, cx } from 'antd-style';
import { memo } from 'react';
@@ -9,7 +9,7 @@ import { useTranslation } from 'react-i18next';
import { inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {LocalFileListState} from '../../..';
+import type { LocalFileListState } from '../../..';
import { FilePathDisplay } from '../../components/FilePathDisplay';
export const ListLocalFilesInspector = memo<
diff --git a/packages/builtin-tool-local-system/src/client/Inspector/ReadLocalFile/index.tsx b/packages/builtin-tool-local-system/src/client/Inspector/ReadLocalFile/index.tsx
index ebb2b1b62d6..7c905d33901 100644
--- a/packages/builtin-tool-local-system/src/client/Inspector/ReadLocalFile/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Inspector/ReadLocalFile/index.tsx
@@ -1,14 +1,14 @@
'use client';
-import type {LocalReadFileParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { LocalReadFileParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { createStaticStyles, cx } from 'antd-style';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {LocalReadFileState} from '../../..';
+import type { LocalReadFileState } from '../../..';
import { FilePathDisplay } from '../../components/FilePathDisplay';
const styles = createStaticStyles(({ css }) => ({
diff --git a/packages/builtin-tool-local-system/src/client/Inspector/RenameLocalFile/index.tsx b/packages/builtin-tool-local-system/src/client/Inspector/RenameLocalFile/index.tsx
index 8d62f7af6e3..3ed39b73dc1 100644
--- a/packages/builtin-tool-local-system/src/client/Inspector/RenameLocalFile/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Inspector/RenameLocalFile/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import type {RenameLocalFileParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { RenameLocalFileParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { MaterialFileTypeIcon } from '@lobehub/ui';
import { createStaticStyles, cx } from 'antd-style';
import path from 'path-browserify-esm';
@@ -10,7 +10,7 @@ import { useTranslation } from 'react-i18next';
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {LocalRenameFileState} from '../../..';
+import type { LocalRenameFileState } from '../../..';
const styles = createStaticStyles(({ css }) => ({
icon: css`
diff --git a/packages/builtin-tool-local-system/src/client/Inspector/RunCommand/index.tsx b/packages/builtin-tool-local-system/src/client/Inspector/RunCommand/index.tsx
index 65ad5317271..008a358658c 100644
--- a/packages/builtin-tool-local-system/src/client/Inspector/RunCommand/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Inspector/RunCommand/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import type {RunCommandParams, RunCommandResult} from '@lobechat/electron-client-ipc';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { RunCommandParams, RunCommandResult } from '@lobechat/electron-client-ipc';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { Check, X } from 'lucide-react';
import { memo } from 'react';
diff --git a/packages/builtin-tool-local-system/src/client/Inspector/SearchLocalFiles/index.tsx b/packages/builtin-tool-local-system/src/client/Inspector/SearchLocalFiles/index.tsx
index 366d43a2b43..f67fb032d33 100644
--- a/packages/builtin-tool-local-system/src/client/Inspector/SearchLocalFiles/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Inspector/SearchLocalFiles/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import type {LocalSearchFilesParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { LocalSearchFilesParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { Text } from '@lobehub/ui';
import { cssVar, cx } from 'antd-style';
import { memo } from 'react';
@@ -9,7 +9,7 @@ import { useTranslation } from 'react-i18next';
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
-import type {LocalFileSearchState} from '../../..';
+import type { LocalFileSearchState } from '../../..';
export const SearchLocalFilesInspector = memo<
BuiltinInspectorProps<LocalSearchFilesParams, LocalFileSearchState>
diff --git a/packages/builtin-tool-local-system/src/client/Inspector/WriteLocalFile/index.tsx b/packages/builtin-tool-local-system/src/client/Inspector/WriteLocalFile/index.tsx
index 59967f913d3..4fcbbe4a878 100644
--- a/packages/builtin-tool-local-system/src/client/Inspector/WriteLocalFile/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Inspector/WriteLocalFile/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import type {WriteLocalFileParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { WriteLocalFileParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { Icon, Text } from '@lobehub/ui';
import { cssVar, cx } from 'antd-style';
import { Plus } from 'lucide-react';
diff --git a/packages/builtin-tool-local-system/src/client/Intervention/EditLocalFile/index.tsx b/packages/builtin-tool-local-system/src/client/Intervention/EditLocalFile/index.tsx
index 54ba6a0327e..0cbefcbc038 100644
--- a/packages/builtin-tool-local-system/src/client/Intervention/EditLocalFile/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Intervention/EditLocalFile/index.tsx
@@ -1,5 +1,5 @@
-import type {EditLocalFileParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinInterventionProps} from '@lobechat/types';
+import type { EditLocalFileParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinInterventionProps } from '@lobechat/types';
import { CodeDiff, Flexbox, Icon, Skeleton, Text } from '@lobehub/ui';
import { ChevronRight } from 'lucide-react';
import path from 'path-browserify-esm';
diff --git a/packages/builtin-tool-local-system/src/client/Intervention/MoveLocalFiles/index.tsx b/packages/builtin-tool-local-system/src/client/Intervention/MoveLocalFiles/index.tsx
index ec5eddab46c..01190723e02 100644
--- a/packages/builtin-tool-local-system/src/client/Intervention/MoveLocalFiles/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Intervention/MoveLocalFiles/index.tsx
@@ -1,5 +1,5 @@
-import type {MoveLocalFilesParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinInterventionProps} from '@lobechat/types';
+import type { MoveLocalFilesParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinInterventionProps } from '@lobechat/types';
import { Flexbox, Text } from '@lobehub/ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/packages/builtin-tool-local-system/src/client/Intervention/RunCommand/index.tsx b/packages/builtin-tool-local-system/src/client/Intervention/RunCommand/index.tsx
index 19bbf0d62dc..e89a39753b0 100644
--- a/packages/builtin-tool-local-system/src/client/Intervention/RunCommand/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Intervention/RunCommand/index.tsx
@@ -1,5 +1,5 @@
-import type {RunCommandParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinInterventionProps} from '@lobechat/types';
+import type { RunCommandParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinInterventionProps } from '@lobechat/types';
import { Flexbox, Highlighter, Text } from '@lobehub/ui';
import { memo } from 'react';
diff --git a/packages/builtin-tool-local-system/src/client/Intervention/WriteFile/index.tsx b/packages/builtin-tool-local-system/src/client/Intervention/WriteFile/index.tsx
index 964303d8fed..7f0734e9259 100644
--- a/packages/builtin-tool-local-system/src/client/Intervention/WriteFile/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Intervention/WriteFile/index.tsx
@@ -1,5 +1,5 @@
-import type {WriteLocalFileParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinInterventionProps} from '@lobechat/types';
+import type { WriteLocalFileParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinInterventionProps } from '@lobechat/types';
import { Flexbox, Highlighter, Icon, Text } from '@lobehub/ui';
import { ChevronRight } from 'lucide-react';
import path from 'path-browserify-esm';
diff --git a/packages/builtin-tool-local-system/src/client/Placeholder/ListFiles.tsx b/packages/builtin-tool-local-system/src/client/Placeholder/ListFiles.tsx
index 635823eaab3..d27af1705eb 100644
--- a/packages/builtin-tool-local-system/src/client/Placeholder/ListFiles.tsx
+++ b/packages/builtin-tool-local-system/src/client/Placeholder/ListFiles.tsx
@@ -1,5 +1,5 @@
-import type {ListLocalFileParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinPlaceholderProps} from '@lobechat/types';
+import type { ListLocalFileParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinPlaceholderProps } from '@lobechat/types';
import { Center, Flexbox, Skeleton } from '@lobehub/ui';
import React, { memo } from 'react';
diff --git a/packages/builtin-tool-local-system/src/client/Placeholder/SearchFiles.tsx b/packages/builtin-tool-local-system/src/client/Placeholder/SearchFiles.tsx
index 4589bc41d46..e8fffcadafc 100644
--- a/packages/builtin-tool-local-system/src/client/Placeholder/SearchFiles.tsx
+++ b/packages/builtin-tool-local-system/src/client/Placeholder/SearchFiles.tsx
@@ -1,5 +1,5 @@
-import type {LocalSearchFilesParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinPlaceholderProps} from '@lobechat/types';
+import type { LocalSearchFilesParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinPlaceholderProps } from '@lobechat/types';
import { Center, Flexbox, Icon, Skeleton } from '@lobehub/ui';
import { createStaticStyles } from 'antd-style';
import { SearchIcon } from 'lucide-react';
diff --git a/packages/builtin-tool-local-system/src/client/Render/EditLocalFile/index.tsx b/packages/builtin-tool-local-system/src/client/Render/EditLocalFile/index.tsx
index a3ddfd58f03..657d50163f5 100644
--- a/packages/builtin-tool-local-system/src/client/Render/EditLocalFile/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Render/EditLocalFile/index.tsx
@@ -1,6 +1,6 @@
-import type {EditLocalFileState} from '@lobechat/builtin-tool-local-system';
-import type {EditLocalFileParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinRenderProps} from '@lobechat/types';
+import type { EditLocalFileState } from '@lobechat/builtin-tool-local-system';
+import type { EditLocalFileParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinRenderProps } from '@lobechat/types';
import { Alert, Flexbox, PatchDiff, Skeleton } from '@lobehub/ui';
import React, { memo } from 'react';
diff --git a/packages/builtin-tool-local-system/src/client/Render/ListFiles/Result.tsx b/packages/builtin-tool-local-system/src/client/Render/ListFiles/Result.tsx
index ef0a2fbe247..39c89e8388a 100644
--- a/packages/builtin-tool-local-system/src/client/Render/ListFiles/Result.tsx
+++ b/packages/builtin-tool-local-system/src/client/Render/ListFiles/Result.tsx
@@ -1,5 +1,5 @@
-import type {LocalFileItem} from '@lobechat/electron-client-ipc';
-import type {ChatMessagePluginError} from '@lobechat/types';
+import type { LocalFileItem } from '@lobechat/electron-client-ipc';
+import type { ChatMessagePluginError } from '@lobechat/types';
import { Flexbox, Skeleton } from '@lobehub/ui';
import { memo } from 'react';
diff --git a/packages/builtin-tool-local-system/src/client/Render/ListFiles/index.tsx b/packages/builtin-tool-local-system/src/client/Render/ListFiles/index.tsx
index 3cffd86c80d..569ee0bdf95 100644
--- a/packages/builtin-tool-local-system/src/client/Render/ListFiles/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Render/ListFiles/index.tsx
@@ -1,6 +1,6 @@
-import type {LocalFileListState} from '@lobechat/builtin-tool-local-system';
-import type {ListLocalFileParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinRenderProps} from '@lobechat/types';
+import type { LocalFileListState } from '@lobechat/builtin-tool-local-system';
+import type { ListLocalFileParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinRenderProps } from '@lobechat/types';
import React, { memo } from 'react';
import SearchResult from './Result';
diff --git a/packages/builtin-tool-local-system/src/client/Render/MoveLocalFiles/index.tsx b/packages/builtin-tool-local-system/src/client/Render/MoveLocalFiles/index.tsx
index 1eb079c8454..4987768d37f 100644
--- a/packages/builtin-tool-local-system/src/client/Render/MoveLocalFiles/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Render/MoveLocalFiles/index.tsx
@@ -1,5 +1,5 @@
-import type {MoveLocalFilesParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinRenderProps} from '@lobechat/types';
+import type { MoveLocalFilesParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinRenderProps } from '@lobechat/types';
import { Flexbox, Text } from '@lobehub/ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/packages/builtin-tool-local-system/src/client/Render/ReadLocalFile/ReadFileView.tsx b/packages/builtin-tool-local-system/src/client/Render/ReadLocalFile/ReadFileView.tsx
index 9dad6669341..ac212e7b1ec 100644
--- a/packages/builtin-tool-local-system/src/client/Render/ReadLocalFile/ReadFileView.tsx
+++ b/packages/builtin-tool-local-system/src/client/Render/ReadLocalFile/ReadFileView.tsx
@@ -1,4 +1,4 @@
-import type {LocalReadFileResult} from '@lobechat/electron-client-ipc';
+import type { LocalReadFileResult } from '@lobechat/electron-client-ipc';
import { ActionIcon, Flexbox, Icon, Markdown, Text } from '@lobehub/ui';
import { createStaticStyles } from 'antd-style';
import { AlignLeft, Asterisk, ExternalLink, FolderOpen } from 'lucide-react';
diff --git a/packages/builtin-tool-local-system/src/client/Render/ReadLocalFile/index.tsx b/packages/builtin-tool-local-system/src/client/Render/ReadLocalFile/index.tsx
index 6ee8544022c..d3cbef55614 100644
--- a/packages/builtin-tool-local-system/src/client/Render/ReadLocalFile/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Render/ReadLocalFile/index.tsx
@@ -1,6 +1,6 @@
import type { LocalReadFileState } from '@lobechat/builtin-tool-local-system';
-import type {LocalReadFileParams} from '@lobechat/electron-client-ipc';
-import type {ChatMessagePluginError} from '@lobechat/types';
+import type { LocalReadFileParams } from '@lobechat/electron-client-ipc';
+import type { ChatMessagePluginError } from '@lobechat/types';
import { memo } from 'react';
import { useChatStore } from '@/store/chat';
diff --git a/packages/builtin-tool-local-system/src/client/Render/RunCommand/index.tsx b/packages/builtin-tool-local-system/src/client/Render/RunCommand/index.tsx
index 0dc4e97d16f..093575f4bda 100644
--- a/packages/builtin-tool-local-system/src/client/Render/RunCommand/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Render/RunCommand/index.tsx
@@ -1,5 +1,5 @@
-import type {RunCommandParams, RunCommandResult} from '@lobechat/electron-client-ipc';
-import type {BuiltinRenderProps} from '@lobechat/types';
+import type { RunCommandParams, RunCommandResult } from '@lobechat/electron-client-ipc';
+import type { BuiltinRenderProps } from '@lobechat/types';
import { Block, Flexbox, Highlighter } from '@lobehub/ui';
import { createStaticStyles } from 'antd-style';
import { memo } from 'react';
diff --git a/packages/builtin-tool-local-system/src/client/Render/SearchFiles/Result.tsx b/packages/builtin-tool-local-system/src/client/Render/SearchFiles/Result.tsx
index 89a3340e791..df4351194ab 100644
--- a/packages/builtin-tool-local-system/src/client/Render/SearchFiles/Result.tsx
+++ b/packages/builtin-tool-local-system/src/client/Render/SearchFiles/Result.tsx
@@ -1,5 +1,5 @@
-import type {FileResult} from '@lobechat/builtin-tool-local-system';
-import type {ChatMessagePluginError} from '@lobechat/types';
+import type { FileResult } from '@lobechat/builtin-tool-local-system';
+import type { ChatMessagePluginError } from '@lobechat/types';
import { Flexbox, Skeleton } from '@lobehub/ui';
import { memo } from 'react';
diff --git a/packages/builtin-tool-local-system/src/client/Render/SearchFiles/SearchQuery/index.tsx b/packages/builtin-tool-local-system/src/client/Render/SearchFiles/SearchQuery/index.tsx
index 63999413d82..7958f0f615c 100644
--- a/packages/builtin-tool-local-system/src/client/Render/SearchFiles/SearchQuery/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Render/SearchFiles/SearchQuery/index.tsx
@@ -1,5 +1,5 @@
import type { LocalFileSearchState } from '@lobechat/builtin-tool-local-system';
-import type {LocalSearchFilesParams} from '@lobechat/electron-client-ipc';
+import type { LocalSearchFilesParams } from '@lobechat/electron-client-ipc';
import { memo } from 'react';
import { useChatStore } from '@/store/chat';
diff --git a/packages/builtin-tool-local-system/src/client/Render/SearchFiles/index.tsx b/packages/builtin-tool-local-system/src/client/Render/SearchFiles/index.tsx
index 3f338e31bbb..a09539313ef 100644
--- a/packages/builtin-tool-local-system/src/client/Render/SearchFiles/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Render/SearchFiles/index.tsx
@@ -1,6 +1,6 @@
import type { LocalFileSearchState } from '@lobechat/builtin-tool-local-system';
-import type {LocalSearchFilesParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinRenderProps} from '@lobechat/types';
+import type { LocalSearchFilesParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinRenderProps } from '@lobechat/types';
import { Flexbox } from '@lobehub/ui';
import { memo } from 'react';
diff --git a/packages/builtin-tool-local-system/src/client/Render/WriteFile/index.tsx b/packages/builtin-tool-local-system/src/client/Render/WriteFile/index.tsx
index f820ad8b626..67e63fc0a2a 100644
--- a/packages/builtin-tool-local-system/src/client/Render/WriteFile/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Render/WriteFile/index.tsx
@@ -1,5 +1,5 @@
-import type {WriteLocalFileParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinRenderProps} from '@lobechat/types';
+import type { WriteLocalFileParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinRenderProps } from '@lobechat/types';
import { Flexbox, Highlighter, Icon, Markdown, Skeleton } from '@lobehub/ui';
import { createStaticStyles } from 'antd-style';
import { ChevronRight } from 'lucide-react';
diff --git a/packages/builtin-tool-local-system/src/client/Streaming/RunCommand/index.tsx b/packages/builtin-tool-local-system/src/client/Streaming/RunCommand/index.tsx
index 5e5ec9b02bf..16e47ebdb9b 100644
--- a/packages/builtin-tool-local-system/src/client/Streaming/RunCommand/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Streaming/RunCommand/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinStreamingProps} from '@lobechat/types';
+import type { BuiltinStreamingProps } from '@lobechat/types';
import { Highlighter } from '@lobehub/ui';
import { memo } from 'react';
diff --git a/packages/builtin-tool-local-system/src/client/Streaming/WriteFile/index.tsx b/packages/builtin-tool-local-system/src/client/Streaming/WriteFile/index.tsx
index 976a4dfc9cf..a2aef3aa624 100644
--- a/packages/builtin-tool-local-system/src/client/Streaming/WriteFile/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Streaming/WriteFile/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import type {WriteLocalFileParams} from '@lobechat/electron-client-ipc';
-import type {BuiltinStreamingProps} from '@lobechat/types';
+import type { WriteLocalFileParams } from '@lobechat/electron-client-ipc';
+import type { BuiltinStreamingProps } from '@lobechat/types';
import { Highlighter, Markdown } from '@lobehub/ui';
import path from 'path-browserify-esm';
import { memo } from 'react';
diff --git a/packages/builtin-tool-local-system/src/client/components/FileItem.tsx b/packages/builtin-tool-local-system/src/client/components/FileItem.tsx
index 78a642ba362..c73877b4319 100644
--- a/packages/builtin-tool-local-system/src/client/components/FileItem.tsx
+++ b/packages/builtin-tool-local-system/src/client/components/FileItem.tsx
@@ -1,4 +1,4 @@
-import type {LocalFileItem} from '@lobechat/electron-client-ipc';
+import type { LocalFileItem } from '@lobechat/electron-client-ipc';
import { ActionIcon, Flexbox } from '@lobehub/ui';
import { createStaticStyles } from 'antd-style';
import dayjs from 'dayjs';
diff --git a/packages/builtin-tool-local-system/src/executor/index.ts b/packages/builtin-tool-local-system/src/executor/index.ts
index 36c386d547b..210428d824e 100644
--- a/packages/builtin-tool-local-system/src/executor/index.ts
+++ b/packages/builtin-tool-local-system/src/executor/index.ts
@@ -38,15 +38,26 @@ import {
formatRenameResult,
formatWriteResult,
} from '@lobechat/prompts';
-import type {BuiltinToolResult} from '@lobechat/types';
-import { BaseExecutor } from '@lobechat/types';
+import type { BuiltinToolResult } from '@lobechat/types';
+import { BaseExecutor } from '@lobechat/types';
import { localFileService } from '@/services/electron/localFileService';
-import type {EditLocalFileState, GetCommandOutputState, GlobFilesState, GrepContentState, KillCommandState, LocalFileListState, LocalFileSearchState, LocalMoveFilesState, LocalReadFilesState, LocalReadFileState, LocalRenameFileState, RunCommandState} from '../types';
-import {
- LocalSystemIdentifier
+import type {
+ EditLocalFileState,
+ GetCommandOutputState,
+ GlobFilesState,
+ GrepContentState,
+ KillCommandState,
+ LocalFileListState,
+ LocalFileSearchState,
+ LocalMoveFilesState,
+ LocalReadFilesState,
+ LocalReadFileState,
+ LocalRenameFileState,
+ RunCommandState,
} from '../types';
+import { LocalSystemIdentifier } from '../types';
const LocalSystemApiEnum = {
editLocalFile: 'editLocalFile' as const,
diff --git a/packages/builtin-tool-memory/scripts/generate-tool-call.ts b/packages/builtin-tool-memory/scripts/generate-tool-call.ts
index 8fd489a8ec8..53e704fcaa6 100644
--- a/packages/builtin-tool-memory/scripts/generate-tool-call.ts
+++ b/packages/builtin-tool-memory/scripts/generate-tool-call.ts
@@ -1,4 +1,3 @@
-
import { mkdir, writeFile } from 'node:fs/promises';
import { join } from 'node:path';
import { exit } from 'node:process';
@@ -13,11 +12,14 @@ const writeToolCallSchemaFromManifest = async (prefix: string, manifest: Builtin
for (const tool of manifest.api) {
const transformedTool = {
...tool,
- type: 'function'
- }
- await writeFile(join(OUTPUT_DIR, `${prefix}-${transformedTool.name}.json`), JSON.stringify(transformedTool, null, 2));
+ type: 'function',
+ };
+ await writeFile(
+ join(OUTPUT_DIR, `${prefix}-${transformedTool.name}.json`),
+ JSON.stringify(transformedTool, null, 2),
+ );
}
-}
+};
async function main() {
await mkdir(OUTPUT_DIR, { recursive: true });
@@ -25,7 +27,6 @@ async function main() {
}
main().catch((err) => {
-
console.error(err);
exit(1);
});
diff --git a/packages/builtin-tool-memory/src/client/Inspector/index.ts b/packages/builtin-tool-memory/src/client/Inspector/index.ts
index e30c4fffa3d..5bc78fff77e 100644
--- a/packages/builtin-tool-memory/src/client/Inspector/index.ts
+++ b/packages/builtin-tool-memory/src/client/Inspector/index.ts
@@ -1,4 +1,4 @@
-import type {BuiltinInspector} from '@lobechat/types';
+import type { BuiltinInspector } from '@lobechat/types';
import { MemoryApiName } from '../../types';
import { AddContextMemoryInspector } from './AddContextMemory';
diff --git a/packages/builtin-tool-memory/src/client/Streaming/index.ts b/packages/builtin-tool-memory/src/client/Streaming/index.ts
index c4fa0d3a874..defd00f7d3f 100644
--- a/packages/builtin-tool-memory/src/client/Streaming/index.ts
+++ b/packages/builtin-tool-memory/src/client/Streaming/index.ts
@@ -1,4 +1,4 @@
-import type {BuiltinStreaming} from '@lobechat/types';
+import type { BuiltinStreaming } from '@lobechat/types';
import { MemoryApiName } from '../../types';
import { AddExperienceMemoryStreaming } from './AddExperienceMemory';
diff --git a/packages/builtin-tool-memory/src/executor/index.ts b/packages/builtin-tool-memory/src/executor/index.ts
index e6045e628c2..7fd0675fc60 100644
--- a/packages/builtin-tool-memory/src/executor/index.ts
+++ b/packages/builtin-tool-memory/src/executor/index.ts
@@ -8,8 +8,8 @@ import type {
UpdateIdentityActionSchema,
} from '@lobechat/memory-user-memory/schemas';
import { formatMemorySearchResults } from '@lobechat/prompts';
-import type {BuiltinToolResult, SearchMemoryParams} from '@lobechat/types';
-import { BaseExecutor } from '@lobechat/types';
+import type { BuiltinToolResult, SearchMemoryParams } from '@lobechat/types';
+import { BaseExecutor } from '@lobechat/types';
import type { z } from 'zod';
import { userMemoryService } from '@/services/userMemory';
diff --git a/packages/builtin-tool-notebook/src/client/Inspector/index.ts b/packages/builtin-tool-notebook/src/client/Inspector/index.ts
index 53d15457caf..e5d89b0b290 100644
--- a/packages/builtin-tool-notebook/src/client/Inspector/index.ts
+++ b/packages/builtin-tool-notebook/src/client/Inspector/index.ts
@@ -1,4 +1,4 @@
-import type {BuiltinInspector} from '@lobechat/types';
+import type { BuiltinInspector } from '@lobechat/types';
import { NotebookApiName } from '../../types';
import { CreateDocumentInspector } from './CreateDocument';
diff --git a/packages/builtin-tool-notebook/src/client/Placeholder/index.ts b/packages/builtin-tool-notebook/src/client/Placeholder/index.ts
index 60cd02cb88e..7b634e5b471 100644
--- a/packages/builtin-tool-notebook/src/client/Placeholder/index.ts
+++ b/packages/builtin-tool-notebook/src/client/Placeholder/index.ts
@@ -1,4 +1,4 @@
-import type {BuiltinPlaceholder} from '@lobechat/types';
+import type { BuiltinPlaceholder } from '@lobechat/types';
import { NotebookApiName } from '../../types';
import { CreateDocumentPlaceholder } from './CreateDocument';
diff --git a/packages/builtin-tool-notebook/src/client/Streaming/index.ts b/packages/builtin-tool-notebook/src/client/Streaming/index.ts
index a12593a25b3..d7c6a12ae3e 100644
--- a/packages/builtin-tool-notebook/src/client/Streaming/index.ts
+++ b/packages/builtin-tool-notebook/src/client/Streaming/index.ts
@@ -1,4 +1,4 @@
-import type {BuiltinStreaming} from '@lobechat/types';
+import type { BuiltinStreaming } from '@lobechat/types';
import { NotebookApiName } from '../../types';
import { CreateDocumentStreaming } from './CreateDocument';
diff --git a/packages/builtin-tool-page-agent/src/client/Inspector/ModifyNodes/index.tsx b/packages/builtin-tool-page-agent/src/client/Inspector/ModifyNodes/index.tsx
index a60334026ef..97868c9c413 100644
--- a/packages/builtin-tool-page-agent/src/client/Inspector/ModifyNodes/index.tsx
+++ b/packages/builtin-tool-page-agent/src/client/Inspector/ModifyNodes/index.tsx
@@ -5,8 +5,8 @@ import type { BuiltinInspectorProps } from '@lobechat/types';
import { Icon, Text } from '@lobehub/ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { DiffIcon, Minus, Plus } from 'lucide-react';
-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 { oneLineEllipsis, shinyTextStyles } from '@/styles';
diff --git a/packages/builtin-tool-page-agent/src/client/Inspector/index.ts b/packages/builtin-tool-page-agent/src/client/Inspector/index.ts
index 1163c7967d1..ca71baca6d2 100644
--- a/packages/builtin-tool-page-agent/src/client/Inspector/index.ts
+++ b/packages/builtin-tool-page-agent/src/client/Inspector/index.ts
@@ -1,4 +1,4 @@
-import type {BuiltinInspector} from '@lobechat/types';
+import type { BuiltinInspector } from '@lobechat/types';
import { DocumentApiName } from '../../types';
import { EditTitleInspector } from './EditTitle';
diff --git a/packages/builtin-tool-page-agent/src/client/Placeholder/index.ts b/packages/builtin-tool-page-agent/src/client/Placeholder/index.ts
index ffc66336ec5..f7f9023c473 100644
--- a/packages/builtin-tool-page-agent/src/client/Placeholder/index.ts
+++ b/packages/builtin-tool-page-agent/src/client/Placeholder/index.ts
@@ -1,4 +1,4 @@
-import type {BuiltinPlaceholder} from '@lobechat/types';
+import type { BuiltinPlaceholder } from '@lobechat/types';
/**
* Page Agent Placeholder Components Registry
diff --git a/packages/builtin-tool-page-agent/src/client/Streaming/index.ts b/packages/builtin-tool-page-agent/src/client/Streaming/index.ts
index b715efaa31b..387fe1a73fb 100644
--- a/packages/builtin-tool-page-agent/src/client/Streaming/index.ts
+++ b/packages/builtin-tool-page-agent/src/client/Streaming/index.ts
@@ -1,4 +1,4 @@
-import type {BuiltinStreaming} from '@lobechat/types';
+import type { BuiltinStreaming } from '@lobechat/types';
/**
* Page Agent Streaming Components Registry
diff --git a/packages/builtin-tool-page-agent/src/executor/index.ts b/packages/builtin-tool-page-agent/src/executor/index.ts
index 5e38cea650a..2efc03c162b 100644
--- a/packages/builtin-tool-page-agent/src/executor/index.ts
+++ b/packages/builtin-tool-page-agent/src/executor/index.ts
@@ -6,8 +6,8 @@ import type {
ModifyNodesArgs,
ReplaceTextArgs,
} from '@lobechat/editor-runtime';
-import type {BuiltinToolResult} from '@lobechat/types';
-import { BaseExecutor } from '@lobechat/types';
+import type { BuiltinToolResult } from '@lobechat/types';
+import { BaseExecutor } from '@lobechat/types';
import type {
EditTitleState,
diff --git a/packages/builtin-tool-web-browsing/src/ExecutionRuntime/index.ts b/packages/builtin-tool-web-browsing/src/ExecutionRuntime/index.ts
index 385ba26e2da..0e018fdfc60 100644
--- a/packages/builtin-tool-web-browsing/src/ExecutionRuntime/index.ts
+++ b/packages/builtin-tool-web-browsing/src/ExecutionRuntime/index.ts
@@ -1,5 +1,12 @@
import { crawlResultsPrompt, searchResultsPrompt } from '@lobechat/prompts';
-import type {BuiltinServerRuntimeOutput, CrawlMultiPagesQuery, CrawlSinglePageQuery, SearchContent, SearchQuery, SearchServiceImpl} from '@lobechat/types';
+import type {
+ BuiltinServerRuntimeOutput,
+ CrawlMultiPagesQuery,
+ CrawlSinglePageQuery,
+ SearchContent,
+ SearchQuery,
+ SearchServiceImpl,
+} from '@lobechat/types';
import { CRAWL_CONTENT_LIMITED_COUNT, SEARCH_ITEM_LIMITED_COUNT } from '../const';
diff --git a/packages/builtin-tool-web-browsing/src/client/Inspector/CrawlMultiPages/index.tsx b/packages/builtin-tool-web-browsing/src/client/Inspector/CrawlMultiPages/index.tsx
index c18494600e0..a0bf00944b6 100644
--- a/packages/builtin-tool-web-browsing/src/client/Inspector/CrawlMultiPages/index.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Inspector/CrawlMultiPages/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinInspectorProps} from '@lobechat/types';
+import type { BuiltinInspectorProps } from '@lobechat/types';
import { cx } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/packages/builtin-tool-web-browsing/src/client/Inspector/Search/index.tsx b/packages/builtin-tool-web-browsing/src/client/Inspector/Search/index.tsx
index 4b7e6b71d38..54ce1877a62 100644
--- a/packages/builtin-tool-web-browsing/src/client/Inspector/Search/index.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Inspector/Search/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinInspectorProps, SearchQuery, UniformSearchResponse} from '@lobechat/types';
+import type { BuiltinInspectorProps, SearchQuery, UniformSearchResponse } from '@lobechat/types';
import { Text } from '@lobehub/ui';
import { cssVar, cx } from 'antd-style';
import { memo } from 'react';
diff --git a/packages/builtin-tool-web-browsing/src/client/Placeholder/CrawlMultiPages.tsx b/packages/builtin-tool-web-browsing/src/client/Placeholder/CrawlMultiPages.tsx
index 3c52ce80592..a7e25660014 100644
--- a/packages/builtin-tool-web-browsing/src/client/Placeholder/CrawlMultiPages.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Placeholder/CrawlMultiPages.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinPlaceholderProps} from '@lobechat/types';
+import type { BuiltinPlaceholderProps } from '@lobechat/types';
import { ScrollShadow } from '@lobehub/ui';
import { memo } from 'react';
diff --git a/packages/builtin-tool-web-browsing/src/client/Placeholder/CrawlSinglePage.tsx b/packages/builtin-tool-web-browsing/src/client/Placeholder/CrawlSinglePage.tsx
index 168f715ddee..99b75bb5974 100644
--- a/packages/builtin-tool-web-browsing/src/client/Placeholder/CrawlSinglePage.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Placeholder/CrawlSinglePage.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {BuiltinPlaceholderProps} from '@lobechat/types';
+import type { BuiltinPlaceholderProps } from '@lobechat/types';
import { memo } from 'react';
import LoadingCard from '../Render/PageContent/Loading';
diff --git a/packages/builtin-tool-web-browsing/src/client/Placeholder/Search.tsx b/packages/builtin-tool-web-browsing/src/client/Placeholder/Search.tsx
index 5b38df0aec0..19986d9aabf 100644
--- a/packages/builtin-tool-web-browsing/src/client/Placeholder/Search.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Placeholder/Search.tsx
@@ -1,4 +1,4 @@
-import type {BuiltinPlaceholderProps, SearchQuery} from '@lobechat/types';
+import type { BuiltinPlaceholderProps, SearchQuery } from '@lobechat/types';
import { Flexbox, Icon, Skeleton } from '@lobehub/ui';
import { createStaticStyles, cx } from 'antd-style';
import { SearchIcon } from 'lucide-react';
diff --git a/packages/builtin-tool-web-browsing/src/client/Portal/PageContent/index.tsx b/packages/builtin-tool-web-browsing/src/client/Portal/PageContent/index.tsx
index 34dd2c24980..07f6bcf8776 100644
--- a/packages/builtin-tool-web-browsing/src/client/Portal/PageContent/index.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Portal/PageContent/index.tsx
@@ -1,5 +1,5 @@
-import type {CrawlResult} from '@lobechat/types';
-import type {CrawlSuccessResult} from '@lobechat/web-crawler';
+import type { CrawlResult } from '@lobechat/types';
+import type { CrawlSuccessResult } from '@lobechat/web-crawler';
import {
Alert,
CopyButton,
diff --git a/packages/builtin-tool-web-browsing/src/client/Portal/PageContents/index.tsx b/packages/builtin-tool-web-browsing/src/client/Portal/PageContents/index.tsx
index 463bb1ec4d2..f8765bfa5ff 100644
--- a/packages/builtin-tool-web-browsing/src/client/Portal/PageContents/index.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Portal/PageContents/index.tsx
@@ -1,4 +1,4 @@
-import type {CrawlResult} from '@lobechat/types';
+import type { CrawlResult } from '@lobechat/types';
import { memo } from 'react';
import { useChatStore } from '@/store/chat';
diff --git a/packages/builtin-tool-web-browsing/src/client/Portal/Search/ResultList/SearchItem/Video.tsx b/packages/builtin-tool-web-browsing/src/client/Portal/Search/ResultList/SearchItem/Video.tsx
index a2ab1141a32..3333678e1d9 100644
--- a/packages/builtin-tool-web-browsing/src/client/Portal/Search/ResultList/SearchItem/Video.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Portal/Search/ResultList/SearchItem/Video.tsx
@@ -1,4 +1,4 @@
-import type {UniformSearchResult} from '@lobechat/types';
+import type { UniformSearchResult } from '@lobechat/types';
import { Avatar, Flexbox, Text } from '@lobehub/ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { memo, useState } from 'react';
diff --git a/packages/builtin-tool-web-browsing/src/client/Portal/Search/ResultList/SearchItem/index.tsx b/packages/builtin-tool-web-browsing/src/client/Portal/Search/ResultList/SearchItem/index.tsx
index 63944937e20..f1754a9dec2 100644
--- a/packages/builtin-tool-web-browsing/src/client/Portal/Search/ResultList/SearchItem/index.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Portal/Search/ResultList/SearchItem/index.tsx
@@ -1,4 +1,4 @@
-import type {UniformSearchResult} from '@lobechat/types';
+import type { UniformSearchResult } from '@lobechat/types';
import { Flexbox, Text } from '@lobehub/ui';
import { createStaticStyles } from 'antd-style';
import { memo } from 'react';
diff --git a/packages/builtin-tool-web-browsing/src/client/Portal/Search/ResultList/index.tsx b/packages/builtin-tool-web-browsing/src/client/Portal/Search/ResultList/index.tsx
index 5fc1a0d1481..5343fbb6d3d 100644
--- a/packages/builtin-tool-web-browsing/src/client/Portal/Search/ResultList/index.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Portal/Search/ResultList/index.tsx
@@ -1,4 +1,4 @@
-import type {UniformSearchResult} from '@lobechat/types';
+import type { UniformSearchResult } from '@lobechat/types';
import React, { memo, useCallback } from 'react';
import { Virtuoso } from 'react-virtuoso';
diff --git a/packages/builtin-tool-web-browsing/src/client/Portal/Search/index.tsx b/packages/builtin-tool-web-browsing/src/client/Portal/Search/index.tsx
index 130c4e40929..a479707925e 100644
--- a/packages/builtin-tool-web-browsing/src/client/Portal/Search/index.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Portal/Search/index.tsx
@@ -1,4 +1,4 @@
-import type {SearchQuery, UniformSearchResponse} from '@lobechat/types';
+import type { SearchQuery, UniformSearchResponse } from '@lobechat/types';
import { Flexbox, Skeleton } from '@lobehub/ui';
import { uniq } from 'es-toolkit/compat';
import { memo } from 'react';
diff --git a/packages/builtin-tool-web-browsing/src/client/Portal/index.tsx b/packages/builtin-tool-web-browsing/src/client/Portal/index.tsx
index e6d62ba94d8..eb93c16624d 100644
--- a/packages/builtin-tool-web-browsing/src/client/Portal/index.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Portal/index.tsx
@@ -1,4 +1,4 @@
-import type {BuiltinPortalProps, CrawlPluginState, SearchQuery} from '@lobechat/types';
+import type { BuiltinPortalProps, CrawlPluginState, SearchQuery } from '@lobechat/types';
import { memo } from 'react';
import { WebBrowsingApiName } from '../../types';
diff --git a/packages/builtin-tool-web-browsing/src/client/Render/CrawlMultiPages.tsx b/packages/builtin-tool-web-browsing/src/client/Render/CrawlMultiPages.tsx
index 5a00cba89b9..ee29cf400af 100644
--- a/packages/builtin-tool-web-browsing/src/client/Render/CrawlMultiPages.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Render/CrawlMultiPages.tsx
@@ -1,4 +1,4 @@
-import type {BuiltinRenderProps, CrawlMultiPagesQuery, CrawlPluginState} from '@lobechat/types';
+import type { BuiltinRenderProps, CrawlMultiPagesQuery, CrawlPluginState } from '@lobechat/types';
import { memo } from 'react';
import PageContent from './PageContent';
diff --git a/packages/builtin-tool-web-browsing/src/client/Render/CrawlSinglePage.tsx b/packages/builtin-tool-web-browsing/src/client/Render/CrawlSinglePage.tsx
index 09da59b1203..c1fd3d8480d 100644
--- a/packages/builtin-tool-web-browsing/src/client/Render/CrawlSinglePage.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Render/CrawlSinglePage.tsx
@@ -1,4 +1,4 @@
-import type {BuiltinRenderProps, CrawlPluginState, CrawlSinglePageQuery} from '@lobechat/types';
+import type { BuiltinRenderProps, CrawlPluginState, CrawlSinglePageQuery } from '@lobechat/types';
import { memo } from 'react';
import PageContent from './PageContent';
diff --git a/packages/builtin-tool-web-browsing/src/client/Render/PageContent/Result.tsx b/packages/builtin-tool-web-browsing/src/client/Render/PageContent/Result.tsx
index 271749f4175..9dbb2f3dba0 100644
--- a/packages/builtin-tool-web-browsing/src/client/Render/PageContent/Result.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Render/PageContent/Result.tsx
@@ -1,6 +1,6 @@
'use client';
-import type {CrawlErrorResult, CrawlSuccessResult} from '@lobechat/web-crawler';
+import type { CrawlErrorResult, CrawlSuccessResult } from '@lobechat/web-crawler';
import { ActionIcon, Alert, Block, Flexbox, Text } from '@lobehub/ui';
import { Descriptions } from 'antd';
import { createStaticStyles } from 'antd-style';
diff --git a/packages/builtin-tool-web-browsing/src/client/Render/PageContent/index.tsx b/packages/builtin-tool-web-browsing/src/client/Render/PageContent/index.tsx
index f61aad09640..c687b5fa4cf 100644
--- a/packages/builtin-tool-web-browsing/src/client/Render/PageContent/index.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Render/PageContent/index.tsx
@@ -1,5 +1,5 @@
-import type {CrawlPluginState} from '@lobechat/types';
-import type {CrawlErrorResult} from '@lobechat/web-crawler';
+import type { CrawlPluginState } from '@lobechat/types';
+import type { CrawlErrorResult } from '@lobechat/web-crawler';
import { Flexbox, ScrollShadow } from '@lobehub/ui';
import { memo } from 'react';
diff --git a/packages/builtin-tool-web-browsing/src/client/Render/Search/ConfigForm/style.tsx b/packages/builtin-tool-web-browsing/src/client/Render/Search/ConfigForm/style.tsx
index 4768087ea20..98eeb43fca3 100644
--- a/packages/builtin-tool-web-browsing/src/client/Render/Search/ConfigForm/style.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Render/Search/ConfigForm/style.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, cssVar }) => ({
diff --git a/packages/builtin-tool-web-browsing/src/client/Render/Search/SearchQuery/index.tsx b/packages/builtin-tool-web-browsing/src/client/Render/Search/SearchQuery/index.tsx
index f19ec2b0cfc..2d05390267a 100644
--- a/packages/builtin-tool-web-browsing/src/client/Render/Search/SearchQuery/index.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Render/Search/SearchQuery/index.tsx
@@ -1,4 +1,4 @@
-import type {SearchQuery, UniformSearchResponse} from '@lobechat/types';
+import type { SearchQuery, UniformSearchResponse } from '@lobechat/types';
import { ActionIcon } from '@lobehub/ui';
import { uniq } from 'es-toolkit/compat';
import { XIcon } from 'lucide-react';
diff --git a/packages/builtin-tool-web-browsing/src/client/Render/Search/SearchResult/SearchResultItem.tsx b/packages/builtin-tool-web-browsing/src/client/Render/Search/SearchResult/SearchResultItem.tsx
index 08bc5b5b0ad..257e95cabc8 100644
--- a/packages/builtin-tool-web-browsing/src/client/Render/Search/SearchResult/SearchResultItem.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Render/Search/SearchResult/SearchResultItem.tsx
@@ -1,8 +1,8 @@
-import type {UniformSearchResult} from '@lobechat/types';
+import type { UniformSearchResult } from '@lobechat/types';
import { Block, Flexbox, Text } from '@lobehub/ui';
import { createStaticStyles } from 'antd-style';
import Link from 'next/link';
-import type { CSSProperties} from 'react';
+import type { CSSProperties } from 'react';
import { memo } from 'react';
import WebFavicon from '@/components/WebFavicon';
diff --git a/packages/builtin-tool-web-browsing/src/client/Render/Search/SearchResult/ShowMore.tsx b/packages/builtin-tool-web-browsing/src/client/Render/Search/SearchResult/ShowMore.tsx
index e65b4bf008d..87617634d9d 100644
--- a/packages/builtin-tool-web-browsing/src/client/Render/Search/SearchResult/ShowMore.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Render/Search/SearchResult/ShowMore.tsx
@@ -1,6 +1,6 @@
import { Block, Flexbox, Text } from '@lobehub/ui';
import { createStaticStyles } from 'antd-style';
-import type { CSSProperties} from 'react';
+import type { CSSProperties } from 'react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/packages/builtin-tool-web-browsing/src/client/Render/Search/SearchResult/index.tsx b/packages/builtin-tool-web-browsing/src/client/Render/Search/SearchResult/index.tsx
index 4fc6b828a39..9b146da6bdd 100644
--- a/packages/builtin-tool-web-browsing/src/client/Render/Search/SearchResult/index.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Render/Search/SearchResult/index.tsx
@@ -1,4 +1,4 @@
-import type {SearchQuery, UniformSearchResponse} from '@lobechat/types';
+import type { SearchQuery, UniformSearchResponse } from '@lobechat/types';
import { Block, Button, Empty, Flexbox, Icon, ScrollShadow, Skeleton } from '@lobehub/ui';
import { uniq } from 'es-toolkit/compat';
import { Edit2Icon, SearchIcon } from 'lucide-react';
diff --git a/packages/builtin-tool-web-browsing/src/client/Render/Search/index.tsx b/packages/builtin-tool-web-browsing/src/client/Render/Search/index.tsx
index 68a63988066..62b0888fa75 100644
--- a/packages/builtin-tool-web-browsing/src/client/Render/Search/index.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Render/Search/index.tsx
@@ -1,4 +1,4 @@
-import type {BuiltinRenderProps, SearchQuery, UniformSearchResponse} from '@lobechat/types';
+import type { BuiltinRenderProps, SearchQuery, UniformSearchResponse } from '@lobechat/types';
import { Alert, Flexbox, Highlighter } from '@lobehub/ui';
import { memo, useState } from 'react';
diff --git a/packages/builtin-tool-web-browsing/src/client/components/SearchBar.tsx b/packages/builtin-tool-web-browsing/src/client/components/SearchBar.tsx
index 6de746b0831..9dd7388a538 100644
--- a/packages/builtin-tool-web-browsing/src/client/components/SearchBar.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/components/SearchBar.tsx
@@ -1,4 +1,4 @@
-import type {SearchQuery} from '@lobechat/types';
+import type { SearchQuery } from '@lobechat/types';
import {
Block,
Checkbox,
@@ -10,8 +10,8 @@ import {
Tooltip,
} from '@lobehub/ui';
import { createStaticStyles } from 'antd-style';
-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 { useIsMobile } from '@/hooks/useIsMobile';
diff --git a/packages/builtin-tool-web-browsing/src/manifest.ts b/packages/builtin-tool-web-browsing/src/manifest.ts
index c7892ec9dba..0fe3409073e 100644
--- a/packages/builtin-tool-web-browsing/src/manifest.ts
+++ b/packages/builtin-tool-web-browsing/src/manifest.ts
@@ -1,4 +1,4 @@
-import type {BuiltinToolManifest} from '@lobechat/types';
+import type { BuiltinToolManifest } from '@lobechat/types';
import dayjs from 'dayjs';
import { systemPrompt } from './systemRole';
diff --git a/packages/const/src/hotkeys.ts b/packages/const/src/hotkeys.ts
index bdc1409dce9..e8215fce344 100644
--- a/packages/const/src/hotkeys.ts
+++ b/packages/const/src/hotkeys.ts
@@ -1,6 +1,4 @@
-import type {
- DesktopHotkeyItem,
- HotkeyItem} from '@lobechat/types';
+import type { DesktopHotkeyItem, HotkeyItem } from '@lobechat/types';
import {
DesktopHotkeyEnum,
HotkeyEnum,
diff --git a/packages/const/src/klavis.ts b/packages/const/src/klavis.ts
index 7b4a137d779..4466a5fc5ca 100644
--- a/packages/const/src/klavis.ts
+++ b/packages/const/src/klavis.ts
@@ -1,4 +1,4 @@
-import type { IconType} from '@icons-pack/react-simple-icons';
+import type { IconType } from '@icons-pack/react-simple-icons';
import { SiCaldotcom, SiGithub } from '@icons-pack/react-simple-icons';
import { Klavis } from 'klavis';
diff --git a/packages/const/src/lobehubSkill.ts b/packages/const/src/lobehubSkill.ts
index dc86a171d00..9f96b8b2240 100644
--- a/packages/const/src/lobehubSkill.ts
+++ b/packages/const/src/lobehubSkill.ts
@@ -1,5 +1,5 @@
-import type {IconType} from '@icons-pack/react-simple-icons';
-import { SiLinear, SiX } from '@icons-pack/react-simple-icons';
+import type { IconType } from '@icons-pack/react-simple-icons';
+import { SiLinear, SiX } from '@icons-pack/react-simple-icons';
export interface LobehubSkillProviderType {
/**
diff --git a/packages/const/src/session.ts b/packages/const/src/session.ts
index b3cb95b0b36..b1b40ba0989 100644
--- a/packages/const/src/session.ts
+++ b/packages/const/src/session.ts
@@ -1,4 +1,4 @@
-import type { LobeAgentSession, LobeGroupSession} from '@lobechat/types';
+import type { LobeAgentSession, LobeGroupSession } from '@lobechat/types';
import { LobeSessionType } from '@lobechat/types';
import { DEFAULT_AGENT_META, DEFAULT_INBOX_AVATAR } from './meta';
diff --git a/packages/const/src/settings/systemAgent.ts b/packages/const/src/settings/systemAgent.ts
index 46d13536139..f8a864423a0 100644
--- a/packages/const/src/settings/systemAgent.ts
+++ b/packages/const/src/settings/systemAgent.ts
@@ -1,5 +1,9 @@
import { DEFAULT_MINI_PROVIDER, DEFAULT_PROVIDER } from '@lobechat/business-const';
-import type { QueryRewriteSystemAgent, SystemAgentItem, UserSystemAgentConfig } from '@lobechat/types';
+import type {
+ QueryRewriteSystemAgent,
+ SystemAgentItem,
+ UserSystemAgentConfig,
+} from '@lobechat/types';
import { DEFAULT_MINI_MODEL, DEFAULT_MODEL } from './llm';
diff --git a/packages/const/src/utils/merge.ts b/packages/const/src/utils/merge.ts
index 0dadedf61e8..c57345277b3 100644
--- a/packages/const/src/utils/merge.ts
+++ b/packages/const/src/utils/merge.ts
@@ -1,4 +1,4 @@
-import type { merge as _merge} from 'es-toolkit/compat';
+import type { merge as _merge } from 'es-toolkit/compat';
import { isEmpty, mergeWith } from 'es-toolkit/compat';
/**
diff --git a/packages/context-engine/src/base/BaseProcessor.ts b/packages/context-engine/src/base/BaseProcessor.ts
index d09d35162ca..4fa3b759347 100644
--- a/packages/context-engine/src/base/BaseProcessor.ts
+++ b/packages/context-engine/src/base/BaseProcessor.ts
@@ -9,7 +9,7 @@ export abstract class BaseProcessor implements ContextProcessor {
abstract readonly name: string;
// Keep parameters for compatibility with existing subclass constructor signatures, but do no processing
-
+
constructor(_options: ProcessorOptions = {}) {}
/**
diff --git a/packages/context-engine/src/base/BaseProvider.ts b/packages/context-engine/src/base/BaseProvider.ts
index 62723073a51..45b3a225313 100644
--- a/packages/context-engine/src/base/BaseProvider.ts
+++ b/packages/context-engine/src/base/BaseProvider.ts
@@ -6,12 +6,11 @@ import { BaseProcessor } from './BaseProcessor';
*/
export abstract class BaseProvider extends BaseProcessor {
// Subclasses can optionally implement; by default no additional context is built
-
+
protected async buildContext(_context: PipelineContext): Promise<string | null> {
return null;
}
-
protected shouldInject(_context: PipelineContext): boolean {
return true;
}
diff --git a/packages/context-engine/src/processors/ToolCall.ts b/packages/context-engine/src/processors/ToolCall.ts
index 60d797f6977..227a692efb6 100644
--- a/packages/context-engine/src/processors/ToolCall.ts
+++ b/packages/context-engine/src/processors/ToolCall.ts
@@ -110,7 +110,7 @@ export class ToolCallProcessor extends BaseProcessor {
if (!supportTools || (!hasTools && hasEmptyToolCalls)) {
// If tools not supported or only has empty tool calls, return regular message (remove tool-related properties)
-
+
const { tools, tool_calls, ...messageWithoutTools } = message;
return messageWithoutTools;
}
diff --git a/packages/context-engine/src/processors/__tests__/HistoryTruncate.test.ts b/packages/context-engine/src/processors/__tests__/HistoryTruncate.test.ts
index f778cd618bf..7890e194d4b 100644
--- a/packages/context-engine/src/processors/__tests__/HistoryTruncate.test.ts
+++ b/packages/context-engine/src/processors/__tests__/HistoryTruncate.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';
-import { getSlicedMessages,HistoryTruncateProcessor } from '../HistoryTruncate';
+import { getSlicedMessages, HistoryTruncateProcessor } from '../HistoryTruncate';
describe('HistoryTruncateProcessor', () => {
describe('getSlicedMessages', () => {
diff --git a/packages/context-engine/src/providers/GTDPlanInjector.ts b/packages/context-engine/src/providers/GTDPlanInjector.ts
index a92074c476c..18a944bb32a 100644
--- a/packages/context-engine/src/providers/GTDPlanInjector.ts
+++ b/packages/context-engine/src/providers/GTDPlanInjector.ts
@@ -39,7 +39,6 @@ export interface GTDPlanInjectorConfig {
function formatGTDPlan(plan: GTDPlan): string {
const lines: string[] = ['<gtd_plan>', `<goal>${plan.goal}</goal>`];
-
if (plan.description) {
lines.push(`<description>${plan.description}</description>`);
}
@@ -69,7 +68,6 @@ export class GTDPlanInjector extends BaseFirstUserContentProvider {
super(options);
}
-
protected buildContent(_context: PipelineContext): string | null {
const { enabled, plan } = this.config;
diff --git a/packages/context-engine/src/providers/GroupContextInjector.ts b/packages/context-engine/src/providers/GroupContextInjector.ts
index 1250e4855c2..b2d1b416319 100644
--- a/packages/context-engine/src/providers/GroupContextInjector.ts
+++ b/packages/context-engine/src/providers/GroupContextInjector.ts
@@ -1,8 +1,5 @@
-import type {GroupContextMemberInfo} from '@lobechat/prompts';
-import {
- formatGroupMembers,
- groupContextTemplate
-} from '@lobechat/prompts';
+import type { GroupContextMemberInfo } from '@lobechat/prompts';
+import { formatGroupMembers, groupContextTemplate } from '@lobechat/prompts';
import debug from 'debug';
import { BaseFirstUserContentProvider } from '../base/BaseFirstUserContentProvider';
diff --git a/packages/context-engine/src/providers/KnowledgeInjector.ts b/packages/context-engine/src/providers/KnowledgeInjector.ts
index b7e87ad6dae..ce4629c01e4 100644
--- a/packages/context-engine/src/providers/KnowledgeInjector.ts
+++ b/packages/context-engine/src/providers/KnowledgeInjector.ts
@@ -29,7 +29,6 @@ export class KnowledgeInjector extends BaseFirstUserContentProvider {
super(options);
}
-
protected buildContent(_context: PipelineContext): string | null {
const fileContents = this.config.fileContents || [];
const knowledgeBases = this.config.knowledgeBases || [];
diff --git a/packages/context-engine/src/providers/PageEditorContextInjector.ts b/packages/context-engine/src/providers/PageEditorContextInjector.ts
index 77d0038aeb8..c64f8637e13 100644
--- a/packages/context-engine/src/providers/PageEditorContextInjector.ts
+++ b/packages/context-engine/src/providers/PageEditorContextInjector.ts
@@ -1,4 +1,4 @@
-import type {PageContentContext} from '@lobechat/prompts';
+import type { PageContentContext } from '@lobechat/prompts';
import { formatPageContentContext } from '@lobechat/prompts';
import debug from 'debug';
diff --git a/packages/context-engine/src/providers/ToolSystemRole.ts b/packages/context-engine/src/providers/ToolSystemRole.ts
index 3de2c7cb434..86e3d785b3f 100644
--- a/packages/context-engine/src/providers/ToolSystemRole.ts
+++ b/packages/context-engine/src/providers/ToolSystemRole.ts
@@ -1,5 +1,5 @@
-import type {API, Tool} from '@lobechat/prompts';
-import { pluginPrompts } from '@lobechat/prompts';
+import type { API, Tool } from '@lobechat/prompts';
+import { pluginPrompts } from '@lobechat/prompts';
import debug from 'debug';
import { BaseProvider } from '../base/BaseProvider';
diff --git a/packages/context-engine/src/providers/UserMemoryInjector.ts b/packages/context-engine/src/providers/UserMemoryInjector.ts
index e677ed9f368..608bd49b0f3 100644
--- a/packages/context-engine/src/providers/UserMemoryInjector.ts
+++ b/packages/context-engine/src/providers/UserMemoryInjector.ts
@@ -26,7 +26,6 @@ export class UserMemoryInjector extends BaseFirstUserContentProvider {
super(options);
}
-
protected buildContent(_context: PipelineContext): string | null {
const { memories } = this.config;
if (!memories) return null;
diff --git a/packages/database/src/core/web-server.ts b/packages/database/src/core/web-server.ts
index c50da413c4a..d7070147ab5 100644
--- a/packages/database/src/core/web-server.ts
+++ b/packages/database/src/core/web-server.ts
@@ -1,4 +1,4 @@
-import { neonConfig,Pool as NeonPool } from '@neondatabase/serverless';
+import { neonConfig, Pool as NeonPool } from '@neondatabase/serverless';
import { drizzle as neonDrizzle } from 'drizzle-orm/neon-serverless';
import { drizzle as nodeDrizzle } from 'drizzle-orm/node-postgres';
import { Pool as NodePool } from 'pg';
diff --git a/packages/database/src/models/__tests__/agent.test.ts b/packages/database/src/models/__tests__/agent.test.ts
index 060624e3ae0..2443670cf5c 100644
--- a/packages/database/src/models/__tests__/agent.test.ts
+++ b/packages/database/src/models/__tests__/agent.test.ts
@@ -4,8 +4,7 @@ import { eq } from 'drizzle-orm';
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import { getTestDB } from '../../core/getTestDB';
-import type {
- NewAgent} from '../../schemas';
+import type { NewAgent } from '../../schemas';
import {
agents,
agentsFiles,
diff --git a/packages/database/src/models/__tests__/aiModel.test.ts b/packages/database/src/models/__tests__/aiModel.test.ts
index 18f99f1f7a9..22471c60461 100644
--- a/packages/database/src/models/__tests__/aiModel.test.ts
+++ b/packages/database/src/models/__tests__/aiModel.test.ts
@@ -4,7 +4,7 @@ import type { AiProviderModelListItem } from 'model-bank';
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import { getTestDB } from '../../core/getTestDB';
-import type { NewAiModelItem} from '../../schemas';
+import type { NewAiModelItem } from '../../schemas';
import { aiModels, users } from '../../schemas';
import type { LobeChatDatabase } from '../../type';
import { AiModelModel } from '../aiModel';
diff --git a/packages/database/src/models/__tests__/asyncTask.test.ts b/packages/database/src/models/__tests__/asyncTask.test.ts
index 1284baad01f..7828ad62dac 100644
--- a/packages/database/src/models/__tests__/asyncTask.test.ts
+++ b/packages/database/src/models/__tests__/asyncTask.test.ts
@@ -1,10 +1,7 @@
// @vitest-environment node
import { ASYNC_TASK_TIMEOUT } from '@lobechat/business-config/server';
-import type {UserMemoryExtractionMetadata} from '@lobechat/types';
-import {
- AsyncTaskStatus,
- AsyncTaskType
-} from '@lobechat/types';
+import type { UserMemoryExtractionMetadata } from '@lobechat/types';
+import { AsyncTaskStatus, AsyncTaskType } from '@lobechat/types';
import { eq } from 'drizzle-orm';
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
diff --git a/packages/database/src/models/__tests__/chatGroup.test.ts b/packages/database/src/models/__tests__/chatGroup.test.ts
index 6350e10addd..55cfd8811a4 100644
--- a/packages/database/src/models/__tests__/chatGroup.test.ts
+++ b/packages/database/src/models/__tests__/chatGroup.test.ts
@@ -5,14 +5,8 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import type { LobeChatDatabase } from '@/database/type';
import { getTestDB } from '../../core/getTestDB';
-import type {
- NewChatGroup} from '../../schemas';
-import {
- agents as agentsTable,
- chatGroups,
- chatGroupsAgents,
- users,
-} from '../../schemas';
+import type { NewChatGroup } from '../../schemas';
+import { agents as agentsTable, chatGroups, chatGroupsAgents, users } from '../../schemas';
import { ChatGroupModel } from '../chatGroup';
const userId = 'test-user';
diff --git a/packages/database/src/models/__tests__/chunk.test.ts b/packages/database/src/models/__tests__/chunk.test.ts
index 02d5f037e41..2f49146014c 100644
--- a/packages/database/src/models/__tests__/chunk.test.ts
+++ b/packages/database/src/models/__tests__/chunk.test.ts
@@ -542,7 +542,7 @@ content in Table html is below:
const chunkResult = await serverDB
.insert(chunks)
.values(
- Array.from({length: 24})
+ Array.from({ length: 24 })
.fill(0)
.map((_, i) => ({ text: `Test Chunk ${i}`, userId })),
)
diff --git a/packages/database/src/models/__tests__/fixtures/embedding.ts b/packages/database/src/models/__tests__/fixtures/embedding.ts
index faf37ca1e16..01b9142bac6 100644
--- a/packages/database/src/models/__tests__/fixtures/embedding.ts
+++ b/packages/database/src/models/__tests__/fixtures/embedding.ts
@@ -1,5 +1,3 @@
-
-
// query: 设计思维的困境是什么 / text-embedding-3-small / 1024d
export const designThinkingQuery = [
0.07259023189544678, -0.034810926765203476, 0.0220064427703619, 0.013883893378078938,
diff --git a/packages/database/src/models/__tests__/generation.test.ts b/packages/database/src/models/__tests__/generation.test.ts
index fbc7f924f15..1e65578de2f 100644
--- a/packages/database/src/models/__tests__/generation.test.ts
+++ b/packages/database/src/models/__tests__/generation.test.ts
@@ -1,12 +1,11 @@
// @vitest-environment node
import type { ImageGenerationAsset } from '@lobechat/types';
-import { AsyncTaskStatus, FileSource } from '@lobechat/types';
+import { AsyncTaskStatus, FileSource } from '@lobechat/types';
import { eq } from 'drizzle-orm';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { getTestDB } from '../../core/getTestDB';
-import type {
- NewGeneration} from '../../schemas';
+import type { NewGeneration } from '../../schemas';
import {
asyncTasks,
files,
diff --git a/packages/database/src/models/__tests__/generationBatch.test.ts b/packages/database/src/models/__tests__/generationBatch.test.ts
index c75270ef268..b80b4295777 100644
--- a/packages/database/src/models/__tests__/generationBatch.test.ts
+++ b/packages/database/src/models/__tests__/generationBatch.test.ts
@@ -5,14 +5,8 @@ import { eq } from 'drizzle-orm';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { getTestDB } from '../../core/getTestDB';
-import type {
- NewGenerationBatch} from '../../schemas';
-import {
- generationBatches,
- generations,
- generationTopics,
- users,
-} from '../../schemas';
+import type { NewGenerationBatch } from '../../schemas';
+import { generationBatches, generations, generationTopics, users } from '../../schemas';
import type { LobeChatDatabase } from '../../type';
import { GenerationBatchModel } from '../generationBatch';
diff --git a/packages/database/src/models/__tests__/knowledgeBase.test.ts b/packages/database/src/models/__tests__/knowledgeBase.test.ts
index 8bde322b428..89c8a708144 100644
--- a/packages/database/src/models/__tests__/knowledgeBase.test.ts
+++ b/packages/database/src/models/__tests__/knowledgeBase.test.ts
@@ -5,8 +5,7 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import { sleep } from '@/utils/sleep';
import { getTestDB } from '../../core/getTestDB';
-import type {
- NewKnowledgeBase} from '../../schemas';
+import type { NewKnowledgeBase } from '../../schemas';
import {
documents,
files,
diff --git a/packages/database/src/models/__tests__/messages/message.stats.test.ts b/packages/database/src/models/__tests__/messages/message.stats.test.ts
index 4d44fe86764..74473f338a3 100644
--- a/packages/database/src/models/__tests__/messages/message.stats.test.ts
+++ b/packages/database/src/models/__tests__/messages/message.stats.test.ts
@@ -359,7 +359,7 @@ describe('MessageModel Statistics Tests', () => {
createdAt: today.subtract(4, 'day').toDate(),
},
// 6 messages - level 2
- ...Array.from({length: 6})
+ ...Array.from({ length: 6 })
.fill(0)
.map((_, i) => ({
id: `2-${i}`,
@@ -369,7 +369,7 @@ describe('MessageModel Statistics Tests', () => {
createdAt: today.subtract(3, 'day').toDate(),
})),
// 11 messages - level 3
- ...Array.from({length: 11})
+ ...Array.from({ length: 11 })
.fill(0)
.map((_, i) => ({
id: `3-${i}`,
@@ -379,7 +379,7 @@ describe('MessageModel Statistics Tests', () => {
createdAt: today.subtract(2, 'day').toDate(),
})),
// 16 messages - level 4
- ...Array.from({length: 16})
+ ...Array.from({ length: 16 })
.fill(0)
.map((_, i) => ({
id: `4-${i}`,
@@ -389,7 +389,7 @@ describe('MessageModel Statistics Tests', () => {
createdAt: today.subtract(1, 'day').toDate(),
})),
// 21 messages - level 4
- ...Array.from({length: 21})
+ ...Array.from({ length: 21 })
.fill(0)
.map((_, i) => ({
id: `5-${i}`,
diff --git a/packages/database/src/models/__tests__/plugin.test.ts b/packages/database/src/models/__tests__/plugin.test.ts
index 89d5036737e..d739f47cc93 100644
--- a/packages/database/src/models/__tests__/plugin.test.ts
+++ b/packages/database/src/models/__tests__/plugin.test.ts
@@ -2,7 +2,7 @@
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import { getTestDB } from '../../core/getTestDB';
-import type { NewInstalledPlugin} from '../../schemas';
+import type { NewInstalledPlugin } from '../../schemas';
import { userInstalledPlugins, users } from '../../schemas';
import type { LobeChatDatabase } from '../../type';
import { PluginModel } from '../plugin';
diff --git a/packages/database/src/models/__tests__/session.test.ts b/packages/database/src/models/__tests__/session.test.ts
index 9ee7244caff..c4cb53d07bd 100644
--- a/packages/database/src/models/__tests__/session.test.ts
+++ b/packages/database/src/models/__tests__/session.test.ts
@@ -4,9 +4,7 @@ import type { LLMParams } from 'model-bank';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { getTestDB } from '../../core/getTestDB';
-import type {
- NewSession,
- SessionItem} from '../../schemas';
+import type { NewSession, SessionItem } from '../../schemas';
import {
agents,
agentsToSessions,
diff --git a/packages/database/src/models/__tests__/topics/topic.create.test.ts b/packages/database/src/models/__tests__/topics/topic.create.test.ts
index a33569ab970..4d78a4508fc 100644
--- a/packages/database/src/models/__tests__/topics/topic.create.test.ts
+++ b/packages/database/src/models/__tests__/topics/topic.create.test.ts
@@ -4,7 +4,7 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import { getTestDB } from '../../../core/getTestDB';
import { agents, messagePlugins, messages, sessions, topics, users } from '../../../schemas';
import type { LobeChatDatabase } from '../../../type';
-import type { CreateTopicParams} from '../../topic';
+import type { CreateTopicParams } from '../../topic';
import { TopicModel } from '../../topic';
const userId = 'topic-create-user';
diff --git a/packages/database/src/models/__tests__/topics/topic.stats.test.ts b/packages/database/src/models/__tests__/topics/topic.stats.test.ts
index f23faebde4b..0b9514670f1 100644
--- a/packages/database/src/models/__tests__/topics/topic.stats.test.ts
+++ b/packages/database/src/models/__tests__/topics/topic.stats.test.ts
@@ -57,8 +57,12 @@ describe('TopicModel - Stats', () => {
it('should count legacy topics via agentsToSessions lookup', async () => {
await serverDB.transaction(async (trx) => {
await trx.insert(sessions).values([{ id: 'count-legacy-session', userId }]);
- await trx.insert(agents).values([{ id: 'count-legacy-agent', userId, title: 'Legacy Agent' }]);
- await trx.insert(agentsToSessions).values([{ agentId: 'count-legacy-agent', sessionId: 'count-legacy-session', userId }]);
+ await trx
+ .insert(agents)
+ .values([{ id: 'count-legacy-agent', userId, title: 'Legacy Agent' }]);
+ await trx
+ .insert(agentsToSessions)
+ .values([{ agentId: 'count-legacy-agent', sessionId: 'count-legacy-session', userId }]);
await trx.insert(topics).values([
{ id: 'legacy-count-1', userId, sessionId: 'count-legacy-session', agentId: null },
{ id: 'legacy-count-2', userId, sessionId: 'count-legacy-session', agentId: null },
@@ -72,8 +76,12 @@ describe('TopicModel - Stats', () => {
it('should count both new and legacy topics', async () => {
await serverDB.transaction(async (trx) => {
await trx.insert(sessions).values([{ id: 'count-mixed-session', userId }]);
- await trx.insert(agents).values([{ id: 'count-mixed-agent', userId, title: 'Mixed Agent' }]);
- await trx.insert(agentsToSessions).values([{ agentId: 'count-mixed-agent', sessionId: 'count-mixed-session', userId }]);
+ await trx
+ .insert(agents)
+ .values([{ id: 'count-mixed-agent', userId, title: 'Mixed Agent' }]);
+ await trx
+ .insert(agentsToSessions)
+ .values([{ agentId: 'count-mixed-agent', sessionId: 'count-mixed-session', userId }]);
await trx.insert(topics).values([
{ id: 'mixed-count-legacy', userId, sessionId: 'count-mixed-session', agentId: null },
{ id: 'mixed-count-new', userId, agentId: 'count-mixed-agent', sessionId: null },
diff --git a/packages/database/src/models/__tests__/user.test.ts b/packages/database/src/models/__tests__/user.test.ts
index a0c4f8dd1cf..403d60bd0f6 100644
--- a/packages/database/src/models/__tests__/user.test.ts
+++ b/packages/database/src/models/__tests__/user.test.ts
@@ -3,9 +3,9 @@ import { eq } from 'drizzle-orm';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { getTestDB } from '../../core/getTestDB';
-import { nextauthAccounts, users,userSettings } from '../../schemas';
+import { nextauthAccounts, users, userSettings } from '../../schemas';
import type { LobeChatDatabase } from '../../type';
-import type { ListUsersForMemoryExtractorCursor} from '../user';
+import type { ListUsersForMemoryExtractorCursor } from '../user';
import { UserModel, UserNotFoundError } from '../user';
const userId = 'user-model-test';
diff --git a/packages/database/src/models/__tests__/userMemories.test.ts b/packages/database/src/models/__tests__/userMemories.test.ts
index bfb9d702706..accb6b1d8c8 100644
--- a/packages/database/src/models/__tests__/userMemories.test.ts
+++ b/packages/database/src/models/__tests__/userMemories.test.ts
@@ -21,10 +21,9 @@ import type {
CreateUserMemoryContextParams,
CreateUserMemoryExperienceParams,
CreateUserMemoryIdentityParams,
- CreateUserMemoryPreferenceParams} from '../userMemory';
-import {
- UserMemoryModel,
+ CreateUserMemoryPreferenceParams,
} from '../userMemory';
+import { UserMemoryModel } from '../userMemory';
const serverDB: LobeChatDatabase = await getTestDB();
@@ -38,9 +37,7 @@ const userMemoryModel = new UserMemoryModel(serverDB, userId);
* @returns Normalized random vector
*/
function generateRandomEmbedding(dimensions: number = 1024): number[] {
- const vector = new Array(dimensions)
- .fill(0)
- .map(() => Math.random() * 2 - 1); // Random values between -1 and 1
+ const vector = new Array(dimensions).fill(0).map(() => Math.random() * 2 - 1); // Random values between -1 and 1
// Normalize the vector
const magnitude = Math.sqrt(vector.reduce((sum, val) => sum + val * val, 0));
@@ -2059,7 +2056,7 @@ describe('UserMemoryModel', () => {
// accessedAt should be updated (either later or same if test runs fast)
if (initialAccessedAt && afterIdentity!.accessedAt) {
expect(afterIdentity!.accessedAt.getTime()).toBeGreaterThanOrEqual(
- initialAccessedAt.getTime()
+ initialAccessedAt.getTime(),
);
}
});
diff --git a/packages/database/src/models/_template.ts b/packages/database/src/models/_template.ts
index d3b17e57c71..86974999f70 100644
--- a/packages/database/src/models/_template.ts
+++ b/packages/database/src/models/_template.ts
@@ -1,6 +1,6 @@
import { and, desc, eq } from 'drizzle-orm';
-import type { NewSessionGroup, SessionGroupItem} from '../schemas';
+import type { NewSessionGroup, SessionGroupItem } from '../schemas';
import { sessionGroups } from '../schemas';
import type { LobeChatDatabase } from '../type';
diff --git a/packages/database/src/models/agent.ts b/packages/database/src/models/agent.ts
index 0120217305c..a176ea2b80f 100644
--- a/packages/database/src/models/agent.ts
+++ b/packages/database/src/models/agent.ts
@@ -5,8 +5,7 @@ import type { PartialDeep } from 'type-fest';
import { merge } from '@/utils/merge';
-import type {
- AgentItem} from '../schemas';
+import type { AgentItem } from '../schemas';
import {
agents,
agentsFiles,
@@ -427,7 +426,7 @@ export class AgentModel {
}
// Build data to be merged, excluding params (processed separately)
-
+
const { params: _params, ...restData } = data;
const mergedValue = merge(agent, restData);
@@ -448,7 +447,7 @@ export class AgentModel {
}
// Remove timestamp fields to let Drizzle's $onUpdate handle them automatically
-
+
const { updatedAt: _, accessedAt: __, createdAt: ___, ...updateData } = mergedValue;
return this.db
diff --git a/packages/database/src/models/agentCronJob.ts b/packages/database/src/models/agentCronJob.ts
index 69b9eb3173b..402a2237781 100644
--- a/packages/database/src/models/agentCronJob.ts
+++ b/packages/database/src/models/agentCronJob.ts
@@ -1,9 +1,12 @@
import { and, desc, eq, gt, inArray, isNull, or, sql } from 'drizzle-orm';
-import type {AgentCronJob, CreateAgentCronJobData, NewAgentCronJob, UpdateAgentCronJobData} from '../schemas/agentCronJob';
-import {
- agentCronJobs
+import type {
+ AgentCronJob,
+ CreateAgentCronJobData,
+ NewAgentCronJob,
+ UpdateAgentCronJobData,
} from '../schemas/agentCronJob';
+import { agentCronJobs } from '../schemas/agentCronJob';
import type { LobeChatDatabase } from '../type';
export class AgentCronJobModel {
@@ -82,10 +85,11 @@ export class AgentCronJobModel {
if (data?.cronPattern !== undefined || data?.timezone !== undefined) {
const existing = await this.findById(id);
- if (existing && (
- (data?.cronPattern !== undefined && data?.cronPattern !== existing.cronPattern) ||
- (data?.timezone !== undefined && data?.timezone !== existing.timezone)
- )) {
+ if (
+ existing &&
+ ((data?.cronPattern !== undefined && data?.cronPattern !== existing.cronPattern) ||
+ (data?.timezone !== undefined && data?.timezone !== existing.timezone))
+ ) {
shouldResetLastExecuted = true;
}
}
diff --git a/packages/database/src/models/aiModel.ts b/packages/database/src/models/aiModel.ts
index 995891bf1c0..a6f0ff1cc8b 100644
--- a/packages/database/src/models/aiModel.ts
+++ b/packages/database/src/models/aiModel.ts
@@ -3,12 +3,11 @@ import type {
AiModelSortMap,
AiProviderModelListItem,
EnabledAiModel,
- ToggleAiModelEnableParams} from 'model-bank';
-import {
- AiModelSourceEnum
+ ToggleAiModelEnableParams,
} from 'model-bank';
+import { AiModelSourceEnum } from 'model-bank';
-import type {AiModelSelectItem, NewAiModelItem } from '../schemas';
+import type { AiModelSelectItem, NewAiModelItem } from '../schemas';
import { aiModels } from '../schemas';
import type { LobeChatDatabase } from '../type';
diff --git a/packages/database/src/models/aiProvider.ts b/packages/database/src/models/aiProvider.ts
index 882c5832b5b..b61c03ab19f 100644
--- a/packages/database/src/models/aiProvider.ts
+++ b/packages/database/src/models/aiProvider.ts
@@ -12,7 +12,7 @@ import { DEFAULT_MODEL_PROVIDER_LIST } from 'model-bank/modelProviders';
import { merge } from '@/utils/merge';
-import type {AiProviderSelectItem } from '../schemas';
+import type { AiProviderSelectItem } from '../schemas';
import { aiModels, aiProviders } from '../schemas';
import type { LobeChatDatabase } from '../type';
@@ -33,7 +33,6 @@ export class AiProviderModel {
{ keyVaults: userKey, ...params }: CreateAiProviderParams,
encryptor?: EncryptUserKeyVaults,
) => {
-
const defaultSerialize = (s: string) => s;
const encrypt = encryptor ?? defaultSerialize;
const keyVaults = await encrypt(JSON.stringify(userKey));
@@ -114,7 +113,6 @@ export class AiProviderModel {
encryptor?: EncryptUserKeyVaults,
decryptor?: DecryptUserKeyVaults,
) => {
-
const defaultSerialize = (s: string) => s;
const encrypt = encryptor ?? defaultSerialize;
const decrypt = decryptor ?? JSON.parse;
diff --git a/packages/database/src/models/asyncTask.ts b/packages/database/src/models/asyncTask.ts
index 3786483a0a7..85a7ec9fcc7 100644
--- a/packages/database/src/models/asyncTask.ts
+++ b/packages/database/src/models/asyncTask.ts
@@ -1,13 +1,9 @@
import { ASYNC_TASK_TIMEOUT } from '@lobechat/business-config/server';
-import type {AsyncTaskType, UserMemoryExtractionMetadata} from '@lobechat/types';
-import {
- AsyncTaskError,
- AsyncTaskErrorType,
- AsyncTaskStatus
-} from '@lobechat/types';
+import type { AsyncTaskType, UserMemoryExtractionMetadata } from '@lobechat/types';
+import { AsyncTaskError, AsyncTaskErrorType, AsyncTaskStatus } from '@lobechat/types';
import { and, eq, inArray, lt, or, sql } from 'drizzle-orm';
-import type {AsyncTaskSelectItem, NewAsyncTaskItem } from '../schemas';
+import type { AsyncTaskSelectItem, NewAsyncTaskItem } from '../schemas';
import { asyncTasks } from '../schemas';
import type { LobeChatDatabase } from '../type';
diff --git a/packages/database/src/models/chatGroup.ts b/packages/database/src/models/chatGroup.ts
index 80e8e16d6f1..d1b6f6eaf4f 100644
--- a/packages/database/src/models/chatGroup.ts
+++ b/packages/database/src/models/chatGroup.ts
@@ -4,11 +4,9 @@ import type {
ChatGroupAgentItem,
ChatGroupItem,
NewChatGroup,
- NewChatGroupAgent} from '../schemas';
-import {
- chatGroups,
- chatGroupsAgents
+ NewChatGroupAgent,
} from '../schemas';
+import { chatGroups, chatGroupsAgents } from '../schemas';
import type { LobeChatDatabase } from '../type';
export class ChatGroupModel {
diff --git a/packages/database/src/models/chunk.ts b/packages/database/src/models/chunk.ts
index 6576be8f335..f431f963a08 100644
--- a/packages/database/src/models/chunk.ts
+++ b/packages/database/src/models/chunk.ts
@@ -2,16 +2,8 @@ import type { ChunkMetadata, FileChunk } from '@lobechat/types';
import { and, asc, cosineDistance, count, desc, eq, inArray, isNull, sql } from 'drizzle-orm';
import { chunk } from 'es-toolkit/compat';
-import type {
- NewChunkItem,
- NewUnstructuredChunkItem} from '../schemas';
-import {
- chunks,
- embeddings,
- fileChunks,
- files,
- unstructuredChunks,
-} from '../schemas';
+import type { NewChunkItem, NewUnstructuredChunkItem } from '../schemas';
+import { chunks, embeddings, fileChunks, files, unstructuredChunks } from '../schemas';
import type { LobeChatDatabase } from '../type';
export class ChunkModel {
diff --git a/packages/database/src/models/document.ts b/packages/database/src/models/document.ts
index 2aa5138573d..7eb886450f2 100644
--- a/packages/database/src/models/document.ts
+++ b/packages/database/src/models/document.ts
@@ -1,6 +1,6 @@
import { and, count, desc, eq, inArray } from 'drizzle-orm';
-import type { DocumentItem,NewDocument } from '../schemas';
+import type { DocumentItem, NewDocument } from '../schemas';
import { documents } from '../schemas';
import type { LobeChatDatabase } from '../type';
diff --git a/packages/database/src/models/embedding.ts b/packages/database/src/models/embedding.ts
index fc34003a257..922edfbad53 100644
--- a/packages/database/src/models/embedding.ts
+++ b/packages/database/src/models/embedding.ts
@@ -1,6 +1,6 @@
import { and, count, eq } from 'drizzle-orm';
-import type {NewEmbeddingsItem } from '../schemas';
+import type { NewEmbeddingsItem } from '../schemas';
import { embeddings } from '../schemas';
import type { LobeChatDatabase } from '../type';
diff --git a/packages/database/src/models/file.ts b/packages/database/src/models/file.ts
index 1aa347286a0..5b5f1c0e4ab 100644
--- a/packages/database/src/models/file.ts
+++ b/packages/database/src/models/file.ts
@@ -1,12 +1,9 @@
-import type { QueryFileListParams} from '@lobechat/types';
+import type { QueryFileListParams } from '@lobechat/types';
import { FilesTabs, SortType } from '@lobechat/types';
import { and, asc, count, desc, eq, ilike, inArray, like, notExists, or, sum } from 'drizzle-orm';
import type { PgTransaction } from 'drizzle-orm/pg-core';
-import type {
- FileItem,
- NewFile,
- NewGlobalFile} from '../schemas';
+import type { FileItem, NewFile, NewGlobalFile } from '../schemas';
import {
chunks,
documentChunks,
diff --git a/packages/database/src/models/generation.ts b/packages/database/src/models/generation.ts
index 646df2ff12b..f95d953cda9 100644
--- a/packages/database/src/models/generation.ts
+++ b/packages/database/src/models/generation.ts
@@ -2,23 +2,17 @@ import type {
AsyncTaskError,
AsyncTaskStatus,
Generation,
- ImageGenerationAsset} from '@lobechat/types';
-import {
- FileSource
+ ImageGenerationAsset,
} from '@lobechat/types';
+import { FileSource } from '@lobechat/types';
import debug from 'debug';
import { and, eq } from 'drizzle-orm';
import { FileService } from '@/server/services/file';
import type { NewFile } from '../schemas';
-import type {
- GenerationItem,
- GenerationWithAsyncTask,
- NewGeneration} from '../schemas/generation';
-import {
- generations,
-} from '../schemas/generation';
+import type { GenerationItem, GenerationWithAsyncTask, NewGeneration } from '../schemas/generation';
+import { generations } from '../schemas/generation';
import type { LobeChatDatabase, Transaction } from '../type';
import { FileModel } from './file';
diff --git a/packages/database/src/models/generationBatch.ts b/packages/database/src/models/generationBatch.ts
index 2d64e182308..4d5620ca1cf 100644
--- a/packages/database/src/models/generationBatch.ts
+++ b/packages/database/src/models/generationBatch.ts
@@ -1,4 +1,9 @@
-import type { Generation, GenerationAsset, GenerationBatch, GenerationConfig } from '@lobechat/types';
+import type {
+ Generation,
+ GenerationAsset,
+ GenerationBatch,
+ GenerationConfig,
+} from '@lobechat/types';
import debug from 'debug';
import { and, eq } from 'drizzle-orm';
@@ -7,10 +12,9 @@ import { FileService } from '@/server/services/file';
import type {
GenerationBatchItem,
GenerationBatchWithGenerations,
- NewGenerationBatch} from '../schemas/generation';
-import {
- generationBatches
+ NewGenerationBatch,
} from '../schemas/generation';
+import { generationBatches } from '../schemas/generation';
import type { LobeChatDatabase } from '../type';
import { GenerationModel } from './generation';
diff --git a/packages/database/src/models/generationTopic.ts b/packages/database/src/models/generationTopic.ts
index 52b5963636e..66919faa7ce 100644
--- a/packages/database/src/models/generationTopic.ts
+++ b/packages/database/src/models/generationTopic.ts
@@ -3,7 +3,7 @@ import { and, desc, eq } from 'drizzle-orm';
import { FileService } from '@/server/services/file';
-import type { GenerationTopicItem} from '../schemas/generation';
+import type { GenerationTopicItem } from '../schemas/generation';
import { generationTopics } from '../schemas/generation';
import type { LobeChatDatabase } from '../type';
diff --git a/packages/database/src/models/knowledgeBase.ts b/packages/database/src/models/knowledgeBase.ts
index c17f845bdc4..ed2474bd93c 100644
--- a/packages/database/src/models/knowledgeBase.ts
+++ b/packages/database/src/models/knowledgeBase.ts
@@ -1,7 +1,7 @@
import type { KnowledgeBaseItem } from '@lobechat/types';
import { and, desc, eq, inArray } from 'drizzle-orm';
-import type {NewKnowledgeBase } from '../schemas';
+import type { NewKnowledgeBase } from '../schemas';
import { documents, knowledgeBaseFiles, knowledgeBases } from '../schemas';
import type { LobeChatDatabase } from '../type';
diff --git a/packages/database/src/models/message.ts b/packages/database/src/models/message.ts
index 76a6b9ca3cb..2246d4a8a7e 100644
--- a/packages/database/src/models/message.ts
+++ b/packages/database/src/models/message.ts
@@ -18,15 +18,12 @@ import type {
ThreadStatus,
UIChatMessage,
UpdateMessageParams,
- UpdateMessageRAGParams} from '@lobechat/types';
-import {
- MessageGroupType,
- ThreadType
+ UpdateMessageRAGParams,
} from '@lobechat/types';
+import { MessageGroupType, ThreadType } from '@lobechat/types';
import type { HeatmapsProps } from '@lobehub/charts';
import dayjs from 'dayjs';
-import type {
- SQL} from 'drizzle-orm';
+import type { SQL } from 'drizzle-orm';
import {
and,
asc,
@@ -251,7 +248,6 @@ export class MessageModel {
ttsContentMd5: messageTTS.contentMd5,
ttsFile: messageTTS.fileId,
ttsVoice: messageTTS.voice,
-
})
.from(messages)
.where(
@@ -480,7 +476,7 @@ export class MessageModel {
},
fileList: fileList
.filter((relation) => relation.messageId === item.id)
-
+
.map<ChatFileItem>(({ id, url, size, fileType, name }) => ({
content: documentsMap[id],
fileType: fileType!,
@@ -491,7 +487,7 @@ export class MessageModel {
})),
imageList: imageList
.filter((relation) => relation.messageId === item.id)
-
+
.map<ChatImageItem>(({ id, url, name }) => ({ alt: name!, id, url })),
model,
@@ -504,7 +500,7 @@ export class MessageModel {
taskDetail: item.role === 'task' ? threadMap.get(item.id as string) : undefined,
videoList: videoList
.filter((relation) => relation.messageId === item.id)
-
+
.map<ChatVideoItem>(({ id, url, name }) => ({ alt: name!, id, url })),
} as unknown as UIChatMessage;
},
@@ -591,7 +587,6 @@ export class MessageModel {
ttsContentMd5: messageTTS.contentMd5,
ttsFile: messageTTS.fileId,
ttsVoice: messageTTS.voice,
-
})
.from(messages)
.where(and(eq(messages.userId, this.userId), inArray(messages.id, messageIds)))
@@ -661,7 +656,10 @@ export class MessageModel {
})
.from(threads)
.where(
- and(eq(threads.userId, this.userId), inArray(threads.sourceMessageId, taskMessageIds)),
+ and(
+ eq(threads.userId, this.userId),
+ inArray(threads.sourceMessageId, taskMessageIds),
+ ),
)
: Promise.resolve([]),
]);
diff --git a/packages/database/src/models/oauthHandoff.ts b/packages/database/src/models/oauthHandoff.ts
index 9d92b7b1c6d..d21831bf30a 100644
--- a/packages/database/src/models/oauthHandoff.ts
+++ b/packages/database/src/models/oauthHandoff.ts
@@ -1,6 +1,6 @@
import { and, eq, lt, sql } from 'drizzle-orm';
-import type { NewOAuthHandoff, OAuthHandoffItem} from '../schemas';
+import type { NewOAuthHandoff, OAuthHandoffItem } from '../schemas';
import { oauthHandoffs } from '../schemas';
import type { LobeChatDatabase } from '../type';
diff --git a/packages/database/src/models/plugin.ts b/packages/database/src/models/plugin.ts
index 327a5b06e4a..0798a8f292c 100644
--- a/packages/database/src/models/plugin.ts
+++ b/packages/database/src/models/plugin.ts
@@ -1,7 +1,7 @@
import type { LobeTool } from '@lobechat/types';
import { and, desc, eq } from 'drizzle-orm';
-import type { InstalledPluginItem, NewInstalledPlugin} from '../schemas';
+import type { InstalledPluginItem, NewInstalledPlugin } from '../schemas';
import { userInstalledPlugins } from '../schemas';
import type { LobeChatDatabase } from '../type';
diff --git a/packages/database/src/models/session.ts b/packages/database/src/models/session.ts
index 7c24101f69c..d62000a5c15 100644
--- a/packages/database/src/models/session.ts
+++ b/packages/database/src/models/session.ts
@@ -6,38 +6,14 @@ import type {
LobeGroupSession,
SessionRankItem,
} from '@lobechat/types';
-import type {
- Column} from 'drizzle-orm';
-import {
- and,
- asc,
- count,
- desc,
- eq,
- gt,
- inArray,
- isNull,
- like,
- not,
- or,
- sql,
-} from 'drizzle-orm';
+import type { Column } from 'drizzle-orm';
+import { and, asc, count, desc, eq, gt, inArray, isNull, like, not, or, sql } from 'drizzle-orm';
import type { PartialDeep } from 'type-fest';
import { merge } from '@/utils/merge';
-import type {
- AgentItem,
- NewAgent,
- NewSession,
- SessionItem} from '../schemas';
-import {
- agents,
- agentsToSessions,
- sessionGroups,
- sessions,
- topics,
-} from '../schemas';
+import type { AgentItem, NewAgent, NewSession, SessionItem } from '../schemas';
+import { agents, agentsToSessions, sessionGroups, sessions, topics } from '../schemas';
import type { LobeChatDatabase } from '../type';
import { genEndDateWhere, genRangeWhere, genStartDateWhere, genWhere } from '../utils/genWhere';
import { idGenerator } from '../utils/idGenerator';
@@ -387,7 +363,6 @@ export class SessionModel {
const { agent, clientId, ...session } = result;
const sessionId = this.genId();
-
const { id: _, slug: __, ...config } = agent;
return this.create({
@@ -551,7 +526,7 @@ export class SessionModel {
}
// Build data to be merged, excluding params (processed separately)
-
+
const { params: _params, ...restData } = data;
const mergedValue = merge(session.agent, restData);
diff --git a/packages/database/src/models/sessionGroup.ts b/packages/database/src/models/sessionGroup.ts
index 07ceaf235c4..771848c3d36 100644
--- a/packages/database/src/models/sessionGroup.ts
+++ b/packages/database/src/models/sessionGroup.ts
@@ -1,6 +1,6 @@
import { and, asc, desc, eq } from 'drizzle-orm';
-import type { SessionGroupItem} from '../schemas';
+import type { SessionGroupItem } from '../schemas';
import { sessionGroups } from '../schemas';
import type { LobeChatDatabase } from '../type';
import { idGenerator } from '../utils/idGenerator';
diff --git a/packages/database/src/models/thread.ts b/packages/database/src/models/thread.ts
index e85e3ec8c80..8ea923c0a83 100644
--- a/packages/database/src/models/thread.ts
+++ b/packages/database/src/models/thread.ts
@@ -1,8 +1,8 @@
-import type { CreateThreadParams} from '@lobechat/types';
+import type { CreateThreadParams } from '@lobechat/types';
import { ThreadStatus } from '@lobechat/types';
import { and, desc, eq } from 'drizzle-orm';
-import type { ThreadItem} from '../schemas';
+import type { ThreadItem } from '../schemas';
import { threads } from '../schemas';
import type { LobeChatDatabase } from '../type';
diff --git a/packages/database/src/models/topic.ts b/packages/database/src/models/topic.ts
index a037da842e3..3a8c975958a 100644
--- a/packages/database/src/models/topic.ts
+++ b/packages/database/src/models/topic.ts
@@ -1,6 +1,5 @@
import type { ChatTopicMetadata, DBMessageItem, TopicRankItem } from '@lobechat/types';
-import type {
- SQL} from 'drizzle-orm';
+import type { SQL } from 'drizzle-orm';
import {
and,
count,
@@ -18,15 +17,8 @@ import {
sql,
} from 'drizzle-orm';
-import type {
- TopicItem} from '../schemas';
-import {
- agents,
- agentsToSessions,
- messagePlugins,
- messages,
- topics,
-} from '../schemas';
+import type { TopicItem } from '../schemas';
+import { agents, agentsToSessions, messagePlugins, messages, topics } from '../schemas';
import type { LobeChatDatabase } from '../type';
import { genEndDateWhere, genRangeWhere, genStartDateWhere, genWhere } from '../utils/genWhere';
import { idGenerator } from '../utils/idGenerator';
@@ -226,7 +218,7 @@ export class TopicModel {
]);
// Remove internal fields before returning
-
+
const cleanItems = items.map(({ agentId, sessionId, ...rest }) => rest);
return { items: cleanItems, total: totalResult[0].count };
@@ -518,10 +510,7 @@ export class TopicModel {
const messageIds = originalMessages.map((m) => m.id);
const originalPlugins =
messageIds.length > 0
- ? await tx
- .select()
- .from(messagePlugins)
- .where(inArray(messagePlugins.id, messageIds))
+ ? await tx.select().from(messagePlugins).where(inArray(messagePlugins.id, messageIds))
: [];
// Build oldId -> newId mapping for messages
@@ -748,11 +737,13 @@ export class TopicModel {
});
};
- countTopicsForMemoryExtractor = async (options: {
- endDate?: Date;
- ignoreExtracted?: boolean;
- startDate?: Date;
- } = {}) => {
+ countTopicsForMemoryExtractor = async (
+ options: {
+ endDate?: Date;
+ ignoreExtracted?: boolean;
+ startDate?: Date;
+ } = {},
+ ) => {
const result = await this.db
.select({ total: count(topics.id) })
.from(topics)
@@ -763,10 +754,10 @@ export class TopicModel {
options.endDate ? lte(topics.createdAt, options.endDate) : undefined,
options.ignoreExtracted
? undefined
- : or(
- isNull(topics.metadata),
- sql`(${topics.metadata}->>'userMemoryExtractStatus') IS DISTINCT FROM 'completed'`,
- ),
+ : or(
+ isNull(topics.metadata),
+ sql`(${topics.metadata}->>'userMemoryExtractStatus') IS DISTINCT FROM 'completed'`,
+ ),
),
);
diff --git a/packages/database/src/models/topicDocument.ts b/packages/database/src/models/topicDocument.ts
index 51c3c5df04e..626d9af6c6a 100644
--- a/packages/database/src/models/topicDocument.ts
+++ b/packages/database/src/models/topicDocument.ts
@@ -1,6 +1,6 @@
import { and, desc, eq } from 'drizzle-orm';
-import type { DocumentItem, NewTopicDocument} from '../schemas';
+import type { DocumentItem, NewTopicDocument } from '../schemas';
import { documents, topicDocuments } from '../schemas';
import type { LobeChatDatabase } from '../type';
diff --git a/packages/database/src/models/topicShare.ts b/packages/database/src/models/topicShare.ts
index 5dcc55fb56d..5a7a5da2579 100644
--- a/packages/database/src/models/topicShare.ts
+++ b/packages/database/src/models/topicShare.ts
@@ -2,7 +2,7 @@ import type { ShareVisibility } from '@lobechat/types';
import { TRPCError } from '@trpc/server';
import { and, asc, eq, sql } from 'drizzle-orm';
-import { agents, chatGroups, chatGroupsAgents, topics,topicShares } from '../schemas';
+import { agents, chatGroups, chatGroupsAgents, topics, topicShares } from '../schemas';
import type { LobeChatDatabase } from '../type';
export type TopicShareData = NonNullable<
@@ -130,7 +130,12 @@ export class TopicShareModel {
// Fetch group members if this is a group topic
let groupMembers:
- | { avatar: string | null; backgroundColor: string | null; id: string; title: string | null }[]
+ | {
+ avatar: string | null;
+ backgroundColor: string | null;
+ id: string;
+ title: string | null;
+ }[]
| undefined;
if (share.groupId) {
const members = await db
diff --git a/packages/database/src/models/user.ts b/packages/database/src/models/user.ts
index 5f4b3648028..e52ed58c515 100644
--- a/packages/database/src/models/user.ts
+++ b/packages/database/src/models/user.ts
@@ -14,15 +14,8 @@ import type { PartialDeep } from 'type-fest';
import { merge } from '@/utils/merge';
import { today } from '@/utils/time';
-import type {
- NewUser,
- UserItem,
- UserSettingsItem} from '../schemas';
-import {
- nextauthAccounts,
- users,
- userSettings
-} from '../schemas';
+import type { NewUser, UserItem, UserSettingsItem } from '../schemas';
+import { nextauthAccounts, users, userSettings } from '../schemas';
import type { LobeChatDatabase } from '../type';
type DecryptUserKeyVaults = (
diff --git a/packages/database/src/models/userMemory/__tests__/activity.test.ts b/packages/database/src/models/userMemory/__tests__/activity.test.ts
index b86e6cdd4f0..50e5340f0ac 100644
--- a/packages/database/src/models/userMemory/__tests__/activity.test.ts
+++ b/packages/database/src/models/userMemory/__tests__/activity.test.ts
@@ -2,13 +2,8 @@
import { beforeEach, describe, expect, it } from 'vitest';
import { getTestDB } from '../../../core/getTestDB';
-import type {
- NewUserMemoryActivity} from '../../../schemas';
-import {
- userMemories,
- userMemoriesActivities,
- users,
-} from '../../../schemas';
+import type { NewUserMemoryActivity } from '../../../schemas';
+import { userMemories, userMemoriesActivities, users } from '../../../schemas';
import type { LobeChatDatabase } from '../../../type';
import { UserMemoryActivityModel } from '../activity';
diff --git a/packages/database/src/models/userMemory/__tests__/context.test.ts b/packages/database/src/models/userMemory/__tests__/context.test.ts
index 3d75c062894..9391dd6c0bd 100644
--- a/packages/database/src/models/userMemory/__tests__/context.test.ts
+++ b/packages/database/src/models/userMemory/__tests__/context.test.ts
@@ -2,7 +2,7 @@
import { beforeEach, describe, expect, it } from 'vitest';
import { getTestDB } from '../../../core/getTestDB';
-import type { NewUserMemoryContext} from '../../../schemas';
+import type { NewUserMemoryContext } from '../../../schemas';
import { userMemories, userMemoriesContexts, users } from '../../../schemas';
import type { LobeChatDatabase } from '../../../type';
import { UserMemoryContextModel } from '../context';
diff --git a/packages/database/src/models/userMemory/__tests__/experience.test.ts b/packages/database/src/models/userMemory/__tests__/experience.test.ts
index 75b27b88876..8d68f12db19 100644
--- a/packages/database/src/models/userMemory/__tests__/experience.test.ts
+++ b/packages/database/src/models/userMemory/__tests__/experience.test.ts
@@ -2,13 +2,8 @@
import { beforeEach, describe, expect, it } from 'vitest';
import { getTestDB } from '../../../core/getTestDB';
-import type {
- NewUserMemoryExperience} from '../../../schemas';
-import {
- userMemories,
- userMemoriesExperiences,
- users,
-} from '../../../schemas';
+import type { NewUserMemoryExperience } from '../../../schemas';
+import { userMemories, userMemoriesExperiences, users } from '../../../schemas';
import type { LobeChatDatabase } from '../../../type';
import { UserMemoryExperienceModel } from '../experience';
diff --git a/packages/database/src/models/userMemory/__tests__/identity.test.ts b/packages/database/src/models/userMemory/__tests__/identity.test.ts
index f15e4f55394..fece6881ab4 100644
--- a/packages/database/src/models/userMemory/__tests__/identity.test.ts
+++ b/packages/database/src/models/userMemory/__tests__/identity.test.ts
@@ -3,13 +3,8 @@ import { RelationshipEnum } from '@lobechat/types';
import { beforeEach, describe, expect, it } from 'vitest';
import { getTestDB } from '../../../core/getTestDB';
-import type {
- NewUserMemoryIdentity} from '../../../schemas';
-import {
- userMemories,
- userMemoriesIdentities,
- users,
-} from '../../../schemas';
+import type { NewUserMemoryIdentity } from '../../../schemas';
+import { userMemories, userMemoriesIdentities, users } from '../../../schemas';
import type { LobeChatDatabase } from '../../../type';
import { UserMemoryIdentityModel } from '../identity';
diff --git a/packages/database/src/models/userMemory/__tests__/preference.test.ts b/packages/database/src/models/userMemory/__tests__/preference.test.ts
index 780fef32f9b..5e5b12ef2a2 100644
--- a/packages/database/src/models/userMemory/__tests__/preference.test.ts
+++ b/packages/database/src/models/userMemory/__tests__/preference.test.ts
@@ -2,13 +2,8 @@
import { beforeEach, describe, expect, it } from 'vitest';
import { getTestDB } from '../../../core/getTestDB';
-import type {
- NewUserMemoryPreference} from '../../../schemas';
-import {
- userMemories,
- userMemoriesPreferences,
- users,
-} from '../../../schemas';
+import type { NewUserMemoryPreference } from '../../../schemas';
+import { userMemories, userMemoriesPreferences, users } from '../../../schemas';
import type { LobeChatDatabase } from '../../../type';
import { UserMemoryPreferenceModel } from '../preference';
diff --git a/packages/database/src/models/userMemory/activity.ts b/packages/database/src/models/userMemory/activity.ts
index 0888270a154..f084621b2d3 100644
--- a/packages/database/src/models/userMemory/activity.ts
+++ b/packages/database/src/models/userMemory/activity.ts
@@ -1,14 +1,9 @@
import type { ActivityListParams, ActivityListResult } from '@lobechat/types';
-import type {SQL} from 'drizzle-orm';
-import { and, asc, desc, eq, ilike, inArray, or, sql } from 'drizzle-orm';
-
-import type {
- NewUserMemoryActivity,
- UserMemoryActivity} from '../../schemas';
-import {
- userMemories,
- userMemoriesActivities
-} from '../../schemas';
+import type { SQL } from 'drizzle-orm';
+import { and, asc, desc, eq, ilike, inArray, or, sql } from 'drizzle-orm';
+
+import type { NewUserMemoryActivity, UserMemoryActivity } from '../../schemas';
+import { userMemories, userMemoriesActivities } from '../../schemas';
import type { LobeChatDatabase } from '../../type';
export class UserMemoryActivityModel {
@@ -32,7 +27,10 @@ export class UserMemoryActivityModel {
delete = async (id: string) => {
return this.db.transaction(async (tx) => {
const activity = await tx.query.userMemoriesActivities.findFirst({
- where: and(eq(userMemoriesActivities.id, id), eq(userMemoriesActivities.userId, this.userId)),
+ where: and(
+ eq(userMemoriesActivities.id, id),
+ eq(userMemoriesActivities.userId, this.userId),
+ ),
});
if (!activity || !activity.userMemoryId) {
@@ -41,7 +39,9 @@ export class UserMemoryActivityModel {
await tx
.delete(userMemories)
- .where(and(eq(userMemories.id, activity.userMemoryId), eq(userMemories.userId, this.userId)));
+ .where(
+ and(eq(userMemories.id, activity.userMemoryId), eq(userMemories.userId, this.userId)),
+ );
return { success: true };
});
@@ -160,6 +160,8 @@ export class UserMemoryActivityModel {
return this.db
.update(userMemoriesActivities)
.set({ ...value, updatedAt: new Date() })
- .where(and(eq(userMemoriesActivities.id, id), eq(userMemoriesActivities.userId, this.userId)));
+ .where(
+ and(eq(userMemoriesActivities.id, id), eq(userMemoriesActivities.userId, this.userId)),
+ );
};
}
diff --git a/packages/database/src/models/userMemory/context.ts b/packages/database/src/models/userMemory/context.ts
index 2fee8a68210..e3fb656bba0 100644
--- a/packages/database/src/models/userMemory/context.ts
+++ b/packages/database/src/models/userMemory/context.ts
@@ -1,12 +1,7 @@
import { and, desc, eq } from 'drizzle-orm';
-import type {
- NewUserMemoryContext,
- UserMemoryContext} from '../../schemas';
-import {
- userMemories,
- userMemoriesContexts
-} from '../../schemas';
+import type { NewUserMemoryContext, UserMemoryContext } from '../../schemas';
+import { userMemories, userMemoriesContexts } from '../../schemas';
import type { LobeChatDatabase } from '../../type';
export class UserMemoryContextModel {
diff --git a/packages/database/src/models/userMemory/experience.ts b/packages/database/src/models/userMemory/experience.ts
index 67e66fd8fcc..e2da2a0ceda 100644
--- a/packages/database/src/models/userMemory/experience.ts
+++ b/packages/database/src/models/userMemory/experience.ts
@@ -1,14 +1,9 @@
import type { ExperienceListParams, ExperienceListResult } from '@lobechat/types';
-import type {SQL} from 'drizzle-orm';
-import { and, asc, desc, eq, ilike, inArray, or, sql } from 'drizzle-orm';
-
-import type {
- NewUserMemoryExperience,
- UserMemoryExperience} from '../../schemas';
-import {
- userMemories,
- userMemoriesExperiences
-} from '../../schemas';
+import type { SQL } from 'drizzle-orm';
+import { and, asc, desc, eq, ilike, inArray, or, sql } from 'drizzle-orm';
+
+import type { NewUserMemoryExperience, UserMemoryExperience } from '../../schemas';
+import { userMemories, userMemoriesExperiences } from '../../schemas';
import type { LobeChatDatabase } from '../../type';
export class UserMemoryExperienceModel {
diff --git a/packages/database/src/models/userMemory/identity.ts b/packages/database/src/models/userMemory/identity.ts
index 6c40d8f6993..675b9f11009 100644
--- a/packages/database/src/models/userMemory/identity.ts
+++ b/packages/database/src/models/userMemory/identity.ts
@@ -1,15 +1,10 @@
import type { IdentityListParams, IdentityListResult } from '@lobechat/types';
import { RelationshipEnum } from '@lobechat/types';
-import type {SQL} from 'drizzle-orm';
-import { and, asc, desc, eq, ilike, inArray, isNull, or, sql } from 'drizzle-orm';
-
-import type {
- NewUserMemoryIdentity,
- UserMemoryIdentity} from '../../schemas';
-import {
- userMemories,
- userMemoriesIdentities
-} from '../../schemas';
+import type { SQL } from 'drizzle-orm';
+import { and, asc, desc, eq, ilike, inArray, isNull, or, sql } from 'drizzle-orm';
+
+import type { NewUserMemoryIdentity, UserMemoryIdentity } from '../../schemas';
+import { userMemories, userMemoriesIdentities } from '../../schemas';
import type { LobeChatDatabase } from '../../type';
export class UserMemoryIdentityModel {
diff --git a/packages/database/src/models/userMemory/model.ts b/packages/database/src/models/userMemory/model.ts
index 8e58c7168c9..e153f3b2343 100644
--- a/packages/database/src/models/userMemory/model.ts
+++ b/packages/database/src/models/userMemory/model.ts
@@ -11,13 +11,14 @@ import type {
UserMemoryIdentityWithoutVectors,
UserMemoryItemSimple,
UserMemoryPreferenceWithoutVectors,
- UserMemoryWithoutVectors} from '@lobechat/types';
+ UserMemoryWithoutVectors,
+} from '@lobechat/types';
import {
ActivityTypeEnum,
IdentityTypeEnum,
LayersEnum,
MemorySourceType,
- RelationshipEnum
+ RelationshipEnum,
} from '@lobechat/types';
import type { AnyColumn, SQL } from 'drizzle-orm';
import {
@@ -43,14 +44,15 @@ import type {
UserMemoryExperience,
UserMemoryIdentity,
UserMemoryItem,
- UserMemoryPreference} from '../../schemas';
+ UserMemoryPreference,
+} from '../../schemas';
import {
userMemories,
userMemoriesActivities,
userMemoriesContexts,
userMemoriesExperiences,
userMemoriesIdentities,
- userMemoriesPreferences
+ userMemoriesPreferences,
} from '../../schemas';
import type { LobeChatDatabase } from '../../type';
import { selectNonVectorColumns } from '../../utils/columns';
diff --git a/packages/database/src/models/userMemory/preference.ts b/packages/database/src/models/userMemory/preference.ts
index 7ac0493f588..2d486ea51fc 100644
--- a/packages/database/src/models/userMemory/preference.ts
+++ b/packages/database/src/models/userMemory/preference.ts
@@ -1,12 +1,7 @@
import { and, desc, eq } from 'drizzle-orm';
-import type {
- NewUserMemoryPreference,
- UserMemoryPreference} from '../../schemas';
-import {
- userMemories,
- userMemoriesPreferences
-} from '../../schemas';
+import type { NewUserMemoryPreference, UserMemoryPreference } from '../../schemas';
+import { userMemories, userMemoriesPreferences } from '../../schemas';
import type { LobeChatDatabase } from '../../type';
export class UserMemoryPreferenceModel {
diff --git a/packages/database/src/models/userMemory/sources/__tests__/benchmarkLoCoMo.test.ts b/packages/database/src/models/userMemory/sources/__tests__/benchmarkLoCoMo.test.ts
index c4ab5903aa7..6b326ed94c2 100644
--- a/packages/database/src/models/userMemory/sources/__tests__/benchmarkLoCoMo.test.ts
+++ b/packages/database/src/models/userMemory/sources/__tests__/benchmarkLoCoMo.test.ts
@@ -1,7 +1,7 @@
-import { afterEach,beforeEach, describe, expect, it } from 'vitest';
+import { afterEach, beforeEach, describe, expect, it } from 'vitest';
-import type { BenchmarkLoCoMoPart} from '../benchmarkLoCoMo';
-import {UserMemorySourceBenchmarkLoCoMoModel } from '../benchmarkLoCoMo';
+import type { BenchmarkLoCoMoPart } from '../benchmarkLoCoMo';
+import { UserMemorySourceBenchmarkLoCoMoModel } from '../benchmarkLoCoMo';
describe('UserMemorySourceBenchmarkLoCoMoModel', () => {
const userId = 'test-user-1';
@@ -117,9 +117,7 @@ describe('UserMemorySourceBenchmarkLoCoMoModel', () => {
model.replaceParts(sourceId, initialParts);
- const newParts: BenchmarkLoCoMoPart[] = [
- { content: 'New Part 1', partIndex: 0 },
- ];
+ const newParts: BenchmarkLoCoMoPart[] = [{ content: 'New Part 1', partIndex: 0 }];
model.replaceParts(sourceId, newParts);
@@ -131,9 +129,7 @@ describe('UserMemorySourceBenchmarkLoCoMoModel', () => {
it('should delete parts when replacing with empty array', async () => {
const sourceId = 'source-delete-parts';
- const parts: BenchmarkLoCoMoPart[] = [
- { content: 'Part to delete', partIndex: 0 },
- ];
+ const parts: BenchmarkLoCoMoPart[] = [{ content: 'Part to delete', partIndex: 0 }];
model.replaceParts(sourceId, parts);
expect((await model.listParts(sourceId)).length).toBe(1);
@@ -146,9 +142,7 @@ describe('UserMemorySourceBenchmarkLoCoMoModel', () => {
const sourceId = 'source-normalize';
const beforeCreate = new Date();
- const parts: BenchmarkLoCoMoPart[] = [
- { content: 'Part without date', partIndex: 0 },
- ];
+ const parts: BenchmarkLoCoMoPart[] = [{ content: 'Part without date', partIndex: 0 }];
model.replaceParts(sourceId, parts);
diff --git a/packages/database/src/repositories/agentGroup/index.ts b/packages/database/src/repositories/agentGroup/index.ts
index 0081b0fb05b..cc8db0b7399 100644
--- a/packages/database/src/repositories/agentGroup/index.ts
+++ b/packages/database/src/repositories/agentGroup/index.ts
@@ -3,16 +3,8 @@ import type { AgentGroupDetail, AgentGroupMember } from '@lobechat/types';
import { cleanObject } from '@lobechat/utils';
import { and, eq, inArray } from 'drizzle-orm';
-import type {
- AgentItem,
- ChatGroupItem,
- NewChatGroup,
- NewChatGroupAgent} from '../../schemas';
-import {
- agents,
- chatGroups,
- chatGroupsAgents
-} from '../../schemas';
+import type { AgentItem, ChatGroupItem, NewChatGroup, NewChatGroupAgent } from '../../schemas';
+import { agents, chatGroups, chatGroupsAgents } from '../../schemas';
import type { LobeChatDatabase } from '../../type';
export interface SupervisorAgentConfig {
diff --git a/packages/database/src/repositories/aiInfra/index.ts b/packages/database/src/repositories/aiInfra/index.ts
index 3f6d507c9e4..6e55b45815d 100644
--- a/packages/database/src/repositories/aiInfra/index.ts
+++ b/packages/database/src/repositories/aiInfra/index.ts
@@ -6,13 +6,8 @@ import type {
ProviderConfig,
} from '@lobechat/types';
import { isEmpty } from 'es-toolkit/compat';
-import type {
- AIChatModelCard,
- AiProviderModelListItem,
- EnabledAiModel} from 'model-bank';
-import {
- AiModelSourceEnum
-} from 'model-bank';
+import type { AIChatModelCard, AiProviderModelListItem, EnabledAiModel } from 'model-bank';
+import { AiModelSourceEnum } from 'model-bank';
import * as modelBank from 'model-bank';
import { DEFAULT_MODEL_PROVIDER_LIST } from 'model-bank/modelProviders';
import pMap from 'p-map';
diff --git a/packages/database/src/repositories/compression/index.ts b/packages/database/src/repositories/compression/index.ts
index 3195b885f4f..caca9349c55 100644
--- a/packages/database/src/repositories/compression/index.ts
+++ b/packages/database/src/repositories/compression/index.ts
@@ -1,8 +1,8 @@
-import type { CompressionGroupMetadata} from '@lobechat/types';
+import type { CompressionGroupMetadata } from '@lobechat/types';
import { MessageGroupType } from '@lobechat/types';
import { and, eq, inArray, isNull } from 'drizzle-orm';
-import type { MessageGroupItem} from '../../schemas';
+import type { MessageGroupItem } from '../../schemas';
import { messageGroups, messages } from '../../schemas';
import type { LobeChatDatabase } from '../../type';
diff --git a/packages/database/src/repositories/dataExporter/index.ts b/packages/database/src/repositories/dataExporter/index.ts
index 8148c85c32b..5347e75600e 100644
--- a/packages/database/src/repositories/dataExporter/index.ts
+++ b/packages/database/src/repositories/dataExporter/index.ts
@@ -91,7 +91,6 @@ export class DataExporterRepos {
private removeUserId(data: any[]) {
return data.map((item) => {
-
const { userId: _, ...rest } = item;
return rest;
});
diff --git a/packages/database/src/repositories/dataImporter/index.ts b/packages/database/src/repositories/dataImporter/index.ts
index 427655dd68f..4c209f3b75d 100644
--- a/packages/database/src/repositories/dataImporter/index.ts
+++ b/packages/database/src/repositories/dataImporter/index.ts
@@ -1,4 +1,4 @@
-import type { ImporterEntryData,ImportPgDataStructure, ImportResultData } from '@lobechat/types';
+import type { ImporterEntryData, ImportPgDataStructure, ImportResultData } from '@lobechat/types';
import { and, eq, inArray } from 'drizzle-orm';
import { uuid } from '@/utils/uuid';
@@ -350,7 +350,7 @@ export class DataImporterRepos {
trx: any,
config: TableImportConfig,
tableData: any[],
-
+
_userConflictStrategy: ConflictStrategy,
): Promise<ImportResult> {
const {
@@ -458,7 +458,7 @@ export class DataImporterRepos {
// Decide how to process based on whether it's composite key and whether to preserve ID
if (isCompositeKey) {
// For composite key tables, don't include id field
-
+
const { id: _, ...rest } = item;
newRecord = {
...rest,
diff --git a/packages/database/src/repositories/knowledge/__tests__/index.test.ts b/packages/database/src/repositories/knowledge/__tests__/index.test.ts
index f5de7d83664..08949811597 100644
--- a/packages/database/src/repositories/knowledge/__tests__/index.test.ts
+++ b/packages/database/src/repositories/knowledge/__tests__/index.test.ts
@@ -196,9 +196,9 @@ describe('KnowledgeRepo', () => {
]);
// Add file to knowledge base
- await serverDB.insert(knowledgeBaseFiles).values([
- { fileId: 'file-in-kb', knowledgeBaseId: 'kb-1', userId },
- ]);
+ await serverDB
+ .insert(knowledgeBaseFiles)
+ .values([{ fileId: 'file-in-kb', knowledgeBaseId: 'kb-1', userId }]);
});
it('should return files and documents for current user', async () => {
diff --git a/packages/database/src/repositories/knowledge/index.test.ts b/packages/database/src/repositories/knowledge/index.test.ts
index 632a2b6b02d..fd47c3ba1e0 100644
--- a/packages/database/src/repositories/knowledge/index.test.ts
+++ b/packages/database/src/repositories/knowledge/index.test.ts
@@ -3,8 +3,8 @@ import { FilesTabs } from '@lobechat/types';
import { beforeEach, describe, expect, it } from 'vitest';
import { getTestDB } from '../../core/getTestDB';
-import type {NewDocument,NewFile } from '../../schemas/file';
-import { documents, files } from '../../schemas/file';
+import type { NewDocument, NewFile } from '../../schemas/file';
+import { documents, files } from '../../schemas/file';
import { users } from '../../schemas/user';
import type { LobeChatDatabase } from '../../type';
import { KnowledgeRepo } from './index';
diff --git a/packages/database/src/repositories/knowledge/index.ts b/packages/database/src/repositories/knowledge/index.ts
index feecdd5014f..0ab28d6f1b7 100644
--- a/packages/database/src/repositories/knowledge/index.ts
+++ b/packages/database/src/repositories/knowledge/index.ts
@@ -1,4 +1,4 @@
-import type { QueryFileListParams} from '@lobechat/types';
+import type { QueryFileListParams } from '@lobechat/types';
import { FilesTabs, SortType } from '@lobechat/types';
import { sql } from 'drizzle-orm';
diff --git a/packages/database/src/repositories/search/index.test.ts b/packages/database/src/repositories/search/index.test.ts
index a27c4c9a215..74db4e2baeb 100644
--- a/packages/database/src/repositories/search/index.test.ts
+++ b/packages/database/src/repositories/search/index.test.ts
@@ -3,12 +3,12 @@ import { beforeEach, describe, expect, it } from 'vitest';
import { getTestDB } from '../../core/getTestDB';
import { documents } from '../../schemas';
-import type {NewAgent } from '../../schemas/agent';
+import type { NewAgent } from '../../schemas/agent';
import { agents } from '../../schemas/agent';
-import type {NewFile } from '../../schemas/file';
+import type { NewFile } from '../../schemas/file';
import { files } from '../../schemas/file';
import { messages } from '../../schemas/message';
-import type { NewTopic} from '../../schemas/topic';
+import type { NewTopic } from '../../schemas/topic';
import { topics } from '../../schemas/topic';
import { users } from '../../schemas/user';
import type { LobeChatDatabase } from '../../type';
diff --git a/packages/database/src/schemas/agentCronJob.ts b/packages/database/src/schemas/agentCronJob.ts
index 8b8f1397d30..49e4379dd98 100644
--- a/packages/database/src/schemas/agentCronJob.ts
+++ b/packages/database/src/schemas/agentCronJob.ts
@@ -1,5 +1,5 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
-import type {ExecutionConditions} from '@lobechat/types';
+import type { ExecutionConditions } from '@lobechat/types';
import { boolean, index, integer, jsonb, pgTable, text, timestamp } from 'drizzle-orm/pg-core';
import { idGenerator } from '../utils/idGenerator';
diff --git a/packages/database/src/schemas/file.ts b/packages/database/src/schemas/file.ts
index 56f29794e6c..fc76478f119 100644
--- a/packages/database/src/schemas/file.ts
+++ b/packages/database/src/schemas/file.ts
@@ -1,7 +1,6 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import { isNotNull } from 'drizzle-orm';
-import type {
- AnyPgColumn} from 'drizzle-orm/pg-core';
+import type { AnyPgColumn } from 'drizzle-orm/pg-core';
import {
boolean,
index,
@@ -79,9 +78,9 @@ export const documents = pgTable(
// Associated file (optional)
// forward reference needs AnyPgColumn to avoid circular type inference
-
+
fileId: text('file_id').references((): AnyPgColumn => files.id, { onDelete: 'set null' }),
-
+
knowledgeBaseId: text('knowledge_base_id').references(() => knowledgeBases.id, {
onDelete: 'set null',
}),
diff --git a/packages/database/src/schemas/generation.ts b/packages/database/src/schemas/generation.ts
index 7b310cb6b6d..fdf1b152669 100644
--- a/packages/database/src/schemas/generation.ts
+++ b/packages/database/src/schemas/generation.ts
@@ -5,7 +5,7 @@ import { createInsertSchema } from 'drizzle-zod';
import { idGenerator } from '../utils/idGenerator';
import { timestamps } from './_helpers';
-import type {AsyncTaskSelectItem } from './asyncTask';
+import type { AsyncTaskSelectItem } from './asyncTask';
import { asyncTasks } from './asyncTask';
import { files } from './file';
import { users } from './user';
diff --git a/packages/database/src/schemas/message.ts b/packages/database/src/schemas/message.ts
index cc42df0f8e0..5efd8d1f2fe 100644
--- a/packages/database/src/schemas/message.ts
+++ b/packages/database/src/schemas/message.ts
@@ -49,7 +49,7 @@ export const messageGroups = pgTable(
}),
// Associated user message
-
+
parentMessageId: text('parent_message_id').references(() => messages.id, {
onDelete: 'cascade',
}),
diff --git a/packages/database/src/schemas/relations.ts b/packages/database/src/schemas/relations.ts
index b0c41cbdfb5..534c1f21a37 100644
--- a/packages/database/src/schemas/relations.ts
+++ b/packages/database/src/schemas/relations.ts
@@ -7,7 +7,7 @@ import { agents, agentsFiles, agentsKnowledgeBases } from './agent';
import { asyncTasks } from './asyncTask';
import { chatGroups, chatGroupsAgents } from './chatGroup';
import { documents, files, knowledgeBases } from './file';
-import { generationBatches, generations,generationTopics } from './generation';
+import { generationBatches, generations, generationTopics } from './generation';
import { messageGroups, messages, messagesFiles } from './message';
import { chunks, documentChunks, unstructuredChunks } from './rag';
import { sessionGroups, sessions } from './session';
diff --git a/packages/database/src/server/models/__tests__/user.test.ts b/packages/database/src/server/models/__tests__/user.test.ts
index d52ffde6785..ce2ce9fcf1f 100644
--- a/packages/database/src/server/models/__tests__/user.test.ts
+++ b/packages/database/src/server/models/__tests__/user.test.ts
@@ -11,7 +11,7 @@ import { getTestDB } from '../../../core/getTestDB';
import { SessionModel } from '../../../models/session';
import { UserModel, UserNotFoundError } from '../../../models/user';
import type { UserSettingsItem } from '../../../schemas';
-import { nextauthAccounts, users,userSettings } from '../../../schemas';
+import { nextauthAccounts, users, userSettings } from '../../../schemas';
const serverDB = await getTestDB();
diff --git a/packages/database/src/server/models/ragEval/dataset.ts b/packages/database/src/server/models/ragEval/dataset.ts
index a57538f6614..7f366d2ab9a 100644
--- a/packages/database/src/server/models/ragEval/dataset.ts
+++ b/packages/database/src/server/models/ragEval/dataset.ts
@@ -1,7 +1,7 @@
import type { RAGEvalDataSetItem } from '@lobechat/types';
import { and, desc, eq } from 'drizzle-orm';
-import type {NewEvalDatasetsItem } from '../../../schemas';
+import type { NewEvalDatasetsItem } from '../../../schemas';
import { evalDatasets } from '../../../schemas';
import type { LobeChatDatabase } from '../../../type';
diff --git a/packages/database/src/server/models/ragEval/datasetRecord.ts b/packages/database/src/server/models/ragEval/datasetRecord.ts
index 602427c1c69..d9c8997292b 100644
--- a/packages/database/src/server/models/ragEval/datasetRecord.ts
+++ b/packages/database/src/server/models/ragEval/datasetRecord.ts
@@ -1,7 +1,7 @@
import type { EvalDatasetRecordRefFile } from '@lobechat/types';
import { and, eq, inArray } from 'drizzle-orm';
-import type {NewEvalDatasetRecordsItem } from '../../../schemas';
+import type { NewEvalDatasetRecordsItem } from '../../../schemas';
import { evalDatasetRecords, files } from '../../../schemas';
import type { LobeChatDatabase } from '../../../type';
diff --git a/packages/database/src/server/models/ragEval/evaluation.ts b/packages/database/src/server/models/ragEval/evaluation.ts
index 3724de54b49..1f795abbc45 100644
--- a/packages/database/src/server/models/ragEval/evaluation.ts
+++ b/packages/database/src/server/models/ragEval/evaluation.ts
@@ -1,15 +1,10 @@
import type { RAGEvalEvaluationItem } from '@lobechat/types';
import { EvalEvaluationStatus } from '@lobechat/types';
-import type { SQL} from 'drizzle-orm';
+import type { SQL } from 'drizzle-orm';
import { and, count, desc, eq, inArray } from 'drizzle-orm';
-import type {
- NewEvalEvaluationItem} from '../../../schemas';
-import {
- evalDatasets,
- evalEvaluation,
- evaluationRecords,
-} from '../../../schemas';
+import type { NewEvalEvaluationItem } from '../../../schemas';
+import { evalDatasets, evalEvaluation, evaluationRecords } from '../../../schemas';
import type { LobeChatDatabase } from '../../../type';
export class EvalEvaluationModel {
diff --git a/packages/database/src/utils/genWhere.ts b/packages/database/src/utils/genWhere.ts
index 249328b223d..e3b12c7498d 100644
--- a/packages/database/src/utils/genWhere.ts
+++ b/packages/database/src/utils/genWhere.ts
@@ -1,6 +1,6 @@
import type { Dayjs } from 'dayjs';
import dayjs from 'dayjs';
-import type { SQL} from 'drizzle-orm';
+import type { SQL } from 'drizzle-orm';
import { and, gte, lte } from 'drizzle-orm';
export const genWhere = (sqls: (SQL<any> | undefined)[]): SQL<any> | undefined => {
diff --git a/packages/edge-config/src/index.ts b/packages/edge-config/src/index.ts
index 905673e9076..b34b3958a7d 100644
--- a/packages/edge-config/src/index.ts
+++ b/packages/edge-config/src/index.ts
@@ -1,10 +1,10 @@
-import type {EdgeConfigClient} from '@vercel/edge-config';
+import type { EdgeConfigClient } from '@vercel/edge-config';
import { createClient } from '@vercel/edge-config';
import createDebug from 'debug';
import { appEnv } from '@/envs/app';
-import type {EdgeConfigData, EdgeConfigKeys} from './types';
+import type { EdgeConfigData, EdgeConfigKeys } from './types';
const debug = createDebug('lobe-server:edge-config');
diff --git a/packages/editor-runtime/src/EditorRuntime.ts b/packages/editor-runtime/src/EditorRuntime.ts
index 34ea354d403..e60b1cd758c 100644
--- a/packages/editor-runtime/src/EditorRuntime.ts
+++ b/packages/editor-runtime/src/EditorRuntime.ts
@@ -1,6 +1,6 @@
-import type {PageContentContext} from '@lobechat/prompts';
-import type {IEditor} from '@lobehub/editor';
-import { LITEXML_APPLY_COMMAND, LITEXML_MODIFY_COMMAND } from '@lobehub/editor';
+import type { PageContentContext } from '@lobechat/prompts';
+import type { IEditor } from '@lobehub/editor';
+import { LITEXML_APPLY_COMMAND, LITEXML_MODIFY_COMMAND } from '@lobehub/editor';
import debug from 'debug';
import type {
diff --git a/packages/editor-runtime/src/__tests__/EditorRuntime.real.test.ts b/packages/editor-runtime/src/__tests__/EditorRuntime.real.test.ts
index 37dd510a753..47a6cd6400d 100644
--- a/packages/editor-runtime/src/__tests__/EditorRuntime.real.test.ts
+++ b/packages/editor-runtime/src/__tests__/EditorRuntime.real.test.ts
@@ -1,11 +1,11 @@
-import type {IEditor} from '@lobehub/editor';
+import type { IEditor } from '@lobehub/editor';
import {
CommonPlugin,
Kernel,
ListPlugin,
LitexmlPlugin,
MarkdownPlugin,
- moment
+ moment,
} from '@lobehub/editor';
import { beforeEach, describe, expect, it, vi } from 'vitest';
diff --git a/packages/editor-runtime/src/__tests__/EditorRuntime.test.ts b/packages/editor-runtime/src/__tests__/EditorRuntime.test.ts
index 67a627d4660..df8518ed18f 100644
--- a/packages/editor-runtime/src/__tests__/EditorRuntime.test.ts
+++ b/packages/editor-runtime/src/__tests__/EditorRuntime.test.ts
@@ -1,11 +1,5 @@
-import type {IEditor} from '@lobehub/editor';
-import {
- CommonPlugin,
- Kernel,
- LitexmlPlugin,
- MarkdownPlugin,
- moment
-} from '@lobehub/editor';
+import type { IEditor } from '@lobehub/editor';
+import { CommonPlugin, Kernel, LitexmlPlugin, MarkdownPlugin, moment } from '@lobehub/editor';
import { resetRandomKey } from 'lexical';
import { beforeEach, describe, expect, it, vi } from 'vitest';
diff --git a/packages/electron-client-ipc/src/events/index.ts b/packages/electron-client-ipc/src/events/index.ts
index 5dcb8b00829..1134fb3d679 100644
--- a/packages/electron-client-ipc/src/events/index.ts
+++ b/packages/electron-client-ipc/src/events/index.ts
@@ -7,7 +7,7 @@ import type { AutoUpdateBroadcastEvents } from './update';
/**
* main -> render broadcast events
*/
-
+
export interface MainBroadcastEvents
extends
AutoUpdateBroadcastEvents,
diff --git a/packages/electron-client-ipc/src/ipc.ts b/packages/electron-client-ipc/src/ipc.ts
index 2eaa592a955..8d63f1ea317 100644
--- a/packages/electron-client-ipc/src/ipc.ts
+++ b/packages/electron-client-ipc/src/ipc.ts
@@ -1,4 +1,3 @@
-
import type { StreamInvokeRequestParams } from './types';
type IpcInvoke = <T = unknown>(event: string, ...data: unknown[]) => Promise<T>;
@@ -47,7 +46,10 @@ declare global {
interface Window {
electronAPI?: {
invoke?: IpcInvoke;
- onStreamInvoke: (params: StreamInvokeRequestParams, callbacks: StreamerCallbacks) => () => void;
+ onStreamInvoke: (
+ params: StreamInvokeRequestParams,
+ callbacks: StreamerCallbacks,
+ ) => () => void;
};
}
}
diff --git a/packages/electron-client-ipc/src/streamInvoke.ts b/packages/electron-client-ipc/src/streamInvoke.ts
index d66ad81cec0..1e8961615c1 100644
--- a/packages/electron-client-ipc/src/streamInvoke.ts
+++ b/packages/electron-client-ipc/src/streamInvoke.ts
@@ -2,7 +2,6 @@ import type { ProxyTRPCStreamRequestParams } from './types';
import { headersToRecord } from './utils/headers';
import { getRequestBody } from './utils/request';
-
export const streamInvoke = async (input: RequestInfo | URL, init?: RequestInit) => {
const url = input.toString();
const parsedUrl = new URL(url, window.location.origin);
@@ -31,7 +30,7 @@ export const streamInvoke = async (input: RequestInfo | URL, init?: RequestInit)
cancel() {
// This will be called if the consumer of the stream calls .cancel()
// We should clean up the IPC listeners
-
+
cleanup?.();
},
start(controller) {
diff --git a/packages/electron-client-ipc/src/utils/headers.ts b/packages/electron-client-ipc/src/utils/headers.ts
index 9497226f50f..1fef671a5e0 100644
--- a/packages/electron-client-ipc/src/utils/headers.ts
+++ b/packages/electron-client-ipc/src/utils/headers.ts
@@ -3,7 +3,7 @@
* @param headersInit - Headers initialization object
* @returns Converted record object
*/
-
+
export const headersToRecord = (headersInit?: HeadersInit): Record<string, string> => {
const record: Record<string, string> = {};
if (!headersInit) {
diff --git a/packages/electron-client-ipc/src/utils/request.ts b/packages/electron-client-ipc/src/utils/request.ts
index f76d3bc3f83..21778cbb8ad 100644
--- a/packages/electron-client-ipc/src/utils/request.ts
+++ b/packages/electron-client-ipc/src/utils/request.ts
@@ -4,7 +4,6 @@
* @returns Converted request body data
*/
export const getRequestBody = async (
-
body?: BodyInit | null,
): Promise<string | ArrayBuffer | undefined> => {
if (!body) {
diff --git a/packages/electron-server-ipc/src/ipcClient.ts b/packages/electron-server-ipc/src/ipcClient.ts
index e74a589e7c2..c05f4e69977 100644
--- a/packages/electron-server-ipc/src/ipcClient.ts
+++ b/packages/electron-server-ipc/src/ipcClient.ts
@@ -15,7 +15,7 @@ export class ElectronIpcClient {
private socket: net.Socket | null = null;
// eslint-disable-next-line @typescript-eslint/ban-types
private requestQueue: Map<string, { reject: Function; resolve: Function }> = new Map();
-
+
private reconnectTimeout: NodeJS.Timeout | null = null;
private connectionAttempts: number = 0;
private maxConnectionAttempts: number = 5;
@@ -196,7 +196,6 @@ export class ElectronIpcClient {
const request = { id, method, params };
log('Created request with ID: %s', id);
-
let requestTimeoutId: NodeJS.Timeout;
const cleanupAndResolve = (value: T) => {
diff --git a/packages/fetch-sse/src/__tests__/fetchSSE.test.ts b/packages/fetch-sse/src/__tests__/fetchSSE.test.ts
index cda7d2bc2b6..3d8a8042b11 100644
--- a/packages/fetch-sse/src/__tests__/fetchSSE.test.ts
+++ b/packages/fetch-sse/src/__tests__/fetchSSE.test.ts
@@ -1,6 +1,6 @@
import { MESSAGE_CANCEL_FLAT } from '@lobechat/const';
import type { ChatMessageError } from '@lobechat/types';
-import type {FetchEventSourceInit} from '@lobechat/utils/client/fetchEventSource/index';
+import type { FetchEventSourceInit } from '@lobechat/utils/client/fetchEventSource/index';
import { fetchEventSource } from '@lobechat/utils/client/fetchEventSource/index';
import { sleep } from '@lobechat/utils/sleep';
import { afterEach, describe, expect, it, vi } from 'vitest';
diff --git a/packages/fetch-sse/src/fetchSSE.ts b/packages/fetch-sse/src/fetchSSE.ts
index 2c857f71156..8c9bed3a461 100644
--- a/packages/fetch-sse/src/fetchSSE.ts
+++ b/packages/fetch-sse/src/fetchSSE.ts
@@ -9,10 +9,9 @@ import type {
ModelReasoning,
ModelUsage,
ResponseAnimation,
- ResponseAnimationStyle} from '@lobechat/types';
-import {
- ChatErrorType
+ ResponseAnimationStyle,
} from '@lobechat/types';
+import { ChatErrorType } from '@lobechat/types';
import { fetchEventSource } from '@lobechat/utils/client/fetchEventSource/index';
import { nanoid } from '@lobechat/utils/uuid';
@@ -229,7 +228,7 @@ export const standardizeAnimationStyle = (
/**
* Fetch data using stream method
*/
-
+
export const fetchSSE = async (url: string, options: RequestInit & FetchSSEOptions = {}) => {
let toolCalls: undefined | MessageToolCall[];
let triggerOnMessageHandler = false;
diff --git a/packages/fetch-sse/src/headers.ts b/packages/fetch-sse/src/headers.ts
index a1aebf18870..23154c24f98 100644
--- a/packages/fetch-sse/src/headers.ts
+++ b/packages/fetch-sse/src/headers.ts
@@ -3,7 +3,7 @@
* @param headersInit - Headers initialization object
* @returns The converted record object
*/
-
+
export const headersToRecord = (headersInit?: HeadersInit): Record<string, string> => {
const record: Record<string, string> = {};
if (!headersInit) {
diff --git a/packages/fetch-sse/src/request.ts b/packages/fetch-sse/src/request.ts
index f76d3bc3f83..21778cbb8ad 100644
--- a/packages/fetch-sse/src/request.ts
+++ b/packages/fetch-sse/src/request.ts
@@ -4,7 +4,6 @@
* @returns Converted request body data
*/
export const getRequestBody = async (
-
body?: BodyInit | null,
): Promise<string | ArrayBuffer | undefined> => {
if (!body) {
diff --git a/packages/file-loaders/src/loaders/index.ts b/packages/file-loaders/src/loaders/index.ts
index 5cef52b68e0..93b52e445a5 100644
--- a/packages/file-loaders/src/loaders/index.ts
+++ b/packages/file-loaders/src/loaders/index.ts
@@ -24,7 +24,6 @@ const lazyFileLoaders: Record<SupportedFileType, LazyLoaderFactory> = {
// pdfjs-dist 5.x uses DOMMatrix at module initialization which doesn't exist in Node.js
if (typeof globalThis.DOMMatrix === 'undefined') {
try {
-
const canvas = require('@napi-rs/canvas');
globalThis.DOMMatrix = canvas.DOMMatrix;
globalThis.DOMPoint = canvas.DOMPoint;
diff --git a/packages/file-loaders/src/loaders/pptx/index.ts b/packages/file-loaders/src/loaders/pptx/index.ts
index 3a2800008f8..a6f8209ce66 100644
--- a/packages/file-loaders/src/loaders/pptx/index.ts
+++ b/packages/file-loaders/src/loaders/pptx/index.ts
@@ -3,8 +3,8 @@ import path from 'node:path';
import debug from 'debug';
import type { DocumentPage, FileLoaderInterface } from '../../types';
-import type {ExtractedFile} from '../../utils/parser-utils';
-import { extractFiles, parseString } from '../../utils/parser-utils';
+import type { ExtractedFile } from '../../utils/parser-utils';
+import { extractFiles, parseString } from '../../utils/parser-utils';
const log = debug('file-loaders:pptx');
diff --git a/packages/file-loaders/src/utils/parser-utils.test.ts b/packages/file-loaders/src/utils/parser-utils.test.ts
index 004cafd6998..be9c4fb0c0f 100644
--- a/packages/file-loaders/src/utils/parser-utils.test.ts
+++ b/packages/file-loaders/src/utils/parser-utils.test.ts
@@ -1,8 +1,8 @@
// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
-import type {ExtractedFile} from './parser-utils';
-import { extractFiles, parseString } from './parser-utils';
+import type { ExtractedFile } from './parser-utils';
+import { extractFiles, parseString } from './parser-utils';
describe('parser-utils', () => {
describe('parseString', () => {
diff --git a/packages/memory-user-memory/benchmarks/locomo/run.ts b/packages/memory-user-memory/benchmarks/locomo/run.ts
index 4247b9ef718..c6a2237f6c7 100644
--- a/packages/memory-user-memory/benchmarks/locomo/run.ts
+++ b/packages/memory-user-memory/benchmarks/locomo/run.ts
@@ -9,7 +9,8 @@ const benchmarkLoCoMoFile = process.env.MEMORY_USER_MEMORY_BENCHMARKS_LOCOMO_DAT
const webhookExtraHeaders = process.env.MEMORY_USER_MEMORY_WEBHOOK_HEADERS;
const post = async (path: string, body: unknown) => {
- const webhookHeaders = webhookExtraHeaders?.split(',')
+ const webhookHeaders = webhookExtraHeaders
+ ?.split(',')
.filter(Boolean)
.reduce<Record<string, string>>((acc, pair) => {
const [key, value] = pair.split('=').map((s) => s.trim());
@@ -71,12 +72,19 @@ async function main() {
userId,
};
try {
- console.log(`[@lobechat/memory-user-memory/benchmarks/locomo] ingesting sample ${payload.sampleId} (${payload.sessions.length} sessions) for user ${userId}`);
+ console.log(
+ `[@lobechat/memory-user-memory/benchmarks/locomo] ingesting sample ${payload.sampleId} (${payload.sessions.length} sessions) for user ${userId}`,
+ );
const res = await post('/api/webhooks/memory-extraction/benchmark-locomo', body);
- console.log(`[@lobechat/memory-user-memory/benchmarks/locomo] ingested sample ${payload.sampleId} -> insertedParts=${res.insertedParts ?? 'n/a'} memories=${res.extraction?.memoryIds?.length ?? 0} traceId=${res.extraction?.traceId ?? 'n/a'}`);
+ console.log(
+ `[@lobechat/memory-user-memory/benchmarks/locomo] ingested sample ${payload.sampleId} -> insertedParts=${res.insertedParts ?? 'n/a'} memories=${res.extraction?.memoryIds?.length ?? 0} traceId=${res.extraction?.traceId ?? 'n/a'}`,
+ );
} catch (err) {
- console.error(`[@lobechat/memory-user-memory/benchmarks/locomo] failed sample ${payload.sampleId}`, err);
+ console.error(
+ `[@lobechat/memory-user-memory/benchmarks/locomo] failed sample ${payload.sampleId}`,
+ err,
+ );
break;
}
}
@@ -88,7 +96,6 @@ async function main() {
);
}
-
main().catch((e) => {
console.error(e);
exit(1);
diff --git a/packages/memory-user-memory/promptfoo/evals/identity/with-s3-trace/buildMessages.ts b/packages/memory-user-memory/promptfoo/evals/identity/with-s3-trace/buildMessages.ts
index 655f99d3dc1..8dd78c93dd5 100644
--- a/packages/memory-user-memory/promptfoo/evals/identity/with-s3-trace/buildMessages.ts
+++ b/packages/memory-user-memory/promptfoo/evals/identity/with-s3-trace/buildMessages.ts
@@ -38,7 +38,10 @@ export const buildIdentityDedupeMessages = async (vars: PromptVars) => {
const traceRaw = await readFile(vars.tracePath, 'utf8');
const trace = JSON.parse(traceRaw) as TracePayload;
- const promptTemplate = await readFile(join(process.cwd(), 'src/prompts/layers/identity.md'), 'utf8');
+ const promptTemplate = await readFile(
+ join(process.cwd(), 'src/prompts/layers/identity.md'),
+ 'utf8',
+ );
const retrievedContexts = trace.contexts?.trimmed?.retrievedContexts ?? [];
const existingIdentitiesContext = trace.contexts?.trimmed?.retrievedIdentitiesContext ?? '';
@@ -64,4 +67,3 @@ export const buildIdentityDedupeMessages = async (vars: PromptVars) => {
{ content: rendered, role: 'user' },
];
};
-
diff --git a/packages/memory-user-memory/promptfoo/evals/identity/with-s3-trace/tests/cases.ts b/packages/memory-user-memory/promptfoo/evals/identity/with-s3-trace/tests/cases.ts
index 480dab33c45..cab39015bfb 100644
--- a/packages/memory-user-memory/promptfoo/evals/identity/with-s3-trace/tests/cases.ts
+++ b/packages/memory-user-memory/promptfoo/evals/identity/with-s3-trace/tests/cases.ts
@@ -1,4 +1,4 @@
-import { readdirSync,readFileSync } from 'node:fs';
+import { readdirSync, readFileSync } from 'node:fs';
import { basename, dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
@@ -40,7 +40,9 @@ const testCases: PromptfooTestCase[] = readdirSync(tracesDir)
.filter((file) => file.endsWith('.json'))
.map((file) => {
const tracePath = join(tracesDir, file);
- const tracePayload = JSON.parse(readFileSync(tracePath, 'utf8')) as MemoryExtractionTracePayload;
+ const tracePayload = JSON.parse(
+ readFileSync(tracePath, 'utf8'),
+ ) as MemoryExtractionTracePayload;
return {
assert: [identityShouldDedupe],
diff --git a/packages/memory-user-memory/scripts/generate-response-formats.ts b/packages/memory-user-memory/scripts/generate-response-formats.ts
index 6351bd65925..426a6985d8f 100644
--- a/packages/memory-user-memory/scripts/generate-response-formats.ts
+++ b/packages/memory-user-memory/scripts/generate-response-formats.ts
@@ -1,4 +1,3 @@
-
import { mkdir, writeFile } from 'node:fs/promises';
import { join } from 'node:path';
import { exit } from 'node:process';
@@ -26,12 +25,12 @@ const writeSchema = async (name: string, schema: any, description: string) => {
const outPath = join(OUTPUT_DIR, `${name}.json`);
await writeFile(outPath, JSON.stringify(responseFormat, null, 2), 'utf8');
-
+
console.log(`Wrote ${outPath}`);
};
const writeGenerateObjectSchema = async (name: string, generateSchema: GenerateObjectSchema) => {
- const responseFormat: { json_schema: GenerateObjectSchema, type: 'json_schema' } = {
+ const responseFormat: { json_schema: GenerateObjectSchema; type: 'json_schema' } = {
json_schema: {
name: generateSchema.name || name,
schema: generateSchema.schema,
@@ -42,7 +41,7 @@ const writeGenerateObjectSchema = async (name: string, generateSchema: GenerateO
const outPath = join(OUTPUT_DIR, `${name}.json`);
await writeFile(outPath, JSON.stringify(responseFormat, null, 2), 'utf8');
-
+
console.log(`Wrote ${outPath}`);
};
@@ -57,7 +56,6 @@ async function main() {
}
main().catch((err) => {
-
console.error(err);
exit(1);
});
diff --git a/packages/memory-user-memory/src/converters/locomo.ts b/packages/memory-user-memory/src/converters/locomo.ts
index 716d98051e7..880e6a5befd 100644
--- a/packages/memory-user-memory/src/converters/locomo.ts
+++ b/packages/memory-user-memory/src/converters/locomo.ts
@@ -79,7 +79,9 @@ const parseDate = (value?: string) => {
if (parsed.isValid()) return parsed.toISOString();
}
- console.warn(`[locomo converter] failed to parse date "${value}" with custom format, falling back to Date parser`);
+ console.warn(
+ `[locomo converter] failed to parse date "${value}" with custom format, falling back to Date parser`,
+ );
const fallback = new Date(value);
return Number.isNaN(fallback.getTime()) ? undefined : fallback.toISOString();
};
@@ -98,7 +100,7 @@ const buildTurnText = (turn: LocomoTurn, includeImageCaptions?: boolean) => {
};
const extractSessions = (conversation: Record<string, unknown>): LocomoSession[] => {
- const sessions: { order: number, session: LocomoSession; }[] = [];
+ const sessions: { order: number; session: LocomoSession }[] = [];
Object.entries(conversation).forEach(([key, value]) => {
const match = key.match(SESSION_KEY_REGEX);
@@ -110,9 +112,7 @@ const extractSessions = (conversation: Record<string, unknown>): LocomoSession[]
sessions.push({ order: Number.parseInt(match[1], 10), session: { dateTime, id: key, turns } });
});
- return sessions
- .sort((a, b) => a.order - b.order)
- .map(({ session }) => session);
+ return sessions.sort((a, b) => a.order - b.order).map(({ session }) => session);
};
const resolveRole = (
@@ -137,24 +137,28 @@ export const buildIngestPayload = (
const sessions = extractSessions(sample.conversation);
const sessionPayloads: IngestSessionPayload[] = sessions.map((session) => {
if (!session.dateTime) {
- console.warn(`[locomo converter] session ${session.id} is missing dateTime, turns will have no createdAt`);
+ console.warn(
+ `[locomo converter] session ${session.id} is missing dateTime, turns will have no createdAt`,
+ );
}
- console.log(`[locomo converter] processing sample ${sample.sample_id} session ${session.id} (on ${session.dateTime ?? 'unknown dateTime'}) with ${session.turns.length} turns`);
+ console.log(
+ `[locomo converter] processing sample ${sample.sample_id} session ${session.id} (on ${session.dateTime ?? 'unknown dateTime'}) with ${session.turns.length} turns`,
+ );
return {
- sessionId: session.id,
- timestamp: parseDate(session.dateTime),
- turns: session.turns.map((turn) => ({
- createdAt: parseDate(session.dateTime),
- diaId: turn.dia_id,
- imageCaption: normalizeArray(turn.blip_caption).join('\n') || undefined,
- imageUrls: normalizeArray(turn.img_url).length ? normalizeArray(turn.img_url) : undefined,
- role: resolveRole(turn.speaker, speakerA, speakerB, options.speakerRoles),
- speaker: turn.speaker,
- text: buildTurnText(turn, options.includeImageCaptions),
- })),
- }
+ sessionId: session.id,
+ timestamp: parseDate(session.dateTime),
+ turns: session.turns.map((turn) => ({
+ createdAt: parseDate(session.dateTime),
+ diaId: turn.dia_id,
+ imageCaption: normalizeArray(turn.blip_caption).join('\n') || undefined,
+ imageUrls: normalizeArray(turn.img_url).length ? normalizeArray(turn.img_url) : undefined,
+ role: resolveRole(turn.speaker, speakerA, speakerB, options.speakerRoles),
+ speaker: turn.speaker,
+ text: buildTurnText(turn, options.includeImageCaptions),
+ })),
+ };
});
return {
@@ -179,7 +183,5 @@ export const loadLocomoFile = (filePath: string): LocomoQASample[] => {
return parsed as LocomoQASample[];
};
-export const convertLocomoFile = (
- filePath: string,
- options: BuildIngestOptions,
-): IngestPayload[] => loadLocomoFile(filePath).map((sample) => buildIngestPayload(sample, options));
+export const convertLocomoFile = (filePath: string, options: BuildIngestOptions): IngestPayload[] =>
+ loadLocomoFile(filePath).map((sample) => buildIngestPayload(sample, options));
diff --git a/packages/memory-user-memory/src/extractors/activity.ts b/packages/memory-user-memory/src/extractors/activity.ts
index 02b60a586fc..f0cb43bac10 100644
--- a/packages/memory-user-memory/src/extractors/activity.ts
+++ b/packages/memory-user-memory/src/extractors/activity.ts
@@ -1,7 +1,7 @@
import { renderPlaceholderTemplate } from '@lobechat/context-engine';
import { activityPrompt } from '../prompts';
-import type { ActivityMemory} from '../schemas';
+import type { ActivityMemory } from '../schemas';
import { ActivityMemorySchema } from '../schemas';
import type { ExtractorTemplateProps } from '../types';
import { BaseMemoryExtractor } from './base';
diff --git a/packages/memory-user-memory/src/extractors/base.ts b/packages/memory-user-memory/src/extractors/base.ts
index 09431133398..f7c09bb52df 100644
--- a/packages/memory-user-memory/src/extractors/base.ts
+++ b/packages/memory-user-memory/src/extractors/base.ts
@@ -1,5 +1,10 @@
import { renderPlaceholderTemplate } from '@lobechat/context-engine';
-import type { ChatCompletionTool, GenerateObjectPayload, GenerateObjectSchema, ModelRuntime } from '@lobechat/model-runtime';
+import type {
+ ChatCompletionTool,
+ GenerateObjectPayload,
+ GenerateObjectSchema,
+ ModelRuntime,
+} from '@lobechat/model-runtime';
import { SpanStatusCode } from '@lobechat/observability-otel/api';
import {
ATTR_GEN_AI_OPERATION_NAME,
@@ -58,7 +63,6 @@ export abstract class BaseMemoryExtractor<
}
protected abstract getResultSchema(): z.ZodType<TOutput> | undefined;
-
protected getSchema(_options: TExtractorTemplateProps): GenerateObjectSchema | undefined {
const schema = this.getResultSchema();
if (!schema) return undefined;
@@ -76,7 +80,6 @@ export abstract class BaseMemoryExtractor<
} satisfies TemplateProps;
}
-
protected getTools(_options: TExtractorTemplateProps): ChatCompletionTool[] | undefined {
return undefined;
}
diff --git a/packages/memory-user-memory/src/extractors/context.ts b/packages/memory-user-memory/src/extractors/context.ts
index c675a2cf543..7959139cb5b 100644
--- a/packages/memory-user-memory/src/extractors/context.ts
+++ b/packages/memory-user-memory/src/extractors/context.ts
@@ -1,7 +1,7 @@
import { renderPlaceholderTemplate } from '@lobechat/context-engine';
import { contextPrompt } from '../prompts';
-import type { ContextMemory} from '../schemas';
+import type { ContextMemory } from '../schemas';
import { ContextMemorySchema } from '../schemas';
import type { ExtractorTemplateProps } from '../types';
import { buildGenerateObjectSchema } from '../utils/zod';
diff --git a/packages/memory-user-memory/src/extractors/experience.ts b/packages/memory-user-memory/src/extractors/experience.ts
index d0160b64b3e..3bd7f97e48d 100644
--- a/packages/memory-user-memory/src/extractors/experience.ts
+++ b/packages/memory-user-memory/src/extractors/experience.ts
@@ -1,7 +1,7 @@
import { renderPlaceholderTemplate } from '@lobechat/context-engine';
import { experiencePrompt } from '../prompts';
-import type { ExperienceMemory} from '../schemas';
+import type { ExperienceMemory } from '../schemas';
import { ExperienceMemorySchema } from '../schemas';
import type { ExtractorTemplateProps } from '../types';
import { buildGenerateObjectSchema } from '../utils/zod';
diff --git a/packages/memory-user-memory/src/extractors/gatekeeper.ts b/packages/memory-user-memory/src/extractors/gatekeeper.ts
index 817be7d47de..d0e733ab1a9 100644
--- a/packages/memory-user-memory/src/extractors/gatekeeper.ts
+++ b/packages/memory-user-memory/src/extractors/gatekeeper.ts
@@ -2,7 +2,7 @@ import { renderPlaceholderTemplate } from '@lobechat/context-engine';
import type { GenerateObjectSchema } from '@lobechat/model-runtime';
import { gatekeeperPrompt } from '../prompts';
-import type { GatekeeperResult} from '../schemas';
+import type { GatekeeperResult } from '../schemas';
import { GatekeeperResultSchema } from '../schemas';
import type { GatekeeperOptions } from '../types';
import { BaseMemoryExtractor } from './base';
diff --git a/packages/memory-user-memory/src/extractors/identity.ts b/packages/memory-user-memory/src/extractors/identity.ts
index 303f1efa30a..6cd61df1e2f 100644
--- a/packages/memory-user-memory/src/extractors/identity.ts
+++ b/packages/memory-user-memory/src/extractors/identity.ts
@@ -1,7 +1,7 @@
import { renderPlaceholderTemplate } from '@lobechat/context-engine';
import { identityPrompt } from '../prompts';
-import type { IdentityActions} from '../schemas';
+import type { IdentityActions } from '../schemas';
import { IdentityActionsSchema } from '../schemas';
import type { ExtractorOptions, ExtractorTemplateProps } from '../types';
import { buildGenerateObjectSchema } from '../utils/zod';
diff --git a/packages/memory-user-memory/src/extractors/persona.ts b/packages/memory-user-memory/src/extractors/persona.ts
index 1e5aee911c5..b76f460ad56 100644
--- a/packages/memory-user-memory/src/extractors/persona.ts
+++ b/packages/memory-user-memory/src/extractors/persona.ts
@@ -40,7 +40,6 @@ export class UserPersonaExtractor extends BaseMemoryExtractor<
return undefined;
}
-
protected getTools(_options: PersonaTemplateProps) {
return [
{
diff --git a/packages/memory-user-memory/src/extractors/preference.ts b/packages/memory-user-memory/src/extractors/preference.ts
index 3af1e9f2415..aac7cd03e32 100644
--- a/packages/memory-user-memory/src/extractors/preference.ts
+++ b/packages/memory-user-memory/src/extractors/preference.ts
@@ -1,7 +1,7 @@
import { renderPlaceholderTemplate } from '@lobechat/context-engine';
import { preferencePrompt } from '../prompts';
-import type { PreferenceMemory} from '../schemas';
+import type { PreferenceMemory } from '../schemas';
import { PreferenceMemorySchema } from '../schemas';
import type { ExtractorTemplateProps } from '../types';
import { buildGenerateObjectSchema } from '../utils/zod';
diff --git a/packages/memory-user-memory/src/providers/existingUserMemory.test.ts b/packages/memory-user-memory/src/providers/existingUserMemory.test.ts
index be6e4a86031..81312ad865f 100644
--- a/packages/memory-user-memory/src/providers/existingUserMemory.test.ts
+++ b/packages/memory-user-memory/src/providers/existingUserMemory.test.ts
@@ -40,7 +40,6 @@ describe('RetrievalUserMemoryContextProvider', () => {
updatedAt: new Date(),
userId: 'user-1',
userMemoryId: 'mem-act-1',
-
} as any,
],
contexts: [
@@ -62,7 +61,6 @@ describe('RetrievalUserMemoryContextProvider', () => {
userId: 'user-1',
userMemoryIds: ['mem-1'],
// similarity is appended by retrieval pipeline
-
} as any,
],
experiences: [
@@ -85,7 +83,6 @@ describe('RetrievalUserMemoryContextProvider', () => {
updatedAt: new Date(),
userId: 'user-1',
userMemoryId: 'mem-2',
-
} as any,
],
preferences: [
@@ -103,7 +100,6 @@ describe('RetrievalUserMemoryContextProvider', () => {
updatedAt: new Date(),
userId: 'user-1',
userMemoryId: 'mem-3',
-
} as any,
],
},
diff --git a/packages/memory-user-memory/src/schemas/activity.ts b/packages/memory-user-memory/src/schemas/activity.ts
index a3c887bf7c5..8e6ffab5b78 100644
--- a/packages/memory-user-memory/src/schemas/activity.ts
+++ b/packages/memory-user-memory/src/schemas/activity.ts
@@ -1,7 +1,7 @@
import type { GenerateObjectSchema } from '@lobechat/model-runtime';
-import type { LayersEnum} from '@lobechat/types';
+import type { LayersEnum } from '@lobechat/types';
import { ActivityTypeEnum, TypesEnum } from '@lobechat/types';
-import type {JSONSchema7} from 'json-schema';
+import type { JSONSchema7 } from 'json-schema';
import { z } from 'zod';
import { MemoryTypeSchema } from './common';
diff --git a/packages/memory-user-memory/src/types.ts b/packages/memory-user-memory/src/types.ts
index 85298101326..7148732460f 100644
--- a/packages/memory-user-memory/src/types.ts
+++ b/packages/memory-user-memory/src/types.ts
@@ -61,7 +61,6 @@ export interface GatekeeperTemplateProps extends ExtractorTemplateProps {
gateKeeperLanguage?: string;
}
-
export type GatekeeperOptions = Pick<ExtractorOptions, 'retrievedContexts' | 'topK'> & {
additionalMessages?: OpenAIChatMessage[];
callbacks?: ExtractorOptions['callbacks'];
@@ -99,7 +98,6 @@ export interface MemoryExtractionSourceMetadata {
version?: string;
}
-
export type ContextOptions<P extends Record<string, unknown>> = P;
export interface BuiltContext<T = Record<string, unknown>> {
diff --git a/packages/model-bank/src/aiModels/ai21.ts b/packages/model-bank/src/aiModels/ai21.ts
index 845fe423acb..82afceb6f1d 100644
--- a/packages/model-bank/src/aiModels/ai21.ts
+++ b/packages/model-bank/src/aiModels/ai21.ts
@@ -6,7 +6,8 @@ const ai21ChatModels: AIChatModelCard[] = [
functionCall: true,
},
contextWindowTokens: 256_000,
- description: 'The most efficient model in its class, balancing speed and quality with a smaller footprint.',
+ description:
+ 'The most efficient model in its class, balancing speed and quality with a smaller footprint.',
displayName: 'Jamba Mini',
enabled: true,
id: 'jamba-mini',
diff --git a/packages/model-bank/src/aiModels/ai360.ts b/packages/model-bank/src/aiModels/ai360.ts
index b7628861678..5e2c987f1ed 100644
--- a/packages/model-bank/src/aiModels/ai360.ts
+++ b/packages/model-bank/src/aiModels/ai360.ts
@@ -85,7 +85,8 @@ const ai360ChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 16_000,
- description: 'A translation-specialized model, deeply fine-tuned for leading translation quality.',
+ description:
+ 'A translation-specialized model, deeply fine-tuned for leading translation quality.',
displayName: '360GPT Pro Trans',
id: '360gpt-pro-trans',
pricing: {
diff --git a/packages/model-bank/src/aiModels/azureai.ts b/packages/model-bank/src/aiModels/azureai.ts
index 543618a8b13..5cb6e00e902 100644
--- a/packages/model-bank/src/aiModels/azureai.ts
+++ b/packages/model-bank/src/aiModels/azureai.ts
@@ -81,7 +81,8 @@ const azureChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 1_047_576,
- description: 'GPT-4.1 is our flagship model for complex tasks, ideal for cross-domain problem solving.',
+ description:
+ 'GPT-4.1 is our flagship model for complex tasks, ideal for cross-domain problem solving.',
displayName: 'GPT-4.1',
enabled: true,
id: 'gpt-4.1',
diff --git a/packages/model-bank/src/aiModels/bfl.ts b/packages/model-bank/src/aiModels/bfl.ts
index 1c8f8f49ad9..2b991104177 100644
--- a/packages/model-bank/src/aiModels/bfl.ts
+++ b/packages/model-bank/src/aiModels/bfl.ts
@@ -1,4 +1,4 @@
-import type { ModelParamsSchema} from '../standard-parameters';
+import type { ModelParamsSchema } from '../standard-parameters';
import { PRESET_ASPECT_RATIOS } from '../standard-parameters';
import type { AIImageModelCard } from '../types';
diff --git a/packages/model-bank/src/aiModels/cometapi.ts b/packages/model-bank/src/aiModels/cometapi.ts
index 0acb349f68e..343d824ca1d 100644
--- a/packages/model-bank/src/aiModels/cometapi.ts
+++ b/packages/model-bank/src/aiModels/cometapi.ts
@@ -218,7 +218,7 @@ const cometapiChatModels: AIChatModelCard[] = [
abilities: { functionCall: true, vision: true },
contextWindowTokens: 1_114_112,
description:
- "Gemini 2.5 Pro is Google’s most advanced reasoning model, able to reason over code, math, and STEM problems and analyze large datasets, codebases, and documents with long context.",
+ 'Gemini 2.5 Pro is Google’s most advanced reasoning model, able to reason over code, math, and STEM problems and analyze large datasets, codebases, and documents with long context.',
displayName: 'Gemini 2.5 Pro',
enabled: true,
id: 'gemini-2.5-pro',
@@ -230,7 +230,7 @@ const cometapiChatModels: AIChatModelCard[] = [
abilities: { functionCall: true, vision: true },
contextWindowTokens: 65_536,
description:
- "Gemini 2.5 Flash is Google’s fast-response reasoning model, able to reason over code, math, and STEM problems and analyze large datasets, codebases, and documents with long context.",
+ 'Gemini 2.5 Flash is Google’s fast-response reasoning model, able to reason over code, math, and STEM problems and analyze large datasets, codebases, and documents with long context.',
displayName: 'Gemini 2.5 flash',
enabled: true,
id: 'gemini-2.5-flash',
@@ -264,7 +264,7 @@ const cometapiChatModels: AIChatModelCard[] = [
{
abilities: { functionCall: true, vision: true },
contextWindowTokens: 131_072,
- description: "xAI’s Grok 4 with strong reasoning capability.",
+ description: 'xAI’s Grok 4 with strong reasoning capability.',
displayName: 'Grok 4',
enabled: true,
id: 'grok-4-0709',
@@ -274,7 +274,7 @@ const cometapiChatModels: AIChatModelCard[] = [
{
abilities: { functionCall: true, vision: true },
contextWindowTokens: 131_072,
- description: "xAI’s Grok 3 with strong reasoning capability.",
+ description: 'xAI’s Grok 3 with strong reasoning capability.',
displayName: 'Grok 3',
enabled: true,
id: 'grok-3',
@@ -284,7 +284,7 @@ const cometapiChatModels: AIChatModelCard[] = [
{
abilities: { functionCall: true, vision: true },
contextWindowTokens: 100_000,
- description: "xAI’s Grok 3 Mini with strong reasoning and fast responses.",
+ description: 'xAI’s Grok 3 Mini with strong reasoning and fast responses.',
displayName: 'Grok 3 Mini',
enabled: true,
id: 'grok-3-mini',
diff --git a/packages/model-bank/src/aiModels/comfyui.ts b/packages/model-bank/src/aiModels/comfyui.ts
index 53e2fb234bd..2153f60af3e 100644
--- a/packages/model-bank/src/aiModels/comfyui.ts
+++ b/packages/model-bank/src/aiModels/comfyui.ts
@@ -1,4 +1,4 @@
-import type { ModelParamsSchema} from '../standard-parameters';
+import type { ModelParamsSchema } from '../standard-parameters';
import { PRESET_ASPECT_RATIOS } from '../standard-parameters';
import type { AIImageModelCard } from '../types';
diff --git a/packages/model-bank/src/aiModels/fireworksai.ts b/packages/model-bank/src/aiModels/fireworksai.ts
index 49ed1b67cf2..9fa2cb4d766 100644
--- a/packages/model-bank/src/aiModels/fireworksai.ts
+++ b/packages/model-bank/src/aiModels/fireworksai.ts
@@ -159,7 +159,8 @@ const fireworksaiChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 32_768,
- description: 'A 24B-parameter model with state-of-the-art capability comparable to larger models.',
+ description:
+ 'A 24B-parameter model with state-of-the-art capability comparable to larger models.',
displayName: 'Mistral Small 3 Instruct',
enabled: true,
id: 'accounts/fireworks/models/mistral-small-24b-instruct-2501',
diff --git a/packages/model-bank/src/aiModels/github.ts b/packages/model-bank/src/aiModels/github.ts
index adf774afb72..f547336be41 100644
--- a/packages/model-bank/src/aiModels/github.ts
+++ b/packages/model-bank/src/aiModels/github.ts
@@ -52,7 +52,8 @@ const githubChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 1_047_576,
- description: 'GPT-4.1 is our flagship model for complex tasks, ideal for cross-domain problem solving.',
+ description:
+ 'GPT-4.1 is our flagship model for complex tasks, ideal for cross-domain problem solving.',
displayName: 'GPT-4.1',
enabled: true,
id: 'openai/gpt-4.1',
@@ -208,7 +209,8 @@ const githubChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 134_144,
- description: 'The most advanced multimodal model in the GPT-4 family, handling text and image inputs.',
+ description:
+ 'The most advanced multimodal model in the GPT-4 family, handling text and image inputs.',
displayName: 'GPT-4o',
id: 'openai/gpt-4o',
maxOutput: 16_384,
@@ -317,7 +319,8 @@ const githubChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 131_072,
- description: 'Mistral Small is suitable for any language-based task requiring high efficiency and low latency.',
+ description:
+ 'Mistral Small is suitable for any language-based task requiring high efficiency and low latency.',
displayName: 'Mistral Small',
id: 'mistral-ai/mistral-small-2503',
maxOutput: 4096,
@@ -344,7 +347,8 @@ const githubChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 131_072,
- description: 'Strong image reasoning on high-resolution images, suited for visual understanding apps.',
+ description:
+ 'Strong image reasoning on high-resolution images, suited for visual understanding apps.',
displayName: 'Llama 3.2 11B Vision',
id: 'meta/Llama-3.2-11B-Vision-Instruct',
maxOutput: 4096,
@@ -424,7 +428,8 @@ const githubChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 8192,
- description: 'A powerful 70B-parameter model that excels at reasoning, coding, and broad language tasks.',
+ description:
+ 'A powerful 70B-parameter model that excels at reasoning, coding, and broad language tasks.',
displayName: 'Meta Llama 3 70B',
id: 'meta/Meta-Llama-3-70B-Instruct',
maxOutput: 4096,
@@ -473,7 +478,8 @@ const githubChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 131_072,
- description: 'The same Phi-3-mini model with a larger context window for RAG or few-shot prompts.',
+ description:
+ 'The same Phi-3-mini model with a larger context window for RAG or few-shot prompts.',
displayName: 'Phi-3-mini 128K',
id: 'microsoft/Phi-3-mini-128k-instruct',
maxOutput: 4096,
@@ -490,7 +496,8 @@ const githubChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 131_072,
- description: 'The same Phi-3-small model with a larger context window for RAG or few-shot prompts.',
+ description:
+ 'The same Phi-3-small model with a larger context window for RAG or few-shot prompts.',
displayName: 'Phi-3-small 128K',
id: 'microsoft/Phi-3-small-128k-instruct',
maxOutput: 4096,
@@ -507,7 +514,8 @@ const githubChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 131_072,
- description: 'The same Phi-3-medium model with a larger context window for RAG or few-shot prompts.',
+ description:
+ 'The same Phi-3-medium model with a larger context window for RAG or few-shot prompts.',
displayName: 'Phi-3-medium 128K',
id: 'microsoft/Phi-3-medium-128k-instruct',
maxOutput: 4096,
diff --git a/packages/model-bank/src/aiModels/higress.ts b/packages/model-bank/src/aiModels/higress.ts
index f52c3e8975d..7ff5c80e1ce 100644
--- a/packages/model-bank/src/aiModels/higress.ts
+++ b/packages/model-bank/src/aiModels/higress.ts
@@ -24,7 +24,8 @@ const higressChatModels: AIChatModelCard[] = [
functionCall: true,
},
contextWindowTokens: 131_072,
- description: 'Enhanced ultra-large Qwen model supporting Chinese, English, and other languages.',
+ description:
+ 'Enhanced ultra-large Qwen model supporting Chinese, English, and other languages.',
displayName: 'Qwen Plus',
enabled: true,
id: 'qwen-plus',
@@ -456,7 +457,8 @@ const higressChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 16_384,
- description: 'Latest high-performance model with high-quality output and much faster reasoning.',
+ description:
+ 'Latest high-performance model with high-quality output and much faster reasoning.',
displayName: 'Yi Lightning',
enabled: true,
id: 'yi-lightning',
@@ -586,7 +588,8 @@ const higressChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 16_384,
- description: 'Model for complex visual tasks with high-performance image understanding and analysis.',
+ description:
+ 'Model for complex visual tasks with high-performance image understanding and analysis.',
displayName: 'Yi Vision',
enabled: true,
id: 'yi-vision',
@@ -797,7 +800,8 @@ const higressChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 8192,
- description: 'GLM-4V-Plus understands video and multiple images, suitable for multimodal tasks.',
+ description:
+ 'GLM-4V-Plus understands video and multiple images, suitable for multimodal tasks.',
displayName: 'GLM-4V-Plus',
enabled: true,
id: 'glm-4v-plus',
@@ -1869,7 +1873,8 @@ const higressChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 128_000,
- description: 'GPT-4 Turbo is a multimodal model with excellent language understanding and generation plus image input.',
+ description:
+ 'GPT-4 Turbo is a multimodal model with excellent language understanding and generation plus image input.',
displayName: 'GPT 4 Turbo',
enabled: true,
id: 'gpt-4',
@@ -1915,7 +1920,8 @@ const higressChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 128_000,
- description: 'Smaller and faster than o1-preview, 80% lower cost, strong at code generation and short-context tasks.',
+ description:
+ 'Smaller and faster than o1-preview, 80% lower cost, strong at code generation and short-context tasks.',
displayName: 'OpenAI o1-mini',
enabled: true,
id: 'o1-mini',
@@ -1955,7 +1961,8 @@ const higressChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 128_000,
- description: 'The most advanced multimodal model in the GPT-4 family, handling text and image inputs.',
+ description:
+ 'The most advanced multimodal model in the GPT-4 family, handling text and image inputs.',
displayName: 'OpenAI GPT-4o',
enabled: true,
id: 'gpt-4o',
@@ -2014,7 +2021,8 @@ const higressChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 131_072,
- description: 'Mistral Small is suitable for any language-based task requiring high efficiency and low latency.',
+ description:
+ 'Mistral Small is suitable for any language-based task requiring high efficiency and low latency.',
displayName: 'Mistral Small',
id: 'mistral-small',
maxOutput: 4096,
@@ -2034,7 +2042,8 @@ const higressChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 131_072,
- description: 'Strong image reasoning on high-resolution images, suited for visual understanding apps.',
+ description:
+ 'Strong image reasoning on high-resolution images, suited for visual understanding apps.',
displayName: 'Llama 3.2 11B Vision',
id: 'llama-3.2-11b-vision-instruct',
maxOutput: 4096,
@@ -2088,7 +2097,8 @@ const higressChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 8192,
- description: 'A powerful 70B-parameter model that excels at reasoning, coding, and broad language tasks.',
+ description:
+ 'A powerful 70B-parameter model that excels at reasoning, coding, and broad language tasks.',
displayName: 'Meta Llama 3 70B',
id: 'meta-llama-3-70b-instruct',
maxOutput: 4096,
@@ -2123,7 +2133,8 @@ const higressChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 131_072,
- description: 'The same Phi-3-mini model with a larger context window for RAG or few-shot prompts.',
+ description:
+ 'The same Phi-3-mini model with a larger context window for RAG or few-shot prompts.',
displayName: 'Phi-3-mini 128K',
id: 'Phi-3-mini-128k-instruct',
maxOutput: 4096,
@@ -2140,7 +2151,8 @@ const higressChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 131_072,
- description: 'The same Phi-3-small model with a larger context window for RAG or few-shot prompts.',
+ description:
+ 'The same Phi-3-small model with a larger context window for RAG or few-shot prompts.',
displayName: 'Phi-3-small 128K',
id: 'Phi-3-small-128k-instruct',
maxOutput: 4096,
@@ -2157,7 +2169,8 @@ const higressChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 131_072,
- description: 'The same Phi-3-medium model with a larger context window for RAG or few-shot prompts.',
+ description:
+ 'The same Phi-3-medium model with a larger context window for RAG or few-shot prompts.',
displayName: 'Phi-3-medium 128K',
id: 'Phi-3-medium-128k-instruct',
maxOutput: 4096,
@@ -2532,7 +2545,8 @@ const higressChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 1_008_192,
- description: 'Gemini 1.5 Flash 002 is an efficient multimodal model for broad application scaling.',
+ description:
+ 'Gemini 1.5 Flash 002 is an efficient multimodal model for broad application scaling.',
displayName: 'Gemini 1.5 Flash 002',
enabled: true,
id: 'gemini-1.5-flash-002',
@@ -2553,7 +2567,8 @@ const higressChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 1_008_192,
- description: 'Gemini 1.5 Flash 001 is an efficient multimodal model for broad application scaling.',
+ description:
+ 'Gemini 1.5 Flash 001 is an efficient multimodal model for broad application scaling.',
displayName: 'Gemini 1.5 Flash 001',
id: 'gemini-1.5-flash-001',
maxOutput: 8192,
@@ -2572,7 +2587,8 @@ const higressChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 1_008_192,
- description: 'Gemini 1.5 Flash 0827 delivers optimized multimodal processing for complex tasks.',
+ description:
+ 'Gemini 1.5 Flash 0827 delivers optimized multimodal processing for complex tasks.',
displayName: 'Gemini 1.5 Flash 0827',
id: 'gemini-1.5-flash-exp-0827',
maxOutput: 8192,
@@ -2592,7 +2608,8 @@ const higressChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 1_008_192,
- description: 'Gemini 1.5 Flash 8B is an efficient multimodal model for broad application scaling.',
+ description:
+ 'Gemini 1.5 Flash 8B is an efficient multimodal model for broad application scaling.',
displayName: 'Gemini 1.5 Flash 8B',
enabled: true,
id: 'gemini-1.5-flash-8b',
@@ -2698,7 +2715,8 @@ const higressChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 2_008_192,
- description: 'Gemini 1.5 Pro 0827 applies latest optimizations for more efficient multimodal processing.',
+ description:
+ 'Gemini 1.5 Pro 0827 applies latest optimizations for more efficient multimodal processing.',
displayName: 'Gemini 1.5 Pro 0827',
id: 'gemini-1.5-pro-exp-0827',
maxOutput: 8192,
@@ -2718,7 +2736,8 @@ const higressChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 2_008_192,
- description: 'Gemini 1.5 Pro 0801 provides strong multimodal processing with greater flexibility for app development.',
+ description:
+ 'Gemini 1.5 Pro 0801 provides strong multimodal processing with greater flexibility for app development.',
displayName: 'Gemini 1.5 Pro 0801',
id: 'gemini-1.5-pro-exp-0801',
maxOutput: 8192,
@@ -2734,7 +2753,8 @@ const higressChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 32_768,
- description: 'Gemini 1.0 Pro is Google’s high-performance AI model designed for broad task scaling.',
+ description:
+ 'Gemini 1.0 Pro is Google’s high-performance AI model designed for broad task scaling.',
displayName: 'Gemini 1.0 Pro',
id: 'gemini-1.0-pro-latest',
maxOutput: 2048,
@@ -2768,7 +2788,8 @@ const higressChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 32_768,
- description: 'Gemini 1.0 Pro 002 (Tuning) provides strong multimodal support for complex tasks.',
+ description:
+ 'Gemini 1.0 Pro 002 (Tuning) provides strong multimodal support for complex tasks.',
displayName: 'Gemini 1.0 Pro 002 (Tuning)',
id: 'gemini-1.0-pro-002',
maxOutput: 2048,
@@ -2804,7 +2825,8 @@ const higressChatModels: AIChatModelCard[] = [
functionCall: true,
},
contextWindowTokens: 128_000,
- description: 'Mistral Small is a cost-effective, fast, and reliable option for translation, summarization, and sentiment analysis.',
+ description:
+ 'Mistral Small is a cost-effective, fast, and reliable option for translation, summarization, and sentiment analysis.',
displayName: 'Mistral Small',
enabled: true,
id: 'mistral-small-latest',
@@ -2836,7 +2858,8 @@ const higressChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 32_768,
- description: 'Codestral is a cutting-edge code generation model optimized for fill-in-the-middle and code completion.',
+ description:
+ 'Codestral is a cutting-edge code generation model optimized for fill-in-the-middle and code completion.',
displayName: 'Codestral',
id: 'codestral-latest',
pricing: {
@@ -2955,7 +2978,8 @@ const higressChatModels: AIChatModelCard[] = [
functionCall: true,
},
contextWindowTokens: 245_760,
- description: 'Suitable for a wide range of NLP tasks, including text generation and dialogue systems.',
+ description:
+ 'Suitable for a wide range of NLP tasks, including text generation and dialogue systems.',
displayName: 'abab6.5s',
enabled: true,
id: 'abab6.5s-chat',
diff --git a/packages/model-bank/src/aiModels/hunyuan.ts b/packages/model-bank/src/aiModels/hunyuan.ts
index c5bb7010fe9..9e69e691406 100644
--- a/packages/model-bank/src/aiModels/hunyuan.ts
+++ b/packages/model-bank/src/aiModels/hunyuan.ts
@@ -484,7 +484,8 @@ const hunyuanChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 8000,
- description: 'Latest multimodal model with multilingual responses and balanced Chinese/English ability.',
+ description:
+ 'Latest multimodal model with multilingual responses and balanced Chinese/English ability.',
displayName: 'Hunyuan Standard Vision',
id: 'hunyuan-standard-vision',
maxOutput: 2000,
diff --git a/packages/model-bank/src/aiModels/modelscope.ts b/packages/model-bank/src/aiModels/modelscope.ts
index 4795a99b0ca..92368282eb1 100644
--- a/packages/model-bank/src/aiModels/modelscope.ts
+++ b/packages/model-bank/src/aiModels/modelscope.ts
@@ -62,7 +62,8 @@ const modelscopeChatModels: AIChatModelCard[] = [
functionCall: true,
},
contextWindowTokens: 131_072,
- description: 'Qwen3 235B A22B is the Qwen3 ultra-scale model delivering top-tier AI capability.',
+ description:
+ 'Qwen3 235B A22B is the Qwen3 ultra-scale model delivering top-tier AI capability.',
displayName: 'Qwen3 235B A22B',
id: 'Qwen/Qwen3-235B-A22B',
type: 'chat',
diff --git a/packages/model-bank/src/aiModels/novita.ts b/packages/model-bank/src/aiModels/novita.ts
index 764066a84fb..00f7286aab6 100644
--- a/packages/model-bank/src/aiModels/novita.ts
+++ b/packages/model-bank/src/aiModels/novita.ts
@@ -602,7 +602,8 @@ const novitaChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 60_288,
- description: 'Mistral Nemo is a 7.3B model with multilingual support and strong coding performance.',
+ description:
+ 'Mistral Nemo is a 7.3B model with multilingual support and strong coding performance.',
displayName: 'Mistral Nemo',
id: 'mistralai/mistral-nemo',
pricing: {
diff --git a/packages/model-bank/src/aiModels/ollama.ts b/packages/model-bank/src/aiModels/ollama.ts
index ed4856b0b69..52877a4e356 100644
--- a/packages/model-bank/src/aiModels/ollama.ts
+++ b/packages/model-bank/src/aiModels/ollama.ts
@@ -44,8 +44,7 @@ const ollamaChatModels: AIChatModelCard[] = [
functionCall: true,
},
contextWindowTokens: 262_144,
- description:
- 'A high-performance long-context model from Alibaba for agents and coding tasks.',
+ description: 'A high-performance long-context model from Alibaba for agents and coding tasks.',
displayName: 'Qwen3 Coder 480B',
id: 'qwen3-coder:480b',
type: 'chat',
@@ -285,14 +284,16 @@ const ollamaChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 128_000,
- description: 'Phi-3 is Microsoft’s lightweight open model for efficient integration and large-scale reasoning.',
+ description:
+ 'Phi-3 is Microsoft’s lightweight open model for efficient integration and large-scale reasoning.',
displayName: 'Phi-3 3.8B',
id: 'phi3',
type: 'chat',
},
{
contextWindowTokens: 128_000,
- description: 'Phi-3 is Microsoft’s lightweight open model for efficient integration and large-scale reasoning.',
+ description:
+ 'Phi-3 is Microsoft’s lightweight open model for efficient integration and large-scale reasoning.',
displayName: 'Phi-3 14B',
id: 'phi3:14b',
type: 'chat',
@@ -373,21 +374,24 @@ const ollamaChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 32_768,
- description: 'Codestral is Mistral AI’s first code model, delivering strong code generation support.',
+ description:
+ 'Codestral is Mistral AI’s first code model, delivering strong code generation support.',
displayName: 'Codestral 22B',
id: 'codestral',
type: 'chat',
},
{
contextWindowTokens: 8192,
- description: 'Aya 23 is Cohere’s multilingual model supporting 23 languages for diverse use cases.',
+ description:
+ 'Aya 23 is Cohere’s multilingual model supporting 23 languages for diverse use cases.',
displayName: 'Aya 23 8B',
id: 'aya',
type: 'chat',
},
{
contextWindowTokens: 8192,
- description: 'Aya 23 is Cohere’s multilingual model supporting 23 languages for diverse use cases.',
+ description:
+ 'Aya 23 is Cohere’s multilingual model supporting 23 languages for diverse use cases.',
displayName: 'Aya 23 35B',
id: 'aya:35b',
type: 'chat',
@@ -408,7 +412,8 @@ const ollamaChatModels: AIChatModelCard[] = [
functionCall: true,
},
contextWindowTokens: 131_072,
- description: 'Command R+ is a high-performance LLM designed for real enterprise scenarios and complex apps.',
+ description:
+ 'Command R+ is a high-performance LLM designed for real enterprise scenarios and complex apps.',
displayName: 'Command R+ 104B',
id: 'command-r-plus',
type: 'chat',
diff --git a/packages/model-bank/src/aiModels/openrouter.ts b/packages/model-bank/src/aiModels/openrouter.ts
index 985f19c2ee6..e87be6e83b2 100644
--- a/packages/model-bank/src/aiModels/openrouter.ts
+++ b/packages/model-bank/src/aiModels/openrouter.ts
@@ -442,7 +442,8 @@ const openrouterChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 1_047_576,
- description: 'GPT-4.1 is the flagship model for complex tasks and cross-domain problem solving.',
+ description:
+ 'GPT-4.1 is the flagship model for complex tasks and cross-domain problem solving.',
displayName: 'GPT-4.1',
id: 'openai/gpt-4.1',
maxOutput: 32_768,
@@ -523,7 +524,8 @@ const openrouterChatModels: AIChatModelCard[] = [
reasoning: true,
},
contextWindowTokens: 200_000,
- description: 'o3-mini delivers higher intelligence at the same cost and latency targets as o1-mini.',
+ description:
+ 'o3-mini delivers higher intelligence at the same cost and latency targets as o1-mini.',
displayName: 'o3-mini',
id: 'openai/o3-mini',
maxOutput: 100_000,
@@ -1060,14 +1062,16 @@ const openrouterChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 32_768,
- description: 'Qwen2 is a new large language model family with stronger understanding and generation.',
+ description:
+ 'Qwen2 is a new large language model family with stronger understanding and generation.',
displayName: 'Qwen2 7B (Free)',
id: 'qwen/qwen-2-7b-instruct:free',
type: 'chat',
},
{
contextWindowTokens: 131_072,
- description: 'LLaMA 3.1 offers multilingual support and is one of the leading generative models.',
+ description:
+ 'LLaMA 3.1 offers multilingual support and is one of the leading generative models.',
displayName: 'Llama 3.1 8B (Free)',
id: 'meta-llama/llama-3.1-8b-instruct:free',
type: 'chat',
diff --git a/packages/model-bank/src/aiModels/perplexity.ts b/packages/model-bank/src/aiModels/perplexity.ts
index 73b47a2fbf4..359fba077f4 100644
--- a/packages/model-bank/src/aiModels/perplexity.ts
+++ b/packages/model-bank/src/aiModels/perplexity.ts
@@ -33,7 +33,8 @@ const perplexityChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 127_072,
- description: 'An advanced search product with search grounding for complex queries and follow-ups.',
+ description:
+ 'An advanced search product with search grounding for complex queries and follow-ups.',
displayName: 'Sonar Reasoning Pro',
enabled: true,
id: 'sonar-reasoning-pro',
@@ -57,7 +58,8 @@ const perplexityChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 127_072,
- description: 'An advanced search product with search grounding for complex queries and follow-ups.',
+ description:
+ 'An advanced search product with search grounding for complex queries and follow-ups.',
displayName: 'Sonar Reasoning',
enabled: true,
id: 'sonar-reasoning',
@@ -80,7 +82,8 @@ const perplexityChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 200_000,
- description: 'An advanced search product with search grounding for complex queries and follow-ups.',
+ description:
+ 'An advanced search product with search grounding for complex queries and follow-ups.',
displayName: 'Sonar Pro',
enabled: true,
id: 'sonar-pro',
diff --git a/packages/model-bank/src/aiModels/qiniu.ts b/packages/model-bank/src/aiModels/qiniu.ts
index 964e8432d15..0c198c35876 100644
--- a/packages/model-bank/src/aiModels/qiniu.ts
+++ b/packages/model-bank/src/aiModels/qiniu.ts
@@ -83,7 +83,7 @@ const qiniuChatModels: AIChatModelCard[] = [
reasoning: true,
},
contextWindowTokens: 163_840,
- description:
+ description:
'DeepSeek Math V2 is a model that has made significant breakthroughs in mathematical reasoning capabilities. Its core innovation lies in the "self-verification" training mechanism, and it has achieved gold medal levels in several top mathematics competitions.',
displayName: 'DeepSeek Math V2',
enabled: true,
diff --git a/packages/model-bank/src/aiModels/sensenova.ts b/packages/model-bank/src/aiModels/sensenova.ts
index 27370a3e95f..f5f6fd1ead2 100644
--- a/packages/model-bank/src/aiModels/sensenova.ts
+++ b/packages/model-bank/src/aiModels/sensenova.ts
@@ -267,8 +267,7 @@ const sensenovaChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 131_072,
- description:
- 'Base V4 with 128K context, strong in long-text understanding and generation.',
+ description: 'Base V4 with 128K context, strong in long-text understanding and generation.',
displayName: 'SenseChat 4.0 128K',
id: 'SenseChat-128K',
maxOutput: 131_072,
diff --git a/packages/model-bank/src/aiModels/togetherai.ts b/packages/model-bank/src/aiModels/togetherai.ts
index cc5e9a102fc..c795865ce57 100644
--- a/packages/model-bank/src/aiModels/togetherai.ts
+++ b/packages/model-bank/src/aiModels/togetherai.ts
@@ -104,7 +104,8 @@ const togetheraiChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 8192,
- description: 'Llama 3 8B Instruct Turbo is a high-performance LLM for a wide range of use cases.',
+ description:
+ 'Llama 3 8B Instruct Turbo is a high-performance LLM for a wide range of use cases.',
displayName: 'Llama 3 8B Instruct Turbo',
id: 'meta-llama/Meta-Llama-3-8B-Instruct-Turbo',
type: 'chat',
@@ -119,7 +120,8 @@ const togetheraiChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 8192,
- description: 'Llama 3 8B Instruct Lite balances performance for resource-constrained environments.',
+ description:
+ 'Llama 3 8B Instruct Lite balances performance for resource-constrained environments.',
displayName: 'Llama 3 8B Instruct Lite',
id: 'meta-llama/Meta-Llama-3-8B-Instruct-Lite',
type: 'chat',
@@ -133,7 +135,8 @@ const togetheraiChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 8192,
- description: 'Llama 3 8B Instruct Reference offers multilingual support and broad domain knowledge.',
+ description:
+ 'Llama 3 8B Instruct Reference offers multilingual support and broad domain knowledge.',
displayName: 'Llama 3 8B Instruct Reference',
id: 'meta-llama/Llama-3-8b-chat-hf',
type: 'chat',
@@ -147,7 +150,8 @@ const togetheraiChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 4096,
- description: 'LLaMA-2 Chat (13B) provides strong language handling and a solid chat experience.',
+ description:
+ 'LLaMA-2 Chat (13B) provides strong language handling and a solid chat experience.',
displayName: 'LLaMA-2 Chat (13B)',
id: 'meta-llama/Llama-2-13b-chat-hf',
type: 'chat',
@@ -169,7 +173,8 @@ const togetheraiChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 8192,
- description: 'Gemma 2 9B, developed by Google, offers efficient instruction following and solid overall capability.',
+ description:
+ 'Gemma 2 9B, developed by Google, offers efficient instruction following and solid overall capability.',
displayName: 'Gemma 2 9B',
enabled: true,
id: 'google/gemma-2-9b-it',
@@ -177,7 +182,8 @@ const togetheraiChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 8192,
- description: 'Gemma 2 27B is a general-purpose LLM with strong performance across many scenarios.',
+ description:
+ 'Gemma 2 27B is a general-purpose LLM with strong performance across many scenarios.',
displayName: 'Gemma 2 27B',
enabled: true,
id: 'google/gemma-2-27b-it',
@@ -185,7 +191,8 @@ const togetheraiChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 8192,
- description: 'Gemma Instruct (2B) provides basic instruction handling for lightweight applications.',
+ description:
+ 'Gemma Instruct (2B) provides basic instruction handling for lightweight applications.',
displayName: 'Gemma Instruct (2B)',
id: 'google/gemma-2b-it',
type: 'chat',
@@ -359,7 +366,8 @@ const togetheraiChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 32_768,
- description: 'Qwen 2 Instruct (72B) delivers precise instruction following for enterprise workloads.',
+ description:
+ 'Qwen 2 Instruct (72B) delivers precise instruction following for enterprise workloads.',
displayName: 'Qwen 2 Instruct (72B)',
id: 'Qwen/Qwen2-72B-Instruct',
type: 'chat',
diff --git a/packages/model-bank/src/aiModels/vercelaigateway.ts b/packages/model-bank/src/aiModels/vercelaigateway.ts
index abbb26cfb65..d24d72d2f2f 100644
--- a/packages/model-bank/src/aiModels/vercelaigateway.ts
+++ b/packages/model-bank/src/aiModels/vercelaigateway.ts
@@ -1684,7 +1684,7 @@ const vercelAIGatewayEmbeddingModels: AIEmbeddingModelCard[] = [
type: 'embedding',
},
{
- description: "OpenAI’s improved, higher-performance ada embedding model variant.",
+ description: 'OpenAI’s improved, higher-performance ada embedding model variant.',
displayName: 'text-embedding-3-small',
id: 'openai/text-embedding-3-small',
maxDimension: 1536,
@@ -1694,7 +1694,7 @@ const vercelAIGatewayEmbeddingModels: AIEmbeddingModelCard[] = [
type: 'embedding',
},
{
- description: "OpenAI’s legacy text embedding model.",
+ description: 'OpenAI’s legacy text embedding model.',
displayName: 'text-embedding-ada-002',
id: 'openai/text-embedding-ada-002',
maxDimension: 1536,
diff --git a/packages/model-bank/src/aiModels/vllm.ts b/packages/model-bank/src/aiModels/vllm.ts
index 62674a79d36..b1d3eb6da4d 100644
--- a/packages/model-bank/src/aiModels/vllm.ts
+++ b/packages/model-bank/src/aiModels/vllm.ts
@@ -26,28 +26,32 @@ const vllmChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 8192,
- description: 'Gemma 2 is Google’s efficient model family for use cases from small apps to complex data processing.',
+ description:
+ 'Gemma 2 is Google’s efficient model family for use cases from small apps to complex data processing.',
displayName: 'Gemma 2 9B',
id: 'google/gemma-2-9b',
type: 'chat',
},
{
contextWindowTokens: 8192,
- description: 'Gemma 2 is Google’s efficient model family for use cases from small apps to complex data processing.',
+ description:
+ 'Gemma 2 is Google’s efficient model family for use cases from small apps to complex data processing.',
displayName: 'Gemma 2 27B',
id: 'google/gemma-2-27b',
type: 'chat',
},
{
contextWindowTokens: 8192,
- description: 'Mistral (7B) Instruct is known for strong performance across many language tasks.',
+ description:
+ 'Mistral (7B) Instruct is known for strong performance across many language tasks.',
displayName: 'Mistral 7B Instruct v0.1',
id: 'mistralai/Mistral-7B-Instruct-v0.1',
type: 'chat',
},
{
contextWindowTokens: 32_768,
- description: 'Mixtral-8x7B Instruct (46.7B) provides high capacity for large-scale data processing.',
+ description:
+ 'Mixtral-8x7B Instruct (46.7B) provides high capacity for large-scale data processing.',
displayName: 'Mistral 8x7B Instruct v0.1',
id: 'mistralai/Mixtral-8x7B-Instruct-v0.1',
type: 'chat',
diff --git a/packages/model-bank/src/aiModels/xai.ts b/packages/model-bank/src/aiModels/xai.ts
index a020b73402a..18bb38af812 100644
--- a/packages/model-bank/src/aiModels/xai.ts
+++ b/packages/model-bank/src/aiModels/xai.ts
@@ -273,8 +273,7 @@ const xaiChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 32_768,
- description:
- 'Improved accuracy, instruction following, and multilingual capability.',
+ description: 'Improved accuracy, instruction following, and multilingual capability.',
displayName: 'Grok 2 Vision 1212',
id: 'grok-2-vision-1212', // legacy
pricing: {
diff --git a/packages/model-bank/src/aiModels/xinference.ts b/packages/model-bank/src/aiModels/xinference.ts
index 616b35e6e80..a65ff01cf80 100644
--- a/packages/model-bank/src/aiModels/xinference.ts
+++ b/packages/model-bank/src/aiModels/xinference.ts
@@ -89,7 +89,8 @@ const xinferenceChatModels: AIChatModelCard[] = [
functionCall: true,
},
contextWindowTokens: 32_768,
- description: 'Qwen2.5-Coder is the latest code-focused LLM in the Qwen family (formerly CodeQwen).',
+ description:
+ 'Qwen2.5-Coder is the latest code-focused LLM in the Qwen family (formerly CodeQwen).',
displayName: 'Qwen2.5 Coder Instruct',
enabled: true,
id: 'qwen2.5-coder-instruct',
diff --git a/packages/model-bank/src/aiModels/zeroone.ts b/packages/model-bank/src/aiModels/zeroone.ts
index 2f9bf7ea437..c957806df99 100644
--- a/packages/model-bank/src/aiModels/zeroone.ts
+++ b/packages/model-bank/src/aiModels/zeroone.ts
@@ -21,7 +21,8 @@ const zerooneChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 16_384,
- description: 'A vision model for complex tasks with strong multi-image understanding and analysis.',
+ description:
+ 'A vision model for complex tasks with strong multi-image understanding and analysis.',
displayName: 'Yi Vision V2',
enabled: true,
id: 'yi-vision-v2',
@@ -50,7 +51,8 @@ const zerooneChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 16_384,
- description: 'A tuned mid-size model with balanced capability and value, optimized for instruction following.',
+ description:
+ 'A tuned mid-size model with balanced capability and value, optimized for instruction following.',
displayName: 'Yi Medium',
id: 'yi-medium',
pricing: {
@@ -78,7 +80,8 @@ const zerooneChatModels: AIChatModelCard[] = [
},
{
contextWindowTokens: 16_384,
- description: 'Exceptional value and performance, tuned for a strong balance of quality, speed, and cost.',
+ description:
+ 'Exceptional value and performance, tuned for a strong balance of quality, speed, and cost.',
displayName: 'Yi Large Turbo',
id: 'yi-large-turbo',
pricing: {
diff --git a/packages/model-bank/src/exports.test.ts b/packages/model-bank/src/exports.test.ts
index 327309616eb..ded46698ce6 100644
--- a/packages/model-bank/src/exports.test.ts
+++ b/packages/model-bank/src/exports.test.ts
@@ -1,4 +1,4 @@
-import { readdirSync,readFileSync } from 'node:fs';
+import { readdirSync, readFileSync } from 'node:fs';
import path from 'node:path';
import { describe, expect, it } from 'vitest';
@@ -29,7 +29,6 @@ describe('model-bank package.json exports should cover all aiModels files', () =
});
if (missing.length > 0) {
-
console.error('Missing exports for aiModels files:', missing);
}
diff --git a/packages/model-bank/src/modelProviders/ai21.ts b/packages/model-bank/src/modelProviders/ai21.ts
index a57b304ca97..652505b4f26 100644
--- a/packages/model-bank/src/modelProviders/ai21.ts
+++ b/packages/model-bank/src/modelProviders/ai21.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref https://docs.ai21.com/reference/jamba-15-api-ref
const Ai21: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/ai302.ts b/packages/model-bank/src/modelProviders/ai302.ts
index befc832c9d0..2b3b33914b7 100644
--- a/packages/model-bank/src/modelProviders/ai302.ts
+++ b/packages/model-bank/src/modelProviders/ai302.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://302.ai/pricing/
const Ai302: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/ai360.ts b/packages/model-bank/src/modelProviders/ai360.ts
index 8c9fdf83414..f03e0052d40 100644
--- a/packages/model-bank/src/modelProviders/ai360.ts
+++ b/packages/model-bank/src/modelProviders/ai360.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://ai.360.cn/platform/docs/overview
const Ai360: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/aihubmix.ts b/packages/model-bank/src/modelProviders/aihubmix.ts
index 9382c9687bf..f77369f9502 100644
--- a/packages/model-bank/src/modelProviders/aihubmix.ts
+++ b/packages/model-bank/src/modelProviders/aihubmix.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const AiHubMix: ModelProviderCard = {
apiKeyUrl: 'https://lobe.li/9mZhb4T',
diff --git a/packages/model-bank/src/modelProviders/akashchat.ts b/packages/model-bank/src/modelProviders/akashchat.ts
index 77586daa58b..3da55860fa5 100644
--- a/packages/model-bank/src/modelProviders/akashchat.ts
+++ b/packages/model-bank/src/modelProviders/akashchat.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const AkashChat: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/anthropic.ts b/packages/model-bank/src/modelProviders/anthropic.ts
index d62b8c22ff6..2454934c151 100644
--- a/packages/model-bank/src/modelProviders/anthropic.ts
+++ b/packages/model-bank/src/modelProviders/anthropic.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const Anthropic: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/azure.ts b/packages/model-bank/src/modelProviders/azure.ts
index 2f3cdeabbe1..f90928819ab 100644
--- a/packages/model-bank/src/modelProviders/azure.ts
+++ b/packages/model-bank/src/modelProviders/azure.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://learn.microsoft.com/azure/ai-services/openai/concepts/models
const Azure: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/azureai.ts b/packages/model-bank/src/modelProviders/azureai.ts
index c2d42f3b588..7052be0cb94 100644
--- a/packages/model-bank/src/modelProviders/azureai.ts
+++ b/packages/model-bank/src/modelProviders/azureai.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://learn.microsoft.com/azure/ai-services/openai/concepts/models
const Azure: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/baichuan.ts b/packages/model-bank/src/modelProviders/baichuan.ts
index 27ff3f7a724..2fc4627f3e1 100644
--- a/packages/model-bank/src/modelProviders/baichuan.ts
+++ b/packages/model-bank/src/modelProviders/baichuan.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://platform.baichuan-ai.com/price
const Baichuan: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/bedrock.ts b/packages/model-bank/src/modelProviders/bedrock.ts
index 07b0a6380b4..7f3b1fa320e 100644
--- a/packages/model-bank/src/modelProviders/bedrock.ts
+++ b/packages/model-bank/src/modelProviders/bedrock.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref :https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html
// ref :https://us-east-1.console.aws.amazon.com/bedrock/home?region=us-east-1#/models
diff --git a/packages/model-bank/src/modelProviders/bfl.ts b/packages/model-bank/src/modelProviders/bfl.ts
index 478bc4e153b..72267c2fd89 100644
--- a/packages/model-bank/src/modelProviders/bfl.ts
+++ b/packages/model-bank/src/modelProviders/bfl.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
/**
* @see https://docs.bfl.ai/
diff --git a/packages/model-bank/src/modelProviders/cerebras.ts b/packages/model-bank/src/modelProviders/cerebras.ts
index 87f53af58dc..6492b95c5ee 100644
--- a/packages/model-bank/src/modelProviders/cerebras.ts
+++ b/packages/model-bank/src/modelProviders/cerebras.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const Cerebras: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/cloudflare.ts b/packages/model-bank/src/modelProviders/cloudflare.ts
index 32374c85ba5..6946d486440 100644
--- a/packages/model-bank/src/modelProviders/cloudflare.ts
+++ b/packages/model-bank/src/modelProviders/cloudflare.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref https://developers.cloudflare.com/workers-ai/models/#text-generation
// api https://developers.cloudflare.com/workers-ai/configuration/open-ai-compatibility
diff --git a/packages/model-bank/src/modelProviders/cohere.ts b/packages/model-bank/src/modelProviders/cohere.ts
index 92b24d506dc..e0345512dc4 100644
--- a/packages/model-bank/src/modelProviders/cohere.ts
+++ b/packages/model-bank/src/modelProviders/cohere.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const Cohere: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/cometapi.ts b/packages/model-bank/src/modelProviders/cometapi.ts
index 7ca96dc54a7..15f123f8092 100644
--- a/packages/model-bank/src/modelProviders/cometapi.ts
+++ b/packages/model-bank/src/modelProviders/cometapi.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://api.cometapi.com/pricing
const CometAPI: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/comfyui.ts b/packages/model-bank/src/modelProviders/comfyui.ts
index 5f3b6ddbcb7..422b17fb08c 100644
--- a/packages/model-bank/src/modelProviders/comfyui.ts
+++ b/packages/model-bank/src/modelProviders/comfyui.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
/**
* ComfyUI Provider Configuration
diff --git a/packages/model-bank/src/modelProviders/deepseek.ts b/packages/model-bank/src/modelProviders/deepseek.ts
index 644a84d94de..f3070ebccde 100644
--- a/packages/model-bank/src/modelProviders/deepseek.ts
+++ b/packages/model-bank/src/modelProviders/deepseek.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const DeepSeek: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/fal.ts b/packages/model-bank/src/modelProviders/fal.ts
index 0d4978fbdf6..25ef9163a14 100644
--- a/packages/model-bank/src/modelProviders/fal.ts
+++ b/packages/model-bank/src/modelProviders/fal.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
/**
* @see https://fal.ai/models/fal-ai/flux/schnell
diff --git a/packages/model-bank/src/modelProviders/fireworksai.ts b/packages/model-bank/src/modelProviders/fireworksai.ts
index bf0aa0fceb9..7885c6df168 100644
--- a/packages/model-bank/src/modelProviders/fireworksai.ts
+++ b/packages/model-bank/src/modelProviders/fireworksai.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://fireworks.ai/models?show=Serverless
// ref: https://fireworks.ai/pricing
diff --git a/packages/model-bank/src/modelProviders/giteeai.ts b/packages/model-bank/src/modelProviders/giteeai.ts
index 6b997ed3d82..f5ef2177a36 100644
--- a/packages/model-bank/src/modelProviders/giteeai.ts
+++ b/packages/model-bank/src/modelProviders/giteeai.ts
@@ -1,10 +1,11 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://ai.gitee.com/serverless-api/packages/1910
const GiteeAI: ModelProviderCard = {
chatModels: [],
checkModel: 'Qwen2.5-72B-Instruct',
- description: 'Gitee AI Serverless APIs provide plug-and-play LLM inference services for developers.',
+ description:
+ 'Gitee AI Serverless APIs provide plug-and-play LLM inference services for developers.',
disableBrowserRequest: true,
id: 'giteeai',
modelList: { showModelFetcher: true },
diff --git a/packages/model-bank/src/modelProviders/github.ts b/packages/model-bank/src/modelProviders/github.ts
index a7a41492d25..34b25dc4af1 100644
--- a/packages/model-bank/src/modelProviders/github.ts
+++ b/packages/model-bank/src/modelProviders/github.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://github.com/marketplace/models
const Github: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/githubCopilot.ts b/packages/model-bank/src/modelProviders/githubCopilot.ts
index 48c307aaa81..05f6ade2567 100644
--- a/packages/model-bank/src/modelProviders/githubCopilot.ts
+++ b/packages/model-bank/src/modelProviders/githubCopilot.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const GithubCopilot: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/google.ts b/packages/model-bank/src/modelProviders/google.ts
index ce22ba360de..7cde9e60fb8 100644
--- a/packages/model-bank/src/modelProviders/google.ts
+++ b/packages/model-bank/src/modelProviders/google.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://ai.google.dev/gemini-api/docs/models/gemini
const Google: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/groq.ts b/packages/model-bank/src/modelProviders/groq.ts
index ab4bd42e306..0a1af840693 100644
--- a/packages/model-bank/src/modelProviders/groq.ts
+++ b/packages/model-bank/src/modelProviders/groq.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref https://console.groq.com/docs/tool-use
const Groq: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/higress.ts b/packages/model-bank/src/modelProviders/higress.ts
index dc37bd738cb..70ff59a89a3 100644
--- a/packages/model-bank/src/modelProviders/higress.ts
+++ b/packages/model-bank/src/modelProviders/higress.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const Higress: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/huggingface.ts b/packages/model-bank/src/modelProviders/huggingface.ts
index 48b4b3076d4..7e2fe2e2ff7 100644
--- a/packages/model-bank/src/modelProviders/huggingface.ts
+++ b/packages/model-bank/src/modelProviders/huggingface.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const HuggingFace: ModelProviderCard = {
apiKeyUrl: 'https://huggingface.co/settings/tokens',
diff --git a/packages/model-bank/src/modelProviders/hunyuan.ts b/packages/model-bank/src/modelProviders/hunyuan.ts
index 2e100c88729..6f65dac3c16 100644
--- a/packages/model-bank/src/modelProviders/hunyuan.ts
+++ b/packages/model-bank/src/modelProviders/hunyuan.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref https://cloud.tencent.com/document/product/1729/104753
const Hunyuan: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/index.ts b/packages/model-bank/src/modelProviders/index.ts
index 0bedebe01e5..e5f63d622b4 100644
--- a/packages/model-bank/src/modelProviders/index.ts
+++ b/packages/model-bank/src/modelProviders/index.ts
@@ -1,6 +1,6 @@
import { ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const';
-import type {ChatModelCard, ModelProviderCard} from '@/types/llm';
+import type { ChatModelCard, ModelProviderCard } from '@/types/llm';
import Ai21Provider from './ai21';
import Ai302Provider from './ai302';
diff --git a/packages/model-bank/src/modelProviders/infiniai.ts b/packages/model-bank/src/modelProviders/infiniai.ts
index 13fbfbb94c7..220c6e50a58 100644
--- a/packages/model-bank/src/modelProviders/infiniai.ts
+++ b/packages/model-bank/src/modelProviders/infiniai.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// https://cloud.infini-ai.com/genstudio/model
// All models are currently free
diff --git a/packages/model-bank/src/modelProviders/internlm.ts b/packages/model-bank/src/modelProviders/internlm.ts
index 72deb2f5a7f..88f14d607ff 100644
--- a/packages/model-bank/src/modelProviders/internlm.ts
+++ b/packages/model-bank/src/modelProviders/internlm.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const InternLM: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/jina.ts b/packages/model-bank/src/modelProviders/jina.ts
index d17e3124a38..37da683556f 100644
--- a/packages/model-bank/src/modelProviders/jina.ts
+++ b/packages/model-bank/src/modelProviders/jina.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const Jina: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/lmstudio.ts b/packages/model-bank/src/modelProviders/lmstudio.ts
index b8e4149e57e..2d433027954 100644
--- a/packages/model-bank/src/modelProviders/lmstudio.ts
+++ b/packages/model-bank/src/modelProviders/lmstudio.ts
@@ -1,9 +1,10 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://ollama.com/library
const LMStudio: ModelProviderCard = {
chatModels: [],
- description: 'LM Studio is a desktop app for developing and experimenting with LLMs on your computer.',
+ description:
+ 'LM Studio is a desktop app for developing and experimenting with LLMs on your computer.',
id: 'lmstudio',
modelsUrl: 'https://lmstudio.ai/models',
name: 'LM Studio',
diff --git a/packages/model-bank/src/modelProviders/lobehub.ts b/packages/model-bank/src/modelProviders/lobehub.ts
index 88b89f702b5..e5a47eb0662 100644
--- a/packages/model-bank/src/modelProviders/lobehub.ts
+++ b/packages/model-bank/src/modelProviders/lobehub.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const LobeHub: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/minimax.ts b/packages/model-bank/src/modelProviders/minimax.ts
index 0bd27a3cd87..e6a21ad343f 100644
--- a/packages/model-bank/src/modelProviders/minimax.ts
+++ b/packages/model-bank/src/modelProviders/minimax.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://platform.minimaxi.com/document/Models
const Minimax: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/mistral.ts b/packages/model-bank/src/modelProviders/mistral.ts
index 2150acc1ba1..d948f70861f 100644
--- a/packages/model-bank/src/modelProviders/mistral.ts
+++ b/packages/model-bank/src/modelProviders/mistral.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://docs.mistral.ai/getting-started/models/
// ref: https://docs.mistral.ai/capabilities/function_calling/
diff --git a/packages/model-bank/src/modelProviders/modelscope.ts b/packages/model-bank/src/modelProviders/modelscope.ts
index 86c1596acaf..730d18a4444 100644
--- a/packages/model-bank/src/modelProviders/modelscope.ts
+++ b/packages/model-bank/src/modelProviders/modelscope.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://modelscope.cn/docs/model-service/API-Inference/intro
const ModelScope: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/moonshot.ts b/packages/model-bank/src/modelProviders/moonshot.ts
index b8dbabb1a0f..4b225b11186 100644
--- a/packages/model-bank/src/modelProviders/moonshot.ts
+++ b/packages/model-bank/src/modelProviders/moonshot.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const Moonshot: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/nebius.ts b/packages/model-bank/src/modelProviders/nebius.ts
index 1b73f9386d3..8708e191a44 100644
--- a/packages/model-bank/src/modelProviders/nebius.ts
+++ b/packages/model-bank/src/modelProviders/nebius.ts
@@ -1,21 +1,21 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const Nebius: ModelProviderCard = {
- chatModels: [],
- checkModel: 'Qwen/Qwen2.5-Coder-7B',
+ chatModels: [],
+ checkModel: 'Qwen/Qwen2.5-Coder-7B',
description:
'Nebius provides high-performance infrastructure for global AI innovators via large-scale GPU clusters and a vertically integrated cloud platform.',
- id: 'nebius',
- modelsUrl: 'https://studio.nebius.com/',
- name: 'Nebius',
- settings: {
- proxyUrl: {
- placeholder: 'https://api.studio.nebius.com/v1',
- },
- sdkType: 'openai',
- showModelFetcher: true,
+ id: 'nebius',
+ modelsUrl: 'https://studio.nebius.com/',
+ name: 'Nebius',
+ settings: {
+ proxyUrl: {
+ placeholder: 'https://api.studio.nebius.com/v1',
},
- url: 'https://nebius.com/',
+ sdkType: 'openai',
+ showModelFetcher: true,
+ },
+ url: 'https://nebius.com/',
};
export default Nebius;
diff --git a/packages/model-bank/src/modelProviders/newapi.ts b/packages/model-bank/src/modelProviders/newapi.ts
index a2f46017bf7..9afa251b04c 100644
--- a/packages/model-bank/src/modelProviders/newapi.ts
+++ b/packages/model-bank/src/modelProviders/newapi.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const NewAPI: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/novita.ts b/packages/model-bank/src/modelProviders/novita.ts
index f91ba33b088..a4b9ef8e325 100644
--- a/packages/model-bank/src/modelProviders/novita.ts
+++ b/packages/model-bank/src/modelProviders/novita.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://novita.ai/model-api/product/llm-api
const Novita: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/nvidia.ts b/packages/model-bank/src/modelProviders/nvidia.ts
index 6cd51de8570..c3fd6b88246 100644
--- a/packages/model-bank/src/modelProviders/nvidia.ts
+++ b/packages/model-bank/src/modelProviders/nvidia.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const Nvidia: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/ollama.ts b/packages/model-bank/src/modelProviders/ollama.ts
index 795fc4fe4b7..3f7c3eae282 100644
--- a/packages/model-bank/src/modelProviders/ollama.ts
+++ b/packages/model-bank/src/modelProviders/ollama.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const Ollama: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/ollamacloud.ts b/packages/model-bank/src/modelProviders/ollamacloud.ts
index 038a5abbcca..1a48ec75e1f 100644
--- a/packages/model-bank/src/modelProviders/ollamacloud.ts
+++ b/packages/model-bank/src/modelProviders/ollamacloud.ts
@@ -1,19 +1,19 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const OllamaCloud: ModelProviderCard = {
- chatModels: [],
- checkModel: 'gpt-oss:20b',
- description:
- 'Ollama Cloud provides managed inference with out-of-the-box access to the Ollama model library and OpenAI-compatible APIs.',
- id: 'ollamacloud',
- modelsUrl: 'https://ollama.com/library',
- name: 'Ollama Cloud',
- settings: {
- disableBrowserRequest: true, // CORS error
- sdkType: 'openai',
- showModelFetcher: true,
- },
- url: 'https://ollama.com/cloud',
+ chatModels: [],
+ checkModel: 'gpt-oss:20b',
+ description:
+ 'Ollama Cloud provides managed inference with out-of-the-box access to the Ollama model library and OpenAI-compatible APIs.',
+ id: 'ollamacloud',
+ modelsUrl: 'https://ollama.com/library',
+ name: 'Ollama Cloud',
+ settings: {
+ disableBrowserRequest: true, // CORS error
+ sdkType: 'openai',
+ showModelFetcher: true,
+ },
+ url: 'https://ollama.com/cloud',
};
export default OllamaCloud;
diff --git a/packages/model-bank/src/modelProviders/openai.ts b/packages/model-bank/src/modelProviders/openai.ts
index 0d1be28e81d..52d8e298a64 100644
--- a/packages/model-bank/src/modelProviders/openai.ts
+++ b/packages/model-bank/src/modelProviders/openai.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://platform.openai.com/docs/deprecations
const OpenAI: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/openrouter.ts b/packages/model-bank/src/modelProviders/openrouter.ts
index 5ac8769afb4..87b2916d11b 100644
--- a/packages/model-bank/src/modelProviders/openrouter.ts
+++ b/packages/model-bank/src/modelProviders/openrouter.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref :https://openrouter.ai/docs#models
const OpenRouter: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/perplexity.ts b/packages/model-bank/src/modelProviders/perplexity.ts
index 3a3c4ae9bfd..da78bd4b679 100644
--- a/packages/model-bank/src/modelProviders/perplexity.ts
+++ b/packages/model-bank/src/modelProviders/perplexity.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref :https://docs.perplexity.ai/docs/model-cards
const Perplexity: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/ppio.ts b/packages/model-bank/src/modelProviders/ppio.ts
index c22e03c2ec4..4fcdd5f9d03 100644
--- a/packages/model-bank/src/modelProviders/ppio.ts
+++ b/packages/model-bank/src/modelProviders/ppio.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const PPIO: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/qiniu.ts b/packages/model-bank/src/modelProviders/qiniu.ts
index f587a984c8f..0ebaffb9ea9 100644
--- a/packages/model-bank/src/modelProviders/qiniu.ts
+++ b/packages/model-bank/src/modelProviders/qiniu.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://developer.qiniu.com/aitokenapi
const Qiniu: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/qwen.ts b/packages/model-bank/src/modelProviders/qwen.ts
index dc5b16ac485..8825e6751f8 100644
--- a/packages/model-bank/src/modelProviders/qwen.ts
+++ b/packages/model-bank/src/modelProviders/qwen.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://help.aliyun.com/zh/model-studio/getting-started/models
const Qwen: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/replicate.ts b/packages/model-bank/src/modelProviders/replicate.ts
index 27beda17494..7f5a123bedb 100644
--- a/packages/model-bank/src/modelProviders/replicate.ts
+++ b/packages/model-bank/src/modelProviders/replicate.ts
@@ -1,10 +1,11 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// Ref: https://replicate.com/docs
const Replicate: ModelProviderCard = {
chatModels: [],
checkModel: 'black-forest-labs/flux-1.1-pro',
- description: 'Replicate runs open-source image models like FLUX and Stable Diffusion via a simple cloud API.',
+ description:
+ 'Replicate runs open-source image models like FLUX and Stable Diffusion via a simple cloud API.',
id: 'replicate',
modelList: { showModelFetcher: true },
modelsUrl: 'https://replicate.com/explore',
diff --git a/packages/model-bank/src/modelProviders/sambanova.ts b/packages/model-bank/src/modelProviders/sambanova.ts
index c2cc4644c04..54a0937720d 100644
--- a/packages/model-bank/src/modelProviders/sambanova.ts
+++ b/packages/model-bank/src/modelProviders/sambanova.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const SambaNova: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/search1api.ts b/packages/model-bank/src/modelProviders/search1api.ts
index 02285d7cc38..e3396edfc75 100644
--- a/packages/model-bank/src/modelProviders/search1api.ts
+++ b/packages/model-bank/src/modelProviders/search1api.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const Search1API: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/sensenova.ts b/packages/model-bank/src/modelProviders/sensenova.ts
index de3d1c35b17..a6edbab29d1 100644
--- a/packages/model-bank/src/modelProviders/sensenova.ts
+++ b/packages/model-bank/src/modelProviders/sensenova.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref https://platform.sensenova.cn/pricing
// ref https://platform.sensenova.cn/release?path=/release-202409.md
diff --git a/packages/model-bank/src/modelProviders/siliconcloud.ts b/packages/model-bank/src/modelProviders/siliconcloud.ts
index 3aee491b4dd..5b40c74c1bd 100644
--- a/packages/model-bank/src/modelProviders/siliconcloud.ts
+++ b/packages/model-bank/src/modelProviders/siliconcloud.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://siliconflow.cn/zh-cn/pricing
const SiliconCloud: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/spark.ts b/packages/model-bank/src/modelProviders/spark.ts
index 34374dced06..7a2a189a475 100644
--- a/packages/model-bank/src/modelProviders/spark.ts
+++ b/packages/model-bank/src/modelProviders/spark.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://www.xfyun.cn/doc/spark/HTTP%E8%B0%83%E7%94%A8%E6%96%87%E6%A1%A3.html#_3-%E8%AF%B7%E6%B1%82%E8%AF%B4%E6%98%8E
// ref: https://www.xfyun.cn/doc/spark/Web.html#_1-%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E
diff --git a/packages/model-bank/src/modelProviders/stepfun.ts b/packages/model-bank/src/modelProviders/stepfun.ts
index 031741b8bad..e0eaa784799 100644
--- a/packages/model-bank/src/modelProviders/stepfun.ts
+++ b/packages/model-bank/src/modelProviders/stepfun.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://platform.stepfun.com/docs/llm/text
// According to the documentation, for Stepfun models, the 'k' in context length refers to 1000
diff --git a/packages/model-bank/src/modelProviders/taichu.ts b/packages/model-bank/src/modelProviders/taichu.ts
index 5374d647b60..f1de9abd686 100644
--- a/packages/model-bank/src/modelProviders/taichu.ts
+++ b/packages/model-bank/src/modelProviders/taichu.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref :https://ai-maas.wair.ac.cn/#/doc
const Taichu: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/tencentcloud.ts b/packages/model-bank/src/modelProviders/tencentcloud.ts
index a85ccdf6c64..16c4b683647 100644
--- a/packages/model-bank/src/modelProviders/tencentcloud.ts
+++ b/packages/model-bank/src/modelProviders/tencentcloud.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const TencentCloud: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/togetherai.ts b/packages/model-bank/src/modelProviders/togetherai.ts
index 59c21a7a3dd..9756350002a 100644
--- a/packages/model-bank/src/modelProviders/togetherai.ts
+++ b/packages/model-bank/src/modelProviders/togetherai.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://docs.together.ai/docs/chat-models
// ref: https://www.together.ai/pricing
diff --git a/packages/model-bank/src/modelProviders/upstage.ts b/packages/model-bank/src/modelProviders/upstage.ts
index 754e6cdbc1c..75a846f8a01 100644
--- a/packages/model-bank/src/modelProviders/upstage.ts
+++ b/packages/model-bank/src/modelProviders/upstage.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref :https://developers.upstage.ai/docs/getting-started/models
const Upstage: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/v0.ts b/packages/model-bank/src/modelProviders/v0.ts
index 0b5f408e40b..6d02a59fd7c 100644
--- a/packages/model-bank/src/modelProviders/v0.ts
+++ b/packages/model-bank/src/modelProviders/v0.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const V0: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/vercelaigateway.ts b/packages/model-bank/src/modelProviders/vercelaigateway.ts
index 6677b9457e1..6e05648a458 100644
--- a/packages/model-bank/src/modelProviders/vercelaigateway.ts
+++ b/packages/model-bank/src/modelProviders/vercelaigateway.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const VercelAIGateway: ModelProviderCard = {
apiKeyUrl: 'https://vercel.com/dashboard/ai-gateway',
diff --git a/packages/model-bank/src/modelProviders/vertexai.ts b/packages/model-bank/src/modelProviders/vertexai.ts
index babf521bd7d..53d0e9d161b 100644
--- a/packages/model-bank/src/modelProviders/vertexai.ts
+++ b/packages/model-bank/src/modelProviders/vertexai.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://ai.google.dev/gemini-api/docs/models/gemini
const VertexAI: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/vllm.ts b/packages/model-bank/src/modelProviders/vllm.ts
index 7be2273b0d1..d33ddec7a5a 100644
--- a/packages/model-bank/src/modelProviders/vllm.ts
+++ b/packages/model-bank/src/modelProviders/vllm.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const VLLM: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/volcengine.ts b/packages/model-bank/src/modelProviders/volcengine.ts
index 9760f4e39aa..b3187e4db6a 100644
--- a/packages/model-bank/src/modelProviders/volcengine.ts
+++ b/packages/model-bank/src/modelProviders/volcengine.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref https://www.volcengine.com/docs/82379/1330310
const Doubao: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/wenxin.ts b/packages/model-bank/src/modelProviders/wenxin.ts
index bcac37dddb0..af0cedd1bb1 100644
--- a/packages/model-bank/src/modelProviders/wenxin.ts
+++ b/packages/model-bank/src/modelProviders/wenxin.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const BaiduWenxin: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/xai.ts b/packages/model-bank/src/modelProviders/xai.ts
index dbc4f84536a..b34e5a1e7e6 100644
--- a/packages/model-bank/src/modelProviders/xai.ts
+++ b/packages/model-bank/src/modelProviders/xai.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://x.ai/about
const XAI: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/xiaomimimo.ts b/packages/model-bank/src/modelProviders/xiaomimimo.ts
index 3fed7506981..14cbe4369ff 100644
--- a/packages/model-bank/src/modelProviders/xiaomimimo.ts
+++ b/packages/model-bank/src/modelProviders/xiaomimimo.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const XiaomiMiMo: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/xinference.ts b/packages/model-bank/src/modelProviders/xinference.ts
index 10dfcaa3dbf..0d82b4e9b5a 100644
--- a/packages/model-bank/src/modelProviders/xinference.ts
+++ b/packages/model-bank/src/modelProviders/xinference.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const Xinference: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/zenmux.ts b/packages/model-bank/src/modelProviders/zenmux.ts
index a7310b79185..86bb91cf568 100644
--- a/packages/model-bank/src/modelProviders/zenmux.ts
+++ b/packages/model-bank/src/modelProviders/zenmux.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const ZenMux: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/modelProviders/zeroone.ts b/packages/model-bank/src/modelProviders/zeroone.ts
index 1c8166f3ac6..3a7fe554e4e 100644
--- a/packages/model-bank/src/modelProviders/zeroone.ts
+++ b/packages/model-bank/src/modelProviders/zeroone.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
// ref: https://platform.lingyiwanwu.com/docs#%E6%A8%A1%E5%9E%8B%E4%B8%8E%E8%AE%A1%E8%B4%B9
const ZeroOne: ModelProviderCard = {
diff --git a/packages/model-bank/src/modelProviders/zhipu.ts b/packages/model-bank/src/modelProviders/zhipu.ts
index 54076ba6bb3..06e04181bdb 100644
--- a/packages/model-bank/src/modelProviders/zhipu.ts
+++ b/packages/model-bank/src/modelProviders/zhipu.ts
@@ -1,4 +1,4 @@
-import type {ModelProviderCard} from '@/types/llm';
+import type { ModelProviderCard } from '@/types/llm';
const ZhiPu: ModelProviderCard = {
chatModels: [],
diff --git a/packages/model-bank/src/standard-parameters/index.test.ts b/packages/model-bank/src/standard-parameters/index.test.ts
index a368ff6bf66..f511af8dbc6 100644
--- a/packages/model-bank/src/standard-parameters/index.test.ts
+++ b/packages/model-bank/src/standard-parameters/index.test.ts
@@ -1,12 +1,7 @@
import { describe, expect, it } from 'vitest';
-import type {
- ModelParamsSchema,RuntimeImageGenParams} from './index';
-import {
- extractDefaultValues,
- ModelParamsMetaSchema,
- validateModelParamsSchema
-} from './index';
+import type { ModelParamsSchema, RuntimeImageGenParams } from './index';
+import { extractDefaultValues, ModelParamsMetaSchema, validateModelParamsSchema } from './index';
describe('meta-schema', () => {
describe('ModelParamsMetaSchema', () => {
diff --git a/packages/model-runtime/src/core/BaseAI.ts b/packages/model-runtime/src/core/BaseAI.ts
index 18a7e89d28a..f5e47d7f871 100644
--- a/packages/model-runtime/src/core/BaseAI.ts
+++ b/packages/model-runtime/src/core/BaseAI.ts
@@ -25,7 +25,10 @@ export interface LobeRuntimeAI {
embeddings?: (payload: EmbeddingsPayload, options?: EmbeddingsOptions) => Promise<Embeddings[]>;
- generateObject?: (payload: GenerateObjectPayload, options?: GenerateObjectOptions) => Promise<any>;
+ generateObject?: (
+ payload: GenerateObjectPayload,
+ options?: GenerateObjectOptions,
+ ) => Promise<any>;
models?: () => Promise<any>;
diff --git a/packages/model-runtime/src/core/ModelRuntime.test.ts b/packages/model-runtime/src/core/ModelRuntime.test.ts
index e3946f5319f..bf3ecd80033 100644
--- a/packages/model-runtime/src/core/ModelRuntime.test.ts
+++ b/packages/model-runtime/src/core/ModelRuntime.test.ts
@@ -3,7 +3,7 @@ import type { ClientSecretPayload } from '@lobechat/types';
import { ModelProvider } from 'model-bank';
import { beforeEach, describe, expect, it, vi } from 'vitest';
-import type { ChatStreamCallbacks, ChatStreamPayload} from '../index';
+import type { ChatStreamCallbacks, ChatStreamPayload } from '../index';
import { LobeOpenAI, ModelRuntime } from '../index';
import { providerRuntimeMap } from '../runtimeMap';
import type { CreateImagePayload } from '../types/image';
diff --git a/packages/model-runtime/src/core/contextBuilders/google.ts b/packages/model-runtime/src/core/contextBuilders/google.ts
index 06adeeae887..9f9aaee9243 100644
--- a/packages/model-runtime/src/core/contextBuilders/google.ts
+++ b/packages/model-runtime/src/core/contextBuilders/google.ts
@@ -1,10 +1,10 @@
import type {
Content,
FunctionDeclaration,
- Part, Tool as GoogleFunctionCallTool} from '@google/genai';
-import {
- Type as SchemaType,
+ Part,
+ Tool as GoogleFunctionCallTool,
} from '@google/genai';
+import { Type as SchemaType } from '@google/genai';
import { imageUrlToBase64 } from '@lobechat/utils';
import type { ChatCompletionTool, OpenAIChatMessage, UserMessageContentPart } from '../../types';
diff --git a/packages/model-runtime/src/core/openaiCompatibleFactory/index.test.ts b/packages/model-runtime/src/core/openaiCompatibleFactory/index.test.ts
index 2c31fa8fe4f..4dabd0ad481 100644
--- a/packages/model-runtime/src/core/openaiCompatibleFactory/index.test.ts
+++ b/packages/model-runtime/src/core/openaiCompatibleFactory/index.test.ts
@@ -2,7 +2,7 @@
import { ModelProvider } from 'model-bank';
import OpenAI from 'openai';
import type { Stream } from 'openai/streaming';
-import type { Mock} from 'vitest';
+import type { Mock } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import type { LobeOpenAICompatibleRuntime } from '../../core/BaseAI';
@@ -161,7 +161,7 @@ describe('LobeOpenAICompatibleFactory', () => {
// Collect all chunks
const chunks = [];
-
+
while (true) {
const { value, done } = await reader.read();
if (done) break;
@@ -267,7 +267,6 @@ describe('LobeOpenAICompatibleFactory', () => {
const decoder = new TextDecoder();
const reader = result.body!.getReader();
-
while (true) {
const { value, done } = await reader.read();
if (done) break;
@@ -337,7 +336,6 @@ describe('LobeOpenAICompatibleFactory', () => {
const reader = result.body!.getReader();
const stream: string[] = [];
-
while (true) {
const { value, done } = await reader.read();
if (done) break;
@@ -411,7 +409,6 @@ describe('LobeOpenAICompatibleFactory', () => {
const reader = result.body!.getReader();
const stream: string[] = [];
-
while (true) {
const { value, done } = await reader.read();
if (done) break;
@@ -886,7 +883,6 @@ describe('LobeOpenAICompatibleFactory', () => {
const reader = readableStream.getReader();
const process = async () => {
try {
-
while (true) {
const { done, value } = await reader.read();
if (done) break;
@@ -2735,7 +2731,7 @@ describe('LobeOpenAICompatibleFactory', () => {
},
contextWindowTokens: 200_000,
description:
- "Claude 3 Haiku is Anthropic’s fastest and most compact model, designed for near-instant responses with fast, accurate performance.",
+ 'Claude 3 Haiku is Anthropic’s fastest and most compact model, designed for near-instant responses with fast, accurate performance.',
displayName: 'Claude 3 Haiku',
enabled: false,
id: 'claude-3-haiku-20240307',
@@ -2791,7 +2787,8 @@ describe('LobeOpenAICompatibleFactory', () => {
deploymentName: 'gpt-4o-mini',
},
contextWindowTokens: 128_000,
- description: 'GPT-4o Mini is a small, efficient model with performance similar to GPT-4o.',
+ description:
+ 'GPT-4o Mini is a small, efficient model with performance similar to GPT-4o.',
displayName: 'GPT 4o Mini',
enabled: false,
id: 'gpt-4o-mini',
diff --git a/packages/model-runtime/src/core/openaiCompatibleFactory/index.ts b/packages/model-runtime/src/core/openaiCompatibleFactory/index.ts
index d7d8c0a1d42..4424b88d04a 100644
--- a/packages/model-runtime/src/core/openaiCompatibleFactory/index.ts
+++ b/packages/model-runtime/src/core/openaiCompatibleFactory/index.ts
@@ -416,7 +416,7 @@ export const createOpenAICompatibleRuntime = <T extends Record<string, any> = an
) as any;
} else {
// Remove internal apiMode parameter before sending to API
-
+
const { apiMode: _, ...cleanedPayload } = postPayload as any;
const finalPayload = {
...cleanedPayload,
diff --git a/packages/model-runtime/src/core/streams/anthropic.ts b/packages/model-runtime/src/core/streams/anthropic.ts
index cf10aa98f8c..c9c7e41d242 100644
--- a/packages/model-runtime/src/core/streams/anthropic.ts
+++ b/packages/model-runtime/src/core/streams/anthropic.ts
@@ -9,12 +9,13 @@ import type {
StreamContext,
StreamProtocolChunk,
StreamProtocolToolCallChunk,
- StreamToolCallChunkData} from './protocol';
+ StreamToolCallChunkData,
+} from './protocol';
import {
convertIterableToStream,
createCallbacksTransformer,
createSSEProtocolTransformer,
- createTokenSpeedCalculator
+ createTokenSpeedCalculator,
} from './protocol';
export const transformAnthropicStream = (
diff --git a/packages/model-runtime/src/core/streams/bedrock/claude.ts b/packages/model-runtime/src/core/streams/bedrock/claude.ts
index 03af690a82a..51c2af38d89 100644
--- a/packages/model-runtime/src/core/streams/bedrock/claude.ts
+++ b/packages/model-runtime/src/core/streams/bedrock/claude.ts
@@ -3,12 +3,11 @@ import type { InvokeModelWithResponseStreamResponse } from '@aws-sdk/client-bedr
import type { ChatStreamCallbacks } from '../../../types';
import { nanoid } from '../../../utils/uuid';
import { transformAnthropicStream } from '../anthropic';
-import type {
- StreamContext} from '../protocol';
+import type { StreamContext } from '../protocol';
import {
createCallbacksTransformer,
createSSEProtocolTransformer,
- createTokenSpeedCalculator
+ createTokenSpeedCalculator,
} from '../protocol';
import { createBedrockStream } from './common';
diff --git a/packages/model-runtime/src/core/streams/bedrock/llama.ts b/packages/model-runtime/src/core/streams/bedrock/llama.ts
index 9ceb8217607..f869fdfb681 100644
--- a/packages/model-runtime/src/core/streams/bedrock/llama.ts
+++ b/packages/model-runtime/src/core/streams/bedrock/llama.ts
@@ -2,13 +2,8 @@ import type { InvokeModelWithResponseStreamResponse } from '@aws-sdk/client-bedr
import type { ChatStreamCallbacks } from '../../../types';
import { nanoid } from '../../../utils/uuid';
-import type {
- StreamContext,
- StreamProtocolChunk} from '../protocol';
-import {
- createCallbacksTransformer,
- createSSEProtocolTransformer
-} from '../protocol';
+import type { StreamContext, StreamProtocolChunk } from '../protocol';
+import { createCallbacksTransformer, createSSEProtocolTransformer } from '../protocol';
import { createBedrockStream } from './common';
interface AmazonBedrockInvocationMetrics {
diff --git a/packages/model-runtime/src/core/streams/google/index.ts b/packages/model-runtime/src/core/streams/google/index.ts
index 11b63efe5ac..9c3b1b3f194 100644
--- a/packages/model-runtime/src/core/streams/google/index.ts
+++ b/packages/model-runtime/src/core/streams/google/index.ts
@@ -9,12 +9,13 @@ import type {
StreamContext,
StreamPartChunkData,
StreamProtocolChunk,
- StreamToolCallChunkData} from '../protocol';
+ StreamToolCallChunkData,
+} from '../protocol';
import {
createCallbacksTransformer,
createSSEProtocolTransformer,
createTokenSpeedCalculator,
- generateToolCallId
+ generateToolCallId,
} from '../protocol';
import { GOOGLE_AI_BLOCK_REASON } from './const';
diff --git a/packages/model-runtime/src/core/streams/model.ts b/packages/model-runtime/src/core/streams/model.ts
index afff5a36d70..467d828ac38 100644
--- a/packages/model-runtime/src/core/streams/model.ts
+++ b/packages/model-runtime/src/core/streams/model.ts
@@ -35,7 +35,6 @@ export const createModelPullStream = <
const encoder = new TextEncoder();
try {
-
while (true) {
// Wait for the next data chunk or iteration completion
const { value: progress, done } = await iterator.next();
diff --git a/packages/model-runtime/src/core/streams/ollama.ts b/packages/model-runtime/src/core/streams/ollama.ts
index 6f2c0295863..bfa4a165176 100644
--- a/packages/model-runtime/src/core/streams/ollama.ts
+++ b/packages/model-runtime/src/core/streams/ollama.ts
@@ -2,13 +2,11 @@ import type { ChatResponse } from 'ollama/browser';
import type { ChatStreamCallbacks } from '../../types';
import { nanoid } from '../../utils/uuid';
-import type {
- StreamContext,
- StreamProtocolChunk} from './protocol';
+import type { StreamContext, StreamProtocolChunk } from './protocol';
import {
createCallbacksTransformer,
createSSEProtocolTransformer,
- generateToolCallId
+ generateToolCallId,
} from './protocol';
const transformOllamaStream = (chunk: ChatResponse, stack: StreamContext): StreamProtocolChunk => {
diff --git a/packages/model-runtime/src/core/streams/openai/openai.ts b/packages/model-runtime/src/core/streams/openai/openai.ts
index 83fa802bdc8..9deb3dd9f55 100644
--- a/packages/model-runtime/src/core/streams/openai/openai.ts
+++ b/packages/model-runtime/src/core/streams/openai/openai.ts
@@ -11,7 +11,8 @@ import type {
StreamContext,
StreamProtocolChunk,
StreamProtocolToolCallChunk,
- StreamToolCallChunkData} from '../protocol';
+ StreamToolCallChunkData,
+} from '../protocol';
import {
convertIterableToStream,
createCallbacksTransformer,
@@ -19,7 +20,7 @@ import {
createSSEProtocolTransformer,
createTokenSpeedCalculator,
FIRST_CHUNK_ERROR_KEY,
- generateToolCallId
+ generateToolCallId,
} from '../protocol';
/**
@@ -561,7 +562,6 @@ const transformOpenAIStream = (
},
type: errorName,
} as ChatMessageError;
-
return { data: errorData, id: chunk.id, type: 'error' };
}
diff --git a/packages/model-runtime/src/core/streams/openai/responsesStream.ts b/packages/model-runtime/src/core/streams/openai/responsesStream.ts
index 8be3e555689..7d3374cf72e 100644
--- a/packages/model-runtime/src/core/streams/openai/responsesStream.ts
+++ b/packages/model-runtime/src/core/streams/openai/responsesStream.ts
@@ -9,14 +9,15 @@ import type {
StreamContext,
StreamProtocolChunk,
StreamProtocolToolCallChunk,
- StreamToolCallChunkData} from '../protocol';
+ StreamToolCallChunkData,
+} from '../protocol';
import {
convertIterableToStream,
createCallbacksTransformer,
createFirstErrorHandleTransformer,
createSSEProtocolTransformer,
createTokenSpeedCalculator,
- FIRST_CHUNK_ERROR_KEY
+ FIRST_CHUNK_ERROR_KEY,
} from '../protocol';
import type { OpenAIStreamOptions } from './openai';
@@ -187,7 +188,6 @@ const transformOpenAIStream = (
},
type: errorName,
} as ChatMessageError;
-
return { data: errorData, id: streamContext.id, type: 'error' };
}
diff --git a/packages/model-runtime/src/core/streams/protocol.test.ts b/packages/model-runtime/src/core/streams/protocol.test.ts
index 47c4d9cdc2d..8f3b06d5cfa 100644
--- a/packages/model-runtime/src/core/streams/protocol.test.ts
+++ b/packages/model-runtime/src/core/streams/protocol.test.ts
@@ -99,7 +99,7 @@ describe('createSSEDataExtractor', () => {
it('should process large chunks of data correctly', async () => {
const transformer = createSSEDataExtractor();
- const messages = Array.from({length: 100})
+ const messages = Array.from({ length: 100 })
.fill(null)
.map((_, i) => `data: {"message": "message${i}"}\n`)
.join('');
diff --git a/packages/model-runtime/src/core/streams/qwen.ts b/packages/model-runtime/src/core/streams/qwen.ts
index 497b8c6af5d..62aab113e24 100644
--- a/packages/model-runtime/src/core/streams/qwen.ts
+++ b/packages/model-runtime/src/core/streams/qwen.ts
@@ -11,13 +11,14 @@ import type {
StreamContext,
StreamProtocolChunk,
StreamProtocolToolCallChunk,
- StreamToolCallChunkData} from './protocol';
+ StreamToolCallChunkData,
+} from './protocol';
import {
convertIterableToStream,
createCallbacksTransformer,
createSSEProtocolTransformer,
createTokenSpeedCalculator,
- generateToolCallId
+ generateToolCallId,
} from './protocol';
export const transformQwenStream = (
@@ -145,7 +146,7 @@ export const transformQwenStream = (
export const QwenAIStream = (
stream: Stream<OpenAI.ChatCompletionChunk> | ReadableStream,
// TODO: preserve for RFC 097
-
+
{
callbacks,
inputStartAt,
diff --git a/packages/model-runtime/src/core/streams/spark.ts b/packages/model-runtime/src/core/streams/spark.ts
index 830125b2fff..2f962843704 100644
--- a/packages/model-runtime/src/core/streams/spark.ts
+++ b/packages/model-runtime/src/core/streams/spark.ts
@@ -3,14 +3,12 @@ import type { Stream } from 'openai/streaming';
import type { ChatStreamCallbacks } from '../../types';
import { convertOpenAIUsage } from '../usageConverters';
-import type {
- StreamProtocolChunk,
- StreamProtocolToolCallChunk} from './protocol';
+import type { StreamProtocolChunk, StreamProtocolToolCallChunk } from './protocol';
import {
convertIterableToStream,
createCallbacksTransformer,
createSSEProtocolTransformer,
- generateToolCallId
+ generateToolCallId,
} from './protocol';
export function transformSparkResponseToStream(data: OpenAI.ChatCompletion) {
diff --git a/packages/model-runtime/src/core/streams/vertex-ai.ts b/packages/model-runtime/src/core/streams/vertex-ai.ts
index a210c8eff95..1491e16c7a6 100644
--- a/packages/model-runtime/src/core/streams/vertex-ai.ts
+++ b/packages/model-runtime/src/core/streams/vertex-ai.ts
@@ -3,16 +3,13 @@ import type { GroundingSearch } from '@lobechat/types';
import { nanoid } from '../../utils/uuid';
import { convertGoogleAIUsage } from '../usageConverters/google-ai';
-import type {GoogleAIStreamOptions} from './google';
-import type {
- ChatPayloadForTransformStream,
- StreamContext,
- StreamProtocolChunk} from './protocol';
+import type { GoogleAIStreamOptions } from './google';
+import type { ChatPayloadForTransformStream, StreamContext, StreamProtocolChunk } from './protocol';
import {
createCallbacksTransformer,
createSSEProtocolTransformer,
createTokenSpeedCalculator,
- generateToolCallId
+ generateToolCallId,
} from './protocol';
const transformVertexAIStream = (
diff --git a/packages/model-runtime/src/core/usageConverters/google-ai.test.ts b/packages/model-runtime/src/core/usageConverters/google-ai.test.ts
index 60132cff994..2625fc0466f 100644
--- a/packages/model-runtime/src/core/usageConverters/google-ai.test.ts
+++ b/packages/model-runtime/src/core/usageConverters/google-ai.test.ts
@@ -1,4 +1,4 @@
-import type { GenerateContentResponseUsageMetadata} from '@google/genai';
+import type { GenerateContentResponseUsageMetadata } from '@google/genai';
import { MediaModality } from '@google/genai';
import type { Pricing } from 'model-bank';
import { describe, expect, it } from 'vitest';
diff --git a/packages/model-runtime/src/core/usageConverters/google-ai.ts b/packages/model-runtime/src/core/usageConverters/google-ai.ts
index 2ff00867008..1791f263076 100644
--- a/packages/model-runtime/src/core/usageConverters/google-ai.ts
+++ b/packages/model-runtime/src/core/usageConverters/google-ai.ts
@@ -1,9 +1,5 @@
-import type {
- GenerateContentResponseUsageMetadata,
- ModalityTokenCount} from '@google/genai';
-import {
- MediaModality
-} from '@google/genai';
+import type { GenerateContentResponseUsageMetadata, ModalityTokenCount } from '@google/genai';
+import { MediaModality } from '@google/genai';
import type { ModelUsage } from '@lobechat/types';
import type { Pricing } from 'model-bank';
diff --git a/packages/model-runtime/src/core/usageConverters/utils/computeImageCost.test.ts b/packages/model-runtime/src/core/usageConverters/utils/computeImageCost.test.ts
index 4f8bbf8212a..19a73f65ba1 100644
--- a/packages/model-runtime/src/core/usageConverters/utils/computeImageCost.test.ts
+++ b/packages/model-runtime/src/core/usageConverters/utils/computeImageCost.test.ts
@@ -1,7 +1,7 @@
import type { Pricing } from 'model-bank';
import { describe, expect, it } from 'vitest';
-import type {ImageGenerationParams } from './computeImageCost';
+import type { ImageGenerationParams } from './computeImageCost';
import { computeImageCost } from './computeImageCost';
describe('computeImageCost', () => {
diff --git a/packages/model-runtime/src/helpers/mergeChatMethodOptions.ts b/packages/model-runtime/src/helpers/mergeChatMethodOptions.ts
index e1d9d9eaffd..87168d0d9be 100644
--- a/packages/model-runtime/src/helpers/mergeChatMethodOptions.ts
+++ b/packages/model-runtime/src/helpers/mergeChatMethodOptions.ts
@@ -5,104 +5,106 @@ import type { ChatMethodOptions } from '../types/chat';
const log = debug('model-runtime:helpers:mergeChatMethodOptions');
export const mergeMultipleChatMethodOptions = (options: ChatMethodOptions[]): ChatMethodOptions => {
- const completionOptions: ChatMethodOptions = { callback: {
- onCompletion: async (data) => {
- for (const option of options) {
- if (option.callback?.onCompletion) {
- try {
- await option.callback.onCompletion(data);
- } catch (error) {
- log('onCompletion callback error:');
- log(JSON.stringify(error));
+ const completionOptions: ChatMethodOptions = {
+ callback: {
+ onCompletion: async (data) => {
+ for (const option of options) {
+ if (option.callback?.onCompletion) {
+ try {
+ await option.callback.onCompletion(data);
+ } catch (error) {
+ log('onCompletion callback error:');
+ log(JSON.stringify(error));
+ }
}
}
- }
- },
- onFinal: async (data) => {
- for (const option of options) {
- if (option.callback?.onFinal) {
- try {
- await option.callback.onFinal(data);
- } catch (error) {
- log('onFinal callback error:');
- log(JSON.stringify(error));
+ },
+ onFinal: async (data) => {
+ for (const option of options) {
+ if (option.callback?.onFinal) {
+ try {
+ await option.callback.onFinal(data);
+ } catch (error) {
+ log('onFinal callback error:');
+ log(JSON.stringify(error));
+ }
}
}
- }
- },
- onGrounding: async (data) => {
- for (const option of options) {
- if (option.callback?.onGrounding) {
- try {
- await option.callback.onGrounding(data);
- } catch (error) {
- log('onGrounding callback error:');
- log(JSON.stringify(error));
+ },
+ onGrounding: async (data) => {
+ for (const option of options) {
+ if (option.callback?.onGrounding) {
+ try {
+ await option.callback.onGrounding(data);
+ } catch (error) {
+ log('onGrounding callback error:');
+ log(JSON.stringify(error));
+ }
}
}
- }
- },
- onStart: async () => {
- for (const option of options) {
- if (option.callback?.onStart) {
- try {
- await option.callback.onStart();
- } catch (error) {
- log('onStart callback error:');
- log(JSON.stringify(error));
+ },
+ onStart: async () => {
+ for (const option of options) {
+ if (option.callback?.onStart) {
+ try {
+ await option.callback.onStart();
+ } catch (error) {
+ log('onStart callback error:');
+ log(JSON.stringify(error));
+ }
}
}
- }
- },
- onText: async (data) => {
- for (const option of options) {
- if (option.callback?.onText) {
- try {
- await option.callback.onText(data);
- } catch (error) {
- log('onText callback error:');
- log(JSON.stringify(error));
+ },
+ onText: async (data) => {
+ for (const option of options) {
+ if (option.callback?.onText) {
+ try {
+ await option.callback.onText(data);
+ } catch (error) {
+ log('onText callback error:');
+ log(JSON.stringify(error));
+ }
}
}
- }
- },
- onThinking: async (data) => {
- for (const option of options) {
- if (option.callback?.onThinking) {
- try {
- await option.callback.onThinking(data);
- } catch (error) {
- log('onThinking callback error:');
- log(JSON.stringify(error));
+ },
+ onThinking: async (data) => {
+ for (const option of options) {
+ if (option.callback?.onThinking) {
+ try {
+ await option.callback.onThinking(data);
+ } catch (error) {
+ log('onThinking callback error:');
+ log(JSON.stringify(error));
+ }
}
}
- }
- },
- onToolsCalling: async (data) => {
- for (const option of options) {
- if (option.callback?.onToolsCalling) {
- try {
- await option.callback.onToolsCalling(data);
- } catch (error) {
- log('onToolsCalling callback error:');
- log(JSON.stringify(error));
+ },
+ onToolsCalling: async (data) => {
+ for (const option of options) {
+ if (option.callback?.onToolsCalling) {
+ try {
+ await option.callback.onToolsCalling(data);
+ } catch (error) {
+ log('onToolsCalling callback error:');
+ log(JSON.stringify(error));
+ }
}
}
- }
- },
- onUsage: async (data) => {
- for (const option of options) {
- if (option.callback?.onUsage) {
- try {
- await option.callback.onUsage(data);
- } catch (error) {
- log('onUsage callback error:');
- log(JSON.stringify(error));
+ },
+ onUsage: async (data) => {
+ for (const option of options) {
+ if (option.callback?.onUsage) {
+ try {
+ await option.callback.onUsage(data);
+ } catch (error) {
+ log('onUsage callback error:');
+ log(JSON.stringify(error));
+ }
}
}
- }
+ },
},
- },};
+ };
completionOptions.headers = options.reduce((acc, option) => {
if (option)
return {
diff --git a/packages/model-runtime/src/helpers/parseToolCalls.ts b/packages/model-runtime/src/helpers/parseToolCalls.ts
index 13caf0bde2b..cc434831d52 100644
--- a/packages/model-runtime/src/helpers/parseToolCalls.ts
+++ b/packages/model-runtime/src/helpers/parseToolCalls.ts
@@ -1,6 +1,6 @@
import { produce } from 'immer';
-import type { MessageToolCall, MessageToolCallChunk} from '../types';
+import type { MessageToolCall, MessageToolCallChunk } from '../types';
import { MessageToolCallSchema } from '../types';
export const parseToolCalls = (origin: MessageToolCall[], value: MessageToolCallChunk[]) =>
diff --git a/packages/model-runtime/src/providerTestUtils.ts b/packages/model-runtime/src/providerTestUtils.ts
index c876578bf43..9dc71c7c781 100644
--- a/packages/model-runtime/src/providerTestUtils.ts
+++ b/packages/model-runtime/src/providerTestUtils.ts
@@ -1,5 +1,5 @@
import OpenAI from 'openai';
-import type { Mock} from 'vitest';
+import type { Mock } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import type { LobeOpenAICompatibleRuntime } from './core/BaseAI';
diff --git a/packages/model-runtime/src/providers/ai302/index.ts b/packages/model-runtime/src/providers/ai302/index.ts
index 0c25e7d1633..b46dd9bbb98 100644
--- a/packages/model-runtime/src/providers/ai302/index.ts
+++ b/packages/model-runtime/src/providers/ai302/index.ts
@@ -1,10 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import type { ChatCompletionErrorPayload } from '../../types';
import { AgentRuntimeErrorType } from '../../types/error';
import { processMultiProviderModelList } from '../../utils/modelParse';
diff --git a/packages/model-runtime/src/providers/ai360/index.ts b/packages/model-runtime/src/providers/ai360/index.ts
index 3cfbaec71b0..3426cd51a73 100644
--- a/packages/model-runtime/src/providers/ai360/index.ts
+++ b/packages/model-runtime/src/providers/ai360/index.ts
@@ -1,11 +1,8 @@
import type { ChatModelCard } from '@lobechat/types';
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
export interface Ai360ModelCard {
id: string;
diff --git a/packages/model-runtime/src/providers/akashchat/index.ts b/packages/model-runtime/src/providers/akashchat/index.ts
index e067ad3b6de..8b570b0d7db 100644
--- a/packages/model-runtime/src/providers/akashchat/index.ts
+++ b/packages/model-runtime/src/providers/akashchat/index.ts
@@ -1,10 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { processMultiProviderModelList } from '../../utils/modelParse';
const THINKING_MODELS = new Set(['DeepSeek-V3-1']);
@@ -44,7 +41,7 @@ export const params = {
const rawList: any[] = modelsPage.data || [];
// Remove `created` field from each model item
-
+
const modelList: AkashChatModelCard[] = rawList.map(({ created: _, ...rest }) => rest);
return await processMultiProviderModelList(modelList, 'akashchat');
diff --git a/packages/model-runtime/src/providers/anthropic/index.test.ts b/packages/model-runtime/src/providers/anthropic/index.test.ts
index ce194554247..8e0212b5333 100644
--- a/packages/model-runtime/src/providers/anthropic/index.test.ts
+++ b/packages/model-runtime/src/providers/anthropic/index.test.ts
@@ -1,5 +1,5 @@
// @vitest-environment node
-import type { Mock} from 'vitest';
+import type { Mock } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { buildDefaultAnthropicPayload } from '../../core/anthropicCompatibleFactory';
diff --git a/packages/model-runtime/src/providers/azureOpenai/index.test.ts b/packages/model-runtime/src/providers/azureOpenai/index.test.ts
index b69f3155753..72456452654 100644
--- a/packages/model-runtime/src/providers/azureOpenai/index.test.ts
+++ b/packages/model-runtime/src/providers/azureOpenai/index.test.ts
@@ -1,6 +1,6 @@
// @vitest-environment node
import { AzureOpenAI } from 'openai';
-import type { Mock} from 'vitest';
+import type { Mock } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import * as openaiCompatibleFactoryModule from '../../core/openaiCompatibleFactory';
diff --git a/packages/model-runtime/src/providers/azureOpenai/index.ts b/packages/model-runtime/src/providers/azureOpenai/index.ts
index 87aae70198a..09f56aaef97 100644
--- a/packages/model-runtime/src/providers/azureOpenai/index.ts
+++ b/packages/model-runtime/src/providers/azureOpenai/index.ts
@@ -45,7 +45,7 @@ export class LobeAzureOpenAI implements LobeRuntimeAI {
async chat(payload: ChatStreamPayload, options?: ChatMethodOptions) {
// Remove internal apiMode parameter to prevent sending to Azure OpenAI API
-
+
const { messages, model, apiMode: _, ...params } = payload;
// o1 series models on Azure OpenAI does not support streaming currently
const enableStreaming = model.includes('o1') ? false : (params.stream ?? true);
diff --git a/packages/model-runtime/src/providers/azureai/index.ts b/packages/model-runtime/src/providers/azureai/index.ts
index 8f14ac6c920..2218e12f29e 100644
--- a/packages/model-runtime/src/providers/azureai/index.ts
+++ b/packages/model-runtime/src/providers/azureai/index.ts
@@ -9,7 +9,7 @@ import type OpenAI from 'openai';
import { systemToUserModels } from '../../const/models';
import type { LobeRuntimeAI } from '../../core/BaseAI';
import { transformResponseToStream } from '../../core/openaiCompatibleFactory';
-import { createSSEDataExtractor,OpenAIStream } from '../../core/streams';
+import { createSSEDataExtractor, OpenAIStream } from '../../core/streams';
import type { ChatMethodOptions, ChatStreamPayload } from '../../types';
import { AgentRuntimeErrorType } from '../../types/error';
import { AgentRuntimeError } from '../../utils/createError';
@@ -39,7 +39,7 @@ export class LobeAzureAI implements LobeRuntimeAI {
async chat(payload: ChatStreamPayload, options?: ChatMethodOptions) {
// Remove internal apiMode parameter to prevent sending to Azure AI API
-
+
const { messages, model, temperature, top_p, apiMode: _, ...params } = payload;
// o1 series models on Azure OpenAI does not support streaming currently
const enableStreaming = model.includes('o1') ? false : (params.stream ?? true);
diff --git a/packages/model-runtime/src/providers/baichuan/index.test.ts b/packages/model-runtime/src/providers/baichuan/index.test.ts
index 0d785266fcc..324a77f998e 100644
--- a/packages/model-runtime/src/providers/baichuan/index.test.ts
+++ b/packages/model-runtime/src/providers/baichuan/index.test.ts
@@ -1,6 +1,6 @@
// @vitest-environment node
import { ModelProvider } from 'model-bank';
-import type { Mock} from 'vitest';
+import type { Mock } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import type { LobeOpenAICompatibleRuntime } from '../../core/BaseAI';
diff --git a/packages/model-runtime/src/providers/baichuan/index.ts b/packages/model-runtime/src/providers/baichuan/index.ts
index 7b3f3527915..5af3aae6332 100644
--- a/packages/model-runtime/src/providers/baichuan/index.ts
+++ b/packages/model-runtime/src/providers/baichuan/index.ts
@@ -1,11 +1,8 @@
import type { ChatModelCard } from '@lobechat/types';
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { resolveParameters } from '../../core/parameterResolver';
import type { ChatStreamPayload } from '../../types';
diff --git a/packages/model-runtime/src/providers/bedrock/index.test.ts b/packages/model-runtime/src/providers/bedrock/index.test.ts
index 7bb453093b5..529f6960750 100644
--- a/packages/model-runtime/src/providers/bedrock/index.test.ts
+++ b/packages/model-runtime/src/providers/bedrock/index.test.ts
@@ -4,12 +4,12 @@ import {
InvokeModelWithResponseStreamCommand,
} from '@aws-sdk/client-bedrock-runtime';
import { ModelProvider } from 'model-bank';
-import type { Mock} from 'vitest';
+import type { Mock } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { AgentRuntimeErrorType } from '../../types/error';
import * as debugStreamModule from '../../utils/debugStream';
-import { experimental_buildLlama2Prompt,LobeBedrockAI } from './index';
+import { experimental_buildLlama2Prompt, LobeBedrockAI } from './index';
// Mock the console.error to avoid polluting test output
vi.spyOn(console, 'error').mockImplementation(() => {});
diff --git a/packages/model-runtime/src/providers/bfl/createImage.ts b/packages/model-runtime/src/providers/bfl/createImage.ts
index 0ce6b2e6014..a9d4f5b8ad6 100644
--- a/packages/model-runtime/src/providers/bfl/createImage.ts
+++ b/packages/model-runtime/src/providers/bfl/createImage.ts
@@ -4,19 +4,12 @@ import type { RuntimeImageGenParamsValue } from 'model-bank';
import { AgentRuntimeErrorType } from '../../types/error';
import type { CreateImagePayload, CreateImageResponse } from '../../types/image';
-import type {TaskResult} from '../../utils/asyncifyPolling';
+import type { TaskResult } from '../../utils/asyncifyPolling';
import { asyncifyPolling } from '../../utils/asyncifyPolling';
import { AgentRuntimeError } from '../../utils/createError';
import { parseDataUri } from '../../utils/uriParser';
-import type {
- BflAsyncResponse,
- BflModelId,
- BflRequest,
- BflResultResponse} from './types';
-import {
- BFL_ENDPOINTS,
- BflStatusResponse,
-} from './types';
+import type { BflAsyncResponse, BflModelId, BflRequest, BflResultResponse } from './types';
+import { BFL_ENDPOINTS, BflStatusResponse } from './types';
const log = createDebug('lobe-image:bfl');
diff --git a/packages/model-runtime/src/providers/cerebras/index.ts b/packages/model-runtime/src/providers/cerebras/index.ts
index 0f83e3c379d..c4de3f7fa8a 100644
--- a/packages/model-runtime/src/providers/cerebras/index.ts
+++ b/packages/model-runtime/src/providers/cerebras/index.ts
@@ -1,10 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { processMultiProviderModelList } from '../../utils/modelParse';
export const params = {
diff --git a/packages/model-runtime/src/providers/cloudflare/index.test.ts b/packages/model-runtime/src/providers/cloudflare/index.test.ts
index 6db8b38a8a4..f94aa8714fb 100644
--- a/packages/model-runtime/src/providers/cloudflare/index.test.ts
+++ b/packages/model-runtime/src/providers/cloudflare/index.test.ts
@@ -1,5 +1,5 @@
// @vitest-environment node
-import type { Mock} from 'vitest';
+import type { Mock } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import type { ChatCompletionTool } from '../../types/chat';
diff --git a/packages/model-runtime/src/providers/cloudflare/index.ts b/packages/model-runtime/src/providers/cloudflare/index.ts
index 15ab1af6a14..83239cd900b 100644
--- a/packages/model-runtime/src/providers/cloudflare/index.ts
+++ b/packages/model-runtime/src/providers/cloudflare/index.ts
@@ -58,7 +58,7 @@ export class LobeCloudflareAI implements LobeRuntimeAI {
async chat(payload: ChatStreamPayload, options?: ChatMethodOptions): Promise<Response> {
try {
// Remove internal apiMode parameter to prevent sending to Cloudflare API
-
+
const { model, tools, apiMode: _, ...restPayload } = payload;
const functions = tools?.map((tool) => tool.function);
const headers = options?.headers || {};
diff --git a/packages/model-runtime/src/providers/cohere/index.ts b/packages/model-runtime/src/providers/cohere/index.ts
index 9dc2c361a08..d0979fff48a 100644
--- a/packages/model-runtime/src/providers/cohere/index.ts
+++ b/packages/model-runtime/src/providers/cohere/index.ts
@@ -1,11 +1,8 @@
import type { ChatModelCard } from '@lobechat/types';
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { resolveParameters } from '../../core/parameterResolver';
export interface CohereModelCard {
diff --git a/packages/model-runtime/src/providers/cometapi/index.ts b/packages/model-runtime/src/providers/cometapi/index.ts
index 12bec5616a2..29e6191cde4 100644
--- a/packages/model-runtime/src/providers/cometapi/index.ts
+++ b/packages/model-runtime/src/providers/cometapi/index.ts
@@ -1,10 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { processMultiProviderModelList } from '../../utils/modelParse';
export interface CometAPIModelCard {
diff --git a/packages/model-runtime/src/providers/comfyui/index.ts b/packages/model-runtime/src/providers/comfyui/index.ts
index ecf28f69e15..abf381047c8 100644
--- a/packages/model-runtime/src/providers/comfyui/index.ts
+++ b/packages/model-runtime/src/providers/comfyui/index.ts
@@ -3,7 +3,11 @@ import { createBasicAuthCredentials } from '@lobechat/utils';
import debug from 'debug';
import type { LobeRuntimeAI } from '../../core/BaseAI';
-import type { AuthenticatedImageRuntime, CreateImagePayload, CreateImageResponse } from '../../types';
+import type {
+ AuthenticatedImageRuntime,
+ CreateImagePayload,
+ CreateImageResponse,
+} from '../../types';
import { parseComfyUIErrorMessage } from '../../utils/comfyuiErrorParser';
import { AgentRuntimeError } from '../../utils/createError';
diff --git a/packages/model-runtime/src/providers/deepseek/index.ts b/packages/model-runtime/src/providers/deepseek/index.ts
index 28ee69c50c3..a5a9b18f7cd 100644
--- a/packages/model-runtime/src/providers/deepseek/index.ts
+++ b/packages/model-runtime/src/providers/deepseek/index.ts
@@ -1,9 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { MODEL_LIST_CONFIGS, processModelList } from '../../utils/modelParse';
export interface DeepSeekModelCard {
diff --git a/packages/model-runtime/src/providers/fireworksai/index.test.ts b/packages/model-runtime/src/providers/fireworksai/index.test.ts
index 4d3bdcb5178..2ef2521e7f8 100644
--- a/packages/model-runtime/src/providers/fireworksai/index.test.ts
+++ b/packages/model-runtime/src/providers/fireworksai/index.test.ts
@@ -3,7 +3,7 @@ import { ModelProvider } from 'model-bank';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { testProvider } from '../../providerTestUtils';
-import type { FireworksAIModelCard} from './index';
+import type { FireworksAIModelCard } from './index';
import { LobeFireworksAI, params } from './index';
const provider = ModelProvider.FireworksAI;
diff --git a/packages/model-runtime/src/providers/fireworksai/index.ts b/packages/model-runtime/src/providers/fireworksai/index.ts
index 102e3d6be56..62d9ed66b33 100644
--- a/packages/model-runtime/src/providers/fireworksai/index.ts
+++ b/packages/model-runtime/src/providers/fireworksai/index.ts
@@ -1,11 +1,8 @@
import type { ChatModelCard } from '@lobechat/types';
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
export interface FireworksAIModelCard {
context_length: number;
diff --git a/packages/model-runtime/src/providers/giteeai/index.ts b/packages/model-runtime/src/providers/giteeai/index.ts
index 673404fca71..0ab6b07d635 100644
--- a/packages/model-runtime/src/providers/giteeai/index.ts
+++ b/packages/model-runtime/src/providers/giteeai/index.ts
@@ -1,10 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { processMultiProviderModelList } from '../../utils/modelParse';
export interface GiteeAIModelCard {
diff --git a/packages/model-runtime/src/providers/github/index.test.ts b/packages/model-runtime/src/providers/github/index.test.ts
index b3c5efa0bcb..b9e49e0fd53 100644
--- a/packages/model-runtime/src/providers/github/index.test.ts
+++ b/packages/model-runtime/src/providers/github/index.test.ts
@@ -3,7 +3,7 @@ import { ModelProvider } from 'model-bank';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { testProvider } from '../../providerTestUtils';
-import type { GithubModelCard} from './index';
+import type { GithubModelCard } from './index';
import { LobeGithubAI, params } from './index';
// Basic provider tests
diff --git a/packages/model-runtime/src/providers/github/index.ts b/packages/model-runtime/src/providers/github/index.ts
index 5b46792e41e..db49c2f8bdd 100644
--- a/packages/model-runtime/src/providers/github/index.ts
+++ b/packages/model-runtime/src/providers/github/index.ts
@@ -1,11 +1,8 @@
import { ModelProvider } from 'model-bank';
import { pruneReasoningPayload } from '../../core/contextBuilders/openai';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { AgentRuntimeErrorType } from '../../types/error';
import { processMultiProviderModelList } from '../../utils/modelParse';
diff --git a/packages/model-runtime/src/providers/google/createImage.test.ts b/packages/model-runtime/src/providers/google/createImage.test.ts
index 29130e9cb9e..d89119a37b4 100644
--- a/packages/model-runtime/src/providers/google/createImage.test.ts
+++ b/packages/model-runtime/src/providers/google/createImage.test.ts
@@ -12,7 +12,7 @@ const noImageErrorType = 'ProviderNoImageGenerated';
const invalidErrorType = 'InvalidProviderAPIKey';
// Mock the console.error to avoid polluting test output
-vi.spyOn(console, 'error').mockImplementation(() => { });
+vi.spyOn(console, 'error').mockImplementation(() => {});
let mockClient: GoogleGenAI;
diff --git a/packages/model-runtime/src/providers/google/generateObject.ts b/packages/model-runtime/src/providers/google/generateObject.ts
index 0a23ca32467..f9698625a7d 100644
--- a/packages/model-runtime/src/providers/google/generateObject.ts
+++ b/packages/model-runtime/src/providers/google/generateObject.ts
@@ -1,10 +1,5 @@
-import type {
- GenerateContentConfig,
- GoogleGenAI} from '@google/genai';
-import {
- FunctionCallingConfigMode,
- Type as SchemaType,
-} from '@google/genai';
+import type { GenerateContentConfig, GoogleGenAI } from '@google/genai';
+import { FunctionCallingConfigMode, Type as SchemaType } from '@google/genai';
import Debug from 'debug';
import { buildGoogleTool } from '../../core/contextBuilders/google';
diff --git a/packages/model-runtime/src/providers/google/index.ts b/packages/model-runtime/src/providers/google/index.ts
index c0cc674b194..9cfc370380a 100644
--- a/packages/model-runtime/src/providers/google/index.ts
+++ b/packages/model-runtime/src/providers/google/index.ts
@@ -1,10 +1,10 @@
import type {
GenerateContentConfig,
HttpOptions,
- ThinkingConfig, Tool as GoogleFunctionCallTool} from '@google/genai';
-import {
- GoogleGenAI
+ ThinkingConfig,
+ Tool as GoogleFunctionCallTool,
} from '@google/genai';
+import { GoogleGenAI } from '@google/genai';
import debug from 'debug';
import type { LobeRuntimeAI } from '../../core/BaseAI';
diff --git a/packages/model-runtime/src/providers/groq/index.ts b/packages/model-runtime/src/providers/groq/index.ts
index a497fd2dc74..42e1e380516 100644
--- a/packages/model-runtime/src/providers/groq/index.ts
+++ b/packages/model-runtime/src/providers/groq/index.ts
@@ -1,10 +1,8 @@
import type { ChatModelCard } from '@lobechat/types';
import { ModelProvider } from 'model-bank';
-import type {OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { resolveParameters } from '../../core/parameterResolver';
import { AgentRuntimeErrorType } from '../../types/error';
diff --git a/packages/model-runtime/src/providers/higress/index.ts b/packages/model-runtime/src/providers/higress/index.ts
index 3911c9f0e7f..0f324559108 100644
--- a/packages/model-runtime/src/providers/higress/index.ts
+++ b/packages/model-runtime/src/providers/higress/index.ts
@@ -2,11 +2,8 @@ import type { ChatModelCard } from '@lobechat/types';
import { uniqueId } from 'es-toolkit/compat';
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
export interface HigressModelCard {
context_length: number;
diff --git a/packages/model-runtime/src/providers/huggingface/index.ts b/packages/model-runtime/src/providers/huggingface/index.ts
index 5f23dba2c0c..037205ab3b1 100644
--- a/packages/model-runtime/src/providers/huggingface/index.ts
+++ b/packages/model-runtime/src/providers/huggingface/index.ts
@@ -3,11 +3,8 @@ import { ModelProvider } from 'model-bank';
import urlJoin from 'url-join';
import { convertOpenAIMessagesToHFFormat } from '../../core/contextBuilders/huggingface';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { convertIterableToStream } from '../../core/streams';
import { AgentRuntimeErrorType } from '../../types/error';
import { processMultiProviderModelList } from '../../utils/modelParse';
diff --git a/packages/model-runtime/src/providers/hunyuan/index.ts b/packages/model-runtime/src/providers/hunyuan/index.ts
index 2cc99b20aa6..80c2e2e4d38 100644
--- a/packages/model-runtime/src/providers/hunyuan/index.ts
+++ b/packages/model-runtime/src/providers/hunyuan/index.ts
@@ -1,11 +1,8 @@
import type { ChatModelCard } from '@lobechat/types';
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
export interface HunyuanModelCard {
id: string;
diff --git a/packages/model-runtime/src/providers/internlm/index.ts b/packages/model-runtime/src/providers/internlm/index.ts
index db71e847df0..78a0ed6aa4c 100644
--- a/packages/model-runtime/src/providers/internlm/index.ts
+++ b/packages/model-runtime/src/providers/internlm/index.ts
@@ -1,10 +1,8 @@
import type { ChatModelCard } from '@lobechat/types';
import { ModelProvider } from 'model-bank';
-import type {OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
export interface InternLMModelCard {
id: string;
diff --git a/packages/model-runtime/src/providers/jina/index.test.ts b/packages/model-runtime/src/providers/jina/index.test.ts
index ba8fbf508f3..b279905c10a 100644
--- a/packages/model-runtime/src/providers/jina/index.test.ts
+++ b/packages/model-runtime/src/providers/jina/index.test.ts
@@ -3,7 +3,7 @@ import { ModelProvider } from 'model-bank';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { testProvider } from '../../providerTestUtils';
-import type { JinaModelCard} from './index';
+import type { JinaModelCard } from './index';
import { LobeJinaAI, params } from './index';
const provider = ModelProvider.Jina;
diff --git a/packages/model-runtime/src/providers/jina/index.ts b/packages/model-runtime/src/providers/jina/index.ts
index 7dd1af90b5a..8c7f8a2f489 100644
--- a/packages/model-runtime/src/providers/jina/index.ts
+++ b/packages/model-runtime/src/providers/jina/index.ts
@@ -1,11 +1,8 @@
import type { ChatModelCard } from '@lobechat/types';
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
export interface JinaModelCard {
id: string;
diff --git a/packages/model-runtime/src/providers/lmstudio/index.ts b/packages/model-runtime/src/providers/lmstudio/index.ts
index 9cc014d86a4..ad07d37ad2b 100644
--- a/packages/model-runtime/src/providers/lmstudio/index.ts
+++ b/packages/model-runtime/src/providers/lmstudio/index.ts
@@ -1,11 +1,8 @@
import type { ChatModelCard } from '@lobechat/types';
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
export interface LMStudioModelCard {
id: string;
diff --git a/packages/model-runtime/src/providers/minimax/index.ts b/packages/model-runtime/src/providers/minimax/index.ts
index 32828dd3605..288aedf5740 100644
--- a/packages/model-runtime/src/providers/minimax/index.ts
+++ b/packages/model-runtime/src/providers/minimax/index.ts
@@ -1,4 +1,4 @@
-import { minimax as minimaxChatModels,ModelProvider } from 'model-bank';
+import { minimax as minimaxChatModels, ModelProvider } from 'model-bank';
import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { resolveParameters } from '../../core/parameterResolver';
diff --git a/packages/model-runtime/src/providers/mistral/index.ts b/packages/model-runtime/src/providers/mistral/index.ts
index d79fc754834..be14ee091a9 100644
--- a/packages/model-runtime/src/providers/mistral/index.ts
+++ b/packages/model-runtime/src/providers/mistral/index.ts
@@ -1,11 +1,8 @@
import type { ChatModelCard } from '@lobechat/types';
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { resolveParameters } from '../../core/parameterResolver';
export interface MistralModelCard {
diff --git a/packages/model-runtime/src/providers/modelscope/index.test.ts b/packages/model-runtime/src/providers/modelscope/index.test.ts
index 96c43945179..dae3f92c8ab 100644
--- a/packages/model-runtime/src/providers/modelscope/index.test.ts
+++ b/packages/model-runtime/src/providers/modelscope/index.test.ts
@@ -3,7 +3,7 @@ import { ModelProvider } from 'model-bank';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { testProvider } from '../../providerTestUtils';
-import type { ModelScopeModelCard} from './index';
+import type { ModelScopeModelCard } from './index';
import { LobeModelScopeAI, params } from './index';
const provider = ModelProvider.ModelScope;
diff --git a/packages/model-runtime/src/providers/modelscope/index.ts b/packages/model-runtime/src/providers/modelscope/index.ts
index bfb5ba7ca1b..06dfada8623 100644
--- a/packages/model-runtime/src/providers/modelscope/index.ts
+++ b/packages/model-runtime/src/providers/modelscope/index.ts
@@ -1,10 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { processMultiProviderModelList } from '../../utils/modelParse';
export interface ModelScopeModelCard {
diff --git a/packages/model-runtime/src/providers/nebius/index.ts b/packages/model-runtime/src/providers/nebius/index.ts
index cc716afac1c..55c80e0a054 100644
--- a/packages/model-runtime/src/providers/nebius/index.ts
+++ b/packages/model-runtime/src/providers/nebius/index.ts
@@ -1,10 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { processMultiProviderModelList } from '../../utils/modelParse';
export interface NebiusModelCard {
diff --git a/packages/model-runtime/src/providers/newapi/index.test.ts b/packages/model-runtime/src/providers/newapi/index.test.ts
index c2b1255c547..b5c21e28d37 100644
--- a/packages/model-runtime/src/providers/newapi/index.test.ts
+++ b/packages/model-runtime/src/providers/newapi/index.test.ts
@@ -1,12 +1,12 @@
// @vitest-environment node
import { ModelProvider } from 'model-bank';
-import type { Mock} from 'vitest';
+import type { Mock } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { responsesAPIModels } from '../../const/models';
import type { ChatStreamPayload } from '../../types/chat';
import * as modelParseModule from '../../utils/modelParse';
-import type { NewAPIModelCard, NewAPIPricing} from './index';
+import type { NewAPIModelCard, NewAPIPricing } from './index';
import { LobeNewAPIAI, params } from './index';
// Mock external dependencies
@@ -361,9 +361,13 @@ describe('NewAPI Runtime - 100% Branch Coverage', () => {
const model = { supported_endpoint_types: ['anthropic'] };
let detectedProvider = 'openai';
- if (model.supported_endpoint_types && model.supported_endpoint_types.length > 0 && model.supported_endpoint_types.includes('anthropic')) {
- detectedProvider = 'anthropic';
- }
+ if (
+ model.supported_endpoint_types &&
+ model.supported_endpoint_types.length > 0 &&
+ model.supported_endpoint_types.includes('anthropic')
+ ) {
+ detectedProvider = 'anthropic';
+ }
expect(detectedProvider).toBe('anthropic');
});
@@ -372,9 +376,13 @@ describe('NewAPI Runtime - 100% Branch Coverage', () => {
const model = { supported_endpoint_types: ['gemini'] };
let detectedProvider = 'openai';
- if (model.supported_endpoint_types && model.supported_endpoint_types.length > 0 && model.supported_endpoint_types.includes('gemini')) {
- detectedProvider = 'google';
- }
+ if (
+ model.supported_endpoint_types &&
+ model.supported_endpoint_types.length > 0 &&
+ model.supported_endpoint_types.includes('gemini')
+ ) {
+ detectedProvider = 'google';
+ }
expect(detectedProvider).toBe('google');
});
@@ -383,9 +391,13 @@ describe('NewAPI Runtime - 100% Branch Coverage', () => {
const model = { supported_endpoint_types: ['xai'] };
let detectedProvider = 'openai';
- if (model.supported_endpoint_types && model.supported_endpoint_types.length > 0 && model.supported_endpoint_types.includes('xai')) {
- detectedProvider = 'xai';
- }
+ if (
+ model.supported_endpoint_types &&
+ model.supported_endpoint_types.length > 0 &&
+ model.supported_endpoint_types.includes('xai')
+ ) {
+ detectedProvider = 'xai';
+ }
expect(detectedProvider).toBe('xai');
});
diff --git a/packages/model-runtime/src/providers/novita/index.test.ts b/packages/model-runtime/src/providers/novita/index.test.ts
index 10da0c584c5..e404e9da311 100644
--- a/packages/model-runtime/src/providers/novita/index.test.ts
+++ b/packages/model-runtime/src/providers/novita/index.test.ts
@@ -1,6 +1,6 @@
// @vitest-environment node
import { ModelProvider } from 'model-bank';
-import type { Mock} from 'vitest';
+import type { Mock } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import type { LobeOpenAICompatibleRuntime } from '../../core/BaseAI';
diff --git a/packages/model-runtime/src/providers/novita/index.ts b/packages/model-runtime/src/providers/novita/index.ts
index c7a4a511fc1..ce799154188 100644
--- a/packages/model-runtime/src/providers/novita/index.ts
+++ b/packages/model-runtime/src/providers/novita/index.ts
@@ -29,7 +29,9 @@ export const LobeNovitaAI = createOpenAICompatibleRuntime({
const formattedModels = modelList.map((m) => {
const mm = m as any;
const features: string[] = Array.isArray(mm.features) ? mm.features : [];
- const inputModalities: string[] = Array.isArray(mm.input_modalities) ? mm.input_modalities : [];
+ const inputModalities: string[] = Array.isArray(mm.input_modalities)
+ ? mm.input_modalities
+ : [];
return {
contextWindowTokens: mm.context_size ?? mm.max_output_tokens ?? undefined,
diff --git a/packages/model-runtime/src/providers/nvidia/index.ts b/packages/model-runtime/src/providers/nvidia/index.ts
index 19d1310465c..f1ed28aaeb5 100644
--- a/packages/model-runtime/src/providers/nvidia/index.ts
+++ b/packages/model-runtime/src/providers/nvidia/index.ts
@@ -1,13 +1,13 @@
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { processMultiProviderModelList } from '../../utils/modelParse';
-const THINKING_MODELS = new Set(['deepseek-ai/deepseek-v3.1', 'deepseek-ai/deepseek-v3.1-terminus']);
+const THINKING_MODELS = new Set([
+ 'deepseek-ai/deepseek-v3.1',
+ 'deepseek-ai/deepseek-v3.1-terminus',
+]);
export interface NvidiaModelCard {
id: string;
diff --git a/packages/model-runtime/src/providers/ollama/index.ts b/packages/model-runtime/src/providers/ollama/index.ts
index 48eaebfcefe..713cf4d4d51 100644
--- a/packages/model-runtime/src/providers/ollama/index.ts
+++ b/packages/model-runtime/src/providers/ollama/index.ts
@@ -6,7 +6,7 @@ import { Ollama } from 'ollama/browser';
import type { ClientOptions } from 'openai';
import type { LobeRuntimeAI } from '../../core/BaseAI';
-import { convertIterableToStream, createModelPullStream,OllamaStream } from '../../core/streams';
+import { convertIterableToStream, createModelPullStream, OllamaStream } from '../../core/streams';
import type {
ChatMethodOptions,
ChatStreamPayload,
@@ -233,7 +233,6 @@ export class LobeOllamaAI implements LobeRuntimeAI {
const { model, insecure } = params;
const signal = options?.signal; // 获取传入的 AbortSignal
-
const abortOllama = () => {
// 假设 this.client.abort() 是幂等的或者可以安全地多次调用
this.client.abort();
diff --git a/packages/model-runtime/src/providers/ollamacloud/index.ts b/packages/model-runtime/src/providers/ollamacloud/index.ts
index 671f03ed2f1..70d3fae5f23 100644
--- a/packages/model-runtime/src/providers/ollamacloud/index.ts
+++ b/packages/model-runtime/src/providers/ollamacloud/index.ts
@@ -1,10 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { processMultiProviderModelList } from '../../utils/modelParse';
export const params = {
diff --git a/packages/model-runtime/src/providers/openai/index.test.ts b/packages/model-runtime/src/providers/openai/index.test.ts
index 404227d0dd2..b5a0e914763 100644
--- a/packages/model-runtime/src/providers/openai/index.test.ts
+++ b/packages/model-runtime/src/providers/openai/index.test.ts
@@ -1,6 +1,6 @@
// @vitest-environment node
import OpenAI from 'openai';
-import type { Mock} from 'vitest';
+import type { Mock } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import * as debugStreamModule from '../../utils/debugStream';
diff --git a/packages/model-runtime/src/providers/openai/index.ts b/packages/model-runtime/src/providers/openai/index.ts
index 9a889a25e8f..e1e19224201 100644
--- a/packages/model-runtime/src/providers/openai/index.ts
+++ b/packages/model-runtime/src/providers/openai/index.ts
@@ -2,11 +2,8 @@ import { ModelProvider } from 'model-bank';
import { responsesAPIModels } from '../../const/models';
import { pruneReasoningPayload } from '../../core/contextBuilders/openai';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import type { ChatStreamPayload } from '../../types';
import { processMultiProviderModelList } from '../../utils/modelParse';
diff --git a/packages/model-runtime/src/providers/openrouter/index.ts b/packages/model-runtime/src/providers/openrouter/index.ts
index 55f5ccf27d2..a6fbf658780 100644
--- a/packages/model-runtime/src/providers/openrouter/index.ts
+++ b/packages/model-runtime/src/providers/openrouter/index.ts
@@ -1,10 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { processMultiProviderModelList } from '../../utils/modelParse';
import type { OpenRouterModelCard, OpenRouterReasoning } from './type';
@@ -17,12 +14,16 @@ export const params = {
baseURL: 'https://openrouter.ai/api/v1',
chatCompletion: {
handlePayload: (payload) => {
-
const { reasoning_effort, thinking, reasoning: _reasoning, thinkingLevel, ...rest } = payload;
let reasoning: OpenRouterReasoning | undefined;
- if (thinking?.type || thinking?.budget_tokens !== undefined || reasoning_effort || thinkingLevel) {
+ if (
+ thinking?.type ||
+ thinking?.budget_tokens !== undefined ||
+ reasoning_effort ||
+ thinkingLevel
+ ) {
if (thinking?.type === 'disabled') {
reasoning = { enabled: false };
} else if (thinking?.budget_tokens !== undefined) {
@@ -31,8 +32,7 @@ export const params = {
};
} else if (reasoning_effort) {
reasoning = { effort: reasoning_effort };
- }
- else if (thinkingLevel) {
+ } else if (thinkingLevel) {
reasoning = { effort: thinkingLevel };
}
}
diff --git a/packages/model-runtime/src/providers/ppio/index.test.ts b/packages/model-runtime/src/providers/ppio/index.test.ts
index 7daecbabd3d..dba09a42921 100644
--- a/packages/model-runtime/src/providers/ppio/index.test.ts
+++ b/packages/model-runtime/src/providers/ppio/index.test.ts
@@ -1,6 +1,6 @@
// @vitest-environment node
import { ModelProvider } from 'model-bank';
-import type { Mock} from 'vitest';
+import type { Mock } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import type { LobeOpenAICompatibleRuntime } from '../../core/BaseAI';
diff --git a/packages/model-runtime/src/providers/qiniu/index.ts b/packages/model-runtime/src/providers/qiniu/index.ts
index 3ed6eb8fa46..92b30a4ea4a 100644
--- a/packages/model-runtime/src/providers/qiniu/index.ts
+++ b/packages/model-runtime/src/providers/qiniu/index.ts
@@ -1,10 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { processMultiProviderModelList } from '../../utils/modelParse';
export const params = {
diff --git a/packages/model-runtime/src/providers/qwen/createImage.ts b/packages/model-runtime/src/providers/qwen/createImage.ts
index 6d2955683b3..4213ac7126f 100644
--- a/packages/model-runtime/src/providers/qwen/createImage.ts
+++ b/packages/model-runtime/src/providers/qwen/createImage.ts
@@ -2,7 +2,7 @@ import createDebug from 'debug';
import type { CreateImageOptions } from '../../core/openaiCompatibleFactory';
import type { CreateImagePayload, CreateImageResponse } from '../../types/image';
-import type {TaskResult} from '../../utils/asyncifyPolling';
+import type { TaskResult } from '../../utils/asyncifyPolling';
import { asyncifyPolling } from '../../utils/asyncifyPolling';
import { AgentRuntimeError } from '../../utils/createError';
diff --git a/packages/model-runtime/src/providers/replicate/index.ts b/packages/model-runtime/src/providers/replicate/index.ts
index 0a83283ef65..827c16826bd 100644
--- a/packages/model-runtime/src/providers/replicate/index.ts
+++ b/packages/model-runtime/src/providers/replicate/index.ts
@@ -416,7 +416,6 @@ export class LobeReplicateAI implements LobeRuntimeAI {
if (!isReplicateDebug) return;
-
console.log(...args);
}
}
diff --git a/packages/model-runtime/src/providers/search1api/index.ts b/packages/model-runtime/src/providers/search1api/index.ts
index fbacf242ec5..df12f9b82d1 100644
--- a/packages/model-runtime/src/providers/search1api/index.ts
+++ b/packages/model-runtime/src/providers/search1api/index.ts
@@ -2,10 +2,8 @@ import type { ChatModelCard } from '@lobechat/types';
import { ModelProvider } from 'model-bank';
import type OpenAI from 'openai';
-import type {OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import type { ChatStreamPayload } from '../../types';
export interface Search1APIModelCard {
diff --git a/packages/model-runtime/src/providers/sensenova/index.ts b/packages/model-runtime/src/providers/sensenova/index.ts
index 514a0db2ff4..1adb8a3591a 100644
--- a/packages/model-runtime/src/providers/sensenova/index.ts
+++ b/packages/model-runtime/src/providers/sensenova/index.ts
@@ -2,11 +2,8 @@ import type { ChatModelCard } from '@lobechat/types';
import { ModelProvider } from 'model-bank';
import { convertSenseNovaMessage } from '../../core/contextBuilders/sensenova';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
export interface SenseNovaModelCard {
id: string;
diff --git a/packages/model-runtime/src/providers/siliconcloud/index.ts b/packages/model-runtime/src/providers/siliconcloud/index.ts
index 16aaab07cf8..38f3013f672 100644
--- a/packages/model-runtime/src/providers/siliconcloud/index.ts
+++ b/packages/model-runtime/src/providers/siliconcloud/index.ts
@@ -1,10 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import type { ChatCompletionErrorPayload } from '../../types';
import { AgentRuntimeErrorType } from '../../types/error';
import { processMultiProviderModelList } from '../../utils/modelParse';
diff --git a/packages/model-runtime/src/providers/spark/index.ts b/packages/model-runtime/src/providers/spark/index.ts
index 02d03977bd0..aaf98b55628 100644
--- a/packages/model-runtime/src/providers/spark/index.ts
+++ b/packages/model-runtime/src/providers/spark/index.ts
@@ -1,10 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { SparkAIStream, transformSparkResponseToStream } from '../../core/streams';
import type { ChatStreamPayload } from '../../types';
diff --git a/packages/model-runtime/src/providers/stepfun/index.ts b/packages/model-runtime/src/providers/stepfun/index.ts
index 8f76af8f99e..fcb87aaefd0 100644
--- a/packages/model-runtime/src/providers/stepfun/index.ts
+++ b/packages/model-runtime/src/providers/stepfun/index.ts
@@ -1,11 +1,8 @@
import type { ChatModelCard } from '@lobechat/types';
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
export interface StepfunModelCard {
id: string;
diff --git a/packages/model-runtime/src/providers/tencentcloud/index.test.ts b/packages/model-runtime/src/providers/tencentcloud/index.test.ts
index 04782931c5a..dc36e1e8b89 100644
--- a/packages/model-runtime/src/providers/tencentcloud/index.test.ts
+++ b/packages/model-runtime/src/providers/tencentcloud/index.test.ts
@@ -3,7 +3,7 @@ import { ModelProvider } from 'model-bank';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { testProvider } from '../../providerTestUtils';
-import type {TencentCloudModelCard } from './index';
+import type { TencentCloudModelCard } from './index';
import { LobeTencentCloudAI, params } from './index';
const provider = ModelProvider.TencentCloud;
diff --git a/packages/model-runtime/src/providers/tencentcloud/index.ts b/packages/model-runtime/src/providers/tencentcloud/index.ts
index 5dc9007e838..8ccb4d3d582 100644
--- a/packages/model-runtime/src/providers/tencentcloud/index.ts
+++ b/packages/model-runtime/src/providers/tencentcloud/index.ts
@@ -1,11 +1,8 @@
import type { ChatModelCard } from '@lobechat/types';
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
export interface TencentCloudModelCard {
id: string;
diff --git a/packages/model-runtime/src/providers/togetherai/index.test.ts b/packages/model-runtime/src/providers/togetherai/index.test.ts
index fe3fcab302d..2b182b78d22 100644
--- a/packages/model-runtime/src/providers/togetherai/index.test.ts
+++ b/packages/model-runtime/src/providers/togetherai/index.test.ts
@@ -3,7 +3,7 @@ import { ModelProvider } from 'model-bank';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { testProvider } from '../../providerTestUtils';
-import type {TogetherAIModel } from './index';
+import type { TogetherAIModel } from './index';
import { LobeTogetherAI, params } from './index';
const provider = ModelProvider.TogetherAI;
diff --git a/packages/model-runtime/src/providers/togetherai/index.ts b/packages/model-runtime/src/providers/togetherai/index.ts
index 00739e598c8..efea9560abc 100644
--- a/packages/model-runtime/src/providers/togetherai/index.ts
+++ b/packages/model-runtime/src/providers/togetherai/index.ts
@@ -1,11 +1,8 @@
import type { ChatModelCard } from '@lobechat/types';
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import type { TogetherAIModel } from './type';
export const params = {
diff --git a/packages/model-runtime/src/providers/v0/index.ts b/packages/model-runtime/src/providers/v0/index.ts
index d739c3c9cc1..a15b4498fc2 100644
--- a/packages/model-runtime/src/providers/v0/index.ts
+++ b/packages/model-runtime/src/providers/v0/index.ts
@@ -1,10 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { MODEL_LIST_CONFIGS, processModelList } from '../../utils/modelParse';
export interface V0ModelCard {
diff --git a/packages/model-runtime/src/providers/vercelaigateway/index.test.ts b/packages/model-runtime/src/providers/vercelaigateway/index.test.ts
index 3e8b11bce60..7ada7e24632 100644
--- a/packages/model-runtime/src/providers/vercelaigateway/index.test.ts
+++ b/packages/model-runtime/src/providers/vercelaigateway/index.test.ts
@@ -3,7 +3,7 @@ import { ModelProvider } from 'model-bank';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { testProvider } from '../../providerTestUtils';
-import type {VercelAIGatewayModelCard } from './index';
+import type { VercelAIGatewayModelCard } from './index';
import { formatPrice, LobeVercelAIGatewayAI, params } from './index';
testProvider({
diff --git a/packages/model-runtime/src/providers/vercelaigateway/index.ts b/packages/model-runtime/src/providers/vercelaigateway/index.ts
index 07fcb8c3393..17ed2d7d804 100644
--- a/packages/model-runtime/src/providers/vercelaigateway/index.ts
+++ b/packages/model-runtime/src/providers/vercelaigateway/index.ts
@@ -1,9 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { processMultiProviderModelList } from '../../utils/modelParse';
export interface VercelAIGatewayModelCard {
@@ -40,7 +38,6 @@ export const params = {
baseURL: 'https://ai-gateway.vercel.sh/v1',
chatCompletion: {
handlePayload: (payload) => {
-
const { reasoning_effort, thinking, reasoning: _reasoning, verbosity, ...rest } = payload;
let reasoning: VercelAIGatewayReasoning | undefined;
@@ -125,7 +122,12 @@ export const params = {
// Merge all applicable extendParams for settings
...(() => {
const extendParams: string[] = [];
- if (tags.includes('reasoning') && m.id.includes('gpt-5') && !m.id.includes('gpt-5.1') && !m.id.includes('gpt-5.2')) {
+ if (
+ tags.includes('reasoning') &&
+ m.id.includes('gpt-5') &&
+ !m.id.includes('gpt-5.1') &&
+ !m.id.includes('gpt-5.2')
+ ) {
extendParams.push('gpt5ReasoningEffort', 'textVerbosity');
}
if (tags.includes('reasoning') && m.id.includes('gpt-5.1') && !m.id.includes('gpt-5.2')) {
diff --git a/packages/model-runtime/src/providers/wenxin/index.ts b/packages/model-runtime/src/providers/wenxin/index.ts
index 57f9f91477f..33c50e58c04 100644
--- a/packages/model-runtime/src/providers/wenxin/index.ts
+++ b/packages/model-runtime/src/providers/wenxin/index.ts
@@ -1,10 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { processMultiProviderModelList } from '../../utils/modelParse';
export interface WenxinModelCard {
diff --git a/packages/model-runtime/src/providers/xai/index.test.ts b/packages/model-runtime/src/providers/xai/index.test.ts
index 0605b77f406..2794be705fa 100644
--- a/packages/model-runtime/src/providers/xai/index.test.ts
+++ b/packages/model-runtime/src/providers/xai/index.test.ts
@@ -4,7 +4,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest';
import { testProvider } from '../../providerTestUtils';
import type { XAIModelCard } from './index';
-import { isGrokReasoningModel,LobeXAI } from './index';
+import { isGrokReasoningModel, LobeXAI } from './index';
testProvider({
Runtime: LobeXAI,
diff --git a/packages/model-runtime/src/providers/xiaomimimo/index.ts b/packages/model-runtime/src/providers/xiaomimimo/index.ts
index bc7f75e74a8..2a2cdb9de96 100644
--- a/packages/model-runtime/src/providers/xiaomimimo/index.ts
+++ b/packages/model-runtime/src/providers/xiaomimimo/index.ts
@@ -1,9 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { MODEL_LIST_CONFIGS, processModelList } from '../../utils/modelParse';
const clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));
diff --git a/packages/model-runtime/src/providers/zenmux/index.test.ts b/packages/model-runtime/src/providers/zenmux/index.test.ts
index 704a96ebe24..d4ffa022fcd 100644
--- a/packages/model-runtime/src/providers/zenmux/index.test.ts
+++ b/packages/model-runtime/src/providers/zenmux/index.test.ts
@@ -1,6 +1,6 @@
// @vitest-environment node
import { ModelProvider } from 'model-bank';
-import type { Mock} from 'vitest';
+import type { Mock } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import * as modelParseModule from '../../utils/modelParse';
diff --git a/packages/model-runtime/src/providers/zeroone/index.ts b/packages/model-runtime/src/providers/zeroone/index.ts
index 2b4793b3897..2fa14f5ca93 100644
--- a/packages/model-runtime/src/providers/zeroone/index.ts
+++ b/packages/model-runtime/src/providers/zeroone/index.ts
@@ -1,10 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {
- OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { MODEL_LIST_CONFIGS, processModelList } from '../../utils/modelParse';
export interface ZeroOneModelCard {
diff --git a/packages/model-runtime/src/providers/zhipu/index.ts b/packages/model-runtime/src/providers/zhipu/index.ts
index 0d6e792c139..5561139e27e 100644
--- a/packages/model-runtime/src/providers/zhipu/index.ts
+++ b/packages/model-runtime/src/providers/zhipu/index.ts
@@ -1,9 +1,7 @@
import { ModelProvider } from 'model-bank';
-import type {OpenAICompatibleFactoryOptions} from '../../core/openaiCompatibleFactory';
-import {
- createOpenAICompatibleRuntime
-} from '../../core/openaiCompatibleFactory';
+import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { resolveParameters } from '../../core/parameterResolver';
import { OpenAIStream } from '../../core/streams/openai';
import { convertIterableToStream } from '../../core/streams/protocol';
diff --git a/packages/model-runtime/src/types/error.ts b/packages/model-runtime/src/types/error.ts
index a663c09bfc0..99e5c82e498 100644
--- a/packages/model-runtime/src/types/error.ts
+++ b/packages/model-runtime/src/types/error.ts
@@ -19,7 +19,6 @@ export const StandardErrorType = {
ServiceUnavailable: 503,
GatewayTimeout: 504,
} as const;
-
export type ErrorType = (typeof StandardErrorType)[keyof typeof StandardErrorType];
diff --git a/packages/model-runtime/src/utils/asyncifyPolling.test.ts b/packages/model-runtime/src/utils/asyncifyPolling.test.ts
index 69b32721f44..4320cd43e8a 100644
--- a/packages/model-runtime/src/utils/asyncifyPolling.test.ts
+++ b/packages/model-runtime/src/utils/asyncifyPolling.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it, vi } from 'vitest';
-import type {TaskResult} from './asyncifyPolling';
+import type { TaskResult } from './asyncifyPolling';
import { asyncifyPolling } from './asyncifyPolling';
describe('asyncifyPolling', () => {
diff --git a/packages/model-runtime/src/utils/consumeStream.ts b/packages/model-runtime/src/utils/consumeStream.ts
index 35ec0de97df..3ef356eb510 100644
--- a/packages/model-runtime/src/utils/consumeStream.ts
+++ b/packages/model-runtime/src/utils/consumeStream.ts
@@ -24,7 +24,6 @@ export async function consumeStreamUntilDone(response: Response): Promise<void>
const reader = response.body.getReader();
try {
-
while (true) {
const { done } = await reader.read();
if (done) break;
diff --git a/packages/model-runtime/src/utils/googleErrorParser.ts b/packages/model-runtime/src/utils/googleErrorParser.ts
index dbe33e9d09c..baa78f6f55a 100644
--- a/packages/model-runtime/src/utils/googleErrorParser.ts
+++ b/packages/model-runtime/src/utils/googleErrorParser.ts
@@ -44,7 +44,7 @@ export function extractStatusCodeFromError(message: string): {
// We need to find a bracket that contains a status code (3-digit number followed by space and text)
let searchStart = 0;
-
+
while (true) {
const openBracketIndex = message.indexOf('[', searchStart);
if (openBracketIndex === -1) {
diff --git a/packages/model-runtime/src/utils/modelParse.ts b/packages/model-runtime/src/utils/modelParse.ts
index 64437914529..f6ef6d66cf5 100644
--- a/packages/model-runtime/src/utils/modelParse.ts
+++ b/packages/model-runtime/src/utils/modelParse.ts
@@ -1,5 +1,5 @@
import type { ChatModelCard } from '@lobechat/types';
-import type { AIBaseModelCard,AiModelSettings, ExtendParamsType } from 'model-bank';
+import type { AIBaseModelCard, AiModelSettings, ExtendParamsType } from 'model-bank';
import type { ModelProviderKey } from '../types';
diff --git a/packages/model-runtime/src/utils/postProcessModelList.ts b/packages/model-runtime/src/utils/postProcessModelList.ts
index deaf80686a4..93f640a551c 100644
--- a/packages/model-runtime/src/utils/postProcessModelList.ts
+++ b/packages/model-runtime/src/utils/postProcessModelList.ts
@@ -1,6 +1,6 @@
import type { ChatModelCard } from '@lobechat/types';
import { omit } from 'es-toolkit/compat';
-import type { AiModelType} from 'model-bank';
+import type { AiModelType } from 'model-bank';
import { CHAT_MODEL_IMAGE_GENERATION_PARAMS } from 'model-bank';
// Whitelist for automatic image model generation
diff --git a/packages/model-runtime/src/utils/safeParseJSON.test.ts b/packages/model-runtime/src/utils/safeParseJSON.test.ts
index df7ef31772b..3c9b4e77cc6 100644
--- a/packages/model-runtime/src/utils/safeParseJSON.test.ts
+++ b/packages/model-runtime/src/utils/safeParseJSON.test.ts
@@ -51,7 +51,7 @@ describe('safeParseJSON', () => {
});
it('should parse large JSON without throwing an error', () => {
- const largeJSON = JSON.stringify({ data: Array.from({length: 1000}).fill('test') });
+ const largeJSON = JSON.stringify({ data: Array.from({ length: 1000 }).fill('test') });
const result = safeParseJSON(largeJSON);
expect(result).toHaveProperty('data');
expect(Array.isArray(result!.data)).toBe(true);
diff --git a/packages/model-runtime/src/utils/sanitizeError.ts b/packages/model-runtime/src/utils/sanitizeError.ts
index 8a3f5b0b17a..08f08fbcbbe 100644
--- a/packages/model-runtime/src/utils/sanitizeError.ts
+++ b/packages/model-runtime/src/utils/sanitizeError.ts
@@ -40,7 +40,7 @@ export function sanitizeError(error: any): any {
if (error.hasOwnProperty(key)) {
const value = error[key];
const lowerKey = key.toLowerCase();
-
+
// Skip sensitive fields entirely
if (sensitiveFields.includes(lowerKey)) {
continue;
@@ -56,4 +56,4 @@ export function sanitizeError(error: any): any {
}
return sanitized;
-}
\ No newline at end of file
+}
diff --git a/packages/observability-otel/src/node.ts b/packages/observability-otel/src/node.ts
index e851db53035..e6d0e43c8e5 100644
--- a/packages/observability-otel/src/node.ts
+++ b/packages/observability-otel/src/node.ts
@@ -1,13 +1,13 @@
/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
import { env } from 'node:process';
-import { diag,DiagConsoleLogger, DiagLogLevel } from '@opentelemetry/api';
+import { diag, DiagConsoleLogger, DiagLogLevel } from '@opentelemetry/api';
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-http';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
import { PgInstrumentation } from '@opentelemetry/instrumentation-pg';
-import type { DetectedResourceAttributes} from '@opentelemetry/resources';
+import type { DetectedResourceAttributes } from '@opentelemetry/resources';
import { resourceFromAttributes } from '@opentelemetry/resources';
import { PeriodicExportingMetricReader } from '@opentelemetry/sdk-metrics';
import { NodeSDK } from '@opentelemetry/sdk-node';
diff --git a/packages/prompts/promptfoo/supervisor/productive/prompt.ts b/packages/prompts/promptfoo/supervisor/productive/prompt.ts
index ca84a77bc38..de927f73503 100644
--- a/packages/prompts/promptfoo/supervisor/productive/prompt.ts
+++ b/packages/prompts/promptfoo/supervisor/productive/prompt.ts
@@ -1,5 +1,5 @@
// TypeScript prompt wrapper that uses actual buildSupervisorPrompt implementation
-import type {SupervisorPromptParams} from '../../../src';
+import type { SupervisorPromptParams } from '../../../src';
import { buildSupervisorPrompt } from '../../../src';
const generatePrompt = ({
diff --git a/packages/prompts/src/chains/__tests__/rewriteQuery.test.ts b/packages/prompts/src/chains/__tests__/rewriteQuery.test.ts
index a2173d4687e..56a72681edf 100644
--- a/packages/prompts/src/chains/__tests__/rewriteQuery.test.ts
+++ b/packages/prompts/src/chains/__tests__/rewriteQuery.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
// Mock DEFAULT_REWRITE_QUERY
-import { chainRewriteQuery,DEFAULT_REWRITE_QUERY } from '../rewriteQuery';
+import { chainRewriteQuery, DEFAULT_REWRITE_QUERY } from '../rewriteQuery';
describe('chainRewriteQuery', () => {
it('should generate correct chat payload with default instruction', () => {
diff --git a/packages/prompts/src/prompts/knowledgeBaseQA/index.test.ts b/packages/prompts/src/prompts/knowledgeBaseQA/index.test.ts
index a8ed7ff335e..3f4fa2f6316 100644
--- a/packages/prompts/src/prompts/knowledgeBaseQA/index.test.ts
+++ b/packages/prompts/src/prompts/knowledgeBaseQA/index.test.ts
@@ -1,4 +1,4 @@
-import type { ChatSemanticSearchChunk, KnowledgeItem} from '@lobechat/types';
+import type { ChatSemanticSearchChunk, KnowledgeItem } from '@lobechat/types';
import { KnowledgeType } from '@lobechat/types';
import { describe, expect, it } from 'vitest';
diff --git a/packages/prompts/src/prompts/messagesToText/index.test.ts b/packages/prompts/src/prompts/messagesToText/index.test.ts
index 86040380e2f..112df8f6de8 100644
--- a/packages/prompts/src/prompts/messagesToText/index.test.ts
+++ b/packages/prompts/src/prompts/messagesToText/index.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';
-import type {Message } from './index';
+import type { Message } from './index';
import { conversationToText } from './index';
describe('conversationToText', () => {
diff --git a/packages/prompts/src/prompts/plugin/index.ts b/packages/prompts/src/prompts/plugin/index.ts
index b3d21b2ceeb..a31fff1fa27 100644
--- a/packages/prompts/src/prompts/plugin/index.ts
+++ b/packages/prompts/src/prompts/plugin/index.ts
@@ -1,4 +1,4 @@
-import type { Tool} from './tools';
+import type { Tool } from './tools';
import { toolsPrompts } from './tools';
export const pluginPrompts = ({ tools }: { tools: Tool[] }) => {
@@ -9,4 +9,4 @@ ${toolsPrompts(tools)}
return prompt.trim();
};
-export { type API, apiPrompt, type Tool, toolPrompt, toolsPrompts } from './tools';
\ No newline at end of file
+export { type API, apiPrompt, type Tool, toolPrompt, toolsPrompts } from './tools';
diff --git a/packages/prompts/src/prompts/plugin/tools.test.ts b/packages/prompts/src/prompts/plugin/tools.test.ts
index 7699a022ca2..1db0e91d069 100644
--- a/packages/prompts/src/prompts/plugin/tools.test.ts
+++ b/packages/prompts/src/prompts/plugin/tools.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';
-import type { Tool} from './tools';
+import type { Tool } from './tools';
import { apiPrompt, toolPrompt, toolsPrompts } from './tools';
describe('Prompt Generation Utils', () => {
diff --git a/packages/prompts/src/prompts/userMemory/index.ts b/packages/prompts/src/prompts/userMemory/index.ts
index 26c00a72330..203aa0ca1de 100644
--- a/packages/prompts/src/prompts/userMemory/index.ts
+++ b/packages/prompts/src/prompts/userMemory/index.ts
@@ -130,8 +130,9 @@ export const promptUserMemory = ({ memories }: PromptUserMemoryOptions): string
return '';
}
- const contentParts: string[] = [
- '<instruction>The following are memories about this user retrieved from previous conversations. Use this information to personalize your responses and maintain continuity.</instruction>'];
+ const contentParts: string[] = [
+ '<instruction>The following are memories about this user retrieved from previous conversations. Use this information to personalize your responses and maintain continuity.</instruction>',
+ ];
// Add instruction
diff --git a/packages/python-interpreter/src/worker.ts b/packages/python-interpreter/src/worker.ts
index 82c63ea37c1..ecf170631fa 100644
--- a/packages/python-interpreter/src/worker.ts
+++ b/packages/python-interpreter/src/worker.ts
@@ -1,11 +1,10 @@
import * as Comlink from 'comlink';
-import type { loadPyodide as loadPyodideType,PyodideAPI } from 'pyodide';
+import type { loadPyodide as loadPyodideType, PyodideAPI } from 'pyodide';
import urlJoin from 'url-join';
import type { PythonOptions, PythonOutput, PythonResult } from './types';
declare global {
-
var loadPyodide: typeof loadPyodideType;
}
diff --git a/packages/ssrf-safe-fetch/index.browser.ts b/packages/ssrf-safe-fetch/index.browser.ts
index f0dcb8c0db3..bff68e5c10e 100644
--- a/packages/ssrf-safe-fetch/index.browser.ts
+++ b/packages/ssrf-safe-fetch/index.browser.ts
@@ -24,11 +24,10 @@ export interface SSRFOptions {
*/
export const ssrfSafeFetch = async (
url: string,
-
+
options?: RequestInit,
-
+
_ssrfOptions?: SSRFOptions,
-
): Promise<Response> => {
return fetch(url, options);
};
diff --git a/packages/ssrf-safe-fetch/index.ts b/packages/ssrf-safe-fetch/index.ts
index 01f61075b7b..5a9871acfc1 100644
--- a/packages/ssrf-safe-fetch/index.ts
+++ b/packages/ssrf-safe-fetch/index.ts
@@ -1,10 +1,6 @@
import fetch from 'node-fetch';
-import type {
- RequestFilteringAgentOptions} from 'request-filtering-agent';
-import {
- RequestFilteringHttpAgent,
- RequestFilteringHttpsAgent,
-} from 'request-filtering-agent';
+import type { RequestFilteringAgentOptions } from 'request-filtering-agent';
+import { RequestFilteringHttpAgent, RequestFilteringHttpsAgent } from 'request-filtering-agent';
/**
* Options for per-call SSRF configuration overrides
@@ -27,10 +23,9 @@ export interface SSRFOptions {
*/
export const ssrfSafeFetch = async (
url: string,
-
+
options?: RequestInit,
ssrfOptions?: SSRFOptions,
-
): Promise<Response> => {
try {
// Configure SSRF protection options with proper precedence using nullish coalescing
diff --git a/packages/types/src/aiChat.ts b/packages/types/src/aiChat.ts
index a9f9a9ce84a..96a2da72e92 100644
--- a/packages/types/src/aiChat.ts
+++ b/packages/types/src/aiChat.ts
@@ -1,13 +1,13 @@
import { z } from 'zod';
import type { UIChatMessage } from './message';
-import type { PageSelection} from './message/ui/params';
+import type { PageSelection } from './message/ui/params';
import { PageSelectionSchema } from './message/ui/params';
import type { OpenAIChatMessage } from './openai/chat';
-import type { LobeUniformTool} from './tool';
+import type { LobeUniformTool } from './tool';
import { LobeUniformToolSchema } from './tool';
import type { ChatTopic } from './topic';
-import type { IThreadType} from './topic/thread';
+import type { IThreadType } from './topic/thread';
import { ThreadType } from './topic/thread';
export interface SendNewMessage {
diff --git a/packages/types/src/auth.ts b/packages/types/src/auth.ts
index 6fff8bd2c45..9abec050b55 100644
--- a/packages/types/src/auth.ts
+++ b/packages/types/src/auth.ts
@@ -47,4 +47,3 @@ export interface ClientSecretPayload {
vertexAIRegion?: string;
}
-
diff --git a/packages/types/src/fetch.ts b/packages/types/src/fetch.ts
index 08343a9b0fe..4a355343603 100644
--- a/packages/types/src/fetch.ts
+++ b/packages/types/src/fetch.ts
@@ -37,7 +37,6 @@ export const ChatErrorType = {
ServiceUnavailable: 503,
GatewayTimeout: 504,
} as const;
-
export type ErrorType = (typeof ChatErrorType)[keyof typeof ChatErrorType];
diff --git a/packages/types/src/message/db/params.ts b/packages/types/src/message/db/params.ts
index 69d8d583b63..f522590b984 100644
--- a/packages/types/src/message/db/params.ts
+++ b/packages/types/src/message/db/params.ts
@@ -1,7 +1,7 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import { z } from 'zod';
-import type { GroundingSearch} from '../../search';
+import type { GroundingSearch } from '../../search';
import { GroundingSearchSchema } from '../../search';
import type {
ChatImageItem,
@@ -9,7 +9,8 @@ import type {
ChatToolPayload,
MessageMetadata,
MessageToolCall,
- ModelReasoning} from '../common';
+ ModelReasoning,
+} from '../common';
import {
ChatImageItemSchema,
ChatMessageErrorSchema,
diff --git a/packages/types/src/message/ui/params.ts b/packages/types/src/message/ui/params.ts
index 4de50acfa13..459db2f45ea 100644
--- a/packages/types/src/message/ui/params.ts
+++ b/packages/types/src/message/ui/params.ts
@@ -4,11 +4,11 @@ import { z } from 'zod';
import type { ConversationContext } from '../../conversation';
import type { UploadFileItem } from '../../files';
import type { MessageSemanticSearchChunk } from '../../rag';
-import type { ChatMessageError} from '../common/base';
+import type { ChatMessageError } from '../common/base';
import { ChatMessageErrorSchema } from '../common/base';
// Import for local use
import type { PageSelection } from '../common/pageSelection';
-import type { ChatPluginPayload} from '../common/tools';
+import type { ChatPluginPayload } from '../common/tools';
import { ToolInterventionSchema } from '../common/tools';
import type { UIChatMessage } from './chat';
import { SemanticSearchChunkSchema } from './rag';
diff --git a/packages/types/src/plugins/mcp.ts b/packages/types/src/plugins/mcp.ts
index 0d34d641036..2af502f152e 100644
--- a/packages/types/src/plugins/mcp.ts
+++ b/packages/types/src/plugins/mcp.ts
@@ -18,7 +18,6 @@ export enum MCPInstallStep {
INSTALLING_PLUGIN = 'INSTALLING_PLUGIN',
}
-
export interface CheckMcpInstallParams {
/**
* Installation details
diff --git a/packages/types/src/tool/plugin.ts b/packages/types/src/tool/plugin.ts
index 0f5f26d8144..66989ddd5a7 100644
--- a/packages/types/src/tool/plugin.ts
+++ b/packages/types/src/tool/plugin.ts
@@ -49,7 +49,6 @@ export interface CustomPluginParams {
headers?: Record<string, string>;
};
useProxy?: boolean;
-
}
export interface LobeToolCustomPlugin {
diff --git a/packages/types/src/topic/topic.ts b/packages/types/src/topic/topic.ts
index f87df51b5d3..5347dfb7c7c 100644
--- a/packages/types/src/topic/topic.ts
+++ b/packages/types/src/topic/topic.ts
@@ -18,7 +18,6 @@ export enum TopicDisplayMode {
// AscMessages = 'ascMessages',
// DescMessages = 'descMessages',
}
-
export interface GroupedTopic {
children: ChatTopic[];
@@ -156,7 +155,12 @@ export interface SharedTopicData {
avatar?: string | null;
backgroundColor?: string | null;
createdAt?: Date | null;
- members?: { avatar: string | null; backgroundColor: string | null; id: string; title: string | null }[];
+ members?: {
+ avatar: string | null;
+ backgroundColor: string | null;
+ id: string;
+ title: string | null;
+ }[];
title?: string | null;
updatedAt?: Date | null;
userId?: string | null;
diff --git a/packages/types/src/userMemory/layers.ts b/packages/types/src/userMemory/layers.ts
index e176d3d705a..23249e4cfdd 100644
--- a/packages/types/src/userMemory/layers.ts
+++ b/packages/types/src/userMemory/layers.ts
@@ -72,7 +72,6 @@ export interface UserMemoryContext extends UserMemoryTimestamps {
userMemoryIds: string[] | null;
}
-
export type UserMemoryContextWithoutVectors = Omit<
UserMemoryContext,
'descriptionVector' | 'titleVector'
@@ -101,7 +100,6 @@ export interface UserMemoryExperience extends UserMemoryTimestamps {
userMemoryId: string | null;
}
-
export type UserMemoryExperienceWithoutVectors = Omit<
UserMemoryExperience,
'actionVector' | 'keyLearningVector' | 'situationVector'
@@ -125,7 +123,6 @@ export interface UserMemoryPreference extends UserMemoryTimestamps {
userMemoryId: string | null;
}
-
export type UserMemoryPreferenceWithoutVectors = Omit<
UserMemoryPreference,
'conclusionDirectivesVector'
@@ -154,7 +151,6 @@ export interface UserMemoryActivity extends UserMemoryTimestamps {
userMemoryId: string | null;
}
-
export type UserMemoryActivityWithoutVectors = Omit<
UserMemoryActivity,
'narrativeVector' | 'feedbackVector'
diff --git a/packages/types/src/userMemory/list.ts b/packages/types/src/userMemory/list.ts
index 9f81395362e..95d5b168027 100644
--- a/packages/types/src/userMemory/list.ts
+++ b/packages/types/src/userMemory/list.ts
@@ -1,11 +1,5 @@
-import type {
- UserMemoryListItem,
- UserMemoryWithoutVectors,
-} from './base'
-import type {
- UserMemoryIdentitiesListItem,
- UserMemoryIdentityWithoutVectors,
-} from './identity'
+import type { UserMemoryListItem, UserMemoryWithoutVectors } from './base';
+import type { UserMemoryIdentitiesListItem, UserMemoryIdentityWithoutVectors } from './identity';
import type {
UserMemoryActivitiesListItem,
UserMemoryActivityWithoutVectors,
@@ -15,7 +9,7 @@ import type {
UserMemoryExperienceWithoutVectors,
UserMemoryPreferencesListItem,
UserMemoryPreferenceWithoutVectors,
-} from './layers'
+} from './layers';
import type { LayersEnum } from './shared';
export interface TopicSource {
@@ -36,13 +30,13 @@ export enum MemorySourceType {
export interface ContextMemorySimple {
context: UserMemoryContextsListItem;
layer: LayersEnum.Context;
- memory: UserMemoryListItem
+ memory: UserMemoryListItem;
}
export interface ContextMemoryDetail {
context: UserMemoryContextWithoutVectors;
layer: LayersEnum.Context;
- memory: UserMemoryWithoutVectors
+ memory: UserMemoryWithoutVectors;
source?: MemorySource;
sourceType?: MemorySourceType;
}
diff --git a/packages/utils/src/chunkers/trimBatchProbe/trimBatchProbe.test.ts b/packages/utils/src/chunkers/trimBatchProbe/trimBatchProbe.test.ts
index c1405c115dd..7a4ea4efef0 100644
--- a/packages/utils/src/chunkers/trimBatchProbe/trimBatchProbe.test.ts
+++ b/packages/utils/src/chunkers/trimBatchProbe/trimBatchProbe.test.ts
@@ -1,6 +1,12 @@
import { describe, expect, it, vi } from 'vitest';
-import { hardTruncateFromTail, normalizeToArray, resolveJoiner, trimBasedOnBatchProbe,truncateByPunctuation } from './trimBatchProbe';
+import {
+ hardTruncateFromTail,
+ normalizeToArray,
+ resolveJoiner,
+ trimBasedOnBatchProbe,
+ truncateByPunctuation,
+} from './trimBatchProbe';
vi.mock('tokenx', () => ({
estimateTokenCount: (str: string) => str.split(/\s+/).filter(Boolean).length,
@@ -9,7 +15,10 @@ vi.mock('tokenx', () => ({
describe('trimBasedOnBatchProbe', () => {
it('prefers compact builds to keep more segments', async () => {
class BuildableChunk {
- constructor(private readonly detail: string, private readonly summary: string) {}
+ constructor(
+ private readonly detail: string,
+ private readonly summary: string,
+ ) {}
build(tryCompactIfPossible?: boolean) {
return tryCompactIfPossible ? this.summary : this.detail;
}
@@ -35,7 +44,10 @@ describe('trimBasedOnBatchProbe', () => {
it('prefers compact probe when it allows keeping more segments', async () => {
class BuildableChunk {
- constructor(private readonly detail: string, private readonly summary: string) {}
+ constructor(
+ private readonly detail: string,
+ private readonly summary: string,
+ ) {}
build(tryCompactIfPossible?: boolean) {
return tryCompactIfPossible ? this.summary : this.detail;
}
@@ -79,13 +91,19 @@ describe('trimBasedOnBatchProbe', () => {
it('uses compact build for single buildable before truncation', async () => {
class BuildableChunk {
- constructor(private readonly detail: string, private readonly summary: string) {}
+ constructor(
+ private readonly detail: string,
+ private readonly summary: string,
+ ) {}
build(tryCompactIfPossible?: boolean) {
return tryCompactIfPossible ? this.summary : this.detail;
}
}
- const result = await trimBasedOnBatchProbe(new BuildableChunk('too long detail text', 'short'), 2);
+ const result = await trimBasedOnBatchProbe(
+ new BuildableChunk('too long detail text', 'short'),
+ 2,
+ );
expect(result).toBe('short');
});
diff --git a/packages/utils/src/chunkers/trimBatchProbe/trimBatchProbe.ts b/packages/utils/src/chunkers/trimBatchProbe/trimBatchProbe.ts
index bfad259c321..51662cdefee 100644
--- a/packages/utils/src/chunkers/trimBatchProbe/trimBatchProbe.ts
+++ b/packages/utils/src/chunkers/trimBatchProbe/trimBatchProbe.ts
@@ -108,7 +108,10 @@ export const hardTruncateFromTail = async (text: string, tokenLimit: number) =>
/**
* Joins built segments using the provided joiner or string separator.
*/
-export const joinSegments = async (segments: string[], joiner: ReturnType<typeof resolveJoiner>) => {
+export const joinSegments = async (
+ segments: string[],
+ joiner: ReturnType<typeof resolveJoiner>,
+) => {
if (typeof joiner === 'string') return segments.join(joiner);
return joiner(segments);
@@ -218,8 +221,11 @@ export const trimBasedOnBatchProbe = async <T = string | Buildable>(
): Promise<string> => {
const options: TrimBatchProbeOptions<T> =
typeof tokenLimitOrOptions === 'number'
- ? { ...(typeof maybeOptions === 'object' ? maybeOptions : {}), tokenLimit: tokenLimitOrOptions }
- : tokenLimitOrOptions ?? {};
+ ? {
+ ...(typeof maybeOptions === 'object' ? maybeOptions : {}),
+ tokenLimit: tokenLimitOrOptions,
+ }
+ : (tokenLimitOrOptions ?? {});
if (typeof maybeOptions === 'string') {
options.joiner = maybeOptions;
@@ -272,7 +278,9 @@ export const trimBasedOnBatchProbe = async <T = string | Buildable>(
if (
bestCompact &&
- (!bestNormal || bestCompact.count > bestNormal.count || bestCompact.text.length > bestNormal.text.length)
+ (!bestNormal ||
+ bestCompact.count > bestNormal.count ||
+ bestCompact.text.length > bestNormal.text.length)
) {
return bestCompact.text;
}
diff --git a/packages/utils/src/client/cookie.ts b/packages/utils/src/client/cookie.ts
index fa02ff993ad..d116badc6de 100644
--- a/packages/utils/src/client/cookie.ts
+++ b/packages/utils/src/client/cookie.ts
@@ -11,7 +11,6 @@ export const setCookie = (
// Set the expiration time to yesterday (expire immediately)
const expiredDate = new Date(0).toUTCString(); // 1970-01-01T00:00:00Z
-
document.cookie = `${key}=; expires=${expiredDate}; path=/;`;
} else {
const expires =
@@ -19,7 +18,6 @@ export const setCookie = (
? expireDays
: dayjs().add(expireDays, 'day').toDate().toUTCString();
-
document.cookie = `${key}=${value};expires=${expires};path=/;`;
}
};
diff --git a/packages/utils/src/client/fetchEventSource/index.ts b/packages/utils/src/client/fetchEventSource/index.ts
index 24274779bd8..064f2b21d14 100644
--- a/packages/utils/src/client/fetchEventSource/index.ts
+++ b/packages/utils/src/client/fetchEventSource/index.ts
@@ -2,14 +2,13 @@
* file copy from https://github.com/Azure/fetch-event-source/blob/45ac3cfffd30b05b79fbf95c21e67d4ef59aa56a/src/fetch.ts
* and remove some code
*/
-import type { EventSourceMessage} from './parse';
+import type { EventSourceMessage } from './parse';
import { getBytes, getLines, getMessages } from './parse';
export const EventStreamContentType = 'text/event-stream';
const LastEventId = 'last-event-id';
-
export interface FetchEventSourceInit extends RequestInit {
/** The Fetch function to use. Defaults to window.fetch */
fetch?: typeof fetch;
@@ -52,7 +51,6 @@ export interface FetchEventSourceInit extends RequestInit {
}
export function fetchEventSource(
-
input: RequestInfo,
{
signal: inputSignal,
diff --git a/packages/utils/src/client/fetchEventSource/parse.ts b/packages/utils/src/client/fetchEventSource/parse.ts
index 4cc30a7a763..5646007b1a1 100644
--- a/packages/utils/src/client/fetchEventSource/parse.ts
+++ b/packages/utils/src/client/fetchEventSource/parse.ts
@@ -1,5 +1,5 @@
//@ts-nocheck
-
+
/* eslint-disable */
/**
* Represents a message sent in an event stream
diff --git a/packages/utils/src/client/topic.ts b/packages/utils/src/client/topic.ts
index e2b80f43781..cb0a0d18084 100644
--- a/packages/utils/src/client/topic.ts
+++ b/packages/utils/src/client/topic.ts
@@ -42,7 +42,12 @@ const getTopicGroupId = (timestamp: number): TimeGroupId => {
// Ensure group sorting
const sortGroups = (groups: GroupedTopic[]): GroupedTopic[] => {
- const orderMap = new Map<string, number>([['today', 0], ['yesterday', 1], ['week', 2], ['month', 3]]);
+ const orderMap = new Map<string, number>([
+ ['today', 0],
+ ['yesterday', 1],
+ ['week', 2],
+ ['month', 3],
+ ]);
// Set the order of fixed groups
diff --git a/packages/utils/src/error.ts b/packages/utils/src/error.ts
index 6fa07a9bdbd..c50039992ff 100644
--- a/packages/utils/src/error.ts
+++ b/packages/utils/src/error.ts
@@ -1,30 +1,31 @@
// Source copied from: https://github.com/moeru-ai/std/blob/72279973ff997b65672a9c85555c3736554bd9b9/packages/std/src/error/index.ts#L41-L46
type Nullable<T> = {
- [P in keyof T]: null | T[P]
-}
+ [P in keyof T]: null | T[P];
+};
/**
* ErrorLike utility interface for containing error-like objects.
*/
-export type ErrorLike<C = unknown> = Nullable<Partial<Pick<Error, 'stack'>>> & Pick<Error, 'message' | 'name'> & { cause?: C }
+export type ErrorLike<C = unknown> = Nullable<Partial<Pick<Error, 'stack'>>> &
+ Pick<Error, 'message' | 'name'> & { cause?: C };
-export const isError = (err: null | undefined | unknown): err is Error =>
- err instanceof Error
+export const isError = (err: null | undefined | unknown): err is Error => err instanceof Error;
export const isErrorLike = <C = unknown>(err: null | undefined | unknown): err is ErrorLike<C> => {
-
- if (err == null)
- return false
+ if (err == null) return false;
- if (isError(err))
- return true
+ if (isError(err)) return true;
- if (typeof err !== 'object')
- return false
+ if (typeof err !== 'object') return false;
- return 'name' in err && typeof err.name === 'string' && 'message' in err && typeof err.message === 'string'
-}
+ return (
+ 'name' in err &&
+ typeof err.name === 'string' &&
+ 'message' in err &&
+ typeof err.message === 'string'
+ );
+};
/**
* Error.name extractor.
@@ -33,9 +34,7 @@ export const isErrorLike = <C = unknown>(err: null | undefined | unknown): err i
* @returns {string | undefined}
*/
export const errorNameFrom = (err: null | undefined | unknown): string | undefined =>
- isErrorLike(err)
- ? err.name
- : undefined
+ isErrorLike(err) ? err.name : undefined;
/**
* Error.message extractor.
@@ -44,9 +43,7 @@ export const errorNameFrom = (err: null | undefined | unknown): string | undefin
* @returns {string | undefined}
*/
export const errorMessageFrom = (err: null | undefined | unknown): string | undefined =>
- isErrorLike(err)
- ? err.message
- : undefined
+ isErrorLike(err) ? err.message : undefined;
/**
* Error.stack extractor.
@@ -55,9 +52,7 @@ export const errorMessageFrom = (err: null | undefined | unknown): string | unde
* @returns {string | undefined}
*/
export const errorStackFrom = (err: null | undefined | unknown): null | string | undefined =>
- isErrorLike(err)
- ? err.stack ?? new Error(errorMessageFrom(err)).stack
- : undefined
+ isErrorLike(err) ? (err.stack ?? new Error(errorMessageFrom(err)).stack) : undefined;
/**
* Error.cause extractor.
@@ -66,9 +61,7 @@ export const errorStackFrom = (err: null | undefined | unknown): null | string |
* @returns {unknown | undefined}
*/
export const errorCauseFrom = <C>(err: null | undefined | unknown): C | undefined => {
-
- if (!isErrorLike(err) || err.cause == null)
- return undefined
+ if (!isErrorLike(err) || err.cause == null) return undefined;
- return err.cause as C | undefined
-}
+ return err.cause as C | undefined;
+};
diff --git a/packages/utils/src/merge.ts b/packages/utils/src/merge.ts
index 221c5748ea5..a79d2b4164c 100644
--- a/packages/utils/src/merge.ts
+++ b/packages/utils/src/merge.ts
@@ -1,4 +1,4 @@
-import type { merge as _merge} from 'es-toolkit/compat';
+import type { merge as _merge } from 'es-toolkit/compat';
import { isEmpty, mergeWith } from 'es-toolkit/compat';
/**
diff --git a/packages/utils/src/safeParseJSON.test.ts b/packages/utils/src/safeParseJSON.test.ts
index df7ef31772b..3c9b4e77cc6 100644
--- a/packages/utils/src/safeParseJSON.test.ts
+++ b/packages/utils/src/safeParseJSON.test.ts
@@ -51,7 +51,7 @@ describe('safeParseJSON', () => {
});
it('should parse large JSON without throwing an error', () => {
- const largeJSON = JSON.stringify({ data: Array.from({length: 1000}).fill('test') });
+ const largeJSON = JSON.stringify({ data: Array.from({ length: 1000 }).fill('test') });
const result = safeParseJSON(largeJSON);
expect(result).toHaveProperty('data');
expect(Array.isArray(result!.data)).toBe(true);
diff --git a/packages/utils/src/server/sse.ts b/packages/utils/src/server/sse.ts
index c557329a8e1..6c42c1f771c 100644
--- a/packages/utils/src/server/sse.ts
+++ b/packages/utils/src/server/sse.ts
@@ -137,7 +137,7 @@ export type AgentStreamEventType =
/**
* Creates SSE headers for agent streaming
*/
-
+
export function createSSEHeaders(): HeadersInit {
return {
'Access-Control-Allow-Headers': 'Cache-Control, Last-Event-ID',
diff --git a/packages/utils/src/toolManifest.ts b/packages/utils/src/toolManifest.ts
index 4f41f9fcaf5..a7f6aeba569 100644
--- a/packages/utils/src/toolManifest.ts
+++ b/packages/utils/src/toolManifest.ts
@@ -1,5 +1,5 @@
import type { OpenAIPluginManifest } from '@lobechat/types';
-import type { LobeChatPluginManifest} from '@lobehub/chat-plugin-sdk';
+import type { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk';
import { pluginManifestSchema } from '@lobehub/chat-plugin-sdk';
import { API_ENDPOINTS } from '@/services/_url';
diff --git a/packages/web-crawler/src/crawImpl/exa.ts b/packages/web-crawler/src/crawImpl/exa.ts
index 92652510b09..dd4e031b85b 100644
--- a/packages/web-crawler/src/crawImpl/exa.ts
+++ b/packages/web-crawler/src/crawImpl/exa.ts
@@ -66,8 +66,8 @@ export const exa: CrawlImpl = async (url) => {
const data = (await res.json()) as ExaResponse;
if (!data.results || data.results.length === 0) {
- console.warn( 'Exa API returned no results for URL:', url )
- return
+ console.warn('Exa API returned no results for URL:', url);
+ return;
}
const firstResult = data.results[0];
diff --git a/packages/web-crawler/src/crawImpl/tavily.ts b/packages/web-crawler/src/crawImpl/tavily.ts
index 619dd4b4bd9..4adbb7eebcb 100644
--- a/packages/web-crawler/src/crawImpl/tavily.ts
+++ b/packages/web-crawler/src/crawImpl/tavily.ts
@@ -67,8 +67,8 @@ export const tavily: CrawlImpl = async (url) => {
const data = (await res.json()) as TavilyResponse;
if (!data.results || data.results.length === 0) {
- console.warn( 'Tavily API returned no results for URL:', url )
- return
+ console.warn('Tavily API returned no results for URL:', url);
+ return;
}
const firstResult = data.results[0];
diff --git a/packages/web-crawler/src/crawler.ts b/packages/web-crawler/src/crawler.ts
index 20da4fd7895..d14669c3f60 100644
--- a/packages/web-crawler/src/crawler.ts
+++ b/packages/web-crawler/src/crawler.ts
@@ -1,4 +1,4 @@
-import type { CrawlImplType} from './crawImpl';
+import type { CrawlImplType } from './crawImpl';
import { crawlImpls } from './crawImpl';
import type { CrawlUniformResult, CrawlUrlRule } from './type';
import { crawUrlRules } from './urlRules';
diff --git a/packages/web-crawler/src/utils/htmlToMarkdown.ts b/packages/web-crawler/src/utils/htmlToMarkdown.ts
index 9e062b0f64b..66a899f8353 100644
--- a/packages/web-crawler/src/utils/htmlToMarkdown.ts
+++ b/packages/web-crawler/src/utils/htmlToMarkdown.ts
@@ -1,7 +1,7 @@
import { Readability } from '@mozilla/readability';
import { Window } from 'happy-dom';
-import type {TranslatorConfigObject} from 'node-html-markdown';
-import { NodeHtmlMarkdown } from 'node-html-markdown';
+import type { TranslatorConfigObject } from 'node-html-markdown';
+import { NodeHtmlMarkdown } from 'node-html-markdown';
import type { FilterOptions } from '../type';
diff --git a/packages/web-crawler/src/utils/withTimeout.ts b/packages/web-crawler/src/utils/withTimeout.ts
index 5eb0ffad0bd..9f295fa43bf 100644
--- a/packages/web-crawler/src/utils/withTimeout.ts
+++ b/packages/web-crawler/src/utils/withTimeout.ts
@@ -1,4 +1,4 @@
-import { TimeoutError } from "./errorType";
+import { TimeoutError } from './errorType';
export const DEFAULT_TIMEOUT = 10_000;
diff --git a/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/index.tsx b/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/index.tsx
index 9ab55d9fc2e..23bc7067a3d 100644
--- a/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/index.tsx
+++ b/src/app/[variants]/(main)/settings/chat-appearance/features/ChatAppearance/index.tsx
@@ -5,6 +5,7 @@ import {
FormGroup,
highlighterThemes,
Icon,
+ LobeSwitch as Switch,
mermaidThemes,
Segmented,
Select,
@@ -76,6 +77,27 @@ const ChatAppearance = memo(() => {
<ChatTransitionPreview key={general.transitionMode} mode={general.transitionMode} />
</FormGroup>
+ <FormGroup
+ active={false}
+ collapsible={false}
+ desc={t('settingChatAppearance.autoScrollOnStreaming.desc')}
+ extra={
+ <Flexbox align={'center'} gap={8} horizontal>
+ {loadingStates.enableAutoScrollOnStreaming && (
+ <Icon icon={Loader2Icon} size={16} spin style={{ opacity: 0.5 }} />
+ )}
+ <Switch
+ checked={general.enableAutoScrollOnStreaming ?? true}
+ onChange={(checked) => handleChange('enableAutoScrollOnStreaming', checked)}
+ />
+ </Flexbox>
+ }
+ title={t('settingChatAppearance.autoScrollOnStreaming.title')}
+ variant={'filled'}
+ >
+ {null}
+ </FormGroup>
+
<FormGroup
collapsible={false}
desc={t('settingChatAppearance.fontSize.desc')}
diff --git a/src/app/[variants]/(main)/settings/features/SettingsContent.tsx b/src/app/[variants]/(main)/settings/features/SettingsContent.tsx
index cbeab40c1fb..bc5c86efc5a 100644
--- a/src/app/[variants]/(main)/settings/features/SettingsContent.tsx
+++ b/src/app/[variants]/(main)/settings/features/SettingsContent.tsx
@@ -1,6 +1,5 @@
'use client';
-import { ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const';
import { Fragment } from 'react';
import Loading from '@/components/Loading/BrandTextLoading';
@@ -8,6 +7,7 @@ import NavHeader from '@/features/NavHeader';
import SettingContainer from '@/features/Setting/SettingContainer';
import dynamic from '@/libs/next/dynamic';
import { SettingsTabs } from '@/store/global/initialState';
+import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';
const componentMap = {
[SettingsTabs.Common]: dynamic(() => import('../common'), {
@@ -62,40 +62,25 @@ const componentMap = {
[SettingsTabs.Skill]: dynamic(() => import('../skill'), {
loading: () => <Loading debugId="Settings > Skill" />,
}),
- ...(ENABLE_BUSINESS_FEATURES
- ? ({
- [SettingsTabs.Plans]: dynamic(
- () => import('@/business/client/BusinessSettingPages/Plans'),
- {
- loading: () => <Loading debugId="Settings > Plans" />,
- },
- ),
- [SettingsTabs.Funds]: dynamic(
- () => import('@/business/client/BusinessSettingPages/Funds'),
- {
- loading: () => <Loading debugId="Settings > Funds" />,
- },
- ),
- [SettingsTabs.Usage]: dynamic(
- () => import('@/business/client/BusinessSettingPages/Usage'),
- {
- loading: () => <Loading debugId="Settings > Usage" />,
- },
- ),
- [SettingsTabs.Billing]: dynamic(
- () => import('@/business/client/BusinessSettingPages/Billing'),
- {
- loading: () => <Loading debugId="Settings > Billing" />,
- },
- ),
- [SettingsTabs.Referral]: dynamic(
- () => import('@/business/client/BusinessSettingPages/Referral'),
- {
- loading: () => <Loading debugId="Settings > Referral" />,
- },
- ),
- } as const)
- : []),
+
+ [SettingsTabs.Plans]: dynamic(() => import('@/business/client/BusinessSettingPages/Plans'), {
+ loading: () => <Loading debugId="Settings > Plans" />,
+ }),
+ [SettingsTabs.Funds]: dynamic(() => import('@/business/client/BusinessSettingPages/Funds'), {
+ loading: () => <Loading debugId="Settings > Funds" />,
+ }),
+ [SettingsTabs.Usage]: dynamic(() => import('@/business/client/BusinessSettingPages/Usage'), {
+ loading: () => <Loading debugId="Settings > Usage" />,
+ }),
+ [SettingsTabs.Billing]: dynamic(() => import('@/business/client/BusinessSettingPages/Billing'), {
+ loading: () => <Loading debugId="Settings > Billing" />,
+ }),
+ [SettingsTabs.Referral]: dynamic(
+ () => import('@/business/client/BusinessSettingPages/Referral'),
+ {
+ loading: () => <Loading debugId="Settings > Referral" />,
+ },
+ ),
};
interface SettingsContentProps {
@@ -104,6 +89,8 @@ interface SettingsContentProps {
}
const SettingsContent = ({ mobile, activeTab }: SettingsContentProps) => {
+ const enableBusinessFeatures = useServerConfigStore(serverConfigSelectors.enableBusinessFeatures);
+
const renderComponent = (tab: string) => {
const Component = componentMap[tab as keyof typeof componentMap] || componentMap.common;
if (!Component) return null;
@@ -117,7 +104,7 @@ const SettingsContent = ({ mobile, activeTab }: SettingsContentProps) => {
SettingsTabs.Profile,
SettingsTabs.Stats,
SettingsTabs.Security,
- ...(ENABLE_BUSINESS_FEATURES
+ ...(enableBusinessFeatures
? [
SettingsTabs.Plans,
SettingsTabs.Funds,
diff --git a/src/app/[variants]/(main)/settings/hooks/useCategory.tsx b/src/app/[variants]/(main)/settings/hooks/useCategory.tsx
index 2b7b9931133..85e267f63e4 100644
--- a/src/app/[variants]/(main)/settings/hooks/useCategory.tsx
+++ b/src/app/[variants]/(main)/settings/hooks/useCategory.tsx
@@ -1,4 +1,3 @@
-import { ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const';
import { isDesktop } from '@lobechat/const';
import { Avatar } from '@lobehub/ui';
import {
@@ -30,7 +29,11 @@ import { useTranslation } from 'react-i18next';
import { useElectronStore } from '@/store/electron';
import { electronSyncSelectors } from '@/store/electron/selectors';
import { SettingsTabs } from '@/store/global/initialState';
-import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
+import {
+ featureFlagsSelectors,
+ serverConfigSelectors,
+ useServerConfigStore,
+} from '@/store/serverConfig';
import { useUserStore } from '@/store/user';
import { userProfileSelectors } from '@/store/user/slices/auth/selectors';
@@ -75,7 +78,7 @@ export const useCategory = () => {
}
return avatar;
}, [avatar, remoteServerUrl]);
-
+ const enableBusinessFeatures = useServerConfigStore(serverConfigSelectors.enableBusinessFeatures);
const categoryGroups: CategoryGroup[] = useMemo(() => {
const groups: CategoryGroup[] = [];
@@ -104,35 +107,35 @@ export const useCategory = () => {
title: t('group.profile'),
});
- const subscriptionItems: CategoryItem[] = [
- {
- icon: Map,
- key: SettingsTabs.Plans,
- label: tSubscription('tab.plans'),
- },
- {
- icon: Coins,
- key: SettingsTabs.Funds,
- label: tSubscription('tab.funds'),
- },
- {
- icon: PieChart,
- key: SettingsTabs.Usage,
- label: tSubscription('tab.usage'),
- },
- {
- icon: CreditCard,
- key: SettingsTabs.Billing,
- label: tSubscription('tab.billing'),
- },
- {
- icon: Gift,
- key: SettingsTabs.Referral,
- label: tSubscription('tab.referral'),
- },
- ];
+ if (enableBusinessFeatures) {
+ const subscriptionItems: CategoryItem[] = [
+ {
+ icon: Map,
+ key: SettingsTabs.Plans,
+ label: tSubscription('tab.plans'),
+ },
+ {
+ icon: Coins,
+ key: SettingsTabs.Funds,
+ label: tSubscription('tab.funds'),
+ },
+ {
+ icon: PieChart,
+ key: SettingsTabs.Usage,
+ label: tSubscription('tab.usage'),
+ },
+ {
+ icon: CreditCard,
+ key: SettingsTabs.Billing,
+ label: tSubscription('tab.billing'),
+ },
+ {
+ icon: Gift,
+ key: SettingsTabs.Referral,
+ label: tSubscription('tab.referral'),
+ },
+ ];
- if (ENABLE_BUSINESS_FEATURES) {
groups.push({
items: subscriptionItems,
key: SettingsGroupKey.Subscription,
@@ -236,7 +239,18 @@ export const useCategory = () => {
});
return groups;
- }, [t, tAuth, enableSTT, hideDocs, mobile, showAiImage, showApiKeyManage, avatarUrl, username]);
+ }, [
+ t,
+ tAuth,
+ enableSTT,
+ enableBusinessFeatures,
+ hideDocs,
+ mobile,
+ showAiImage,
+ showApiKeyManage,
+ avatarUrl,
+ username,
+ ]);
return categoryGroups;
};
diff --git a/src/business/client/BusinessSettingPages/Billing.tsx b/src/business/client/BusinessSettingPages/Billing.tsx
index bca51e82ee0..ab6e8c06919 100644
--- a/src/business/client/BusinessSettingPages/Billing.tsx
+++ b/src/business/client/BusinessSettingPages/Billing.tsx
@@ -1,3 +1,14 @@
-export default function Billing() {
- return null;
-}
+'use client';
+
+import { isDesktop } from '@lobechat/const';
+import { memo } from 'react';
+
+import { SubscriptionIframeWrapper } from './SubscriptionIframeWrapper';
+
+const Billing = memo(() => {
+ if (!isDesktop) return null;
+ return <SubscriptionIframeWrapper page="billing" />;
+});
+
+Billing.displayName = 'Billing';
+export default Billing;
diff --git a/src/business/client/BusinessSettingPages/Funds.tsx b/src/business/client/BusinessSettingPages/Funds.tsx
index 511c5053612..4ccfd291d02 100644
--- a/src/business/client/BusinessSettingPages/Funds.tsx
+++ b/src/business/client/BusinessSettingPages/Funds.tsx
@@ -1,3 +1,14 @@
-export default function Funds() {
- return null;
-}
+'use client';
+
+import { isDesktop } from '@lobechat/const';
+import { memo } from 'react';
+
+import { SubscriptionIframeWrapper } from './SubscriptionIframeWrapper';
+
+const Funds = memo(() => {
+ if (!isDesktop) return null;
+ return <SubscriptionIframeWrapper page="funds" />;
+});
+
+Funds.displayName = 'Funds';
+export default Funds;
diff --git a/src/business/client/BusinessSettingPages/Plans.tsx b/src/business/client/BusinessSettingPages/Plans.tsx
index 64a46b7d018..48d52e1c0c9 100644
--- a/src/business/client/BusinessSettingPages/Plans.tsx
+++ b/src/business/client/BusinessSettingPages/Plans.tsx
@@ -1,3 +1,14 @@
-export default function Plans() {
- return null;
-}
+'use client';
+
+import { isDesktop } from '@lobechat/const';
+import { memo } from 'react';
+
+import { SubscriptionIframeWrapper } from './SubscriptionIframeWrapper';
+
+const Plans = memo(() => {
+ if (!isDesktop) return null;
+ return <SubscriptionIframeWrapper page="plans" />;
+});
+
+Plans.displayName = 'Plans';
+export default Plans;
diff --git a/src/business/client/BusinessSettingPages/Referral.tsx b/src/business/client/BusinessSettingPages/Referral.tsx
index 1a1360d0013..7dd2a78f1ab 100644
--- a/src/business/client/BusinessSettingPages/Referral.tsx
+++ b/src/business/client/BusinessSettingPages/Referral.tsx
@@ -1,3 +1,14 @@
-export default function Referral() {
- return null;
-}
+'use client';
+
+import { isDesktop } from '@lobechat/const';
+import { memo } from 'react';
+
+import { SubscriptionIframeWrapper } from './SubscriptionIframeWrapper';
+
+const Referral = memo(() => {
+ if (!isDesktop) return null;
+ return <SubscriptionIframeWrapper page="referral" />;
+});
+
+Referral.displayName = 'Referral';
+export default Referral;
diff --git a/src/business/client/BusinessSettingPages/SubscriptionIframeWrapper.tsx b/src/business/client/BusinessSettingPages/SubscriptionIframeWrapper.tsx
new file mode 100644
index 00000000000..b59e7ec3094
--- /dev/null
+++ b/src/business/client/BusinessSettingPages/SubscriptionIframeWrapper.tsx
@@ -0,0 +1,160 @@
+'use client';
+
+import { Center, Flexbox } from '@lobehub/ui';
+import { Spin } from 'antd';
+import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import { OFFICIAL_URL } from '@/const/url';
+import { useIsCloudActive } from '@/hooks/useIsCloudActive';
+import { remoteServerService } from '@/services/electron/remoteServer';
+import { electronSystemService } from '@/services/electron/system';
+import { useServerConfigStore } from '@/store/serverConfig';
+import { serverConfigSelectors } from '@/store/serverConfig/selectors';
+
+const PARTITION_ID = 'persist:subscription';
+
+interface SubscriptionIframeWrapperProps {
+ page: 'billing' | 'funds' | 'plans' | 'referral' | 'usage';
+}
+
+export const SubscriptionIframeWrapper = memo<SubscriptionIframeWrapperProps>(({ page }) => {
+ const [sessionReady, setSessionReady] = useState(false);
+ const [error, setError] = useState<string | null>(null);
+ const webviewRef = useRef<HTMLElement>(null);
+
+ const { i18n } = useTranslation();
+ const isCloudActive = useIsCloudActive();
+
+ const enableBusinessFeatures = useServerConfigStore(serverConfigSelectors.enableBusinessFeatures);
+
+ const iframeUrl = useMemo(() => {
+ if (!isCloudActive) return null;
+
+ const url = new URL(`/embed/subscription/${page}`, OFFICIAL_URL);
+ // Sync locale to embed page via hl parameter
+ if (i18n.language) {
+ url.searchParams.set('hl', i18n.language);
+ }
+ return url.toString();
+ }, [page, i18n.language, isCloudActive]);
+
+ useEffect(() => {
+ const initSession = async () => {
+ try {
+ await remoteServerService.setupSubscriptionWebviewSession(PARTITION_ID);
+ setSessionReady(true);
+ } catch (err) {
+ console.error('Failed to initialize subscription webview session:', err);
+ setError('Failed to initialize subscription session');
+ }
+ };
+
+ initSession();
+ }, []);
+
+ // Intercept all link clicks in webview and open them in default browser
+ // This webview only hosts the current page, any navigation should open externally
+ useEffect(() => {
+ const webview = webviewRef.current as any;
+ if (!webview || !sessionReady) return;
+
+ const LINK_CLICK_PREFIX = '__EXTERNAL_LINK__:';
+
+ // Inject script to intercept all link clicks and window.open after DOM is ready
+ const handleDomReady = () => {
+ webview.executeJavaScript(`
+ (function() {
+ const PREFIX = '${LINK_CLICK_PREFIX}';
+
+ // Intercept link clicks
+ document.addEventListener('click', function(e) {
+ const link = e.target.closest('a');
+ if (link && link.href) {
+ e.preventDefault();
+ e.stopPropagation();
+ // Use console.log with prefix to communicate with parent
+ console.log(PREFIX + link.href);
+ }
+ }, true);
+
+ // Intercept window.open calls
+ const originalOpen = window.open;
+ window.open = function(url, target, features) {
+ if (url) {
+ // Resolve relative URLs to absolute
+ const absoluteUrl = new URL(url, window.location.href).href;
+ console.log(PREFIX + absoluteUrl);
+ }
+ // Return null to indicate popup was blocked (expected behavior)
+ return null;
+ };
+ })();
+ `);
+ };
+
+ const handleConsoleMessage = (event: any) => {
+ const message = event.message as string | undefined;
+ if (message?.startsWith(LINK_CLICK_PREFIX)) {
+ const url = message.slice(LINK_CLICK_PREFIX.length);
+ electronSystemService.openExternalLink(url);
+ }
+ };
+
+ webview.addEventListener('dom-ready', handleDomReady);
+ webview.addEventListener('console-message', handleConsoleMessage);
+
+ return () => {
+ webview.removeEventListener('dom-ready', handleDomReady);
+ webview.removeEventListener('console-message', handleConsoleMessage);
+ };
+ }, [sessionReady]);
+
+ const handleRetry = useCallback(() => {
+ setError(null);
+ setSessionReady(false);
+
+ remoteServerService
+ .setupSubscriptionWebviewSession(PARTITION_ID)
+ .then(() => setSessionReady(true))
+ .catch(() => setError('Failed to initialize subscription session'));
+ }, []);
+
+ if (!enableBusinessFeatures || !iframeUrl) return null;
+
+ if (error) {
+ return (
+ <div style={{ padding: 24, textAlign: 'center' }}>
+ <p>{error}</p>
+ <button type="button" onClick={handleRetry}>
+ Retry
+ </button>
+ </div>
+ );
+ }
+
+ if (!sessionReady) {
+ return (
+ <Flexbox height={'100%'} width={'100%'}>
+ <Center flex={1}>
+ <Spin />
+ </Center>
+ </Flexbox>
+ );
+ }
+
+ return (
+ <webview
+ partition={PARTITION_ID}
+ ref={webviewRef}
+ src={iframeUrl}
+ style={{
+ border: 0,
+ inset: 0,
+ position: 'absolute',
+ }}
+ />
+ );
+});
+
+SubscriptionIframeWrapper.displayName = 'SubscriptionIframeWrapper';
diff --git a/src/business/client/BusinessSettingPages/Usage.tsx b/src/business/client/BusinessSettingPages/Usage.tsx
index 89753260624..7413f30d9a3 100644
--- a/src/business/client/BusinessSettingPages/Usage.tsx
+++ b/src/business/client/BusinessSettingPages/Usage.tsx
@@ -1,3 +1,14 @@
-export default function Usage() {
- return null;
-}
+'use client';
+
+import { isDesktop } from '@lobechat/const';
+import { memo } from 'react';
+
+import { SubscriptionIframeWrapper } from './SubscriptionIframeWrapper';
+
+const Usage = memo(() => {
+ if (!isDesktop) return null;
+ return <SubscriptionIframeWrapper page="usage" />;
+});
+
+Usage.displayName = 'Usage';
+export default Usage;
diff --git a/src/hooks/useIsCloudActive.ts b/src/hooks/useIsCloudActive.ts
new file mode 100644
index 00000000000..9752007e65f
--- /dev/null
+++ b/src/hooks/useIsCloudActive.ts
@@ -0,0 +1,17 @@
+'use client';
+
+import { isDesktop } from '@/const/version';
+import { useElectronStore } from '@/store/electron';
+import { electronSyncSelectors } from '@/store/electron/selectors';
+
+/**
+ * Returns whether cloud sync is active (storage mode is cloud and sync is active).
+ */
+export const useIsCloudActive = () => {
+ if (!isDesktop) return false;
+
+ const storageMode = useElectronStore(electronSyncSelectors.storageMode);
+ const isSyncActive = useElectronStore(electronSyncSelectors.isSyncActive);
+
+ return storageMode === 'cloud' && isSyncActive;
+};
diff --git a/src/services/electron/remoteServer.ts b/src/services/electron/remoteServer.ts
index 0133986c541..909e4b23594 100644
--- a/src/services/electron/remoteServer.ts
+++ b/src/services/electron/remoteServer.ts
@@ -44,6 +44,16 @@ class RemoteServerService {
cancelAuthorization = async () => {
return ensureElectronIpc().auth.cancelAuthorization();
};
+
+ /**
+ * Setup subscription webview session with OIDC token injection
+ * This configures the webview partition session to inject authentication tokens
+ * for requests to the official domain.
+ * @param partition The partition name for the webview session
+ */
+ setupSubscriptionWebviewSession = async (partition: string) => {
+ return ensureElectronIpc().remoteServer.setupSubscriptionWebviewSession({ partition });
+ };
}
export const remoteServerService = new RemoteServerService();