@action-state-group/capsule-viewer 0.12.0 → 0.14.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 (44) hide show
  1. package/README.md +6 -0
  2. package/dist/browser.d.ts +1 -0
  3. package/dist/browser.js +3 -0
  4. package/dist/browser.js.map +1 -1
  5. package/dist/compliance-view.d.ts +6 -0
  6. package/dist/compliance-view.js +21 -3
  7. package/dist/compliance-view.js.map +1 -1
  8. package/dist/contract-report-wording.d.ts +6 -2
  9. package/dist/contract-report-wording.js +57 -6
  10. package/dist/contract-report-wording.js.map +1 -1
  11. package/dist/contract-report.d.ts +3 -2
  12. package/dist/contract-report.js +5 -2
  13. package/dist/contract-report.js.map +1 -1
  14. package/dist/core-strip.d.ts +1 -1
  15. package/dist/core-strip.js +80 -25
  16. package/dist/core-strip.js.map +1 -1
  17. package/dist/evidence-graph-view.d.ts +2 -2
  18. package/dist/evidence-graph-view.js +16 -10
  19. package/dist/evidence-graph-view.js.map +1 -1
  20. package/dist/evidence-graph.iife.js +3576 -560
  21. package/dist/generic-report-view.d.ts +36 -0
  22. package/dist/generic-report-view.js +304 -0
  23. package/dist/generic-report-view.js.map +1 -0
  24. package/dist/history-view.d.ts +290 -0
  25. package/dist/history-view.iife.js +1278 -0
  26. package/dist/history-view.iife.js.sha256 +1 -0
  27. package/dist/history-view.js +940 -0
  28. package/dist/history-view.js.map +1 -0
  29. package/dist/index.d.ts +1 -0
  30. package/dist/index.js +1 -0
  31. package/dist/index.js.map +1 -1
  32. package/dist/outcome-report-view.js +41 -5
  33. package/dist/outcome-report-view.js.map +1 -1
  34. package/dist/report-front-styles.js +1 -0
  35. package/dist/report-front-styles.js.map +1 -1
  36. package/dist/report-levels.d.ts +37 -4
  37. package/dist/report-levels.js +127 -8
  38. package/dist/report-levels.js.map +1 -1
  39. package/dist/viewer-build.js +2 -2
  40. package/dist/wording/contract-report-eu-ai-act.en.json +4 -0
  41. package/dist/wording/contract-report-generic.en.json +460 -0
  42. package/dist/wording/contract-report-outcomes.en.json +6 -0
  43. package/dist/wording/history-view.en.json +147 -0
  44. package/package.json +6 -2
@@ -0,0 +1,36 @@
1
+ import type { BundleVerificationResult, ResultRoot } from "@action-state-group/agent-action-capsule";
2
+ import type { Words } from "./contract-report-wording.js";
3
+ import { type TierOf } from "./evidence-contract.js";
4
+ /**
5
+ * The `generic` grouping of the contract-report module (contract-report.ts):
6
+ * the view of a Result that opts into `contract-report/v1` and carries
7
+ * neither Outcomes `lines` nor EU `groups` data (contract-report/v1 module
8
+ * spec section 2). It reads the Result alone: a row is one (`contract_ref`,
9
+ * `requirement_ref`) pair with its claims, its group is the part of the
10
+ * `requirement_ref` before the first `.`, and every tally shows its
11
+ * denominator ("2 of 5 claims"), never a percentage. A requirement tier
12
+ * (from the page's contract), a claim not yet in force, and a claim that
13
+ * failed verification keep the places the spec gives them.
14
+ *
15
+ * Every word is the pack's (`generic.*` and the section 3 keys, layered over
16
+ * `wording/contract-report-generic.en.json`); a name no layer has is the raw
17
+ * identifier. Page layout: L0 the title, summary and counts after the core's
18
+ * strip; L1 the rows (a group is a heading, a row is a level-1 toggle);
19
+ * L2 each claim's assurance and "Check this report yourself".
20
+ */
21
+ /** The `generic` grouping's page wrapper: its element, class, page name and stylesheet. */
22
+ export declare const GENERIC_FRAME: {
23
+ readonly tag: "div";
24
+ readonly className: "gr";
25
+ readonly page: "contract-report";
26
+ readonly css: string;
27
+ };
28
+ /**
29
+ * Draw the `generic` grouping into the three region wrappers
30
+ * (contract-report.ts made them and put the stylesheet in L0).
31
+ */
32
+ export declare function drawGeneric(levels: {
33
+ readonly L0: HTMLElement;
34
+ readonly L1: HTMLElement;
35
+ readonly L2: HTMLElement;
36
+ }, result: ResultRoot, bundle: unknown, verified: BundleVerificationResult, w: Words, tierOf?: TierOf): Promise<void>;
@@ -0,0 +1,304 @@
1
+ import { COMPLIANCE_FRAME_VARS } from "./frame-tokens.generated.js";
2
+ import { ROW_TIERS } from "./evidence-contract.js";
3
+ import { leadWithProvenance, renderCheckYourself } from "./report-front.js";
4
+ import { frontCss } from "./report-front-styles.js";
5
+ import { assuranceRow, levelCss, levelToggle, proofList, reportSummary, withheldMark, wordPill, } from "./report-levels.js";
6
+ import { tagSource } from "./report-legend.js";
7
+ import { provenanceLines, renderProvenance } from "./report-provenance.js";
8
+ /**
9
+ * The `generic` grouping of the contract-report module (contract-report.ts):
10
+ * the view of a Result that opts into `contract-report/v1` and carries
11
+ * neither Outcomes `lines` nor EU `groups` data (contract-report/v1 module
12
+ * spec section 2). It reads the Result alone: a row is one (`contract_ref`,
13
+ * `requirement_ref`) pair with its claims, its group is the part of the
14
+ * `requirement_ref` before the first `.`, and every tally shows its
15
+ * denominator ("2 of 5 claims"), never a percentage. A requirement tier
16
+ * (from the page's contract), a claim not yet in force, and a claim that
17
+ * failed verification keep the places the spec gives them.
18
+ *
19
+ * Every word is the pack's (`generic.*` and the section 3 keys, layered over
20
+ * `wording/contract-report-generic.en.json`); a name no layer has is the raw
21
+ * identifier. Page layout: L0 the title, summary and counts after the core's
22
+ * strip; L1 the rows (a group is a heading, a row is a level-1 toggle);
23
+ * L2 each claim's assurance and "Check this report yourself".
24
+ */
25
+ /** The `generic` grouping's page wrapper: its element, class, page name and stylesheet. */
26
+ export const GENERIC_FRAME = {
27
+ tag: "div",
28
+ className: "gr",
29
+ page: "contract-report",
30
+ css: `
31
+ .gr{${COMPLIANCE_FRAME_VARS}
32
+ font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Helvetica,Arial,sans-serif;color:var(--ink);background:#fff;display:block;max-width:1080px;margin:26px auto;padding:0 28px}
33
+ .gr *{box-sizing:border-box}
34
+ .gr h1,.gr h2,.gr h3{font-family:Georgia,"Iowan Old Style",Cambria,serif;color:var(--navy);margin:0}
35
+ .gr h1{font-size:28px;margin:6px 0 4px}
36
+ .gr h2{font-size:21px;margin:0 0 6px}
37
+ .gr h3{font-size:17px;margin:18px 0 6px}
38
+ .gr .rsum,.gr .counts{color:var(--slate);margin:0 0 8px}
39
+ .gr .rnote{font-size:12.5px;color:var(--slate);margin:2px 0 8px}
40
+ .gr .tally{display:flex;flex-wrap:wrap;gap:6px 12px;font-size:13px;margin:4px 0}
41
+ .gr .rname{font-weight:600;color:var(--navy)}
42
+ .gr .rname code,.gr .cid{font-family:ui-monospace,Menlo,monospace;font-size:12.5px;word-break:break-all}
43
+ .gr ul.claims{list-style:none;margin:6px 0 0;padding:0}
44
+ .gr .tier-note{font-size:12.5px;color:var(--slate)}
45
+ ` +
46
+ levelCss("gr") +
47
+ frontCss(".gr"),
48
+ };
49
+ const VERDICT_TONE = {
50
+ met: "ok",
51
+ not_met: "bad",
52
+ not_evaluable: "ne",
53
+ out_of_scope: "na",
54
+ failed: "bad",
55
+ unsupported: "ne",
56
+ };
57
+ /** What the claim shows as its verdict: failed verification and unsupported claims are not the producer's stated verdict (ER section 4). */
58
+ function shownVerdict(claim) {
59
+ if (claim.failed)
60
+ return "failed";
61
+ return claim.support === "supported" ? claim.verdict : "unsupported";
62
+ }
63
+ function el(tag, className, text) {
64
+ const node = document.createElement(tag);
65
+ if (className !== "")
66
+ node.className = className;
67
+ if (text !== undefined)
68
+ node.textContent = text;
69
+ return node;
70
+ }
71
+ /** The rows of `claims`, keyed by (contract_ref, requirement_ref), in order of first claim. */
72
+ function rowsOf(claims) {
73
+ const rows = new Map();
74
+ for (const claim of claims) {
75
+ const key = JSON.stringify([claim.contractRef, claim.requirementRef]);
76
+ const row = rows.get(key);
77
+ if (row === undefined)
78
+ rows.set(key, {
79
+ contractRef: claim.contractRef,
80
+ requirementRef: claim.requirementRef,
81
+ claims: [claim],
82
+ });
83
+ else
84
+ row.claims.push(claim);
85
+ }
86
+ return [...rows.values()];
87
+ }
88
+ /** The group a row sits in: the part of its `requirement_ref` before the first `.`, or none. */
89
+ function groupOf(requirementRef) {
90
+ const dot = requirementRef.indexOf(".");
91
+ return dot <= 0 ? undefined : requirementRef.slice(0, dot);
92
+ }
93
+ function verdictPill(verdict, w) {
94
+ const word = w.enumWord("verdict", verdict);
95
+ // `failed` and `unsupported` are this grouping's own verdicts (section 3
96
+ // defines four), so they read through the grouping's key.
97
+ const shown = verdict === "failed" || verdict === "unsupported"
98
+ ? w.t(`generic.verdict.${verdict}`)
99
+ : word;
100
+ const pill = wordPill({ word: shown, tone: VERDICT_TONE[verdict] ?? "na" }, verdict);
101
+ pill.dataset.verdict = verdict;
102
+ return pill;
103
+ }
104
+ /** The row's tally: its claims counted by shown verdict, each with its denominator. */
105
+ function tally(row, w, later) {
106
+ const counts = new Map();
107
+ for (const claim of row.claims) {
108
+ const verdict = shownVerdict(claim);
109
+ counts.set(verdict, (counts.get(verdict) ?? 0) + 1);
110
+ }
111
+ const box = el("div", "tally");
112
+ for (const [verdict, n] of counts) {
113
+ const part = el("span", "");
114
+ part.dataset.tally = verdict;
115
+ // A later claim's verdict is readiness only (ER section 4.3): its
116
+ // tally says so, so a later not_met never reads as a violation.
117
+ if (later)
118
+ part.append(w.t("generic.later.readiness"), " ");
119
+ part.append(verdictPill(verdict, w), " ");
120
+ part.append(w.t("generic.tally", {
121
+ n: n.toLocaleString(),
122
+ total: row.claims.length.toLocaleString(),
123
+ }));
124
+ box.append(part);
125
+ }
126
+ return box;
127
+ }
128
+ function claimProofs(claim, w) {
129
+ const body = el("div", "pf-b");
130
+ const rows = [
131
+ [w.t("generic.claim.contract"), claim.contractRef],
132
+ [w.t("generic.claim.requirement"), claim.requirementRef],
133
+ assuranceRow(claim, w),
134
+ ];
135
+ if (claim.type !== "requirement")
136
+ rows.push([
137
+ w.t("generic.claim.type"),
138
+ claim.recognized
139
+ ? claim.type
140
+ : w.t("generic.claim.unrecognized", { type: claim.type }),
141
+ ]);
142
+ if (claim.failed && claim.failure !== undefined)
143
+ rows.push([w.t("generic.claim.failure"), claim.failure]);
144
+ body.append(proofList(rows));
145
+ const mark = withheldMark(claim, w);
146
+ if (mark !== undefined)
147
+ body.append(mark);
148
+ return body;
149
+ }
150
+ function claimItem(claim, w) {
151
+ const item = el("li", "");
152
+ item.dataset.claimRef = claim.id;
153
+ const head = el("span", "");
154
+ const id = tagSource(el("code", "cid", claim.id), "producer");
155
+ head.append(id, " ", verdictPill(shownVerdict(claim), w));
156
+ item.append(levelToggle(2, head, () => claimProofs(claim, w), { className: "claim" }));
157
+ return item;
158
+ }
159
+ function rowItem(row, w, later, tierOf) {
160
+ const label = w.row(row.requirementRef, "label");
161
+ const name = el("span", "rname");
162
+ if (label !== undefined)
163
+ name.append(tagSource(el("span", "", label), "pack"));
164
+ else
165
+ name.append(tagSource(el("code", "", row.requirementRef), "producer"));
166
+ const summary = el("span", "");
167
+ summary.append(name);
168
+ const tier = tierOf?.(row.contractRef, row.requirementRef);
169
+ if (tier !== undefined) {
170
+ const chip = el("span", "rtier", w.t(`requirement_tier.${tier}`));
171
+ chip.dataset.requirementTier = tier;
172
+ summary.append(" ", chip);
173
+ }
174
+ summary.append(tally(row, w, later));
175
+ const toggle = levelToggle(1, summary, () => {
176
+ const body = el("div", "row-b");
177
+ const detail = w.row(row.requirementRef, "detail");
178
+ if (detail !== undefined)
179
+ body.append(el("p", "", detail));
180
+ const undecided = row.claims.some((claim) => !claim.failed && claim.verdict === "not_evaluable");
181
+ const note = w.row(row.requirementRef, "not_evaluable");
182
+ if (undecided && note !== undefined)
183
+ body.append(el("p", "rnote", note));
184
+ if (later)
185
+ for (const date of new Set(row.claims.flatMap((claim) => claim.appliesFrom === undefined ? [] : [claim.appliesFrom])))
186
+ body.append(el("p", "rnote", w.t("generic.later.note", { date })));
187
+ const list = el("ul", "claims");
188
+ for (const claim of row.claims)
189
+ list.append(claimItem(claim, w));
190
+ body.append(el("h3", "", w.t("generic.claims.h")), list);
191
+ return body;
192
+ }, { className: "row" });
193
+ toggle.dataset.row = row.requirementRef;
194
+ toggle.dataset.contract = row.contractRef;
195
+ return toggle;
196
+ }
197
+ /** A contract's rows as groups: a heading per group, the rows under it, a group with no title last. */
198
+ function groupedRows(rows, w, later, tierOf) {
199
+ const box = el("div", "groups");
200
+ const order = [];
201
+ const byGroup = new Map();
202
+ for (const row of rows) {
203
+ const group = groupOf(row.requirementRef);
204
+ if (!byGroup.has(group)) {
205
+ byGroup.set(group, []);
206
+ order.push(group);
207
+ }
208
+ byGroup.get(group).push(row);
209
+ }
210
+ // A requirement_ref with no `.` is in a final group with no title.
211
+ order.sort((a, b) => Number(a === undefined) - Number(b === undefined));
212
+ for (const group of order) {
213
+ const part = el("div", "group");
214
+ if (group !== undefined) {
215
+ part.dataset.group = group;
216
+ const title = w.group(group);
217
+ const heading = el("h3", "");
218
+ heading.append(title !== undefined
219
+ ? tagSource(el("span", "", title), "pack")
220
+ : tagSource(el("span", "", group), "producer"));
221
+ part.append(heading);
222
+ }
223
+ for (const row of byGroup.get(group))
224
+ part.append(rowItem(row, w, later, tierOf));
225
+ box.append(part);
226
+ }
227
+ return box;
228
+ }
229
+ function contractHeading(contract, w) {
230
+ const heading = el("h2", "", w.t("generic.contract.h"));
231
+ heading.append(" ", tagSource(el("code", "", contract), "producer"));
232
+ return heading;
233
+ }
234
+ /** Rows by contract first, in order of first appearance (module spec section 2: several contracts). */
235
+ function byContract(rows, w, later, tierOf) {
236
+ const contracts = [...new Set(rows.map((row) => row.contractRef))];
237
+ if (contracts.length <= 1)
238
+ return groupedRows(rows, w, later, tierOf);
239
+ const box = el("div", "contracts");
240
+ for (const contract of contracts) {
241
+ const part = el("div", "contract");
242
+ part.dataset.contract = contract;
243
+ part.append(contractHeading(contract, w), groupedRows(rows.filter((row) => row.contractRef === contract), w, later, tierOf));
244
+ box.append(part);
245
+ }
246
+ return box;
247
+ }
248
+ /**
249
+ * Draw the `generic` grouping into the three region wrappers
250
+ * (contract-report.ts made them and put the stylesheet in L0).
251
+ */
252
+ export async function drawGeneric(levels, result, bundle, verified, w, tierOf) {
253
+ const tierFor = (claim) => tierOf === undefined
254
+ ? "unstated"
255
+ : tierOf(claim.contractRef, claim.requirementRef);
256
+ const inForce = result.claims.filter((claim) => !claim.later);
257
+ const later = result.claims.filter((claim) => claim.later);
258
+ // The derived counts leave informational rows out (module spec section 2);
259
+ // contract-report.ts says so above, whenever the Result has one.
260
+ const counted = inForce.filter((claim) => !(tierOf !== undefined && tierFor(claim) === "informational"));
261
+ // L0, after the core's strip: the title, the pack's summary and the counts.
262
+ const sheet = el("div", "l0-card front-card");
263
+ sheet.append(el("h1", "", w.t("generic.title")));
264
+ const summary = reportSummary(w);
265
+ if (summary !== undefined)
266
+ sheet.append(summary);
267
+ const counts = el("p", "counts", `${w.p("generic.counts.claims", counted.length)} · ${w.p("generic.counts.rows", rowsOf(counted).length)}`);
268
+ counts.dataset.counts = "";
269
+ sheet.append(counts);
270
+ levels.L0.append(sheet);
271
+ // L1, why: the rows, led by who judged, who witnessed, what verified.
272
+ const section = el("section", "front-card");
273
+ section.dataset.section = "rows";
274
+ const rows = rowsOf(inForce);
275
+ if (tierOf === undefined)
276
+ section.append(byContract(rows, w, false));
277
+ else
278
+ for (const tier of ROW_TIERS) {
279
+ const inTier = rows.filter((row) => tierOf(row.contractRef, row.requirementRef) === tier);
280
+ if (inTier.length === 0)
281
+ continue;
282
+ const part = el("div", "tier-section");
283
+ part.dataset.tierSection = tier;
284
+ part.append(el("h2", "", w.t(`generic.rtier.${tier}.title`, {
285
+ n: inTier.length.toLocaleString(),
286
+ })), el("p", "rnote", w.t(`generic.rtier.${tier}.note`)), byContract(inTier, w, false, tierOf));
287
+ section.append(part);
288
+ }
289
+ // Claims not yet in force: their own section after the in-force rows,
290
+ // never merged with them, and counted in no total above (ER section 4.3).
291
+ if (later.length > 0) {
292
+ const part = el("div", "later-section");
293
+ part.dataset.section = "not-yet-in-force";
294
+ const laterRows = rowsOf(later);
295
+ part.append(el("h2", "", w.t("generic.later.title", { n: later.length.toLocaleString() })), byContract(laterRows, w, true, tierOf));
296
+ section.append(part);
297
+ }
298
+ section.append(tagSource(el("p", "rnote", w.t("generic.producer.note")), "core"));
299
+ levels.L1.append(section);
300
+ leadWithProvenance(levels.L1, section, renderProvenance(await provenanceLines(result.records, result.claims, bundle, verified, w)));
301
+ // L2, module detail after the core's verification section.
302
+ levels.L2.append(renderCheckYourself(bundle, w));
303
+ }
304
+ //# sourceMappingURL=generic-report-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generic-report-view.js","sourceRoot":"","sources":["../src/generic-report-view.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,SAAS,EAA6B,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,SAAS,EACT,aAAa,EACb,YAAY,EACZ,QAAQ,GAET,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE3E;;;;;;;;;;;;;;;;GAgBG;AAEH,2FAA2F;AAC3F,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,IAAI;IACf,IAAI,EAAE,iBAAiB;IACvB,GAAG,EACD;MACE,qBAAqB;;;;;;;;;;;;;;CAc1B;QACG,QAAQ,CAAC,IAAI,CAAC;QACd,QAAQ,CAAC,KAAK,CAAC;CACT,CAAC;AAEX,MAAM,YAAY,GAAmC;IACnD,GAAG,EAAE,IAAI;IACT,OAAO,EAAE,KAAK;IACd,aAAa,EAAE,IAAI;IACnB,YAAY,EAAE,IAAI;IAClB,MAAM,EAAE,KAAK;IACb,WAAW,EAAE,IAAI;CAClB,CAAC;AAEF,4IAA4I;AAC5I,SAAS,YAAY,CAAC,KAAkB;IACt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AE,CACA,IAAI,EACJ,EAAE,EACF,CAAC,CAAC,CAAC,CAAC,qBAAqB,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC,CACjE,EACD,UAAU,CAAC,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CACvC,CAAC;QACF,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,CAAC,MAAM,CACZ,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,EAAE,MAAM,CAAC,CAClE,CAAC;IACF,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC1B,kBAAkB,CAChB,MAAM,CAAC,EAAE,EACT,OAAO,EACP,gBAAgB,CACd,MAAM,eAAe,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,CAC1E,CACF,CAAC;IAEF,2DAA2D;IAC3D,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,290 @@
1
+ export declare const HISTORY_VIEW = "history-view/v0";
2
+ export type CheckStatus = "pass" | "fail" | "not_run";
3
+ export type SlotState = "passed" | "failed" | "none" | "not_checked";
4
+ export interface HistorySlot {
5
+ readonly state: SlotState;
6
+ readonly by?: string;
7
+ readonly at?: string;
8
+ readonly through?: {
9
+ readonly k: number;
10
+ readonly n: number;
11
+ };
12
+ }
13
+ export interface CheckpointRow {
14
+ readonly kind: "checkpoint";
15
+ readonly cut_at: string;
16
+ readonly log_size: number;
17
+ readonly anchor: string;
18
+ readonly signature: CheckStatus;
19
+ readonly witness: HistorySlot;
20
+ readonly second_signature: HistorySlot;
21
+ }
22
+ export interface DealRow {
23
+ readonly kind: "deal";
24
+ readonly asked: string;
25
+ readonly outcome: string;
26
+ readonly money?: string;
27
+ readonly opened_at: string;
28
+ readonly last_at: string;
29
+ readonly record: string;
30
+ readonly witness: HistorySlot;
31
+ readonly second_signature: HistorySlot;
32
+ }
33
+ export interface HistorySharing {
34
+ readonly standard_history: boolean;
35
+ readonly history_segments: "off" | "counterparties" | "peers";
36
+ readonly record_at_completion: "counterparty" | "off";
37
+ readonly adjudications: "deliver_to_subjects" | "off";
38
+ readonly exchange_corroboration: boolean;
39
+ /** Absent when the node does not state it (an advertised policy lacks it). */
40
+ readonly adjudicate_differing_twins?: boolean;
41
+ /** Absent when the node does not state it (an advertised policy lacks it). */
42
+ readonly witnesses?: readonly string[];
43
+ }
44
+ export interface HistoryViewInput {
45
+ readonly view: typeof HISTORY_VIEW;
46
+ readonly kind: "checkpoint" | "deal";
47
+ readonly surface: "neutral" | "product";
48
+ readonly reader: "owner" | "recipient";
49
+ readonly holder: {
50
+ readonly node?: string;
51
+ readonly name?: string;
52
+ readonly stream?: string;
53
+ };
54
+ readonly audience: {
55
+ readonly kind: "private";
56
+ } | {
57
+ readonly kind: "shared";
58
+ readonly for: string;
59
+ } | {
60
+ readonly kind: "anyone";
61
+ };
62
+ readonly built_at: string;
63
+ readonly checked: {
64
+ readonly where: "page" | "builder";
65
+ readonly by: string;
66
+ };
67
+ readonly outcome?: {
68
+ readonly kind: "answered";
69
+ } | {
70
+ readonly kind: "refused";
71
+ readonly reason: string;
72
+ } | {
73
+ readonly kind: "unreadable";
74
+ };
75
+ readonly picked?: boolean;
76
+ readonly rows: readonly (CheckpointRow | DealRow)[];
77
+ readonly checks: readonly {
78
+ readonly id: string;
79
+ readonly status: CheckStatus;
80
+ readonly values?: Readonly<Record<string, string>>;
81
+ }[];
82
+ readonly periods?: readonly {
83
+ readonly from: string;
84
+ readonly to: string;
85
+ /** A count, or `withheld: true` where the node withholds a small count. */
86
+ readonly cells: readonly {
87
+ readonly what: string;
88
+ readonly value?: string;
89
+ readonly withheld?: true;
90
+ }[];
91
+ }[];
92
+ readonly sharing?: HistorySharing;
93
+ readonly signer_directory?: string;
94
+ readonly period?: {
95
+ readonly from: string;
96
+ readonly to: string;
97
+ };
98
+ }
99
+ /** An overlay pack: a product caller's words for keys of the view's own pack. */
100
+ export interface HistoryViewOverlay {
101
+ readonly id: string;
102
+ readonly entries: Readonly<Record<string, string>>;
103
+ }
104
+ /** The view's check ids (design note §3). Words for each are `check.<id>`. */
105
+ export declare const HISTORY_CHECK_IDS: readonly ["readable", "refusal", "artifact_digest", "card_digest", "checkpoint_signatures", "checkpoint_chain", "consistency", "anchor", "period_counts", "envelope_signature", "key_is_node", "reply_bound", "witness", "second_signature", "deal_report"];
106
+ /** The view's wording pack, as shipped (neutral words only). */
107
+ export declare const HISTORY_VIEW_WORDING: {
108
+ wording_pack_version: string;
109
+ id: string;
110
+ locale: string;
111
+ provenance: {
112
+ _comment: string;
113
+ muse_commit: string;
114
+ sources: {
115
+ "header.title.owner": string;
116
+ "badge.private": string;
117
+ "built.owner": string;
118
+ "hero.none.deals": string;
119
+ "hero.deals.one": string;
120
+ "hero.deals.other": string;
121
+ "row.opened": string;
122
+ "row.last": string;
123
+ "stamp.recorded": string;
124
+ "stamp.timestamped": string;
125
+ "slot.timestamped.none": string;
126
+ "slot.part": string;
127
+ "slot.unchecked": string;
128
+ "slot.failed": string;
129
+ "seal.deals": string;
130
+ "seal.directory": string;
131
+ };
132
+ };
133
+ entries: {
134
+ "header.title.node": string;
135
+ "header.title.stream": string;
136
+ "header.title.owner": string;
137
+ "header.title.shared": string;
138
+ "header.title.person": string;
139
+ "badge.private": string;
140
+ "badge.shared": string;
141
+ "badge.anyone": string;
142
+ "scope.period": string;
143
+ "built.owner": string;
144
+ "built.recipient": string;
145
+ "hero.checkpoints.one": string;
146
+ "hero.checkpoints.other": string;
147
+ "hero.entries.one": string;
148
+ "hero.entries.other": string;
149
+ "verdict.pass": string;
150
+ "verdict.pass.all": string;
151
+ "verdict.unchecked": string;
152
+ "hero.failed": string;
153
+ "hero.none.checkpoints": string;
154
+ "hero.refused": string;
155
+ "hero.refused.reason": string;
156
+ "hero.unreadable": string;
157
+ "hero.deals.one": string;
158
+ "hero.deals.other": string;
159
+ "hero.deals.picked.one": string;
160
+ "hero.deals.picked.other": string;
161
+ "hero.none.deals": string;
162
+ "chip.signatures.pass": string;
163
+ "chip.signatures.pass.all": string;
164
+ "chip.signatures.unchecked": string;
165
+ "chip.timestamped.all": string;
166
+ "chip.timestamped.some": string;
167
+ "chip.timestamped.none": string;
168
+ "chip.timestamped.unchecked": string;
169
+ "chip.timestamped.failed": string;
170
+ "chip.started": string;
171
+ "chip.recorded": string;
172
+ "rows.heading.checkpoints": string;
173
+ "rows.heading.deals": string;
174
+ "row.cut": string;
175
+ "row.entries.one": string;
176
+ "row.entries.other": string;
177
+ "row.opened": string;
178
+ "row.last": string;
179
+ "proof.checkpoint": string;
180
+ "proof.node": string;
181
+ "proof.record": string;
182
+ "stamp.recorded": string;
183
+ "stamp.timestamped": string;
184
+ "stamp.second": string;
185
+ "stamp.signature.unchecked": string;
186
+ "slot.timestamped.at": string;
187
+ "slot.timestamped.by": string;
188
+ "slot.part": string;
189
+ "slot.timestamped.none": string;
190
+ "slot.second.by": string;
191
+ "slot.second.none": string;
192
+ "slot.unchecked": string;
193
+ "slot.failed": string;
194
+ "periods.heading": string;
195
+ "periods.row": string;
196
+ "periods.cell": string;
197
+ "periods.cell.withheld": string;
198
+ "callout.heading": string;
199
+ "callout.checkpoints": string;
200
+ "callout.deals": string;
201
+ "callout.deals.picked": string;
202
+ "shares.heading": string;
203
+ "shares.summary": string;
204
+ "shares.standard.on": string;
205
+ "shares.standard.off": string;
206
+ "shares.segments.counterparties": string;
207
+ "shares.segments.peers": string;
208
+ "shares.segments.off": string;
209
+ "shares.segments.off.sealed": string;
210
+ "shares.corroboration.on": string;
211
+ "shares.completion.on": string;
212
+ "shares.completion.off": string;
213
+ "shares.adjudications.on": string;
214
+ "shares.adjudications.off": string;
215
+ "shares.twins.on": string;
216
+ "shares.twins.unstated": string;
217
+ "shares.witnesses": string;
218
+ "shares.witnesses.none": string;
219
+ "shares.witnesses.unstated": string;
220
+ "shares.never": string;
221
+ "shares.as_of": string;
222
+ "seal.title": string;
223
+ "seal.checkpoints": string;
224
+ "seal.deals": string;
225
+ "seal.unchecked": string;
226
+ "seal.second.label": string;
227
+ "seal.second.rows": string;
228
+ "seal.directory": string;
229
+ "checked.heading": string;
230
+ "checked.where.page": string;
231
+ "checked.where.builder": string;
232
+ "check.line": string;
233
+ "status.pass": string;
234
+ "status.fail": string;
235
+ "status.not_run": string;
236
+ "check.readable": string;
237
+ "check.refusal": string;
238
+ "check.artifact_digest": string;
239
+ "check.card_digest": string;
240
+ "check.checkpoint_signatures": string;
241
+ "check.checkpoint_chain": string;
242
+ "check.consistency": string;
243
+ "check.anchor": string;
244
+ "check.period_counts": string;
245
+ "check.envelope_signature": string;
246
+ "check.key_is_node": string;
247
+ "check.reply_bound": string;
248
+ "check.witness": string;
249
+ "check.second_signature": string;
250
+ "check.deal_report": string;
251
+ refused: string;
252
+ };
253
+ };
254
+ /** A refused input: every reason the view found. */
255
+ export declare class HistoryViewRefused extends Error {
256
+ readonly reasons: readonly string[];
257
+ constructor(reasons: readonly string[]);
258
+ }
259
+ /** One element of the page. Attribute values are the view's own tokens. */
260
+ export interface HistoryElement {
261
+ readonly tag: string;
262
+ readonly attrs: readonly (readonly [string, string])[];
263
+ readonly children: readonly (HistoryElement | string)[];
264
+ }
265
+ /** The tree as HTML, by the HTML fragment serialization rules. */
266
+ export declare function serializeHistoryElement(node: HistoryElement | string): string;
267
+ /** The tree as DOM, text set as text nodes only. */
268
+ export declare function historyElementToDom(node: HistoryElement | string, doc: Document): Node;
269
+ /**
270
+ * The History view's element tree for `input`, or every reason it is
271
+ * refused. `overlay` is a product caller's words (surface `product` only).
272
+ */
273
+ export declare function buildHistoryView(input: unknown, overlay?: unknown): {
274
+ readonly ok: true;
275
+ readonly tree: HistoryElement;
276
+ } | {
277
+ readonly ok: false;
278
+ readonly reasons: readonly string[];
279
+ };
280
+ /** The History view as HTML text; throws HistoryViewRefused on a refused input. */
281
+ export declare function historyViewHtml(input: unknown, overlay?: unknown): string;
282
+ /**
283
+ * Draws the History view into `container`, replacing what it holds. A
284
+ * refused input draws one visible refusal line and returns false.
285
+ */
286
+ export declare function renderHistoryView(input: unknown, container: Element, overlay?: unknown): boolean;
287
+ /** The view's stylesheet: one column under 900px, two above, and print. */
288
+ export declare const historyViewStyles = ".cv-history{--cvh-ink:#1f2733;--cvh-slate:#6b7482;--cvh-line:#e3ded3;--cvh-cream:#f6f2ea;--cvh-navy:#232f42;--cvh-ok:#2e7d5b;--cvh-bad:#b5462f;font:16px/1.45 system-ui,sans-serif;color:var(--cvh-ink);max-width:1120px;margin:0 auto;padding:16px;display:grid;gap:16px}\n.cv-history h1{font-size:22px;margin:0}.cv-history h2{font-size:15px;margin:0 0 8px;color:var(--cvh-navy)}\n.cvh-header p{margin:4px 0}.cvh-badge{display:inline-block;border:1px solid var(--cvh-line);border-radius:6px;padding:2px 8px;font-size:12px;font-weight:700;letter-spacing:.02em}\n.cvh-badge[data-audience=private]{background:#fbefd9;border-color:#e8a33d}.cvh-built,.cvh-note{color:var(--cvh-slate);font-size:13px}\n.cvh-hero-line{font-size:20px;font-weight:700;margin:0}.cvh-hero-note{margin:6px 0 0;color:var(--cvh-slate)}\n.cvh-chips{list-style:none;padding:0;margin:0;display:flex;flex-wrap:wrap;gap:8px}.cvh-chip{background:var(--cvh-cream);border-radius:999px;padding:3px 10px;font-size:13px}\n.cvh-rows{list-style:none;padding:0;margin:0}.cvh-row{border:1px solid var(--cvh-line);border-radius:10px;padding:10px 12px;margin:0 0 10px}\n.cvh-row p{margin:0 0 4px}.cvh-row-title{font-weight:700}.cvh-row-detail{color:var(--cvh-slate);font-size:14px}\n.cvh-proof summary{cursor:pointer;font-size:13px;color:var(--cvh-slate)}.cvh-proof code{font-size:12px;word-break:break-all}\n.cvh-stamps{list-style:none;padding:0;margin:8px 0 0;display:flex;flex-wrap:wrap;gap:8px}\n.cvh-stamp,.cvh-seal-slot{border:2px solid var(--cvh-navy);border-radius:999px;padding:2px 10px;font-size:12px;color:var(--cvh-navy)}\n.cvh-stamp[data-filled=no],.cvh-seal-slot[data-filled=no]{border-style:dotted;border-color:#9aa1ab;color:var(--cvh-slate)}\n.cvh-stamp[data-state=failed]{border-color:var(--cvh-bad);color:var(--cvh-bad)}\n.cvh-stamp-name{font-weight:800}.cvh-stamp-line{margin-left:6px}\n.cvh-callout,.cvh-shares,.cvh-seal,.cvh-periods{border:1px solid var(--cvh-line);border-radius:10px;padding:12px}\n.cvh-callout{background:var(--cvh-cream)}.cvh-callout p,.cvh-seal p{margin:0 0 6px}.cvh-shares ul,.cvh-periods ul{margin:0;padding-left:18px}\n.cvh-seal-title{font-weight:700}.cvh-checked summary{cursor:pointer;font-weight:700;color:var(--cvh-navy)}\n.cvh-check[data-status=fail]{color:var(--cvh-bad)}.cvh-check[data-status=pass]{color:var(--cvh-ok)}\n.cvh-main,.cvh-side{display:grid;gap:16px;align-content:start}.cvh-refused{border:1px solid var(--cvh-bad);color:var(--cvh-bad);padding:8px 12px;border-radius:8px}\n@media (min-width:900px){.cv-history{grid-template-columns:minmax(0,3fr) minmax(0,2fr)}.cvh-header{grid-column:1/-1}}\n@media print{.cv-history{max-width:none;grid-template-columns:1fr}.cvh-proof code{display:block}}\n";
289
+ /** A whole static page (no script) holding the History view; throws HistoryViewRefused. */
290
+ export declare function historyViewDocument(input: unknown, overlay?: unknown, title?: string): string;