@kritchoff/agent-browser 0.9.46 → 0.9.47
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.
- package/package.json +1 -1
- package/sdk.sh +0 -20
- package/start.sh +14 -5
package/package.json
CHANGED
package/sdk.sh
CHANGED
|
@@ -89,16 +89,6 @@ cmd_start() {
|
|
|
89
89
|
log_success "Found cached baseline snapshot. Performing HYPER-SPEED WARM BOOT..."
|
|
90
90
|
export EMULATOR_SNAPSHOT_NAME="quickboot"
|
|
91
91
|
"$SDK_ROOT/start.sh"
|
|
92
|
-
|
|
93
|
-
cd "$SDK_ROOT"
|
|
94
|
-
AGENT_CONT=$(docker compose ps -q agent-service)
|
|
95
|
-
if [ -n "$AGENT_CONT" ] && ! docker port "$AGENT_CONT" 3000 >/dev/null 2>&1; then
|
|
96
|
-
log_warn "Port 3000 (Host 32001) is not mapped! Container config is stale."
|
|
97
|
-
log_info "Forcing full restart to apply network settings..."
|
|
98
|
-
docker compose -f "$COMPOSE_FILE" down -v --remove-orphans
|
|
99
|
-
sleep 5
|
|
100
|
-
"$SDK_ROOT/start.sh"
|
|
101
|
-
fi
|
|
102
92
|
else
|
|
103
93
|
# === COLD START & FREEZE ===
|
|
104
94
|
log_warn "No baseline found. Performing FIRST RUN SETUP (Cold Boot)..."
|
|
@@ -117,22 +107,12 @@ cmd_start() {
|
|
|
117
107
|
|
|
118
108
|
cd "$SDK_ROOT"
|
|
119
109
|
CONTAINER=$(docker compose ps -q android-service)
|
|
120
|
-
AGENT_CONT=$(docker compose ps -q agent-service)
|
|
121
110
|
|
|
122
111
|
if [ -z "$CONTAINER" ]; then
|
|
123
112
|
log_error "Error: Android container not found."
|
|
124
113
|
exit 1
|
|
125
114
|
fi
|
|
126
115
|
|
|
127
|
-
if ! docker port "$AGENT_CONT" 3000 >/dev/null 2>&1; then
|
|
128
|
-
log_warn "Port 3000 (Host 32001) is not mapped! Container config is stale."
|
|
129
|
-
log_info "Forcing full restart to apply network settings..."
|
|
130
|
-
docker compose -f "$COMPOSE_FILE" down -v --remove-orphans
|
|
131
|
-
sleep 5
|
|
132
|
-
"$SDK_ROOT/start.sh"
|
|
133
|
-
CONTAINER=$(docker compose ps -q android-service)
|
|
134
|
-
fi
|
|
135
|
-
|
|
136
116
|
log_info "Saving emulator state (quickboot)..."
|
|
137
117
|
if docker exec "$CONTAINER" adb emu avd snapshot save quickboot; then
|
|
138
118
|
log_success "Snapshot saved to host volume."
|
package/start.sh
CHANGED
|
@@ -64,15 +64,24 @@ wait_for_log() {
|
|
|
64
64
|
|
|
65
65
|
echo -n " Waiting for $label... "
|
|
66
66
|
until docker logs "$container" 2>&1 | grep -q "$pattern"; do
|
|
67
|
-
sleep
|
|
67
|
+
sleep 1 # Faster polling
|
|
68
68
|
done
|
|
69
69
|
echo -e "${GREEN}Done!${NC}"
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
wait_for_log "$ANDROID_CONTAINER" "
|
|
75
|
-
|
|
72
|
+
if [ -z "$SNAPSHOT_PATH" ] && [ -z "$EMULATOR_SNAPSHOT_NAME" ]; then
|
|
73
|
+
# --- COLD BOOT PATH (Wait for everything) ---
|
|
74
|
+
wait_for_log "$ANDROID_CONTAINER" "Emulator boot complete" "Android Emulator Boot"
|
|
75
|
+
wait_for_log "$ANDROID_CONTAINER" "APK installation complete" "WootzApp Installation"
|
|
76
|
+
wait_for_log "$ANDROID_CONTAINER" "CDP Bridge ready" "CDP Bridge"
|
|
77
|
+
else
|
|
78
|
+
# --- WARM BOOT PATH (Hyper-Speed) ---
|
|
79
|
+
# We skip Boot and APK installation because they are inside the snapshot.
|
|
80
|
+
# We only wait for the Daemon to reconnect to the resumed emulator.
|
|
81
|
+
echo -e "${GREEN} Snapshot detected. Skipping OS boot and APK install waits.${NC}"
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
# We always wait for the Daemon because it's the final bridge to the SDK
|
|
76
85
|
wait_for_log "$AGENT_CONTAINER" "Daemon listening on TCP" "Agent Daemon Connection"
|
|
77
86
|
|
|
78
87
|
# 3.5 Network Rehydration (Warm Boot Only)
|