webtap-tool 0.6.0__tar.gz → 0.7.0__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.6.0 → webtap_tool-0.7.0}/CHANGELOG.md +14 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/PKG-INFO +1 -1
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/pyproject.toml +1 -1
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/TIPS.md +6 -5
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/to_model.py +10 -3
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/.gitignore +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/ARCHITECTURE.md +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/README.md +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/data/filters.json +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/extension/content.js +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/extension/manifest.json +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/extension/sidepanel.html +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/extension/sidepanel.js +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/llms.txt +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/VISION.md +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/__init__.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/api.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/app.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/cdp/README.md +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/cdp/__init__.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/cdp/query.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/cdp/schema/README.md +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/cdp/schema/cdp_protocol.json +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/cdp/schema/cdp_version.json +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/cdp/session.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/DEVELOPER_GUIDE.md +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/__init__.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/_builders.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/_tips.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/_utils.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/body.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/connection.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/console.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/events.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/fetch.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/filters.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/inspect.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/javascript.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/launch.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/navigation.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/network.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/selections.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/server.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/setup.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/filters.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/README.md +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/__init__.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/body.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/console.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/dom.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/fetch.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/main.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/network.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/setup/__init__.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/setup/chrome.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/setup/desktop.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/setup/extension.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/setup/filters.py +0 -0
- {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/setup/platform.py +0 -0
|
@@ -15,6 +15,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
15
15
|
|
|
16
16
|
### Removed
|
|
17
17
|
|
|
18
|
+
## [0.7.0] - 2025-10-10
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- **BREAKING**: `to_model()` now requires `model_name` parameter for explicit class naming
|
|
24
|
+
- Old: `to_model(123, "models/product.py", json_path="Data[0]")`
|
|
25
|
+
- New: `to_model(123, "models/product.py", "Product", json_path="Data[0]")`
|
|
26
|
+
- Enforces best practice: always specify what you're generating
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
### Removed
|
|
31
|
+
|
|
18
32
|
## [0.6.0] - 2025-10-10
|
|
19
33
|
|
|
20
34
|
### Added
|
|
@@ -26,7 +26,7 @@ body(123, "msgpack.unpackb(body)") # Binary formats
|
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
#### Tips
|
|
29
|
-
- **Generate models:** `to_model({id}, "models/model.py")` - create Pydantic models from JSON
|
|
29
|
+
- **Generate models:** `to_model({id}, "models/model.py", "Model")` - create Pydantic models from JSON
|
|
30
30
|
- **Chain requests:** `body({id}, "httpx.get(json.loads(body)['next_url']).text[:100]")`
|
|
31
31
|
- **Parse XML:** `body({id}, "ElementTree.fromstring(body).find('.//title').text")`
|
|
32
32
|
- **Extract forms:** `body({id}, "[f['action'] for f in bs4(body, 'html.parser').find_all('form')]")`
|
|
@@ -38,13 +38,14 @@ Generate Pydantic v2 models from JSON response bodies for reverse engineering AP
|
|
|
38
38
|
|
|
39
39
|
#### Examples
|
|
40
40
|
```python
|
|
41
|
-
to_model(123, "models/product.py")
|
|
42
|
-
to_model(123, "models/
|
|
43
|
-
to_model(123, "/tmp/
|
|
41
|
+
to_model(123, "models/product.py", "Product") # Generate from full response
|
|
42
|
+
to_model(123, "models/customers/group.py", "CustomerGroup", "Data[0]") # Extract nested + domain structure
|
|
43
|
+
to_model(123, "/tmp/item.py", "Item", "items[0]") # Extract array items
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
#### Tips
|
|
47
47
|
- **Check structure first:** `body({id})` - preview JSON before generating
|
|
48
|
+
- **Domain organization:** Use paths like `"models/customers/group.py"` for structure
|
|
48
49
|
- **Extract nested data:** Use `json_path="Data[0]"` to extract specific objects
|
|
49
50
|
- **Array items:** Extract first item with `json_path="items[0]"` for model generation
|
|
50
51
|
- **Auto-cleanup:** Generated models use snake_case fields and modern type hints (list, dict, | None)
|
|
@@ -80,7 +81,7 @@ Show network requests with full data.
|
|
|
80
81
|
|
|
81
82
|
#### Tips
|
|
82
83
|
- **Analyze responses:** `body({id})` - fetch response body
|
|
83
|
-
- **Generate models:** `to_model({id}, "models/model.py")` - create Pydantic models from JSON
|
|
84
|
+
- **Generate models:** `to_model({id}, "models/model.py", "Model")` - create Pydantic models from JSON
|
|
84
85
|
- **Parse HTML:** `body({id}, "bs4(body, 'html.parser').find('title').text")`
|
|
85
86
|
- **Extract JSON:** `body({id}, "json.loads(body)['data']")`
|
|
86
87
|
- **Find patterns:** `body({id}, "re.findall(r'/api/\\w+', body)")`
|
|
@@ -12,12 +12,13 @@ mcp_desc = get_mcp_description("to_model")
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
@app.command(display="markdown", fastmcp={"type": "tool", "description": mcp_desc} if mcp_desc else {"type": "tool"})
|
|
15
|
-
def to_model(state, response: int, output: str, json_path: str = None) -> dict: # pyright: ignore[reportArgumentType]
|
|
15
|
+
def to_model(state, response: int, output: str, model_name: str, json_path: str = None) -> dict: # pyright: ignore[reportArgumentType]
|
|
16
16
|
"""Generate Pydantic model from response body using datamodel-codegen.
|
|
17
17
|
|
|
18
18
|
Args:
|
|
19
19
|
response: Response row ID from network() table
|
|
20
|
-
output: Output file path for generated model (e.g., "models/
|
|
20
|
+
output: Output file path for generated model (e.g., "models/customers/group.py")
|
|
21
|
+
model_name: Class name for generated model (e.g., "CustomerGroup")
|
|
21
22
|
json_path: Optional JSON path to extract nested data (e.g., "Data[0]")
|
|
22
23
|
|
|
23
24
|
Returns:
|
|
@@ -102,6 +103,7 @@ def to_model(state, response: int, output: str, json_path: str = None) -> dict:
|
|
|
102
103
|
input_filename="response.json",
|
|
103
104
|
output=output_path,
|
|
104
105
|
output_model_type=DataModelType.PydanticV2BaseModel,
|
|
106
|
+
class_name=model_name, # Set generated class name
|
|
105
107
|
snake_case_field=True, # Convert to snake_case
|
|
106
108
|
use_standard_collections=True, # Use list instead of List
|
|
107
109
|
use_union_operator=True, # Use | instead of Union
|
|
@@ -125,5 +127,10 @@ def to_model(state, response: int, output: str, json_path: str = None) -> dict:
|
|
|
125
127
|
|
|
126
128
|
return success_response(
|
|
127
129
|
"Model generated successfully",
|
|
128
|
-
details={
|
|
130
|
+
details={
|
|
131
|
+
"Class": model_name,
|
|
132
|
+
"Output": str(output_path),
|
|
133
|
+
"Fields": field_count,
|
|
134
|
+
"Size": f"{output_path.stat().st_size} bytes",
|
|
135
|
+
},
|
|
129
136
|
)
|
|
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
|