@action-state-group/capsule-viewer 0.13.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.
- package/dist/browser.d.ts +1 -0
- package/dist/browser.js +3 -0
- package/dist/browser.js.map +1 -1
- package/dist/compliance-view.js +4 -1
- package/dist/compliance-view.js.map +1 -1
- package/dist/evidence-graph.iife.js +1349 -13
- package/dist/history-view.d.ts +290 -0
- package/dist/history-view.iife.js +1278 -0
- package/dist/history-view.iife.js.sha256 +1 -0
- package/dist/history-view.js +940 -0
- package/dist/history-view.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/outcome-report-view.js +15 -5
- package/dist/outcome-report-view.js.map +1 -1
- package/dist/report-front-styles.js +1 -0
- package/dist/report-front-styles.js.map +1 -1
- package/dist/report-levels.d.ts +37 -4
- package/dist/report-levels.js +127 -8
- package/dist/report-levels.js.map +1 -1
- package/dist/viewer-build.js +1 -1
- package/dist/wording/history-view.en.json +147 -0
- package/package.json +5 -1
|
@@ -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;
|