mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 21:06:09 +00:00
feat(agent): an Agent tab, a session drawer page, and a bubble over the game (#2376)
* feat(agent): an Agent tab in the launcher that talks to Claude Code outside any session * feat(agent): the agent in the session drawer and as a bubble over the game * fix(agent): connect loopback adb, show unread replies, and fit the drawer page to the screen * feat(agent): first-run setup in the Agent tab, a harness choice with Codex, and no permission prompts * fix(agent): install helpers off the main thread and offer sign-in only after the install * fix(agent): connect adb only for commands that use it and run setup checks one at a time * fix(agent): show why a setup check failed * fix(agent): each harness has its own setup state and conversation * fix(agent): start the adb server before connecting and retry the connection check * fix(agent): switching harness clears the previous harness's setup results * feat(agent): a header, a composer with send and stop, and Markdown replies in the agent chat * fix(agent): leave room under the chat composer * feat(agent): continue the conversation after a Lab build restarts the app * feat(agent): show and remove what the agent stores in the Linux userland * fix(agent): the build tools take about 5 GB * feat(agent): DroidDeck opens on the Agent tab after restarting on a Lab build * feat(agent): conversation history, model and plan mode, live replies, full tool input and output, processes, attachments, queued messages and a Stop that ends the turn * fix(agent): check the Lab build less often while nothing is happening * fix(agent): an old Lab build's progress is not shown as a failure, and a restart counts as success * feat(agent): rebuild a kept Lab build from Updates, and tidy the chat's tool rows, costs, processes and times * feat(agent): a setup step that prepares fast Lab builds for the installed version, kept alive while it runs * fix(agent): the notification names a prepare and shows its percent without repeating the title * fix(agent): run the agent's Lab builds in the app's own process and continue the conversation that asked after the restart * fix(agent): setup's prepare runs the build itself instead of handing it to the app * feat(agent): a turn that ends without a reply says so and offers Retry, the resume is retried once, and each turn's raw output is kept * fix(agent): keep the previous turn's raw output too * fix(agent): a resumed Claude Code turn no longer ends at the result for a background task the last run left behind * fix(agent): install Codex's code-mode host with it, without which Codex runs no commands * feat(agent): setup and storage collapse into a summary card like Setup's, and Codex tool rows show the command without its shell wrapper * feat(agent): drop the agent bubble over sessions for now; the drawer keeps the agent * fix(agent): the Agent tab shows once the Linux runtime is downloaded, even while its proot pack is still being fetched * fix(agent): before the install brings adb, the connection step checks the app's own pairing instead of failing with adb not found * fix(agent): proot's binding warnings are not shown as a setup step's reason * fix(agent): the session drawer's Agent page fills the height under the drawer's header instead of a guess from the screen height * fix(agent): write the browser and GitHub helpers before every setup step, not only the install * fix(agent): find Wireless debugging's current port when the saved one no longer answers, so sign-ins open the browser after it restarts * fix(agent): only take a Wireless debugging port that answers, since mDNS can still advertise an old one * fix(agent): find a loopback Wireless debugging port by scanning when mDNS advertises none * fix(agent): keep a Codex turn going through reconnect notices and read gh login's status reliably * fix(agent): time out hung setup checks and keep their results and actions with their harness * fix(agent): keep the draft across settings and show the Agent tab once the runtime installs * fix(agent): keep the backslash when quoting apostrophes in a URL the browser helper opens * fix(agent): refresh apt's package lists before installing, since a fresh Linux runtime ships without them * fix(agent): sign-in links open through the app itself, so they work without Wireless debugging * fix(agent): the connection step passes only when adb really reaches the device, not on adb's own error * fix(agent): say Wireless debugging isn't reachable instead of adb's error * fix(agent): keep prompts, tool ids, attachments and retries with their own turn and chat * fix(agent): the service stops only once foreground, and Rebuild waits for a ready agent * fix(agent): the Codex install says what it is downloading, so a long download doesn't look stuck * fix(agent): pass the prompt to both CLIs the way they were tested on devices * fix(agent): the browser helper uses the running app's files directory, falls back to adb when the app cannot open a link, and the link is not logged
This commit is contained in:
1 parent
61031e3c4b
commit
db933e4232
33 files changed
+3210
-13
No files matched your search
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
# Opens a URL in Android's browser on the display the agent is being used on ($DD_BROWSER_DISPLAY).
|
||||
# DroidDeck opens what is left in $DD_AGENT_INBOX/open-url; adb is the fallback when it cannot.
|
||||
url=$1
|
||||
[ -n "$url" ] || exit 1
|
||||
inbox=${DD_AGENT_INBOX:-/data/user/0/com.droiddeck.launcher/files/agent}
|
||||
rm -f "$inbox/open-url.failed" 2>/dev/null
|
||||
if [ -d "$inbox" ] && printf '%s\n' "$url" > "$inbox/open-url.part" && mv -f "$inbox/open-url.part" "$inbox/open-url"; then
|
||||
i=0
|
||||
while [ $i -lt 30 ] && [ -e "$inbox/open-url" ]; do
|
||||
sleep 0.2
|
||||
i=$((i + 1))
|
||||
done
|
||||
if [ -e "$inbox/open-url" ]; then
|
||||
rm -f "$inbox/open-url"
|
||||
elif [ -e "$inbox/open-url.failed" ]; then
|
||||
rm -f "$inbox/open-url.failed"
|
||||
else
|
||||
sleep 0.3
|
||||
[ -e "$inbox/open-url.failed" ] && rm -f "$inbox/open-url.failed" || exit 0
|
||||
fi
|
||||
fi
|
||||
serial=${ADB_SERIAL:-127.0.0.1:5555}
|
||||
adb connect "$serial" >/dev/null 2>&1
|
||||
quoted=$(printf "%s" "$url" | sed "s/'/'\\\\''/g")
|
||||
adb -s "$serial" shell "am start --display ${DD_BROWSER_DISPLAY:-0} -a android.intent.action.VIEW -d '$quoted'" >/dev/null 2>&1 ||
|
||||
echo "Open this on any device: $url" >&2
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
# GitHub sign-in through Android's browser, with the one-time code typed in for the person.
|
||||
serial=${ADB_SERIAL:-127.0.0.1:5555}
|
||||
display=${DD_BROWSER_DISPLAY:-0}
|
||||
adb connect "$serial" >/dev/null 2>&1
|
||||
coproc GH { BROWSER=true gh auth login --hostname github.com --git-protocol https --web 2>&1; }
|
||||
# bash drops GH and GH_PID once gh exits, which can be before the loop reads its last line.
|
||||
ghpid=$GH_PID
|
||||
exec {ghout}<&"${GH[0]}" {ghin}>&"${GH[1]}"
|
||||
typed=
|
||||
while IFS= read -r line <&"$ghout"; do
|
||||
printf '%s\n' "$line"
|
||||
code=$(grep -oE '[A-Z0-9]{4}-[A-Z0-9]{4}' <<<"$line" | head -1)
|
||||
if [ -n "$code" ] && [ -z "$typed" ]; then
|
||||
typed=1
|
||||
echo >&"$ghin"
|
||||
adb -s "$serial" shell "am start --display $display -a android.intent.action.VIEW -d https://github.com/login/device" >/dev/null 2>&1
|
||||
# Chrome drops characters from `input text` and from fast key events on this page.
|
||||
keys=
|
||||
for ((i = 0; i < ${#code}; i++)); do
|
||||
c=${code:i:1}
|
||||
[ "$c" = - ] || keys+="input -d $display keyevent KEYCODE_$c; sleep 0.4; "
|
||||
done
|
||||
(sleep 7; adb -s "$serial" shell "$keys" >/dev/null 2>&1) &
|
||||
fi
|
||||
done
|
||||
wait "$ghpid"
|
||||
Reference in new issue
Block a user