company-skill 3.1.2 → 3.1.3
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/hooks/stop-guard.js +9 -0
- package/package.json +1 -1
package/hooks/stop-guard.js
CHANGED
|
@@ -9,6 +9,15 @@ const criteriaPath = path.join(companyDir, 'criteria.json');
|
|
|
9
9
|
const goalPath = path.join(companyDir, 'GOAL.md');
|
|
10
10
|
const cancelPath = path.join(companyDir, 'CANCEL');
|
|
11
11
|
|
|
12
|
+
// Read stdin for stop_hook_active flag
|
|
13
|
+
let stdinData = '';
|
|
14
|
+
try { stdinData = fs.readFileSync('/dev/stdin', 'utf8'); } catch (e) {}
|
|
15
|
+
let hookActive = false;
|
|
16
|
+
try { hookActive = JSON.parse(stdinData).stop_hook_active === true; } catch (e) {}
|
|
17
|
+
|
|
18
|
+
// If hook already fired once and Claude is trying to stop again, let it
|
|
19
|
+
if (hookActive) process.exit(0);
|
|
20
|
+
|
|
12
21
|
// No company running
|
|
13
22
|
if (!fs.existsSync(goalPath) && !fs.existsSync(criteriaPath)) process.exit(0);
|
|
14
23
|
|