@luanpdd/kit-mcp 1.11.0 → 1.12.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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // hook-version: 1.6.0
2
+ // hook-version: 1.6.1
3
3
  // kit-mcp · Sidecar Tool Publisher (PostToolUse)
4
4
  //
5
5
  // Publishes every Claude Code tool invocation to the kit-mcp sidecar so the
@@ -74,8 +74,7 @@ process.stdin.on('end', () => {
74
74
  payload,
75
75
  };
76
76
 
77
- publish(port, event);
78
- process.exit(0);
77
+ publish(port, event).then(() => process.exit(0));
79
78
  } catch (err) {
80
79
  process.stderr.write(`[sidecar-tool-publisher] ${err.message}\n`);
81
80
  process.exit(0);
@@ -160,23 +159,30 @@ function detectIde() {
160
159
  }
161
160
 
162
161
  function publish(port, event) {
163
- const body = JSON.stringify(event);
164
- const req = http.request({
165
- method: 'POST',
166
- host: '127.0.0.1',
167
- port,
168
- path: '/publish',
169
- agent: false,
170
- headers: {
171
- host: `127.0.0.1:${port}`,
172
- 'content-type': 'application/json',
173
- 'content-length': Buffer.byteLength(body, 'utf8'),
174
- origin: `http://127.0.0.1:${port}`,
175
- connection: 'close',
176
- },
177
- }, (res) => { res.resume(); });
178
- req.on('error', () => { /* fire-and-forget */ });
179
- req.setTimeout(800, () => { try { req.destroy(); } catch (_) { /* noop */ } });
180
- req.write(body);
181
- req.end();
162
+ return new Promise((resolve) => {
163
+ const body = JSON.stringify(event);
164
+ const req = http.request({
165
+ method: 'POST',
166
+ host: '127.0.0.1',
167
+ port,
168
+ path: '/publish',
169
+ agent: false,
170
+ headers: {
171
+ host: `127.0.0.1:${port}`,
172
+ 'content-type': 'application/json',
173
+ 'content-length': Buffer.byteLength(body, 'utf8'),
174
+ origin: `http://127.0.0.1:${port}`,
175
+ connection: 'close',
176
+ },
177
+ }, (res) => {
178
+ // Drain response body to ensure server has fully processed before resolve
179
+ res.resume();
180
+ res.on('end', resolve);
181
+ res.on('close', resolve);
182
+ });
183
+ req.on('error', () => resolve());
184
+ req.setTimeout(800, () => { try { req.destroy(); } catch (_) { /* noop */ } resolve(); });
185
+ req.write(body);
186
+ req.end();
187
+ });
182
188
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luanpdd/kit-mcp",
3
- "version": "1.11.0",
3
+ "version": "1.12.1",
4
4
  "description": "Generic infrastructure to ship YOUR personal kit of agents/commands/skills as an MCP server, with cross-IDE sync (Claude Code, Cursor, Codex, Gemini, Windsurf, Antigravity, Copilot, Trae).",
5
5
  "type": "module",
6
6
  "bin": {