agent-decoder 0.3.2__py3-none-any.whl
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.
- agent_decoder-0.3.2.dist-info/METADATA +387 -0
- agent_decoder-0.3.2.dist-info/RECORD +89 -0
- agent_decoder-0.3.2.dist-info/WHEEL +4 -0
- agent_decoder-0.3.2.dist-info/entry_points.txt +2 -0
- agent_decoder-0.3.2.dist-info/licenses/LICENSE +111 -0
- clau_decode/__init__.py +8 -0
- clau_decode/__main__.py +11 -0
- clau_decode/_auth_env.py +118 -0
- clau_decode/_pty_preexec.py +42 -0
- clau_decode/analytics/__init__.py +0 -0
- clau_decode/analytics/aggregator.py +55 -0
- clau_decode/analytics/cost.py +76 -0
- clau_decode/analytics/extractor.py +32 -0
- clau_decode/analytics/fast.py +289 -0
- clau_decode/analytics/models.py +49 -0
- clau_decode/analytics/pricing.py +162 -0
- clau_decode/analytics/prompt.py +34 -0
- clau_decode/analytics/service.py +23 -0
- clau_decode/analytics/stats.py +117 -0
- clau_decode/analytics/tips.py +176 -0
- clau_decode/btw_capture.py +290 -0
- clau_decode/cli.py +504 -0
- clau_decode/config.py +144 -0
- clau_decode/db.py +2054 -0
- clau_decode/driver_manager.py +387 -0
- clau_decode/drivers/__init__.py +27 -0
- clau_decode/drivers/base.py +170 -0
- clau_decode/drivers/registry.py +113 -0
- clau_decode/drivers/tmux_driver.py +488 -0
- clau_decode/editor.py +182 -0
- clau_decode/events_bus.py +69 -0
- clau_decode/locks.py +388 -0
- clau_decode/migrate.py +1313 -0
- clau_decode/models.py +285 -0
- clau_decode/parser.py +466 -0
- clau_decode/providers/__init__.py +30 -0
- clau_decode/providers/base.py +132 -0
- clau_decode/providers/claude.py +81 -0
- clau_decode/providers/codex.py +441 -0
- clau_decode/providers/registry.py +89 -0
- clau_decode/pty_native.py +39 -0
- clau_decode/pty_runner.py +2406 -0
- clau_decode/pty_screen_state.py +65 -0
- clau_decode/recap_runner.py +230 -0
- clau_decode/reporter.py +305 -0
- clau_decode/scanner.py +125 -0
- clau_decode/server.py +2841 -0
- clau_decode/static/android-chrome-192x192.png +0 -0
- clau_decode/static/android-chrome-512x512.png +0 -0
- clau_decode/static/app-icon.png +0 -0
- clau_decode/static/apple-touch-icon.png +0 -0
- clau_decode/static/assets/ChatView-BBVXuITs.js +79 -0
- clau_decode/static/assets/ChatView-BrP-ENHg.css +1 -0
- clau_decode/static/assets/Dashboard-3CYO4HQw.js +1 -0
- clau_decode/static/assets/FileViewer-BwbDc3ky.js +1 -0
- clau_decode/static/assets/HelpPopup-CPtECjYw.js +1 -0
- clau_decode/static/assets/ScrollContainer-BT_Dzxah.js +1 -0
- clau_decode/static/assets/SearchOverlay-DqI7aZaC.js +1 -0
- clau_decode/static/assets/SessionItem-DlyKg80u.js +1 -0
- clau_decode/static/assets/SettingsModal-CZBfMqx7.js +1 -0
- clau_decode/static/assets/ShortcutsPopup-W7CPdCzW.js +1 -0
- clau_decode/static/assets/Sidebar-BBswhEua.js +1 -0
- clau_decode/static/assets/client-DTSXvAb8.js +1 -0
- clau_decode/static/assets/fira-code-DGosTW8U.woff2 +0 -0
- clau_decode/static/assets/formatRelative-j86webkr.js +1 -0
- clau_decode/static/assets/hljs-B3O74O7Z.js +35 -0
- clau_decode/static/assets/index-BHdCOIkq.css +10 -0
- clau_decode/static/assets/index-DfKltZ6z.js +5 -0
- clau_decode/static/assets/ioskeley-mono-C7VR2-sL.woff2 +0 -0
- clau_decode/static/assets/jetbrains-mono-V6pRDFza.woff2 +0 -0
- clau_decode/static/assets/julia-mono-Cbvba6sW.woff2 +0 -0
- clau_decode/static/assets/libertinus-mono-Coz17E-O.woff2 +0 -0
- clau_decode/static/assets/monaspace-argon-RS-2TGNg.woff2 +0 -0
- clau_decode/static/assets/nativePtyFonts-BaXKtUsn.js +1 -0
- clau_decode/static/assets/react-Bi_azaFt.js +9 -0
- clau_decode/static/assets/renderSnippet-CqpQQugH.js +1 -0
- clau_decode/static/assets/rolldown-runtime-S-ySWqyJ.js +1 -0
- clau_decode/static/assets/shared-DdVGprvF.js +1 -0
- clau_decode/static/assets/source-code-pro-DEXWLoHG.woff2 +0 -0
- clau_decode/static/assets/spline-sans-mono-mUpA6Mve.woff2 +0 -0
- clau_decode/static/assets/ui-BcGPjpYn.js +1 -0
- clau_decode/static/assets/xanh-mono-Dsg19vWS.woff2 +0 -0
- clau_decode/static/favicon-16x16.png +0 -0
- clau_decode/static/favicon-32x32.png +0 -0
- clau_decode/static/favicon.ico +0 -0
- clau_decode/static/index.html +24 -0
- clau_decode/static/site.webmanifest +1 -0
- clau_decode/update_check.py +51 -0
- clau_decode/watcher.py +63 -0
clau_decode/watcher.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""File watcher — detects new/changed JSONL files and notifies the server via a queue.
|
|
2
|
+
|
|
3
|
+
Contract (for Agent 2 to implement):
|
|
4
|
+
watch_paths(root_paths: list[Path], queue: asyncio.Queue) -> None (async, runs forever)
|
|
5
|
+
- Use watchfiles.awatch to watch all root_paths recursively
|
|
6
|
+
- For each *.jsonl change, put a WatchEvent onto the queue
|
|
7
|
+
- Filter to only *.jsonl file changes (ignore everything else)
|
|
8
|
+
|
|
9
|
+
WatchEvent dataclass:
|
|
10
|
+
kind: Literal["created", "modified", "deleted"]
|
|
11
|
+
path: Path
|
|
12
|
+
|
|
13
|
+
The SSE endpoint in server.py consumes the queue and forwards events to clients.
|
|
14
|
+
|
|
15
|
+
SOLID notes:
|
|
16
|
+
- No direct knowledge of DB or parser — pure event emission
|
|
17
|
+
- Callers decide what to do with the events
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
import asyncio
|
|
23
|
+
from dataclasses import dataclass
|
|
24
|
+
from pathlib import Path
|
|
25
|
+
from typing import Literal
|
|
26
|
+
|
|
27
|
+
from watchfiles import Change, awatch
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass
|
|
31
|
+
class WatchEvent:
|
|
32
|
+
kind: Literal["created", "modified", "deleted"]
|
|
33
|
+
path: Path
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
async def watch_paths(root_paths: list[Path], queue: asyncio.Queue) -> None:
|
|
37
|
+
"""Watch all root_paths and emit WatchEvents for *.jsonl changes.
|
|
38
|
+
|
|
39
|
+
Runs indefinitely until cancelled. Filters filesystem events to only
|
|
40
|
+
``*.jsonl`` files and maps ``watchfiles.Change`` values to human-readable
|
|
41
|
+
``WatchEvent.kind`` strings before putting them on the queue.
|
|
42
|
+
|
|
43
|
+
Args:
|
|
44
|
+
root_paths: Directories to watch recursively. Non-existent paths are
|
|
45
|
+
silently skipped.
|
|
46
|
+
queue: Asyncio queue that the server's SSE endpoint drains.
|
|
47
|
+
"""
|
|
48
|
+
existing = [str(p) for p in root_paths if p.exists()]
|
|
49
|
+
if not existing:
|
|
50
|
+
return
|
|
51
|
+
|
|
52
|
+
_kind_map: dict[Change, Literal["created", "modified", "deleted"]] = {
|
|
53
|
+
Change.added: "created",
|
|
54
|
+
Change.modified: "modified",
|
|
55
|
+
Change.deleted: "deleted",
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async for changes in awatch(*existing, debounce=50):
|
|
59
|
+
for change_type, path_str in changes:
|
|
60
|
+
if not path_str.endswith(".jsonl"):
|
|
61
|
+
continue
|
|
62
|
+
kind = _kind_map.get(change_type, "modified")
|
|
63
|
+
await queue.put(WatchEvent(kind=kind, path=Path(path_str)))
|