@niroai/niro 0.10.1 → 0.12.0

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.
@@ -42,6 +42,7 @@ const {
42
42
  isNiroUserPromptHook,
43
43
  isNiroPreToolUseHook,
44
44
  isNiroExploreHook,
45
+ isNiroImpactHook,
45
46
  userHome,
46
47
  } = require("./setup");
47
48
 
@@ -126,7 +127,7 @@ function removeMarkerSectionBounded(content, marker) {
126
127
  }
127
128
 
128
129
  /**
129
- * Strip niro's PostCompact, UserPromptSubmit, and PreToolUse (temp-project + explore-first) hook
130
+ * Strip niro's PostCompact, UserPromptSubmit, and PreToolUse (temp-project + explore-first + impact-gate) hook
130
131
  * entries from a parsed Claude Code settings object (mutates and returns it). Uses the same matchers
131
132
  * install uses. Empty arrays / an empty `hooks` object are pruned so the file stays tidy. Other hooks
132
133
  * are untouched. Returns { settings, removed } where `removed` is the count deleted.
@@ -152,7 +153,9 @@ function filterNiroHooks(settings) {
152
153
  }
153
154
  if (Array.isArray(hooks.PreToolUse)) {
154
155
  const before = hooks.PreToolUse.length;
155
- hooks.PreToolUse = hooks.PreToolUse.filter((h) => !isNiroPreToolUseHook(h) && !isNiroExploreHook(h));
156
+ hooks.PreToolUse = hooks.PreToolUse.filter(
157
+ (h) => !isNiroPreToolUseHook(h) && !isNiroExploreHook(h) && !isNiroImpactHook(h),
158
+ );
156
159
  removed += before - hooks.PreToolUse.length;
157
160
  if (hooks.PreToolUse.length === 0) delete hooks.PreToolUse;
158
161
  }
@@ -388,6 +391,8 @@ function uninstallClaudeCode() {
388
391
  // a task the developer has long forgotten.
389
392
  try {
390
393
  require("../lib/receiptStore").purge();
394
+ // The impact gate's evidence files and off switch go with the hook that read them.
395
+ require("../lib/impactLog").purge();
391
396
  } catch {
392
397
  /* best effort — never block an uninstall on cleaning up a cache */
393
398
  }