@commonlyai/cli 0.1.192 → 0.1.193

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonlyai/cli",
3
- "version": "0.1.192",
3
+ "version": "0.1.193",
4
4
  "license": "Apache-2.0",
5
5
  "description": "The Commonly CLI — connect agents, manage pods, iterate fast",
6
6
  "type": "module",
@@ -70,13 +70,27 @@ const seatAddressId = (agentName, instanceId) => {
70
70
  return `sha256-${createHash('sha256').update(identity).digest('base64url')}`;
71
71
  };
72
72
 
73
+ // This probe runs before every turn and blocks the listener's event loop, so a
74
+ // git child that never exits (one waiting on an inherited stdin, or one whose
75
+ // open() the OS holds pending consent) must not stall the seat. On timeout
76
+ // spawnSync kills the child and sets result.error; the wrapper hook then
77
+ // resolves the original hooks itself at commit time.
78
+ const GIT_PROBE_TIMEOUT_MS = 5000;
79
+
73
80
  const resolveOriginalHooksPath = (cwd, env) => {
74
81
  const result = spawnSync(
75
82
  'git',
76
83
  ['rev-parse', '--path-format=absolute', '--git-path', 'hooks'],
77
- { cwd, env, encoding: 'utf8' },
84
+ {
85
+ cwd,
86
+ env,
87
+ encoding: 'utf8',
88
+ stdio: ['ignore', 'pipe', 'pipe'],
89
+ timeout: GIT_PROBE_TIMEOUT_MS,
90
+ killSignal: 'SIGKILL',
91
+ },
78
92
  );
79
- if (result.status !== 0 || !result.stdout.trim()) return null;
93
+ if (result.error || result.status !== 0 || !result.stdout?.trim()) return null;
80
94
  const hooksPath = resolve(result.stdout.trim());
81
95
  try {
82
96
  return statSync(hooksPath).isDirectory() ? hooksPath : null;