human-browser 4.5.0 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/SKILL.md +37 -0
  2. package/package.json +1 -1
package/SKILL.md CHANGED
@@ -1000,4 +1000,41 @@ cost: $0.58
1000
1000
  viewer: https://humanbrowser.cloud/a/s_xyz?k=...
1001
1001
  ```
1002
1002
 
1003
+ #### Zombie protection (v78+)
1004
+
1005
+ Two server-side mechanisms prevent client timeouts from accumulating zombie sessions and exhausting `HB_MAX_SESSIONS_PER_TOKEN` (default 10):
1006
+
1007
+ **Profile mutex on /spawn:** if the same `(token, profile)` already has an active session, `/spawn` returns the EXISTING session info with `"reused": true` instead of creating a new one. To force a fresh session anyway, pass `body.force_new: true`. Ephemeral spawns (no profile) bypass the check.
1008
+
1009
+ ```jsonc
1010
+ // Second /spawn with profile=main → reuse existing
1011
+ {
1012
+ "sessionId": "s_existing...",
1013
+ "password": "...",
1014
+ "viewerUrl": "...",
1015
+ "profile": "main",
1016
+ "reused": true,
1017
+ "createdAt": 1778529919000,
1018
+ "lastActivityMs": 1778530100000
1019
+ }
1020
+ ```
1021
+
1022
+ **Auto-die after done:** once an agent emits `ev:done`, the session-server waits 5 minutes (`HB_DONE_GRACE_MS`, default 300000) for either a new `/run` or a new WS client to attach. If neither arrives → the session-server exits and spawner-router reaps the slot. Failed sessions (state=error) use a shorter 2-min grace (`HB_ERROR_GRACE_MS`). The 3-hour spawner-router idle reaper still exists as a backstop for sessions that never reached done.
1023
+
1024
+ #### Admin session control (v78+, master skill token only)
1025
+
1026
+ ```bash
1027
+ # List all active sessions across all tokens
1028
+ curl -sX GET https://agent.humanbrowser.cloud/admin/sessions \
1029
+ -H "Authorization: Bearer $HUMANBROWSER_SKILL_TOKEN"
1030
+ # → { "sessions": [{ sessionId, tokenHash, tokenOwner, profile, viewerUrl,
1031
+ # httpPort, cdpPort, wsClients, ready, exited,
1032
+ # lastActivityMs, ageMs, lastTaskAt, spawnedAt }], total, max }
1033
+
1034
+ # Force-stop a specific session
1035
+ curl -sX DELETE https://agent.humanbrowser.cloud/admin/sessions/s_xxx \
1036
+ -H "Authorization: Bearer $HUMANBROWSER_SKILL_TOKEN"
1037
+ # → { "ok": true, "sessionId": "s_xxx", "reason": "admin-kill" }
1038
+ ```
1039
+
1003
1040
  > **Note on multi-turn**: the A2A spec describes an `input-required` state for tasks that need follow-up input. The current cloud build runs every task to terminal in one shot — multi-turn resumption is reserved in the protocol but not yet wired up server-side. Use `tasks/cancel` and submit a fresh task if you need to redirect.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "human-browser",
3
- "version": "4.5.0",
3
+ "version": "4.6.0",
4
4
  "description": "Stealth browser for AI agents. Bypasses Cloudflare, DataDome, PerimeterX. Residential IPs from 10+ countries. iPhone 15 Pro fingerprint. Drop-in Playwright replacement — launchHuman() just works.",
5
5
  "keywords": [
6
6
  "browser-automation",