feat(simulation): expose semantic UI snapshots (#37802)
This commit is contained in:
parent
86a468c4d8
commit
edc93ceff1
12 changed files with 477 additions and 43 deletions
12
packages/tui/src/simulation/semantics.ts
Normal file
12
packages/tui/src/simulation/semantics.ts
Normal 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 }
|
||||
Loading…
Add table
Add a link
Reference in a new issue