ghosttrap-cli 0.3.3__tar.gz → 0.3.5__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.3 → ghosttrap_cli-0.3.5}/PKG-INFO +1 -1
- {ghosttrap_cli-0.3.3 → ghosttrap_cli-0.3.5}/ghosttrap_cli/cli.py +25 -1
- {ghosttrap_cli-0.3.3 → ghosttrap_cli-0.3.5}/ghosttrap_cli.egg-info/PKG-INFO +1 -1
- {ghosttrap_cli-0.3.3 → ghosttrap_cli-0.3.5}/pyproject.toml +1 -1
- {ghosttrap_cli-0.3.3 → ghosttrap_cli-0.3.5}/README.md +0 -0
- {ghosttrap_cli-0.3.3 → ghosttrap_cli-0.3.5}/ghosttrap_cli/__init__.py +0 -0
- {ghosttrap_cli-0.3.3 → ghosttrap_cli-0.3.5}/ghosttrap_cli.egg-info/SOURCES.txt +0 -0
- {ghosttrap_cli-0.3.3 → ghosttrap_cli-0.3.5}/ghosttrap_cli.egg-info/dependency_links.txt +0 -0
- {ghosttrap_cli-0.3.3 → ghosttrap_cli-0.3.5}/ghosttrap_cli.egg-info/entry_points.txt +0 -0
- {ghosttrap_cli-0.3.3 → ghosttrap_cli-0.3.5}/ghosttrap_cli.egg-info/requires.txt +0 -0
- {ghosttrap_cli-0.3.3 → ghosttrap_cli-0.3.5}/ghosttrap_cli.egg-info/top_level.txt +0 -0
- {ghosttrap_cli-0.3.3 → ghosttrap_cli-0.3.5}/setup.cfg +0 -0
|
@@ -63,7 +63,9 @@ Read `~/.ghosttrap/config.json` for state. It contains:
|
|
|
63
63
|
|
|
64
64
|
## When peek returns
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
1. **Immediately restart peek** in the background before doing anything else — this ensures you're listening for the next error while you work on the current one.
|
|
67
|
+
2. Read the JSON output: `error.repo`, `error.type`, `error.message`, `error.traceback` (list of strings), `error.frames` (list of `{file, line, function, code}`).
|
|
68
|
+
3. Open the file from the last frame, diagnose, fix.
|
|
67
69
|
|
|
68
70
|
## Rules
|
|
69
71
|
|
|
@@ -312,11 +314,31 @@ async def peek(server_url, token):
|
|
|
312
314
|
await asyncio.sleep(60)
|
|
313
315
|
|
|
314
316
|
|
|
317
|
+
def clear():
|
|
318
|
+
_require_setup()
|
|
319
|
+
config = _load_config()
|
|
320
|
+
token = _get_repo_token(config)
|
|
321
|
+
server = GHOSTTRAP_SERVER.replace("wss://", "https://").replace("/stream/", "")
|
|
322
|
+
url = f"{server}/latest/{token}/"
|
|
323
|
+
try:
|
|
324
|
+
req = urllib.request.Request(url, headers={"User-Agent": "ghosttrap-cli"})
|
|
325
|
+
with urllib.request.urlopen(req, timeout=10) as resp:
|
|
326
|
+
data = json.loads(resp.read())
|
|
327
|
+
latest_id = data.get("latest_id", 0)
|
|
328
|
+
config["cursor"] = latest_id
|
|
329
|
+
_save_config(config)
|
|
330
|
+
print(f"cleared — cursor set to {latest_id}", file=sys.stderr)
|
|
331
|
+
except Exception as e:
|
|
332
|
+
print(f"error: {e}", file=sys.stderr)
|
|
333
|
+
sys.exit(1)
|
|
334
|
+
|
|
335
|
+
|
|
315
336
|
def main():
|
|
316
337
|
parser = argparse.ArgumentParser(prog="ghosttrap", description="Watch for errors from ghosttrap.io")
|
|
317
338
|
sub = parser.add_subparsers(dest="command")
|
|
318
339
|
|
|
319
340
|
sub.add_parser("setup", help="Claim repos and install Claude Code skill")
|
|
341
|
+
sub.add_parser("clear", help="Skip all outstanding errors")
|
|
320
342
|
|
|
321
343
|
watch_parser = sub.add_parser("watch", help="Stream errors in real time")
|
|
322
344
|
watch_parser.add_argument("--server", default=GHOSTTRAP_SERVER, help="WebSocket server URL")
|
|
@@ -329,6 +351,8 @@ def main():
|
|
|
329
351
|
if args.command == "setup":
|
|
330
352
|
token = get_gh_token()
|
|
331
353
|
asyncio.run(setup(GHOSTTRAP_SERVER, token))
|
|
354
|
+
elif args.command == "clear":
|
|
355
|
+
clear()
|
|
332
356
|
elif args.command == "watch":
|
|
333
357
|
_require_setup()
|
|
334
358
|
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
|