UNPKG

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.

30 lines (26 loc) 1.87 kB
/** * # kestrel.markets/react — the human Rendering adapter (ADR-0052 §3/§4) * * The React visualization layer for the Frame `json` Rendering, shipped as an OPTIONAL subpath export * of `kestrel.markets`. Two component families, both shells that DISPLAY engine output and invent no * value (`React hosts Renderings; it never produces them`): * * - {@link HonestChart} — human candlesticks over the typed Frame `json` Rendering: UNKNOWN → gap, * MODEL Fields badged with their receipt, degraded MODEL Fields refused (fail-closed). * - {@link TerminalView} — a monospace shell around a pre-rendered text Rendering (canonical or an * ARM), exact whitespace preserved. * * ## Isolation (a HARD requirement, ADR-0052 §3) * `react` is an OPTIONAL peer dependency — never a `dependency`. This subpath is its own `exports` * entry, so the CLI/agent entry never resolves it and the `npx` funnel installs/loads nothing new. * Every engine import in this tree is `import type` (erased at build): the browser bundle reaches * NOTHING in the engine runtime graph (no tokenizer, no sha256, no Bun/node built-in). The two * runtime constants that must agree with the engine — the UNKNOWN marker and the arm registry — are * pinned to the engine's TYPES at typecheck, so drift reds `bun run typecheck`, never a shipped bundle. */ export { HonestChart, type HonestChartProps } from "./honest-chart.ts"; export { TerminalView, type TerminalViewProps } from "./terminal-view.ts"; // The render-arm registry, mirrored for a host model-selector (values), plus the id type. export { ARM_IDS, TOKEN_OPTIMAL_ARM_IDS, type ArmId } from "./arms.ts"; // Honest reading helpers + the fail-closed error, for hosts that read the `json` Rendering directly. export { HonestChartError, UNKNOWN, isUnknown, type FieldReceipt } from "./frame-fields.ts";