v0.7: 以 AALC 为底座重建 MCP server

Browse Source
- AALC 作为 submodule (vendor/aalc @ 7452fad), 不改其代码
- 低层工具走 AALC auto/ocr/模板匹配; 高层 run_task 跑 AALC 现成流程(子进程, 可强杀)
- 常驻服务跑在交互桌面会话 + stdio bridge (token 认证), 取代每次截图注册计划任务
- 删除自写的截图/输入/OCR 后端
- 测试: FakeEngine 覆盖协议、任务生命周期、TCP+bridge 端到端

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
yws
2026-10-02 01:39:06 +00:00
co-authored by Claude Opus 5.5
parent 809a7fb017
commit a4b27f991c
31 changed files with 1179 additions and 1557 deletions
+37
View File
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
"""测试用引擎: 屏幕内容由测试脚本预设, 记录所有输入动作。"""
from .engine import Engine
class FakeEngine(Engine):
def __init__(self, frames=None, images=None):
# frames: 每次 ocr() 依次返回的 items 列表; 用完后停在最后一帧
self.frames = list(frames or [[]])
self.images = dict(images or {}) # name -> (x, y)
self.actions = []
self.shots = 0
def screenshot(self):
self.shots += 1
return {'path': 'fake/shot_%d.png' % self.shots, 'w': 1920, 'h': 1080}
def ocr(self):
shot = self.screenshot()
items = self.frames.pop(0) if len(self.frames) > 1 else self.frames[0]
return shot, [dict(it, score=it.get('score', 0.99)) for it in items]
def find_image(self, name, threshold=0.8, model='normal'):
return self.images.get(name)
def list_images(self, prefix=''):
return sorted(n for n in self.images if n.startswith(prefix))
def click(self, x, y, times=1):
self.actions.append(('click', int(x), int(y), int(times)))
def keypress(self, key):
self.actions.append(('key', key))
def type_text(self, text):
self.actions.append(('type', text))