UUID-based sidechat reuse for heartbeat\n\n- Add url command to muse-chat-api.py\n- Dispatcher: reuse_key -> thread UUID mapping in job-sidechats.json\n- Capture UUID after first send, reuse on subsequent runs\n- Fixes multi-spawn bug (was matching by auto-generated title)
This commit is contained in:
@@ -378,6 +378,11 @@ def ev1(ws, expr, await_p=False):
|
||||
return None
|
||||
|
||||
|
||||
def cmd_url(ws):
|
||||
"""Print current browser URL."""
|
||||
url = ev(ws, "window.location.href")
|
||||
print(url)
|
||||
|
||||
def cmd_upload(ws, filepath, message=None, dry_run=False):
|
||||
"""Attach a file to the chat composer via CDP DOM.setFileInputFiles.
|
||||
|
||||
@@ -478,7 +483,7 @@ def main():
|
||||
p = argparse.ArgumentParser()
|
||||
p.add_argument('--account', required=True, choices=list(ACCOUNTS.keys()),
|
||||
help='Agent name (matches node, profile, ACCOUNTS.md)')
|
||||
p.add_argument('command', choices=['send', 'messages', 'wait', 'approvals', 'sidechat', 'upload'])
|
||||
p.add_argument('command', choices=['send', 'messages', 'wait', 'approvals', 'sidechat', 'upload', 'url'])
|
||||
p.add_argument('arg', nargs='*', default=[])
|
||||
p.add_argument('--dry-run', action='store_true',
|
||||
help='upload: stage attachment without sending')
|
||||
@@ -524,6 +529,8 @@ def main():
|
||||
else:
|
||||
print(f"ERROR: unknown sidechat subcommand: {sub}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
elif args.command == 'url':
|
||||
cmd_url(ws)
|
||||
elif args.command == 'upload':
|
||||
if not args.arg:
|
||||
print("ERROR: upload requires a filepath", file=sys.stderr)
|
||||
|
||||
Reference in New Issue
Block a user