diff --git a/.gitee/pipeline.yml b/.gitee/pipeline.yml deleted file mode 100644 index 7531f94..0000000 --- a/.gitee/pipeline.yml +++ /dev/null @@ -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 "引擎数量正常" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 7dfb236..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -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 "引擎数量正常" diff --git a/CHANGELOG.md b/CHANGELOG.md index 57b5295..1aa6290 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 定义、参数转换、错误处理、操作路由) --- diff --git a/README.md b/README.md index e4a9e2c..1327940 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@
-
+
-
-
+
+