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

@ -0,0 +1,12 @@
import type { Renderable } from "@opentui/core"
import type { SimulationProtocol } from "@opencode-ai/simulation/protocol"
type Definition = Omit<SimulationProtocol.Frontend.SemanticNode, "id" | "element" | "parent">
const key = Symbol.for("opencode.simulation.semantics")
const bind = (definition: () => Definition) => (renderable: Renderable) => {
Object.defineProperty(renderable, key, { value: definition, configurable: true })
}
export const SimulationSemantics = { bind }