@mauribadnights/clooks 0.6.0 → 0.6.1

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 (2) hide show
  1. package/dist/server.js +9 -5
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -91,11 +91,15 @@ function readBody(req) {
91
91
  }
92
92
  function sendJson(res, status, data) {
93
93
  const body = JSON.stringify(data);
94
- res.writeHead(status, {
95
- 'Content-Type': 'application/json',
96
- 'Content-Length': Buffer.byteLength(body),
97
- });
98
- res.end(body);
94
+ res.socket?.on('error', () => { }); // suppress EPIPE if client disconnected early
95
+ try {
96
+ res.writeHead(status, {
97
+ 'Content-Type': 'application/json',
98
+ 'Content-Length': Buffer.byteLength(body),
99
+ });
100
+ res.end(body);
101
+ }
102
+ catch (_) { }
99
103
  }
100
104
  /**
101
105
  * Create the HTTP server for hook handling.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mauribadnights/clooks",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Persistent hook runtime for Claude Code — eliminates process spawning overhead and gives you observability",
5
5
  "bin": {
6
6
  "clooks": "./dist/cli.js"