Add QR pairing (terminal QR, in-app scanner, iris://pair deep link)
This commit is contained in:
1 parent
27dc7917f2
commit
7a6d922d12
63 files changed
+2073
-630
No files matched your search
@@ -11,7 +11,7 @@ Usage::
|
||||
hermes-agent/.venv/bin/python gateway-plugin/tests/e2e.py --skip 3,5,7
|
||||
hermes-agent/.venv/bin/python gateway-plugin/tests/e2e.py --url ws://host:8790/ws
|
||||
|
||||
The token is read from $ANDROID_TOKEN, else hermes-agent/.env, else
|
||||
The token is read from $IRIS_TOKEN, else hermes-agent/.env, else
|
||||
~/.hermes/.env. The gateway must already be running (this driver never
|
||||
starts or stops it). Idempotent: channels/jobs it creates are cleaned up
|
||||
even on failure, and leftover "e2e-*" channels/jobs from earlier runs are
|
||||
@@ -52,14 +52,14 @@ PASS, PARTIAL, SKIP, FAIL = "PASS", "PARTIAL", "SKIP", "FAIL"
|
||||
def find_token(cli_token: str) -> str:
|
||||
if cli_token:
|
||||
return cli_token
|
||||
env = os.getenv("ANDROID_TOKEN")
|
||||
env = os.getenv("IRIS_TOKEN")
|
||||
if env:
|
||||
return env
|
||||
for p in (REPO / "hermes-agent" / ".env", Path.home() / ".hermes" / ".env"):
|
||||
try:
|
||||
for raw_line in p.read_text().splitlines():
|
||||
line = raw_line.strip()
|
||||
if line.startswith("ANDROID_TOKEN="):
|
||||
if line.startswith("IRIS_TOKEN="):
|
||||
return line.split("=", 1)[1].strip().strip('"').strip("'")
|
||||
except OSError:
|
||||
pass
|
||||
@@ -204,7 +204,7 @@ def s7_cron(env, url, token):
|
||||
if not chat_id:
|
||||
return FAIL, "channel.created received but chat_id not parseable"
|
||||
job_name = f"e2e-cron-{uuid.uuid4().hex[:6]}"
|
||||
deliver = f"android:{chat_id}"
|
||||
deliver = f"iris:{chat_id}"
|
||||
rc, out, err = run_hermes(
|
||||
env, "cron", "create", "1m",
|
||||
"Reply with exactly: e2e cron delivery OK",
|
||||
@@ -310,7 +310,7 @@ def s13_http_fallback(env, url, token):
|
||||
must land on the SSE stream promptly after the POST (< 1.5 s on LAN)."""
|
||||
u = urlparse(url)
|
||||
scheme = "https" if u.scheme == "wss" else "http"
|
||||
http_port = os.getenv("ANDROID_HTTP_PORT", "8791")
|
||||
http_port = os.getenv("IRIS_HTTP_PORT", "8791")
|
||||
http_url = f"{scheme}://{u.hostname or '127.0.0.1'}:{http_port}"
|
||||
rc, out, _ = run_probe(env, url, token, "--http", "--http-url", http_url,
|
||||
"--send", "Reply with exactly: e2e http fallback OK",
|
||||
@@ -352,7 +352,7 @@ def main() -> int:
|
||||
p = argparse.ArgumentParser(
|
||||
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
|
||||
)
|
||||
p.add_argument("--url", default=os.getenv("ANDROID_WS_URL", DEFAULT_URL))
|
||||
p.add_argument("--url", default=os.getenv("IRIS_WS_URL", DEFAULT_URL))
|
||||
p.add_argument("--token", default="")
|
||||
p.add_argument("--skip", default="",
|
||||
help="comma-separated scenario numbers to skip (e.g. 3,5,7)")
|
||||
@@ -360,12 +360,12 @@ def main() -> int:
|
||||
|
||||
token = find_token(args.token)
|
||||
if not token:
|
||||
print("!! ANDROID_TOKEN not found (env, hermes-agent/.env, or ~/.hermes/.env)")
|
||||
print("!! IRIS_TOKEN not found (env, hermes-agent/.env, or ~/.hermes/.env)")
|
||||
return 1
|
||||
skip = {int(x) for x in args.skip.split(",") if x.strip()}
|
||||
|
||||
env = dict(os.environ)
|
||||
env["ANDROID_TOKEN"] = token
|
||||
env["IRIS_TOKEN"] = token
|
||||
|
||||
print(f"== e2e: url={args.url} token={token[:6]}…")
|
||||
sweep_leftovers(env, args.url, token)
|
||||
|
||||
Reference in new issue
Block a user