feat: prompt command (MessageBox), admin status in banner
This commit is contained in:
parent
fdd2124da8
commit
e0edf60461
6 changed files with 100 additions and 0 deletions
|
|
@ -287,6 +287,18 @@ def cmd_find_window(args):
|
|||
print(f"{wid:<20} {title}")
|
||||
|
||||
|
||||
def cmd_prompt(args):
|
||||
"""Show a MessageBox on the remote PC asking the user to do something.
|
||||
Blocks until the user clicks OK — use this when the AI needs the user
|
||||
to perform a manual action (e.g. click a button, confirm a dialog)."""
|
||||
sid = resolve_session(args.session_id)
|
||||
body = {"message": args.message}
|
||||
if args.title:
|
||||
body["title"] = args.title
|
||||
_req("POST", f"/sessions/{sid}/prompt", json=body)
|
||||
print(f"User confirmed prompt on session {sid!r}.")
|
||||
|
||||
|
||||
def cmd_run(args):
|
||||
"""Launch a program on the remote session (fire-and-forget)."""
|
||||
sid = resolve_session(args.session_id)
|
||||
|
|
@ -374,6 +386,12 @@ def build_parser() -> argparse.ArgumentParser:
|
|||
fwp.add_argument("session_id")
|
||||
fwp.add_argument("title", help="Substring to search for (case-insensitive)")
|
||||
|
||||
pp = sub.add_parser("prompt", help="Show a MessageBox asking the user to do something manually")
|
||||
pp.add_argument("session_id")
|
||||
pp.add_argument("message", help="What to ask the user (e.g. 'Please click Save, then OK')")
|
||||
pp.add_argument("--title", default=None, help="Dialog title (default: Helios Remote)")
|
||||
pp.set_defaults(func=cmd_prompt)
|
||||
|
||||
rp = sub.add_parser("run", help="Launch a program on the remote session (fire-and-forget)")
|
||||
rp.add_argument("session_id")
|
||||
rp.add_argument("program", help="Program to launch (e.g. notepad.exe)")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue