feat: Brain-Tools fuer Overlay/Sprache + Rechte automatisch per ADB erteilen

1) ARIA hatte KEIN Werkzeug fuer die Einblendung — der Agent kann notify/speak/
   volume laengst, aber im Brain fehlten die Tools. Sie hat deshalb improvisiert
   ('cmd notification post', gibt es auf Android 9 nicht) und ist gescheitert.
   Neu: host_notify (Overlay/Sprache, mode ueberschreibbar), host_speak,
   host_volume — mit dem ausdruecklichen Hinweis, es NICHT ueber adb zu versuchen.
2) _adb_grant_permissions: appops PROJECT_MEDIA (Screenshots ohne Dialog) +
   SYSTEM_ALERT_WINDOW (Overlay) + pm grant RECORD_AUDIO (Mikro) werden beim
   Einrichten automatisch gesetzt — kein Zusammenklicken mit der Fernbedienung
   mehr. Best effort; was scheitert, wird als 'manuell noetig' gemeldet. Neue
   Aktion adb.permissions setzt sie einzeln nach.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 02:37:20 +02:00
co-authored by Claude Opus 4.8
parent ac40afc856
commit 586a2bf134
3 changed files with 118 additions and 4 deletions
+66 -1
View File
@@ -1501,6 +1501,67 @@ META_TOOLS = [
},
},
},
{
"type": "function",
"function": {
"name": "host_notify",
"description": (
"Zeigt eine Nachricht AUF einem Host-Agenten an — bei einem Fire TV / "
"Android TV als EINBLENDUNG ueber dem laufenden Bild (Netflix & Co. "
"laufen weiter), wahlweise als Sprachausgabe. NIMM DIESES TOOL, wenn "
"Stefan etwas 'auf dem Fernseher einblenden/anzeigen' will — versuche "
"das NICHT ueber host_exec/adb (dort gibt es kein passendes Kommando). "
"mode: 'overlay' (einblenden), 'speech' (vorlesen) oder 'both'; ohne "
"Angabe gilt die Einstellung am Geraet. Braucht dort einmalig die "
"Berechtigung 'Ueber anderen Apps anzeigen'."
),
"parameters": {
"type": "object",
"properties": {
"host": {"type": "string", "description": "Host-ID/Name (z.B. 'Fire-TV Schlafzimmer')."},
"text": {"type": "string", "description": "Der anzuzeigende Text."},
"title": {"type": "string", "description": "Ueberschrift (Default 'ARIA')."},
"seconds": {"type": "integer", "description": "Anzeigedauer (Default 12)."},
"mode": {"type": "string", "description": "overlay | speech | both"},
},
"required": ["host", "text"],
},
},
},
{
"type": "function",
"function": {
"name": "host_speak",
"description": (
"Laesst einen Host-Agenten Text laut vorlesen (Fire TV: ueber die "
"Fernseher-Lautsprecher). Fuer reine Sprachansagen; soll es auch/nur "
"sichtbar sein, nimm host_notify."
),
"parameters": {
"type": "object",
"properties": {
"host": {"type": "string", "description": "Host-ID/Name."},
"text": {"type": "string", "description": "Was gesprochen werden soll."},
},
"required": ["host", "text"],
},
},
},
{
"type": "function",
"function": {
"name": "host_volume",
"description": "Setzt die Medien-Lautstaerke eines Host-Agenten (Fire TV / Android).",
"parameters": {
"type": "object",
"properties": {
"host": {"type": "string", "description": "Host-ID/Name."},
"percent": {"type": "integer", "description": "0-100."},
},
"required": ["host", "percent"],
},
},
},
{
"type": "function",
"function": {
@@ -2864,6 +2925,9 @@ class Agent:
"host_ui_swipe": ("ui_swipe", ["x1", "y1", "x2", "y2", "duration_ms"]),
"host_ui_key": ("ui_key", ["key"]),
"host_app_launch": ("app_launch", ["package", "query", "command"]),
"host_notify": ("notify", ["text", "title", "seconds", "mode"]),
"host_speak": ("speak", ["text"]),
"host_volume": ("volume", ["percent"]),
}
if name in _UI_ACTIONS:
action, keys = _UI_ACTIONS[name]
@@ -3674,7 +3738,8 @@ class Agent:
if name in ("host_list", "host_exec", "host_read", "host_write",
"host_info", "host_screenshot", "host_ui_dump",
"host_ui_tap", "host_ui_text", "host_ui_swipe",
"host_ui_key", "host_app_launch"):
"host_ui_key", "host_app_launch",
"host_notify", "host_speak", "host_volume"):
return self._dispatch_host(name, arguments)
if name == "vm_register":
pid = (project_id or "").strip()