feat(simulation): expose semantic UI snapshots (#37802)

This commit is contained in:
Kit Langton 2026-07-19 16:04:27 -04:00 committed by GitHub
commit edc93ceff1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 477 additions and 43 deletions

View file

@ -39,7 +39,7 @@ test("scopes the frontend control server and reports malformed JSON", async () =
protocolVersion: 1,
role: "ui",
server: { name: "opencode", version: expect.any(String) },
capabilities: expect.arrayContaining(["ui.state", "ui.capture"]),
capabilities: expect.arrayContaining(["ui.state", "ui.snapshot", "ui.capture"]),
},
})
@ -60,6 +60,13 @@ test("scopes the frontend control server and reports malformed JSON", async () =
},
})
socket.send(JSON.stringify({ jsonrpc: "2.0", id: 3, method: "ui.snapshot" }))
expect(yield* Queue.take(messages)).toEqual({
jsonrpc: "2.0",
id: 3,
result: { format: "opencode-ui-snapshot-v1", nodes: [] },
})
socket.send("{")
expect(yield* Queue.take(messages)).toMatchObject({
id: null,