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

Function generate_plugin

scripts/hermes_plugin_unit_check.py:45–69  ·  view source on GitHub ↗

Generates the plugin into a throwaway HOME using the real installer.

(work: Path)

Source from the content-addressed store, hash-verified

43
44
45def generate_plugin(work: Path) -> Path:
46 """Generates the plugin into a throwaway HOME using the real installer."""
47 repo_root = Path(__file__).resolve().parent.parent
48 bin_path = Path(
49 os.environ.get("TRACEDECAY_BIN", repo_root / "target" / "debug" / "tracedecay")
50 )
51 assert bin_path.is_file(), f"tracedecay binary not found at {bin_path}"
52 home = work / "home"
53 home.mkdir()
54 env = dict(os.environ)
55 env["HOME"] = str(home)
56 env["USERPROFILE"] = str(home)
57 env["PATH"] = f"{bin_path.parent}{os.pathsep}{env.get('PATH', '')}"
58 env.pop("HERMES_HOME", None)
59 subprocess.run(
60 [str(bin_path), "install", "--agent", "hermes", "--no-dashboard"],
61 check=True,
62 env=env,
63 capture_output=True,
64 text=True,
65 timeout=120,
66 )
67 plugin_dir = home / ".hermes" / "plugins" / "tracedecay"
68 assert (plugin_dir / "__init__.py").is_file(), plugin_dir
69 return plugin_dir
70
71
72class StubCtx:

Callers 1

run_checksFunction · 0.85

Calls 2

resolveMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected