debug-run 0.5.8 → 0.5.10

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 (3) hide show
  1. package/README.md +31 -0
  2. package/dist/index.cjs +9641 -392
  3. package/package.json +5 -2
package/README.md CHANGED
@@ -143,6 +143,8 @@ Options:
143
143
  --attach Attach to running process
144
144
  --pid <id> Process ID to attach to
145
145
  --env <key=value...> Environment variables
146
+ --compact Enable compact output for reduced token usage
147
+ --stack-limit <N> Max stack frames to include (default: 3 in compact)
146
148
 
147
149
  Commands:
148
150
  list-adapters List available debug adapters
@@ -336,6 +338,35 @@ When an assertion fails, you get an `assertion_failed` event with:
336
338
 
337
339
  Assertions are checked at breakpoints, during stepping, and during trace mode.
338
340
 
341
+ ### Compact output mode (for AI agents)
342
+
343
+ Reduce token usage by 40-60% with compact output:
344
+
345
+ ```bash
346
+ npx debug-run ./app.dll \
347
+ -a dotnet \
348
+ -b "src/OrderService.cs:45" \
349
+ --compact \
350
+ --pretty
351
+ ```
352
+
353
+ Compact mode applies these optimizations:
354
+ - **Stack trace limiting**: Only top 3 frames by default (configurable with `--stack-limit`)
355
+ - **Internal frame filtering**: Removes node_modules, runtime internals, webpack frames
356
+ - **Path abbreviation**: `~/project/src/file.ts` instead of `/Users/name/project/src/file.ts`
357
+ - **Variable diffing**: On repeated breakpoint hits, only reports changed variables (`_diff` key)
358
+ - **Trace path collapsing**: Consecutive identical locations collapsed to `functionName (x5)`
359
+
360
+ Example compact output vs verbose:
361
+
362
+ ```json
363
+ // Compact (~60 tokens)
364
+ {"type":"breakpoint_hit","location":{"file":".../src/OrderService.cs","line":45,"function":"ProcessOrder"},"stackTrace":[{"function":"ProcessOrder","file":".../src/OrderService.cs","line":45}],"locals":{"order":{"type":"OrderDto","value":{"Id":"abc-123","Total":150}}}}
365
+
366
+ // Verbose (~180 tokens)
367
+ {"type":"breakpoint_hit","timestamp":"2025-01-15T10:30:01.234Z","id":1,"threadId":1,"location":{"file":"/home/user/project/src/OrderService.cs","line":45,"column":12,"function":"ProcessOrder","module":"MyApp"},"stackTrace":[{"frameId":1,"function":"ProcessOrder","file":"/home/user/project/src/OrderService.cs","line":45,"column":12,"module":"MyApp"},{"frameId":2,"function":"Main","file":"/home/user/project/src/Program.cs","line":10,"column":5},...],"locals":{"order":{"type":"OrderDto","value":{"Id":"abc-123","Total":150,"CreatedAt":"2025-01-15T00:00:00Z","Status":"pending",...}},"this":{...}}}
368
+ ```
369
+
339
370
  ### Trace mode (follow execution path)
340
371
 
341
372
  Automatically step through code after hitting a breakpoint: