chore: remove file
This commit is contained in:
75
CHANGELOG.md
75
CHANGELOG.md
@@ -1,75 +0,0 @@
|
||||
# Changelog / 更新日志
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
本项目的所有重要更改都将记录在此文件中。
|
||||
格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),
|
||||
本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
||||
|
||||
---
|
||||
|
||||
## [Unreleased] / 未发布
|
||||
|
||||
### Added / 新增
|
||||
- 插件发布工作流 (Plugin release workflow)
|
||||
|
||||
### Changed / 变更
|
||||
|
||||
### Fixed / 修复
|
||||
|
||||
### Removed / 移除
|
||||
|
||||
---
|
||||
|
||||
## Plugin Versions / 插件版本
|
||||
|
||||
### Actions
|
||||
|
||||
| Plugin / 插件 | Version / 版本 |
|
||||
|---------------|----------------|
|
||||
| Smart Mind Map / 思维导图 | 0.8.0 |
|
||||
| Flash Card / 闪记卡 | 0.2.1 |
|
||||
| Export to Word / 导出为 Word | 0.1.0 |
|
||||
| Export to Excel / 导出为 Excel | 0.3.3 |
|
||||
| Deep Reading & Summary / 精读 | 0.1.0 / 2.0.0 |
|
||||
| Smart Infographic / 智能信息图 | 1.3.0 |
|
||||
|
||||
### Filters
|
||||
|
||||
| Plugin / 插件 | Version / 版本 |
|
||||
|---------------|----------------|
|
||||
| Async Context Compression / 异步上下文压缩 | 1.1.0 |
|
||||
| Context & Model Enhancement Filter | 0.2 |
|
||||
| Gemini Manifold Companion | 1.7.0 |
|
||||
| Gemini 多模态过滤器 | 0.3.2 |
|
||||
|
||||
### Pipes
|
||||
|
||||
| Plugin / 插件 | Version / 版本 |
|
||||
|---------------|----------------|
|
||||
| Gemini Manifold google_genai | 1.26.0 |
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Release Template / 发布模板:
|
||||
|
||||
## [x.x.x] - YYYY-MM-DD
|
||||
|
||||
### Added / 新增
|
||||
- New feature description
|
||||
|
||||
### Changed / 变更
|
||||
- Change description
|
||||
|
||||
### Fixed / 修复
|
||||
- Bug fix description
|
||||
|
||||
### Plugin Updates / 插件更新
|
||||
- `plugin_name`: v0.x.0 -> v0.y.0
|
||||
- Feature 1
|
||||
- Feature 2
|
||||
-->
|
||||
@@ -1,104 +0,0 @@
|
||||
# Markdown Normalizer 插件可靠性修复分析报告 (Issue #57)
|
||||
|
||||
## 1. 问题背景
|
||||
根据 Issue #57 报告,`Markdown Normalizer` 在 v1.2.7 版本中存在数项严重影响可靠性的 Bug,包括错误回滚失效、对内联技术内容的过度转义、配置项不生效以及调试日志潜在的隐私风险。
|
||||
|
||||
## 2. 核心处理流程图 (v1.2.8)
|
||||
以下流程展示了插件如何在确保“不损坏原始内容”的前提下进行智能修复:
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
Start([开始处理内容]) --> Cache[1. 内存中存入原始快照 Snapshot]
|
||||
Cache --> Logic{进入修复流程}
|
||||
|
||||
subgraph "分层保护逻辑 (Context-Aware)"
|
||||
Logic --> Block[识别并锁定 ``` 代码块]
|
||||
Block --> Inline[识别并锁定 ` 行内代码]
|
||||
Inline --> Math[识别并锁定 $ LaTeX 公式]
|
||||
Math --> Clean[仅对非锁定区域执行转义清理]
|
||||
end
|
||||
|
||||
Clean --> Others[执行其他规则: Thought/Details/Table等]
|
||||
Others --> Check{运行是否报错?}
|
||||
|
||||
Check -- 否 (成功) --> Success[返回修复后的内容]
|
||||
Check -- 是 (失败) --> Rollback[触发回滚: 丢弃所有修改]
|
||||
|
||||
Rollback --> Original[返回步骤1存储的原始快照]
|
||||
|
||||
Success --> End([输出结果])
|
||||
Original --> End
|
||||
```
|
||||
|
||||
## 3. 修复项详细说明
|
||||
|
||||
### 2.1 错误回滚机制修复 (Reliability: Error Fallback)
|
||||
- **问题**:在 `normalize` 流程中,如果某个清理器抛出异常,返回的是已被部分修改的 `content`,导致输出内容损坏。
|
||||
- **技术实现**:
|
||||
```python
|
||||
def normalize(self, content: str) -> str:
|
||||
original_content = content # 1. 流程开始前缓存原始快照
|
||||
try:
|
||||
# ... 执行一系列清理步骤 ...
|
||||
return content
|
||||
except Exception as e:
|
||||
# 2. 任何步骤失败,立即记录日志并回滚
|
||||
logger.error(f"Content normalization failed: {e}", exc_info=True)
|
||||
return original_content # 确保返回的是原始快照
|
||||
```
|
||||
- **验证结果**:通过模拟 `RuntimeError` 验证,插件现在能 100% 回滚至原始状态。
|
||||
|
||||
### 2.2 上下文感知的转义保护 (Context-Aware Escaping)
|
||||
- **问题**:全局替换导致正文中包含在 `` ` `` 内的代码片段(如正则、Windows 路径)被破坏。
|
||||
- **技术实现**:
|
||||
重构后的 `_fix_escape_characters` 采用了 **“分词保护策略”**,通过多层嵌套分割来确保仅在非代码上下文中进行清理:
|
||||
```python
|
||||
def _fix_escape_characters(self, content: str) -> str:
|
||||
# 层级 1: 以 ``` 分隔代码块
|
||||
parts = content.split("```")
|
||||
for i in range(len(parts)):
|
||||
is_code_block = (i % 2 != 0)
|
||||
if is_code_block and not self.config.enable_escape_fix_in_code_blocks:
|
||||
continue # 默认跳过代码块
|
||||
|
||||
if not is_code_block:
|
||||
# 层级 2: 在非代码块正文中,以 ` 分隔内联代码
|
||||
inline_parts = parts[i].split("`")
|
||||
for k in range(0, len(inline_parts), 2): # 仅处理非内联代码部分
|
||||
# 层级 3: 在非内联代码中,以 $ 分隔 LaTeX 公式
|
||||
sub_parts = inline_parts[k].split("$")
|
||||
for j in range(0, len(sub_parts), 2):
|
||||
# 最终:仅在确认为“纯文本”的部分执行 clean_text
|
||||
sub_parts[j] = clean_text(sub_parts[j])
|
||||
inline_parts[k] = "$".join(sub_parts)
|
||||
parts[i] = "`".join(inline_parts)
|
||||
else:
|
||||
parts[i] = clean_text(parts[i])
|
||||
return "```".join(parts)
|
||||
```
|
||||
- **验证结果**:测试用例 `Regex: [\n\r]` 和 `C:\Windows` 在正文中保持原样,而普通文本中的 `\\n` 被正确转换。
|
||||
|
||||
### 2.3 配置项激活 (Configuration Enforcement)
|
||||
- **问题**:`enable_escape_fix_in_code_blocks` 开关在代码中被定义但未被逻辑引用。
|
||||
- **修复方案**:在 `_fix_escape_characters` 处理流程中加入对该开关的判断。
|
||||
- **验证结果**:当开关关闭(默认)时,代码块内容保持不变;开启时,代码块内执行转义修复。
|
||||
|
||||
### 2.4 默认日志策略调整 (Privacy & Performance)
|
||||
- **问题**:`show_debug_log` 默认为 `True`,且会将原始内容打印到浏览器控制台。
|
||||
- **修复方案**:将默认值改为 `False`。
|
||||
- **验证结果**:新安装或默认配置下不再主动输出全量日志,仅在用户显式开启时用于调试。
|
||||
|
||||
## 3. 综合测试覆盖
|
||||
已建立 `comprehensive_test_markdown_normalizer.py` 测试脚本,覆盖以下场景:
|
||||
1. **异常抛出回滚**:确保插件“不破坏”原始内容。
|
||||
2. **内联代码保护**:验证正则和路径字符串的完整性。
|
||||
3. **代码块开关控制**:验证配置项的有效性。
|
||||
4. **LaTeX 命令回归测试**:确保 `\times`, `\theta` 等命令不被误触。
|
||||
5. **复杂嵌套结构**:验证包含 Thought 标签、列表、内联代码及代码块的混合文本处理。
|
||||
|
||||
## 4. 结论
|
||||
`Markdown Normalizer v1.2.8` 已解决 Issue #57 提出的所有核心可靠性问题。插件现在具备“不损坏内容”的防御性编程能力,并能更智能地感知 Markdown 上下文。
|
||||
|
||||
---
|
||||
**报告日期**:2026-03-08
|
||||
**修复版本**:v1.2.8
|
||||
@@ -1,12 +0,0 @@
|
||||
# Reply to Issue #57
|
||||
|
||||
I have addressed these issues in **v1.2.8** with a focus on reliability and a "Safe-by-Default" approach:
|
||||
|
||||
1. **Robust Error Rollback (Items 1, 4, 5)**: I implemented a full `try...except` wrapper. If any error occurs during normalization, the plugin now returns the **100% original text**. This ensures that the output is never partially modified or corrupted.
|
||||
2. **Conservative Escaping (Item 2)**: To avoid breaking technical content like regex or paths, the escape fixer now strictly skips all code blocks, inline code, and LaTeX formulas by default. I have shifted toward an "opt-in" model where aggressive cleaning is disabled unless specifically requested.
|
||||
3. **Fixed Configuration (Item 3)**: The `enable_escape_fix_in_code_blocks` Valve was intended to handle escaping within code blocks (e.g., for fixing flat SQL output), but there was a bug preventing it from being applied. I have fixed this, and the setting is now fully functional.
|
||||
4. **Privacy & Reliability**: I have changed the default for `show_debug_log` to `False`. While it was previously enabled by default to help gather feedback and squash bugs during the initial development phase, the plugin has now undergone multiple iterations and reliability enhancements (including the new tiered protection and rollback mechanisms), making it stable enough for a "silent" and private default operation.
|
||||
|
||||
**Recommendation**: If you encounter SQL or data blocks that appear on a single line, you can now manually enable `enable_escape_fix_in_code_blocks` in the Valves to fix them safely.
|
||||
|
||||
Please update to the latest version via [OpenWebUI Community](https://openwebui.com/functions/baaa8732-9348-40b7-8359-7e009660e23c). Thank you for your valuable feedback!
|
||||
@@ -1,99 +0,0 @@
|
||||
# Markdown Normalizer v1.2.8 测试用例集
|
||||
|
||||
您可以将以下内容逐个复制到 OpenWebUI 的聊天框中,以验证插件的各项修复功能。
|
||||
|
||||
---
|
||||
|
||||
## 用例 1:验证 SQL 代码块换行修复 (需要手动开启配置)
|
||||
|
||||
**测试目的**:验证 `enable_escape_fix_in_code_blocks` 开关是否生效。
|
||||
**前提条件**:请先在插件 Valves 设置中将 `enable_escape_fix_in_code_blocks` 设置为 **开启 (True)**。
|
||||
|
||||
**复制以下内容:**
|
||||
```text
|
||||
请帮我美化这段 SQL 的排版,使其恢复正常换行:
|
||||
|
||||
```sql
|
||||
SELECT * \n FROM users \n WHERE status = 'active' \n AND created_at > '2024-01-01' \n ORDER BY id DESC;
|
||||
```
|
||||
```
|
||||
|
||||
**预期效果**:SQL 代码块内的 `\n` 消失,变为整齐的多行 SQL 语句。
|
||||
|
||||
---
|
||||
|
||||
## 用例 2:验证上下文感知保护 (防止误伤技术内容)
|
||||
|
||||
**测试目的**:验证插件是否能准确识别“纯文本”和“代码区域”,只修复该修复的地方。
|
||||
**配置要求**:默认配置即可。
|
||||
|
||||
**复制以下内容:**
|
||||
```text
|
||||
这是一个综合测试用例。
|
||||
|
||||
1. 普通文本修复测试:
|
||||
这是第一行\\n这是第二行(你应该看到这里发生了换行)。
|
||||
|
||||
2. 行内代码保护测试(不应被修改):
|
||||
- 正则表达式:`[\n\r\t]`
|
||||
- Windows 路径:`C:\Windows\System32\drivers\etc\hosts`
|
||||
- 转义测试:`\\n` 应该保持字面量。
|
||||
|
||||
3. LaTeX 命令保护测试:
|
||||
这里的数学公式 $\times \theta \nu \sum$ 应该渲染正常,反斜杠不应被修掉。
|
||||
|
||||
4. 现代 LaTeX 定界符转换:
|
||||
\[ E = mc^2 \]
|
||||
(上面这行应该被自动转换为 $$ 包围的块级公式)
|
||||
```
|
||||
|
||||
**预期效果**:
|
||||
- 第一部分的 `\\n` 成功换行。
|
||||
- 第二部分反引号 `` ` `` 里的内容原封不动。
|
||||
- 第三部分的希腊字母公式渲染正常。
|
||||
- 第四部分的 `\[` 变成了 `$$` 且能正常显示公式。
|
||||
|
||||
---
|
||||
|
||||
## 用例 3:验证思维链与详情标签规范化
|
||||
|
||||
**测试目的**:验证对 `<thought>` 和 `<details>` 标签的排版优化。
|
||||
|
||||
**复制以下内容:**
|
||||
```text
|
||||
<thinking>
|
||||
这是一个正在思考的思维链。
|
||||
</thinking>
|
||||
<details>
|
||||
<summary>点击查看详情</summary>
|
||||
这里的排版通常容易出错。
|
||||
</details>
|
||||
紧接着详情标签的文字(应该和上面有空行隔开)。
|
||||
```
|
||||
|
||||
**预期效果**:
|
||||
- `<thinking>` 标签被统一为 `<thought>`。
|
||||
- `</details>` 标签下方自动注入了空行,防止与正文粘连导致渲染失效。
|
||||
|
||||
---
|
||||
|
||||
## 用例 4:极端压力与回滚测试 (稳定性验证)
|
||||
|
||||
**测试目的**:模拟复杂嵌套环境,验证 100% 回滚机制。
|
||||
|
||||
**复制以下内容:**
|
||||
```text
|
||||
尝试混合所有复杂元素:
|
||||
- 列表项 1
|
||||
- 列表项 2 with `inline \\n code`
|
||||
- $ \text{Math } \alpha $
|
||||
```sql
|
||||
-- SQL with nested issue
|
||||
SELECT 'literal \n string' FROM `table`;
|
||||
```
|
||||
<thought>End of test</thought>
|
||||
```
|
||||
|
||||
**预期效果**:
|
||||
- 无论内部处理逻辑多么复杂,插件都应保证输出稳定的结果。
|
||||
- 如果模拟任何内部崩溃(技术人员可用),消息会回滚至此原始文本,不会导致页面白屏。
|
||||
@@ -1,51 +0,0 @@
|
||||
You are a helpful assistant.
|
||||
|
||||
[Session Context]
|
||||
- **Your Isolated Workspace**: `/app/backend/data/copilot_workspace/user_123/chat_456`
|
||||
- **Active User ID**: `user_123`
|
||||
- **Active Chat ID**: `chat_456`
|
||||
- **Skills Directory**: `/app/backend/data/skills/shared/` — contains user-installed skills.
|
||||
- **Config Directory**: `/app/backend/data/.copilot` — system configuration (Restricted).
|
||||
- **CLI Tools Path**: `/app/backend/data/.copilot_tools/` — Global tools installed via npm or pip will automatically go here and be in your $PATH. Python tools are strictly isolated in a venv here.
|
||||
**CRITICAL INSTRUCTION**: You MUST use the above workspace for ALL file operations.
|
||||
- DO NOT create files in `/tmp` or any other system directories.
|
||||
- Always interpret 'current directory' as your Isolated Workspace.
|
||||
|
||||
[Available Native System Tools]
|
||||
The host environment is rich. Based on the official OpenWebUI Docker deployment baseline (backend image), the following CLI tools are expected to be preinstalled and globally available in $PATH:
|
||||
- **Network/Data**: `curl`, `jq`, `netcat-openbsd`
|
||||
- **Media/Doc**: `pandoc` (format conversion), `ffmpeg` (audio/video)
|
||||
- **Build/System**: `git`, `gcc`, `make`, `build-essential`, `zstd`, `bash`
|
||||
- **Python/Runtime**: `python3`, `pip3`, `uv`
|
||||
- **Verification Rule**: Before installing any CLI/tool dependency, first check availability with `which <tool>` or a lightweight version probe (e.g. `<tool> --version`).
|
||||
- **Python Libs**: The active virtual environment inherits `--system-site-packages`. Advanced libraries like `pandas`, `numpy`, `pillow`, `opencv-python-headless`, `pypdf`, `langchain`, `playwright`, `httpx`, and `beautifulsoup4` are ALREADY installed. Try importing them before attempting to install.
|
||||
|
||||
|
||||
[Mode Context: Plan Mode]
|
||||
You are currently operating in **Plan Mode**.
|
||||
DEFINITION: Plan mode is a collaborative phase to outline multi-step plans or conduct research BEFORE any code is modified.
|
||||
|
||||
<workflow>
|
||||
1. Clarification: If requirements/goals are ambiguous, ask questions.
|
||||
2. Analysis: Analyze the codebase to understand constraints. You MAY use shell commands (e.g., `ls`, `grep`, `find`, `cat`) and other read-only tools.
|
||||
3. Formulation: Generate your structured plan OR research findings.
|
||||
4. Approval: Present the detailed plan directly to the user for approval via chat.
|
||||
</workflow>
|
||||
|
||||
<key_principles>
|
||||
- ZERO CODE MODIFICATION: You must NOT execute file edits, write operations, or destructive system changes. Your permissions are locked to READ/RESEARCH ONLY, with the sole exception of the progress-tracking file `plan.md`.
|
||||
- SHELL USAGE: Shell execution is ENABLED for research purposes. Any attempts to modify the filesystem via shell (e.g., `sed -i`, `rm`) will be strictly blocked, except for appending to `plan.md`.
|
||||
- PURE RESEARCH SUPPORT: If the user requests a pure research report, output your conclusions directly matching the plan style.
|
||||
- PERSISTENCE: You MUST save your proposed plan to `/app/backend/data/.copilot/session-state/chat_456/plan.md` to sync with the UI. The UI automatically reads this file to update the plan view.
|
||||
</key_principles>
|
||||
|
||||
<plan_format>
|
||||
When presenting your findings or plan in the chat, structure it clearly:
|
||||
## Plan / Report: {Title}
|
||||
**TL;DR**: {Summary}
|
||||
**Detailed Tasks / Steps**: {List step-by-step}
|
||||
**Affected Files**:
|
||||
- `path/to/file`
|
||||
**Constraint/Status**: {Any constraints}
|
||||
</plan_format>
|
||||
Acknowledge your role as a planner and format your next response using the plan style above.
|
||||
Reference in New Issue
Block a user