hypha-debugger 0.1.7__tar.gz → 0.1.8__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.7 → hypha_debugger-0.1.8}/PKG-INFO +1 -1
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/hypha_debugger/__init__.py +1 -1
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/hypha_debugger/debugger.py +5 -36
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/hypha_debugger.egg-info/PKG-INFO +1 -1
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/pyproject.toml +1 -1
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/tests/test_services.py +5 -3
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/README.md +0 -0
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/hypha_debugger/__main__.py +0 -0
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/hypha_debugger/services/__init__.py +0 -0
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/hypha_debugger/services/execute.py +0 -0
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/hypha_debugger/services/filesystem.py +0 -0
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/hypha_debugger/services/info.py +0 -0
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/hypha_debugger/services/inspect_vars.py +0 -0
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/hypha_debugger/services/source.py +0 -0
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/hypha_debugger/utils/__init__.py +0 -0
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/hypha_debugger/utils/env.py +0 -0
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/hypha_debugger.egg-info/SOURCES.txt +0 -0
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/hypha_debugger.egg-info/dependency_links.txt +0 -0
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/hypha_debugger.egg-info/entry_points.txt +0 -0
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/hypha_debugger.egg-info/requires.txt +0 -0
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/hypha_debugger.egg-info/top_level.txt +0 -0
- {hypha_debugger-0.1.7 → hypha_debugger-0.1.8}/setup.cfg +0 -0
|
@@ -54,24 +54,9 @@ def _build_instruction_block(service_url: str, token: str = "") -> str:
|
|
|
54
54
|
auth = f' -H "Authorization: Bearer $TOKEN"' if token else ""
|
|
55
55
|
lines = [
|
|
56
56
|
"# Hypha Remote Debugger — Python Process",
|
|
57
|
-
"# A debugger is attached to a running Python process.",
|
|
58
|
-
"# You can
|
|
59
|
-
"#
|
|
60
|
-
"#",
|
|
61
|
-
"# Available functions:",
|
|
62
|
-
"# get_process_info - PID, Python version, CWD, platform, memory",
|
|
63
|
-
"# execute_code - Run Python code (persistent REPL, auto-captures last expr)",
|
|
64
|
-
"# get_variable - Inspect a variable by name",
|
|
65
|
-
"# list_variables - List variables in a namespace",
|
|
66
|
-
"# get_stack_trace - Stack traces of all threads",
|
|
67
|
-
"# list_files - List directory contents",
|
|
68
|
-
"# read_file - Read file content (with offset/limit)",
|
|
69
|
-
"# write_file - Write/append to a file",
|
|
70
|
-
"# get_installed_packages - List pip packages",
|
|
71
|
-
"# get_source - Get debugger source code (for self-inspection)",
|
|
72
|
-
"# get_skill_md - Get full API docs as Markdown",
|
|
73
|
-
"#",
|
|
74
|
-
"# POST endpoints accept JSON body with parameter names as keys.",
|
|
57
|
+
"# A remote debugger is attached to a running Python process.",
|
|
58
|
+
"# You can execute code, read/write files, inspect variables, and more.",
|
|
59
|
+
"# Call get_skill_md for full API docs with all available functions.",
|
|
75
60
|
"",
|
|
76
61
|
f'SERVICE_URL="{service_url}"',
|
|
77
62
|
]
|
|
@@ -79,28 +64,12 @@ def _build_instruction_block(service_url: str, token: str = "") -> str:
|
|
|
79
64
|
lines.append(f'TOKEN="{token}"')
|
|
80
65
|
lines += [
|
|
81
66
|
"",
|
|
82
|
-
"#
|
|
83
|
-
f'curl "$SERVICE_URL/get_process_info"{auth}',
|
|
84
|
-
"",
|
|
85
|
-
"# Execute Python code (timeout default 30s):",
|
|
67
|
+
"# Execute Python code:",
|
|
86
68
|
f'curl -X POST "$SERVICE_URL/execute_code"{auth}'
|
|
87
69
|
' -H "Content-Type: application/json"'
|
|
88
70
|
" -d '{\"code\": \"import sys; sys.version\"}'",
|
|
89
71
|
"",
|
|
90
|
-
"#
|
|
91
|
-
f'curl -X POST "$SERVICE_URL/write_file"{auth}'
|
|
92
|
-
' -H "Content-Type: application/json"'
|
|
93
|
-
" -d '{\"path\": \"hello.txt\", \"content\": \"Hello, world!\"}'",
|
|
94
|
-
"",
|
|
95
|
-
"# List files in working directory:",
|
|
96
|
-
f'curl "$SERVICE_URL/list_files"{auth}',
|
|
97
|
-
"",
|
|
98
|
-
"# Read a file:",
|
|
99
|
-
f'curl -X POST "$SERVICE_URL/read_file"{auth}'
|
|
100
|
-
' -H "Content-Type: application/json"'
|
|
101
|
-
" -d '{\"path\": \"hello.txt\"}'",
|
|
102
|
-
"",
|
|
103
|
-
"# Get full API documentation:",
|
|
72
|
+
"# Get full API docs (all functions, parameters, examples):",
|
|
104
73
|
f'curl "$SERVICE_URL/get_skill_md"{auth}',
|
|
105
74
|
]
|
|
106
75
|
return "\n".join(lines)
|
|
@@ -255,7 +255,7 @@ def test_instruction_block_no_token():
|
|
|
255
255
|
assert "TOKEN=" not in block
|
|
256
256
|
assert "Authorization" not in block
|
|
257
257
|
assert "execute_code" in block
|
|
258
|
-
assert "
|
|
258
|
+
assert "get_skill_md" in block
|
|
259
259
|
|
|
260
260
|
|
|
261
261
|
def test_instruction_block_with_token():
|
|
@@ -302,11 +302,13 @@ def test_get_skill_md():
|
|
|
302
302
|
assert "SERVICE_URL" in md
|
|
303
303
|
|
|
304
304
|
|
|
305
|
-
def
|
|
305
|
+
def test_instruction_block_concise():
|
|
306
306
|
from hypha_debugger.debugger import _build_instruction_block
|
|
307
307
|
block = _build_instruction_block("https://example.com/ws/services/py-debugger-abc")
|
|
308
|
-
assert "get_source" in block
|
|
309
308
|
assert "get_skill_md" in block
|
|
309
|
+
# Should NOT have the verbose function list anymore
|
|
310
|
+
assert "get_variable" not in block
|
|
311
|
+
assert "list_files" not in block
|
|
310
312
|
|
|
311
313
|
|
|
312
314
|
def test_debug_session_print_instructions(capsys):
|
|
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
|