@tanagram/cli 0.5.53 → 0.5.54

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.
Binary file
Binary file
Binary file
Binary file
Binary file
package/install.js CHANGED
@@ -171,6 +171,62 @@ function installClaudeSkill() {
171
171
  }
172
172
  }
173
173
 
174
+ function installStopHook() {
175
+ if (process.env.TANAGRAM_SKIP_HOOK === '1' || process.env.TANAGRAM_SKIP_HOOK === 'true') {
176
+ console.error('Skipping Tanagram Stop hook installation (TANAGRAM_SKIP_HOOK set).');
177
+ return;
178
+ }
179
+ if (isCIEnvironment()) {
180
+ console.error('Skipping Tanagram Stop hook installation (CI environment).');
181
+ return;
182
+ }
183
+
184
+ console.error('Installing Tanagram Stop hook for Claude Code...');
185
+
186
+ try {
187
+ const settingsPath = path.join(os.homedir(), '.claude', 'settings.json');
188
+ let settings = {};
189
+
190
+ if (fs.existsSync(settingsPath)) {
191
+ const raw = fs.readFileSync(settingsPath, 'utf8');
192
+ settings = JSON.parse(raw);
193
+ }
194
+
195
+ // Ensure hooks.Stop array exists
196
+ if (!settings.hooks) settings.hooks = {};
197
+ if (!Array.isArray(settings.hooks.Stop)) settings.hooks.Stop = [];
198
+
199
+ // Check if tanagram stop-hook is already configured
200
+ const alreadyInstalled = settings.hooks.Stop.some(entry =>
201
+ Array.isArray(entry.hooks) && entry.hooks.some(h => h.command === 'tanagram stop-hook')
202
+ );
203
+
204
+ if (alreadyInstalled) {
205
+ console.error('✓ Tanagram Stop hook already configured');
206
+ return;
207
+ }
208
+
209
+ settings.hooks.Stop.push({
210
+ hooks: [
211
+ {
212
+ type: 'command',
213
+ command: 'tanagram stop-hook',
214
+ timeout: 120
215
+ }
216
+ ]
217
+ });
218
+
219
+ fs.mkdirSync(path.dirname(settingsPath), { recursive: true });
220
+ fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n');
221
+
222
+ console.error(`✓ Tanagram Stop hook installed to ${settingsPath}`);
223
+ track('cli.stop_hook.install.success');
224
+ } catch (err) {
225
+ console.error('Warning: Failed to install Stop hook:', err.message);
226
+ track('cli.stop_hook.install.failure', { error: err.message });
227
+ }
228
+ }
229
+
174
230
  function ensureOpenCode() {
175
231
  if (isCIEnvironment()) {
176
232
  return;
@@ -217,6 +273,9 @@ function ensureOpenCode() {
217
273
  // Install Claude skill
218
274
  installClaudeSkill();
219
275
 
276
+ // Install Stop hook for Claude Code
277
+ installStopHook();
278
+
220
279
  // Install OpenCode (LLM agent for eval)
221
280
  ensureOpenCode();
222
281
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanagram/cli",
3
- "version": "0.5.53",
3
+ "version": "0.5.54",
4
4
  "description": "Tanagram - Catch sloppy code before it ships",
5
5
  "main": "index.js",
6
6
  "bin": {