Update llmcore truncation, adb_ui parsing, stapp regex, and subagent docs

This commit is contained in:
Liang Jiaqing
2026-04-09 18:43:20 +08:00
parent 6628a3d987
commit 2977be33c6
4 changed files with 40 additions and 30 deletions

View File

@@ -42,7 +42,7 @@ def _parse_xml(xml_str, keyword=None, clickable_only=False, raw=False):
cls = n.get("class", "").split(".")[-1]
rid = n.get("resource-id", "")
label = text or desc
if not label and not raw: continue
if not label and not click and not raw: continue
if clickable_only and not click: continue
if keyword and keyword.lower() not in label.lower(): continue
cx, cy = 0, 0
@@ -51,8 +51,8 @@ def _parse_xml(xml_str, keyword=None, clickable_only=False, raw=False):
if len(m) == 2:
cx = (int(m[0][0]) + int(m[1][0])) // 2
cy = (int(m[0][1]) + int(m[1][1])) // 2
nodes.append({"text": text or desc, "click": click,
"bounds": bounds, "cx": cx, "cy": cy, "class": cls, "id": rid})
edit = cls == "EditText"
nodes.append({"text": text or desc, "click": click, "edit": edit, "cx": cx, "cy": cy, "cls": cls, "rid": rid})
return nodes
def ui(keyword=None, clickable_only=False, raw=False):
@@ -66,9 +66,13 @@ def ui(keyword=None, clickable_only=False, raw=False):
nodes = _parse_xml(xml_str, keyword, clickable_only, raw)
if not raw:
for n in nodes:
flag = "Y" if n["click"] else " "
flag = "E" if n.get("edit") else ("Y" if n["click"] else " ")
coord = f"({n['cx']},{n['cy']})" if n['cx'] else ""
print(f"[{flag}] {n['text']} {coord} {n['bounds']}")
display_text = n['text']
if not display_text:
hint = n.get('rid', '').split('/')[-1] or n.get('cls', 'icon')
display_text = f"<{hint}>"
print(f"[{flag}] {display_text} {coord}")
print(f"\ntotal: {len(nodes)} nodes")
return nodes

View File

@@ -9,6 +9,7 @@
- 流程:启动 → 轮询 output.txt`[ROUND END]`=该轮完成)→ 写 reply.txt 继续 → 不写则5min退出
- output1/2/3.txtreply后各轮输出递增编号同样append+`[ROUND END]`
- input.txt目标+约束可指定SOP名。禁写具体步骤除非已读SOP确认。大量数据给路径禁塞入
-`--input`走命令行,长文本/含引号会超时。超过一句话时先写input.txt启动时不带`--input`
- --bg启动瞬间返回可同一code_run内sleep后poll非--bg方式禁止合并启动+轮询
```python