agent-debugger 0.1.0__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 (42) hide show
  1. agent_debugger-0.1.0/.adb/history.json +29 -0
  2. agent_debugger-0.1.0/.gitignore +207 -0
  3. agent_debugger-0.1.0/LICENSE +21 -0
  4. agent_debugger-0.1.0/Makefile +54 -0
  5. agent_debugger-0.1.0/PKG-INFO +135 -0
  6. agent_debugger-0.1.0/Plan.md +1011 -0
  7. agent_debugger-0.1.0/README.md +103 -0
  8. agent_debugger-0.1.0/StorePlan.md +74 -0
  9. agent_debugger-0.1.0/agent_debugger/__init__.py +33 -0
  10. agent_debugger-0.1.0/agent_debugger/app.py +1386 -0
  11. agent_debugger-0.1.0/agent_debugger/breakpoints.py +195 -0
  12. agent_debugger-0.1.0/agent_debugger/cli.py +458 -0
  13. agent_debugger-0.1.0/agent_debugger/events.py +143 -0
  14. agent_debugger-0.1.0/agent_debugger/extensions.py +103 -0
  15. agent_debugger-0.1.0/agent_debugger/message_utils.py +60 -0
  16. agent_debugger-0.1.0/agent_debugger/panels/__init__.py +1 -0
  17. agent_debugger-0.1.0/agent_debugger/panels/diff.py +92 -0
  18. agent_debugger-0.1.0/agent_debugger/panels/logs.py +25 -0
  19. agent_debugger-0.1.0/agent_debugger/panels/messages.py +60 -0
  20. agent_debugger-0.1.0/agent_debugger/panels/source.py +87 -0
  21. agent_debugger-0.1.0/agent_debugger/panels/stack.py +87 -0
  22. agent_debugger-0.1.0/agent_debugger/panels/state.py +144 -0
  23. agent_debugger-0.1.0/agent_debugger/panels/store.py +105 -0
  24. agent_debugger-0.1.0/agent_debugger/panels/tools.py +151 -0
  25. agent_debugger-0.1.0/agent_debugger/panels/traces.py +30 -0
  26. agent_debugger-0.1.0/agent_debugger/panels/variables.py +76 -0
  27. agent_debugger-0.1.0/agent_debugger/py.typed +0 -0
  28. agent_debugger-0.1.0/agent_debugger/runner.py +383 -0
  29. agent_debugger-0.1.0/agent_debugger/store_backend.py +174 -0
  30. agent_debugger-0.1.0/agent_debugger/tracer.py +507 -0
  31. agent_debugger-0.1.0/examples/simple_agent.py +418 -0
  32. agent_debugger-0.1.0/examples/simple_extensions.py +184 -0
  33. agent_debugger-0.1.0/pyproject.toml +116 -0
  34. agent_debugger-0.1.0/tests/__init__.py +1 -0
  35. agent_debugger-0.1.0/tests/test_app.py +1351 -0
  36. agent_debugger-0.1.0/tests/test_breakpoints.py +127 -0
  37. agent_debugger-0.1.0/tests/test_cli.py +304 -0
  38. agent_debugger-0.1.0/tests/test_debug_keys.py +102 -0
  39. agent_debugger-0.1.0/tests/test_events.py +90 -0
  40. agent_debugger-0.1.0/tests/test_simple_agent.py +63 -0
  41. agent_debugger-0.1.0/tests/test_store_backend.py +56 -0
  42. agent_debugger-0.1.0/uv.lock +2759 -0
@@ -0,0 +1,29 @@
1
+ [
2
+ "/continue",
3
+ "hello",
4
+ "/logs",
5
+ "/source",
6
+ "/messages",
7
+ "hello",
8
+ "/clear memory",
9
+ "/help",
10
+ "/break node echo",
11
+ "/break node does_not_exist",
12
+ "/break node echo",
13
+ "/break tool fake_tool",
14
+ "hi",
15
+ "good to see you",
16
+ "/help",
17
+ "/break node echo",
18
+ "/break node does_not_exist",
19
+ "/break node echo",
20
+ "/break tool fake_tool",
21
+ "/break state messages",
22
+ "/break transition",
23
+ "/break line examples/simple_agent.py:368",
24
+ "/breakpoints",
25
+ "hi",
26
+ "hello",
27
+ "hi",
28
+ "wow"
29
+ ]
@@ -0,0 +1,207 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Derrick Kondo
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.
@@ -0,0 +1,54 @@
1
+ .PHONY: all format lint lint_package lint_tests test tests typecheck clean build help
2
+
3
+ # Default target
4
+ all: format lint test
5
+
6
+ # Format code with ruff
7
+ format:
8
+ uv run --group lint ruff format .
9
+ uv run --group lint ruff check --fix .
10
+
11
+ # Lint code with ruff
12
+ lint:
13
+ uv run --group lint ruff check .
14
+ uv run --group lint ruff format --check .
15
+
16
+ # Lint package code (excluding tests)
17
+ lint_package:
18
+ uv run --group lint ruff check agent_debugger examples
19
+ uv run --group lint ruff format --check agent_debugger examples
20
+
21
+ # Lint tests only
22
+ lint_tests:
23
+ uv run --group lint ruff check tests
24
+ uv run --group lint ruff format --check tests
25
+
26
+ # Run unit tests
27
+ test tests:
28
+ uv run --group test pytest tests -v
29
+
30
+ # Type checking
31
+ typecheck:
32
+ uv run --group typing mypy agent_debugger
33
+
34
+ # Clean build artifacts
35
+ clean:
36
+ rm -rf dist/ build/ *.egg-info/
37
+ find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
38
+ find . -type f -name "*.pyc" -delete
39
+
40
+ # Build package
41
+ build:
42
+ uv build
43
+
44
+ # Help
45
+ help:
46
+ @echo "Available targets:"
47
+ @echo " format - Format code with ruff"
48
+ @echo " lint - Lint code with ruff"
49
+ @echo " lint_package - Lint package code (excluding tests)"
50
+ @echo " lint_tests - Lint tests only"
51
+ @echo " test / tests - Run unit tests"
52
+ @echo " typecheck - Run mypy type checking"
53
+ @echo " clean - Remove build artifacts"
54
+ @echo " build - Build package"
@@ -0,0 +1,135 @@
1
+ Metadata-Version: 2.4
2
+ Name: agent-debugger
3
+ Version: 0.1.0
4
+ Summary: Agent Debugger for LangChain/LangGraph
5
+ Project-URL: Homepage, https://github.com/dkondo/agent-tackle-box
6
+ Project-URL: Repository, https://github.com/dkondo/agent-tackle-box
7
+ Project-URL: Source Code, https://github.com/dkondo/agent-tackle-box/tree/main/projects/agent-debugger
8
+ Author-email: Derrick Kondo <dkondo@gmail.com>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: agent,debugger,langchain,langgraph,llm
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Classifier: Topic :: Software Development :: Debuggers
21
+ Requires-Python: >=3.11
22
+ Requires-Dist: click>=8.0
23
+ Requires-Dist: deepdiff>=8.0
24
+ Requires-Dist: langchain-core>=0.3
25
+ Requires-Dist: langgraph>=0.4
26
+ Requires-Dist: rich>=13.0
27
+ Requires-Dist: textual>=3.0
28
+ Provides-Extra: litellm
29
+ Requires-Dist: langchain-litellm>=0.5.1; extra == 'litellm'
30
+ Requires-Dist: python-dotenv>=1.0; extra == 'litellm'
31
+ Description-Content-Type: text/markdown
32
+
33
+ # adb: Agent Debugger for LangChain/LangGraph
34
+
35
+ A TUI debugger that combines application-level agent inspection (state, memory, tool calls, messages) with Python-level debugging (breakpoints, stepping, variable inspection).
36
+
37
+ ## Quick Start
38
+
39
+ ```bash
40
+ # Install
41
+ uv pip install -e .
42
+
43
+ # Debug a LangGraph agent script
44
+ adb run my_agent.py
45
+
46
+ # Attach to a specific graph object
47
+ adb attach my_module:graph
48
+
49
+ # Attach with optional renderers/providers
50
+ adb attach my_module:graph \
51
+ --memory-renderer my_mod:MemoryRenderer \
52
+ --store-renderer my_mod:StoreRenderer \
53
+ --state-renderer my_mod:StateRenderer \
54
+ --output-renderer my_mod:ChatOutputRenderer \
55
+ --tool-renderer my_mod:ToolRenderer \
56
+ --state-mutator my_mod:StateMutator
57
+ ```
58
+
59
+ ## Run from Source
60
+
61
+ ```bash
62
+ # Create/update local env from this repo
63
+ uv sync --dev
64
+
65
+ # Run adb directly from source (project root)
66
+ uv run adb run examples/simple_agent.py
67
+
68
+ # Equivalent module invocation
69
+ uv run python -m agent_debugger.cli run examples/simple_agent.py
70
+ ```
71
+
72
+ ## Simple Agent Demo
73
+
74
+ ```bash
75
+ # Run simple_agent with all demo renderer/mutator extensions
76
+ uv run adb run examples/simple_agent.py \
77
+ --memory-renderer examples.simple_extensions:SimpleMemoryRenderer \
78
+ --output-renderer examples.simple_extensions:SimpleChatOutputRenderer \
79
+ --tool-renderer examples.simple_extensions:SimpleToolRenderer \
80
+ --state-mutator examples.simple_extensions:SimpleStateMutator
81
+
82
+ # Optional: enable LiteLLM tool-calling path in examples/simple_agent.py
83
+ # (example model uses Vertex + service account/ADC auth)
84
+ USE_LITELLM=1 LITELLM_MODEL=vertex_ai/gemini-2.0-flash uv run adb run examples/simple_agent.py \
85
+ --memory-renderer examples.simple_extensions:SimpleMemoryRenderer \
86
+ --output-renderer examples.simple_extensions:SimpleChatOutputRenderer \
87
+ --tool-renderer examples.simple_extensions:SimpleToolRenderer \
88
+ --state-mutator examples.simple_extensions:SimpleStateMutator
89
+ ```
90
+
91
+ ## Features
92
+
93
+ - **Application-level debugging**: See agent state, messages, tool calls, state diffs
94
+ - **Code-level debugging**: Set breakpoints, step through code, inspect variables
95
+ - **Agent-level breakpoints**: Break on node start, tool call, or state change
96
+ - **Optional renderers/providers**: Custom state, store, memory, chat output, and state mutation hooks
97
+ - **Persistent tool history**: Tool calls are kept across turns in the Tools pane and grouped by turn
98
+ - **`import agent_debugger as adb; adb.set_trace()`**: Drop into the debugger from anywhere in your agent code
99
+
100
+ ## Usage
101
+
102
+ ```bash
103
+ # Set a breakpoint on a node
104
+ /break node agent
105
+
106
+ # Set a breakpoint on a tool
107
+ /break tool search_listings
108
+
109
+ # Break when a state key changes
110
+ /break state messages
111
+
112
+ # Standard Python breakpoint
113
+ /break line my_agent.py:42
114
+
115
+ # Clear local UI context
116
+ /clear
117
+
118
+ # Local clear + optional mutator mutation
119
+ /clear memory
120
+ ```
121
+
122
+ See `/help` in the TUI for all commands.
123
+
124
+ ## Debug Keys
125
+
126
+ When at a breakpoint, use pudb-style keys:
127
+
128
+ | Key | Action |
129
+ |-----|--------|
130
+ | `c` | Continue execution |
131
+ | `n` | Step over (next line) |
132
+ | `s` | Step into |
133
+ | `r` | Step out (return / finish) |
134
+
135
+ **Implementation note:** When a breakpoint hits, the Input widget is disabled (`inp.disabled = True`). This prevents it from consuming keystrokes, so `c`/`n`/`s`/`r` go to the App's `BINDINGS` instead. When the user presses `c` (continue), the Input is re-enabled and re-focused.