hypha-debugger 0.1.3__tar.gz → 0.1.4__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.1.3 → hypha_debugger-0.1.4}/PKG-INFO +1 -1
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/__init__.py +1 -1
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/debugger.py +50 -25
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger.egg-info/PKG-INFO +1 -1
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/pyproject.toml +1 -1
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/README.md +0 -0
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/__main__.py +0 -0
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/services/__init__.py +0 -0
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/services/execute.py +0 -0
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/services/filesystem.py +0 -0
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/services/info.py +0 -0
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/services/inspect_vars.py +0 -0
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/utils/__init__.py +0 -0
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/utils/env.py +0 -0
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger.egg-info/SOURCES.txt +0 -0
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger.egg-info/dependency_links.txt +0 -0
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger.egg-info/entry_points.txt +0 -0
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger.egg-info/requires.txt +0 -0
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger.egg-info/top_level.txt +0 -0
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/setup.cfg +0 -0
- {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/tests/test_services.py +0 -0
|
@@ -55,32 +55,43 @@ def _build_instruction_block(
|
|
|
55
55
|
|
|
56
56
|
Returns a formatted string similar to the JS overlay instructions.
|
|
57
57
|
"""
|
|
58
|
+
auth_header = f' -H "Authorization: Bearer $TOKEN"' if require_token else ""
|
|
59
|
+
lines = [
|
|
60
|
+
"# Hypha Remote Debugger — Python Process",
|
|
61
|
+
"# A debugger is attached to a running Python process.",
|
|
62
|
+
"# You can remotely inspect variables, execute code, browse files,",
|
|
63
|
+
"# and query process info via the HTTP API below.",
|
|
64
|
+
"#",
|
|
65
|
+
"# Available functions: get_process_info, execute_code, get_variable,",
|
|
66
|
+
"# list_variables, get_stack_trace, list_files, read_file, get_installed_packages",
|
|
67
|
+
"#",
|
|
68
|
+
"# All endpoints require ?_mode=last suffix. POST endpoints accept JSON body.",
|
|
69
|
+
"",
|
|
70
|
+
f'SERVICE_URL="{service_url}"',
|
|
71
|
+
]
|
|
58
72
|
if require_token:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"-H \"Content-Type: application/json\" "
|
|
82
|
-
"-d '{\"code\": \"import sys; sys.version\"}'",
|
|
83
|
-
])
|
|
73
|
+
lines.append(f'TOKEN="{token}"')
|
|
74
|
+
lines += [
|
|
75
|
+
"",
|
|
76
|
+
"# Get process info (PID, Python version, CWD, memory):",
|
|
77
|
+
f'curl "$SERVICE_URL/get_process_info?_mode=last"{auth_header}',
|
|
78
|
+
"",
|
|
79
|
+
"# Execute Python code remotely:",
|
|
80
|
+
f"curl -X POST \"$SERVICE_URL/execute_code?_mode=last\""
|
|
81
|
+
f"{auth_header}"
|
|
82
|
+
" -H \"Content-Type: application/json\""
|
|
83
|
+
" -d '{\"code\": \"import sys; sys.version\"}'",
|
|
84
|
+
"",
|
|
85
|
+
"# Inspect a variable:",
|
|
86
|
+
f"curl -X POST \"$SERVICE_URL/get_variable?_mode=last\""
|
|
87
|
+
f"{auth_header}"
|
|
88
|
+
" -H \"Content-Type: application/json\""
|
|
89
|
+
" -d '{\"name\": \"my_var\"}'",
|
|
90
|
+
"",
|
|
91
|
+
"# List files in working directory:",
|
|
92
|
+
f'curl "$SERVICE_URL/list_files?_mode=last"{auth_header}',
|
|
93
|
+
]
|
|
94
|
+
return "\n".join(lines)
|
|
84
95
|
|
|
85
96
|
|
|
86
97
|
def _print_session_info(
|
|
@@ -97,7 +108,14 @@ def _print_session_info(
|
|
|
97
108
|
if require_token:
|
|
98
109
|
print(f"[hypha-debugger] Token: {token}")
|
|
99
110
|
print()
|
|
111
|
+
sep = "=" * 60
|
|
112
|
+
print(f"{sep}")
|
|
113
|
+
print(" Copy the text below to your AI agent")
|
|
114
|
+
print(f"{sep}")
|
|
115
|
+
print()
|
|
100
116
|
print(_build_instruction_block(service_url, token, require_token))
|
|
117
|
+
print()
|
|
118
|
+
print(f"{sep}")
|
|
101
119
|
|
|
102
120
|
|
|
103
121
|
@dataclass
|
|
@@ -120,7 +138,14 @@ class DebugSession:
|
|
|
120
138
|
instructions = _build_instruction_block(
|
|
121
139
|
self.service_url, self.token, bool(self.token)
|
|
122
140
|
)
|
|
141
|
+
sep = "=" * 60
|
|
142
|
+
print(f"{sep}")
|
|
143
|
+
print(" Copy the text below to your AI agent")
|
|
144
|
+
print(f"{sep}")
|
|
145
|
+
print()
|
|
123
146
|
print(instructions)
|
|
147
|
+
print()
|
|
148
|
+
print(f"{sep}")
|
|
124
149
|
return instructions
|
|
125
150
|
|
|
126
151
|
async def serve_forever(self):
|
|
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
|