Add Wormhole auto-kill so Interface 5 can be claimed
Cable autorun holds IF5; kill on launch/connect and via GUI button/CLI. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -11,6 +11,7 @@ from pathlib import Path
|
||||
from . import __version__
|
||||
from .protocol import Session
|
||||
from .usb_link import list_devices, Juc500Link, doctor
|
||||
from .wormhole_kill import kill_wormhole_processes, wormhole_status
|
||||
|
||||
|
||||
def _progress(prefix: str):
|
||||
@@ -61,12 +62,29 @@ def cmd_doctor(_args: argparse.Namespace) -> int:
|
||||
print("Windows PnP VID_0711:")
|
||||
for row in rep.pnp_vid0711:
|
||||
print(f" - {row}")
|
||||
wh = wormhole_status()
|
||||
print(f"Wormhole 프로세스: {wh['count']} — {wh['message']}")
|
||||
for p in wh.get("processes") or []:
|
||||
print(f" - {p.get('name')} pid={p.get('pid')}")
|
||||
print("안내:")
|
||||
for h in rep.hints:
|
||||
print(f" * {h}")
|
||||
return 0 if rep.ok else 1
|
||||
|
||||
|
||||
def cmd_kill_wormhole(_args: argparse.Namespace) -> int:
|
||||
result = kill_wormhole_processes(force=True)
|
||||
print(result.get("message") or "")
|
||||
if result.get("killed"):
|
||||
for p in result["killed"]:
|
||||
print(f" 종료: {p.get('name')} pid={p.get('pid')}")
|
||||
if result.get("remaining"):
|
||||
for p in result["remaining"]:
|
||||
print(f" 잔여: {p.get('name')} pid={p.get('pid')}")
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
def cmd_probe(args: argparse.Namespace) -> int:
|
||||
with Juc500Link(serial=args.serial) as link:
|
||||
print(f"열림: serial={link.serial!r}")
|
||||
@@ -143,6 +161,9 @@ def build_parser() -> argparse.ArgumentParser:
|
||||
s = sub.add_parser("doctor", help="USB/libusb/WinUSB 진단")
|
||||
s.set_defaults(func=cmd_doctor)
|
||||
|
||||
s = sub.add_parser("kill-wormhole", help="공식 Wormhole/GoBridge 프로세스 종료")
|
||||
s.set_defaults(func=cmd_kill_wormhole)
|
||||
|
||||
s = sub.add_parser("probe", help="USB 인터페이스 점유 및 송수신 프로브")
|
||||
s.add_argument("--serial", default=None)
|
||||
s.set_defaults(func=cmd_probe)
|
||||
|
||||
Reference in New Issue
Block a user