antigravity-remote 3.1.0__py3-none-any.whl

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.
@@ -0,0 +1,98 @@
1
+ """OCR utilities for Antigravity Remote."""
2
+
3
+ import logging
4
+ from typing import Optional, Tuple
5
+
6
+ import mss
7
+ from PIL import Image
8
+
9
+ logger = logging.getLogger(__name__)
10
+
11
+ # Lazy import pytesseract
12
+ _pytesseract = None
13
+
14
+
15
+ def _get_pytesseract():
16
+ """Lazy load pytesseract with path configuration."""
17
+ global _pytesseract
18
+ if _pytesseract is None:
19
+ try:
20
+ import pytesseract
21
+ from ..config import config
22
+
23
+ if config.tesseract_path:
24
+ pytesseract.pytesseract.tesseract_cmd = config.tesseract_path
25
+
26
+ _pytesseract = pytesseract
27
+ except ImportError:
28
+ logger.error("pytesseract not installed. Run: pip install pytesseract")
29
+ raise
30
+ return _pytesseract
31
+
32
+
33
+ def scan_screen() -> Tuple[str, int]:
34
+ """
35
+ Capture screenshot and extract text using OCR.
36
+
37
+ Returns:
38
+ Tuple of (extracted text, image hash for change detection).
39
+ """
40
+ pytesseract = _get_pytesseract()
41
+
42
+ with mss.mss() as sct:
43
+ monitor = sct.monitors[1]
44
+ sct_img = sct.grab(monitor)
45
+ img = Image.frombytes('RGB', sct_img.size, sct_img.bgra, 'raw', 'BGRX')
46
+
47
+ # Extract text
48
+ text = pytesseract.image_to_string(img).lower()
49
+
50
+ # Simple hash for change detection (first 10KB of image data)
51
+ img_hash = hash(img.tobytes()[:10000])
52
+
53
+ return text, img_hash
54
+
55
+
56
+ # Keyword lists for detection
57
+ APPROVAL_KEYWORDS = [
58
+ "run command", "accept changes", "proceed", "approve",
59
+ "allow", "confirm", "yes or no", "y/n", "always allow",
60
+ "do you want", "permission", "authorize"
61
+ ]
62
+
63
+ DONE_KEYWORDS = [
64
+ "anything else", "let me know", "task complete", "done!",
65
+ "successfully", "finished", "completed", "all set",
66
+ "ready for", "is there anything"
67
+ ]
68
+
69
+ ERROR_KEYWORDS = [
70
+ "error:", "failed", "exception", "traceback", "cannot",
71
+ "permission denied", "not found", "invalid", "quota exceeded"
72
+ ]
73
+
74
+
75
+ def detect_keywords(text: str) -> Optional[Tuple[str, str]]:
76
+ """
77
+ Detect important keywords in screen text.
78
+
79
+ Args:
80
+ text: The OCR-extracted text to search.
81
+
82
+ Returns:
83
+ Tuple of (category, keyword) if detected, None otherwise.
84
+ Categories: 'approval', 'done', 'error'
85
+ """
86
+ for keyword in APPROVAL_KEYWORDS:
87
+ if keyword in text:
88
+ return ('approval', keyword)
89
+
90
+ for keyword in DONE_KEYWORDS:
91
+ if keyword in text:
92
+ return ('done', keyword)
93
+
94
+ for keyword in ERROR_KEYWORDS:
95
+ if keyword in text:
96
+ return ('error', keyword)
97
+
98
+ return None
@@ -0,0 +1,49 @@
1
+ """Screenshot utilities for Antigravity Remote."""
2
+
3
+ import logging
4
+ import os
5
+ import tempfile
6
+ from typing import Optional
7
+
8
+ import mss
9
+ import mss.tools
10
+
11
+ logger = logging.getLogger(__name__)
12
+
13
+
14
+ def take_screenshot() -> Optional[str]:
15
+ """
16
+ Capture a screenshot of the primary monitor.
17
+
18
+ Returns:
19
+ Path to the temporary screenshot file, or None on failure.
20
+ """
21
+ try:
22
+ with mss.mss() as sct:
23
+ monitor = sct.monitors[1] # Primary monitor
24
+ sct_img = sct.grab(monitor)
25
+
26
+ # Save to temp file
27
+ with tempfile.NamedTemporaryFile(suffix=".png", delete=False) as tmp:
28
+ mss.tools.to_png(sct_img.rgb, sct_img.size, output=tmp.name)
29
+ logger.debug(f"Screenshot saved to {tmp.name}")
30
+ return tmp.name
31
+
32
+ except Exception as e:
33
+ logger.error(f"Error taking screenshot: {e}")
34
+ return None
35
+
36
+
37
+ def cleanup_screenshot(path: str) -> None:
38
+ """
39
+ Remove a temporary screenshot file.
40
+
41
+ Args:
42
+ path: Path to the screenshot file.
43
+ """
44
+ try:
45
+ if path and os.path.exists(path):
46
+ os.remove(path)
47
+ logger.debug(f"Cleaned up screenshot: {path}")
48
+ except Exception as e:
49
+ logger.warning(f"Error cleaning up screenshot: {e}")
@@ -0,0 +1,114 @@
1
+ Metadata-Version: 2.4
2
+ Name: antigravity-remote
3
+ Version: 3.1.0
4
+ Summary: Remote control your Antigravity AI assistant via Telegram
5
+ Project-URL: Homepage, https://github.com/kubrat/antigravity-remote
6
+ Project-URL: Repository, https://github.com/kubrat/antigravity-remote
7
+ Author: Kubrat
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: ai,antigravity,automation,bot,remote,telegram
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: Microsoft :: Windows
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Communications :: Chat
20
+ Requires-Python: >=3.10
21
+ Requires-Dist: fastapi>=0.95.0
22
+ Requires-Dist: mss>=9.0.0
23
+ Requires-Dist: pillow>=10.0.0
24
+ Requires-Dist: pyautogui>=0.9.53
25
+ Requires-Dist: pydub>=0.25.1
26
+ Requires-Dist: pygetwindow>=0.0.9
27
+ Requires-Dist: pyperclip>=1.8.2
28
+ Requires-Dist: python-telegram-bot>=20.0
29
+ Requires-Dist: speechrecognition>=3.10.0
30
+ Requires-Dist: uvicorn>=0.21.0
31
+ Requires-Dist: websockets>=10.0
32
+ Provides-Extra: dev
33
+ Requires-Dist: black>=23.0.0; extra == 'dev'
34
+ Requires-Dist: mypy>=1.0.0; extra == 'dev'
35
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
36
+ Provides-Extra: voice
37
+ Requires-Dist: speechrecognition>=3.10.0; extra == 'voice'
38
+ Description-Content-Type: text/markdown
39
+
40
+ # Antigravity Remote 🚀
41
+
42
+ Remote control your [Antigravity](https://antigravity.dev) AI assistant via Telegram.
43
+
44
+ [![Telegram Bot](https://img.shields.io/badge/Telegram-@antigravityrcbot-blue?logo=telegram)](https://t.me/antigravityrcbot)
45
+ [![PyPI](https://img.shields.io/pypi/v/antigravity-remote)](https://pypi.org/project/antigravity-remote/)
46
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
47
+
48
+ ## Features
49
+
50
+ - 📱 **Message Relay** - Send instructions from your phone
51
+ - 📸 **Screenshots** - View screen anytime
52
+ - ⚡ **Quick Replies** - One-tap Yes/No/Proceed buttons
53
+ - 🔐 **Secure** - Your data never leaves your PC
54
+
55
+ ## Quick Start
56
+
57
+ ### 1. Install
58
+
59
+ ```bash
60
+ pip install antigravity-remote
61
+ ```
62
+
63
+ ### 2. Register
64
+
65
+ ```bash
66
+ antigravity-remote --register
67
+ ```
68
+
69
+ Enter your Telegram User ID (get it from [@userinfobot](https://t.me/userinfobot)).
70
+
71
+ ### 3. Run
72
+
73
+ ```bash
74
+ antigravity-remote
75
+ ```
76
+
77
+ ### 4. Control from Telegram
78
+
79
+ 👉 **[@antigravityrcbot](https://t.me/antigravityrcbot)**
80
+
81
+ ## Requirements
82
+
83
+ - Python 3.10+
84
+ - Windows
85
+
86
+ ## Commands (in Telegram)
87
+
88
+ | Command | Description |
89
+ |---------|-------------|
90
+ | `/status` | Take screenshot |
91
+ | `/scroll up/down` | Scroll chat |
92
+ | `/accept` / `/reject` | Accept/reject |
93
+ | `/key ctrl+s` | Send key combo |
94
+ | `/quick` | Quick reply buttons |
95
+ | Any text | Relay to Antigravity |
96
+
97
+ ## How It Works
98
+
99
+ ```
100
+ 📱 Your Phone ☁️ Server 💻 Your PC
101
+ │ Message bot │ │
102
+ ├──────────────────►│ │
103
+ │ │ WebSocket │
104
+ │ ├──────────────────►│
105
+ │ │ │ Execute
106
+ │ │◄──────────────────┤ Screenshot
107
+ │◄──────────────────┤ │
108
+ ```
109
+
110
+ Your bot token stays on our secure server. You only run a lightweight agent on your PC.
111
+
112
+ ## License
113
+
114
+ MIT © Kubrat
@@ -0,0 +1,23 @@
1
+ antigravity_remote/__init__.py,sha256=ZtnsWjQxZfmE2U8z3mbjWa95JtUoliaM00auAv2SGMA,293
2
+ antigravity_remote/__main__.py,sha256=RwTPfkqVbqW6Sb_3T_BIe09F3heKx6W0KWKSXxBYTNQ,3596
3
+ antigravity_remote/agent.py,sha256=WRggaT8gg9a_cD1htS0d9l-iZ3bJBpP_XgIktoGCMG0,15157
4
+ antigravity_remote/bot.py,sha256=v5RP757-5KMTzxyxJpfKz9tfubyXZ7dt0QcmBk_hjIw,5059
5
+ antigravity_remote/config.py,sha256=MVyJ49AEXR6-WynWaYXuPW3FwdU6RLUKstE7u8HhH28,2236
6
+ antigravity_remote/state.py,sha256=6LoHeTfJQVHU9PpiC5Hhi6V4CKWJx-qTOnEreQLfG6Y,2217
7
+ antigravity_remote/handlers/__init__.py,sha256=_YKjoXLlv0hYHkZNwDMsa4Ze3UjgXChDCaMR_aw3-WE,1513
8
+ antigravity_remote/handlers/ai.py,sha256=_YUjUNsqJ0GxAbxLE1Yy1Hw38K2C5RSQ6VEeOIbm4ck,4501
9
+ antigravity_remote/handlers/base.py,sha256=Yjq7QN15zBExMrd8jGSmbYKJS3_dpP6Ovq0zMLva2rc,1062
10
+ antigravity_remote/handlers/control.py,sha256=N7d84jUVnJLI4fhfKKsOllVIkqotDF3pbhMDBdmwiJU,3660
11
+ antigravity_remote/handlers/files.py,sha256=TS9JB5CFeiIGkpnNY7Puk-hkQugVgn0g9Exa2gisEQM,3724
12
+ antigravity_remote/handlers/monitoring.py,sha256=zo5CbpBya-YHBE4CYaGBf9xvbXW2bKujHiiYK6gIpFc,7386
13
+ antigravity_remote/handlers/quick.py,sha256=Vd2TjFXLzwMqYIqq7Fb6BJDnjllYZVQ1_7QGWXZOsnE,4881
14
+ antigravity_remote/handlers/screen.py,sha256=0funSy1eYPIfeeGymgSAIgFpaUu3HhLv2h7G82ec3UY,3337
15
+ antigravity_remote/utils/__init__.py,sha256=lwRicer6FCk4Op7zPee3Ezdra104PxDigdMpDvPYt_o,465
16
+ antigravity_remote/utils/automation.py,sha256=lR4uSXkbQSB7EZ2w2iZW9UeSRSQz8xvR3eJWmf04RA8,3992
17
+ antigravity_remote/utils/ocr.py,sha256=STdJoh3_zsKvHx0dCLeqEcUM4-F4b7nQ2A57fzUK2Hs,2738
18
+ antigravity_remote/utils/screenshot.py,sha256=eup60Iles_MMNBbcmLWFcvi8DAddUzrYmbPwRuxDg-8,1369
19
+ antigravity_remote-3.1.0.dist-info/METADATA,sha256=84-27D5NhS8f6c78LF8isEp_Y9dPQNWkXUPCsS6Swzw,3592
20
+ antigravity_remote-3.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
21
+ antigravity_remote-3.1.0.dist-info/entry_points.txt,sha256=DlNcH8xFN_aK4PFd-grvOLSLiYdh4YaaPj0EsNnoI9I,72
22
+ antigravity_remote-3.1.0.dist-info/licenses/LICENSE,sha256=zwQvwBcTdGhYEnFEzOLpV3YSwsEu27lLR3GYhmQ-Tvg,1084
23
+ antigravity_remote-3.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.28.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ antigravity-remote = antigravity_remote.__main__:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Kubrat
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.