feat(copilot-sdk): v0.12.1 - disable terminal tools for AI, improve RichUI theme
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# GitHub Copilot SDK Pipe for OpenWebUI
|
||||
|
||||
| By [Fu-Jie](https://github.com/Fu-Jie) · v0.12.0 | [⭐ Star this repo](https://github.com/Fu-Jie/openwebui-extensions) |
|
||||
| By [Fu-Jie](https://github.com/Fu-Jie) · v0.12.1 | [⭐ Star this repo](https://github.com/Fu-Jie/openwebui-extensions) |
|
||||
| :--- | ---: |
|
||||
|
||||
|  |  |  |  |  |  |  |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# GitHub Copilot Official SDK Pipe
|
||||
|
||||
| 作者:[Fu-Jie](https://github.com/Fu-Jie) · v0.12.0 | [⭐ 点个 Star 支持项目](https://github.com/Fu-Jie/openwebui-extensions) |
|
||||
| 作者:[Fu-Jie](https://github.com/Fu-Jie) · v0.12.1 | [⭐ 点个 Star 支持项目](https://github.com/Fu-Jie/openwebui-extensions) |
|
||||
| :--- | ---: |
|
||||
|
||||
|  |  |  |  |  |  |  |
|
||||
|
||||
@@ -78,10 +78,74 @@ RICHUI_BRIDGE_STYLE = """
|
||||
<style id="openwebui-richui-bridge-style" data-openwebui-richui-bridge="1">
|
||||
:root {
|
||||
color-scheme: light dark;
|
||||
/* Theme-aware CSS variables for AI-generated content */
|
||||
--richui-text: #1a202c;
|
||||
--richui-text-secondary: #4a5568;
|
||||
--richui-text-muted: #718096;
|
||||
--richui-bg: #ffffff;
|
||||
--richui-bg-secondary: #f7fafc;
|
||||
--richui-bg-tertiary: #edf2f7;
|
||||
--richui-border: #e2e8f0;
|
||||
--richui-border-subtle: #edf2f7;
|
||||
--richui-accent: #3182ce;
|
||||
--richui-accent-hover: #2b6cb0;
|
||||
--richui-success: #38a169;
|
||||
--richui-warning: #d69e2e;
|
||||
--richui-error: #e53e3e;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--richui-text: #f7fafc;
|
||||
--richui-text-secondary: #cbd5e0;
|
||||
--richui-text-muted: #a0aec0;
|
||||
--richui-bg: #1a202c;
|
||||
--richui-bg-secondary: #2d3748;
|
||||
--richui-bg-tertiary: #4a5568;
|
||||
--richui-border: #4a5568;
|
||||
--richui-border-subtle: #2d3748;
|
||||
--richui-accent: #63b3ed;
|
||||
--richui-accent-hover: #90cdf4;
|
||||
--richui-success: #68d391;
|
||||
--richui-warning: #f6e05e;
|
||||
--richui-error: #fc8181;
|
||||
}
|
||||
}
|
||||
html[data-openwebui-applied-theme="dark"],
|
||||
html.dark {
|
||||
--richui-text: #f7fafc;
|
||||
--richui-text-secondary: #cbd5e0;
|
||||
--richui-text-muted: #a0aec0;
|
||||
--richui-bg: #1a202c;
|
||||
--richui-bg-secondary: #2d3748;
|
||||
--richui-bg-tertiary: #4a5568;
|
||||
--richui-border: #4a5568;
|
||||
--richui-border-subtle: #2d3748;
|
||||
--richui-accent: #63b3ed;
|
||||
--richui-accent-hover: #90cdf4;
|
||||
--richui-success: #68d391;
|
||||
--richui-warning: #f6e05e;
|
||||
--richui-error: #fc8181;
|
||||
}
|
||||
html[data-openwebui-applied-theme="light"],
|
||||
html.light {
|
||||
--richui-text: #1a202c;
|
||||
--richui-text-secondary: #4a5568;
|
||||
--richui-text-muted: #718096;
|
||||
--richui-bg: #ffffff;
|
||||
--richui-bg-secondary: #f7fafc;
|
||||
--richui-bg-tertiary: #edf2f7;
|
||||
--richui-border: #e2e8f0;
|
||||
--richui-border-subtle: #edf2f7;
|
||||
--richui-accent: #3182ce;
|
||||
--richui-accent-hover: #2b6cb0;
|
||||
--richui-success: #38a169;
|
||||
--richui-warning: #d69e2e;
|
||||
--richui-error: #e53e3e;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
background: transparent !important;
|
||||
color: var(--richui-text) !important;
|
||||
overflow-x: hidden !important;
|
||||
width: 100% !important;
|
||||
margin: 0 !important;
|
||||
@@ -1655,7 +1719,7 @@ class Pipe:
|
||||
description="Copilot CLI log level: none, error, warning, info, debug, all",
|
||||
)
|
||||
TIMEOUT: int = Field(
|
||||
default=300,
|
||||
default=3600,
|
||||
description="Timeout for each stream chunk (seconds)",
|
||||
)
|
||||
|
||||
@@ -2051,12 +2115,12 @@ class Pipe:
|
||||
+ "".join(button_html)
|
||||
+ "</div></section>\n"
|
||||
"<style>\n"
|
||||
".openwebui-richui-fallback-actions{margin:20px auto 0;max-width:1200px;padding:14px 16px;border:1px solid rgba(148,163,184,.18);border-radius:14px;background:rgba(15,23,42,.04);}\n"
|
||||
".openwebui-richui-fallback-title{font-size:12px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--color-text-secondary, #64748b);margin-bottom:10px;}\n"
|
||||
".openwebui-richui-fallback-actions{margin:20px auto 0;max-width:1200px;padding:14px 16px;border:1px solid var(--richui-border, rgba(148,163,184,.18));border-radius:14px;background:var(--richui-bg-secondary, rgba(15,23,42,.04));}\n"
|
||||
".openwebui-richui-fallback-title{font-size:12px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--richui-text-secondary, #64748b);margin-bottom:10px;}\n"
|
||||
".openwebui-richui-fallback-row{display:flex;flex-wrap:wrap;gap:10px;}\n"
|
||||
".openwebui-richui-action-btn{appearance:none;border:1px solid rgba(148,163,184,.24);background:var(--color-bg-secondary, rgba(255,255,255,.9));color:var(--color-text-primary, #0f172a);border-radius:999px;padding:8px 14px;font:500 13px/1.2 var(--font-sans, system-ui);cursor:pointer;transition:all .18s ease;}\n"
|
||||
".openwebui-richui-action-btn:hover{transform:translateY(-1px);border-color:rgba(59,130,246,.55);}\n"
|
||||
".openwebui-richui-action-btn:focus-visible{outline:2px solid rgba(59,130,246,.6);outline-offset:2px;}\n"
|
||||
".openwebui-richui-action-btn{appearance:none;border:1px solid var(--richui-border, rgba(148,163,184,.24));background:var(--richui-bg, rgba(255,255,255,.9));color:var(--richui-text, #0f172a);border-radius:999px;padding:8px 14px;font:500 13px/1.2 var(--font-sans, system-ui);cursor:pointer;transition:all .18s ease;}\n"
|
||||
".openwebui-richui-action-btn:hover{transform:translateY(-1px);border-color:var(--richui-accent, rgba(59,130,246,.55));}\n"
|
||||
".openwebui-richui-action-btn:focus-visible{outline:2px solid var(--richui-accent, rgba(59,130,246,.6));outline-offset:2px;}\n"
|
||||
"</style>\n"
|
||||
)
|
||||
|
||||
@@ -5108,6 +5172,10 @@ class Pipe:
|
||||
__event_call__,
|
||||
)
|
||||
continue
|
||||
tool_type = t_dict.get("type", "")
|
||||
tool_id = t_dict.get("tool_id", "")
|
||||
if tool_type == "terminal" or str(tool_id).startswith("terminal:"):
|
||||
continue
|
||||
try:
|
||||
copilot_tool = self._convert_openwebui_tool_to_sdk(
|
||||
tool_name,
|
||||
@@ -9608,7 +9676,7 @@ class Pipe:
|
||||
break
|
||||
|
||||
now_ts = time.monotonic()
|
||||
no_progress_timeout = min(float(self.valves.TIMEOUT), 90.0)
|
||||
no_progress_timeout = float(self.valves.TIMEOUT)
|
||||
time_since_last_event = now_ts - state.get(
|
||||
"last_event_ts", stream_start_ts
|
||||
)
|
||||
|
||||
23
plugins/pipes/github-copilot-sdk/v0.12.1.md
Normal file
23
plugins/pipes/github-copilot-sdk/v0.12.1.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# v0.12.1 Release Notes
|
||||
|
||||
This update (`v0.12.1`) disables terminal server tools from being exposed to AI while keeping terminal functionality available to users, and improves RichUI theme compatibility.
|
||||
|
||||
## 📊 New Features
|
||||
|
||||
### 1. Disable Terminal Tools for AI
|
||||
Terminal server tools (e.g., `run_command`) are now filtered out at the pipe level, preventing AI from calling terminal tools while preserving terminal functionality for users through the OpenWebUI interface.
|
||||
|
||||
### 2. RichUI Theme-Aware CSS Variables
|
||||
Added CSS custom properties (`--richui-text`, `--richui-bg`, etc.) that automatically adapt to light/dark themes, improving text contrast and readability in AI-generated HTML content.
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ Improvements
|
||||
|
||||
1. **Fallback Actions Styling**: Updated fallback action buttons to use theme-aware CSS variables for consistent appearance across themes.
|
||||
2. **Default Timeout**: Increased default stream timeout from 300s to 3600s for better handling of long-running tasks.
|
||||
|
||||
---
|
||||
|
||||
## 📖 Docs Update
|
||||
* Version synchronization pushed up to `v0.12.1`.
|
||||
23
plugins/pipes/github-copilot-sdk/v0.12.1_CN.md
Normal file
23
plugins/pipes/github-copilot-sdk/v0.12.1_CN.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# v0.12.1 发布说明
|
||||
|
||||
本次更新 (`v0.12.1`) 在管道层面禁用了终端服务器工具的 AI 调用,同时保留用户通过界面使用终端的功能,并改进了 RichUI 主题兼容性。
|
||||
|
||||
## 📊 新功能
|
||||
|
||||
### 1. 禁用终端工具的 AI 调用
|
||||
终端服务器工具(如 `run_command`)现在已在管道层面被过滤,AI 无法调用这些工具,但用户仍可通过 OpenWebUI 界面使用终端功能。
|
||||
|
||||
### 2. RichUI 主题感知 CSS 变量
|
||||
新增 CSS 自定义属性(`--richui-text`、`--richui-bg` 等),自动适配浅色/深色主题,改善 AI 生成 HTML 内容的文字对比度和可读性。
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ 改进
|
||||
|
||||
1. **Fallback Actions 样式优化**:更新 fallback action 按钮使用主题感知 CSS 变量,确保跨主题一致性。
|
||||
2. **默认超时时间**:将默认流超时从 300 秒增加到 3600 秒,更好地处理长时间运行的任务。
|
||||
|
||||
---
|
||||
|
||||
## 📖 文档更新
|
||||
* 版本同步更新至 `v0.12.1`。
|
||||
Reference in New Issue
Block a user