{"_id":"@alesanchezr/llm-debugger","_rev":"5-e7daffb2d753458989aa0f57f976c9a3","name":"@alesanchezr/llm-debugger","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@alesanchezr/llm-debugger","version":"1.0.0","author":{"name":"alesanchezr"},"license":"MIT","_id":"@alesanchezr/llm-debugger@1.0.0","maintainers":[{"name":"alesanchezr","email":"aalejo@gmail.com"}],"bin":{"llm-debugger":"src/back/server.js"},"dist":{"shasum":"0e588a95fbbb635c3b11e0c1af9856b677d9b3f4","tarball":"https://registry.npmjs.org/@alesanchezr/llm-debugger/-/llm-debugger-1.0.0.tgz","fileCount":3,"integrity":"sha512-VlMvVU2o8GikAQoxyYge9MNfyw2yRhnMd+w15ZrqgTeM1gyg6+ZgECDCzVxOC9c8g9PB7Amy3dokm7dKsijPhA==","signatures":[{"sig":"MEUCIEnIjYNoKlXChOTK8v2gwX+6WBUaMHPWJ2Os/QfRPV+NAiEA1XHRsJZsn+4lU/Ch9pU/eMFE//fBhvWz3/vXVLAv+/o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4178},"main":"dist/llm-debugger.js","scripts":{"build":"rollup -c","start":"node src/back/server.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"alesanchezr","email":"aalejo@gmail.com"},"_npmVersion":"10.9.0","description":"A tool to debug console logs by sending them to a local server","directories":{},"_nodeVersion":"22.12.0","dependencies":{"cors":"^2.8.5","express":"^4.18.2"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^3.29.4","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-node-resolve":"^15.2.3"},"_npmOperationalInternal":{"tmp":"tmp/llm-debugger_1.0.0_1744055124611_0.855336524051993","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@alesanchezr/llm-debugger","version":"1.0.1","author":{"name":"alesanchezr"},"license":"MIT","_id":"@alesanchezr/llm-debugger@1.0.1","maintainers":[{"name":"alesanchezr","email":"aalejo@gmail.com"}],"bin":{"llm-debugger":"src/back/server.js"},"dist":{"shasum":"d0badf1d845e1a940a41ee62f37be530ddcff0ae","tarball":"https://registry.npmjs.org/@alesanchezr/llm-debugger/-/llm-debugger-1.0.1.tgz","fileCount":3,"integrity":"sha512-UNZW1BhuDizVrCqIzlGmMy8NZGLYAaKu+rxgehDlAZXK6aK77EyY6gXFquMM8wpmSZKX9NOb6/Hf+2jPh8cEJw==","signatures":[{"sig":"MEYCIQCQvdiTYV8Bh/2Rf7ESU22ZOMTZp4Lg0cwWI01sL7FsYgIhAMBMrHklXeHApzYhAidwHdkKznEXaglGwpIcWGpxx9Xb","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5125},"main":"dist/llm-debugger.js","scripts":{"build":"rollup -c","start":"node src/back/server.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"alesanchezr","email":"aalejo@gmail.com"},"_npmVersion":"10.9.0","description":"A tool to debug console logs by sending them to a local server","directories":{},"_nodeVersion":"22.12.0","dependencies":{"cors":"^2.8.5","express":"^4.18.2"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^3.29.4","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-node-resolve":"^15.2.3"},"_npmOperationalInternal":{"tmp":"tmp/llm-debugger_1.0.1_1744055499036_0.6184950548065931","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@alesanchezr/llm-debugger","version":"1.0.2","author":{"name":"alesanchezr"},"license":"MIT","_id":"@alesanchezr/llm-debugger@1.0.2","maintainers":[{"name":"alesanchezr","email":"aalejo@gmail.com"}],"bin":{"llm-debugger":"src/back/server.js"},"dist":{"shasum":"efd96f516f3bcd2c4a3d272d069087bba2fa9d46","tarball":"https://registry.npmjs.org/@alesanchezr/llm-debugger/-/llm-debugger-1.0.2.tgz","fileCount":4,"integrity":"sha512-5/VNwQD9gHRiiRyYHeHSpPA3oPqmrCxhSiQRCb7lrzod6DOnXT9M8P5IAWj6U6Cz4wkB+UQkGFsZ4sh2dGGeyQ==","signatures":[{"sig":"MEUCIQD//feOBszMB5lxlgB5KPur46+AlwWzh4IETNHjWJDqvgIgRJQNP+z1S5GTDXaLytr45F58bmMs5Qi4dBWoTsUchQA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7317},"main":"dist/llm-debugger.js","scripts":{"build":"rollup -c","start":"node src/back/server.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"alesanchezr","email":"aalejo@gmail.com"},"_npmVersion":"10.9.0","description":"A tool to debug console logs by sending them to a local server","directories":{},"_nodeVersion":"22.12.0","dependencies":{"cors":"^2.8.5","express":"^4.18.2"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^3.29.4","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-node-resolve":"^15.2.3"},"_npmOperationalInternal":{"tmp":"tmp/llm-debugger_1.0.2_1744055653024_0.6111465407361263","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@alesanchezr/llm-debugger","version":"1.0.3","keywords":[],"author":{"name":"alesanchezr"},"license":"MIT","_id":"@alesanchezr/llm-debugger@1.0.3","maintainers":[{"name":"alesanchezr","email":"aalejo@gmail.com"}],"bin":{"llm-debugger":"src/back/server.js"},"dist":{"shasum":"880a7059d0a06b63913b75d1e3e6c3f09e434fea","tarball":"https://registry.npmjs.org/@alesanchezr/llm-debugger/-/llm-debugger-1.0.3.tgz","fileCount":4,"integrity":"sha512-R5kaVplT/v39mKoChtojssBbHsxKcAQKUo6Hc8jFibvwZVCb2P1Q+GOY3ccTt7u1ibae1yVgWcCCSx/5uRUNkg==","signatures":[{"sig":"MEYCIQD2anlFoC/wu6lZ95YCUYTQo0+o+XdlfFQaRSNSM8rr5AIhAIvXlzMAsRyvOXjtMa6sb4JpqNfjnSlaLECEfiNRMYrd","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14410},"main":"dist/llm-debugger.js","type":"module","gitHead":"ad31163fa3f3317029eaee7a8c963581734b9c9e","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c","start":"node src/back/server.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"alesanchezr","email":"aalejo@gmail.com"},"_npmVersion":"10.9.0","description":"A tool to debug console logs by sending them to a local server","directories":{},"_nodeVersion":"22.12.0","dependencies":{"cors":"^2.8.5","express":"^4.18.2"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^3.29.5","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-node-resolve":"^15.3.1"},"_npmOperationalInternal":{"tmp":"tmp/llm-debugger_1.0.3_1744210866184_0.930723442754434","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@alesanchezr/llm-debugger","version":"1.0.4","description":"A tool to debug console logs by sending them to a local server","type":"module","main":"dist/llm-debugger.js","bin":{"llm-debugger":"src/back/server.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c","start":"node src/back/server.js","prepublishOnly":"npm run build"},"keywords":[],"author":{"name":"alesanchezr"},"license":"MIT","dependencies":{"cors":"^2.8.5","express":"^4.18.2"},"devDependencies":{"@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-node-resolve":"^15.3.1","rollup":"^3.29.5"},"_id":"@alesanchezr/llm-debugger@1.0.4","gitHead":"c8b9ebb1cb8bf2cc984aec25c8b68a23d0b4bca6","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-J6Z0TrZEpopORTB4yyUSBBnbJtRAtjtL1c5jVoflt8dtbjN1vgP0I6du4Njjhk722cFDyay2zC+BBONR6YWKxA==","shasum":"e103f70332c4bf613d9cae6984c87fff4b1e45ae","tarball":"https://registry.npmjs.org/@alesanchezr/llm-debugger/-/llm-debugger-1.0.4.tgz","fileCount":4,"unpackedSize":14438,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCZbgRJq7Pjj4ynvhsBKH2FknT1CDjpx1REDg/ZruZ/LwIgMcxKxg5XEJMv0Tljt/FSH9EJBZ6pMCgAo4pehejEvoI="}]},"_npmUser":{"name":"alesanchezr","email":"aalejo@gmail.com"},"directories":{},"maintainers":[{"name":"alesanchezr","email":"aalejo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/llm-debugger_1.0.4_1744643706820_0.9782975258301039"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-07T19:45:24.546Z","modified":"2025-04-14T15:15:07.179Z","1.0.0":"2025-04-07T19:45:24.783Z","1.0.1":"2025-04-07T19:51:39.211Z","1.0.2":"2025-04-07T19:54:13.200Z","1.0.3":"2025-04-09T15:01:06.407Z","1.0.4":"2025-04-14T15:15:07.016Z"},"author":{"name":"alesanchezr"},"license":"MIT","keywords":[],"description":"A tool to debug console logs by sending them to a local server","maintainers":[{"name":"alesanchezr","email":"aalejo@gmail.com"}],"readme":"# LLM Debugger\n\nCapture frontend console logs, network requests (fetch), and **check the status of script/stylesheet links** and stream them to a local server. The server saves these logs to a file (`llm-debugger-logs.txt` by default) for easy inclusion as context in LLMs (like Cursor, Copilot, etc.) or for general debugging.\n\n- **Console Logging**: Capture all console output with file and line numbers\n- **Network Monitoring**: Track fetch requests and responses\n- **Resource Checking**: Automatically detect failed script and stylesheet loads\n- **Error Tracking**: Capture uncaught errors and unhandled promise rejections with stack traces\n- **LLM-Friendly Format**: Logs are saved in a clean, human-readable text format\n- **Zero Configuration**: Works out of the box with sensible defaults\n\n## Quick Usage (2 steps)\n\n1. Run the server that will create and sync the `llm-debugger-logs.txt` file:\n\n```bash\nnpx @alesanchezr/llm-debugger start\n```\n\n2. Add these two script tags to your HTML `<head>` opening and closing tags:\n\n```html\n<!-- Configure LLM Debugger -->\n<script>\n    window.LLM_DEBUGGER_CONFIG = {\n        sniffers: ['console', 'fetch', 'resourceCheck'],\n        endpoint: 'http://localhost:3006/logs'\n    };\n</script>\n\n<!-- Initialize LLM Debugger -->\n<script src=\"https://cdn.jsdelivr.net/npm/@alesanchezr/llm-debugger@latest/dist/llm-debugger.bundle.js\"></script>\n```\n\nThat's it! The debugger will start automatically and begin collecting:\n- Console logs (log, warn, error)\n- Network requests and responses\n- Failed script and stylesheet loads\n- JavaScript errors with stack traces\n- Unhandled promise rejections\n\n\n## Advanced Configuration\n\nCustomize the debugger's behavior using these options:\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `sniffers` | Array/String | `['console', 'fetch', 'resourceCheck']` | What to monitor |\n| `logLevel` | String | `'info'` | Minimum log level to capture |\n| `autoStart` | Boolean | `true` | Start automatically |\n| `endpoint` | String | `'http://localhost:3006/logs'` | Where to send logs |\n| `bufferSize` | Number | `150 * 1024` | Max log buffer size (150KB) |\n| `sendInterval` | Number | `5000` | How often to send logs (ms) |\n\n## Examples\n\n### Basic Usage\n```html\n<script>\n    window.LLM_DEBUGGER_CONFIG = {\n        sniffers: ['console', 'fetch']\n    };\n</script>\n<script src=\"https://cdn.jsdelivr.net/npm/@alesanchezr/llm-debugger@latest/dist/llm-debugger.bundle.js\" type=\"module\"></script>\n```\n\n### Advanced Configuration\n```html\n<script>\n    window.LLM_DEBUGGER_CONFIG = {\n        sniffers: ['console', 'resourceCheck'],\n        logLevel: 'error',\n        endpoint: 'https://your-log-server.com/logs',\n        bufferSize: 300 * 1024,\n        sendInterval: 10000\n    };\n</script>\n<script src=\"https://cdn.jsdelivr.net/npm/@alesanchezr/llm-debugger@latest/dist/llm-debugger.bundle.js\" type=\"module\"></script>\n```\n\n## Log Format\n\nLogs are saved in a clean, human-readable text format:\n\n```\n[2024-03-14T12:34:56.789Z] CONSOLE DEBUG: This is a debug message in app.js:42\n[2024-03-14T12:34:57.123Z] NETWORK: GET https://api.example.com/data (200 OK)\n[2024-03-14T12:34:58.456Z] RESOURCE: Failed to load script https://example.com/missing.js (404 Not Found)\n[2024-03-14T12:34:59.789Z] UNCAUGHT ERROR: Cannot read property 'x' of undefined in app.js:15:10\nStack trace:\nTypeError: Cannot read property 'x' of undefined\n    at foo (app.js:15:10)\n    at bar (app.js:10:5)\n    at app.js:5:3\n[2024-03-14T12:35:00.123Z] UNHANDLED PROMISE REJECTION: Promise was rejected\nStack trace:\nError: Operation failed\n    at asyncFunction (app.js:25:10)\n    at app.js:20:5\n```\n\n## Development and contributions\n\n1. Install dependencies:\n```bash\nnpm install\n```\n\n2. Start the development server:\n```bash\nnpm run dev\n```\n\n3. Build for production:\n```bash\nnpm run build\n```\n\n## Demo\n\nTry the demo in the `demo` directory:\n1. Build the debugger: `npm run build`\n2. Serve the demo directory\n3. Open the browser console to see the debugger in action\n\n## License\n\nMIT \n","readmeFilename":"README.md"}