/** * Reading a `decision_answers` payload — THE ONE reader, shared by every * surface that shows a decision (matrx-frontend's answers card, review queue, * comparison table and text export; Workflow Studio's decision block). * * Contract: `common-docs/systems/agents/typed-messages/FEATURE.md` * ("Kind `decision_answers`"). The reader is DEFENSIVE by design — a * malformed answer is shown as unreadable, never coerced into a number that * a person would then act on. A probability is a claim about the world; a * silently-defaulted one is a lie with a bar chart next to it. * * Pure and framework-free: no React, no DOM, no host imports. */ declare const DECISION_ANSWERS_KIND: "decision_answers"; /** How the probability was obtained. Never inferred — always stated. */ type DecisionMethod = "native" | "verbalized" | "verbalized_calibrated"; interface DecisionAnswerView { name: string; type: "noul" | "choice" | "score" | "unknown"; /** The answer verbatim: boolean, option name, or score. */ answer: boolean | string | number | null; /** * Yes/No only — probability that the answer is TRUE, verbatim from the * payload. This is NOT the probability of the answer given: a `false` * answer at `probability: 0.29` is a 71% No. Use `answerProbability` for * the number that belongs beside the answer; this one is for the * distribution and the author's threshold, both of which are stated on the * true-probability scale. */ probability: number | null; /** * The full distribution, option/level → probability. For Yes/No this is * SYNTHESISED from `probability` (Yes p, No 1−p) so every type has one * distribution shape and no surface has to derive the complement itself. */ probabilities: Array<{ key: string; label: string; value: number; }>; /** * The distribution key the ANSWER points at: the option for a choice, the * MOST LIKELY level (the distribution's peak) for a score, `"true"`/`"false"` * for a Yes/No. `null` when the answer is unreadable or no distribution was * returned. A score's weighted number is shown as the number; its label and * percentage come from the peak, so the headline and the bold bar below it * are the same level (see `answerKeyFor`). */ answerKey: string | null; confidence: number | null; /** Score only — level number → what that level means. */ legend: Record; /** The author's suggested cut, when the surface knows it. */ suggestedThreshold: number | null; /** The question as asked, when the surface can supply it. */ instruction: string | null; } interface DecisionAnswersView { model: string | null; method: DecisionMethod | null; answers: DecisionAnswerView[]; /** Questions the holder refused, with the reason it gave. */ refusals: Array<{ name: string; reason: string; }>; inputTokens: number | null; outputTokens: number | null; costUsd: number | null; } /** `null` when the value is not a decision_answers payload at all. */ declare function readDecisionAnswers(value: unknown): DecisionAnswersView | null; /** How the answer reads on screen. Never invented — `null` stays unreadable. */ declare function formatDecisionAnswer(answer: DecisionAnswerView): string; /** * The answer in words, for a glance. A score reads as its peak level * ("4 · down for someone"), never "2.3 — down for someone", which put the * probability-weighted average and the peak level's name in one phrase. The * average stays available on the view (`answer.answer`) for surfaces that show * it as a secondary figure; the text export keeps `formatDecisionAnswer`. */ declare function formatAnswerHeadline(answer: DecisionAnswerView): string; /** * The one number that belongs beside the answer: the probability OF THE * ANSWER GIVEN, never the biggest number in the distribution and never the * raw `probability` field. * * Two ways this used to lie, both live: a `noul` answered `false` at * `probability: 0.3` printed "No 30%" when the model was 70% sure of No; and * a score's label and percentage came from different levels. For a score the * label is the peak level, so this is the peak's own probability — the label * and the number always describe the same level. */ declare function answerProbability(answer: DecisionAnswerView): number | null; /** P(true) for a Yes/No — the scale the author's threshold is stated on. */ declare function probabilityOfTrue(answer: DecisionAnswerView): number | null; declare const METHOD_LABELS: Record; declare const METHOD_EXPLANATIONS: Record; /** * A decision turn as READABLE TEXT — for every surface that shows a run's * result as a string instead of drawing the `DecisionAnswers` card: the toast * preview, agent apps (their `response` string, public `/p/` included), * a shortcut's `responseText` handed to its caller. A decision turn carries no * text at all, so every one of those surfaces used to show nothing — or wait * forever — over a paid, finished verdict. * * One line per answer, with the probability OF THE ANSWER GIVEN (never the raw * P(true) a `false` answer carries), then the refusals with their reasons. * `null` when the value is not a decision payload — never a guess. */ declare function decisionAnswersText(payload: unknown): string | null; export { DECISION_ANSWERS_KIND, METHOD_EXPLANATIONS, METHOD_LABELS, answerProbability, decisionAnswersText, formatAnswerHeadline, formatDecisionAnswer, probabilityOfTrue, readDecisionAnswers }; export type { DecisionAnswerView, DecisionAnswersView, DecisionMethod };