ghosttrap-cli 0.3.4__tar.gz → 0.3.6__tar.gz
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.
- {ghosttrap_cli-0.3.4 → ghosttrap_cli-0.3.6}/PKG-INFO +1 -1
- {ghosttrap_cli-0.3.4 → ghosttrap_cli-0.3.6}/ghosttrap_cli/cli.py +27 -0
- {ghosttrap_cli-0.3.4 → ghosttrap_cli-0.3.6}/ghosttrap_cli.egg-info/PKG-INFO +1 -1
- {ghosttrap_cli-0.3.4 → ghosttrap_cli-0.3.6}/pyproject.toml +1 -1
- {ghosttrap_cli-0.3.4 → ghosttrap_cli-0.3.6}/README.md +0 -0
- {ghosttrap_cli-0.3.4 → ghosttrap_cli-0.3.6}/ghosttrap_cli/__init__.py +0 -0
- {ghosttrap_cli-0.3.4 → ghosttrap_cli-0.3.6}/ghosttrap_cli.egg-info/SOURCES.txt +0 -0
- {ghosttrap_cli-0.3.4 → ghosttrap_cli-0.3.6}/ghosttrap_cli.egg-info/dependency_links.txt +0 -0
- {ghosttrap_cli-0.3.4 → ghosttrap_cli-0.3.6}/ghosttrap_cli.egg-info/entry_points.txt +0 -0
- {ghosttrap_cli-0.3.4 → ghosttrap_cli-0.3.6}/ghosttrap_cli.egg-info/requires.txt +0 -0
- {ghosttrap_cli-0.3.4 → ghosttrap_cli-0.3.6}/ghosttrap_cli.egg-info/top_level.txt +0 -0
- {ghosttrap_cli-0.3.4 → ghosttrap_cli-0.3.6}/setup.cfg +0 -0
|
@@ -314,11 +314,36 @@ async def peek(server_url, token):
|
|
|
314
314
|
await asyncio.sleep(60)
|
|
315
315
|
|
|
316
316
|
|
|
317
|
+
def clear():
|
|
318
|
+
_require_setup()
|
|
319
|
+
config = _load_config()
|
|
320
|
+
token = _get_repo_token(config)
|
|
321
|
+
since = config.get("cursor", 0)
|
|
322
|
+
server = GHOSTTRAP_SERVER.replace("wss://", "https://").replace("/stream/", "")
|
|
323
|
+
url = f"{server}/latest/{token}/?since={since}"
|
|
324
|
+
try:
|
|
325
|
+
req = urllib.request.Request(url, headers={"User-Agent": "ghosttrap-cli"})
|
|
326
|
+
with urllib.request.urlopen(req, timeout=10) as resp:
|
|
327
|
+
data = json.loads(resp.read())
|
|
328
|
+
latest_id = data.get("latest_id", 0)
|
|
329
|
+
pending = data.get("pending", 0)
|
|
330
|
+
config["cursor"] = latest_id
|
|
331
|
+
_save_config(config)
|
|
332
|
+
if pending:
|
|
333
|
+
print(f"cleared {pending} error(s)", file=sys.stderr)
|
|
334
|
+
else:
|
|
335
|
+
print(f"nothing to clear", file=sys.stderr)
|
|
336
|
+
except Exception as e:
|
|
337
|
+
print(f"error: {e}", file=sys.stderr)
|
|
338
|
+
sys.exit(1)
|
|
339
|
+
|
|
340
|
+
|
|
317
341
|
def main():
|
|
318
342
|
parser = argparse.ArgumentParser(prog="ghosttrap", description="Watch for errors from ghosttrap.io")
|
|
319
343
|
sub = parser.add_subparsers(dest="command")
|
|
320
344
|
|
|
321
345
|
sub.add_parser("setup", help="Claim repos and install Claude Code skill")
|
|
346
|
+
sub.add_parser("clear", help="Skip all outstanding errors")
|
|
322
347
|
|
|
323
348
|
watch_parser = sub.add_parser("watch", help="Stream errors in real time")
|
|
324
349
|
watch_parser.add_argument("--server", default=GHOSTTRAP_SERVER, help="WebSocket server URL")
|
|
@@ -331,6 +356,8 @@ def main():
|
|
|
331
356
|
if args.command == "setup":
|
|
332
357
|
token = get_gh_token()
|
|
333
358
|
asyncio.run(setup(GHOSTTRAP_SERVER, token))
|
|
359
|
+
elif args.command == "clear":
|
|
360
|
+
clear()
|
|
334
361
|
elif args.command == "watch":
|
|
335
362
|
_require_setup()
|
|
336
363
|
config = _load_config()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|