feat(simulation): add endpoint handshake protocol (#37157)
This commit is contained in:
parent
f92d84746b
commit
5e2e0d6965
8 changed files with 350 additions and 2 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { InstallationVersion } from "@opencode-ai/core/installation/version"
|
||||
import { Effect } from "effect"
|
||||
import { SimulationControlServer } from "../control-server"
|
||||
import { SimulationProtocol } from "../protocol"
|
||||
|
|
@ -6,6 +7,15 @@ import { SimulationRenderer } from "./renderer"
|
|||
|
||||
function handle(harness: Harness, request: SimulationProtocol.Frontend.Request) {
|
||||
switch (request.method) {
|
||||
case "simulation.handshake":
|
||||
return SimulationProtocol.Handshake.dispatch(
|
||||
{
|
||||
role: "ui",
|
||||
server: { name: "opencode", version: InstallationVersion },
|
||||
capabilities: SimulationProtocol.Frontend.Capabilities,
|
||||
},
|
||||
request.params,
|
||||
)
|
||||
case "ui.capture":
|
||||
return SimulationActions.capture(harness)
|
||||
case "ui.screenshot":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue