Skip to content

Commit 61bb6f6

Browse files
authored
Merge pull request #70 from VectorlyApp/agent-refactor
Agent refactor
2 parents 73681d4 + 95f9432 commit 61bb6f6

File tree

22 files changed

+1543
-627
lines changed

22 files changed

+1543
-627
lines changed

.github/workflows/publish.yml

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
pull_request:
7+
paths:
8+
- 'pyproject.toml'
9+
- 'web_hacker/**'
10+
- '.github/workflows/publish.yml'
11+
workflow_dispatch:
12+
inputs:
13+
dry_run:
14+
description: 'Dry run (build only, no publish)'
15+
required: false
16+
default: false
17+
type: boolean
18+
19+
jobs:
20+
build:
21+
name: Build distribution
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.12'
30+
31+
- name: Install build dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install build hatchling
35+
36+
- name: Build package
37+
run: python -m build
38+
39+
- name: Check version not already published
40+
if: github.event_name == 'release'
41+
run: |
42+
VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
43+
echo "Package version: $VERSION"
44+
45+
# Check if version exists on PyPI
46+
if pip index versions web-hacker 2>/dev/null | grep -q "$VERSION"; then
47+
echo "::error::Version $VERSION already exists on PyPI! Update version in pyproject.toml"
48+
exit 1
49+
fi
50+
echo "✓ Version $VERSION is new and ready to publish"
51+
52+
- name: List built artifacts
53+
run: ls -la dist/
54+
55+
- name: Test local install
56+
run: |
57+
pip install dist/*.whl
58+
python -c "import web_hacker; print('Successfully imported web_hacker')"
59+
60+
- name: Upload distribution artifacts
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: python-package-distributions
64+
path: dist/
65+
66+
publish-testpypi:
67+
name: Publish to TestPyPI
68+
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run != 'true')
69+
needs: build
70+
runs-on: ubuntu-latest
71+
environment:
72+
name: release
73+
url: https://test.pypi.org/p/web-hacker
74+
permissions:
75+
id-token: write
76+
steps:
77+
- name: Download distribution artifacts
78+
uses: actions/download-artifact@v4
79+
with:
80+
name: python-package-distributions
81+
path: dist/
82+
83+
- name: Publish to TestPyPI
84+
uses: pypa/gh-action-pypi-publish@release/v1
85+
with:
86+
repository-url: https://test.pypi.org/legacy/
87+
88+
test-install:
89+
name: Test install from TestPyPI
90+
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run != 'true')
91+
needs: publish-testpypi
92+
runs-on: ubuntu-latest
93+
steps:
94+
- name: Set up Python
95+
uses: actions/setup-python@v5
96+
with:
97+
python-version: '3.12'
98+
99+
- name: Wait for TestPyPI to index package
100+
run: sleep 60
101+
102+
- name: Test install from TestPyPI
103+
run: |
104+
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ web-hacker
105+
python -c "import web_hacker; print('Successfully imported web_hacker')"
106+
107+
publish-pypi:
108+
name: Publish to PyPI
109+
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run != 'true')
110+
needs: test-install
111+
runs-on: ubuntu-latest
112+
environment:
113+
name: release
114+
url: https://pypi.org/p/web-hacker
115+
permissions:
116+
id-token: write
117+
steps:
118+
- name: Download distribution artifacts
119+
uses: actions/download-artifact@v4
120+
with:
121+
name: python-package-distributions
122+
path: dist/
123+
124+
- name: Publish to PyPI
125+
uses: pypa/gh-action-pypi-publish@release/v1
126+
127+
verify-pypi:
128+
name: Verify install from PyPI
129+
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run != 'true')
130+
needs: publish-pypi
131+
runs-on: ubuntu-latest
132+
steps:
133+
- name: Set up Python
134+
uses: actions/setup-python@v5
135+
with:
136+
python-version: '3.12'
137+
138+
- name: Wait for PyPI to index package
139+
run: sleep 60
140+
141+
- name: Test install from PyPI
142+
run: |
143+
pip install web-hacker
144+
python -c "import web_hacker; print('Successfully imported web_hacker from PyPI')"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ The fastest way to get started is using the quickstart script, which automates t
277277

278278
```bash
279279
# Make sure web-hacker is installed
280-
pip install web-hacker
280+
pip install web-hacker # Or install from the latest code
281281

282282
# Set your OpenAI API key
283283
export OPENAI_API_KEY="sk-..."

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66

77
[project]
88
name = "web-hacker"
9-
version = "1.2.0"
9+
version = "1.2.1"
1010
description = "SDK for reverse engineering web apps"
1111
readme = "README.md"
1212
requires-python = ">=3.12.3,<3.13"
@@ -40,6 +40,7 @@ dependencies = [
4040
"python-dotenv>=1.2.1",
4141
"requests>=2.31.0",
4242
"tldextract>=5.1.0",
43+
"toonify[pydantic]>=1.5.1",
4344
"websockets>=15.0.1",
4445
"websocket-client>=1.6.0",
4546
"beautifulsoup4>=4.14.2",
@@ -54,7 +55,7 @@ dev = [
5455

5556
[project.scripts]
5657
web-hacker-monitor = "web_hacker.scripts.browser_monitor:main"
57-
web-hacker-discover = "web_hacker.scripts.discover_routines:main"
58+
web-hacker-discover = "web_hacker.scripts.discover_routine:main"
5859
web-hacker-execute = "web_hacker.scripts.execute_routine:main"
5960

6061
[project.urls]

0 commit comments

Comments
 (0)