webtap-tool 0.8.0__tar.gz → 0.8.1__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.
Potentially problematic release.
This version of webtap-tool might be problematic. Click here for more details.
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/CHANGELOG.md +11 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/PKG-INFO +1 -1
- webtap_tool-0.8.1/docs/summaries/HANDOFF_2025-10-16_223809.md +125 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/pyproject.toml +1 -1
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/services/setup/extension.py +1 -1
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/.gitignore +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/ARCHITECTURE.md +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/README.md +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/data/filters.json +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/docs/summaries/HANDOFF_2025-10-16.md +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/extension/background.js +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/extension/content.js +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/extension/manifest.json +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/extension/sidepanel.html +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/extension/sidepanel.js +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/llms.txt +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/VISION.md +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/__init__.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/api.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/app.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/cdp/README.md +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/cdp/__init__.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/cdp/query.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/cdp/schema/README.md +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/cdp/schema/cdp_protocol.json +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/cdp/schema/cdp_version.json +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/cdp/session.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/DEVELOPER_GUIDE.md +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/TIPS.md +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/__init__.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/_builders.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/_code_generation.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/_tips.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/_utils.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/body.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/connection.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/console.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/events.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/fetch.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/filters.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/inspect.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/javascript.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/launch.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/navigation.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/network.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/quicktype.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/selections.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/server.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/setup.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/commands/to_model.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/filters.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/services/README.md +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/services/__init__.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/services/body.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/services/console.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/services/dom.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/services/fetch.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/services/main.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/services/network.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/services/setup/__init__.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/services/setup/chrome.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/services/setup/desktop.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/services/setup/filters.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/services/setup/platform.py +0 -0
- {webtap_tool-0.8.0 → webtap_tool-0.8.1}/src/webtap/services/state_snapshot.py +0 -0
|
@@ -15,6 +15,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
15
15
|
|
|
16
16
|
### Removed
|
|
17
17
|
|
|
18
|
+
## [0.8.1] - 2025-10-16
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- **Extension setup**: Added missing `background.js` to downloaded extension files (setup-extension command now downloads all 5 required files)
|
|
26
|
+
|
|
27
|
+
### Removed
|
|
28
|
+
|
|
18
29
|
## [0.8.0] - 2025-10-16
|
|
19
30
|
|
|
20
31
|
### Added
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# WebTap Session Handoff - 2025-10-16
|
|
2
|
+
|
|
3
|
+
## Accomplishments
|
|
4
|
+
|
|
5
|
+
### Critical Bug Fix: Reconnection After Page Crashes
|
|
6
|
+
- **Problem**: When a connected page crashed/closed, WebTap couldn't reconnect (got "Already connected" error)
|
|
7
|
+
- **Root cause**: `CDPSession._on_close()` never cleared `ws_app` and `page_info` state
|
|
8
|
+
- **Solution**: Proper state lifecycle management
|
|
9
|
+
- `_on_close()` now clears state after detecting unexpected disconnect
|
|
10
|
+
- `disconnect()` preserves DB thread and events (only `cleanup()` stops DB thread)
|
|
11
|
+
- Added `atexit` hook for proper cleanup on app exit
|
|
12
|
+
- Events now persist across connection cycles (cleared only by Clear button or exit)
|
|
13
|
+
- **Files changed**:
|
|
14
|
+
- `cdp/session.py`: Added `cleanup()`, modified `disconnect()` and `_on_close()`
|
|
15
|
+
- `app.py`: Added `atexit` registration
|
|
16
|
+
- `__init__.py`: Wire up cleanup on exit
|
|
17
|
+
- `services/main.py`: `_handle_unexpected_disconnect()` preserves events
|
|
18
|
+
|
|
19
|
+
### Code Generation Features
|
|
20
|
+
- **New quicktype command**: Generate types for 12+ languages (TypeScript, Go, Rust, Python, etc.)
|
|
21
|
+
- Auto-detects language from file extension
|
|
22
|
+
- Language-aware header comments with event metadata
|
|
23
|
+
- Full quicktype CLI options support via `options` dict
|
|
24
|
+
- **Request body support**: `body()` and `to_model()` now work with POST/PUT/PATCH requests
|
|
25
|
+
- Auto-detects `Network.requestWillBeSent` events and fetches POST data
|
|
26
|
+
- Returns event data for `expr` evaluation on any CDP event type
|
|
27
|
+
- **Refactoring**: Created `_code_generation.py` with shared utilities
|
|
28
|
+
- Eliminated 166 duplicate lines across `to_model()` and `quicktype()`
|
|
29
|
+
- Reduced queries from 2→1 per generation call
|
|
30
|
+
- New `BodyService.prepare_for_generation()` orchestrator
|
|
31
|
+
|
|
32
|
+
### Extension Safety & UX
|
|
33
|
+
- **Safety**: Eliminated XSS/encoding issues
|
|
34
|
+
- Replaced UTF-8 cross (✕) with pure CSS icon
|
|
35
|
+
- All `innerHTML` replaced with safe DOM creation
|
|
36
|
+
- New `showError()` and `showMessage()` helpers with auto-escaping
|
|
37
|
+
- **UX**: Added "Reload Pages" button for manual page list refresh
|
|
38
|
+
- **UX**: Context menu for switching between sidepanel and popup window modes
|
|
39
|
+
- **Concurrency**: Added global operation lock to prevent concurrent button operations
|
|
40
|
+
|
|
41
|
+
### State Management Improvements
|
|
42
|
+
- **Thread-safe SSE**: New immutable snapshot architecture
|
|
43
|
+
- `StateSnapshot` frozen dataclass with atomic updates
|
|
44
|
+
- `WebTapService._create_snapshot()` and `_trigger_broadcast()` replace direct broadcasts
|
|
45
|
+
- All service mutations trigger snapshot updates via RLock-protected operations
|
|
46
|
+
- **Service layer**: Broadcast callback pattern (DOMService, FetchService use callbacks instead of direct queue access)
|
|
47
|
+
|
|
48
|
+
### Tips System
|
|
49
|
+
- Added contextual tips to `page()` and `pages()` commands
|
|
50
|
+
- `info_response()` now supports `tips` parameter (matches `table_response()`)
|
|
51
|
+
|
|
52
|
+
## Current Status
|
|
53
|
+
|
|
54
|
+
**Production Ready**
|
|
55
|
+
|
|
56
|
+
- All linting passed (ruff check)
|
|
57
|
+
- Type checking passed (basedpyright)
|
|
58
|
+
- Released as webtap-tool 0.8.0 to PyPI
|
|
59
|
+
- No known blockers
|
|
60
|
+
|
|
61
|
+
## Key Files
|
|
62
|
+
|
|
63
|
+
### Changed Files (24 total)
|
|
64
|
+
- **Core fixes**: `cdp/session.py`, `services/main.py`, `app.py`, `__init__.py`
|
|
65
|
+
- **New features**: `commands/quicktype.py`, `commands/_code_generation.py`, `services/state_snapshot.py`
|
|
66
|
+
- **Extension**: `extension/sidepanel.js`, `extension/sidepanel.html`, `extension/background.js`
|
|
67
|
+
- **Refactored**: `services/body.py`, `commands/to_model.py`, `commands/body.py`
|
|
68
|
+
- **Docs**: `commands/TIPS.md`, `commands/_builders.py`, `commands/connection.py`, `commands/navigation.py`
|
|
69
|
+
|
|
70
|
+
### Architecture Documents
|
|
71
|
+
- `src/webtap/VISION.md` - Native CDP storage philosophy
|
|
72
|
+
- `commands/DEVELOPER_GUIDE.md` - Command development patterns
|
|
73
|
+
- `commands/TIPS.md` - User-facing tips with examples
|
|
74
|
+
|
|
75
|
+
### Changelogs
|
|
76
|
+
- `.claude/CHANGELOG.md` - Documented new `/handoff` command
|
|
77
|
+
- `packages/webtap/CHANGELOG.md` - Full 0.8.0 release notes
|
|
78
|
+
|
|
79
|
+
## Next Steps
|
|
80
|
+
|
|
81
|
+
**No immediate tasks** - system is stable and released.
|
|
82
|
+
|
|
83
|
+
## Future Work
|
|
84
|
+
|
|
85
|
+
### Nice-to-Have Enhancements
|
|
86
|
+
1. **HAR export command** (~100 lines)
|
|
87
|
+
- Map CDP events → HAR format for compatibility with other tools
|
|
88
|
+
- Reference: Network Timing API spec
|
|
89
|
+
|
|
90
|
+
2. **Service Worker commands**
|
|
91
|
+
- CDP has dedicated ServiceWorker domain (already works via `events()` with expr)
|
|
92
|
+
- Could add convenience commands if needed
|
|
93
|
+
|
|
94
|
+
3. **Code cleanup opportunities**
|
|
95
|
+
- Extract `_insert_header()` to shared utils if `to_model()` needs headers
|
|
96
|
+
- Consolidate language detection map (currently duplicated in 2 files)
|
|
97
|
+
- Standardize error response builders
|
|
98
|
+
|
|
99
|
+
### Architecture Insights
|
|
100
|
+
- **Service layer owns orchestration**: `prepare_for_generation()` lives in BodyService (has state, domain knowledge)
|
|
101
|
+
- **Utils stay pure**: `_code_generation.py` has no dependencies, pure transforms
|
|
102
|
+
- **expr is universal**: Works for ANY CDP event type, no special cases needed
|
|
103
|
+
- **DB lifecycle**: Tied to app lifetime (not connection lifetime) for event preservation
|
|
104
|
+
|
|
105
|
+
## Testing Evidence
|
|
106
|
+
|
|
107
|
+
- Manual testing: Page crash → reconnect → works
|
|
108
|
+
- Extension tested: Reload button, safe HTML rendering
|
|
109
|
+
- Code generation tested: quicktype with multiple languages
|
|
110
|
+
- Linting: `ruff check packages/webtap/src --fix`
|
|
111
|
+
- Type checking: `basedpyright packages/webtap/src`
|
|
112
|
+
- Released to PyPI: webtap-tool 0.8.0
|
|
113
|
+
|
|
114
|
+
## Commits This Session
|
|
115
|
+
```
|
|
116
|
+
0572ced feat(webtap): fix reconnection and add code generation features
|
|
117
|
+
b53608e chore(claude): add handoff slash command
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Statistics
|
|
121
|
+
- **Lines changed**: +1,544 / -360
|
|
122
|
+
- **Files modified**: 24
|
|
123
|
+
- **New files**: 4 (background.js, _code_generation.py, quicktype.py, state_snapshot.py)
|
|
124
|
+
- **Duplicate code removed**: 166 lines
|
|
125
|
+
- **Query optimization**: 2 queries → 1 per generation call
|
|
@@ -12,7 +12,7 @@ logger = logging.getLogger(__name__)
|
|
|
12
12
|
|
|
13
13
|
# GitHub URLs for extension files
|
|
14
14
|
EXTENSION_BASE_URL = "https://raw.githubusercontent.com/angelsen/tap-tools/main/packages/webtap/extension"
|
|
15
|
-
EXTENSION_FILES = ["manifest.json", "content.js", "sidepanel.html", "sidepanel.js"]
|
|
15
|
+
EXTENSION_FILES = ["manifest.json", "background.js", "content.js", "sidepanel.html", "sidepanel.js"]
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class ExtensionSetupService:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|