Summary
Port scripts/debug.sh (355 lines) to src/lib/debug.ts as part of the #924 shell consolidation.
This is the diagnostic collection script that gathers system info, Docker state, gateway logs, and sandbox status for nemoclaw debug. Currently implemented as a bash script that bin/nemoclaw.js shells out to.
Approach
- Write
src/lib/debug.ts using execa (not child_process) for subprocess execution
- Replace
bin/nemoclaw.js's spawnSync("bash", ["scripts/debug.sh", ...]) with a direct call to the TS module
- Secret redaction must be preserved (the script filters API keys from output)
- Follow the established pattern: TS source in
src/lib/, compiled to dist/lib/ via npm run build:cli
- Co-locate tests in
src/lib/debug.test.ts, importing from ../../dist/lib/debug for coverage attribution
Context
Not blocked by
Any of the #924 blocker PRs (#781, #782, #819, #672, #794, #634).
Summary
Port
scripts/debug.sh(355 lines) tosrc/lib/debug.tsas part of the #924 shell consolidation.This is the diagnostic collection script that gathers system info, Docker state, gateway logs, and sandbox status for
nemoclaw debug. Currently implemented as a bash script thatbin/nemoclaw.jsshells out to.Approach
src/lib/debug.tsusing execa (not child_process) for subprocess executionbin/nemoclaw.js'sspawnSync("bash", ["scripts/debug.sh", ...])with a direct call to the TS modulesrc/lib/, compiled todist/lib/vianpm run build:clisrc/lib/debug.test.ts, importing from../../dist/lib/debugfor coverage attributionContext
bin/lib/, TS source insrc/lib/)Not blocked by
Any of the #924 blocker PRs (#781, #782, #819, #672, #794, #634).