MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / write_codex_plugin_files

Function write_codex_plugin_files

src/agents/codex.rs:570–586  ·  view source on GitHub ↗
(
    install_dir: &Path,
    tracedecay_bin: &str,
    policy: CodexBundlePolicy,
)

Source from the content-addressed store, hash-verified

568}
569
570fn write_codex_plugin_files(
571 install_dir: &Path,
572 tracedecay_bin: &str,
573 policy: CodexBundlePolicy,
574) -> Result<()> {
575 for (relative, contents) in codex_embedded_plugin_files() {
576 let rendered = match relative {
577 ".codex-plugin/plugin.json" => codex_plugin_manifest(contents, policy)?,
578 ".mcp.json" => codex_plugin_mcp(contents, tracedecay_bin, policy)?,
579 "hooks/hooks.json" if !policy.include_hooks() => continue,
580 "hooks/hooks.json" => codex_plugin_hooks(contents, tracedecay_bin)?,
581 _ => contents.to_string(),
582 };
583 safe_write_text_file(&install_dir.join(relative), &rendered, None)?;
584 }
585 Ok(())
586}
587
588fn codex_plugin_manifest(raw: &str, policy: CodexBundlePolicy) -> Result<String> {
589 super::plugin_bundle::stamp_manifest_version_with(raw, |manifest| {

Callers 1

Calls 6

codex_plugin_manifestFunction · 0.85
codex_plugin_mcpFunction · 0.85
codex_plugin_hooksFunction · 0.85
safe_write_text_fileFunction · 0.85
include_hooksMethod · 0.80

Tested by

no test coverage detected