@kritchoff/agent-browser 0.9.28 → 0.9.30

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.
@@ -14,9 +14,10 @@
14
14
  import { WootzAgent } from '../dist/index.js';
15
15
 
16
16
  const args = process.argv.slice(2);
17
- const command = args[0];
17
+ // Find the first argument that doesn't start with '-' to be the command
18
+ const command = args.find(arg => !arg.startsWith('-'));
18
19
 
19
- if (!command || command === '--help' || command === '-h') {
20
+ if (!command || command === 'help') {
20
21
  console.log(`
21
22
  WootzApp Agent Browser CLI
22
23
 
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import * as net from 'net';
5
5
  import { randomUUID } from 'crypto';
6
6
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
7
  const SDK_SCRIPT = path.resolve(__dirname, '../sdk.sh');
8
- const DAEMON_PORT = 3000;
8
+ const DAEMON_PORT = 3001;
9
9
  export class WootzAgent {
10
10
  options;
11
11
  constructor(options = {}) {
@@ -8,10 +8,10 @@ services:
8
8
  privileged: true # Required for KVM
9
9
  restart: always # Auto-restart on crash
10
10
  ports:
11
- - "5556:5555" # ADB (Host access)
12
- - "9225:9224" # CDP (Host access)
13
- - "6081:6080" # NoVNC
14
- - "3000:3000" # Agent Control Port (Exposed from shared namespace)
11
+ - "5566:5555" # ADB (Host access)
12
+ - "9235:9224" # CDP (Host access)
13
+ - "6091:6080" # NoVNC
14
+ - "3001:3000" # Agent Control Port (Exposed from shared namespace)
15
15
  environment:
16
16
  - EMULATOR_NAME=Pixel_6_API_34
17
17
  - BROWSER=wootzapp
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kritchoff/agent-browser",
3
- "version": "0.9.28",
3
+ "version": "0.9.30",
4
4
  "description": "Headless browser automation CLI for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/sdk.sh CHANGED
@@ -96,10 +96,12 @@ cmd_start() {
96
96
  # Verify port mapping for warm start too
97
97
  cd "$SDK_ROOT"
98
98
  CONTAINER=$(docker compose ps -q android-service)
99
- if [ -n "$CONTAINER" ] && ! docker port "$CONTAINER" 3000 >/dev/null 2>&1; then
100
- log_warn "Port 3000 is not mapped! Container config is stale."
99
+ if [ -n "$CONTAINER" ] && ! docker port "$CONTAINER" 3001 >/dev/null 2>&1; then
100
+ log_warn "Port 3001 is not mapped! Container config is stale."
101
101
  log_info "Forcing full restart to apply network settings..."
102
102
  docker compose -f "$COMPOSE_FILE" down
103
+ log_info "Waiting for ports to release..."
104
+ sleep 5
103
105
  "$SDK_ROOT/start.sh" --snapshot "$SNAPSHOT_FILE"
104
106
  fi
105
107
  else
@@ -128,12 +130,14 @@ cmd_start() {
128
130
  exit 1
129
131
  fi
130
132
 
131
- # SELF-HEAL: Verify port 3000 is actually mapped
133
+ # SELF-HEAL: Verify port 3001 is actually mapped
132
134
  # If the container was created with an old config, it might be running without ports.
133
- if ! docker port "$CONTAINER" 3000 >/dev/null 2>&1; then
134
- log_warn "Port 3000 is not mapped! Container config is stale."
135
+ if ! docker port "$CONTAINER" 3001 >/dev/null 2>&1; then
136
+ log_warn "Port 3001 is not mapped! Container config is stale."
135
137
  log_info "Forcing full restart to apply network settings..."
136
138
  docker compose -f "$COMPOSE_FILE" down
139
+ log_info "Waiting for ports to release..."
140
+ sleep 5
137
141
  "$SDK_ROOT/start.sh"
138
142
 
139
143
  # Re-fetch container ID after restart