Lay down the plugin and the config entry as an older release left them.
(directory: Path, body: str = V1_PLUGIN, entry: bool = True)
| 69 | |
| 70 | |
| 71 | def _old_install(directory: Path, body: str = V1_PLUGIN, entry: bool = True) -> tuple[Path, Path]: |
| 72 | """Lay down the plugin and the config entry as an older release left them.""" |
| 73 | plugin = directory / ".opencode" / "plugins" / "graphify.js" |
| 74 | plugin.parent.mkdir(parents=True, exist_ok=True) |
| 75 | plugin.write_text(body, encoding="utf-8") |
| 76 | config = directory / ".opencode" / "opencode.json" |
| 77 | settings = {"model": "some/model", **({"plugin": [ENTRY]} if entry else {})} |
| 78 | config.write_text(json.dumps(settings), encoding="utf-8") |
| 79 | return plugin, config |
| 80 | |
| 81 | |
| 82 | def test_the_old_plugin_is_what_opencode_2_rejects(): |
no outgoing calls
no test coverage detected