@kritchoff/agent-browser 0.9.39 → 0.9.41

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 (3) hide show
  1. package/package.json +1 -1
  2. package/sdk.sh +5 -0
  3. package/start.sh +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kritchoff/agent-browser",
3
- "version": "0.9.39",
3
+ "version": "0.9.41",
4
4
  "description": "Headless browser automation CLI for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/sdk.sh CHANGED
@@ -88,6 +88,11 @@ cmd_start() {
88
88
  # Ensure images are present (Production robustness)
89
89
  pull_images_with_retry
90
90
 
91
+ # --- ALWAYS CLEAN UP PREVIOUS STATE ---
92
+ # This prevents network namespace corruption and port binding failures on warm boots
93
+ log_info "Cleaning up previous container state..."
94
+ docker compose -f "$COMPOSE_FILE" down -v --remove-orphans >/dev/null 2>&1 || true
95
+
91
96
  if [ -f "$SNAPSHOT_FILE" ]; then
92
97
  # === WARM START ===
93
98
  log_success "Found cached baseline snapshot. Performing WARM BOOT..."
package/start.sh CHANGED
@@ -74,11 +74,12 @@ if [ -n "$SNAPSHOT_PATH" ]; then
74
74
  # (This assumes the entrypoint script respects EMULATOR_SNAPSHOT_NAME)
75
75
  # For now, we'll rely on the default behavior or standard AVD loading
76
76
 
77
- echo " Restarting Android service to load snapshot..."
78
- docker compose -f "${COMPOSE_FILE:-docker-compose.prod.yml}" restart android-service
77
+ echo " Restarting services to load snapshot..."
78
+ docker compose -f "${COMPOSE_FILE:-docker-compose.prod.yml}" restart android-service agent-service
79
79
 
80
- # Update container ID after restart
80
+ # Update container IDs after restart
81
81
  ANDROID_CONTAINER=$(docker compose -f "${COMPOSE_FILE:-docker-compose.prod.yml}" ps -q android-service)
82
+ AGENT_CONTAINER=$(docker compose -f "${COMPOSE_FILE:-docker-compose.prod.yml}" ps -q agent-service)
82
83
  else
83
84
  echo -e "${RED}Error: Failed to import snapshot.${NC}"
84
85
  exit 1