Update llmcore truncation, adb_ui parsing, stapp regex, and subagent docs
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
- 流程:启动 → 轮询 output.txt(`[ROUND END]`=该轮完成)→ 写 reply.txt 继续 → 不写则5min退出
|
||||
- output1/2/3.txt:reply后各轮输出(递增编号),同样append+`[ROUND END]`
|
||||
- input.txt:目标+约束,可指定SOP名。禁写具体步骤(除非已读SOP确认)。大量数据给路径禁塞入
|
||||
- ⚠ `--input`走命令行,长文本/含引号会超时。超过一句话时:先写input.txt,启动时不带`--input`
|
||||
- --bg启动瞬间返回,可同一code_run内sleep后poll;非--bg方式禁止合并启动+轮询
|
||||
|
||||
```python
|
||||
|
||||
Reference in New Issue
Block a user