Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(debug): add web command to drive the SPA in Playwright

Steven Enamakel80d23bac3c54
diff --git a/scripts/debug/cli.sh b/scripts/debug/cli.sh
index 07989f3966..1a8d2b0d35 100755
--- a/scripts/debug/cli.sh
+++ b/scripts/debug/cli.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Dispatcher for `pnpm debug <cmd> <args…>`.
# Agent-friendly wrappers around the project's test/run scripts.
-# Commands: unit | e2e | rust | logs | harness-cache-audit | capture | breakdown
+# Commands: unit | e2e | rust | logs | harness-cache-audit | capture | breakdown | web
set -euo pipefail
here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -32,6 +32,10 @@ Commands:
exact request bodies the harness sends and prints one line per
inference response (serving endpoint, TTFB, prompt/cached tokens,
prompt_cache_key). Configure with CAPTURE_* env vars; `--help` lists them.
+ web [--script <file.mjs>] [--headed] [--keep] [--help]
+ Drive the web SPA in Playwright Chromium against a throwaway stack
+ (mock backend, fresh core, watcher-free Vite), signed in through the
+ real provider button. Artifacts go to target/debug-logs/web-<ts>/.
breakdown <req.json> [--response <res>] [--depth N] [--top N] [--json]
Token accounting for one captured request: every system-prompt
section, tool schema and message priced in tokens, calibrated to the
@@ -67,6 +71,9 @@ case "$cmd" in
goals-live)
exec node "$here/goals-live.mjs" "$@"
;;
+ web)
+ exec node "$here/web-ui.mjs" "$@"
+ ;;
*)
echo "[debug] unknown command: $cmd" >&2
usage >&2