gm-cc 2.0.587 → 2.0.589

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.
@@ -4,7 +4,7 @@
4
4
  "name": "AnEntrypoint"
5
5
  },
6
6
  "description": "State machine agent with hooks, skills, and automated git enforcement",
7
- "version": "2.0.587",
7
+ "version": "2.0.589",
8
8
  "metadata": {
9
9
  "description": "State machine agent with hooks, skills, and automated git enforcement"
10
10
  },
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/bin/plugkit.exe CHANGED
Binary file
package/bin/plugkit.js CHANGED
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- const { spawnSync } = require('child_process');
3
+ const { spawn, spawnSync } = require('child_process');
4
4
  const path = require('path');
5
5
  const os = require('os');
6
+ const fs = require('fs');
6
7
 
7
8
  const dir = __dirname;
8
9
  const platform = os.platform();
@@ -11,12 +12,31 @@ const arch = os.arch();
11
12
  let bin;
12
13
  if (platform === 'win32') {
13
14
  bin = path.join(dir, arch === 'arm64' ? 'plugkit-win32-arm64.exe' : 'plugkit-win32-x64.exe');
14
- if (!require('fs').existsSync(bin)) bin = path.join(dir, 'plugkit.exe');
15
+ if (!fs.existsSync(bin)) bin = path.join(dir, 'plugkit.exe');
15
16
  } else if (platform === 'darwin') {
16
17
  bin = path.join(dir, arch === 'arm64' ? 'plugkit-darwin-arm64' : 'plugkit-darwin-x64');
17
18
  } else {
18
19
  bin = path.join(dir, arch === 'arm64' || arch === 'aarch64' ? 'plugkit-linux-arm64' : 'plugkit-linux-x64');
19
20
  }
20
21
 
21
- const result = spawnSync(bin, process.argv.slice(2), { stdio: 'inherit', windowsHide: true });
22
- process.exit(result.status ?? 1);
22
+ const args = process.argv.slice(2);
23
+ const isHook = args[0] === 'hook';
24
+
25
+ if (isHook && !process.stdin.isTTY) {
26
+ // Claude Code pipes JSON to the wrapper's stdin. On Windows, spawnSync with
27
+ // stdio:'inherit' does NOT reliably forward a piped stdin to the native child
28
+ // (the child sees EOF immediately and the hook treats tool_name as empty →
29
+ // silently allows every command). Read stdin ourselves and write it explicitly.
30
+ const chunks = [];
31
+ process.stdin.on('data', c => chunks.push(c));
32
+ process.stdin.on('end', () => {
33
+ const child = spawn(bin, args, { stdio: ['pipe', 'inherit', 'inherit'], windowsHide: true });
34
+ child.stdin.end(Buffer.concat(chunks));
35
+ child.on('close', code => process.exit(code ?? 1));
36
+ child.on('error', () => process.exit(1));
37
+ });
38
+ process.stdin.on('error', () => process.exit(1));
39
+ } else {
40
+ const result = spawnSync(bin, args, { stdio: 'inherit', windowsHide: true });
41
+ process.exit(result.status ?? 1);
42
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-cc",
3
- "version": "2.0.587",
3
+ "version": "2.0.589",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.587",
3
+ "version": "2.0.589",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": {
6
6
  "name": "AnEntrypoint",