!4 chore: 清理仓库,删除不需要的文件
Merge pull request !4 from shuiyu1123/cleanup-v5.1.4
This commit is contained in:
7 files changed
+51
-298
No files matched your search
@@ -1,117 +0,0 @@
|
||||
# Gitee Go CI 流水线
|
||||
|
||||
triggers:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
|
||||
stages:
|
||||
- lint
|
||||
- test
|
||||
- structure
|
||||
|
||||
jobs:
|
||||
py-compile:
|
||||
name: 语法检查
|
||||
stage: lint
|
||||
image: python:3.12
|
||||
script:
|
||||
- python -c "
|
||||
import py_compile, os, sys;
|
||||
errors = 0;
|
||||
for root, dirs, files in os.walk('.'):
|
||||
dirs[:] = [d for d in dirs if d not in {'.git', '__pycache__', 'node_modules', 'embedded_python'}];
|
||||
for f in files:
|
||||
if f.endswith('.py'):
|
||||
path = os.path.join(root, f);
|
||||
try:
|
||||
py_compile.compile(path, doraise=True);
|
||||
except py_compile.PyCompileError as e:
|
||||
print(f'ERROR: {e}');
|
||||
errors += 1;
|
||||
if errors:
|
||||
print(f'{errors} 个文件有语法错误');
|
||||
sys.exit(1);
|
||||
print('所有文件语法正确')
|
||||
"
|
||||
|
||||
ruff-lint:
|
||||
name: Ruff lint
|
||||
stage: lint
|
||||
image: python:3.12
|
||||
script:
|
||||
- pip install ruff -q
|
||||
- ruff check . --select E,F,W --ignore E501,E402 --exclude .git,__pycache__,embedded_python
|
||||
|
||||
pytest-310:
|
||||
name: 插件测试 (Python 3.10)
|
||||
stage: test
|
||||
image: python:3.10
|
||||
script:
|
||||
- pip install pytest colorama -q
|
||||
- pytest tests/ -v --tb=short
|
||||
|
||||
pytest-311:
|
||||
name: 插件测试 (Python 3.11)
|
||||
stage: test
|
||||
image: python:3.11
|
||||
script:
|
||||
- pip install pytest colorama -q
|
||||
- pytest tests/ -v --tb=short
|
||||
|
||||
pytest-312:
|
||||
name: 插件测试 (Python 3.12)
|
||||
stage: test
|
||||
image: python:3.12
|
||||
script:
|
||||
- pip install pytest colorama -q
|
||||
- pytest tests/ -v --tb=short
|
||||
|
||||
structure:
|
||||
name: 项目结构检查
|
||||
stage: structure
|
||||
image: python:3.12
|
||||
script:
|
||||
- echo "检查项目结构..."
|
||||
- |
|
||||
files=(
|
||||
"ai_cli.py"
|
||||
"launcher.py"
|
||||
"xcli_core/cli_core.py"
|
||||
"xcli_core/cli_base.py"
|
||||
"xcli_core/config.py"
|
||||
"xcli_core/constants.py"
|
||||
"ai_engines/ollama_engine.py"
|
||||
"ai_engines/openai_engine.py"
|
||||
"plugins/code_editor.py"
|
||||
"plugins/cmd_executor.py"
|
||||
"plugins/file_manager.py"
|
||||
"plugins/auto_engineer.py"
|
||||
)
|
||||
missing=0
|
||||
for f in "${files[@]}"; do
|
||||
if [ -f "$f" ]; then
|
||||
echo " ✓ $f"
|
||||
else
|
||||
echo " ✗ $f (缺失!)"
|
||||
missing=$((missing + 1))
|
||||
fi
|
||||
done
|
||||
if [ $missing -gt 0 ]; then
|
||||
echo "${missing} 个文件缺失"
|
||||
exit 1
|
||||
fi
|
||||
echo "项目结构完整"
|
||||
- |
|
||||
engines=$(ls ai_engines/*_engine.py 2>/dev/null | wc -l)
|
||||
echo "AI 引擎数量: $engines"
|
||||
if [ "$engines" -gt 2 ]; then
|
||||
echo "警告: 引擎数量超过 2 个"
|
||||
exit 1
|
||||
fi
|
||||
echo "引擎数量正常"
|
||||
@@ -1,148 +0,0 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master, main]
|
||||
pull_request:
|
||||
branches: [master, main]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: 代码检查
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: 安装 Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: 安装依赖
|
||||
run: pip install ruff
|
||||
|
||||
- name: 语法检查 (py_compile)
|
||||
run: |
|
||||
python -c "
|
||||
import py_compile, os, sys
|
||||
errors = 0
|
||||
for root, dirs, files in os.walk('.'):
|
||||
dirs[:] = [d for d in dirs if d not in {'.git', '__pycache__', 'node_modules', 'embedded_python'}]
|
||||
for f in files:
|
||||
if f.endswith('.py'):
|
||||
path = os.path.join(root, f)
|
||||
try:
|
||||
py_compile.compile(path, doraise=True)
|
||||
except py_compile.PyCompileError as e:
|
||||
print(f'ERROR: {e}')
|
||||
errors += 1
|
||||
if errors:
|
||||
print(f'\n{errors} 个文件有语法错误')
|
||||
sys.exit(1)
|
||||
print('所有文件语法正确')
|
||||
"
|
||||
|
||||
- name: Ruff lint
|
||||
run: ruff check . --select E,F,W --ignore E501,E402,W503 --exclude .git,__pycache__,embedded_python
|
||||
|
||||
test:
|
||||
name: 插件测试
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.10", "3.11", "3.12"]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: 安装 Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: 安装测试依赖
|
||||
run: pip install pytest colorama
|
||||
|
||||
- name: 运行测试
|
||||
run: pytest tests/ -v --tb=short
|
||||
|
||||
structure:
|
||||
name: 项目结构检查
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: 安装 Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: 检查必要文件
|
||||
run: |
|
||||
echo "检查项目结构..."
|
||||
files=(
|
||||
"ai_cli.py"
|
||||
"launcher.py"
|
||||
"xcli_core/cli_core.py"
|
||||
"xcli_core/cli_base.py"
|
||||
"xcli_core/config.py"
|
||||
"xcli_core/constants.py"
|
||||
"ai_engines/ollama_engine.py"
|
||||
"ai_engines/openai_engine.py"
|
||||
"plugins/code_editor.py"
|
||||
"plugins/git_tools.py"
|
||||
"plugins/cmd_executor.py"
|
||||
"plugins/file_manager.py"
|
||||
"plugins/auto_engineer.py"
|
||||
)
|
||||
missing=0
|
||||
for f in "${files[@]}"; do
|
||||
if [ -f "$f" ]; then
|
||||
echo " $f"
|
||||
else
|
||||
echo " $f (缺失!)"
|
||||
missing=$((missing + 1))
|
||||
fi
|
||||
done
|
||||
if [ $missing -gt 0 ]; then
|
||||
echo "\n${missing} 个文件缺失"
|
||||
exit 1
|
||||
fi
|
||||
echo "\n项目结构完整"
|
||||
|
||||
- name: 检查旧文件已清理
|
||||
run: |
|
||||
old_files=(
|
||||
"ai_engines/mimo_engine.py"
|
||||
"ai_engines/GLM_http_engine.py"
|
||||
"ai_engines/qwq_engine.py"
|
||||
"ai_engines/xfyun_spark_engine.py"
|
||||
"ai_engines/iflow_api_engine.py"
|
||||
"ai_engines/maas_http_engine.py"
|
||||
"ai_engines/SDK_openAI.py"
|
||||
"plugins/git_workflow.py"
|
||||
"plugins/code_search.py"
|
||||
"plugins/project_analyzer.py"
|
||||
"plugins/scheduler.py"
|
||||
)
|
||||
found=0
|
||||
for f in "${old_files[@]}"; do
|
||||
if [ -f "$f" ]; then
|
||||
echo " 旧文件未清理: $f"
|
||||
found=$((found + 1))
|
||||
fi
|
||||
done
|
||||
if [ $found -gt 0 ]; then
|
||||
echo "\n${found} 个旧文件未清理"
|
||||
exit 1
|
||||
fi
|
||||
echo "旧文件已全部清理"
|
||||
|
||||
- name: 检查无重复引擎
|
||||
run: |
|
||||
engines=$(ls ai_engines/*_engine.py 2>/dev/null | wc -l)
|
||||
echo "AI 引擎数量: $engines"
|
||||
if [ "$engines" -gt 2 ]; then
|
||||
echo "警告: 引擎数量超过 2 个 (ollama + openai)"
|
||||
exit 1
|
||||
fi
|
||||
echo "引擎数量正常"
|
||||
+31
-13
@@ -7,23 +7,41 @@
|
||||
## v5.1.4 (2026-04-29)
|
||||
|
||||
### 新增功能
|
||||
- **桌面GUI自动化插件** (`gui_auto`) — 基于 Windows UI Automation (UIA) API,实现屏幕 UI 元素识别与操控,20 个操作
|
||||
- **元素树获取** (`snapshot`) — 获取整个屏幕或指定窗口的 UI 元素树,支持自定义遍历深度
|
||||
- **元素交互** — 点击/右键/双击元素(支持名称模糊匹配和坐标点击)
|
||||
- **文本输入** — 在指定元素中输入文本,支持中文 Unicode 输入,自动尝试 ValuePattern
|
||||
- **按键发送** — 发送键盘快捷键和单个按键,支持组合键(如 Ctrl+S)
|
||||
- **窗口管理** — 列出所有窗口、聚焦指定窗口
|
||||
- **元素查询** — 查找/查找所有/获取详情/获取值/子树遍历/检查存在/获取状态
|
||||
- **高级功能** — 等待元素出现(带超时)、高亮闪烁元素(GDI 绘制红色边框)
|
||||
- **MCP/FC 完整支持** — 实现 `get_mcp_definition()` + `convert_mcp_args()`,可被 AI 通过 Function Calling 直接调用
|
||||
- **跨平台安全** — 非 Windows 环境下优雅降级,给出清晰错误提示
|
||||
|
||||
- **桌面GUI自动化插件** (`gui_auto`, 20 操作) — 基于 Windows UI Automation (UIA) API,AI 可识别和操控桌面应用
|
||||
- 元素树获取 (`snapshot`) — 获取整个屏幕或指定窗口的 UI 元素树,支持自定义遍历深度
|
||||
- 元素交互 — 点击/右键/双击(名称模糊匹配 + 坐标点击),文本输入(中文 Unicode)、清空、发送按键
|
||||
- 窗口管理 — 列出所有窗口 (`windows`)、聚焦指定窗口 (`focus`)
|
||||
- 元素查询 — 查找/查找所有/详情/值/子树/存在检查/状态,共 8 个查询操作
|
||||
- 高级功能 — 等待元素出现(带超时)、高亮闪烁元素(GDI 红色边框)、滚动
|
||||
- MCP/FC 完整定义,AI 通过 Function Calling 直接调用,非 Windows 环境优雅降级
|
||||
|
||||
- **AI 生图插件** (`ai_image`) — 基于 ai.2x.nz 自然语言生图接口
|
||||
- 自然语言描述 + 直接 Tag 双模式
|
||||
- 工作流切换、画风选择、分辨率调整
|
||||
- 异步生成 + WebSocket 进度推送
|
||||
- 生成历史记录
|
||||
|
||||
- **Web UI 后端** (`webui_server.py`) — WebSocket 实时通信 + 静态文件服务
|
||||
- 纯 Python 实现,基于 `websockets` 库
|
||||
- 支持命令行参数 (`--port` / `--host`)
|
||||
- 与前端 `webui.html` 配合,提供完整的浏览器端 AI 交互体验
|
||||
|
||||
### 改进
|
||||
|
||||
- **Web UI 前端重写** (`webui.html`) — 从纯静态页面升级为 WebSocket 实时交互
|
||||
- 大厂设计感 UI,响应式布局
|
||||
- 实时消息流、打字机效果
|
||||
- 支持工具调用结果展示
|
||||
|
||||
### 文档
|
||||
- 更新 README.md 插件列表:17 个 → 18 个
|
||||
- 更新操作数:141+ → 160+
|
||||
- 更新 badge: plugins 17 → 18
|
||||
|
||||
- 更新 README.md: 插件列表、项目结构、badge 版本号
|
||||
- 更新 CHANGELOG.md: v5.1.4 完整变更记录
|
||||
- 更新 HELP.md: 新增 GUI 自动化使用说明
|
||||
|
||||
### 测试
|
||||
|
||||
- 新增 gui_auto 插件 30 个单元测试(工具信息、MCP 定义、参数转换、错误处理、操作路由)
|
||||
|
||||
---
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img src="https://img.shields.io/badge/version-5.1.3-blue" alt="version">
|
||||
<img src="https://img.shields.io/badge/version-5.1.4-blue" alt="version">
|
||||
<img src="https://img.shields.io/badge/python-3.10+-green" alt="python">
|
||||
<img src="https://img.shields.io/badge/license-MIT-orange" alt="license">
|
||||
<img src="https://img.shields.io/badge/tests-113%20passed-brightgreen" alt="tests">
|
||||
<img src="https://img.shields.io/badge/plugins-18-blueviolet" alt="plugins">
|
||||
<img src="https://img.shields.io/badge/tests-150+%20passed-brightgreen" alt="tests">
|
||||
<img src="https://img.shields.io/badge/plugins-19-blueviolet" alt="plugins">
|
||||
<img src="https://img.shields.io/badge/MCP-supported-brightgreen" alt="mcp">
|
||||
</p>
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
- **Clawli 远程模式** — PC-手机 WebSocket 双向通信,支持内网穿透代理
|
||||
- **定时任务** — 支持相对时间、绝对时间、重复任务,到期自动激活 AI
|
||||
- **系统通知** — 跨平台任务完成通知(Windows / macOS / Linux)
|
||||
- **MCP 协议** — 18 个插件全部实现 MCP 定义,支持 Function Calling 原生调用
|
||||
- **18 个插件 160+ 个操作** — 代码编辑、Git、浏览器、工程化、文件管理、图像生成、记忆、桌面GUI自动化等
|
||||
- **MCP 协议** — 19 个插件全部实现 MCP 定义,支持 Function Calling 原生调用
|
||||
- **19 个插件 161+ 个操作** — 代码编辑、Git、浏览器、工程化、文件管理、图像生成、记忆、桌面GUI自动化等
|
||||
- **三模式界面** — TUI 图形化 + 传统命令行 + **Web UI 浏览器界面**
|
||||
- **113 个自动化测试** — pytest 覆盖全部插件和核心模块
|
||||
- **150+ 个自动化测试** — pytest 覆盖全部插件和核心模块
|
||||
|
||||
## 快速开始
|
||||
|
||||
@@ -87,7 +87,7 @@ launcher.exe
|
||||
}
|
||||
```
|
||||
|
||||
## 插件列表 (18 个)
|
||||
## 插件列表 (19 个)
|
||||
|
||||
### 核心生产力
|
||||
|
||||
@@ -107,6 +107,7 @@ launcher.exe
|
||||
| `sub_agent` | 8 | 子 Agent 系统。spawn/list/status/result/send/kill,多 Agent 并行协作 |
|
||||
| `browser_auto` | 28 | 浏览器自动化。导航/点击/填写/截图/JS执行/PDF/cookies(基于 Playwright) |
|
||||
| `gui_auto` | 20 | **桌面GUI自动化**。基于 Windows UIA,屏幕元素识别/点击/输入/截图/元素树遍历(仅Windows) |
|
||||
| `ai_image` | — | **AI生图**。基于 ai.2x.nz 自然语言生图,异步生成 + WebSocket 进度推送 |
|
||||
| `image_generator` | 7 | **图像生成**。基于 ComfyUI 在线服务,自然语言/Tag 双模式,28 个角色工作流 |
|
||||
| `memory_plugin` | 11 | **记忆系统**。AI 写日记/搜索记忆/管理聊天记录/长期记忆 MEMORY.md |
|
||||
| `scheduler` | 4 | **定时任务**。支持相对时间/绝对时间/重复任务,到期自动激活 AI |
|
||||
@@ -187,7 +188,7 @@ memory_plugin chat_search 图像生成
|
||||
|
||||
## MCP 协议支持
|
||||
|
||||
所有 18 个插件均实现 MCP (Model Context Protocol) 定义,支持三种工具调用协议:
|
||||
所有 19 个插件均实现 MCP (Model Context Protocol) 定义,支持三种工具调用协议:
|
||||
|
||||
| 协议 | 说明 |
|
||||
|------|------|
|
||||
@@ -217,12 +218,17 @@ memory_plugin chat_search 图像生成
|
||||
|
||||
## Web UI
|
||||
|
||||
纯静态 HTML 界面,无需后端,浏览器直接打开。
|
||||
WebSocket 实时交互界面,支持完整的 AI 对话体验。
|
||||
|
||||
```bash
|
||||
# 方式 1: 启动 WebSocket 后端(推荐)
|
||||
python webui_server.py --port 8080
|
||||
# 浏览器访问 http://localhost:8080
|
||||
|
||||
# 方式 2: 直接打开静态页面(功能有限)
|
||||
start webui.html # Windows
|
||||
open webui.html # macOS
|
||||
xdg-open webui.html # Linux
|
||||
start webui.html # Windows
|
||||
```
|
||||
|
||||
## 项目结构
|
||||
@@ -230,7 +236,8 @@ start webui.html # Windows
|
||||
```
|
||||
xiaoli-cli/
|
||||
├── ai_cli.py # 主入口
|
||||
├── webui.html # Web UI 界面 (纯静态 HTML)
|
||||
├── webui.html # Web UI 界面 (WebSocket 实时交互)
|
||||
├── webui_server.py # Web UI 后端 (WebSocket + 静态文件服务)
|
||||
├── launcher.py # 智能启动器(自动检测环境/安装依赖)
|
||||
├── config.json.example # 配置模板
|
||||
├── easter_egg.py # 彩蛋
|
||||
@@ -257,7 +264,7 @@ xiaoli-cli/
|
||||
│ ├── ollama_engine.py # Ollama 本地模型
|
||||
│ └── openai_engine.py # OpenAI 兼容格式
|
||||
│
|
||||
├── plugins/ # 插件 (18 个)
|
||||
├── plugins/ # 插件 (19 个)
|
||||
│ ├── code_editor.py # 代码编辑+搜索 (24 操作)
|
||||
│ ├── git_tools.py # Git 版本控制 (17 操作)
|
||||
│ ├── cmd_executor.py # Shell 命令执行
|
||||
@@ -267,6 +274,7 @@ xiaoli-cli/
|
||||
│ ├── sub_agent.py # 子 Agent 系统 (8 操作)
|
||||
│ ├── browser_auto.py # 浏览器自动化 (28 操作)
|
||||
│ ├── gui_auto.py # 桌面GUI自动化 (20 操作) ⭐ NEW
|
||||
│ ├── ai_image.py # AI生图 (ai.2x.nz) ⭐ NEW
|
||||
│ ├── image_generator.py # 图像生成 (7 操作) ⭐ NEW
|
||||
│ ├── memory_plugin.py # 记忆系统 (11 操作) ⭐ NEW
|
||||
│ ├── scheduler.py # 定时任务
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
Line 1
|
||||
MODIFIED LINE
|
||||
Line 3
|
||||
@@ -1,5 +0,0 @@
|
||||
Line 1
|
||||
REPLACED LINE 2
|
||||
Line 3
|
||||
REPLACED LINE 4
|
||||
Line 5
|
||||
Binary file not shown.
Reference in new issue
Block a user