hypha-debugger 0.2.1__tar.gz → 0.2.3__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.
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/PKG-INFO +2 -1
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger/__init__.py +1 -1
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger/cli.py +20 -1
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger/services/source.py +17 -9
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger.egg-info/PKG-INFO +2 -1
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger.egg-info/requires.txt +1 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/pyproject.toml +2 -1
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/README.md +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger/__main__.py +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger/debugger.py +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger/services/__init__.py +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger/services/execute.py +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger/services/filesystem.py +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger/services/info.py +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger/services/inspect_vars.py +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger/services/shell.py +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger/utils/__init__.py +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger/utils/env.py +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger.egg-info/SOURCES.txt +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger.egg-info/dependency_links.txt +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger.egg-info/entry_points.txt +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/hypha_debugger.egg-info/top_level.txt +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/setup.cfg +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/tests/test_cli.py +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/tests/test_services.py +0 -0
- {hypha_debugger-0.2.1 → hypha_debugger-0.2.3}/tests/test_shell.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hypha-debugger
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Injectable debugger for Python processes and AI agents, powered by Hypha RPC
|
|
5
5
|
Author: Amun AI AB
|
|
6
6
|
License: MIT
|
|
@@ -20,6 +20,7 @@ Requires-Python: >=3.9
|
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
Requires-Dist: hypha-rpc>=0.20.0
|
|
22
22
|
Requires-Dist: pydantic>=2.0
|
|
23
|
+
Requires-Dist: certifi
|
|
23
24
|
Provides-Extra: dev
|
|
24
25
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
25
26
|
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
|
|
@@ -22,6 +22,7 @@ after every ``hyd sh``. See any debugger's ``GET <url>/get_skill_md``.
|
|
|
22
22
|
import json
|
|
23
23
|
import os
|
|
24
24
|
import shlex
|
|
25
|
+
import ssl
|
|
25
26
|
import sys
|
|
26
27
|
import urllib.error
|
|
27
28
|
import urllib.request
|
|
@@ -29,6 +30,24 @@ import urllib.request
|
|
|
29
30
|
__all__ = ["main"]
|
|
30
31
|
|
|
31
32
|
|
|
33
|
+
def _ssl_context() -> ssl.SSLContext:
|
|
34
|
+
"""A TLS context that verifies certs using certifi's CA bundle when available.
|
|
35
|
+
|
|
36
|
+
Python's default context uses the system/OpenSSL trust store, which is often
|
|
37
|
+
missing or unconfigured (macOS framework Python, minimal containers, fresh
|
|
38
|
+
venvs) — causing CERTIFICATE_VERIFY_FAILED on HTTPS service URLs even though
|
|
39
|
+
`curl` works. certifi (a transitive dep of hypha-rpc) fixes that portably.
|
|
40
|
+
"""
|
|
41
|
+
try:
|
|
42
|
+
import certifi
|
|
43
|
+
return ssl.create_default_context(cafile=certifi.where())
|
|
44
|
+
except Exception:
|
|
45
|
+
return ssl.create_default_context()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
_SSL_CTX = _ssl_context()
|
|
49
|
+
|
|
50
|
+
|
|
32
51
|
class CliError(Exception):
|
|
33
52
|
pass
|
|
34
53
|
|
|
@@ -164,7 +183,7 @@ def _call_remote(profile: dict, fn: str, params: dict, http_timeout: int = 75) -
|
|
|
164
183
|
if profile.get("token"):
|
|
165
184
|
req.add_header("Authorization", "Bearer " + profile["token"])
|
|
166
185
|
try:
|
|
167
|
-
with urllib.request.urlopen(req, timeout=http_timeout) as resp:
|
|
186
|
+
with urllib.request.urlopen(req, timeout=http_timeout, context=_SSL_CTX) as resp:
|
|
168
187
|
raw = resp.read().decode("utf-8", "replace")
|
|
169
188
|
except urllib.error.HTTPError as e:
|
|
170
189
|
body = e.read().decode("utf-8", "replace") if e.fp else ""
|
|
@@ -90,18 +90,20 @@ def _get_skill_md_impl() -> str:
|
|
|
90
90
|
|
|
91
91
|
## Overview
|
|
92
92
|
A remote debugger is attached to a running Python process. You have full access
|
|
93
|
-
to
|
|
93
|
+
to run shell + Python, read/write files, inspect variables, and install packages.
|
|
94
94
|
|
|
95
|
-
**
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
**START HERE → install the `hyd` CLI (next section).** Decision rule: if you'll run
|
|
96
|
+
more than ~2 commands here (i.e. almost any real task), `hyd` is the intended
|
|
97
|
+
interface — one `pip install`, then every command is a short `hyd sh '…'` /
|
|
98
|
+
`hyd py '…'` with the connection + working directory remembered for you, far fewer
|
|
99
|
+
tokens than re-sending an authenticated curl each time, and it behaves like a local
|
|
100
|
+
shell. Only for a single throwaway call is raw curl (further down) simpler. The raw
|
|
101
|
+
HTTP API is the low-level fallback and powers the CLI.
|
|
98
102
|
|
|
99
|
-
## Fast path — the `hyd` CLI (
|
|
103
|
+
## Fast path — the `hyd` CLI (do this first)
|
|
100
104
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
It stores this connection as a named **profile** (URL + token) on disk, so later
|
|
104
|
-
calls carry no auth or JSON boilerplate. Bootstrap yourself:
|
|
105
|
+
Bootstrap yourself in three lines (THIS_SERVICE_URL = the URL you fetched this doc
|
|
106
|
+
from, without the trailing `/get_skill_md`):
|
|
105
107
|
|
|
106
108
|
```bash
|
|
107
109
|
pip install hypha-debugger # ships the `hyd` command
|
|
@@ -111,8 +113,14 @@ export HYD_PROFILE=main # select it (env var — per-terminal, not
|
|
|
111
113
|
hyd sh 'uname -a && pwd' # run a remote shell command
|
|
112
114
|
hyd 'ls -la' # bare form: anything not a subcommand runs as a command
|
|
113
115
|
hyd py 'import sys; sys.version' # run Python via execute_code
|
|
116
|
+
hyd status # confirm it's connected
|
|
114
117
|
```
|
|
115
118
|
|
|
119
|
+
Install tip: `pipx install hypha-debugger` is the most reliable — it always puts
|
|
120
|
+
`hyd` on your PATH. If instead you used `pip install --user` and `hyd` isn't found,
|
|
121
|
+
either add the user bin dir to PATH, or just use `python -m hypha_debugger.cli` in
|
|
122
|
+
place of `hyd` — identical arguments (`python -m hypha_debugger.cli sh 'pwd'`).
|
|
123
|
+
|
|
116
124
|
Key ideas:
|
|
117
125
|
- **The remote is stateless.** The "current directory" and "current profile" live
|
|
118
126
|
in the environment variables `HYD_CWD` and `HYD_PROFILE` (per shell), so different
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hypha-debugger
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Injectable debugger for Python processes and AI agents, powered by Hypha RPC
|
|
5
5
|
Author: Amun AI AB
|
|
6
6
|
License: MIT
|
|
@@ -20,6 +20,7 @@ Requires-Python: >=3.9
|
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
Requires-Dist: hypha-rpc>=0.20.0
|
|
22
22
|
Requires-Dist: pydantic>=2.0
|
|
23
|
+
Requires-Dist: certifi
|
|
23
24
|
Provides-Extra: dev
|
|
24
25
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
25
26
|
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "hypha-debugger"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.3"
|
|
8
8
|
description = "Injectable debugger for Python processes and AI agents, powered by Hypha RPC"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|
|
@@ -25,6 +25,7 @@ classifiers = [
|
|
|
25
25
|
dependencies = [
|
|
26
26
|
"hypha-rpc>=0.20.0",
|
|
27
27
|
"pydantic>=2.0",
|
|
28
|
+
"certifi",
|
|
28
29
|
]
|
|
29
30
|
|
|
30
31
|
[project.urls]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|