feat: add interactive selection dialog to batch installer (#60)
* feat: add interactive selection dialog to batch installer * feat: improve batch installer selection dialog * feat: add search and filtering to batch installer dialog * fix: sync type filter with selected plugins * fix: sync search results with selected plugins * feat: add multi-repository batch install support * fix: clarify single-call multi-repo usage * feat: add repository filters to selection dialog * refactor: simplify selection dialog header * docs: simplify batch installer quick start * docs: feature batch installer on homepage
This commit is contained in:
@@ -90,6 +90,13 @@ A collection of enhancements, plugins, and prompts for [open-webui](https://gith
|
|||||||
|
|
||||||
**Maximize your context window.** Intelligently compresses chat history using LLM logic to save tokens and costs while maintaining a high-quality reasoning chain.
|
**Maximize your context window.** Intelligently compresses chat history using LLM logic to save tokens and costs while maintaining a high-quality reasoning chain.
|
||||||
|
|
||||||
|
### 6. [Batch Install Plugins from GitHub](https://openwebui.com/posts/batch_install_plugins_install_popular_plugins_in_s_c9fd6e80) [](https://openwebui.com/posts/batch_install_plugins_install_popular_plugins_in_s_c9fd6e80)
|
||||||
|
|
||||||
|
**Faster plugin onboarding across community repositories.** Pull plugins from multiple GitHub repositories in one request, then narrow the result set inside an interactive dialog with repository tags, type filters, keyword search, and descriptions before installing only the subset you want.
|
||||||
|
|
||||||
|

|
||||||
|
> *A single install dialog can merge multiple repositories and let you filter visually before anything is installed.*
|
||||||
|
|
||||||
## 📦 Project Contents
|
## 📦 Project Contents
|
||||||
|
|
||||||
<!-- markdownlint-disable MD033 -->
|
<!-- markdownlint-disable MD033 -->
|
||||||
@@ -111,6 +118,7 @@ Located in the `plugins/` directory, containing Python-based enhancements:
|
|||||||
|
|
||||||
- **Smart Mind Map Tool** (`smart-mind-map-tool`): The tool version of Smart Mind Map, enabling AI proactive/autonomous invocation.
|
- **Smart Mind Map Tool** (`smart-mind-map-tool`): The tool version of Smart Mind Map, enabling AI proactive/autonomous invocation.
|
||||||
- **OpenWebUI Skills Manager Tool** (`openwebui-skills-manager-tool`): Native tool for managing OpenWebUI skills.
|
- **OpenWebUI Skills Manager Tool** (`openwebui-skills-manager-tool`): Native tool for managing OpenWebUI skills.
|
||||||
|
- **Batch Install Plugins from GitHub** (`batch-install-plugins`): Discovers plugins from multiple GitHub repositories and installs them through an interactive repository/type-filtered selection dialog.
|
||||||
|
|
||||||
### Filters
|
### Filters
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,13 @@ OpenWebUI 增强功能集合。包含个人开发与收集的插件、提示词
|
|||||||
|
|
||||||
**挑战 Token 極限。** 采用多专家异步压缩逻辑,在保持高吞吐量推理链的同时,大幅降低 Token 消耗。
|
**挑战 Token 極限。** 采用多专家异步压缩逻辑,在保持高吞吐量推理链的同时,大幅降低 Token 消耗。
|
||||||
|
|
||||||
|
### 6. [Batch Install Plugins from GitHub](https://openwebui.com/posts/batch_install_plugins_install_popular_plugins_in_s_c9fd6e80) [](https://openwebui.com/posts/batch_install_plugins_install_popular_plugins_in_s_c9fd6e80)
|
||||||
|
|
||||||
|
**更快试用多个社区插件仓库。** 一次请求即可聚合多个 GitHub 仓库里的插件,再通过交互式对话框里的仓库标签、类型筛选、关键词搜索和描述信息,把要安装的范围缩小到真正需要的子集。
|
||||||
|
|
||||||
|

|
||||||
|
> *一个安装对话框就能合并多个仓库,并在真正安装前先完成可视化筛选。*
|
||||||
|
|
||||||
## 📦 项目内容
|
## 📦 项目内容
|
||||||
|
|
||||||
<!-- markdownlint-disable MD033 -->
|
<!-- markdownlint-disable MD033 -->
|
||||||
@@ -108,6 +115,7 @@ OpenWebUI 增强功能集合。包含个人开发与收集的插件、提示词
|
|||||||
|
|
||||||
- **智能思维导图工具** (`smart-mind-map-tool`): 思维导图的 Tool 版本,支持 AI 主动/自主调用。
|
- **智能思维导图工具** (`smart-mind-map-tool`): 思维导图的 Tool 版本,支持 AI 主动/自主调用。
|
||||||
- **OpenWebUI Skills 管理工具** (`openwebui-skills-manager-tool`): 用于管理 OpenWebUI Skills 的原生工具。
|
- **OpenWebUI Skills 管理工具** (`openwebui-skills-manager-tool`): 用于管理 OpenWebUI Skills 的原生工具。
|
||||||
|
- **Batch Install Plugins from GitHub** (`batch-install-plugins`): 从多个 GitHub 仓库发现插件,并通过支持仓库/类型筛选的交互式选择对话框完成安装。
|
||||||
|
|
||||||
### Filters (消息处理)
|
### Filters (消息处理)
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Batch Install Plugins from GitHub
|
# Batch Install Plugins from GitHub
|
||||||
|
|
||||||
**Author:** [Fu-Jie](https://github.com/Fu-Jie) | **Version:** 1.0.0 | **Project:** [OpenWebUI Extensions](https://github.com/Fu-Jie/openwebui-extensions)
|
**Author:** [Fu-Jie](https://github.com/Fu-Jie) | **Version:** 1.1.0 | **Project:** [OpenWebUI Extensions](https://github.com/Fu-Jie/openwebui-extensions)
|
||||||
|
|
||||||
One-click batch install plugins from GitHub repositories to your OpenWebUI instance.
|
One-click batch install plugins from GitHub repositories to your OpenWebUI instance.
|
||||||
|
|
||||||
@@ -8,9 +8,10 @@ One-click batch install plugins from GitHub repositories to your OpenWebUI insta
|
|||||||
|
|
||||||
- **One-Click Install**: Install all plugins with a single command
|
- **One-Click Install**: Install all plugins with a single command
|
||||||
- **Auto-Update**: Automatically updates previously installed plugins
|
- **Auto-Update**: Automatically updates previously installed plugins
|
||||||
- **Public GitHub Support**: Install plugins from any public GitHub repository
|
- **Public GitHub Support**: Install plugins from one or many public GitHub repositories
|
||||||
- **Multi-Type Support**: Supports Pipe, Action, Filter, and Tool plugins
|
- **Multi-Type Support**: Supports Pipe, Action, Filter, and Tool plugins
|
||||||
- **Confirmation**: Shows plugin list before installing, allows selective installation
|
- **Multi-Repository Picker**: Combine multiple repositories in one request and review them in a single grouped dialog
|
||||||
|
- **Interactive Selection Dialog**: Filter by repository and type, search by keyword, review plugin descriptions, then install only the checked subset
|
||||||
- **i18n**: Supports 11 languages
|
- **i18n**: Supports 11 languages
|
||||||
|
|
||||||
## Flow
|
## Flow
|
||||||
@@ -20,7 +21,7 @@ User Input
|
|||||||
│
|
│
|
||||||
▼
|
▼
|
||||||
┌─────────────────────────────────────┐
|
┌─────────────────────────────────────┐
|
||||||
│ Discover Plugins from GitHub │
|
│ Discover Plugins from GitHub Repos │
|
||||||
│ (fetch file tree + parse .py) │
|
│ (fetch file tree + parse .py) │
|
||||||
└─────────────────────────────────────┘
|
└─────────────────────────────────────┘
|
||||||
│
|
│
|
||||||
@@ -32,8 +33,8 @@ User Input
|
|||||||
│
|
│
|
||||||
▼
|
▼
|
||||||
┌─────────────────────────────────────┐
|
┌─────────────────────────────────────┐
|
||||||
│ Show Confirmation Dialog │
|
│ Show Selection Dialog │
|
||||||
│ (list plugins + exclude hint) │
|
│ (repo groups + filters + search) │
|
||||||
└─────────────────────────────────────┘
|
└─────────────────────────────────────┘
|
||||||
│
|
│
|
||||||
├── [Cancel] → End
|
├── [Cancel] → End
|
||||||
@@ -57,49 +58,23 @@ User Input
|
|||||||
|
|
||||||
## Interactive Installation Workflow
|
## Interactive Installation Workflow
|
||||||
|
|
||||||
Each request handles one repository. To mix repositories, send another request after the previous installation completes.
|
The `repo` parameter accepts one or more `owner/repo` values separated by commas, semicolons, or new lines.
|
||||||
|
|
||||||
|
After plugin discovery and filtering, OpenWebUI opens a browser dialog built with the `execute` event. The dialog merges results from every requested repository, groups them by repository, supports repository tags, type filters, and keyword search, and lets you check exactly which plugins to install before the API calls start.
|
||||||
|
|
||||||
|
If one user request mentions multiple repositories, keep them in the same request so the model can pass them into a single tool call.
|
||||||
|
|
||||||
## Quick Start: Install Popular Collections
|
## Quick Start: Install Popular Collections
|
||||||
|
|
||||||
Copy any of these prompts and paste them into your chat:
|
Paste this prompt into your chat:
|
||||||
|
|
||||||
```
|
```
|
||||||
# Install all from my collection (default)
|
Install all plugins from Fu-Jie/openwebui-extensions, iChristGit/OpenWebui-Tools, Haervwe/open-webui-tools, Classic298/open-webui-plugins, suurt8ll/open_webui_functions, rbb-dev/Open-WebUI-OpenRouter-pipe
|
||||||
Install all plugins
|
|
||||||
|
|
||||||
# Add popular community tools
|
|
||||||
Install all plugins from iChristGit/OpenWebui-Tools
|
|
||||||
|
|
||||||
# Add utility-focused extensions
|
|
||||||
Install all plugins from Haervwe/open-webui-tools
|
|
||||||
|
|
||||||
# Add mixed community implementations
|
|
||||||
Install all plugins from Classic298/open-webui-plugins
|
|
||||||
|
|
||||||
# Add function-based plugins
|
|
||||||
Install all plugins from suurt8ll/open_webui_functions
|
|
||||||
|
|
||||||
# Add OpenRouter pipe integration
|
|
||||||
Install all plugins from rbb-dev/Open-WebUI-OpenRouter-pipe
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Each line is a separate request. Already installed plugins are automatically updated.
|
Once the dialog opens, use the repository tags, type filters, and keyword search to narrow the list before installing. Already installed plugins are automatically updated.
|
||||||
|
|
||||||
## Usage Examples
|
You can replace that repository list with your own collections whenever needed.
|
||||||
|
|
||||||
For more advanced usage patterns:
|
|
||||||
|
|
||||||
```
|
|
||||||
# Filter by plugin type
|
|
||||||
"Install only tool plugins from iChristGit/OpenWebui-Tools"
|
|
||||||
"Install only action plugins from Classic298/open-webui-plugins"
|
|
||||||
|
|
||||||
# Exclude specific plugins
|
|
||||||
"Install all plugins from Haervwe/open-webui-tools, exclude_keywords=test,deprecated"
|
|
||||||
|
|
||||||
# Install from your own repository
|
|
||||||
"Install all plugins from your-username/my-plugin-collection"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Default Repository
|
## Default Repository
|
||||||
|
|
||||||
@@ -127,11 +102,11 @@ For other repositories:
|
|||||||
| `SKIP_KEYWORDS` | `test,verify,example,template,mock` | Comma-separated keywords to skip |
|
| `SKIP_KEYWORDS` | `test,verify,example,template,mock` | Comma-separated keywords to skip |
|
||||||
| `TIMEOUT` | `20` | Request timeout in seconds |
|
| `TIMEOUT` | `20` | Request timeout in seconds |
|
||||||
|
|
||||||
## Confirmation Timeout
|
## Selection Dialog Timeout
|
||||||
|
|
||||||
User confirmation dialogs have a default timeout of **2 minutes (120 seconds)**, allowing sufficient time for users to:
|
The plugin selection dialog has a default timeout of **2 minutes (120 seconds)**, allowing sufficient time for users to:
|
||||||
- Read and review the plugin list
|
- Read and review the plugin list
|
||||||
- Make installation decisions
|
- Check or uncheck the plugins they want
|
||||||
- Handle network delays
|
- Handle network delays
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Batch Install Plugins from GitHub
|
# Batch Install Plugins from GitHub
|
||||||
|
|
||||||
**作者:** [Fu-Jie](https://github.com/Fu-Jie) | **版本:** 1.0.0 | **项目:** [OpenWebUI Extensions](https://github.com/Fu-Jie/openwebui-extensions)
|
**作者:** [Fu-Jie](https://github.com/Fu-Jie) | **版本:** 1.1.0 | **项目:** [OpenWebUI Extensions](https://github.com/Fu-Jie/openwebui-extensions)
|
||||||
|
|
||||||
一键将 GitHub 仓库中的插件批量安装到你的 OpenWebUI 实例。
|
一键将 GitHub 仓库中的插件批量安装到你的 OpenWebUI 实例。
|
||||||
|
|
||||||
@@ -8,9 +8,10 @@
|
|||||||
|
|
||||||
- 一键安装:单个命令安装所有插件
|
- 一键安装:单个命令安装所有插件
|
||||||
- 自动更新:自动更新之前安装过的插件
|
- 自动更新:自动更新之前安装过的插件
|
||||||
- 公开 GitHub 支持:支持从任何公开 GitHub 仓库安装插件
|
- 公开 GitHub 支持:支持从一个或多个公开 GitHub 仓库安装插件
|
||||||
- 多类型支持:支持 Pipe、Action、Filter 和 Tool 插件
|
- 多类型支持:支持 Pipe、Action、Filter 和 Tool 插件
|
||||||
- 安装确认:安装前显示插件列表,支持选择性安装
|
- 多仓库选择器:一次请求可合并多个仓库,并在同一个分组对话框中查看
|
||||||
|
- 交互式选择对话框:先按仓库和类型筛选、按关键词搜索并查看描述信息,再勾选要安装的插件,只安装所选子集
|
||||||
- 国际化:支持 11 种语言
|
- 国际化:支持 11 种语言
|
||||||
|
|
||||||
## 流程
|
## 流程
|
||||||
@@ -20,7 +21,7 @@
|
|||||||
│
|
│
|
||||||
▼
|
▼
|
||||||
┌─────────────────────────────────────┐
|
┌─────────────────────────────────────┐
|
||||||
│ 从 GitHub 发现插件 │
|
│ 从 GitHub 多仓库发现插件 │
|
||||||
│ (获取文件树 + 解析 .py 文件) │
|
│ (获取文件树 + 解析 .py 文件) │
|
||||||
└─────────────────────────────────────┘
|
└─────────────────────────────────────┘
|
||||||
│
|
│
|
||||||
@@ -32,8 +33,8 @@
|
|||||||
│
|
│
|
||||||
▼
|
▼
|
||||||
┌─────────────────────────────────────┐
|
┌─────────────────────────────────────┐
|
||||||
│ 显示确认对话框 │
|
│ 显示选择对话框 │
|
||||||
│ (插件列表 + 排除提示) │
|
│ (仓库分组 + 筛选 + 搜索) │
|
||||||
└─────────────────────────────────────┘
|
└─────────────────────────────────────┘
|
||||||
│
|
│
|
||||||
├── [取消] → 结束
|
├── [取消] → 结束
|
||||||
@@ -57,49 +58,23 @@
|
|||||||
|
|
||||||
## 交互式安装工作流
|
## 交互式安装工作流
|
||||||
|
|
||||||
每次请求处理一个仓库。如需混合多个来源,请在上一次安装完成后再发起下一次请求。
|
`repo` 参数现在支持多个 `owner/repo`,可用逗号、分号或换行分隔。
|
||||||
|
|
||||||
|
在插件发现和过滤完成后,OpenWebUI 会通过 `execute` 事件打开浏览器选择对话框。对话框会合并所有目标仓库的结果,按仓库分组展示,并支持仓库标签、类型筛选、关键词搜索和描述查看,再开始调用安装 API。
|
||||||
|
|
||||||
|
如果一次用户请求里提到了多个仓库,尽量保持在同一次请求里,让模型把它们合并到一次工具调用中。
|
||||||
|
|
||||||
## 快速开始:安装热门插件集
|
## 快速开始:安装热门插件集
|
||||||
|
|
||||||
复制以下任一提示词,粘贴到你的对话框中:
|
复制下面这条提示词,粘贴到你的对话框中:
|
||||||
|
|
||||||
```
|
```
|
||||||
# 安装我的默认集合
|
从 Fu-Jie/openwebui-extensions、iChristGit/OpenWebui-Tools、Haervwe/open-webui-tools、Classic298/open-webui-plugins、suurt8ll/open_webui_functions、rbb-dev/Open-WebUI-OpenRouter-pipe 安装所有插件
|
||||||
安装所有插件
|
|
||||||
|
|
||||||
# 添加热门社区工具
|
|
||||||
从 iChristGit/OpenWebui-Tools 安装所有插件
|
|
||||||
|
|
||||||
# 添加实用工具扩展
|
|
||||||
从 Haervwe/open-webui-tools 安装所有插件
|
|
||||||
|
|
||||||
# 添加混合社区实现
|
|
||||||
从 Classic298/open-webui-plugins 安装所有插件
|
|
||||||
|
|
||||||
# 添加基于函数的插件
|
|
||||||
从 suurt8ll/open_webui_functions 安装所有插件
|
|
||||||
|
|
||||||
# 添加 OpenRouter 管道集成
|
|
||||||
从 rbb-dev/Open-WebUI-OpenRouter-pipe 安装所有插件
|
|
||||||
```
|
```
|
||||||
|
|
||||||
每一行是一个独立的请求。已安装的插件会自动更新。
|
弹窗出现后,直接用里面的仓库标签、类型筛选和关键词搜索来缩小范围再安装。已安装的插件会自动更新。
|
||||||
|
|
||||||
## 使用示例
|
需要时,你也可以把这串仓库替换成你自己的插件仓库组合。
|
||||||
|
|
||||||
更多高级用法:
|
|
||||||
|
|
||||||
```
|
|
||||||
# 按插件类型过滤
|
|
||||||
"从 iChristGit/OpenWebui-Tools 仅安装 tool 插件"
|
|
||||||
"从 Classic298/open-webui-plugins 仅安装 action 插件"
|
|
||||||
|
|
||||||
# 排除特定插件
|
|
||||||
"从 Haervwe/open-webui-tools 安装所有插件, exclude_keywords=test,deprecated"
|
|
||||||
|
|
||||||
# 从你自己的仓库安装
|
|
||||||
"从 your-username/my-plugin-collection 安装所有插件"
|
|
||||||
```
|
|
||||||
|
|
||||||
## 默认仓库
|
## 默认仓库
|
||||||
|
|
||||||
@@ -127,11 +102,11 @@
|
|||||||
| `SKIP_KEYWORDS` | `test,verify,example,template,mock` | 逗号分隔的跳过关键词 |
|
| `SKIP_KEYWORDS` | `test,verify,example,template,mock` | 逗号分隔的跳过关键词 |
|
||||||
| `TIMEOUT` | `20` | 请求超时时间(秒)|
|
| `TIMEOUT` | `20` | 请求超时时间(秒)|
|
||||||
|
|
||||||
## 确认超时时间
|
## 选择对话框超时时间
|
||||||
|
|
||||||
用户确认对话框的默认超时时间为 **2 分钟(120 秒)**,为用户提供充足的时间来:
|
插件选择对话框的默认超时时间为 **2 分钟(120 秒)**,为用户提供充足的时间来:
|
||||||
- 阅读和查看插件列表
|
- 阅读和查看插件列表
|
||||||
- 做出安装决定
|
- 勾选或取消勾选想安装的插件
|
||||||
- 处理网络延迟
|
- 处理网络延迟
|
||||||
|
|
||||||
## 支持
|
## 支持
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Batch Install Plugins from GitHub
|
# Batch Install Plugins from GitHub
|
||||||
|
|
||||||
| By [Fu-Jie](https://github.com/Fu-Jie) · v1.0.0 | [⭐ Star this repo](https://github.com/Fu-Jie/openwebui-extensions) |
|
| By [Fu-Jie](https://github.com/Fu-Jie) · v1.1.0 | [⭐ Star this repo](https://github.com/Fu-Jie/openwebui-extensions) |
|
||||||
| :--- | ---: |
|
| :--- | ---: |
|
||||||
|
|
||||||
|  |  |  |  |  |  |  |
|
|  |  |  |  |  |  |  |
|
||||||
@@ -12,9 +12,10 @@ One-click batch install plugins from GitHub repositories to your OpenWebUI insta
|
|||||||
|
|
||||||
- **One-Click Install**: Install all plugins with a single command
|
- **One-Click Install**: Install all plugins with a single command
|
||||||
- **Auto-Update**: Automatically updates previously installed plugins
|
- **Auto-Update**: Automatically updates previously installed plugins
|
||||||
- **Public GitHub Support**: Install plugins from any public GitHub repository
|
- **Public GitHub Support**: Install plugins from one or many public GitHub repositories
|
||||||
- **Multi-Type Support**: Supports Pipe, Action, Filter, and Tool plugins
|
- **Multi-Type Support**: Supports Pipe, Action, Filter, and Tool plugins
|
||||||
- **Confirmation**: Shows plugin list before installing, allows selective installation
|
- **Multi-Repository Picker**: Combine multiple repositories in one request and review them in a single grouped dialog
|
||||||
|
- **Interactive Selection Dialog**: Filter by repository and type, search by keyword, review plugin descriptions, then install only the checked subset
|
||||||
- **i18n**: Supports 11 languages
|
- **i18n**: Supports 11 languages
|
||||||
|
|
||||||
## Flow
|
## Flow
|
||||||
@@ -24,7 +25,7 @@ User Input
|
|||||||
│
|
│
|
||||||
▼
|
▼
|
||||||
┌─────────────────────────────────────┐
|
┌─────────────────────────────────────┐
|
||||||
│ Discover Plugins from GitHub │
|
│ Discover Plugins from GitHub Repos │
|
||||||
│ (fetch file tree + parse .py) │
|
│ (fetch file tree + parse .py) │
|
||||||
└─────────────────────────────────────┘
|
└─────────────────────────────────────┘
|
||||||
│
|
│
|
||||||
@@ -36,8 +37,8 @@ User Input
|
|||||||
│
|
│
|
||||||
▼
|
▼
|
||||||
┌─────────────────────────────────────┐
|
┌─────────────────────────────────────┐
|
||||||
│ Show Confirmation Dialog │
|
│ Show Selection Dialog │
|
||||||
│ (list plugins + exclude hint) │
|
│ (repo groups + filters + search) │
|
||||||
└─────────────────────────────────────┘
|
└─────────────────────────────────────┘
|
||||||
│
|
│
|
||||||
├── [Cancel] → End
|
├── [Cancel] → End
|
||||||
@@ -61,49 +62,23 @@ User Input
|
|||||||
|
|
||||||
## Interactive Installation Workflow
|
## Interactive Installation Workflow
|
||||||
|
|
||||||
Each request handles one repository. To mix repositories, send another request after the previous installation completes.
|
The `repo` parameter accepts one or more `owner/repo` values separated by commas, semicolons, or new lines.
|
||||||
|
|
||||||
|
After plugin discovery and filtering, OpenWebUI opens a browser dialog built with the `execute` event. The dialog merges results from every requested repository, groups them by repository, supports repository tags, type filters, and keyword search, and lets you check exactly which plugins to install before the API calls start.
|
||||||
|
|
||||||
|
If one user request mentions multiple repositories, keep them in the same request so the model can pass them into a single tool call.
|
||||||
|
|
||||||
## Quick Start: Install Popular Collections
|
## Quick Start: Install Popular Collections
|
||||||
|
|
||||||
Copy any of these prompts and paste them into your chat:
|
Paste this prompt into your chat:
|
||||||
|
|
||||||
```
|
```
|
||||||
# Install all from my collection (default)
|
Install all plugins from Fu-Jie/openwebui-extensions, iChristGit/OpenWebui-Tools, Haervwe/open-webui-tools, Classic298/open-webui-plugins, suurt8ll/open_webui_functions, rbb-dev/Open-WebUI-OpenRouter-pipe
|
||||||
Install all plugins
|
|
||||||
|
|
||||||
# Add popular community tools
|
|
||||||
Install all plugins from iChristGit/OpenWebui-Tools
|
|
||||||
|
|
||||||
# Add utility-focused extensions
|
|
||||||
Install all plugins from Haervwe/open-webui-tools
|
|
||||||
|
|
||||||
# Add mixed community implementations
|
|
||||||
Install all plugins from Classic298/open-webui-plugins
|
|
||||||
|
|
||||||
# Add function-based plugins
|
|
||||||
Install all plugins from suurt8ll/open_webui_functions
|
|
||||||
|
|
||||||
# Add OpenRouter pipe integration
|
|
||||||
Install all plugins from rbb-dev/Open-WebUI-OpenRouter-pipe
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Each line is a separate request. Already installed plugins are automatically updated.
|
Once the dialog opens, use the repository tags, type filters, and keyword search to narrow the list before installing. Already installed plugins are automatically updated.
|
||||||
|
|
||||||
## Usage Examples
|
You can replace that repository list with your own collections whenever needed.
|
||||||
|
|
||||||
For more advanced usage patterns:
|
|
||||||
|
|
||||||
```
|
|
||||||
# Filter by plugin type
|
|
||||||
"Install only tool plugins from iChristGit/OpenWebui-Tools"
|
|
||||||
"Install only action plugins from Classic298/open-webui-plugins"
|
|
||||||
|
|
||||||
# Exclude specific plugins
|
|
||||||
"Install all plugins from Haervwe/open-webui-tools, exclude_keywords=test,deprecated"
|
|
||||||
|
|
||||||
# Install from your own repository
|
|
||||||
"Install all plugins from your-username/my-plugin-collection"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Default Repository
|
## Default Repository
|
||||||
|
|
||||||
@@ -131,11 +106,11 @@ For other repositories:
|
|||||||
| `SKIP_KEYWORDS` | `test,verify,example,template,mock` | Comma-separated keywords to skip |
|
| `SKIP_KEYWORDS` | `test,verify,example,template,mock` | Comma-separated keywords to skip |
|
||||||
| `TIMEOUT` | `20` | Request timeout in seconds |
|
| `TIMEOUT` | `20` | Request timeout in seconds |
|
||||||
|
|
||||||
## Confirmation Timeout
|
## Selection Dialog Timeout
|
||||||
|
|
||||||
User confirmation dialogs have a default timeout of **2 minutes (120 seconds)**, allowing sufficient time for users to:
|
The plugin selection dialog has a default timeout of **2 minutes (120 seconds)**, allowing sufficient time for users to:
|
||||||
- Read and review the plugin list
|
- Read and review the plugin list
|
||||||
- Make installation decisions
|
- Check or uncheck the plugins they want
|
||||||
- Handle network delays
|
- Handle network delays
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Batch Install Plugins from GitHub
|
# Batch Install Plugins from GitHub
|
||||||
|
|
||||||
| 作者:[Fu-Jie](https://github.com/Fu-Jie) · v1.0.0 | [⭐ 点个 Star 支持项目](https://github.com/Fu-Jie/openwebui-extensions) |
|
| 作者:[Fu-Jie](https://github.com/Fu-Jie) · v1.1.0 | [⭐ 点个 Star 支持项目](https://github.com/Fu-Jie/openwebui-extensions) |
|
||||||
| :--- | ---: |
|
| :--- | ---: |
|
||||||
|
|
||||||
|  |  |  |  |  |  |  |
|
|  |  |  |  |  |  |  |
|
||||||
@@ -12,9 +12,10 @@
|
|||||||
|
|
||||||
- 一键安装:单个命令安装所有插件
|
- 一键安装:单个命令安装所有插件
|
||||||
- 自动更新:自动更新之前安装过的插件
|
- 自动更新:自动更新之前安装过的插件
|
||||||
- 公开 GitHub 支持:支持从任何公开 GitHub 仓库安装插件
|
- 公开 GitHub 支持:支持从一个或多个公开 GitHub 仓库安装插件
|
||||||
- 多类型支持:支持 Pipe、Action、Filter 和 Tool 插件
|
- 多类型支持:支持 Pipe、Action、Filter 和 Tool 插件
|
||||||
- 安装确认:安装前显示插件列表,支持选择性安装
|
- 多仓库选择器:一次请求可合并多个仓库,并在同一个分组对话框中查看
|
||||||
|
- 交互式选择对话框:先按仓库和类型筛选、按关键词搜索并查看描述信息,再勾选要安装的插件,只安装所选子集
|
||||||
- 国际化:支持 11 种语言
|
- 国际化:支持 11 种语言
|
||||||
|
|
||||||
## 流程
|
## 流程
|
||||||
@@ -24,7 +25,7 @@
|
|||||||
│
|
│
|
||||||
▼
|
▼
|
||||||
┌─────────────────────────────────────┐
|
┌─────────────────────────────────────┐
|
||||||
│ 从 GitHub 发现插件 │
|
│ 从 GitHub 多仓库发现插件 │
|
||||||
│ (获取文件树 + 解析 .py 文件) │
|
│ (获取文件树 + 解析 .py 文件) │
|
||||||
└─────────────────────────────────────┘
|
└─────────────────────────────────────┘
|
||||||
│
|
│
|
||||||
@@ -36,8 +37,8 @@
|
|||||||
│
|
│
|
||||||
▼
|
▼
|
||||||
┌─────────────────────────────────────┐
|
┌─────────────────────────────────────┐
|
||||||
│ 显示确认对话框 │
|
│ 显示选择对话框 │
|
||||||
│ (插件列表 + 排除提示) │
|
│ (仓库分组 + 筛选 + 搜索) │
|
||||||
└─────────────────────────────────────┘
|
└─────────────────────────────────────┘
|
||||||
│
|
│
|
||||||
├── [取消] → 结束
|
├── [取消] → 结束
|
||||||
@@ -61,49 +62,23 @@
|
|||||||
|
|
||||||
## 交互式安装工作流
|
## 交互式安装工作流
|
||||||
|
|
||||||
每次请求处理一个仓库。如需混合多个来源,请在上一次安装完成后再发起下一次请求。
|
`repo` 参数现在支持多个 `owner/repo`,可用逗号、分号或换行分隔。
|
||||||
|
|
||||||
|
在插件发现和过滤完成后,OpenWebUI 会通过 `execute` 事件打开浏览器选择对话框。对话框会合并所有目标仓库的结果,按仓库分组展示,并支持仓库标签、类型筛选、关键词搜索和描述查看,再开始调用安装 API。
|
||||||
|
|
||||||
|
如果一次用户请求里提到了多个仓库,尽量保持在同一次请求里,让模型把它们合并到一次工具调用中。
|
||||||
|
|
||||||
## 快速开始:安装热门插件集
|
## 快速开始:安装热门插件集
|
||||||
|
|
||||||
复制以下任一提示词,粘贴到你的对话框中:
|
复制下面这条提示词,粘贴到你的对话框中:
|
||||||
|
|
||||||
```
|
```
|
||||||
# 安装我的默认集合
|
从 Fu-Jie/openwebui-extensions、iChristGit/OpenWebui-Tools、Haervwe/open-webui-tools、Classic298/open-webui-plugins、suurt8ll/open_webui_functions、rbb-dev/Open-WebUI-OpenRouter-pipe 安装所有插件
|
||||||
安装所有插件
|
|
||||||
|
|
||||||
# 添加热门社区工具
|
|
||||||
从 iChristGit/OpenWebui-Tools 安装所有插件
|
|
||||||
|
|
||||||
# 添加实用工具扩展
|
|
||||||
从 Haervwe/open-webui-tools 安装所有插件
|
|
||||||
|
|
||||||
# 添加混合社区实现
|
|
||||||
从 Classic298/open-webui-plugins 安装所有插件
|
|
||||||
|
|
||||||
# 添加基于函数的插件
|
|
||||||
从 suurt8ll/open_webui_functions 安装所有插件
|
|
||||||
|
|
||||||
# 添加 OpenRouter 管道集成
|
|
||||||
从 rbb-dev/Open-WebUI-OpenRouter-pipe 安装所有插件
|
|
||||||
```
|
```
|
||||||
|
|
||||||
每一行是一个独立的请求。已安装的插件会自动更新。
|
弹窗出现后,直接用里面的仓库标签、类型筛选和关键词搜索来缩小范围再安装。已安装的插件会自动更新。
|
||||||
|
|
||||||
## 使用示例
|
需要时,你也可以把这串仓库替换成你自己的插件仓库组合。
|
||||||
|
|
||||||
更多高级用法:
|
|
||||||
|
|
||||||
```
|
|
||||||
# 按插件类型过滤
|
|
||||||
"从 iChristGit/OpenWebui-Tools 仅安装 tool 插件"
|
|
||||||
"从 Classic298/open-webui-plugins 仅安装 action 插件"
|
|
||||||
|
|
||||||
# 排除特定插件
|
|
||||||
"从 Haervwe/open-webui-tools 安装所有插件, exclude_keywords=test,deprecated"
|
|
||||||
|
|
||||||
# 从你自己的仓库安装
|
|
||||||
"从 your-username/my-plugin-collection 安装所有插件"
|
|
||||||
```
|
|
||||||
|
|
||||||
## 默认仓库
|
## 默认仓库
|
||||||
|
|
||||||
@@ -131,11 +106,11 @@
|
|||||||
| `SKIP_KEYWORDS` | `test,verify,example,template,mock` | 逗号分隔的跳过关键词 |
|
| `SKIP_KEYWORDS` | `test,verify,example,template,mock` | 逗号分隔的跳过关键词 |
|
||||||
| `TIMEOUT` | `20` | 请求超时时间(秒)|
|
| `TIMEOUT` | `20` | 请求超时时间(秒)|
|
||||||
|
|
||||||
## 确认超时时间
|
## 选择对话框超时时间
|
||||||
|
|
||||||
用户确认对话框的默认超时时间为 **2 分钟(120 秒)**,为用户提供充足的时间来:
|
插件选择对话框的默认超时时间为 **2 分钟(120 秒)**,为用户提供充足的时间来:
|
||||||
- 阅读和查看插件列表
|
- 阅读和查看插件列表
|
||||||
- 做出安装决定
|
- 勾选或取消勾选想安装的插件
|
||||||
- 处理网络延迟
|
- 处理网络延迟
|
||||||
|
|
||||||
## 支持
|
## 支持
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ OpenWebUI native Tool plugins that can be used across models.
|
|||||||
|
|
||||||
## Available Tool Plugins
|
## Available Tool Plugins
|
||||||
|
|
||||||
- [Batch Install Plugins from GitHub](batch-install-plugins-tool.md) (v1.0.0) - One-click batch install plugins from GitHub repositories with confirmation and multi-language support.
|
- [Batch Install Plugins from GitHub](batch-install-plugins-tool.md) (v1.1.0) - One-click batch install plugins from GitHub repositories with an interactive selection dialog and multi-language support.
|
||||||
- [OpenWebUI Skills Manager Tool](openwebui-skills-manager-tool.md) (v0.3.0) - Simple native skill management (`list/show/install/create/update/delete`).
|
- [OpenWebUI Skills Manager Tool](openwebui-skills-manager-tool.md) (v0.3.0) - Simple native skill management (`list/show/install/create/update/delete`).
|
||||||
- [Smart Mind Map Tool](smart-mind-map-tool.md) (v1.0.0) - Intelligently analyzes text content and proactively generates interactive mind maps to help users structure and visualize knowledge.
|
- [Smart Mind Map Tool](smart-mind-map-tool.md) (v1.0.0) - Intelligently analyzes text content and proactively generates interactive mind maps to help users structure and visualize knowledge.
|
||||||
|
|||||||
@@ -4,6 +4,6 @@
|
|||||||
|
|
||||||
## 可用 Tool 插件
|
## 可用 Tool 插件
|
||||||
|
|
||||||
- [Batch Install Plugins from GitHub](batch-install-plugins-tool.zh.md) (v1.0.0) - 一键从 GitHub 仓库批量安装插件,支持确认和多语言。
|
- [Batch Install Plugins from GitHub](batch-install-plugins-tool.zh.md) (v1.1.0) - 一键从 GitHub 仓库批量安装插件,支持交互式选择对话框和多语言。
|
||||||
- [OpenWebUI Skills 管理工具](openwebui-skills-manager-tool.zh.md) (v0.3.0) - 简化技能管理(`list/show/install/create/update/delete`)。
|
- [OpenWebUI Skills 管理工具](openwebui-skills-manager-tool.zh.md) (v0.3.0) - 简化技能管理(`list/show/install/create/update/delete`)。
|
||||||
- [智能思维导图工具 (Smart Mind Map Tool)](smart-mind-map-tool.zh.md) (v1.0.0) - 智能分析文本内容并主动生成交互式思维导图,帮助用户结构化与可视化知识。
|
- [智能思维导图工具 (Smart Mind Map Tool)](smart-mind-map-tool.zh.md) (v1.0.0) - 智能分析文本内容并主动生成交互式思维导图,帮助用户结构化与可视化知识。
|
||||||
|
|||||||
@@ -1,29 +1,30 @@
|
|||||||
# 🎉 Introducing Batch Install Plugins v1.0.0
|
# 🎉 Batch Install Plugins v1.1.0
|
||||||
|
|
||||||
## Headline
|
## Headline
|
||||||
**One-Click Batch Installation of OpenWebUI Plugins - Solving the Plugin Setup Headache**
|
**Interactive Plugin Picker for OpenWebUI Batch Installation**
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
Installing plugins in OpenWebUI used to be tedious: searching for plugins, downloading them one by one, and hoping everything works in your environment. Today, we're excited to announce **Batch Install Plugins from GitHub** v1.0.0 — a powerful new tool that transforms plugin installation from a chore into a single command.
|
Installing plugins in OpenWebUI should not feel like an all-or-nothing jump. With **Batch Install Plugins from GitHub** v1.1.0, the workflow now opens an interactive browser dialog so users can review the filtered list and choose exactly which plugins to install before the API requests begin.
|
||||||
|
|
||||||
## Key Highlights
|
## Key Highlights
|
||||||
|
|
||||||
### 🚀 One-Click Bulk Installation
|
### 🚀 Interactive Plugin Selection
|
||||||
- Install multiple plugins from any public GitHub repository with a single command
|
- Uses the OpenWebUI `execute` event to open a custom browser dialog
|
||||||
- Automatically discovers plugins and validates them
|
- Displays the filtered plugin list with checkboxes, type filters, keyword search, plugin descriptions, and repository context
|
||||||
- Updates previously installed plugins seamlessly
|
- Installs only the plugins the user keeps selected
|
||||||
|
|
||||||
### ✅ Smart Safety Features
|
### ✅ Smart Safety Features
|
||||||
- Shows a confirmation dialog with the plugin list before installation
|
- Replaces the basic confirmation event with a richer selective install flow
|
||||||
- Users can review and approve before proceeding
|
- Users can uncheck plugins they do not want without rewriting the request
|
||||||
|
- Removes the noisy copy-to-exclude helper when it is not needed
|
||||||
- Automatically excludes the tool itself from installation
|
- Automatically excludes the tool itself from installation
|
||||||
|
|
||||||
### 🌍 Multi-Repository Support
|
### 🌍 Multi-Repository Support
|
||||||
Install plugins from **any public GitHub repository**, including your own community collections:
|
Install plugins from **any public GitHub repository**, including your own community collections:
|
||||||
- Use one request per repository, then call the tool again to combine multiple sources
|
- Use one request to combine multiple repositories in a single grouped picker
|
||||||
- **Default**: Fu-Jie/openwebui-extensions (my personal collection)
|
- **Default**: Fu-Jie/openwebui-extensions (my personal collection)
|
||||||
- Works with public repositories in `owner/repo` format
|
- Works with public repositories in `owner/repo` format, separated by commas, semicolons, or new lines
|
||||||
- Mix and match plugins: install from my collection first, then add community collections in subsequent calls
|
- Mix and match plugins from multiple sources before installation starts
|
||||||
|
|
||||||
### 🔧 Container-Friendly
|
### 🔧 Container-Friendly
|
||||||
- Automatically handles port mapping issues in containerized deployments
|
- Automatically handles port mapping issues in containerized deployments
|
||||||
@@ -37,25 +38,25 @@ Install plugins from **any public GitHub repository**, including your own commun
|
|||||||
|
|
||||||
## How It Works: Interactive Installation Workflow
|
## How It Works: Interactive Installation Workflow
|
||||||
|
|
||||||
Each request handles one repository. To combine multiple repositories, send another request after the previous installation completes.
|
The `repo` parameter now accepts one or more `owner/repo` values separated by commas, semicolons, or new lines.
|
||||||
|
|
||||||
1. **Start with My Collection**
|
1. **Start with My Collection**
|
||||||
```
|
```
|
||||||
"Install all plugins from Fu-Jie/openwebui-extensions"
|
"Install all plugins from Fu-Jie/openwebui-extensions"
|
||||||
```
|
```
|
||||||
Review the confirmation dialog, approve, and the plugins are installed.
|
Review the selection dialog, keep the plugins you want checked, and then install them.
|
||||||
|
|
||||||
2. **Add a Community Collection**
|
2. **Mix in a Community Collection**
|
||||||
```
|
```
|
||||||
"Install all plugins from iChristGit/OpenWebui-Tools"
|
"Install all plugins from Fu-Jie/openwebui-extensions, iChristGit/OpenWebui-Tools"
|
||||||
```
|
```
|
||||||
Add more plugins from a different repository. Already installed plugins are updated seamlessly.
|
Review both repositories in one grouped dialog, then install only the subset you want.
|
||||||
|
|
||||||
3. **Install a Specific Type**
|
3. **Install a Specific Type Across Repositories**
|
||||||
```
|
```
|
||||||
"Install only pipe plugins from Haervwe/open-webui-tools"
|
"Install only pipe plugins from Haervwe/open-webui-tools, Classic298/open-webui-plugins"
|
||||||
```
|
```
|
||||||
Pick specific plugin types from another repository, or exclude certain keywords.
|
Pick specific plugin types across repositories, or exclude certain keywords.
|
||||||
|
|
||||||
4. **Use Your Own Public Repository**
|
4. **Use Your Own Public Repository**
|
||||||
```
|
```
|
||||||
@@ -84,23 +85,23 @@ OpenRouter API pipe integration for advanced model access.
|
|||||||
|
|
||||||
## Usage Examples
|
## Usage Examples
|
||||||
|
|
||||||
Each line below is a separate request:
|
Each line below can be used directly. The third example combines repositories in one request:
|
||||||
|
|
||||||
```
|
```
|
||||||
# Start with my collection
|
# Start with my collection
|
||||||
"Install all plugins"
|
"Install all plugins"
|
||||||
|
|
||||||
# Add community plugins in a new request
|
# Add community plugins
|
||||||
"Install all plugins from iChristGit/OpenWebui-Tools"
|
"Install all plugins from iChristGit/OpenWebui-Tools"
|
||||||
|
|
||||||
# Add only one plugin type from another repository
|
# Combine repositories in one picker
|
||||||
"Install only tool plugins from Haervwe/open-webui-tools"
|
"Install all plugins from Fu-Jie/openwebui-extensions, Classic298/open-webui-plugins"
|
||||||
|
|
||||||
# Continue building your setup
|
# Add only one plugin type from multiple repositories
|
||||||
"Install only action plugins from Classic298/open-webui-plugins"
|
"Install only tool plugins from Haervwe/open-webui-tools, Classic298/open-webui-plugins"
|
||||||
|
|
||||||
# Filter out unwanted plugins
|
# Filter out unwanted plugins
|
||||||
"Install all plugins from Haervwe/open-webui-tools, exclude_keywords=test,deprecated"
|
"Install all plugins from Haervwe/open-webui-tools, Classic298/open-webui-plugins, exclude_keywords=test,deprecated"
|
||||||
|
|
||||||
# Install from your own public repository
|
# Install from your own public repository
|
||||||
"Install all plugins from your-username/my-plugin-collection"
|
"Install all plugins from your-username/my-plugin-collection"
|
||||||
@@ -110,8 +111,8 @@ Each line below is a separate request:
|
|||||||
|
|
||||||
- **Async Architecture**: Non-blocking I/O for better performance
|
- **Async Architecture**: Non-blocking I/O for better performance
|
||||||
- **httpx Integration**: Modern async HTTP client with timeout protection
|
- **httpx Integration**: Modern async HTTP client with timeout protection
|
||||||
- **Comprehensive Tests**: 8 regression tests with 100% pass rate
|
- **Selective Install Flow**: The install loop now runs only for the checked plugin subset
|
||||||
- **Full Event Support**: Proper OpenWebUI event injection with fallback handling
|
- **Full Event Support**: Proper OpenWebUI `execute` event handling with fallback behavior
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -123,7 +124,7 @@ Each line below is a separate request:
|
|||||||
## Links
|
## Links
|
||||||
|
|
||||||
- **GitHub Repository**: https://github.com/Fu-Jie/openwebui-extensions/tree/main/plugins/tools/batch-install-plugins
|
- **GitHub Repository**: https://github.com/Fu-Jie/openwebui-extensions/tree/main/plugins/tools/batch-install-plugins
|
||||||
- **Release Notes**: https://github.com/Fu-Jie/openwebui-extensions/blob/main/plugins/tools/batch-install-plugins/v1.0.0.md
|
- **Release Notes**: https://github.com/Fu-Jie/openwebui-extensions/blob/main/plugins/tools/batch-install-plugins/v1.1.0.md
|
||||||
|
|
||||||
## Community Love
|
## Community Love
|
||||||
|
|
||||||
|
|||||||
@@ -1,29 +1,30 @@
|
|||||||
# 🎉 Batch Install Plugins 首发 v1.0.0
|
# 🎉 Batch Install Plugins v1.1.0
|
||||||
|
|
||||||
## 标题
|
## 标题
|
||||||
**一键批量安装 OpenWebUI 插件 - 解决装机烦恼**
|
**为 OpenWebUI 批量安装带来可勾选的交互式插件选择器**
|
||||||
|
|
||||||
## 前言
|
## 前言
|
||||||
在 OpenWebUI 中安装插件曾经很麻烦:逐个搜索、逐个下载、祈祷一切顺利。今天,我们欣然宣布 **Batch Install Plugins from GitHub** v1.0.0 的问世 — 一款强大的新工具,让插件安装从苦差事变成一条简单命令。
|
批量安装不应该是“全装或不装”的二选一。现在,**Batch Install Plugins from GitHub** v1.1.0 新增了基于浏览器的交互式选择对话框,用户可以先查看过滤后的插件列表,再勾选真正要安装的插件,然后才开始调用安装 API。
|
||||||
|
|
||||||
## 核心特性
|
## 核心特性
|
||||||
|
|
||||||
### 🚀 一键批量安装
|
### 🚀 交互式插件选择
|
||||||
- 从任意公开 GitHub 仓库用一条命令安装多个插件
|
- 基于 OpenWebUI 的 `execute` 事件打开自定义浏览器选择对话框
|
||||||
- 自动发现插件并进行验证
|
- 显示带复选框、类型筛选、关键词搜索、插件描述和仓库信息的过滤结果
|
||||||
- 无缝更新已安装的插件
|
- 只安装用户保留勾选的插件
|
||||||
|
|
||||||
### ✅ 智能安全保障
|
### ✅ 智能安全保障
|
||||||
- 安装前显示插件列表确认对话框
|
- 用更丰富的选择流程替代基础 confirmation 事件
|
||||||
- 用户可在安装前查看和审批
|
- 用户无需改写请求,也能取消勾选不想安装的插件
|
||||||
|
- 不再显示多余的“复制 exclude_keywords”提示
|
||||||
- 自动排除工具自身,避免重复安装
|
- 自动排除工具自身,避免重复安装
|
||||||
|
|
||||||
### 🌍 多仓库支持
|
### 🌍 多仓库支持
|
||||||
支持从**任意公开 GitHub 仓库**安装插件,包括你自己的社区合集:
|
支持从**任意公开 GitHub 仓库**安装插件,包括你自己的社区合集:
|
||||||
- 每次请求处理一个仓库,需要时可再次调用工具来组合多个来源
|
- 一次请求即可组合多个仓库,并在同一个分组选择器中查看
|
||||||
- **默认**:Fu-Jie/openwebui-extensions(我的个人合集)
|
- **默认**:Fu-Jie/openwebui-extensions(我的个人合集)
|
||||||
- 支持公开仓库,格式为 `owner/repo`
|
- 支持公开仓库,格式为 `owner/repo`,可用逗号、分号或换行分隔
|
||||||
- 混合搭配:先从我的合集安装,再通过后续调用添加社区合集
|
- 混合搭配:安装前就能在同一个对话框中选择多个来源的插件
|
||||||
|
|
||||||
### 🔧 容器友好
|
### 🔧 容器友好
|
||||||
- 自动处理容器部署中的端口映射问题
|
- 自动处理容器部署中的端口映射问题
|
||||||
@@ -37,25 +38,25 @@
|
|||||||
|
|
||||||
## 工作流程:交互式安装
|
## 工作流程:交互式安装
|
||||||
|
|
||||||
每次请求处理一个仓库。如需组合多个仓库,请在上一次安装完成后再发起下一次请求。
|
`repo` 参数现在支持多个 `owner/repo`,可用逗号、分号或换行分隔。
|
||||||
|
|
||||||
1. **先从我的合集开始**
|
1. **先从我的合集开始**
|
||||||
```
|
```
|
||||||
"安装 Fu-Jie/openwebui-extensions 中的所有插件"
|
"安装 Fu-Jie/openwebui-extensions 中的所有插件"
|
||||||
```
|
```
|
||||||
查看确认对话框,批准后开始安装。
|
查看选择对话框,保留想安装的勾选项后开始安装。
|
||||||
|
|
||||||
2. **再添加社区合集**
|
2. **混合加入社区合集**
|
||||||
```
|
```
|
||||||
"从 iChristGit/OpenWebui-Tools 安装所有插件"
|
"从 Fu-Jie/openwebui-extensions、iChristGit/OpenWebui-Tools 安装所有插件"
|
||||||
```
|
```
|
||||||
从不同仓库添加更多插件。已安装的插件会无缝更新。
|
在一个按仓库分组的选择对话框里查看两个来源,再安装真正需要的子集。
|
||||||
|
|
||||||
3. **按类型继续安装**
|
3. **跨仓库按类型继续安装**
|
||||||
```
|
```
|
||||||
"从 Haervwe/open-webui-tools 仅安装 pipe 插件"
|
"从 Haervwe/open-webui-tools、Classic298/open-webui-plugins 仅安装 pipe 插件"
|
||||||
```
|
```
|
||||||
从另一个仓库选择特定类型的插件,或排除某些关键词。
|
一次性在多个仓库里选择特定类型的插件,或排除某些关键词。
|
||||||
|
|
||||||
4. **使用你自己的公开仓库**
|
4. **使用你自己的公开仓库**
|
||||||
```
|
```
|
||||||
@@ -84,23 +85,23 @@ OpenRouter API pipe 集成,提供高级模型访问。
|
|||||||
|
|
||||||
## 使用示例
|
## 使用示例
|
||||||
|
|
||||||
下面每一行都是一次独立请求:
|
下面每一行都可以直接使用,其中第三行演示了单次请求组合多个仓库:
|
||||||
|
|
||||||
```
|
```
|
||||||
# 先从我的合集开始
|
# 先从我的合集开始
|
||||||
"安装所有插件"
|
"安装所有插件"
|
||||||
|
|
||||||
# 在下一次请求中加入社区插件
|
# 添加社区插件
|
||||||
"从 iChristGit/OpenWebui-Tools 安装所有插件"
|
"从 iChristGit/OpenWebui-Tools 安装所有插件"
|
||||||
|
|
||||||
# 从其他仓库只安装某一种类型
|
# 在同一个选择器里组合多个仓库
|
||||||
"从 Haervwe/open-webui-tools 仅安装 tool 插件"
|
"从 Fu-Jie/openwebui-extensions、Classic298/open-webui-plugins 安装所有插件"
|
||||||
|
|
||||||
# 继续补充你的插件组合
|
# 从多个仓库只安装某一种类型
|
||||||
"从 Classic298/open-webui-plugins 安装仅 action 插件"
|
"从 Haervwe/open-webui-tools、Classic298/open-webui-plugins 仅安装 tool 插件"
|
||||||
|
|
||||||
# 过滤不想安装的插件
|
# 过滤不想安装的插件
|
||||||
"从 Haervwe/open-webui-tools 安装所有插件,exclude_keywords=test,deprecated"
|
"从 Haervwe/open-webui-tools、Classic298/open-webui-plugins 安装所有插件,exclude_keywords=test,deprecated"
|
||||||
|
|
||||||
# 从你自己的公开仓库安装
|
# 从你自己的公开仓库安装
|
||||||
"从 your-username/my-plugin-collection 安装所有插件"
|
"从 your-username/my-plugin-collection 安装所有插件"
|
||||||
@@ -110,8 +111,8 @@ OpenRouter API pipe 集成,提供高级模型访问。
|
|||||||
|
|
||||||
- **异步架构**:非阻塞 I/O,性能更优
|
- **异步架构**:非阻塞 I/O,性能更优
|
||||||
- **httpx 集成**:现代化异步 HTTP 客户端,包含超时保护
|
- **httpx 集成**:现代化异步 HTTP 客户端,包含超时保护
|
||||||
- **完整测试**:8 个回归测试,100% 通过率
|
- **选择性安装流程**:安装循环只会处理用户最终勾选的插件子集
|
||||||
- **完整事件支持**:正确处理 OpenWebUI 事件注入,提供回退机制
|
- **完整事件支持**:正确处理 OpenWebUI `execute` 事件,并保留回退行为
|
||||||
|
|
||||||
## 安装方法
|
## 安装方法
|
||||||
|
|
||||||
@@ -123,7 +124,7 @@ OpenRouter API pipe 集成,提供高级模型访问。
|
|||||||
## 相关链接
|
## 相关链接
|
||||||
|
|
||||||
- **GitHub 仓库**:https://github.com/Fu-Jie/openwebui-extensions/tree/main/plugins/tools/batch-install-plugins
|
- **GitHub 仓库**:https://github.com/Fu-Jie/openwebui-extensions/tree/main/plugins/tools/batch-install-plugins
|
||||||
- **发布说明**:https://github.com/Fu-Jie/openwebui-extensions/blob/main/plugins/tools/batch-install-plugins/v1.0.0_CN.md
|
- **发布说明**:https://github.com/Fu-Jie/openwebui-extensions/blob/main/plugins/tools/batch-install-plugins/v1.1.0_CN.md
|
||||||
|
|
||||||
## 社区支持
|
## 社区支持
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Batch Install Plugins from GitHub
|
# Batch Install Plugins from GitHub
|
||||||
|
|
||||||
| By [Fu-Jie](https://github.com/Fu-Jie) · v1.0.0 | [⭐ Star this repo](https://github.com/Fu-Jie/openwebui-extensions) |
|
| By [Fu-Jie](https://github.com/Fu-Jie) · v1.1.0 | [⭐ Star this repo](https://github.com/Fu-Jie/openwebui-extensions) |
|
||||||
| :--- | ---: |
|
| :--- | ---: |
|
||||||
|
|
||||||
|  |  |  |  |  |  |  |
|
|  |  |  |  |  |  |  |
|
||||||
@@ -12,9 +12,10 @@ One-click batch install plugins from GitHub repositories to your OpenWebUI insta
|
|||||||
|
|
||||||
- **One-Click Install**: Install all plugins with a single command
|
- **One-Click Install**: Install all plugins with a single command
|
||||||
- **Auto-Update**: Automatically updates previously installed plugins
|
- **Auto-Update**: Automatically updates previously installed plugins
|
||||||
- **Public GitHub Support**: Install plugins from any public GitHub repository
|
- **Public GitHub Support**: Install plugins from one or many public GitHub repositories
|
||||||
- **Multi-Type Support**: Supports Pipe, Action, Filter, and Tool plugins
|
- **Multi-Type Support**: Supports Pipe, Action, Filter, and Tool plugins
|
||||||
- **Confirmation**: Shows plugin list before installing, allows selective installation
|
- **Multi-Repository Picker**: Combine multiple repositories in one request and review them in a single grouped dialog
|
||||||
|
- **Interactive Selection Dialog**: Filter by repository and type, search by keyword, review plugin descriptions, then install only the checked subset
|
||||||
- **i18n**: Supports 11 languages
|
- **i18n**: Supports 11 languages
|
||||||
|
|
||||||
## Flow
|
## Flow
|
||||||
@@ -24,7 +25,7 @@ User Input
|
|||||||
│
|
│
|
||||||
▼
|
▼
|
||||||
┌─────────────────────────────────────┐
|
┌─────────────────────────────────────┐
|
||||||
│ Discover Plugins from GitHub │
|
│ Discover Plugins from GitHub Repos │
|
||||||
│ (fetch file tree + parse .py) │
|
│ (fetch file tree + parse .py) │
|
||||||
└─────────────────────────────────────┘
|
└─────────────────────────────────────┘
|
||||||
│
|
│
|
||||||
@@ -36,8 +37,8 @@ User Input
|
|||||||
│
|
│
|
||||||
▼
|
▼
|
||||||
┌─────────────────────────────────────┐
|
┌─────────────────────────────────────┐
|
||||||
│ Show Confirmation Dialog │
|
│ Show Selection Dialog │
|
||||||
│ (list plugins + exclude hint) │
|
│ (repo groups + filters + search) │
|
||||||
└─────────────────────────────────────┘
|
└─────────────────────────────────────┘
|
||||||
│
|
│
|
||||||
├── [Cancel] → End
|
├── [Cancel] → End
|
||||||
@@ -61,49 +62,23 @@ User Input
|
|||||||
|
|
||||||
## Interactive Installation Workflow
|
## Interactive Installation Workflow
|
||||||
|
|
||||||
Each request handles one repository. To mix repositories, send another request after the previous installation completes.
|
The `repo` parameter accepts one or more `owner/repo` values separated by commas, semicolons, or new lines.
|
||||||
|
|
||||||
|
After plugin discovery and filtering, OpenWebUI opens a browser dialog built with the `execute` event. The dialog merges results from every requested repository, groups them by repository, supports repository tags, type filters, and keyword search, and lets you check exactly which plugins to install before the API calls start.
|
||||||
|
|
||||||
|
If one user request mentions multiple repositories, keep them in the same request so the model can pass them into a single tool call.
|
||||||
|
|
||||||
## Quick Start: Install Popular Collections
|
## Quick Start: Install Popular Collections
|
||||||
|
|
||||||
Copy any of these prompts and paste them into your chat:
|
Paste this prompt into your chat:
|
||||||
|
|
||||||
```
|
```
|
||||||
# Install all from my collection (default)
|
Install all plugins from Fu-Jie/openwebui-extensions, iChristGit/OpenWebui-Tools, Haervwe/open-webui-tools, Classic298/open-webui-plugins, suurt8ll/open_webui_functions, rbb-dev/Open-WebUI-OpenRouter-pipe
|
||||||
Install all plugins
|
|
||||||
|
|
||||||
# Add popular community tools
|
|
||||||
Install all plugins from iChristGit/OpenWebui-Tools
|
|
||||||
|
|
||||||
# Add utility-focused extensions
|
|
||||||
Install all plugins from Haervwe/open-webui-tools
|
|
||||||
|
|
||||||
# Add mixed community implementations
|
|
||||||
Install all plugins from Classic298/open-webui-plugins
|
|
||||||
|
|
||||||
# Add function-based plugins
|
|
||||||
Install all plugins from suurt8ll/open_webui_functions
|
|
||||||
|
|
||||||
# Add OpenRouter pipe integration
|
|
||||||
Install all plugins from rbb-dev/Open-WebUI-OpenRouter-pipe
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Each line is a separate request. Already installed plugins are automatically updated.
|
Once the dialog opens, use the repository tags, type filters, and keyword search to narrow the list before installing. Already installed plugins are automatically updated.
|
||||||
|
|
||||||
## Usage Examples
|
You can replace that repository list with your own collections whenever needed.
|
||||||
|
|
||||||
For more advanced usage patterns:
|
|
||||||
|
|
||||||
```
|
|
||||||
# Filter by plugin type
|
|
||||||
"Install only tool plugins from iChristGit/OpenWebui-Tools"
|
|
||||||
"Install only action plugins from Classic298/open-webui-plugins"
|
|
||||||
|
|
||||||
# Exclude specific plugins
|
|
||||||
"Install all plugins from Haervwe/open-webui-tools, exclude_keywords=test,deprecated"
|
|
||||||
|
|
||||||
# Install from your own repository
|
|
||||||
"Install all plugins from your-username/my-plugin-collection"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Default Repository
|
## Default Repository
|
||||||
|
|
||||||
@@ -131,11 +106,11 @@ For other repositories:
|
|||||||
| `SKIP_KEYWORDS` | `test,verify,example,template,mock` | Comma-separated keywords to skip |
|
| `SKIP_KEYWORDS` | `test,verify,example,template,mock` | Comma-separated keywords to skip |
|
||||||
| `TIMEOUT` | `20` | Request timeout in seconds |
|
| `TIMEOUT` | `20` | Request timeout in seconds |
|
||||||
|
|
||||||
## Confirmation Timeout
|
## Selection Dialog Timeout
|
||||||
|
|
||||||
User confirmation dialogs have a default timeout of **2 minutes (120 seconds)**, allowing sufficient time for users to:
|
The plugin selection dialog has a default timeout of **2 minutes (120 seconds)**, allowing sufficient time for users to:
|
||||||
- Read and review the plugin list
|
- Read and review the plugin list
|
||||||
- Make installation decisions
|
- Check or uncheck the plugins they want
|
||||||
- Handle network delays
|
- Handle network delays
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Batch Install Plugins from GitHub
|
# Batch Install Plugins from GitHub
|
||||||
|
|
||||||
| 作者:[Fu-Jie](https://github.com/Fu-Jie) · v1.0.0 | [⭐ 点个 Star 支持项目](https://github.com/Fu-Jie/openwebui-extensions) |
|
| 作者:[Fu-Jie](https://github.com/Fu-Jie) · v1.1.0 | [⭐ 点个 Star 支持项目](https://github.com/Fu-Jie/openwebui-extensions) |
|
||||||
| :--- | ---: |
|
| :--- | ---: |
|
||||||
|
|
||||||
|  |  |  |  |  |  |  |
|
|  |  |  |  |  |  |  |
|
||||||
@@ -12,9 +12,10 @@
|
|||||||
|
|
||||||
- 一键安装:单个命令安装所有插件
|
- 一键安装:单个命令安装所有插件
|
||||||
- 自动更新:自动更新之前安装过的插件
|
- 自动更新:自动更新之前安装过的插件
|
||||||
- 公开 GitHub 支持:支持从任何公开 GitHub 仓库安装插件
|
- 公开 GitHub 支持:支持从一个或多个公开 GitHub 仓库安装插件
|
||||||
- 多类型支持:支持 Pipe、Action、Filter 和 Tool 插件
|
- 多类型支持:支持 Pipe、Action、Filter 和 Tool 插件
|
||||||
- 安装确认:安装前显示插件列表,支持选择性安装
|
- 多仓库选择器:一次请求可合并多个仓库,并在同一个分组对话框中查看
|
||||||
|
- 交互式选择对话框:先按仓库和类型筛选、按关键词搜索并查看描述信息,再勾选要安装的插件,只安装所选子集
|
||||||
- 国际化:支持 11 种语言
|
- 国际化:支持 11 种语言
|
||||||
|
|
||||||
## 流程
|
## 流程
|
||||||
@@ -24,7 +25,7 @@
|
|||||||
│
|
│
|
||||||
▼
|
▼
|
||||||
┌─────────────────────────────────────┐
|
┌─────────────────────────────────────┐
|
||||||
│ 从 GitHub 发现插件 │
|
│ 从 GitHub 多仓库发现插件 │
|
||||||
│ (获取文件树 + 解析 .py 文件) │
|
│ (获取文件树 + 解析 .py 文件) │
|
||||||
└─────────────────────────────────────┘
|
└─────────────────────────────────────┘
|
||||||
│
|
│
|
||||||
@@ -36,8 +37,8 @@
|
|||||||
│
|
│
|
||||||
▼
|
▼
|
||||||
┌─────────────────────────────────────┐
|
┌─────────────────────────────────────┐
|
||||||
│ 显示确认对话框 │
|
│ 显示选择对话框 │
|
||||||
│ (插件列表 + 排除提示) │
|
│ (仓库分组 + 筛选 + 搜索) │
|
||||||
└─────────────────────────────────────┘
|
└─────────────────────────────────────┘
|
||||||
│
|
│
|
||||||
├── [取消] → 结束
|
├── [取消] → 结束
|
||||||
@@ -61,49 +62,23 @@
|
|||||||
|
|
||||||
## 交互式安装工作流
|
## 交互式安装工作流
|
||||||
|
|
||||||
每次请求处理一个仓库。如需混合多个来源,请在上一次安装完成后再发起下一次请求。
|
`repo` 参数现在支持多个 `owner/repo`,可用逗号、分号或换行分隔。
|
||||||
|
|
||||||
|
在插件发现和过滤完成后,OpenWebUI 会通过 `execute` 事件打开浏览器选择对话框。对话框会合并所有目标仓库的结果,按仓库分组展示,并支持仓库标签、类型筛选、关键词搜索和描述查看,再开始调用安装 API。
|
||||||
|
|
||||||
|
如果一次用户请求里提到了多个仓库,尽量保持在同一次请求里,让模型把它们合并到一次工具调用中。
|
||||||
|
|
||||||
## 快速开始:安装热门插件集
|
## 快速开始:安装热门插件集
|
||||||
|
|
||||||
复制以下任一提示词,粘贴到你的对话框中:
|
复制下面这条提示词,粘贴到你的对话框中:
|
||||||
|
|
||||||
```
|
```
|
||||||
# 安装我的默认集合
|
从 Fu-Jie/openwebui-extensions、iChristGit/OpenWebui-Tools、Haervwe/open-webui-tools、Classic298/open-webui-plugins、suurt8ll/open_webui_functions、rbb-dev/Open-WebUI-OpenRouter-pipe 安装所有插件
|
||||||
安装所有插件
|
|
||||||
|
|
||||||
# 添加热门社区工具
|
|
||||||
从 iChristGit/OpenWebui-Tools 安装所有插件
|
|
||||||
|
|
||||||
# 添加实用工具扩展
|
|
||||||
从 Haervwe/open-webui-tools 安装所有插件
|
|
||||||
|
|
||||||
# 添加混合社区实现
|
|
||||||
从 Classic298/open-webui-plugins 安装所有插件
|
|
||||||
|
|
||||||
# 添加基于函数的插件
|
|
||||||
从 suurt8ll/open_webui_functions 安装所有插件
|
|
||||||
|
|
||||||
# 添加 OpenRouter 管道集成
|
|
||||||
从 rbb-dev/Open-WebUI-OpenRouter-pipe 安装所有插件
|
|
||||||
```
|
```
|
||||||
|
|
||||||
每一行是一个独立的请求。已安装的插件会自动更新。
|
弹窗出现后,直接用里面的仓库标签、类型筛选和关键词搜索来缩小范围再安装。已安装的插件会自动更新。
|
||||||
|
|
||||||
## 使用示例
|
需要时,你也可以把这串仓库替换成你自己的插件仓库组合。
|
||||||
|
|
||||||
更多高级用法:
|
|
||||||
|
|
||||||
```
|
|
||||||
# 按插件类型过滤
|
|
||||||
"从 iChristGit/OpenWebui-Tools 仅安装 tool 插件"
|
|
||||||
"从 Classic298/open-webui-plugins 仅安装 action 插件"
|
|
||||||
|
|
||||||
# 排除特定插件
|
|
||||||
"从 Haervwe/open-webui-tools 安装所有插件, exclude_keywords=test,deprecated"
|
|
||||||
|
|
||||||
# 从你自己的仓库安装
|
|
||||||
"从 your-username/my-plugin-collection 安装所有插件"
|
|
||||||
```
|
|
||||||
|
|
||||||
## 默认仓库
|
## 默认仓库
|
||||||
|
|
||||||
@@ -131,11 +106,11 @@
|
|||||||
| `SKIP_KEYWORDS` | `test,verify,example,template,mock` | 逗号分隔的跳过关键词 |
|
| `SKIP_KEYWORDS` | `test,verify,example,template,mock` | 逗号分隔的跳过关键词 |
|
||||||
| `TIMEOUT` | `20` | 请求超时时间(秒)|
|
| `TIMEOUT` | `20` | 请求超时时间(秒)|
|
||||||
|
|
||||||
## 确认超时时间
|
## 选择对话框超时时间
|
||||||
|
|
||||||
用户确认对话框的默认超时时间为 **2 分钟(120 秒)**,为用户提供充足的时间来:
|
插件选择对话框的默认超时时间为 **2 分钟(120 秒)**,为用户提供充足的时间来:
|
||||||
- 阅读和查看插件列表
|
- 阅读和查看插件列表
|
||||||
- 做出安装决定
|
- 勾选或取消勾选想安装的插件
|
||||||
- 处理网络延迟
|
- 处理网络延迟
|
||||||
|
|
||||||
## 支持
|
## 支持
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ title: Batch Install Plugins from GitHub
|
|||||||
author: Fu-Jie
|
author: Fu-Jie
|
||||||
author_url: https://github.com/Fu-Jie/openwebui-extensions
|
author_url: https://github.com/Fu-Jie/openwebui-extensions
|
||||||
funding_url: https://github.com/open-webui
|
funding_url: https://github.com/open-webui
|
||||||
version: 1.0.0
|
version: 1.1.0
|
||||||
description: One-click batch install plugins from GitHub repositories to your OpenWebUI instance.
|
openwebui_id: c9fd6e80-d58f-4312-8fbb-214d86bbe599
|
||||||
|
description: One-click batch install plugins from one or more GitHub repositories to your OpenWebUI instance. If a user mentions multiple repositories in one request, combine them into a single tool call.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import ast
|
import ast
|
||||||
@@ -15,7 +16,7 @@ import os
|
|||||||
import re
|
import re
|
||||||
import textwrap
|
import textwrap
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Dict, List, Optional, Tuple
|
from typing import Any, Dict, List, Optional, Set, Tuple
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
@@ -298,6 +299,207 @@ TRANSLATIONS = {
|
|||||||
|
|
||||||
FALLBACK_MAP = {"zh": "zh-CN", "zh-TW": "zh-TW", "zh-HK": "zh-HK", "en": "en-US", "ko": "ko-KR", "ja": "ja-JP", "fr": "fr-FR", "de": "de-DE", "es": "es-ES", "it": "it-IT", "vi": "vi-VN"}
|
FALLBACK_MAP = {"zh": "zh-CN", "zh-TW": "zh-TW", "zh-HK": "zh-HK", "en": "en-US", "ko": "ko-KR", "ja": "ja-JP", "fr": "fr-FR", "de": "de-DE", "es": "es-ES", "it": "it-IT", "vi": "vi-VN"}
|
||||||
|
|
||||||
|
SELECTION_DIALOG_TEXTS = {
|
||||||
|
"en-US": {
|
||||||
|
"select_all": "Select all",
|
||||||
|
"clear_all": "Clear all",
|
||||||
|
"quick_select": "Filter by type",
|
||||||
|
"all_types": "All",
|
||||||
|
"repo_filter": "Filter by repository",
|
||||||
|
"all_repos": "All repositories",
|
||||||
|
"search_label": "Search",
|
||||||
|
"search_placeholder": "Search title, description, file path...",
|
||||||
|
"no_results": "No plugins match the current filter.",
|
||||||
|
"selected_count": "{count} selected",
|
||||||
|
"install_selected": "Install Selected",
|
||||||
|
"cancel": "Cancel",
|
||||||
|
"version_label": "Version",
|
||||||
|
"file_label": "File",
|
||||||
|
"description_label": "Description",
|
||||||
|
"repo_label": "Repository",
|
||||||
|
},
|
||||||
|
"zh-CN": {
|
||||||
|
"select_all": "全选",
|
||||||
|
"clear_all": "清空",
|
||||||
|
"quick_select": "按类型筛选",
|
||||||
|
"all_types": "全部",
|
||||||
|
"repo_filter": "按仓库筛选",
|
||||||
|
"all_repos": "全部仓库",
|
||||||
|
"search_label": "搜索",
|
||||||
|
"search_placeholder": "搜索标题、描述、文件路径...",
|
||||||
|
"no_results": "当前筛选条件下没有匹配的插件。",
|
||||||
|
"selected_count": "已选 {count} 项",
|
||||||
|
"install_selected": "安装所选插件",
|
||||||
|
"cancel": "取消",
|
||||||
|
"version_label": "版本",
|
||||||
|
"file_label": "文件",
|
||||||
|
"description_label": "描述",
|
||||||
|
"repo_label": "仓库",
|
||||||
|
},
|
||||||
|
"zh-HK": {
|
||||||
|
"select_all": "全選",
|
||||||
|
"clear_all": "清空",
|
||||||
|
"quick_select": "按類型篩選",
|
||||||
|
"all_types": "全部",
|
||||||
|
"repo_filter": "按倉庫篩選",
|
||||||
|
"all_repos": "全部倉庫",
|
||||||
|
"search_label": "搜尋",
|
||||||
|
"search_placeholder": "搜尋標題、描述、檔案路徑...",
|
||||||
|
"no_results": "目前篩選條件下沒有相符的外掛。",
|
||||||
|
"selected_count": "已選 {count} 項",
|
||||||
|
"install_selected": "安裝所選外掛",
|
||||||
|
"cancel": "取消",
|
||||||
|
"version_label": "版本",
|
||||||
|
"file_label": "檔案",
|
||||||
|
"description_label": "描述",
|
||||||
|
"repo_label": "倉庫",
|
||||||
|
},
|
||||||
|
"zh-TW": {
|
||||||
|
"select_all": "全選",
|
||||||
|
"clear_all": "清空",
|
||||||
|
"quick_select": "按類型篩選",
|
||||||
|
"all_types": "全部",
|
||||||
|
"repo_filter": "按倉庫篩選",
|
||||||
|
"all_repos": "全部倉庫",
|
||||||
|
"search_label": "搜尋",
|
||||||
|
"search_placeholder": "搜尋標題、描述、檔案路徑...",
|
||||||
|
"no_results": "目前篩選條件下沒有符合的外掛。",
|
||||||
|
"selected_count": "已選 {count} 項",
|
||||||
|
"install_selected": "安裝所選外掛",
|
||||||
|
"cancel": "取消",
|
||||||
|
"version_label": "版本",
|
||||||
|
"file_label": "檔案",
|
||||||
|
"description_label": "描述",
|
||||||
|
"repo_label": "倉庫",
|
||||||
|
},
|
||||||
|
"ko-KR": {
|
||||||
|
"select_all": "전체 선택",
|
||||||
|
"clear_all": "선택 해제",
|
||||||
|
"quick_select": "유형별 필터",
|
||||||
|
"all_types": "전체",
|
||||||
|
"repo_filter": "저장소별 필터",
|
||||||
|
"all_repos": "전체 저장소",
|
||||||
|
"search_label": "검색",
|
||||||
|
"search_placeholder": "제목, 설명, 파일 경로 검색...",
|
||||||
|
"no_results": "현재 필터와 일치하는 플러그인이 없습니다.",
|
||||||
|
"selected_count": "{count}개 선택됨",
|
||||||
|
"install_selected": "선택한 플러그인 설치",
|
||||||
|
"cancel": "취소",
|
||||||
|
"version_label": "버전",
|
||||||
|
"file_label": "파일",
|
||||||
|
"description_label": "설명",
|
||||||
|
"repo_label": "저장소",
|
||||||
|
},
|
||||||
|
"ja-JP": {
|
||||||
|
"select_all": "すべて選択",
|
||||||
|
"clear_all": "クリア",
|
||||||
|
"quick_select": "タイプで絞り込み",
|
||||||
|
"all_types": "すべて",
|
||||||
|
"repo_filter": "リポジトリで絞り込み",
|
||||||
|
"all_repos": "すべてのリポジトリ",
|
||||||
|
"search_label": "検索",
|
||||||
|
"search_placeholder": "タイトル、説明、ファイルパスを検索...",
|
||||||
|
"no_results": "現在の条件に一致するプラグインはありません。",
|
||||||
|
"selected_count": "{count}件を選択",
|
||||||
|
"install_selected": "選択したプラグインをインストール",
|
||||||
|
"cancel": "キャンセル",
|
||||||
|
"version_label": "バージョン",
|
||||||
|
"file_label": "ファイル",
|
||||||
|
"description_label": "説明",
|
||||||
|
"repo_label": "リポジトリ",
|
||||||
|
},
|
||||||
|
"fr-FR": {
|
||||||
|
"select_all": "Tout sélectionner",
|
||||||
|
"clear_all": "Tout effacer",
|
||||||
|
"quick_select": "Filtrer par type",
|
||||||
|
"all_types": "Tous",
|
||||||
|
"repo_filter": "Filtrer par dépôt",
|
||||||
|
"all_repos": "Tous les dépôts",
|
||||||
|
"search_label": "Rechercher",
|
||||||
|
"search_placeholder": "Rechercher par titre, description, fichier...",
|
||||||
|
"no_results": "Aucun plugin ne correspond au filtre actuel.",
|
||||||
|
"selected_count": "{count} sélectionnés",
|
||||||
|
"install_selected": "Installer la sélection",
|
||||||
|
"cancel": "Annuler",
|
||||||
|
"version_label": "Version",
|
||||||
|
"file_label": "Fichier",
|
||||||
|
"description_label": "Description",
|
||||||
|
"repo_label": "Dépôt",
|
||||||
|
},
|
||||||
|
"de-DE": {
|
||||||
|
"select_all": "Alle auswählen",
|
||||||
|
"clear_all": "Auswahl löschen",
|
||||||
|
"quick_select": "Nach Typ filtern",
|
||||||
|
"all_types": "Alle",
|
||||||
|
"repo_filter": "Nach Repository filtern",
|
||||||
|
"all_repos": "Alle Repositories",
|
||||||
|
"search_label": "Suchen",
|
||||||
|
"search_placeholder": "Titel, Beschreibung, Dateipfad durchsuchen...",
|
||||||
|
"no_results": "Keine Plugins entsprechen dem aktuellen Filter.",
|
||||||
|
"selected_count": "{count} ausgewählt",
|
||||||
|
"install_selected": "Auswahl installieren",
|
||||||
|
"cancel": "Abbrechen",
|
||||||
|
"version_label": "Version",
|
||||||
|
"file_label": "Datei",
|
||||||
|
"description_label": "Beschreibung",
|
||||||
|
"repo_label": "Repository",
|
||||||
|
},
|
||||||
|
"es-ES": {
|
||||||
|
"select_all": "Seleccionar todo",
|
||||||
|
"clear_all": "Limpiar",
|
||||||
|
"quick_select": "Filtrar por tipo",
|
||||||
|
"all_types": "Todos",
|
||||||
|
"repo_filter": "Filtrar por repositorio",
|
||||||
|
"all_repos": "Todos los repositorios",
|
||||||
|
"search_label": "Buscar",
|
||||||
|
"search_placeholder": "Buscar por titulo, descripcion o archivo...",
|
||||||
|
"no_results": "Ningun plugin coincide con el filtro actual.",
|
||||||
|
"selected_count": "{count} seleccionados",
|
||||||
|
"install_selected": "Instalar seleccionados",
|
||||||
|
"cancel": "Cancelar",
|
||||||
|
"version_label": "Versión",
|
||||||
|
"file_label": "Archivo",
|
||||||
|
"description_label": "Descripción",
|
||||||
|
"repo_label": "Repositorio",
|
||||||
|
},
|
||||||
|
"it-IT": {
|
||||||
|
"select_all": "Seleziona tutto",
|
||||||
|
"clear_all": "Cancella",
|
||||||
|
"quick_select": "Filtra per tipo",
|
||||||
|
"all_types": "Tutti",
|
||||||
|
"repo_filter": "Filtra per repository",
|
||||||
|
"all_repos": "Tutti i repository",
|
||||||
|
"search_label": "Cerca",
|
||||||
|
"search_placeholder": "Cerca per titolo, descrizione o file...",
|
||||||
|
"no_results": "Nessun plugin corrisponde al filtro attuale.",
|
||||||
|
"selected_count": "{count} selezionati",
|
||||||
|
"install_selected": "Installa selezionati",
|
||||||
|
"cancel": "Annulla",
|
||||||
|
"version_label": "Versione",
|
||||||
|
"file_label": "File",
|
||||||
|
"description_label": "Descrizione",
|
||||||
|
"repo_label": "Repository",
|
||||||
|
},
|
||||||
|
"vi-VN": {
|
||||||
|
"select_all": "Chọn tất cả",
|
||||||
|
"clear_all": "Bỏ chọn",
|
||||||
|
"quick_select": "Lọc theo loại",
|
||||||
|
"all_types": "Tất cả",
|
||||||
|
"repo_filter": "Lọc theo kho",
|
||||||
|
"all_repos": "Tất cả kho",
|
||||||
|
"search_label": "Tìm kiếm",
|
||||||
|
"search_placeholder": "Tìm theo tiêu đề, mô tả, đường dẫn tệp...",
|
||||||
|
"no_results": "Không có plugin nào khớp với bộ lọc hiện tại.",
|
||||||
|
"selected_count": "Đã chọn {count}",
|
||||||
|
"install_selected": "Cài đặt mục đã chọn",
|
||||||
|
"cancel": "Hủy",
|
||||||
|
"version_label": "Phiên bản",
|
||||||
|
"file_label": "Tệp",
|
||||||
|
"description_label": "Mô tả",
|
||||||
|
"repo_label": "Kho",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def _resolve_language(user_language: str) -> str:
|
def _resolve_language(user_language: str) -> str:
|
||||||
value = str(user_language or "").strip()
|
value = str(user_language or "").strip()
|
||||||
@@ -322,6 +524,19 @@ def _t(lang: str, key: str, **kwargs) -> str:
|
|||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
||||||
|
def _selection_t(lang: str, key: str, **kwargs) -> str:
|
||||||
|
lang_key = _resolve_language(lang)
|
||||||
|
text = SELECTION_DIALOG_TEXTS.get(
|
||||||
|
lang_key, SELECTION_DIALOG_TEXTS["en-US"]
|
||||||
|
).get(key, SELECTION_DIALOG_TEXTS["en-US"][key])
|
||||||
|
if kwargs:
|
||||||
|
try:
|
||||||
|
text = text.format(**kwargs)
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
async def _emit_status(emitter: Optional[Any], description: str, done: bool = False) -> None:
|
async def _emit_status(emitter: Optional[Any], description: str, done: bool = False) -> None:
|
||||||
if emitter:
|
if emitter:
|
||||||
await emitter(
|
await emitter(
|
||||||
@@ -462,12 +677,14 @@ class PluginCandidate:
|
|||||||
metadata: Dict[str, str],
|
metadata: Dict[str, str],
|
||||||
content: str,
|
content: str,
|
||||||
function_id: str,
|
function_id: str,
|
||||||
|
source_repo: str,
|
||||||
):
|
):
|
||||||
self.plugin_type = plugin_type
|
self.plugin_type = plugin_type
|
||||||
self.file_path = file_path
|
self.file_path = file_path
|
||||||
self.metadata = metadata
|
self.metadata = metadata
|
||||||
self.content = content
|
self.content = content
|
||||||
self.function_id = function_id
|
self.function_id = function_id
|
||||||
|
self.source_repo = source_repo
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def title(self) -> str:
|
def title(self) -> str:
|
||||||
@@ -477,6 +694,10 @@ class PluginCandidate:
|
|||||||
def version(self) -> str:
|
def version(self) -> str:
|
||||||
return self.metadata.get("version", "unknown")
|
return self.metadata.get("version", "unknown")
|
||||||
|
|
||||||
|
@property
|
||||||
|
def selection_id(self) -> str:
|
||||||
|
return f"{self.source_repo}::{self.file_path}::{self.function_id}"
|
||||||
|
|
||||||
|
|
||||||
def extract_metadata(content: str) -> Dict[str, str]:
|
def extract_metadata(content: str) -> Dict[str, str]:
|
||||||
docstring = _extract_module_docstring(content)
|
docstring = _extract_module_docstring(content)
|
||||||
@@ -691,23 +912,64 @@ def _candidate_debug_data(candidate: PluginCandidate) -> Dict[str, str]:
|
|||||||
return {
|
return {
|
||||||
"title": candidate.title,
|
"title": candidate.title,
|
||||||
"type": candidate.plugin_type,
|
"type": candidate.plugin_type,
|
||||||
|
"source_repo": candidate.source_repo,
|
||||||
"file_path": candidate.file_path,
|
"file_path": candidate.file_path,
|
||||||
"function_id": candidate.function_id,
|
"function_id": candidate.function_id,
|
||||||
"version": candidate.version,
|
"version": candidate.version,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_repo_inputs(repo_value: str) -> List[str]:
|
||||||
|
parts = re.split(r"[\n,;,;、]+", str(repo_value or DEFAULT_REPO))
|
||||||
|
repos: List[str] = []
|
||||||
|
seen: Set[str] = set()
|
||||||
|
|
||||||
|
for part in parts:
|
||||||
|
candidate = part.strip().strip("/")
|
||||||
|
if not candidate:
|
||||||
|
continue
|
||||||
|
normalized = candidate.lower()
|
||||||
|
if normalized in seen:
|
||||||
|
continue
|
||||||
|
seen.add(normalized)
|
||||||
|
repos.append(candidate)
|
||||||
|
|
||||||
|
return repos or [DEFAULT_REPO]
|
||||||
|
|
||||||
|
|
||||||
|
def _sort_candidates_by_repo_order(
|
||||||
|
candidates: List[PluginCandidate],
|
||||||
|
repos: List[str],
|
||||||
|
) -> List[PluginCandidate]:
|
||||||
|
repo_order = {repo.lower(): index for index, repo in enumerate(repos)}
|
||||||
|
fallback_index = len(repo_order)
|
||||||
|
return sorted(
|
||||||
|
candidates,
|
||||||
|
key=lambda item: (
|
||||||
|
repo_order.get(item.source_repo.lower(), fallback_index),
|
||||||
|
item.source_repo.lower(),
|
||||||
|
item.plugin_type,
|
||||||
|
item.file_path,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def _filter_candidates(
|
def _filter_candidates(
|
||||||
candidates: List[PluginCandidate],
|
candidates: List[PluginCandidate],
|
||||||
plugin_types: List[str],
|
plugin_types: List[str],
|
||||||
repo: str,
|
repos: List[str],
|
||||||
exclude_keywords: str = "",
|
exclude_keywords: str = "",
|
||||||
) -> List[PluginCandidate]:
|
) -> List[PluginCandidate]:
|
||||||
allowed_types = {item.strip().lower() for item in plugin_types if item.strip()}
|
allowed_types = {item.strip().lower() for item in plugin_types if item.strip()}
|
||||||
filtered = [c for c in candidates if c.plugin_type.lower() in allowed_types]
|
filtered = [c for c in candidates if c.plugin_type.lower() in allowed_types]
|
||||||
|
|
||||||
if repo.lower() == DEFAULT_REPO.lower():
|
includes_default_repo = any(item.lower() == DEFAULT_REPO.lower() for item in repos)
|
||||||
filtered = [c for c in filtered if not _matches_self_plugin(c)]
|
if includes_default_repo:
|
||||||
|
filtered = [
|
||||||
|
c
|
||||||
|
for c in filtered
|
||||||
|
if not (c.source_repo.lower() == DEFAULT_REPO.lower() and _matches_self_plugin(c))
|
||||||
|
]
|
||||||
|
|
||||||
exclude_list = [item.strip().lower() for item in exclude_keywords.split(",") if item.strip()]
|
exclude_list = [item.strip().lower() for item in exclude_keywords.split(",") if item.strip()]
|
||||||
if exclude_list:
|
if exclude_list:
|
||||||
@@ -724,7 +986,8 @@ def _filter_candidates(
|
|||||||
|
|
||||||
|
|
||||||
def _build_confirmation_hint(lang: str, repo: str, exclude_keywords: str) -> str:
|
def _build_confirmation_hint(lang: str, repo: str, exclude_keywords: str) -> str:
|
||||||
is_default_repo = repo.lower() == DEFAULT_REPO.lower()
|
repo_list = _parse_repo_inputs(repo)
|
||||||
|
is_default_repo = any(item.lower() == DEFAULT_REPO.lower() for item in repo_list)
|
||||||
excluded_parts: List[str] = []
|
excluded_parts: List[str] = []
|
||||||
|
|
||||||
if exclude_keywords:
|
if exclude_keywords:
|
||||||
@@ -735,38 +998,400 @@ def _build_confirmation_hint(lang: str, repo: str, exclude_keywords: str) -> str
|
|||||||
if excluded_parts:
|
if excluded_parts:
|
||||||
return _t(lang, "confirm_excluded_hint", excluded=", ".join(excluded_parts))
|
return _t(lang, "confirm_excluded_hint", excluded=", ".join(excluded_parts))
|
||||||
|
|
||||||
return _t(lang, "confirm_copy_exclude_hint", keywords=SELF_EXCLUDE_HINT)
|
return ""
|
||||||
|
|
||||||
|
|
||||||
async def _request_confirmation(
|
def _build_selection_dialog_js(
|
||||||
|
options: List[Dict[str, str]],
|
||||||
|
ui_text: Dict[str, str],
|
||||||
|
) -> str:
|
||||||
|
lines = [
|
||||||
|
"return new Promise((resolve) => {",
|
||||||
|
" try {",
|
||||||
|
f" const options = {json.dumps(options, ensure_ascii=False)};",
|
||||||
|
f" const ui = {json.dumps(ui_text, ensure_ascii=False)};",
|
||||||
|
" const dialogId = 'batch-install-plugin-selector';",
|
||||||
|
" const body = typeof document !== 'undefined' ? document.body : null;",
|
||||||
|
" const existing = body ? document.getElementById(dialogId) : null;",
|
||||||
|
" if (existing) { existing.remove(); }",
|
||||||
|
" if (!body) {",
|
||||||
|
" resolve({ confirmed: false, error: 'document.body unavailable', selected_ids: [] });",
|
||||||
|
" return;",
|
||||||
|
" }",
|
||||||
|
" const selected = new Set(options.map((item) => item.id));",
|
||||||
|
" let activeFilter = '';",
|
||||||
|
" let activeRepoFilter = '';",
|
||||||
|
" let searchTerm = '';",
|
||||||
|
" const escapeHtml = (value) => String(value ?? '').replace(/[&<>\"']/g, (char) => ({",
|
||||||
|
" '&': '&',",
|
||||||
|
" '<': '<',",
|
||||||
|
" '>': '>',",
|
||||||
|
" '\"': '"',",
|
||||||
|
" \"'\": ''',",
|
||||||
|
" }[char]));",
|
||||||
|
" const overlay = document.createElement('div');",
|
||||||
|
" overlay.id = dialogId;",
|
||||||
|
" overlay.style.cssText = [",
|
||||||
|
" 'position:fixed',",
|
||||||
|
" 'inset:0',",
|
||||||
|
" 'padding:24px',",
|
||||||
|
" 'background:rgba(15,23,42,0.52)',",
|
||||||
|
" 'backdrop-filter:blur(3px)',",
|
||||||
|
" 'display:flex',",
|
||||||
|
" 'align-items:center',",
|
||||||
|
" 'justify-content:center',",
|
||||||
|
" 'z-index:9999',",
|
||||||
|
" 'box-sizing:border-box',",
|
||||||
|
" ].join(';');",
|
||||||
|
" overlay.innerHTML = `",
|
||||||
|
" <div style=\"width:min(920px,100%);max-height:min(88vh,900px);overflow:hidden;border-radius:18px;background:#ffffff;box-shadow:0 30px 80px rgba(15,23,42,0.28);display:flex;flex-direction:column;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif\">",
|
||||||
|
" <div style=\"padding:22px 24px 16px;border-bottom:1px solid #e5e7eb\">",
|
||||||
|
" <div>",
|
||||||
|
" <div style=\"font-size:22px;font-weight:700;color:#0f172a\">${escapeHtml(ui.title)}</div>",
|
||||||
|
" <div style=\"margin-top:8px;font-size:14px;color:#475569\">${escapeHtml(ui.list_title)}</div>",
|
||||||
|
" </div>",
|
||||||
|
" <div id=\"batch-install-plugin-selector-hint\" style=\"margin-top:14px;padding:12px 14px;border-radius:12px;background:#f8fafc;color:#334155;font-size:13px;line-height:1.5;white-space:pre-wrap\"></div>",
|
||||||
|
" </div>",
|
||||||
|
" <div style=\"padding:16px 24px 0;display:grid;gap:12px\">",
|
||||||
|
" <div style=\"display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap\">",
|
||||||
|
" <div style=\"display:flex;gap:8px;flex-wrap:wrap\">",
|
||||||
|
" <button id=\"batch-install-plugin-selector-select-all\" style=\"padding:8px 12px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;color:#0f172a;font-size:13px;cursor:pointer\">${escapeHtml(ui.select_all)}</button>",
|
||||||
|
" <button id=\"batch-install-plugin-selector-clear-all\" style=\"padding:8px 12px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;color:#0f172a;font-size:13px;cursor:pointer\">${escapeHtml(ui.clear_all)}</button>",
|
||||||
|
" </div>",
|
||||||
|
" <div id=\"batch-install-plugin-selector-count\" style=\"font-size:13px;font-weight:600;color:#475569\"></div>",
|
||||||
|
" </div>",
|
||||||
|
" <div style=\"display:grid;gap:10px\">",
|
||||||
|
" <div style=\"display:flex;gap:10px;align-items:center;flex-wrap:wrap\">",
|
||||||
|
" <div style=\"font-size:12px;font-weight:700;color:#475569;text-transform:uppercase;letter-spacing:0.04em\">${escapeHtml(ui.quick_select)}</div>",
|
||||||
|
" <div id=\"batch-install-plugin-selector-types\" style=\"display:flex;gap:8px;flex-wrap:wrap\"></div>",
|
||||||
|
" </div>",
|
||||||
|
" <div id=\"batch-install-plugin-selector-repo-row\" style=\"display:flex;gap:10px;align-items:center;flex-wrap:wrap\">",
|
||||||
|
" <div style=\"font-size:12px;font-weight:700;color:#475569;text-transform:uppercase;letter-spacing:0.04em\">${escapeHtml(ui.repo_filter)}</div>",
|
||||||
|
" <div id=\"batch-install-plugin-selector-repos\" style=\"display:flex;gap:8px;flex-wrap:wrap\"></div>",
|
||||||
|
" </div>",
|
||||||
|
" <div style=\"display:grid;gap:6px\">",
|
||||||
|
" <div style=\"font-size:12px;font-weight:700;color:#475569;text-transform:uppercase;letter-spacing:0.04em\">${escapeHtml(ui.search_label)}</div>",
|
||||||
|
" <input id=\"batch-install-plugin-selector-search\" type=\"text\" placeholder=\"${escapeHtml(ui.search_placeholder)}\" style=\"width:100%;padding:10px 12px;border:1px solid #cbd5e1;border-radius:12px;background:#fff;color:#0f172a;font-size:14px;outline:none;box-sizing:border-box\" />",
|
||||||
|
" </div>",
|
||||||
|
" </div>",
|
||||||
|
" </div>",
|
||||||
|
" <div id=\"batch-install-plugin-selector-list\" style=\"padding:16px 24px 0;overflow:auto;display:grid;gap:12px;flex:1;min-height:0\"></div>",
|
||||||
|
" <div style=\"padding:18px 24px 24px;border-top:1px solid #e5e7eb;margin-top:18px;display:flex;justify-content:flex-end;gap:12px;flex-wrap:wrap\">",
|
||||||
|
" <button id=\"batch-install-plugin-selector-cancel\" style=\"padding:10px 16px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;color:#0f172a;font-weight:600;cursor:pointer\">${escapeHtml(ui.cancel)}</button>",
|
||||||
|
" <button id=\"batch-install-plugin-selector-submit\" style=\"padding:10px 16px;border:none;border-radius:10px;background:#0f172a;color:#fff;font-weight:600;cursor:pointer\">${escapeHtml(ui.install_selected)}</button>",
|
||||||
|
" </div>",
|
||||||
|
" </div>",
|
||||||
|
" `;",
|
||||||
|
" body.appendChild(overlay);",
|
||||||
|
" const previousOverflow = body.style.overflow;",
|
||||||
|
" body.style.overflow = 'hidden';",
|
||||||
|
" const listEl = overlay.querySelector('#batch-install-plugin-selector-list');",
|
||||||
|
" const countEl = overlay.querySelector('#batch-install-plugin-selector-count');",
|
||||||
|
" const hintEl = overlay.querySelector('#batch-install-plugin-selector-hint');",
|
||||||
|
" const typesEl = overlay.querySelector('#batch-install-plugin-selector-types');",
|
||||||
|
" const repoRowEl = overlay.querySelector('#batch-install-plugin-selector-repo-row');",
|
||||||
|
" const reposEl = overlay.querySelector('#batch-install-plugin-selector-repos');",
|
||||||
|
" const searchInput = overlay.querySelector('#batch-install-plugin-selector-search');",
|
||||||
|
" const submitBtn = overlay.querySelector('#batch-install-plugin-selector-submit');",
|
||||||
|
" const cancelBtn = overlay.querySelector('#batch-install-plugin-selector-cancel');",
|
||||||
|
" const selectAllBtn = overlay.querySelector('#batch-install-plugin-selector-select-all');",
|
||||||
|
" const clearAllBtn = overlay.querySelector('#batch-install-plugin-selector-clear-all');",
|
||||||
|
" const typeMap = options.reduce((groups, item) => {",
|
||||||
|
" if (!groups[item.type]) {",
|
||||||
|
" groups[item.type] = [];",
|
||||||
|
" }",
|
||||||
|
" groups[item.type].push(item);",
|
||||||
|
" return groups;",
|
||||||
|
" }, {});",
|
||||||
|
" const repoMap = options.reduce((groups, item) => {",
|
||||||
|
" if (!groups[item.repo]) {",
|
||||||
|
" groups[item.repo] = [];",
|
||||||
|
" }",
|
||||||
|
" groups[item.repo].push(item);",
|
||||||
|
" return groups;",
|
||||||
|
" }, {});",
|
||||||
|
" const typeEntries = Object.entries(typeMap);",
|
||||||
|
" const repoEntries = Object.entries(repoMap);",
|
||||||
|
" const matchesSearch = (item) => {",
|
||||||
|
" const haystack = [item.title, item.description, item.file_path, item.type, item.repo].join(' ').toLowerCase();",
|
||||||
|
" return !searchTerm || haystack.includes(searchTerm);",
|
||||||
|
" };",
|
||||||
|
" const getVisibleOptions = () => options.filter((item) => {",
|
||||||
|
" const matchesType = !activeFilter || item.type === activeFilter;",
|
||||||
|
" const matchesRepo = !activeRepoFilter || item.repo === activeRepoFilter;",
|
||||||
|
" return matchesType && matchesRepo && matchesSearch(item);",
|
||||||
|
" });",
|
||||||
|
" const syncSelectionToVisible = () => {",
|
||||||
|
" selected.clear();",
|
||||||
|
" getVisibleOptions().forEach((item) => selected.add(item.id));",
|
||||||
|
" };",
|
||||||
|
" const formatMultilineText = (value) => escapeHtml(value).replace(/\\n+/g, '<br />');",
|
||||||
|
" hintEl.textContent = ui.hint || '';",
|
||||||
|
" hintEl.style.display = ui.hint ? 'block' : 'none';",
|
||||||
|
" const renderTypeButtons = () => {",
|
||||||
|
" const scopedOptions = options.filter((item) => {",
|
||||||
|
" const matchesRepo = !activeRepoFilter || item.repo === activeRepoFilter;",
|
||||||
|
" return matchesRepo && matchesSearch(item);",
|
||||||
|
" });",
|
||||||
|
" const filterEntries = [['', scopedOptions], ...typeEntries.map(([type]) => [type, scopedOptions.filter((item) => item.type === type)])];",
|
||||||
|
" typesEl.innerHTML = filterEntries.map(([type, items]) => {",
|
||||||
|
" const isActive = activeFilter === type;",
|
||||||
|
" const background = isActive ? '#0f172a' : '#ffffff';",
|
||||||
|
" const color = isActive ? '#ffffff' : '#0f172a';",
|
||||||
|
" const border = isActive ? '#0f172a' : '#cbd5e1';",
|
||||||
|
" const label = type || ui.all_types;",
|
||||||
|
" return `",
|
||||||
|
" <button type=\"button\" data-plugin-type=\"${escapeHtml(type)}\" style=\"padding:7px 12px;border:1px solid ${border};border-radius:999px;background:${background};color:${color};font-size:12px;font-weight:700;cursor:pointer;display:inline-flex;gap:8px;align-items:center\">",
|
||||||
|
" <span>${escapeHtml(label)}</span>",
|
||||||
|
" <span style=\"display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:${isActive ? 'rgba(255,255,255,0.16)' : '#e2e8f0'};color:${isActive ? '#ffffff' : '#334155'}\">${items.length}</span>",
|
||||||
|
" </button>",
|
||||||
|
" `;",
|
||||||
|
" }).join('');",
|
||||||
|
" typesEl.querySelectorAll('button[data-plugin-type]').forEach((button) => {",
|
||||||
|
" button.addEventListener('click', () => {",
|
||||||
|
" const pluginType = button.getAttribute('data-plugin-type') || '';",
|
||||||
|
" activeFilter = activeFilter === pluginType ? '' : pluginType;",
|
||||||
|
" syncSelectionToVisible();",
|
||||||
|
" renderList();",
|
||||||
|
" });",
|
||||||
|
" });",
|
||||||
|
" };",
|
||||||
|
" const renderRepoButtons = () => {",
|
||||||
|
" if (repoEntries.length <= 1) {",
|
||||||
|
" repoRowEl.style.display = 'none';",
|
||||||
|
" reposEl.innerHTML = '';",
|
||||||
|
" activeRepoFilter = '';",
|
||||||
|
" return;",
|
||||||
|
" }",
|
||||||
|
" repoRowEl.style.display = 'flex';",
|
||||||
|
" const scopedOptions = options.filter((item) => {",
|
||||||
|
" const matchesType = !activeFilter || item.type === activeFilter;",
|
||||||
|
" return matchesType && matchesSearch(item);",
|
||||||
|
" });",
|
||||||
|
" const filterEntries = [['', scopedOptions], ...repoEntries.map(([repoName]) => [repoName, scopedOptions.filter((item) => item.repo === repoName)])];",
|
||||||
|
" reposEl.innerHTML = filterEntries.map(([repoName, items]) => {",
|
||||||
|
" const isActive = activeRepoFilter === repoName;",
|
||||||
|
" const background = isActive ? '#1d4ed8' : '#ffffff';",
|
||||||
|
" const color = isActive ? '#ffffff' : '#1d4ed8';",
|
||||||
|
" const border = isActive ? '#1d4ed8' : '#bfdbfe';",
|
||||||
|
" const label = repoName || ui.all_repos;",
|
||||||
|
" return `",
|
||||||
|
" <button type=\"button\" data-plugin-repo=\"${escapeHtml(repoName)}\" style=\"padding:7px 12px;border:1px solid ${border};border-radius:999px;background:${background};color:${color};font-size:12px;font-weight:700;cursor:pointer;display:inline-flex;gap:8px;align-items:center\">",
|
||||||
|
" <span>${escapeHtml(label)}</span>",
|
||||||
|
" <span style=\"display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:${isActive ? 'rgba(255,255,255,0.16)' : '#dbeafe'};color:${isActive ? '#ffffff' : '#1e3a8a'}\">${items.length}</span>",
|
||||||
|
" </button>",
|
||||||
|
" `;",
|
||||||
|
" }).join('');",
|
||||||
|
" reposEl.querySelectorAll('button[data-plugin-repo]').forEach((button) => {",
|
||||||
|
" button.addEventListener('click', () => {",
|
||||||
|
" const repoName = button.getAttribute('data-plugin-repo') || '';",
|
||||||
|
" activeRepoFilter = activeRepoFilter === repoName ? '' : repoName;",
|
||||||
|
" syncSelectionToVisible();",
|
||||||
|
" renderList();",
|
||||||
|
" });",
|
||||||
|
" });",
|
||||||
|
" };",
|
||||||
|
" const updateState = () => {",
|
||||||
|
" countEl.textContent = ui.selected_count.replace('{count}', String(selected.size));",
|
||||||
|
" submitBtn.disabled = selected.size === 0;",
|
||||||
|
" submitBtn.style.opacity = selected.size === 0 ? '0.45' : '1';",
|
||||||
|
" submitBtn.style.cursor = selected.size === 0 ? 'not-allowed' : 'pointer';",
|
||||||
|
" renderTypeButtons();",
|
||||||
|
" renderRepoButtons();",
|
||||||
|
" };",
|
||||||
|
" const renderOptionCard = (item) => {",
|
||||||
|
" const checked = selected.has(item.id) ? 'checked' : '';",
|
||||||
|
" const description = item.description ? `",
|
||||||
|
" <div style=\"display:grid;gap:4px\">",
|
||||||
|
" <div style=\"font-size:11px;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:0.04em\">${escapeHtml(ui.description_label)}</div>",
|
||||||
|
" <div style=\"font-size:13px;color:#334155;line-height:1.55;word-break:break-word\">${formatMultilineText(item.description)}</div>",
|
||||||
|
" </div>",
|
||||||
|
" ` : '';",
|
||||||
|
" return `",
|
||||||
|
" <label style=\"display:flex;gap:14px;align-items:flex-start;padding:14px;border:1px solid #e2e8f0;border-radius:14px;background:#fff;cursor:pointer\">",
|
||||||
|
" <input type=\"checkbox\" data-plugin-id=\"${escapeHtml(item.id)}\" ${checked} style=\"margin-top:3px;width:16px;height:16px;accent-color:#0f172a;flex-shrink:0\" />",
|
||||||
|
" <div style=\"min-width:0;display:grid;gap:6px\">",
|
||||||
|
" <div style=\"display:flex;gap:10px;align-items:center;flex-wrap:wrap\">",
|
||||||
|
" <span style=\"display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;background:#f1f5f9;color:#334155;font-size:12px;font-weight:700;text-transform:uppercase\">${escapeHtml(item.type)}</span>",
|
||||||
|
" <span style=\"display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;background:#eff6ff;color:#1d4ed8;font-size:12px;font-weight:700\">${escapeHtml(item.repo)}</span>",
|
||||||
|
" <span style=\"font-size:15px;font-weight:700;color:#0f172a;word-break:break-word\">${escapeHtml(item.title)}</span>",
|
||||||
|
" </div>",
|
||||||
|
" <div style=\"font-size:12px;color:#475569;word-break:break-word\">${escapeHtml(ui.version_label)}: ${escapeHtml(item.version)} · ${escapeHtml(ui.file_label)}: ${escapeHtml(item.file_path)}</div>",
|
||||||
|
" ${description}",
|
||||||
|
" </div>",
|
||||||
|
" </label>",
|
||||||
|
" `;",
|
||||||
|
" };",
|
||||||
|
" const renderList = () => {",
|
||||||
|
" const visibleOptions = getVisibleOptions();",
|
||||||
|
" if (!visibleOptions.length) {",
|
||||||
|
" listEl.innerHTML = `<div style=\"padding:24px;border:1px dashed #cbd5e1;border-radius:14px;background:#f8fafc;color:#475569;font-size:14px;text-align:center\">${escapeHtml(ui.no_results)}</div>`;",
|
||||||
|
" updateState();",
|
||||||
|
" return;",
|
||||||
|
" }",
|
||||||
|
" const groups = visibleOptions.reduce((bucket, item) => {",
|
||||||
|
" if (!bucket[item.repo]) {",
|
||||||
|
" bucket[item.repo] = [];",
|
||||||
|
" }",
|
||||||
|
" bucket[item.repo].push(item);",
|
||||||
|
" return bucket;",
|
||||||
|
" }, {});",
|
||||||
|
" listEl.innerHTML = Object.entries(groups).map(([repoName, items]) => `",
|
||||||
|
" <section style=\"display:grid;gap:10px\">",
|
||||||
|
" <div style=\"display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;padding:0 2px\">",
|
||||||
|
" <div style=\"display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border-radius:999px;background:#eff6ff;color:#1d4ed8;font-size:12px;font-weight:700;word-break:break-word\">${escapeHtml(repoName)}</div>",
|
||||||
|
" <div style=\"display:inline-flex;align-items:center;gap:8px;padding:4px 10px;border-radius:999px;background:#f8fafc;color:#475569;font-size:12px;font-weight:600\">${items.length}</div>",
|
||||||
|
" </div>",
|
||||||
|
" <div style=\"display:grid;gap:12px\">${items.map((item) => renderOptionCard(item)).join('')}</div>",
|
||||||
|
" </section>",
|
||||||
|
" `).join('');",
|
||||||
|
" listEl.querySelectorAll('input[data-plugin-id]').forEach((input) => {",
|
||||||
|
" input.addEventListener('change', () => {",
|
||||||
|
" const pluginId = input.getAttribute('data-plugin-id') || '';",
|
||||||
|
" if (input.checked) {",
|
||||||
|
" selected.add(pluginId);",
|
||||||
|
" } else {",
|
||||||
|
" selected.delete(pluginId);",
|
||||||
|
" }",
|
||||||
|
" updateState();",
|
||||||
|
" });",
|
||||||
|
" });",
|
||||||
|
" updateState();",
|
||||||
|
" };",
|
||||||
|
" const cleanup = () => {",
|
||||||
|
" body.style.overflow = previousOverflow;",
|
||||||
|
" window.removeEventListener('keydown', onKeyDown, true);",
|
||||||
|
" overlay.remove();",
|
||||||
|
" };",
|
||||||
|
" const finish = (confirmed) => {",
|
||||||
|
" const selectedIds = confirmed ? options.filter((item) => selected.has(item.id)).map((item) => item.id) : [];",
|
||||||
|
" cleanup();",
|
||||||
|
" resolve({ confirmed, selected_ids: selectedIds });",
|
||||||
|
" };",
|
||||||
|
" const onKeyDown = (event) => {",
|
||||||
|
" if (event.key === 'Escape') {",
|
||||||
|
" event.preventDefault();",
|
||||||
|
" finish(false);",
|
||||||
|
" }",
|
||||||
|
" };",
|
||||||
|
" overlay.addEventListener('click', (event) => {",
|
||||||
|
" if (event.target === overlay) {",
|
||||||
|
" finish(false);",
|
||||||
|
" }",
|
||||||
|
" });",
|
||||||
|
" selectAllBtn.addEventListener('click', () => {",
|
||||||
|
" getVisibleOptions().forEach((item) => selected.add(item.id));",
|
||||||
|
" renderList();",
|
||||||
|
" });",
|
||||||
|
" clearAllBtn.addEventListener('click', () => {",
|
||||||
|
" getVisibleOptions().forEach((item) => selected.delete(item.id));",
|
||||||
|
" renderList();",
|
||||||
|
" });",
|
||||||
|
" searchInput.addEventListener('input', () => {",
|
||||||
|
" searchTerm = searchInput.value.trim().toLowerCase();",
|
||||||
|
" syncSelectionToVisible();",
|
||||||
|
" renderList();",
|
||||||
|
" });",
|
||||||
|
" cancelBtn.addEventListener('click', () => finish(false));",
|
||||||
|
" submitBtn.addEventListener('click', () => {",
|
||||||
|
" if (selected.size === 0) {",
|
||||||
|
" updateState();",
|
||||||
|
" return;",
|
||||||
|
" }",
|
||||||
|
" finish(true);",
|
||||||
|
" });",
|
||||||
|
" window.addEventListener('keydown', onKeyDown, true);",
|
||||||
|
" renderList();",
|
||||||
|
" } catch (error) {",
|
||||||
|
" console.error('[Batch Install] Plugin selection dialog failed', error);",
|
||||||
|
" resolve({",
|
||||||
|
" confirmed: false,",
|
||||||
|
" error: error instanceof Error ? error.message : String(error),",
|
||||||
|
" selected_ids: [],",
|
||||||
|
" });",
|
||||||
|
" }",
|
||||||
|
"});",
|
||||||
|
]
|
||||||
|
return "\n".join(lines)
|
||||||
|
|
||||||
|
|
||||||
|
async def _request_plugin_selection(
|
||||||
event_call: Optional[Any],
|
event_call: Optional[Any],
|
||||||
lang: str,
|
lang: str,
|
||||||
message: str,
|
candidates: List[PluginCandidate],
|
||||||
) -> Tuple[bool, Optional[str]]:
|
hint: str,
|
||||||
|
) -> Tuple[Optional[List[PluginCandidate]], Optional[str]]:
|
||||||
if not event_call:
|
if not event_call:
|
||||||
return True, None
|
return candidates, None
|
||||||
|
|
||||||
|
options = [
|
||||||
|
{
|
||||||
|
"id": candidate.selection_id,
|
||||||
|
"title": candidate.title,
|
||||||
|
"type": candidate.plugin_type,
|
||||||
|
"repo": candidate.source_repo,
|
||||||
|
"version": candidate.version,
|
||||||
|
"file_path": candidate.file_path,
|
||||||
|
"description": candidate.metadata.get("description", ""),
|
||||||
|
}
|
||||||
|
for candidate in candidates
|
||||||
|
]
|
||||||
|
ui_text = {
|
||||||
|
"title": _t(lang, "confirm_title"),
|
||||||
|
"list_title": _t(lang, "status_list_title", count=len(candidates)),
|
||||||
|
"repo_label": _selection_t(lang, "repo_label"),
|
||||||
|
"hint": hint.strip(),
|
||||||
|
"select_all": _selection_t(lang, "select_all"),
|
||||||
|
"clear_all": _selection_t(lang, "clear_all"),
|
||||||
|
"quick_select": _selection_t(lang, "quick_select"),
|
||||||
|
"all_types": _selection_t(lang, "all_types"),
|
||||||
|
"repo_filter": _selection_t(lang, "repo_filter"),
|
||||||
|
"all_repos": _selection_t(lang, "all_repos"),
|
||||||
|
"search_label": _selection_t(lang, "search_label"),
|
||||||
|
"search_placeholder": _selection_t(lang, "search_placeholder"),
|
||||||
|
"no_results": _selection_t(lang, "no_results"),
|
||||||
|
"selected_count": _selection_t(lang, "selected_count", count="{count}"),
|
||||||
|
"install_selected": _selection_t(lang, "install_selected"),
|
||||||
|
"cancel": _selection_t(lang, "cancel"),
|
||||||
|
"version_label": _selection_t(lang, "version_label"),
|
||||||
|
"file_label": _selection_t(lang, "file_label"),
|
||||||
|
"description_label": _selection_t(lang, "description_label"),
|
||||||
|
}
|
||||||
|
js_code = _build_selection_dialog_js(options, ui_text)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
confirmed = await asyncio.wait_for(
|
result = await asyncio.wait_for(
|
||||||
event_call(
|
event_call({"type": "execute", "data": {"code": js_code}}),
|
||||||
{
|
|
||||||
"type": "confirmation",
|
|
||||||
"data": {
|
|
||||||
"title": _t(lang, "confirm_title"),
|
|
||||||
"message": message,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
),
|
|
||||||
timeout=CONFIRMATION_TIMEOUT,
|
timeout=CONFIRMATION_TIMEOUT,
|
||||||
)
|
)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
logger.warning("Installation confirmation timed out.")
|
logger.warning("Installation selection dialog timed out.")
|
||||||
return False, _t(lang, "err_confirm_unavailable")
|
return None, _t(lang, "err_confirm_unavailable")
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
logger.warning("Installation confirmation failed: %s", exc)
|
logger.warning("Installation selection dialog failed: %s", exc)
|
||||||
return False, _t(lang, "err_confirm_unavailable")
|
return None, _t(lang, "err_confirm_unavailable")
|
||||||
|
|
||||||
return bool(confirmed), None
|
if not isinstance(result, dict):
|
||||||
|
logger.warning("Unexpected selection dialog result: %r", result)
|
||||||
|
return None, _t(lang, "err_confirm_unavailable")
|
||||||
|
|
||||||
|
if result.get("error"):
|
||||||
|
logger.warning("Selection dialog returned error: %s", result.get("error"))
|
||||||
|
return None, _t(lang, "err_confirm_unavailable")
|
||||||
|
|
||||||
|
if not result.get("confirmed"):
|
||||||
|
return [], None
|
||||||
|
|
||||||
|
selected_ids = result.get("selected_ids")
|
||||||
|
if not isinstance(selected_ids, list):
|
||||||
|
logger.warning("Selection dialog returned invalid selected_ids: %r", selected_ids)
|
||||||
|
return None, _t(lang, "err_confirm_unavailable")
|
||||||
|
|
||||||
|
selected_id_set = {str(item).strip() for item in selected_ids if str(item).strip()}
|
||||||
|
selected_candidates = [
|
||||||
|
candidate for candidate in candidates if candidate.selection_id in selected_id_set
|
||||||
|
]
|
||||||
|
return selected_candidates, None
|
||||||
|
|
||||||
|
|
||||||
def parse_github_url(url: str) -> Optional[Tuple[str, str, str]]:
|
def parse_github_url(url: str) -> Optional[Tuple[str, str, str]]:
|
||||||
@@ -811,11 +1436,13 @@ async def fetch_github_file(
|
|||||||
async def discover_plugins(
|
async def discover_plugins(
|
||||||
url: str,
|
url: str,
|
||||||
skip_keywords: str = "test",
|
skip_keywords: str = "test",
|
||||||
|
source_repo: str = "",
|
||||||
) -> Tuple[List[PluginCandidate], List[Tuple[str, str]]]:
|
) -> Tuple[List[PluginCandidate], List[Tuple[str, str]]]:
|
||||||
parsed = parse_github_url(url)
|
parsed = parse_github_url(url)
|
||||||
if not parsed:
|
if not parsed:
|
||||||
return [], [("url", "invalid github url")]
|
return [], [("url", "invalid github url")]
|
||||||
owner, repo, branch = parsed
|
owner, repo, branch = parsed
|
||||||
|
resolved_repo = source_repo or f"{owner}/{repo}"
|
||||||
|
|
||||||
is_default_repo = (owner.lower() == "fu-jie" and repo.lower() == "openwebui-extensions")
|
is_default_repo = (owner.lower() == "fu-jie" and repo.lower() == "openwebui-extensions")
|
||||||
|
|
||||||
@@ -880,6 +1507,7 @@ async def discover_plugins(
|
|||||||
metadata=metadata,
|
metadata=metadata,
|
||||||
content=content,
|
content=content,
|
||||||
function_id=build_function_id(item_path, metadata),
|
function_id=build_function_id(item_path, metadata),
|
||||||
|
source_repo=resolved_repo,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -887,10 +1515,30 @@ async def discover_plugins(
|
|||||||
return candidates, skipped
|
return candidates, skipped
|
||||||
|
|
||||||
|
|
||||||
|
async def discover_plugins_from_repos(
|
||||||
|
repos: List[str],
|
||||||
|
skip_keywords: str = "test",
|
||||||
|
) -> Tuple[List[PluginCandidate], List[Tuple[str, str]]]:
|
||||||
|
tasks = [
|
||||||
|
discover_plugins(f"https://github.com/{repo}", skip_keywords, source_repo=repo)
|
||||||
|
for repo in repos
|
||||||
|
]
|
||||||
|
results = await asyncio.gather(*tasks)
|
||||||
|
|
||||||
|
all_candidates: List[PluginCandidate] = []
|
||||||
|
all_skipped: List[Tuple[str, str]] = []
|
||||||
|
|
||||||
|
for repo, (candidates, skipped) in zip(repos, results):
|
||||||
|
all_candidates.extend(candidates)
|
||||||
|
all_skipped.extend([(f"{repo}:{path}", reason) for path, reason in skipped])
|
||||||
|
|
||||||
|
return _sort_candidates_by_repo_order(all_candidates, repos), all_skipped
|
||||||
|
|
||||||
|
|
||||||
class ListParams(BaseModel):
|
class ListParams(BaseModel):
|
||||||
repo: str = Field(
|
repo: str = Field(
|
||||||
default=DEFAULT_REPO,
|
default=DEFAULT_REPO,
|
||||||
description="GitHub repository (owner/repo)",
|
description="One or more GitHub repositories (owner/repo), separated by commas, semicolons, or new lines. If the user mentions multiple repositories in one request, combine them here and call the tool once.",
|
||||||
)
|
)
|
||||||
plugin_types: List[str] = Field(
|
plugin_types: List[str] = Field(
|
||||||
default=["pipe", "action", "filter", "tool"],
|
default=["pipe", "action", "filter", "tool"],
|
||||||
@@ -901,7 +1549,7 @@ class ListParams(BaseModel):
|
|||||||
class InstallParams(BaseModel):
|
class InstallParams(BaseModel):
|
||||||
repo: str = Field(
|
repo: str = Field(
|
||||||
default=DEFAULT_REPO,
|
default=DEFAULT_REPO,
|
||||||
description="GitHub repository (owner/repo)",
|
description="One or more GitHub repositories (owner/repo), separated by commas, semicolons, or new lines. If the user mentions multiple repositories in one request, combine them here and call the tool once instead of making separate calls.",
|
||||||
)
|
)
|
||||||
plugin_types: List[str] = Field(
|
plugin_types: List[str] = Field(
|
||||||
default=["pipe", "action", "filter", "tool"],
|
default=["pipe", "action", "filter", "tool"],
|
||||||
@@ -936,6 +1584,11 @@ class Tools:
|
|||||||
repo: str = DEFAULT_REPO,
|
repo: str = DEFAULT_REPO,
|
||||||
plugin_types: List[str] = ["pipe", "action", "filter", "tool"],
|
plugin_types: List[str] = ["pipe", "action", "filter", "tool"],
|
||||||
) -> str:
|
) -> str:
|
||||||
|
"""List plugins from one or more repositories in a single call.
|
||||||
|
|
||||||
|
If a user request mentions multiple repositories, combine them into the
|
||||||
|
`repo` argument instead of calling this tool multiple times.
|
||||||
|
"""
|
||||||
user_ctx = await _get_user_context(__user__, __event_call__, __request__)
|
user_ctx = await _get_user_context(__user__, __event_call__, __request__)
|
||||||
lang = user_ctx.get("user_language", "en-US")
|
lang = user_ctx.get("user_language", "en-US")
|
||||||
|
|
||||||
@@ -943,18 +1596,22 @@ class Tools:
|
|||||||
if valves and hasattr(valves, "SKIP_KEYWORDS") and valves.SKIP_KEYWORDS:
|
if valves and hasattr(valves, "SKIP_KEYWORDS") and valves.SKIP_KEYWORDS:
|
||||||
skip_keywords = valves.SKIP_KEYWORDS
|
skip_keywords = valves.SKIP_KEYWORDS
|
||||||
|
|
||||||
repo_url = f"https://github.com/{repo}"
|
repo_list = _parse_repo_inputs(repo)
|
||||||
candidates, _ = await discover_plugins(repo_url, skip_keywords)
|
candidates, _ = await discover_plugins_from_repos(repo_list, skip_keywords)
|
||||||
|
|
||||||
if not candidates:
|
if not candidates:
|
||||||
return _t(lang, "err_no_plugins")
|
return _t(lang, "err_no_plugins")
|
||||||
|
|
||||||
filtered = _filter_candidates(candidates, plugin_types, repo)
|
filtered = _filter_candidates(candidates, plugin_types, repo_list)
|
||||||
if not filtered:
|
if not filtered:
|
||||||
return _t(lang, "err_no_match")
|
return _t(lang, "err_no_match")
|
||||||
|
|
||||||
lines = [f"## {_t(lang, 'status_list_title', count=len(filtered))}\n"]
|
lines = [f"## {_t(lang, 'status_list_title', count=len(filtered))}\n"]
|
||||||
|
current_repo = ""
|
||||||
for c in filtered:
|
for c in filtered:
|
||||||
|
if c.source_repo != current_repo:
|
||||||
|
lines.append(f"\n### {c.source_repo}")
|
||||||
|
current_repo = c.source_repo
|
||||||
lines.append(
|
lines.append(
|
||||||
_t(lang, "list_item", type=c.plugin_type, title=c.title)
|
_t(lang, "list_item", type=c.plugin_type, title=c.title)
|
||||||
)
|
)
|
||||||
@@ -973,6 +1630,12 @@ class Tools:
|
|||||||
exclude_keywords: str = "",
|
exclude_keywords: str = "",
|
||||||
timeout: int = DEFAULT_TIMEOUT,
|
timeout: int = DEFAULT_TIMEOUT,
|
||||||
) -> str:
|
) -> str:
|
||||||
|
"""Install plugins from one or more repositories in a single call.
|
||||||
|
|
||||||
|
If a user request mentions multiple repositories, combine them into the
|
||||||
|
`repo` argument and call this tool once instead of making parallel
|
||||||
|
calls for each repository.
|
||||||
|
"""
|
||||||
user_ctx = await _get_user_context(__user__, __event_call__, __request__)
|
user_ctx = await _get_user_context(__user__, __event_call__, __request__)
|
||||||
lang = user_ctx.get("user_language", "en-US")
|
lang = user_ctx.get("user_language", "en-US")
|
||||||
event_emitter = __event_emitter__ or emitter
|
event_emitter = __event_emitter__ or emitter
|
||||||
@@ -1024,39 +1687,30 @@ class Tools:
|
|||||||
|
|
||||||
await _emit_status(event_emitter, _t(lang, "status_fetching"), done=False)
|
await _emit_status(event_emitter, _t(lang, "status_fetching"), done=False)
|
||||||
|
|
||||||
repo_url = f"https://github.com/{repo}"
|
repo_list = _parse_repo_inputs(repo)
|
||||||
candidates, _ = await discover_plugins(repo_url, skip_keywords)
|
candidates, _ = await discover_plugins_from_repos(repo_list, skip_keywords)
|
||||||
|
|
||||||
if not candidates:
|
if not candidates:
|
||||||
return await _finalize_message(
|
return await _finalize_message(
|
||||||
event_emitter, _t(lang, "err_no_plugins"), notification_type="error"
|
event_emitter, _t(lang, "err_no_plugins"), notification_type="error"
|
||||||
)
|
)
|
||||||
|
|
||||||
filtered = _filter_candidates(candidates, plugin_types, repo, exclude_keywords)
|
filtered = _filter_candidates(candidates, plugin_types, repo_list, exclude_keywords)
|
||||||
|
|
||||||
if not filtered:
|
if not filtered:
|
||||||
return await _finalize_message(
|
return await _finalize_message(
|
||||||
event_emitter, _t(lang, "err_no_match"), notification_type="warning"
|
event_emitter, _t(lang, "err_no_match"), notification_type="warning"
|
||||||
)
|
)
|
||||||
|
|
||||||
plugin_list = "\n".join([f"- [{c.plugin_type}] {c.title}" for c in filtered])
|
|
||||||
hint_msg = _build_confirmation_hint(lang, repo, exclude_keywords)
|
hint_msg = _build_confirmation_hint(lang, repo, exclude_keywords)
|
||||||
confirm_msg = _t(
|
selected_candidates, confirm_error = await _request_plugin_selection(
|
||||||
lang,
|
__event_call__, lang, filtered, hint_msg
|
||||||
"confirm_message",
|
|
||||||
count=len(filtered),
|
|
||||||
plugin_list=plugin_list,
|
|
||||||
hint=hint_msg,
|
|
||||||
)
|
|
||||||
|
|
||||||
confirmed, confirm_error = await _request_confirmation(
|
|
||||||
__event_call__, lang, confirm_msg
|
|
||||||
)
|
)
|
||||||
if confirm_error:
|
if confirm_error:
|
||||||
return await _finalize_message(
|
return await _finalize_message(
|
||||||
event_emitter, confirm_error, notification_type="warning"
|
event_emitter, confirm_error, notification_type="warning"
|
||||||
)
|
)
|
||||||
if not confirmed:
|
if not selected_candidates:
|
||||||
return await _finalize_message(
|
return await _finalize_message(
|
||||||
event_emitter,
|
event_emitter,
|
||||||
_t(lang, "confirm_cancelled"),
|
_t(lang, "confirm_cancelled"),
|
||||||
@@ -1068,9 +1722,10 @@ class Tools:
|
|||||||
"Starting OpenWebUI install requests",
|
"Starting OpenWebUI install requests",
|
||||||
{
|
{
|
||||||
"repo": repo,
|
"repo": repo,
|
||||||
|
"repos": repo_list,
|
||||||
"base_url": base_url,
|
"base_url": base_url,
|
||||||
"note": "Backend uses default port 8080 (containerized environment)",
|
"note": "Backend uses default port 8080 (containerized environment)",
|
||||||
"plugin_count": len(filtered),
|
"plugin_count": len(selected_candidates),
|
||||||
"plugin_types": plugin_types,
|
"plugin_types": plugin_types,
|
||||||
"exclude_keywords": exclude_keywords,
|
"exclude_keywords": exclude_keywords,
|
||||||
"timeout": timeout,
|
"timeout": timeout,
|
||||||
@@ -1092,7 +1747,7 @@ class Tools:
|
|||||||
async with httpx.AsyncClient(
|
async with httpx.AsyncClient(
|
||||||
timeout=httpx.Timeout(timeout), follow_redirects=True
|
timeout=httpx.Timeout(timeout), follow_redirects=True
|
||||||
) as client:
|
) as client:
|
||||||
for candidate in filtered:
|
for candidate in selected_candidates:
|
||||||
await _emit_status(
|
await _emit_status(
|
||||||
event_emitter,
|
event_emitter,
|
||||||
_t(
|
_t(
|
||||||
@@ -1341,12 +1996,17 @@ class Tools:
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
summary = _t(lang, "status_done", success=success_count, total=len(filtered))
|
summary = _t(
|
||||||
|
lang,
|
||||||
|
"status_done",
|
||||||
|
success=success_count,
|
||||||
|
total=len(selected_candidates),
|
||||||
|
)
|
||||||
output = "\n".join(results + [summary])
|
output = "\n".join(results + [summary])
|
||||||
notification_type = "success"
|
notification_type = "success"
|
||||||
if success_count == 0:
|
if success_count == 0:
|
||||||
notification_type = "error"
|
notification_type = "error"
|
||||||
elif success_count < len(filtered):
|
elif success_count < len(selected_candidates):
|
||||||
notification_type = "warning"
|
notification_type = "warning"
|
||||||
|
|
||||||
await _emit_status(event_emitter, summary, done=True)
|
await _emit_status(event_emitter, summary, done=True)
|
||||||
|
|||||||
BIN
plugins/tools/batch-install-plugins/install.png
Normal file
BIN
plugins/tools/batch-install-plugins/install.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 281 KiB |
36
plugins/tools/batch-install-plugins/v1.1.0.md
Normal file
36
plugins/tools/batch-install-plugins/v1.1.0.md
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
[](https://openwebui.com/t/fujie/batch_install_plugins)
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Batch Install Plugins from GitHub v1.1.0 upgrades the install confirmation step into an interactive plugin picker powered by the OpenWebUI `execute` event. Users can now review the filtered plugin list in a browser dialog, uncheck anything they do not want, and install only the selected subset.
|
||||||
|
|
||||||
|
**[📖 README](https://github.com/Fu-Jie/openwebui-extensions/blob/main/plugins/tools/batch-install-plugins/README.md)**
|
||||||
|
|
||||||
|
## Highlights
|
||||||
|
|
||||||
|
- **Interactive Selection Dialog**: Opens a checkbox-based browser dialog with type filters, keyword search, and visible plugin descriptions
|
||||||
|
- **Multi-Repository Input**: Accepts multiple `owner/repo` values in one request and groups the dialog by repository
|
||||||
|
- **Selective Installation**: The install loop now runs only for the plugins the user keeps selected
|
||||||
|
- **Repository Context**: Displays the current repository and only shows useful exclusion information inside the dialog
|
||||||
|
- **Localized UI**: Dialog controls are localized for all supported languages
|
||||||
|
- **No Workflow Regression**: Existing discovery, filtering, auto-update, and fallback connection logic remain unchanged
|
||||||
|
|
||||||
|
## Technical Notes
|
||||||
|
|
||||||
|
- Replaced the install confirmation step with `__event_call__({"type": "execute"})`
|
||||||
|
- Added a repository parser plus multi-repository discovery fan-out before filtering and installation
|
||||||
|
- Returns a structured payload containing `confirmed` and `selected_ids`
|
||||||
|
- Preserves the existing 120-second timeout for user interaction
|
||||||
|
- Keeps installation ordering aligned with the requested repository order and filtered candidate list
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
- Python syntax validated with `python -m py_compile plugins/tools/batch-install-plugins/batch_install_plugins.py`
|
||||||
|
- README and mirrored docs updated to match the new interactive selection flow
|
||||||
|
|
||||||
|
## Upgrade Notes
|
||||||
|
|
||||||
|
- No new Valves are required
|
||||||
|
- Existing prompts continue to work
|
||||||
|
- Users now get a plugin picker before installation begins
|
||||||
|
- One request can now merge multiple repositories into the same selection dialog
|
||||||
36
plugins/tools/batch-install-plugins/v1.1.0_CN.md
Normal file
36
plugins/tools/batch-install-plugins/v1.1.0_CN.md
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
[](https://openwebui.com/t/fujie/batch_install_plugins)
|
||||||
|
|
||||||
|
## 概述
|
||||||
|
|
||||||
|
Batch Install Plugins from GitHub v1.1.0 将原本的安装确认步骤升级为基于 OpenWebUI `execute` 事件的交互式插件选择器。现在,用户可以先在浏览器对话框中查看过滤后的插件列表,取消勾选不想安装的项,然后只安装最终选中的插件子集。
|
||||||
|
|
||||||
|
**[📖 README](https://github.com/Fu-Jie/openwebui-extensions/blob/main/plugins/tools/batch-install-plugins/README_CN.md)**
|
||||||
|
|
||||||
|
## 亮点
|
||||||
|
|
||||||
|
- **交互式选择对话框**:不再只使用基础 confirmation 事件,而是打开带类型筛选、关键词搜索、描述信息和复选框的浏览器对话框
|
||||||
|
- **多仓库输入**:一次请求支持多个 `owner/repo`,并在对话框中按仓库分组展示
|
||||||
|
- **选择性安装**:安装循环只会处理用户最终保留勾选的插件
|
||||||
|
- **仓库上下文**:对话框中会显示当前仓库,并且只展示真正有用的排除信息
|
||||||
|
- **本地化 UI**:对话框控件已为所有支持语言提供本地化文本
|
||||||
|
- **工作流不回退**:原有的插件发现、过滤、自动更新和连接回退逻辑保持不变
|
||||||
|
|
||||||
|
## 技术说明
|
||||||
|
|
||||||
|
- 使用 `__event_call__({"type": "execute"})` 替换安装确认步骤
|
||||||
|
- 新增仓库解析和多仓库发现聚合流程,再进入过滤与安装阶段
|
||||||
|
- 返回包含 `confirmed` 与 `selected_ids` 的结构化结果
|
||||||
|
- 保留原有的 120 秒用户交互超时时间
|
||||||
|
- 安装顺序仍与用户传入的仓库顺序和过滤后的候选列表保持一致
|
||||||
|
|
||||||
|
## 验证
|
||||||
|
|
||||||
|
- 已通过 `python -m py_compile plugins/tools/batch-install-plugins/batch_install_plugins.py` 进行 Python 语法校验
|
||||||
|
- README 与镜像文档已同步为新的交互式选择流程
|
||||||
|
|
||||||
|
## 升级说明
|
||||||
|
|
||||||
|
- 不需要新增 Valves
|
||||||
|
- 现有提示词仍可继续使用
|
||||||
|
- 安装开始前会新增一个插件选择器步骤
|
||||||
|
- 现在单次请求就可以把多个仓库合并到同一个选择对话框
|
||||||
Reference in New Issue
Block a user