app
Pup - the AI's own browser
Public Made by Adomby adom
pup gives your AI a real browser on your desktop that it drives completely, in the background, signed in as you: windows that never jump in front of your work, one shared profile that learns your logins, and every window labeled on the taskbar with its AI thread's name.
← Commit history
selftest T10: foreground-steal guard for #56 (focus a window we own, cold the dashboard profile, assert a cold pup_dashboard never changes the foreground)
1 file changed
+20
tools/selftest.sh+20@@ -124,6 +124,26 @@ timeout 60 $CLI pup_configure '{"overlayBadges":"off"}' >/dev/null 2>&1; sleep 6 timeout 60 $CLI pup_configure '{"overlayBadges":"on"}' >/dev/null 2>&1 ok "toggle roundtrip issued (verify pixels per the skill before claiming to John)" +echo "== T10 FOREGROUND STEAL (#56 guard): a COLD pup_dashboard must not take focus =="+# #56 was reported live (a window jumped in front of John while he typed) and no longer reproduces,+# so this check exists to make sure it cannot come back quietly. Focus a window WE own, cold the+# dashboard profile, call pup_dashboard as an AI caller, and assert the focused window never changed.+timeout 90 $CLI pup_close_window '{"sessionId":"pup-dashboard"}' >/dev/null 2>&1+timeout 60 $CLI shell_execute '{"command":"powershell -NoProfile -Command \"Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -like \\\"*pup-dashboard*\\\" } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force }\"","reason":"selftest T10: cold the dashboard profile so the launch is a genuine cold start"}' >/dev/null 2>&1+timeout 120 $CLI pup_open_window '{"sessionId":"st-fg","url":"https://example.com","foreground":false}' >/dev/null 2>&1+sleep 4+timeout 90 $CLI pup_raise_os_window '{"sessionId":"st-fg","foregroundReason":"selftest T10 guard for issue 56: this window must remain focused across a cold dashboard launch"}' >/dev/null 2>&1+sleep 3+FG_BEFORE=$(timeout 60 $CLI shell_execute '{"command":"powershell -NoProfile -Command \"Add-Type -Name FGA -Namespace W -MemberDefinition '"'"'[DllImport(\\\"user32.dll\\\")] public static extern IntPtr GetForegroundWindow();'"'"'; [W.FGA]::GetForegroundWindow()\"","reason":"selftest T10: foreground window before the cold dashboard launch"}' 2>&1 | J "(d.get('stdout') or '').strip()")+timeout 120 $CLI pup_dashboard '{}' >/dev/null 2>&1+sleep 6+FG_AFTER=$(timeout 60 $CLI shell_execute '{"command":"powershell -NoProfile -Command \"Add-Type -Name FGB -Namespace W -MemberDefinition '"'"'[DllImport(\\\"user32.dll\\\")] public static extern IntPtr GetForegroundWindow();'"'"'; [W.FGB]::GetForegroundWindow()\"","reason":"selftest T10: foreground window after the cold dashboard launch"}' 2>&1 | J "(d.get('stdout') or '').strip()")+if [ -n "$FG_BEFORE" ] && [ "$FG_BEFORE" = "$FG_AFTER" ]; then ok "cold pup_dashboard did NOT steal focus (foreground hwnd $FG_BEFORE unchanged)"+elif [ -z "$FG_BEFORE" ]; then bad "T10 could not read the foreground window — check did not run"+else bad "FOREGROUND STOLEN by a cold pup_dashboard (#56 regressed): $FG_BEFORE -> $FG_AFTER"; fi+timeout 60 $CLI pup_close_window '{"sessionId":"st-fg"}' >/dev/null 2>&1+timeout 60 $CLI pup_close_window '{"sessionId":"pup-dashboard"}' >/dev/null 2>&1+ echo "== T9 CLEANUP: close test windows; nothing owned by pup-selftest remains; keys reaped ==" timeout 60 $CLI pup_close_window '{"sessionId":"st-web"}' >/dev/null 2>&1 timeout 60 $CLI pup_close_window '{"sessionId":"st-tall"}' >/dev/null 2>&1