open-research-protocol 0.4.1 → 0.4.2
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/cli/orp.py +28 -0
- package/package.json +1 -1
package/cli/orp.py
CHANGED
|
@@ -279,6 +279,14 @@ def _prompt_value(label: str, *, secret: bool = False) -> str:
|
|
|
279
279
|
return input(f"{label}: ").strip()
|
|
280
280
|
|
|
281
281
|
|
|
282
|
+
def _read_value_from_stdin() -> str:
|
|
283
|
+
try:
|
|
284
|
+
raw = sys.stdin.read()
|
|
285
|
+
except Exception:
|
|
286
|
+
return ""
|
|
287
|
+
return raw.rstrip("\r\n")
|
|
288
|
+
|
|
289
|
+
|
|
282
290
|
def _session_summary(session: dict[str, Any]) -> dict[str, Any]:
|
|
283
291
|
user = session.get("user") if isinstance(session.get("user"), dict) else None
|
|
284
292
|
pending = session.get("pending_verification")
|
|
@@ -3588,7 +3596,12 @@ def cmd_auth_login(args: argparse.Namespace) -> int:
|
|
|
3588
3596
|
if not email:
|
|
3589
3597
|
raise RuntimeError("Email is required.")
|
|
3590
3598
|
|
|
3599
|
+
password_from_stdin = bool(getattr(args, "password_stdin", False))
|
|
3591
3600
|
password = str(getattr(args, "password", "")).strip()
|
|
3601
|
+
if password_from_stdin and password:
|
|
3602
|
+
raise RuntimeError("Use either --password or --password-stdin, not both.")
|
|
3603
|
+
if password_from_stdin:
|
|
3604
|
+
password = _read_value_from_stdin()
|
|
3592
3605
|
if not password:
|
|
3593
3606
|
password = _prompt_value("Password", secret=True)
|
|
3594
3607
|
if not password:
|
|
@@ -3647,7 +3660,12 @@ def cmd_auth_verify(args: argparse.Namespace) -> int:
|
|
|
3647
3660
|
if not email:
|
|
3648
3661
|
raise RuntimeError("Email is required.")
|
|
3649
3662
|
|
|
3663
|
+
code_from_stdin = bool(getattr(args, "code_stdin", False))
|
|
3650
3664
|
code = str(getattr(args, "code", "")).strip()
|
|
3665
|
+
if code_from_stdin and code:
|
|
3666
|
+
raise RuntimeError("Use either --code or --code-stdin, not both.")
|
|
3667
|
+
if code_from_stdin:
|
|
3668
|
+
code = _read_value_from_stdin()
|
|
3651
3669
|
if not code:
|
|
3652
3670
|
code = _prompt_value("Verification code")
|
|
3653
3671
|
if not code:
|
|
@@ -4419,6 +4437,11 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
4419
4437
|
s_auth_login = auth_sub.add_parser("login", help="Start hosted workspace login flow")
|
|
4420
4438
|
s_auth_login.add_argument("--email", default="", help="Hosted account email")
|
|
4421
4439
|
s_auth_login.add_argument("--password", default="", help="Hosted account password")
|
|
4440
|
+
s_auth_login.add_argument(
|
|
4441
|
+
"--password-stdin",
|
|
4442
|
+
action="store_true",
|
|
4443
|
+
help="Read the hosted account password from stdin",
|
|
4444
|
+
)
|
|
4422
4445
|
add_base_url_flag(s_auth_login)
|
|
4423
4446
|
add_json_flag(s_auth_login)
|
|
4424
4447
|
s_auth_login.set_defaults(func=cmd_auth_login, json_output=False)
|
|
@@ -4426,6 +4449,11 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
4426
4449
|
s_auth_verify = auth_sub.add_parser("verify", help="Complete hosted workspace verification")
|
|
4427
4450
|
s_auth_verify.add_argument("--email", default="", help="Hosted account email")
|
|
4428
4451
|
s_auth_verify.add_argument("--code", default="", help="Verification code")
|
|
4452
|
+
s_auth_verify.add_argument(
|
|
4453
|
+
"--code-stdin",
|
|
4454
|
+
action="store_true",
|
|
4455
|
+
help="Read the verification code from stdin",
|
|
4456
|
+
)
|
|
4429
4457
|
add_base_url_flag(s_auth_verify)
|
|
4430
4458
|
add_json_flag(s_auth_verify)
|
|
4431
4459
|
s_auth_verify.set_defaults(func=cmd_auth_verify, json_output=False)
|
package/package.json
CHANGED