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.

Files changed (59) hide show
  1. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/CHANGELOG.md +14 -0
  2. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/PKG-INFO +1 -1
  3. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/pyproject.toml +1 -1
  4. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/TIPS.md +6 -5
  5. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/to_model.py +10 -3
  6. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/.gitignore +0 -0
  7. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/ARCHITECTURE.md +0 -0
  8. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/README.md +0 -0
  9. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/data/filters.json +0 -0
  10. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/extension/content.js +0 -0
  11. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/extension/manifest.json +0 -0
  12. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/extension/sidepanel.html +0 -0
  13. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/extension/sidepanel.js +0 -0
  14. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/llms.txt +0 -0
  15. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/VISION.md +0 -0
  16. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/__init__.py +0 -0
  17. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/api.py +0 -0
  18. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/app.py +0 -0
  19. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/cdp/README.md +0 -0
  20. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/cdp/__init__.py +0 -0
  21. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/cdp/query.py +0 -0
  22. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/cdp/schema/README.md +0 -0
  23. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/cdp/schema/cdp_protocol.json +0 -0
  24. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/cdp/schema/cdp_version.json +0 -0
  25. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/cdp/session.py +0 -0
  26. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/DEVELOPER_GUIDE.md +0 -0
  27. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/__init__.py +0 -0
  28. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/_builders.py +0 -0
  29. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/_tips.py +0 -0
  30. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/_utils.py +0 -0
  31. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/body.py +0 -0
  32. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/connection.py +0 -0
  33. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/console.py +0 -0
  34. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/events.py +0 -0
  35. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/fetch.py +0 -0
  36. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/filters.py +0 -0
  37. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/inspect.py +0 -0
  38. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/javascript.py +0 -0
  39. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/launch.py +0 -0
  40. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/navigation.py +0 -0
  41. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/network.py +0 -0
  42. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/selections.py +0 -0
  43. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/server.py +0 -0
  44. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/commands/setup.py +0 -0
  45. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/filters.py +0 -0
  46. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/README.md +0 -0
  47. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/__init__.py +0 -0
  48. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/body.py +0 -0
  49. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/console.py +0 -0
  50. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/dom.py +0 -0
  51. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/fetch.py +0 -0
  52. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/main.py +0 -0
  53. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/network.py +0 -0
  54. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/setup/__init__.py +0 -0
  55. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/setup/chrome.py +0 -0
  56. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/setup/desktop.py +0 -0
  57. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/setup/extension.py +0 -0
  58. {webtap_tool-0.6.0 → webtap_tool-0.7.0}/src/webtap/services/setup/filters.py +0 -0
  59. {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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: webtap-tool
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: Terminal-based web page inspector for AI debugging sessions
5
5
  Author-email: Fredrik Angelsen <fredrikangelsen@gmail.com>
6
6
  Classifier: Development Status :: 3 - Alpha
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "webtap-tool"
3
- version = "0.6.0"
3
+ version = "0.7.0"
4
4
  description = "Terminal-based web page inspector for AI debugging sessions"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -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") # Generate from full response
42
- to_model(123, "models/customer.py", json_path="Data[0]") # Extract nested object
43
- to_model(123, "/tmp/model.py", json_path="items") # Extract array items
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/product.py")
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={"Output": str(output_path), "Fields": field_count, "Size": f"{output_path.stat().st_size} bytes"},
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