Files
chrome-use/scripts/windows-debug/run.sh
T
leeguooooo 61060486f4
Release binaries / Build macOS ARM64 (push) Has been cancelled
Release binaries / Build macOS x64 (push) Has been cancelled
Release binaries / Build Linux ARM64 (push) Has been cancelled
Release binaries / Build Linux musl ARM64 (push) Has been cancelled
Release binaries / Build Linux musl x64 (push) Has been cancelled
Release binaries / Build Linux x64 (push) Has been cancelled
Release binaries / Build Windows x64 (push) Has been cancelled
Release binaries / Attach binaries to GitHub Release (push) Has been cancelled
rebrand: agent-browser-stealth → chrome-use, de-fork, reset to v1.0.0
Standalone product rename across the whole repo (issue: project identity):

- Binary/package/repo/skill/docs: agent-browser[-stealth] → chrome-use
  (single binary name `chrome-use`; old aliases agent-browser/abs dropped).
- Version: 0.27.0-fork.51 → 1.0.0 (drop the upstream-fork counter).
- Native-messaging host: com.agent_browser.connect → com.leeguoo.chrome_use
  (CLI + ab-connect extension in lockstep — this is a breaking handshake change,
  extension bumped 0.4.2 → 0.5.0, needs a Web Store republish).
- Config dir: ~/.agent-browser → ~/.chrome-use.
- README/zh: reframed from "stealth fork of agent-browser" to a standalone
  product with a small `originally based on vercel-labs/agent-browser` credit.
- Kept AGENT_BROWSER_* env vars working (63 vars across the codebase; renaming
  them would break every existing script/skill for no user-facing gain).

Build green, 802 unit tests pass, fmt + clippy clean. Upstream attribution to
vercel-labs/agent-browser preserved.
2026-06-12 12:56:21 +09:00

93 lines
2.3 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
INSTANCE_FILE="$SCRIPT_DIR/.instance"
if [[ ! -f "$INSTANCE_FILE" ]]; then
echo "Error: No instance provisioned. Run ./scripts/windows-debug/provision.sh first."
exit 1
fi
if [[ $# -eq 0 ]]; then
echo "Usage: ./scripts/windows-debug/run.sh \"<powershell-command>\""
echo ""
echo "Examples:"
echo " ./scripts/windows-debug/run.sh \"cd C:\\chrome-use && cargo test\""
echo " ./scripts/windows-debug/run.sh \"Get-Content C:\\bootstrap.log\""
echo " ./scripts/windows-debug/run.sh \"cd C:\\chrome-use && cargo test e2e -- --ignored --test-threads=1\""
exit 1
fi
source "$INSTANCE_FILE"
export AWS_DEFAULT_REGION="$REGION"
COMMAND="$*"
PARAMS_FILE=$(mktemp)
trap "rm -f $PARAMS_FILE" EXIT
python3 -c '
import json, sys
path_setup = "$env:PATH = \"$env:USERPROFILE\\.cargo\\bin;C:\\Program Files\\Git\\cmd;$env:PATH\""
cmd = path_setup + "\n" + sys.argv[1]
json.dump({"commands": [cmd]}, open(sys.argv[2], "w"))
' "$COMMAND" "$PARAMS_FILE"
COMMAND_ID=$(aws ssm send-command \
--instance-ids "$INSTANCE_ID" \
--document-name "AWS-RunPowerShellScript" \
--parameters "file://$PARAMS_FILE" \
--timeout-seconds 3600 \
--query "Command.CommandId" --output text)
echo "Command sent (ID: $COMMAND_ID). Waiting..." >&2
while true; do
RESULT=$(aws ssm get-command-invocation \
--command-id "$COMMAND_ID" \
--instance-id "$INSTANCE_ID" \
--output json 2>&1) || true
STATUS=$(echo "$RESULT" | python3 -c "
import sys, json
try:
print(json.loads(sys.stdin.read()).get('Status', 'Unknown'))
except:
print('Pending')
" 2>/dev/null)
case "$STATUS" in
Success)
echo "$RESULT" | python3 -c "
import sys, json
r = json.loads(sys.stdin.read())
out = r.get('StandardOutputContent', '').rstrip()
err = r.get('StandardErrorContent', '').rstrip()
if out:
print(out)
if err:
print(err, file=sys.stderr)
"
exit 0
;;
Failed|TimedOut|Cancelled)
echo "$RESULT" | python3 -c "
import sys, json
r = json.loads(sys.stdin.read())
out = r.get('StandardOutputContent', '').rstrip()
err = r.get('StandardErrorContent', '').rstrip()
if out:
print(out)
if err:
print(err, file=sys.stderr)
"
echo "Command $STATUS." >&2
exit 1
;;
*)
sleep 3
;;
esac
done