| 256 | } |
| 257 | |
| 258 | fn write_embedded_plugin(install_dir: &Path, tracedecay_bin: &str) -> Result<()> { |
| 259 | for (relative, contents) in embedded_plugin_files() { |
| 260 | let rendered = match relative { |
| 261 | ".cursor-plugin/plugin.json" => cursor_plugin_manifest(contents)?, |
| 262 | "mcp.json" => cursor_plugin_mcp(contents, tracedecay_bin)?, |
| 263 | "hooks/hooks.json" => cursor_plugin_hooks(contents, tracedecay_bin)?, |
| 264 | _ => contents.to_string(), |
| 265 | }; |
| 266 | safe_write_text_file(&install_dir.join(relative), &rendered, None)?; |
| 267 | } |
| 268 | Ok(()) |
| 269 | } |
| 270 | |
| 271 | fn cursor_plugin_manifest(raw: &str) -> Result<String> { |
| 272 | super::plugin_bundle::stamp_manifest_version(raw) |