lc-mcp v0.5: 语义化操控(MCP stdio) — OCR文本化+语义点击, win/linux/mac 截图与输入后端

Browse Source
This commit is contained in:
yws
2026-10-01 16:37:33 +00:00
commit 0db14040b7
15 changed files with 1124 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
"""输入后端接口。每种后端实现同一套动作:click/move/keypress/type_text。"""
from abc import ABC, abstractmethod
class InputBackend(ABC):
@abstractmethod
def click(self, x, y, button='left', clicks=1):
...
@abstractmethod
def move(self, x, y):
...
@abstractmethod
def keypress(self, key):
...
@abstractmethod
def type_text(self, text):
...
def backend_factory(name, **kwargs):
if name == 'mock':
from .mock import MockBackend
return MockBackend(**kwargs)
if name == 'sendinput':
from .sendinput_win import SendInputBackend
return SendInputBackend(**kwargs)
if name == 'interception':
from .interception_win import InterceptionBackend
return InterceptionBackend(**kwargs)
raise ValueError('unknown backend: %s' % name)