Skip to main content

Shared debugger library for Top Coder AI Skills — Node.js (CDP) and Python (DAP)

Project description

top-coder-ai-skills-debugger

Shared debugger library for Top Coder AI Skills. Python library for AI-driven debugging of Node.js (CDP) and Python (DAP) programs — breakpoints, stepping, and variable inspection without a GUI.

Features

  • Node.js — CDP over WebSocket (built-in inspector, no extra npm deps).
  • Python — DAP via debugpy (launch and attach).
  • Single APIDebugSession: start, breakpoints, continue, step, evaluate, stack, variables.
  • Two modes — In-memory (e.g. MCP server) or file-backed with a daemon (e.g. CLI scripts that run as separate processes).
  • LLM-friendly — All methods return plain text suitable for agent consumption.

Install

pip install top-coder-ai-skills-debugger
# or
uv add top-coder-ai-skills-debugger
# or
poetry add top-coder-ai-skills-debugger

Requirements: Python ≥3.11.

Quick start (in-memory)

import asyncio
from debugger_core.session import DebugSession

async def main():
    session = DebugSession()
    print(await session.start("app.js", "node"))
    print(await session.add_breakpoint("app.js", 10))
    print(await session.resume())       # run until breakpoint
    print(await session.inspect("x"))    # evaluate expression
    print(await session.get_stack())
    print(await session.stop())

asyncio.run(main())

All methods return strings (status messages, stack traces, variable dumps, or error text).

Session modes

Mode Use case How
In-memory MCP server, scripts in one process session = DebugSession() then start, resume, etc.
File-backed CLI scripts (each command is a new process) session = DebugSession.from_file_or_new(language="node"). First call runs start() and spawns a daemon; later calls reuse it via the saved session file.

For file-backed usage, always call stop() when done so the daemon and debuggee are torn down.

API overview

Method Description
start(program, language) Launch the debugger (language: "node" or "python").
add_breakpoint(file, line) Set a breakpoint; returns verification status.
resume() Continue until next breakpoint or program exit.
step(action="next") Step over (next) or step in (step_in).
inspect(expression) Evaluate an expression in the current frame.
get_stack() Current call stack as formatted text.
get_local_variables() Local variables of the top frame.
probe(program, file, line, language) One-shot: start, run to line, return stack + variables, then stop.
stop() Disconnect and clean up.

Development

From the package directory:

# Build wheel + sdist
make build

# Publish to PyPI (after configuring auth)
make publish

# Clean and reinstall from dist (sanity check)
make clean && make test-install

See the repo root and docs/PUBLISHING.md for workspace setup and publishing from the monorepo.

License

MIT. See the top-level repo for full license and source links.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

top_coder_ai_skills_debugger-0.1.0.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

top_coder_ai_skills_debugger-0.1.0-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

Details for the file top_coder_ai_skills_debugger-0.1.0.tar.gz.

File metadata

File hashes

Hashes for top_coder_ai_skills_debugger-0.1.0.tar.gz
Algorithm Hash digest
SHA256 375ed90ab891d24b092767da8cc1df8323a480c275d7b438b8c8a381df0a6c34
MD5 36437f72d4cf8b2789d93f7da45283c3
BLAKE2b-256 1079b1b02ca42bb2c55c54a0764db02a2abb43cedb543e810dffaafd7e374f5f

See more details on using hashes here.

File details

Details for the file top_coder_ai_skills_debugger-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for top_coder_ai_skills_debugger-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ae6f4dad2cdb8c712f00b18074927387e2efffe12573982b7ebd39e995cd65a
MD5 5ca58f2b4b82a765a18cff438381de65
BLAKE2b-256 a843c85749ba36923c64215e9cf64173d70927c8d6c3bf64121f094414a4f169

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page