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.
Files changed (21) hide show
  1. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/PKG-INFO +1 -1
  2. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/__init__.py +1 -1
  3. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/debugger.py +50 -25
  4. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger.egg-info/PKG-INFO +1 -1
  5. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/pyproject.toml +1 -1
  6. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/README.md +0 -0
  7. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/__main__.py +0 -0
  8. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/services/__init__.py +0 -0
  9. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/services/execute.py +0 -0
  10. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/services/filesystem.py +0 -0
  11. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/services/info.py +0 -0
  12. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/services/inspect_vars.py +0 -0
  13. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/utils/__init__.py +0 -0
  14. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger/utils/env.py +0 -0
  15. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger.egg-info/SOURCES.txt +0 -0
  16. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger.egg-info/dependency_links.txt +0 -0
  17. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger.egg-info/entry_points.txt +0 -0
  18. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger.egg-info/requires.txt +0 -0
  19. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/hypha_debugger.egg-info/top_level.txt +0 -0
  20. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/setup.cfg +0 -0
  21. {hypha_debugger-0.1.3 → hypha_debugger-0.1.4}/tests/test_services.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hypha-debugger
3
- Version: 0.1.3
3
+ Version: 0.1.4
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
@@ -12,5 +12,5 @@ Usage (sync):
12
12
 
13
13
  from hypha_debugger.debugger import start_debugger, start_debugger_sync, DebugSession
14
14
 
15
- __version__ = "0.1.3"
15
+ __version__ = "0.1.4"
16
16
  __all__ = ["start_debugger", "start_debugger_sync", "DebugSession", "__version__"]
@@ -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
- return "\n".join([
60
- f'SERVICE_URL="{service_url}"',
61
- f'TOKEN="{token}"',
62
- "",
63
- "# Quick test:",
64
- 'curl "$SERVICE_URL/get_process_info?_mode=last" -H "Authorization: Bearer $TOKEN"',
65
- "",
66
- "# Execute code:",
67
- "curl -X POST \"$SERVICE_URL/execute_code?_mode=last\" "
68
- "-H \"Authorization: Bearer $TOKEN\" "
69
- "-H \"Content-Type: application/json\" "
70
- "-d '{\"code\": \"import sys; sys.version\"}'",
71
- ])
72
- else:
73
- return "\n".join([
74
- f'SERVICE_URL="{service_url}"',
75
- "",
76
- "# Quick test (no auth required — keep URL secret):",
77
- 'curl "$SERVICE_URL/get_process_info?_mode=last"',
78
- "",
79
- "# Execute code:",
80
- "curl -X POST \"$SERVICE_URL/execute_code?_mode=last\" "
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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hypha-debugger
3
- Version: 0.1.3
3
+ Version: 0.1.4
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hypha-debugger"
7
- version = "0.1.3"
7
+ version = "0.1.4"
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"}
File without changes
File without changes