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