kestrel.markets
Version:
A typed, token-efficient language + runtime for agentic trading: agents author bounded plans, the runtime fires them at the tick. CLI + typed library + MCP server.
28 lines (27 loc) • 1.56 kB
JavaScript
/**
* # react/TerminalView — a shell around ENGINE BYTES (ADR-0052 §4)
*
* Displays a PRE-RENDERED text Rendering — canonical or a token-optimal ARM the engine already
* emitted ({@link ../frame/render.ts} / {@link ../frame/render-arm.ts}) — as monospace text with the
* EXACT whitespace preserved. It is a shell, NEVER a fourth renderer: it takes the text as a prop and
* does ZERO re-rendering logic. `React hosts Renderings; it never produces them` (ADR-0052 §4). The
* {@link TerminalViewProps.arm} prop is metadata identifying which arm produced the bytes; a host
* that offers a model-selector reads the available ids from {@link ./arms.ts ARM_IDS}.
*
* Isolation (ADR-0052 §3): the only value import is `react`; the arm id is typed against the engine's
* registry via a type-only edge ({@link ./arms.ts}), so nothing in the engine runtime graph is
* reached from the browser bundle.
*/
import { createElement } from "react";
/**
* Render a pre-rendered text Rendering verbatim in a monospace `<pre>`. The engine's bytes are the
* single child text node — React preserves the exact whitespace (`white-space: pre`), and the
* component computes NOTHING from them. Deterministic: identical props ⇒ identical markup.
*/
export function TerminalView(props) {
return createElement("pre", {
className: props.className ?? "kestrel-terminal",
"data-arm": props.arm,
style: { whiteSpace: "pre", fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace", margin: 0 },
}, props.text);
}