agnt 0.6.3__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.
agnt/__init__.py ADDED
@@ -0,0 +1,174 @@
1
+ """
2
+ agnt - MCP server for AI coding agents
3
+
4
+ This package provides the agnt binary for use as an MCP server,
5
+ offering process management, reverse proxy with traffic logging,
6
+ browser instrumentation, and sketch mode.
7
+
8
+ Usage:
9
+ Add to your MCP client configuration:
10
+ {
11
+ "mcpServers": {
12
+ "agnt": {
13
+ "command": "agnt",
14
+ "args": ["serve"]
15
+ }
16
+ }
17
+ }
18
+
19
+ Or run with PTY wrapper:
20
+ agnt run claude --dangerously-skip-permissions
21
+
22
+ For more information, see:
23
+ https://standardbeagle.github.io/agnt/
24
+ """
25
+
26
+ __version__ = "0.6.2"
27
+ __all__ = ["main", "get_binary_path", "run"]
28
+
29
+ import os
30
+ import platform
31
+ import stat
32
+ import subprocess
33
+ import sys
34
+ import tempfile
35
+ from pathlib import Path
36
+ from typing import Optional
37
+
38
+ import httpx
39
+
40
+ REPO = "standardbeagle/agnt"
41
+ VERSION = __version__
42
+ BINARY_NAME = "agnt"
43
+
44
+
45
+ def get_platform() -> str:
46
+ """Get the platform name for download."""
47
+ system = platform.system().lower()
48
+ if system == "darwin":
49
+ return "darwin"
50
+ elif system == "linux":
51
+ return "linux"
52
+ elif system == "windows":
53
+ return "windows"
54
+ else:
55
+ raise RuntimeError(f"Unsupported platform: {system}")
56
+
57
+
58
+ def get_arch() -> str:
59
+ """Get the architecture name for download."""
60
+ machine = platform.machine().lower()
61
+ if machine in ("x86_64", "amd64"):
62
+ return "amd64"
63
+ elif machine in ("arm64", "aarch64"):
64
+ return "arm64"
65
+ else:
66
+ raise RuntimeError(f"Unsupported architecture: {machine}")
67
+
68
+
69
+ def get_binary_name() -> str:
70
+ """Get the binary name for the current platform."""
71
+ if platform.system().lower() == "windows":
72
+ return f"{BINARY_NAME}.exe"
73
+ return BINARY_NAME
74
+
75
+
76
+ def get_cache_dir() -> Path:
77
+ """Get the cache directory for storing the binary."""
78
+ if platform.system().lower() == "windows":
79
+ base = Path(os.environ.get("LOCALAPPDATA", Path.home() / "AppData" / "Local"))
80
+ elif platform.system().lower() == "darwin":
81
+ base = Path.home() / "Library" / "Caches"
82
+ else:
83
+ base = Path(os.environ.get("XDG_CACHE_HOME", Path.home() / ".cache"))
84
+
85
+ cache_dir = base / "agnt" / VERSION
86
+ cache_dir.mkdir(parents=True, exist_ok=True)
87
+ return cache_dir
88
+
89
+
90
+ def get_download_url() -> str:
91
+ """Get the download URL for the binary."""
92
+ plat = get_platform()
93
+ arch = get_arch()
94
+ ext = ".exe" if plat == "windows" else ""
95
+ return f"https://github.com/{REPO}/releases/download/v{VERSION}/{BINARY_NAME}-{plat}-{arch}{ext}"
96
+
97
+
98
+ def get_binary_path() -> Path:
99
+ """Get the path to the agnt binary, downloading if necessary."""
100
+ cache_dir = get_cache_dir()
101
+ binary_path = cache_dir / get_binary_name()
102
+
103
+ if binary_path.exists():
104
+ return binary_path
105
+
106
+ # Download the binary
107
+ url = get_download_url()
108
+ print(f"Downloading agnt v{VERSION}...", file=sys.stderr)
109
+ print(f" Platform: {get_platform()}", file=sys.stderr)
110
+ print(f" Architecture: {get_arch()}", file=sys.stderr)
111
+
112
+ try:
113
+ with httpx.Client(follow_redirects=True, timeout=60.0) as client:
114
+ response = client.get(url)
115
+ response.raise_for_status()
116
+
117
+ # Write to temp file first, then move
118
+ with tempfile.NamedTemporaryFile(
119
+ delete=False, dir=cache_dir, suffix=".tmp"
120
+ ) as tmp:
121
+ tmp.write(response.content)
122
+ tmp_path = Path(tmp.name)
123
+
124
+ # Move to final location
125
+ tmp_path.rename(binary_path)
126
+
127
+ # Make executable on Unix
128
+ if platform.system().lower() != "windows":
129
+ binary_path.chmod(binary_path.stat().st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
130
+
131
+ print(f"Successfully installed agnt to {binary_path}", file=sys.stderr)
132
+
133
+ except httpx.HTTPError as e:
134
+ print(f"Failed to download agnt: {e}", file=sys.stderr)
135
+ print("", file=sys.stderr)
136
+ print("You can manually download the binary from:", file=sys.stderr)
137
+ print(f" https://github.com/{REPO}/releases/tag/v{VERSION}", file=sys.stderr)
138
+ print("", file=sys.stderr)
139
+ print("Or build from source:", file=sys.stderr)
140
+ print(" git clone https://github.com/standardbeagle/agnt.git", file=sys.stderr)
141
+ print(" cd agnt", file=sys.stderr)
142
+ print(" make build", file=sys.stderr)
143
+ sys.exit(1)
144
+
145
+ return binary_path
146
+
147
+
148
+ def run(args: Optional[list[str]] = None) -> subprocess.CompletedProcess:
149
+ """Run agnt with the given arguments."""
150
+ binary_path = get_binary_path()
151
+ return subprocess.run([str(binary_path)] + (args or []))
152
+
153
+
154
+ def main() -> None:
155
+ """Entry point for the agnt command."""
156
+ binary_path = get_binary_path()
157
+ try:
158
+ # Replace current process with the binary
159
+ if platform.system().lower() == "windows":
160
+ # Windows doesn't support exec, so use subprocess
161
+ result = subprocess.run([str(binary_path)] + sys.argv[1:])
162
+ sys.exit(result.returncode)
163
+ else:
164
+ os.execv(str(binary_path), [str(binary_path)] + sys.argv[1:])
165
+ except FileNotFoundError:
166
+ print(f"Error: Binary not found at {binary_path}", file=sys.stderr)
167
+ sys.exit(1)
168
+ except PermissionError:
169
+ print(f"Error: Binary at {binary_path} is not executable", file=sys.stderr)
170
+ sys.exit(1)
171
+
172
+
173
+ if __name__ == "__main__":
174
+ main()
@@ -0,0 +1,187 @@
1
+ Metadata-Version: 2.4
2
+ Name: agnt
3
+ Version: 0.6.3
4
+ Summary: MCP server for AI coding agents - process management, reverse proxy with traffic logging, browser instrumentation, and sketch mode
5
+ Project-URL: Homepage, https://standardbeagle.github.io/agnt/
6
+ Project-URL: Documentation, https://standardbeagle.github.io/agnt/
7
+ Project-URL: Repository, https://github.com/standardbeagle/agnt
8
+ Project-URL: Issues, https://github.com/standardbeagle/agnt/issues
9
+ Project-URL: Changelog, https://github.com/standardbeagle/agnt/blob/main/CHANGELOG.md
10
+ Author-email: Standard Beagle <dev@standardbeagle.com>
11
+ License-Expression: MIT
12
+ License-File: LICENSE
13
+ Keywords: agent,ai,claude-code,debugging,development,devtools,diagnostics,frontend,mcp,model-context-protocol,process-management,proxy,sketch,wireframe
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: MacOS
19
+ Classifier: Operating System :: Microsoft :: Windows
20
+ Classifier: Operating System :: POSIX :: Linux
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Topic :: Internet :: Proxy Servers
26
+ Classifier: Topic :: Software Development :: Debuggers
27
+ Classifier: Topic :: Software Development :: Testing
28
+ Requires-Python: >=3.10
29
+ Requires-Dist: httpx>=0.25.0
30
+ Description-Content-Type: text/markdown
31
+
32
+ # agnt
33
+
34
+ **Give your AI coding agent browser superpowers.**
35
+
36
+ agnt is a new kind of tool designed for the age of AI-assisted development. It acts as a bridge between your AI coding agent and the browser, extending what's possible during vibe coding sessions.
37
+
38
+ ## What Does It Do?
39
+
40
+ When you're in the flow with Claude Code, Cursor, or other AI tools, agnt lets your agent:
41
+
42
+ - **See what you see** - Screenshots, DOM inspection, visual debugging
43
+ - **Hear from you directly** - Send messages from browser to agent
44
+ - **Sketch ideas together** - Draw wireframes directly on your UI
45
+ - **Debug in real-time** - Capture errors, network traffic, performance
46
+ - **Extend its thinking window** - Structured data uses fewer tokens than descriptions
47
+
48
+ ## Installation
49
+
50
+ ```bash
51
+ pip install agnt
52
+ # or
53
+ uv pip install agnt
54
+ # or
55
+ pipx install agnt
56
+ ```
57
+
58
+ ## Quick Start
59
+
60
+ ### As MCP Server (Claude Code, Cursor, etc.)
61
+
62
+ Add to your MCP configuration:
63
+
64
+ ```json
65
+ {
66
+ "mcpServers": {
67
+ "agnt": {
68
+ "command": "agnt",
69
+ "args": ["serve"]
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ Or with uvx:
76
+
77
+ ```json
78
+ {
79
+ "mcpServers": {
80
+ "agnt": {
81
+ "command": "uvx",
82
+ "args": ["agnt", "serve"]
83
+ }
84
+ }
85
+ }
86
+ ```
87
+
88
+ ### As PTY Wrapper
89
+
90
+ Wrap your AI coding tool with overlay features:
91
+
92
+ ```bash
93
+ agnt run claude --dangerously-skip-permissions
94
+ agnt run cursor
95
+ agnt run aider
96
+ ```
97
+
98
+ This adds a terminal overlay menu (Ctrl+P) and enables browser-to-terminal messaging.
99
+
100
+ ## Core Features
101
+
102
+ ### Browser Superpowers
103
+
104
+ Start a proxy and your agent gains eyes into the browser:
105
+
106
+ ```
107
+ proxy {action: "start", id: "app", target_url: "http://localhost:3000"}
108
+ ```
109
+
110
+ Now your agent can:
111
+ - Take screenshots
112
+ - Inspect any element
113
+ - Audit accessibility
114
+ - See what you clicked
115
+
116
+ ### Floating Indicator
117
+
118
+ Every proxied page gets a floating bug icon. Click to:
119
+ - Send messages to your agent
120
+ - Take area screenshots
121
+ - Select elements to log
122
+ - Open sketch mode
123
+
124
+ ### Sketch Mode
125
+
126
+ Draw directly on your UI:
127
+ - Shapes: rectangles, circles, arrows, freehand
128
+ - Wireframes: buttons, inputs, sticky notes
129
+ - Save and send to agent instantly
130
+
131
+ ### Real-Time Error Capture
132
+
133
+ JavaScript errors automatically captured and available to your agent - no more forgetting to mention them.
134
+
135
+ ## MCP Tools
136
+
137
+ | Tool | Description |
138
+ |------|-------------|
139
+ | `detect` | Auto-detect project type and scripts |
140
+ | `run` | Run scripts or commands |
141
+ | `proc` | Manage processes |
142
+ | `proxy` | Reverse proxy with instrumentation |
143
+ | `proxylog` | Query traffic logs |
144
+ | `currentpage` | View page sessions |
145
+ | `daemon` | Manage background service |
146
+
147
+ ## Browser API
148
+
149
+ The proxy injects `window.__devtool` with 50+ diagnostic functions:
150
+
151
+ ```javascript
152
+ __devtool.screenshot('name') // Capture screenshot
153
+ __devtool.inspect('#element') // Full element analysis
154
+ __devtool.auditAccessibility() // A11y audit
155
+ __devtool.sketch.open() // Enter sketch mode
156
+ __devtool.interactions.getLastClick() // Last click details
157
+ ```
158
+
159
+ ## Configuration
160
+
161
+ Create `.agnt.kdl` in your project:
162
+
163
+ ```kdl
164
+ scripts {
165
+ dev {
166
+ command "npm"
167
+ args "run" "dev"
168
+ autostart true
169
+ }
170
+ }
171
+
172
+ proxies {
173
+ frontend {
174
+ target "http://localhost:3000"
175
+ autostart true
176
+ }
177
+ }
178
+ ```
179
+
180
+ ## Documentation
181
+
182
+ - [GitHub](https://github.com/standardbeagle/agnt)
183
+ - [Full Docs](https://standardbeagle.github.io/agnt/)
184
+
185
+ ## License
186
+
187
+ MIT
@@ -0,0 +1,6 @@
1
+ agnt/__init__.py,sha256=Be8ni09FGT-n6pj6wL6TJ3WTOTzUY1rPBHypR4eJ9Vg,5391
2
+ agnt-0.6.3.dist-info/METADATA,sha256=CXHJLNtpIDm157wxbijYV1n4Se1HZ8_s8RQHlGoj8b0,4896
3
+ agnt-0.6.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
4
+ agnt-0.6.3.dist-info/entry_points.txt,sha256=x49RGanN1v4RGYL1SrdmeH0BJNDotBCI2EFuQQBKB_I,35
5
+ agnt-0.6.3.dist-info/licenses/LICENSE,sha256=tmG6fLm_x-rPAMfHNzGNLNOXg5VVMl7I-bQIS4AMALk,1072
6
+ agnt-0.6.3.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
+ agnt = agnt:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Standard Beagle
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.