import type { SandboxKitDocs } from './sandbox-kit.js'; /** * Why a UI tool call was refused (or warned about) — what telemetry counts. * * `shape`: the input does not fit the schema (a missing wrapper, a wrong type); `syntax`: the code * does not parse; `missing-app`: JSX without `App`; `bridge`: a bridge other than `agent.send`; * `unknown-component` / `unknown-prop`: not in the kit's docs; `unavailable`: the component is not * offered here; `other`: anything else (a thrown handler, the emit failing). */ export type GenuiErrorCategory = 'shape' | 'syntax' | 'missing-app' | 'bridge' | 'unknown-component' | 'unknown-prop' | 'unavailable' | 'other'; /** One problem with a sandbox's code, where it is. */ export interface SandboxCodeIssue { /** `error` refuses the call; `warning` is reported with the result. */ severity: 'error' | 'warning'; category: GenuiErrorCategory; field: 'jsx' | 'html' | 'jsFunctions' | 'jsExpressions'; /** The `jsExpressions` entry. */ index?: number; /** 1-based, in the field's own text. */ line?: number; /** 1-based. */ column?: number; /** What is wrong and the one-line fix. */ message: string; } export interface ValidateSandboxCodeOptions { /** The view may be JSX (a kit bundle draws it). Default: what `kit.jsx` says. */ jsx?: boolean; /** The kit's docs: ``s and their props are checked against them. */ kit?: SandboxKitDocs; /** Origins the policy opens for scripts (`