@action-state-group/capsule-viewer 0.0.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/LICENSE +201 -0
  2. package/LICENSE-BSD-3-Clause +28 -0
  3. package/README.md +94 -1
  4. package/dist/alias-interpreters.d.ts +18 -0
  5. package/dist/alias-interpreters.js +50 -0
  6. package/dist/alias-interpreters.js.map +1 -0
  7. package/dist/browser.d.ts +7 -0
  8. package/dist/browser.js +25 -0
  9. package/dist/browser.js.map +1 -0
  10. package/dist/builtin-manifests.d.ts +51 -0
  11. package/dist/builtin-manifests.js +196 -0
  12. package/dist/builtin-manifests.js.map +1 -0
  13. package/dist/compliance-presentation.d.ts +51 -0
  14. package/dist/compliance-presentation.js +140 -0
  15. package/dist/compliance-presentation.js.map +1 -0
  16. package/dist/compliance-styles.d.ts +1 -0
  17. package/dist/compliance-styles.js +104 -0
  18. package/dist/compliance-styles.js.map +1 -0
  19. package/dist/compliance-view.d.ts +46 -0
  20. package/dist/compliance-view.js +828 -0
  21. package/dist/compliance-view.js.map +1 -0
  22. package/dist/compliance.d.ts +121 -0
  23. package/dist/compliance.js +412 -0
  24. package/dist/compliance.js.map +1 -0
  25. package/dist/composed-styles.d.ts +12 -0
  26. package/dist/composed-styles.js +20 -0
  27. package/dist/composed-styles.js.map +1 -0
  28. package/dist/composed-view.d.ts +24 -0
  29. package/dist/composed-view.js +186 -0
  30. package/dist/composed-view.js.map +1 -0
  31. package/dist/contract-report-wording.d.ts +195 -0
  32. package/dist/contract-report-wording.js +1141 -0
  33. package/dist/contract-report-wording.js.map +1 -0
  34. package/dist/contract-report.d.ts +92 -0
  35. package/dist/contract-report.js +63 -0
  36. package/dist/contract-report.js.map +1 -0
  37. package/dist/emitter-shell.html +310 -0
  38. package/dist/emitter.d.ts +105 -0
  39. package/dist/emitter.js +329 -0
  40. package/dist/emitter.js.map +1 -0
  41. package/dist/evidence-graph-view.d.ts +149 -0
  42. package/dist/evidence-graph-view.js +2718 -0
  43. package/dist/evidence-graph-view.js.map +1 -0
  44. package/dist/evidence-graph.iife.js +18159 -0
  45. package/dist/frame-tokens.generated.d.ts +3 -0
  46. package/dist/frame-tokens.generated.js +5 -0
  47. package/dist/frame-tokens.generated.js.map +1 -0
  48. package/dist/index.d.ts +5 -0
  49. package/dist/index.js +12 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/outcome-report-presentation.d.ts +48 -0
  52. package/dist/outcome-report-presentation.js +90 -0
  53. package/dist/outcome-report-presentation.js.map +1 -0
  54. package/dist/outcome-report-styles.d.ts +1 -0
  55. package/dist/outcome-report-styles.js +228 -0
  56. package/dist/outcome-report-styles.js.map +1 -0
  57. package/dist/outcome-report-view.d.ts +78 -0
  58. package/dist/outcome-report-view.js +1488 -0
  59. package/dist/outcome-report-view.js.map +1 -0
  60. package/dist/presentation-builder.d.ts +296 -0
  61. package/dist/presentation-builder.js +646 -0
  62. package/dist/presentation-builder.js.map +1 -0
  63. package/dist/presentation-fragment.d.ts +129 -0
  64. package/dist/presentation-fragment.js +213 -0
  65. package/dist/presentation-fragment.js.map +1 -0
  66. package/dist/presentation-mount.d.ts +26 -0
  67. package/dist/presentation-mount.js +45 -0
  68. package/dist/presentation-mount.js.map +1 -0
  69. package/dist/presentation-registry.d.ts +277 -0
  70. package/dist/presentation-registry.js +416 -0
  71. package/dist/presentation-registry.js.map +1 -0
  72. package/dist/record-content.d.ts +68 -0
  73. package/dist/record-content.js +153 -0
  74. package/dist/record-content.js.map +1 -0
  75. package/dist/record-dating.d.ts +10 -0
  76. package/dist/record-dating.js +76 -0
  77. package/dist/record-dating.js.map +1 -0
  78. package/dist/report-front-styles.d.ts +9 -0
  79. package/dist/report-front-styles.js +55 -0
  80. package/dist/report-front-styles.js.map +1 -0
  81. package/dist/report-front.d.ts +78 -0
  82. package/dist/report-front.js +274 -0
  83. package/dist/report-front.js.map +1 -0
  84. package/dist/report-levels.d.ts +206 -0
  85. package/dist/report-levels.js +739 -0
  86. package/dist/report-levels.js.map +1 -0
  87. package/dist/report-provenance.d.ts +111 -0
  88. package/dist/report-provenance.js +535 -0
  89. package/dist/report-provenance.js.map +1 -0
  90. package/dist/viewer-build.d.ts +37 -0
  91. package/dist/viewer-build.js +29 -0
  92. package/dist/viewer-build.js.map +1 -0
  93. package/dist/wording/contract-report-eu-ai-act.en.json +295 -0
  94. package/dist/wording/contract-report-outcomes.en.json +394 -0
  95. package/package.json +48 -4
@@ -0,0 +1,274 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ /**
3
+ * The pieces of a contract report that every grouping shares, placed by the
4
+ * contract-report layout note (docs/design/contract-report-layout.md):
5
+ *
6
+ * - L0: the mock-judge mark in the header (decision D5 (b)) and the sealed aggregate,
7
+ * coverage first, then the buckets (contract-report/v1 section 2,
8
+ * evidence-result-v0 section 3).
9
+ * - Rows that open in place (expandableRow).
10
+ * - L2, after the core's verification section: "Check this report
11
+ * yourself", the bundle's anchors and the steps to re-check them.
12
+ * - The host's depth applied to the module's own toggles (presentation
13
+ * contract section 9.1). The core's section is never touched here.
14
+ */
15
+ import { utcDateOf, } from "@action-state-group/agent-action-capsule";
16
+ import { deferBody, openToggle } from "./report-levels.js";
17
+ import { judgedByMock, witnessEntries, } from "./report-provenance.js";
18
+ function el(tag, className, text) {
19
+ const node = document.createElement(tag);
20
+ if (className !== "")
21
+ node.className = className;
22
+ if (text !== undefined)
23
+ node.textContent = text;
24
+ return node;
25
+ }
26
+ const fmt = (n) => n.toLocaleString("en-US");
27
+ // The aggregate is drawn as sealed (contract-report/v1 section 2). Where
28
+ // the claims give another number (`countMismatches`), a marker beside the
29
+ // sealed one says what the claims give, so a disagreement reads as one and
30
+ // neither number is silently preferred (presentation contract section 3).
31
+ function mismatchMarker(result, field, w) {
32
+ const mismatch = result.countMismatches.find((entry) => entry.field === field);
33
+ if (mismatch === undefined)
34
+ return undefined;
35
+ const marker = el("span", "count mismatch", w.t("front.agg.mismatch", { recomputed: fmt(mismatch.recomputed) }));
36
+ marker.dataset.countMismatch = field;
37
+ marker.dataset.stated = String(mismatch.stated);
38
+ marker.dataset.recomputed = String(mismatch.recomputed);
39
+ return marker;
40
+ }
41
+ /**
42
+ * Decision D5 (b): one L0 mark, drawn only when the judge was a mock. It
43
+ * sits in the report's header right under the title (`placeMockMark`), so
44
+ * a reader meets it before any figure; the folded provenance line then
45
+ * leaves the judge out of its brief (report-provenance.ts).
46
+ */
47
+ export function renderMockJudgeLine(tally, w) {
48
+ if (!judgedByMock(tally))
49
+ return undefined;
50
+ const line = el("p", "mockmark", w.t("front.mock"));
51
+ line.dataset.section = "mock-judge";
52
+ return line;
53
+ }
54
+ /** Put the mock-judge mark right under the header's title; a header without one takes it first. */
55
+ export function placeMockMark(header, mark) {
56
+ if (mark === undefined)
57
+ return;
58
+ const title = header.querySelector("h1");
59
+ if (title === null)
60
+ header.prepend(mark);
61
+ else
62
+ title.after(mark);
63
+ }
64
+ /**
65
+ * The folded provenance line opens L1: it becomes the first row of the
66
+ * section card that holds the report's rows, ruled off from them. Without
67
+ * that section it keeps a card of its own.
68
+ */
69
+ export function leadWithProvenance(host, section, provenance) {
70
+ const row = el("div", "prov-row");
71
+ row.append(provenance);
72
+ if (section === null)
73
+ host.prepend(frontCard(row));
74
+ else
75
+ section.prepend(row);
76
+ }
77
+ /**
78
+ * The Result's sealed aggregate, coverage first and then the buckets, each
79
+ * count with its unit (evaluations); `unknown_count` is "evaluations with
80
+ * an unknown result", never "unresolved". The numbers are the producer's
81
+ * (`statedCoverage`, the `buckets` lists), with a marker wherever the
82
+ * claims give another. When a claim is dated, or the out-of-scope switch
83
+ * is on, a line says the date "in force" is relative to and that these are
84
+ * the producer's copy of the contract (ER sections 4.2 and 4.3).
85
+ */
86
+ export function renderAggregate(result, w) {
87
+ const section = el("section", "agg");
88
+ section.dataset.section = "aggregate";
89
+ const stated = result.statedCoverage;
90
+ const requirements = new Set(result.claims
91
+ .filter((claim) => !claim.later)
92
+ .map((claim) => JSON.stringify([claim.contractRef, claim.requirementRef]))).size;
93
+ const line = el("p", "agg-line");
94
+ const marked = (text, field) => {
95
+ line.append(text);
96
+ const marker = mismatchMarker(result, field, w);
97
+ if (marker !== undefined)
98
+ line.append(" ", marker);
99
+ };
100
+ marked(w.t("front.agg.evaluated", {
101
+ evaluations: w.p("front.agg.evaluations", stated.evaluatedPopulation, {
102
+ n: fmt(stated.evaluatedPopulation),
103
+ }),
104
+ requirements: w.p("front.agg.requirements", requirements, {
105
+ n: fmt(requirements),
106
+ }),
107
+ }), "evaluated_population");
108
+ line.append(" · ", w.t("front.agg.excluded", {
109
+ excluded: fmt(stated.excludedNotApplicable),
110
+ }), " · ");
111
+ marked(w.p("front.agg.unknown", stated.unknownCount, {
112
+ n: fmt(stated.unknownCount),
113
+ }), "unknown_count");
114
+ const later = stated.notYetInForce;
115
+ if (later !== undefined ||
116
+ result.countMismatches.some((m) => m.field === "not_yet_in_force")) {
117
+ line.append(" · ");
118
+ marked(w.p("front.agg.later", later ?? 0, { n: fmt(later ?? 0) }), "not_yet_in_force");
119
+ line.dataset.notYetInForce = String(later ?? 0);
120
+ }
121
+ line.dataset.evaluated = String(stated.evaluatedPopulation);
122
+ line.dataset.requirements = String(requirements);
123
+ line.dataset.excluded = String(stated.excludedNotApplicable);
124
+ line.dataset.unknown = String(stated.unknownCount);
125
+ section.append(line);
126
+ const buckets = el("div", "agg-buckets");
127
+ const entries = [
128
+ ["met", result.buckets.met, "buckets.met"],
129
+ ["not_met", result.buckets.notMet, "buckets.not_met"],
130
+ ["not_evaluable", result.buckets.notEvaluable, "buckets.not_evaluable"],
131
+ ["out_of_scope", result.buckets.outOfScope, "buckets.out_of_scope"],
132
+ ];
133
+ for (const [verdict, ids, field] of entries) {
134
+ if (ids === undefined)
135
+ continue;
136
+ const box = el("div", `agg-bucket ${verdict}`);
137
+ box.dataset.bucket = verdict;
138
+ box.dataset.count = String(ids.length);
139
+ box.append(el("b", "", fmt(ids.length)));
140
+ box.append(el("span", "", w.t(`front.agg.bucket.${verdict}`)));
141
+ const marker = mismatchMarker(result, field, w);
142
+ if (marker !== undefined)
143
+ box.append(marker);
144
+ buckets.append(box);
145
+ }
146
+ section.append(buckets);
147
+ const dated = result.claims.some((claim) => claim.appliesFrom !== undefined);
148
+ const switched = result.buckets.outOfScope !== undefined;
149
+ if (dated || switched) {
150
+ const copied = el("p", "agg-note");
151
+ if (dated) {
152
+ // A dated Result passed validation, so generated_at parses.
153
+ const date = utcDateOf(result.generatedAt) ?? result.generatedAt;
154
+ copied.append(w.t("front.agg.as-of", { date }), " ");
155
+ copied.dataset.asOf = date;
156
+ }
157
+ copied.append(w.t(dated && switched
158
+ ? "front.agg.copied.both"
159
+ : dated
160
+ ? "front.agg.copied.dates"
161
+ : "front.agg.copied.switch"));
162
+ copied.dataset.copiedFacts = "contract";
163
+ section.append(copied);
164
+ }
165
+ return section;
166
+ }
167
+ function bundleObject(bundle) {
168
+ return typeof bundle === "object" && bundle !== null && !Array.isArray(bundle)
169
+ ? bundle
170
+ : {};
171
+ }
172
+ /**
173
+ * "Check this report yourself": the bundle's own anchors (producer key,
174
+ * log, checkpoint root and size, record count) and the steps to re-check
175
+ * them. Module detail: it goes in L2 after the core's verification section,
176
+ * never in its place. The comparison step is drawn as a comparison only
177
+ * when the bundle carries a witness receipt; otherwise it says only that
178
+ * the bundle carries none, never that no outside checkpoint exists.
179
+ */
180
+ export function renderCheckYourself(bundle, w) {
181
+ const b = bundleObject(bundle);
182
+ const section = el("section", "check front-card");
183
+ section.dataset.section = "check-yourself";
184
+ section.append(el("h2", "", w.t("front.check.h")));
185
+ const anchors = el("div", "anchors");
186
+ const cell = (label, value, key) => {
187
+ const box = el("div", "anchor");
188
+ box.dataset.anchor = key;
189
+ box.append(el("span", "k", label), el("code", "", value));
190
+ anchors.append(box);
191
+ };
192
+ const extensions = bundleObject(b.extensions);
193
+ const producerKey = bundleObject(extensions["producer-key/v1"]).public_key;
194
+ if (typeof producerKey === "string")
195
+ cell(w.t("front.check.key"), producerKey, "producer-key");
196
+ const checkpoint = bundleObject(b.checkpoint);
197
+ if (typeof checkpoint.log_id === "string")
198
+ cell(w.t("front.check.log"), checkpoint.log_id, "log");
199
+ if (typeof checkpoint.root === "string" &&
200
+ typeof checkpoint.mmr_size === "number")
201
+ cell(w.t("front.check.root"), `${checkpoint.root} · ${fmt(checkpoint.mmr_size)}`, "checkpoint");
202
+ if (Array.isArray(b.records))
203
+ cell(w.t("front.check.records"), fmt(b.records.length), "records");
204
+ section.append(anchors);
205
+ const receipts = witnessEntries(b.checkpoint).filter((entry) => !entry.stub && !entry.malformed);
206
+ const steps = el("ol", "steps");
207
+ steps.append(el("li", "", w.t("front.check.s1")), el("li", "", w.t("front.check.s2")));
208
+ const compare = el("li", "", w.t(receipts.length > 0 ? "front.check.s3.receipt" : "front.check.s3.none"));
209
+ compare.dataset.receipt = receipts.length > 0 ? "present" : "absent";
210
+ steps.append(compare, el("li", "", w.t("front.check.s4")));
211
+ section.append(steps);
212
+ return section;
213
+ }
214
+ /**
215
+ * A table row that opens its full-width detail row, with no script needed:
216
+ * the row's name (the rule, test or obligation it opens) becomes the
217
+ * summary of a level-1 disclosure in its first cell, and the stylesheet
218
+ * shows the detail row while that disclosure is open. The row stays a
219
+ * table row and the disclosure takes its name from the row's own words.
220
+ * The detail's body is built when it first opens (or at once with
221
+ * `eager`); a click anywhere on the row opens it too. `key` names the
222
+ * detail row's id from what the row is, so every packaging of one bundle
223
+ * draws the same ids.
224
+ */
225
+ export function expandableRow(row, name, detail, build, key, eager = false) {
226
+ row.classList.add("x");
227
+ detail.classList.add("x-detail");
228
+ detail.id = `cr-x-${key.replace(/[^A-Za-z0-9_.-]/gu, "_")}`;
229
+ const cell = detail.firstElementChild;
230
+ const toggle = document.createElement("details");
231
+ toggle.className = "lv lv1 rx";
232
+ toggle.dataset.level = "1";
233
+ const summary = document.createElement("summary");
234
+ summary.setAttribute("aria-controls", detail.id);
235
+ name.replaceWith(toggle);
236
+ summary.append(name);
237
+ toggle.append(summary);
238
+ deferBody(toggle, build, eager, cell);
239
+ // The summary's own click toggles natively; anywhere else on the row
240
+ // does the same.
241
+ row.addEventListener("click", (event) => {
242
+ if (event.target.closest("summary") !== null)
243
+ return;
244
+ if (toggle.open)
245
+ toggle.open = false;
246
+ else
247
+ openToggle(toggle);
248
+ });
249
+ return toggle;
250
+ }
251
+ /** A front card: the frame's centred white card, for blocks outside the sheet. */
252
+ export function frontCard(...children) {
253
+ const card = el("div", "front-card");
254
+ card.append(...children);
255
+ return card;
256
+ }
257
+ /**
258
+ * Open the module's own toggles to the host's depth (presentation contract
259
+ * section 9.1): at L0 none; at L1 the toggles in the L1 region; at L2 every
260
+ * toggle in every region, including the ones a toggle builds when it opens
261
+ * (see `openBuiltToDepth`). The core's section is the core's.
262
+ */
263
+ export function applyDepth(levels) {
264
+ if (levels.depth === "L0")
265
+ return;
266
+ const regions = levels.depth === "L1" ? [levels.L1] : [levels.L0, levels.L1, levels.L2];
267
+ for (const region of regions) {
268
+ if (levels.depth === "L2")
269
+ region.dataset.openAll = "";
270
+ for (const toggle of region.querySelectorAll("details.lv"))
271
+ openToggle(toggle);
272
+ }
273
+ }
274
+ //# sourceMappingURL=report-front.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-front.js","sourceRoot":"","sources":["../src/report-front.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;GAYG;AACH,OAAO,EACL,SAAS,GAGV,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,YAAY,EACZ,cAAc,GAEf,MAAM,wBAAwB,CAAC;AAUhC,SAAS,EAAE,CAAC,GAAW,EAAE,SAAiB,EAAE,IAAa;IACvD,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,SAAS,KAAK,EAAE;QAAE,IAAI,CA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QAAuB;IAClD,MAAM,IAAI,GAAG,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IACrC,IAAI,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC;IACzB,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,MAAoB;IAC7C,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI;QAAE,OAAO;IAClC,MAAM,OAAO,GACX,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;IAC1E,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI;YAAE,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;QACvD,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,gBAAgB,CAC1C,YAAY,CACb;YACC,UAAU,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
@@ -0,0 +1,206 @@
1
+ import { type ConversationTranscript, type ReportState, type ResultClaim } from "@action-state-group/agent-action-capsule";
2
+ import type { Words } from "./contract-report-wording.js";
3
+ /**
4
+ * A level-1 or level-2 toggle. `summary` is what the closed toggle says;
5
+ * `build` makes the body on first open (or at once with `eager`).
6
+ */
7
+ export declare function levelToggle(level: 1 | 2, summary: string | HTMLElement, build: () => Node, options?: {
8
+ className?: string;
9
+ eager?: boolean;
10
+ }): HTMLDetailsElement;
11
+ /**
12
+ * A <details> whose body is built the first time it opens, or at once with
13
+ * `eager`, into the toggle itself or into `into` (a table row's detail cell). Until then it is marked `data-body="pending"`, and
14
+ * `fillPendingBodies` can build it without opening it.
15
+ */
16
+ export declare function deferBody(details: HTMLDetailsElement, build: () => Node, eager?: boolean, into?: HTMLElement): void;
17
+ /**
18
+ * Builds every body under `root` that `selector` names and is still
19
+ * pending -- toggle bodies and conversation bodies alike, and the ones those
20
+ * bodies bring -- leaving every toggle open or closed as it was. The static
21
+ * package builds every body this way (`fillForNoScript`), so a toggle a
22
+ * reader opens on a page that runs no script is not empty. Returns how
23
+ * many bodies it built.
24
+ */
25
+ export declare function fillPendingBodies(root: ParentNode, selector?: string): number;
26
+ /**
27
+ * For a page that runs no script (the static package,
28
+ * presentation-builder.ts): builds every body still pending under `root`,
29
+ * and the ones those bodies bring, so opening any toggle shows what it
30
+ * shows where script runs (capsule-viewer#67). Each conversation is kept
31
+ * once, in the core's records section: a card's conversation becomes a
32
+ * link to it (`linkConversations`), including the conversations a body
33
+ * brings when it is built. Every toggle stays open or closed as it was,
34
+ * except where the host opened a region to L2, as on the scripted page.
35
+ * Returns how many bodies it built; a body with no fill registered here
36
+ * stays pending, for the caller to report.
37
+ */
38
+ export declare function fillForNoScript(root: ParentNode): number;
39
+ /**
40
+ * The one nesting rule for every report page (SEAMS ruling 11): a level-2
41
+ * toggle may sit inside a level-1 toggle, and nothing deeper. Returns every
42
+ * breach in `root`, by the summary text of the offending toggle: a toggle
43
+ * inside two others, a level-1 toggle inside another toggle, or a level-2
44
+ * toggle inside anything but a level-1 toggle (another level 2, say).
45
+ * Empty when the page keeps the rule. Run it over a page with every toggle
46
+ * opened, so lazily built bodies are counted.
47
+ */
48
+ export declare function nestingProblems(root: ParentNode): string[];
49
+ /**
50
+ * At depth L2 everything is open (presentation contract section 9.1),
51
+ * including the toggles a body holds when it is built after the page was
52
+ * drawn: inside a region the host opened to L2 (`data-open-all`), a newly
53
+ * built body's toggles open too.
54
+ */
55
+ export declare function openBuiltToDepth(body: HTMLElement): void;
56
+ /** Opens a toggle and builds its body now (tests, print). */
57
+ export declare function openToggle(details: HTMLDetailsElement): void;
58
+ /**
59
+ * A conversation's body inside an open level-1 toggle, in place (never a
60
+ * toggle). Built when it comes within a screen or so of the view; where the
61
+ * browser has no IntersectionObserver it is built at once. `beforeprint`
62
+ * builds every pending body so a printed page is whole.
63
+ */
64
+ export declare function lazyBody(host: HTMLElement, build: () => Node): void;
65
+ /**
66
+ * Result words never come from the bundle: presentation contract section 6
67
+ * forbids a bundle-carried setting from choosing wording. They come from the
68
+ * card's wording pack (contract-report-wording.ts), which ships with the
69
+ * viewer. The default packs speak the plain set (met, not met, did not
70
+ * apply, could not decide); a pack may speak the grade ladder (established,
71
+ * failed, not present, inconclusive, not checked) instead, and so tell the
72
+ * three undecided cases apart.
73
+ */
74
+ export type RuleVerdict = "met" | "not_met" | "not_evaluable" | "failed" | "unsupported" | "not_applicable" | "out_of_scope" | "not_yet_in_force";
75
+ export type Tone = "ok" | "bad" | "na" | "ne";
76
+ export interface Worded {
77
+ readonly word: string;
78
+ readonly tone: Tone;
79
+ }
80
+ /**
81
+ * Whether a judge ran on one rule, as far as the bundle shows: `yes` when
82
+ * its disclosed report states a judge pin, `no` when the disclosed report
83
+ * states none, `withheld` when the bundle withholds the report, `unknown`
84
+ * when the report is supplied but does not match what was sealed, cannot be
85
+ * read or does not check out, or is not carried at all. In every case but
86
+ * `yes` and `no` the bundle cannot say.
87
+ */
88
+ export type Judged = "yes" | "no" | "withheld" | "unknown";
89
+ export declare function judgedOf(reportState: ReportState | undefined, judgePinDigest: string | undefined): Judged;
90
+ /**
91
+ * One rule's result in words, from the card's own grouping prefix
92
+ * (`lines.verdict.*` or `groups.verdict.*`: the bare `verdict.*` namespace
93
+ * stays contract-report/v1 §3's). `judged` picks among the pack's four
94
+ * words for a rule nobody could decide: a judge ran and could not decide
95
+ * (`.not_evaluable.judged`), none ran (`.unjudged`), the bundle
96
+ * withholds the report that would say which (`.withheld`), or a judge's
97
+ * report is cited but this bundle does not carry a readable copy of it --
98
+ * mismatched, unreadable, invalid, or simply not carried (`.unavailable`),
99
+ * never `.withheld`, which would claim more than those states show. A
100
+ * failed or unsupported claim failed verification, or its evidence is
101
+ * missing; it is never "not checked".
102
+ */
103
+ export declare function ruleWord(verdict: RuleVerdict, judged: Judged, w: Words): Worded;
104
+ /**
105
+ * The judge's note in plain words. A sealed rationale that is the judge
106
+ * backend's own synthesized line ("jev choice: not_met (probabilities={...},
107
+ * confidence=...)") reads "The judge was 78% sure." (`judge.note.sure`); any
108
+ * other rationale (a recomputed check's own explanation) is shown as sealed.
109
+ * Display only: the proofs always carry the rationale exactly as sealed.
110
+ */
111
+ export declare function judgeNote(rationale: string, verdict: string, w: Words): string;
112
+ export declare function wordPill(worded: Worded, key: string): HTMLElement;
113
+ /**
114
+ * `tau2:airline:<model>:task-20:trial-1` reads "task 20, trial 1" with the
115
+ * model beside it; the older `tau2:airline:task-20:trial-0` reads "task 20,
116
+ * trial 0"; any other id is shown whole.
117
+ */
118
+ export declare function caseParts(conversationId: string, w: Words): {
119
+ label: string;
120
+ model?: string;
121
+ };
122
+ /**
123
+ * A sealed tool result, shown verbatim. It is indented for
124
+ * reading only when doing so changes nothing but whitespace: JSON.parse then
125
+ * JSON.stringify must give back exactly the original once whitespace outside
126
+ * strings is set aside. A number JSON cannot hold exactly
127
+ * (`{"id":12345678901234567890}`), a duplicate key, an escape written
128
+ * differently: any of these, and the original text is shown as it is.
129
+ */
130
+ export declare function exactText(text: string): {
131
+ text: string;
132
+ indented: boolean;
133
+ };
134
+ /**
135
+ * The conversation as a chat: who said what, and each tool the agent called
136
+ * with its arguments. The words come from the transcript the caller has
137
+ * already tied to the judged case by digest (`verified`), or to the case
138
+ * every claim cites when the reports are withheld (`cited`, said as such);
139
+ * nothing is reworded. Returns the "not in this bundle" note otherwise.
140
+ */
141
+ export declare function renderChat(transcript: ConversationTranscript, caseRecord: string | undefined, w: Words): HTMLElement;
142
+ /**
143
+ * The turns of a conversation as a chat, and nothing else: who said what,
144
+ * each tool call with its arguments, each tool result as sealed. It states
145
+ * nothing about where the turns came from or what was checked; its caller
146
+ * does (renderChat for a card, the core's record entry for a record).
147
+ */
148
+ export declare function renderTurns(turns: NonNullable<ConversationTranscript["turns"]>, w: Words): HTMLElement;
149
+ /** The address of a record in the core's records section (evidence-graph-view.ts). */
150
+ export declare function recordAddress(recordId: string): string;
151
+ /**
152
+ * A conversation in place in its card: a level-2 toggle whose body is the
153
+ * chat, built when it opens, with a close control and a link to the record
154
+ * in the core's records section above and below it. The in-place copy
155
+ * carries no address; only the records section's entry does.
156
+ *
157
+ * Beside the toggle sits the same link worded for a page that runs no
158
+ * script, hidden: the static package (presentation-builder.ts) keeps one
159
+ * copy of each conversation, in the records section, and swaps the toggle
160
+ * for that link when the record is there (`linkConversations`).
161
+ */
162
+ export declare function conversationFold(transcript: ConversationTranscript, caseRecord: string | undefined, w: Words): HTMLElement;
163
+ /**
164
+ * Opens a record's entry in the core's records section, and every toggle
165
+ * around it, so the link's target is in view when the browser scrolls to
166
+ * it. A browser that opens a closed <details> for a fragment does the same
167
+ * on a page that runs no script.
168
+ */
169
+ export declare function revealRecord(from: Node, recordId: string): void;
170
+ /**
171
+ * Where script runs: a page opened at a record's address (`#record-<id>`),
172
+ * or whose address changes to one, opens that record's entry and every
173
+ * fold around it, as a link to it does (`revealRecord`). One listener per
174
+ * document.
175
+ */
176
+ export declare function revealRecordsByHash(doc: Document): void;
177
+ /**
178
+ * For a page that runs no script: every in-place conversation whose record
179
+ * the core's records section holds becomes a link to it, so the page keeps
180
+ * one copy of each conversation however many cards cite it, built or not.
181
+ * A conversation whose record is not there (none is stated, or its
182
+ * transcript is absent or does not check) keeps its toggle and its state
183
+ * note. Returns how many it linked.
184
+ */
185
+ export declare function linkConversations(root: ParentNode): number;
186
+ /**
187
+ * The pack's `report.summary` line under the card's title, or nothing: the
188
+ * module has no summary of its own, so a pack that sets none shows none.
189
+ */
190
+ export declare function reportSummary(w: Words): HTMLElement | undefined;
191
+ /**
192
+ * One claim's assurance, as sealed on it (contract-report/v1 section 2:
193
+ * assurance stays on the claim): its tier, grade, sufficiency and carrier
194
+ * status, each in the layered section 3 word, or its raw value when no layer
195
+ * has one. The raw values ride on the element as data.
196
+ */
197
+ export declare function assuranceRow(claim: ResultClaim, w: Words): [string, string, Record<string, string>];
198
+ /**
199
+ * A wording layer the host supplied was refused (contract-report/v1 section
200
+ * 3): one line at the top of the card, so a reader never takes the default
201
+ * words for the ones the page was built to show.
202
+ */
203
+ export declare function refusedWordingNotice(w: Words): HTMLElement | undefined;
204
+ export declare function proofList(rows: readonly (readonly [string, string] | readonly [string, string, Readonly<Record<string, string>>])[]): HTMLElement;
205
+ /** The toggles', chat's and proofs' styles, scoped under the card's class. */
206
+ export declare function levelCss(scope: string): string;