mirror of
https://github.com/Heretek-AI/opencode.git
synced 2026-11-22 08:59:26 -10:00
13 lines
484 B
TypeScript
13 lines
484 B
TypeScript
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 }
|