fantoma 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.
Files changed (110) hide show
  1. fantoma-0.7.0/.github/workflows/publish.yml +30 -0
  2. fantoma-0.7.0/.gitignore +71 -0
  3. fantoma-0.7.0/Dockerfile +54 -0
  4. fantoma-0.7.0/LICENSE +21 -0
  5. fantoma-0.7.0/PKG-INFO +531 -0
  6. fantoma-0.7.0/PROGRESS.md +690 -0
  7. fantoma-0.7.0/README.md +490 -0
  8. fantoma-0.7.0/docker-compose.fantoma.yml +40 -0
  9. fantoma-0.7.0/docs/COMPETITIVE-ANALYSIS.md +82 -0
  10. fantoma-0.7.0/docs/proxy-vpn-guide.md +126 -0
  11. fantoma-0.7.0/docs/superpowers/plans/2026-03-25-captcha-sitekey-fix.md +526 -0
  12. fantoma-0.7.0/docs/superpowers/plans/2026-03-27-fantoma-v03-plan.md +690 -0
  13. fantoma-0.7.0/docs/superpowers/plans/2026-03-27-fantoma-v04-email-verification-plan.md +665 -0
  14. fantoma-0.7.0/docs/superpowers/plans/2026-03-28-full-code-audit.md +567 -0
  15. fantoma-0.7.0/docs/superpowers/plans/2026-03-29-fantoma-v05-plan.md +1778 -0
  16. fantoma-0.7.0/docs/superpowers/plans/2026-03-29-fantoma-v06-plan.md +1639 -0
  17. fantoma-0.7.0/docs/superpowers/plans/2026-03-30-fantoma-v06-dom-intelligence-plan.md +1176 -0
  18. fantoma-0.7.0/docs/superpowers/plans/2026-03-30-fantoma-v06-phase3-plan.md +1531 -0
  19. fantoma-0.7.0/docs/superpowers/plans/2026-04-01-fantoma-publish-readiness-plan.md +334 -0
  20. fantoma-0.7.0/docs/superpowers/specs/2026-03-27-fantoma-v03-llm-brain-design.md +207 -0
  21. fantoma-0.7.0/docs/superpowers/specs/2026-03-28-full-code-audit-design.md +110 -0
  22. fantoma-0.7.0/docs/superpowers/specs/2026-03-29-navigation-intelligence-design.md +314 -0
  23. fantoma-0.7.0/docs/superpowers/specs/2026-03-29-session-persistence-design.md +278 -0
  24. fantoma-0.7.0/docs/superpowers/specs/2026-03-30-fantoma-v06-phase3-design.md +258 -0
  25. fantoma-0.7.0/docs/superpowers/specs/2026-04-01-fantoma-publish-readiness-design.md +77 -0
  26. fantoma-0.7.0/examples/data_extraction.py +11 -0
  27. fantoma-0.7.0/examples/escalation.py +17 -0
  28. fantoma-0.7.0/examples/form_filling.py +13 -0
  29. fantoma-0.7.0/examples/local_llm.py +17 -0
  30. fantoma-0.7.0/examples/multi_tab.py +32 -0
  31. fantoma-0.7.0/examples/simple_search.py +14 -0
  32. fantoma-0.7.0/examples/tool_api.py +22 -0
  33. fantoma-0.7.0/examples/with_proxy.py +21 -0
  34. fantoma-0.7.0/fantoma/__init__.py +4 -0
  35. fantoma-0.7.0/fantoma/agent.py +333 -0
  36. fantoma-0.7.0/fantoma/browser/__init__.py +0 -0
  37. fantoma-0.7.0/fantoma/browser/actions.py +291 -0
  38. fantoma-0.7.0/fantoma/browser/consent.py +199 -0
  39. fantoma-0.7.0/fantoma/browser/email_verify.py +199 -0
  40. fantoma-0.7.0/fantoma/browser/engine.py +425 -0
  41. fantoma-0.7.0/fantoma/browser/fingerprint.py +218 -0
  42. fantoma-0.7.0/fantoma/browser/form_assist.py +157 -0
  43. fantoma-0.7.0/fantoma/browser/form_login.py +809 -0
  44. fantoma-0.7.0/fantoma/browser/form_memory.py +170 -0
  45. fantoma-0.7.0/fantoma/browser/humanize.py +78 -0
  46. fantoma-0.7.0/fantoma/browser/observer.py +200 -0
  47. fantoma-0.7.0/fantoma/browser/page_state.py +256 -0
  48. fantoma-0.7.0/fantoma/browser/proxy.py +176 -0
  49. fantoma-0.7.0/fantoma/browser/stealth.py +130 -0
  50. fantoma-0.7.0/fantoma/browser/verification.py +224 -0
  51. fantoma-0.7.0/fantoma/browser_tool.py +469 -0
  52. fantoma-0.7.0/fantoma/captcha/__init__.py +0 -0
  53. fantoma-0.7.0/fantoma/captcha/api_solver.py +107 -0
  54. fantoma-0.7.0/fantoma/captcha/detector.py +103 -0
  55. fantoma-0.7.0/fantoma/captcha/human_solver.py +65 -0
  56. fantoma-0.7.0/fantoma/captcha/orchestrator.py +259 -0
  57. fantoma-0.7.0/fantoma/captcha/pow_solver.py +38 -0
  58. fantoma-0.7.0/fantoma/captcha/sitekey.py +206 -0
  59. fantoma-0.7.0/fantoma/captcha/telegram_solver.py +154 -0
  60. fantoma-0.7.0/fantoma/cli.py +1078 -0
  61. fantoma-0.7.0/fantoma/config.py +88 -0
  62. fantoma-0.7.0/fantoma/dom/__init__.py +0 -0
  63. fantoma-0.7.0/fantoma/dom/accessibility.py +687 -0
  64. fantoma-0.7.0/fantoma/dom/diff.py +106 -0
  65. fantoma-0.7.0/fantoma/dom/extractor.py +469 -0
  66. fantoma-0.7.0/fantoma/dom/frames.py +107 -0
  67. fantoma-0.7.0/fantoma/dom/selectors.py +149 -0
  68. fantoma-0.7.0/fantoma/llm/__init__.py +0 -0
  69. fantoma-0.7.0/fantoma/llm/client.py +209 -0
  70. fantoma-0.7.0/fantoma/resilience/__init__.py +0 -0
  71. fantoma-0.7.0/fantoma/resilience/escalation.py +61 -0
  72. fantoma-0.7.0/fantoma/session.py +136 -0
  73. fantoma-0.7.0/fantoma_demo.gif +0 -0
  74. fantoma-0.7.0/pyproject.toml +45 -0
  75. fantoma-0.7.0/server.py +244 -0
  76. fantoma-0.7.0/stress_audit.py +225 -0
  77. fantoma-0.7.0/stress_test.py +425 -0
  78. fantoma-0.7.0/tests/conftest.py +19 -0
  79. fantoma-0.7.0/tests/test_adaptive_wait.py +39 -0
  80. fantoma-0.7.0/tests/test_browser_tool.py +410 -0
  81. fantoma-0.7.0/tests/test_captcha.py +165 -0
  82. fantoma-0.7.0/tests/test_captcha_edge_cases.py +418 -0
  83. fantoma-0.7.0/tests/test_dedup.py +72 -0
  84. fantoma-0.7.0/tests/test_dom_extractor.py +314 -0
  85. fantoma-0.7.0/tests/test_dom_modes.py +151 -0
  86. fantoma-0.7.0/tests/test_email_verify.py +197 -0
  87. fantoma-0.7.0/tests/test_engine_storage.py +11 -0
  88. fantoma-0.7.0/tests/test_field_state.py +57 -0
  89. fantoma-0.7.0/tests/test_fingerprint.py +80 -0
  90. fantoma-0.7.0/tests/test_form_assist.py +275 -0
  91. fantoma-0.7.0/tests/test_form_login.py +229 -0
  92. fantoma-0.7.0/tests/test_form_memory.py +104 -0
  93. fantoma-0.7.0/tests/test_frames.py +85 -0
  94. fantoma-0.7.0/tests/test_landmarks.py +268 -0
  95. fantoma-0.7.0/tests/test_llm_labeller.py +145 -0
  96. fantoma-0.7.0/tests/test_observer.py +82 -0
  97. fantoma-0.7.0/tests/test_page_state.py +80 -0
  98. fantoma-0.7.0/tests/test_paint_order.py +209 -0
  99. fantoma-0.7.0/tests/test_patchright.py +57 -0
  100. fantoma-0.7.0/tests/test_progress.py +231 -0
  101. fantoma-0.7.0/tests/test_pruning.py +74 -0
  102. fantoma-0.7.0/tests/test_server.py +83 -0
  103. fantoma-0.7.0/tests/test_session.py +119 -0
  104. fantoma-0.7.0/tests/test_traces.py +88 -0
  105. fantoma-0.7.0/tests/test_tree_diff.py +64 -0
  106. fantoma-0.7.0/tests/test_verification_flow.py +451 -0
  107. fantoma-0.7.0/tools/confidence_test.py +381 -0
  108. fantoma-0.7.0/tools/live_test.py +412 -0
  109. fantoma-0.7.0/tools/single_signup_test.py +82 -0
  110. fantoma-0.7.0/tools/x_probe.py +537 -0
@@ -0,0 +1,30 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ publish:
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ id-token: write
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: '3.12'
20
+
21
+ - name: Install build tools
22
+ run: pip install build
23
+
24
+ - name: Build package
25
+ run: python -m build
26
+
27
+ - name: Publish to PyPI
28
+ uses: pypa/gh-action-pypi-publish@release/v1
29
+ with:
30
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,71 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+
7
+ # Distribution / packaging
8
+ dist/
9
+ build/
10
+ *.egg-info/
11
+ *.egg
12
+
13
+ # Virtual environments
14
+ .venv/
15
+ venv/
16
+ ENV/
17
+
18
+ # Testing
19
+ .pytest_cache/
20
+ .coverage
21
+ htmlcov/
22
+
23
+ # IDE
24
+ .idea/
25
+ .vscode/
26
+ *.swp
27
+ *.swo
28
+
29
+ # OS
30
+ .DS_Store
31
+ Thumbs.db
32
+
33
+ # Fantoma runtime
34
+ monitor_logs/
35
+ stress_test_results*.json
36
+ stress_test*.log
37
+ signup_results*.json
38
+ signup_log*.txt
39
+ signup_output*.txt
40
+ phi_complex_results.json
41
+ overnight_results*.json
42
+ overnight_log*.txt
43
+ overnight_test.py
44
+ integration_test.py
45
+ integration_results.json
46
+ ux_review*.py
47
+ ux_review*.txt
48
+
49
+ # Test artifacts
50
+ tests/*_results.json
51
+ tests/real_*.py
52
+ tests/full_*.py
53
+ tests/live_*.py
54
+ tests/scenario_*.py
55
+ v03_fresh_results.json
56
+
57
+ # One-off scripts
58
+ hn_post.py
59
+ demo_script.sh
60
+ weekly_monitor.py
61
+
62
+ # Demo files (keep .gif for README)
63
+ fantoma_demo.cast
64
+ fantoma_demo.mp4
65
+
66
+ # Backup files
67
+ *.backup-*
68
+
69
+ # Docker secrets
70
+ .env
71
+ .worktrees/
@@ -0,0 +1,54 @@
1
+ FROM ubuntu:22.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+ ENV PYTHONDONTWRITEBYTECODE=1
5
+ ENV PYTHONUNBUFFERED=1
6
+
7
+ # System deps: Xvfb (virtual display), fonts, browser libs
8
+ RUN apt-get update && apt-get install -y --no-install-recommends \
9
+ python3 python3-pip python3-venv \
10
+ xvfb xauth \
11
+ # Fonts — realistic fingerprint, cover Windows + Mac + Linux families
12
+ fonts-liberation fonts-noto fonts-dejavu-core fonts-freefont-ttf \
13
+ fonts-noto-cjk fonts-noto-color-emoji \
14
+ # Browser runtime deps (Firefox/Camoufox needs these)
15
+ libgtk-3-0 libdbus-glib-1-2 libxt6 libx11-xcb1 \
16
+ libasound2 libpci3 libxcomposite1 libxdamage1 libxrandr2 \
17
+ libxkbcommon0 libgbm1 libpango-1.0-0 libcairo2 libatk1.0-0 \
18
+ # Networking tools (debug)
19
+ curl ca-certificates \
20
+ && rm -rf /var/lib/apt/lists/*
21
+
22
+ WORKDIR /app
23
+
24
+ # Install Python deps first (layer cache)
25
+ COPY pyproject.toml /app/
26
+ RUN pip3 install --no-cache-dir \
27
+ "camoufox>=0.4" \
28
+ "playwright>=1.40" \
29
+ "httpx>=0.25" \
30
+ "capsolver" \
31
+ "flask>=3.0" \
32
+ && pip3 install --no-cache-dir -e /app 2>/dev/null || true
33
+
34
+ # Download Camoufox browser binary (must succeed — no runtime fetch)
35
+ RUN python3 -m camoufox fetch
36
+
37
+ # Copy Fantoma source
38
+ COPY . /app
39
+
40
+ # Install Fantoma properly
41
+ RUN pip3 install --no-cache-dir -e ".[captcha]"
42
+
43
+ # Xvfb display setup
44
+ ENV DISPLAY=:99
45
+
46
+ # Create dirs Fantoma expects
47
+ RUN mkdir -p /root/.local/share/fantoma/traces \
48
+ /root/.local/share/fantoma/sessions \
49
+ /root/.local/share/fantoma/form_memory
50
+
51
+ EXPOSE 7860
52
+
53
+ # Start Xvfb + server
54
+ CMD ["sh", "-c", "Xvfb :99 -screen 0 1920x1080x24 -ac +extension GLX &>/dev/null & sleep 1 && python3 /app/server.py"]
fantoma-0.7.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Steam Vibe Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.