(&self, ctx: &InstallContext)
| 132 | } |
| 133 | |
| 134 | fn update_plugin(&self, ctx: &InstallContext) -> Result<UpdatePluginOutcome> { |
| 135 | let claude_dir = ctx.home.join(".claude"); |
| 136 | let settings_path = claude_dir.join("settings.json"); |
| 137 | let claude_md_path = claude_dir.join("CLAUDE.md"); |
| 138 | |
| 139 | if !plugin_marketplace_manifest_path(&ctx.home).exists() |
| 140 | && !has_config_managed_leftovers(&ctx.home) |
| 141 | { |
| 142 | return Ok(UpdatePluginOutcome::NotInstalled); |
| 143 | } |
| 144 | |
| 145 | // Redeploy the bundle at the current version, refresh the marketplace |
| 146 | // path, ensure enablement, and re-run migration. |
| 147 | let deploy_dir = deploy_plugin_bundle(&ctx.home, &ctx.tracedecay_bin)?; |
| 148 | register_marketplace(&ctx.home, &deploy_dir)?; |
| 149 | |
| 150 | let mut settings = load_json_file_strict(&settings_path)?; |
| 151 | enable_plugin(&mut settings); |
| 152 | // Write/refresh the plugin-namespace permission allowlist (and migrate |
| 153 | // legacy `mcp__tracedecay__*` entries to their plugin twins) so an |
| 154 | // `update-plugin` from an older install stops prompting on every tool |
| 155 | // call. Idempotent. |
| 156 | install_permissions(&mut settings, &ctx.tool_permissions); |
| 157 | write_json_file(&settings_path, &settings)?; |
| 158 | |
| 159 | migrate_off_config_managed(&ctx.home); |
| 160 | |
| 161 | // Refresh the managed CLAUDE.md steering block so an `update-plugin` |
| 162 | // rewrites a stale block to the current moment-trigger text. The block |
| 163 | // reaches subagents (they load the project/user CLAUDE.md), so keeping |
| 164 | // it current is how updated steering actually propagates. |
| 165 | install_claude_md_rules(&claude_md_path)?; |
| 166 | |
| 167 | sync_claude_plugin_cache(&ctx.home); |
| 168 | |
| 169 | Ok(UpdatePluginOutcome::Refreshed(vec![deploy_dir])) |
| 170 | } |
| 171 | |
| 172 | fn healthcheck(&self, dc: &mut DoctorCounters, ctx: &HealthcheckContext) { |
| 173 | eprintln!("\n\x1b[1mClaude Code integration\x1b[0m"); |
nothing calls this directly
no test coverage detected