Move Rider and Unity bridges to Rust

This commit is contained in:
Meta Vens 2026-05-06 07:55:02 +01:00
commit 8e656267d9
14 changed files with 1739 additions and 1250 deletions

View file

@ -5,9 +5,9 @@ This is the first Rider-side bridge surface for Epiphany.
It is deliberately small:
- show an Epiphany tool window inside Rider
- call `tools/epiphany_rider_bridge.py status`
- call native `epiphany-rider-bridge status`
- send current editor file/selection context through
`tools/epiphany_rider_bridge.py context`
native `epiphany-rider-bridge context`
- write operator-safe artifacts under `.epiphany-gui/rider`
The plugin does not talk to worker transcripts, raw results, or agent internals.
@ -27,20 +27,21 @@ gradle buildPlugin
## Runtime Contract
The plugin shells out to the local bridge script instead of owning protocol
The plugin shells out to the local native bridge instead of owning protocol
logic:
```powershell
python E:\Projects\EpiphanyAgent\tools\epiphany_rider_bridge.py status --project-root <repo>
python E:\Projects\EpiphanyAgent\tools\epiphany_rider_bridge.py context --project-root <repo> --file <file> --selection-start <line> --selection-end <line>
epiphany-rider-bridge status --project-root <repo>
epiphany-rider-bridge context --project-root <repo> --file <file> --selection-start <line> --selection-end <line>
```
Set these environment variables if needed:
- `EPIPHANY_REPO_ROOT`
- `EPIPHANY_PYTHON`
- `EPIPHANY_RIDER_BRIDGE`
- `CARGO_TARGET_DIR`
- `EPIPHANY_RIDER_ARTIFACT_ROOT`
The first dogfood use can also skip the plugin and use the bridge script
The first dogfood use can also skip the plugin and use the native bridge
directly. The point is the receipt shape, not making Rider perform authority
the Epiphany coordinator owns.

View file

@ -33,10 +33,10 @@ class EpiphanyBridgeClient(private val project: Project) {
}
private fun runBridge(args: List<String>): String {
val script = File(epiphanyRoot, "tools/epiphany_rider_bridge.py")
val bridge = bridgePath()
val artifactRoot = System.getenv("EPIPHANY_RIDER_ARTIFACT_ROOT")
?: File(epiphanyRoot, ".epiphany-gui/rider").absolutePath
val command = mutableListOf(pythonPath(), script.absolutePath)
val command = mutableListOf(bridge.absolutePath)
command.addAll(args)
command.add("--artifact-root")
command.add(artifactRoot)
@ -50,16 +50,22 @@ class EpiphanyBridgeClient(private val project: Project) {
return output.ifBlank { "Epiphany bridge returned no output." }
}
private fun pythonPath(): String {
return System.getenv("EPIPHANY_PYTHON")
?: "C:\\Users\\Meta\\.cache\\codex-runtimes\\codex-primary-runtime\\dependencies\\python\\python.exe"
private fun bridgePath(): File {
System.getenv("EPIPHANY_RIDER_BRIDGE")?.let { return File(it).absoluteFile }
val targetDir = System.getenv("CARGO_TARGET_DIR")
?: "C:\\Users\\Meta\\.cargo-target-codex"
val candidate = File(targetDir, "debug/epiphany-rider-bridge.exe").absoluteFile
if (candidate.exists()) {
return candidate
}
return File(epiphanyRoot, "epiphany-core/target/debug/epiphany-rider-bridge.exe").absoluteFile
}
private fun findEpiphanyRoot(): File {
System.getenv("EPIPHANY_REPO_ROOT")?.let { return File(it).absoluteFile }
var cursor: File? = projectRoot
while (cursor != null) {
if (File(cursor, "tools/epiphany_rider_bridge.py").exists()) {
if (File(cursor, "epiphany-core/Cargo.toml").exists()) {
return cursor
}
cursor = cursor.parentFile