@action-state-group/capsule-viewer 0.27.0 → 0.27.2
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 +5 -0
- package/dist/browser.js.map +1 -1
- package/dist/deal-standalone-report.d.ts +25 -0
- package/dist/deal-standalone-report.js +272 -0
- package/dist/deal-standalone-report.js.map +1 -0
- package/dist/evidence-graph-view.js +5 -0
- package/dist/evidence-graph-view.js.map +1 -1
- package/dist/evidence-graph.iife.js +291 -138
- package/dist/history-view.d.ts +1 -0
- package/dist/history-view.iife.js +10 -11
- package/dist/history-view.iife.js.sha256 +1 -1
- package/dist/history-view.js +15 -5
- package/dist/history-view.js.map +1 -1
- package/dist/receipt-core.generated.js +106 -17
- package/dist/receipt-core.generated.js.map +1 -1
- package/dist/receipt.d.ts +7 -1
- package/dist/receipt.js +27 -5
- package/dist/receipt.js.map +1 -1
- package/dist/viewer-build.js +1 -1
- package/dist/wording/history-view.en.json +5 -4
- package/package.json +1 -1
package/dist/browser.d.ts
CHANGED
|
@@ -9,5 +9,6 @@ export { readerAnchorWitness, readerWitnessPolicy, setReaderWitnessPolicy, } fro
|
|
|
9
9
|
export { paymentPreimageCheck } from "./payment-preimage.js";
|
|
10
10
|
export { readerCadenceWitness } from "./cadence-witness.js";
|
|
11
11
|
export { readerCardRegistered } from "./card-registered.js";
|
|
12
|
+
export { dealStandaloneReport } from "./deal-standalone-report.js";
|
|
12
13
|
export { readerCardSignature } from "./card-signature.js";
|
|
13
14
|
export { historyViewHtml, historyViewStyles, renderHistoryView, } from "./history-view.js";
|
package/dist/browser.js
CHANGED
|
@@ -41,6 +41,11 @@ export { readerCadenceWitness } from "./cadence-witness.js";
|
|
|
41
41
|
// section 13): AAC's checkCardRegistered over the card statements the block
|
|
42
42
|
// carries, under the reader's own witness list. Existence at a time only.
|
|
43
43
|
export { readerCardRegistered } from "./card-registered.js";
|
|
44
|
+
// A deal copy's standalone report (x-deal-report/v0), checked as capsulectl
|
|
45
|
+
// deal verify checks it (capsule-viewer#397): the receipt module reads the
|
|
46
|
+
// report only once this says "pass". Built from agent-action-capsule's
|
|
47
|
+
// envelope and disclosure checks; the module verifies nothing.
|
|
48
|
+
export { dealStandaloneReport } from "./deal-standalone-report.js";
|
|
44
49
|
// The History card's signature (capsule-viewer#211; rule F4.7): the context's
|
|
45
50
|
// own strict verdict for the root record, which the module draws and does
|
|
46
51
|
// not decide.
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,sEAAsE;AACtE,+DAA+D;AAC/D,gEAAgE;AAChE,wEAAwE;AACxE,uEAAuE;AACvE,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACnE,cAAc,yBAAyB,CAAC;AAExC,yEAAyE;AACzE,8EAA8E;AAC9E,8EAA8E;AAC9E,0EAA0E;AAC1E,uEAAuE;AACvE,4EAA4E;AAC5E,6EAA6E;AAC7E,0EAA0E;AAC1E,2DAA2D;AAC3D,4DAA4D;AAC5D,4EAA4E;AAC5E,WAAW;AACX,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,0CAA0C,CAAC;AAElD,+EAA+E;AAC/E,yEAAyE;AACzE,2EAA2E;AAC3E,mDAAmD;AACnD,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAE/B,0EAA0E;AAC1E,uEAAuE;AACvE,0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AAmD;AACnD,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAE/B,0EAA0E;AAC1E,uEAAuE;AACvE,0EAA0E;AAC1E,gHAAgH;AAChH,sEAAsE;AACtE,6EAA6E;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,8EAA8E;AAC9E,4EAA4E;AAC5E,0EAA0E;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,4EAA4E;AAC5E,2EAA2E;AAC3E,uEAAuE;AACvE,+DAA+D;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,8EAA8E;AAC9E,0EAA0E;AAC1E,cAAc;AACd,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,uEAAuE;AACvE,2DAA2D;AAC3D,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The status of a copy's standalone x-deal-v0 report: `pass` or `fail` as
|
|
3
|
+
* `capsulectl deal verify --bundle` would report it, or null when the bundle
|
|
4
|
+
* carries none this page checks (no `x-deal-report/v0`, an x-deal-v1 copy),
|
|
5
|
+
* or when this browser cannot verify Ed25519.
|
|
6
|
+
*/
|
|
7
|
+
export declare function dealStandaloneReport(bundle: unknown): Promise<"pass" | "fail" | null>;
|
|
8
|
+
/**
|
|
9
|
+
* A JSON non-negative integer, as evidencebook's JSONUint reads one from a
|
|
10
|
+
* bundle decoded with UseNumber: a number only, never a string, and never -0
|
|
11
|
+
* (strconv.ParseUint refuses "-0"). One limit of the page's JSON.parse: a
|
|
12
|
+
* number written `22.0` or `2.2e1` arrives here as 22, which Go refuses; the
|
|
13
|
+
* page cannot see the spelling.
|
|
14
|
+
*/
|
|
15
|
+
export declare function jsonUint(value: unknown): bigint | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* An RFC 3339 time as one comparable instant, to the nanosecond, as Go's
|
|
18
|
+
* time.Parse(time.RFC3339Nano) reads it and Equal compares it: the year read
|
|
19
|
+
* as written (0000-9999), an upper-case T and Z, any number of fraction
|
|
20
|
+
* digits of which nine are kept. Undefined when it is not one. Go's general
|
|
21
|
+
* parser also takes a comma before the fraction and a one-digit hour, which
|
|
22
|
+
* this refuses: capsulectl writes neither, and a refusal here only declines
|
|
23
|
+
* a receipt Go would pass, never the other way.
|
|
24
|
+
*/
|
|
25
|
+
export declare function instant(value: unknown): string | undefined;
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* The page's check of a deal copy's standalone report (capsule-cli#294,
|
|
4
|
+
* capsule-viewer#397): an x-deal-v0 copy whose report rides in
|
|
5
|
+
* `x-deal-report/v0`, on no log, bound to the deal checkpoint the copy is
|
|
6
|
+
* made at. It applies what `capsulectl deal verify --bundle` applies
|
|
7
|
+
* (evidencebook `capsulectl/internal/deal/deal_verify_entry.go` and
|
|
8
|
+
* `deal_verify_report.go` `standaloneReportEntry`, the x-deal-v0 path), so a
|
|
9
|
+
* receipt page reads the report only when this check passed, as it reads it
|
|
10
|
+
* only when capsulectl reported it passed:
|
|
11
|
+
*
|
|
12
|
+
* 1. the x-deal-v0 section is a pointer alone (`sealed_report`), with no
|
|
13
|
+
* x-deal-v1 section beside it, and `x-deal-report/v0` is exactly
|
|
14
|
+
* `{record, agent_input}`, its record the pointer's Capsule and a deal
|
|
15
|
+
* report (`action_id` `capsulectl-deal-report`);
|
|
16
|
+
* 2. the record's producer signature verifies under its own `key_id`, and
|
|
17
|
+
* that key is the verified key of the deal's last step (the record at
|
|
18
|
+
* the highest log position whose evidence record header is a step's);
|
|
19
|
+
* 3. its agent_input matches the digest the record's Capsule commits;
|
|
20
|
+
* 4. its payload is a `deal_report` of the bundle's deal (its `deal_id` is
|
|
21
|
+
* the log id's suffix after `deal/`) under the x-deal-v0 profile, for a
|
|
22
|
+
* copy audience;
|
|
23
|
+
* 5. its `deal_checkpoint` is the bundle's checkpoint (log id, MMR size,
|
|
24
|
+
* root) and holds nothing else;
|
|
25
|
+
* 6. the bundle holds no report record;
|
|
26
|
+
* 7. its lifecycle's `as_of` is the checkpoint's signed time, to the
|
|
27
|
+
* nanosecond.
|
|
28
|
+
*
|
|
29
|
+
* The x-deal-v1 report is not checked here yet: it passes only under the
|
|
30
|
+
* profile's own rule (evidencebook `xdealv1.VerifyReportBundle`), which this
|
|
31
|
+
* page does not run, so a v1 copy gets no answer and its receipt declines.
|
|
32
|
+
*/
|
|
33
|
+
import { ed25519Available, verifyDisclosureEnvelope, verifyProducerEnvelope, } from "@action-state-group/agent-action-capsule";
|
|
34
|
+
const DEAL_V0 = "x-deal-v0";
|
|
35
|
+
const DEAL_V1 = "x-deal-v1";
|
|
36
|
+
const STANDALONE = "x-deal-report/v0";
|
|
37
|
+
const POINTER = "sealed_report";
|
|
38
|
+
const REPORT_ACTION = "capsulectl-deal-report";
|
|
39
|
+
const STEP_TYPES = new Set(["deal_step", "step_completed", "step_failed"]);
|
|
40
|
+
const COPY_AUDIENCES = new Set(["counterparty", "adjudicator", "keep"]);
|
|
41
|
+
const isObj = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
42
|
+
const obj = (value) => (isObj(value) ? value : {});
|
|
43
|
+
/**
|
|
44
|
+
* The status of a copy's standalone x-deal-v0 report: `pass` or `fail` as
|
|
45
|
+
* `capsulectl deal verify --bundle` would report it, or null when the bundle
|
|
46
|
+
* carries none this page checks (no `x-deal-report/v0`, an x-deal-v1 copy),
|
|
47
|
+
* or when this browser cannot verify Ed25519.
|
|
48
|
+
*/
|
|
49
|
+
export async function dealStandaloneReport(bundle) {
|
|
50
|
+
const value = obj(bundle);
|
|
51
|
+
const extensions = obj(value["extensions"]);
|
|
52
|
+
if (!(STANDALONE in extensions) || DEAL_V1 in extensions)
|
|
53
|
+
return null;
|
|
54
|
+
if (!ed25519Available())
|
|
55
|
+
return null;
|
|
56
|
+
return (await standaloneReportHolds(value, extensions)) ? "pass" : "fail";
|
|
57
|
+
}
|
|
58
|
+
async function standaloneReportHolds(value, extensions) {
|
|
59
|
+
// 1. A pointer-only section naming the record the extension carries.
|
|
60
|
+
const section = extensions[DEAL_V0];
|
|
61
|
+
if (!isObj(section) || Object.keys(section).length !== 1)
|
|
62
|
+
return false;
|
|
63
|
+
const id = section[POINTER];
|
|
64
|
+
const x = extensions[STANDALONE];
|
|
65
|
+
if (typeof id !== "string" || !isObj(x) || Object.keys(x).length !== 2)
|
|
66
|
+
return false;
|
|
67
|
+
const record = x["record"];
|
|
68
|
+
const input = x["agent_input"];
|
|
69
|
+
if (!isObj(record) ||
|
|
70
|
+
!isObj(input) ||
|
|
71
|
+
record["capsule_id"] !== id ||
|
|
72
|
+
record["action_id"] !== REPORT_ACTION)
|
|
73
|
+
return false;
|
|
74
|
+
// 2. Signed by the deal's last step's key.
|
|
75
|
+
const reportKey = await verifiedProducerKey(record);
|
|
76
|
+
if (reportKey === undefined)
|
|
77
|
+
return false;
|
|
78
|
+
const last = await lastStepRecord(value);
|
|
79
|
+
if (last === undefined)
|
|
80
|
+
return false;
|
|
81
|
+
if ((await verifiedProducerKey(last)) !== reportKey)
|
|
82
|
+
return false;
|
|
83
|
+
// 3. The disclosed payload is the one the Capsule commits.
|
|
84
|
+
const capsule = {};
|
|
85
|
+
for (const [k, v] of Object.entries(record))
|
|
86
|
+
if (k !== "signature" && k !== "key_id")
|
|
87
|
+
capsule[k] = v;
|
|
88
|
+
const disclosed = await verifyDisclosureEnvelope({
|
|
89
|
+
capsule,
|
|
90
|
+
disclosures: { agent_input: input },
|
|
91
|
+
});
|
|
92
|
+
if (!disclosed.ok || disclosed.disclosuresMatched !== 1)
|
|
93
|
+
return false;
|
|
94
|
+
// 4. This deal's report, under x-deal-v0, for a copy audience.
|
|
95
|
+
const logId = obj(value["completeness_certificate"])["log_id"];
|
|
96
|
+
if (typeof logId !== "string" || !logId.startsWith("deal/"))
|
|
97
|
+
return false;
|
|
98
|
+
const audience = input["audience"];
|
|
99
|
+
if (input["type"] !== "deal_report" ||
|
|
100
|
+
input["profile"] !== DEAL_V0 ||
|
|
101
|
+
typeof audience !== "string" ||
|
|
102
|
+
!COPY_AUDIENCES.has(audience) ||
|
|
103
|
+
input["deal_id"] !== logId.slice("deal/".length))
|
|
104
|
+
return false;
|
|
105
|
+
// 5. Bound to this bundle's checkpoint and nothing else.
|
|
106
|
+
const checkpoint = obj(value["checkpoint"]);
|
|
107
|
+
const bound = input["deal_checkpoint"];
|
|
108
|
+
if (!isObj(bound) || Object.keys(bound).length !== 3)
|
|
109
|
+
return false;
|
|
110
|
+
const boundSize = jsonUint(bound["mmr_size"]);
|
|
111
|
+
const size = jsonUint(checkpoint["mmr_size"]);
|
|
112
|
+
if (bound["log_id"] !== logId ||
|
|
113
|
+
boundSize === undefined ||
|
|
114
|
+
size === undefined ||
|
|
115
|
+
boundSize !== size ||
|
|
116
|
+
bound["root"] !== checkpoint["root"])
|
|
117
|
+
return false;
|
|
118
|
+
// 6. No report record beside it.
|
|
119
|
+
const records = Array.isArray(value["records"]) ? value["records"] : [];
|
|
120
|
+
if (records.some((r) => obj(r)["action_id"] === REPORT_ACTION))
|
|
121
|
+
return false;
|
|
122
|
+
// 7. As of the checkpoint's signed time.
|
|
123
|
+
const asOf = instant(obj(obj(input["report"])["lifecycle"])["as_of"]);
|
|
124
|
+
const signed = instant(checkpoint["timestamp"]);
|
|
125
|
+
return asOf !== undefined && signed !== undefined && asOf === signed;
|
|
126
|
+
}
|
|
127
|
+
/** A record's producer key, hex, when its signature verifies under its own key_id. */
|
|
128
|
+
async function verifiedProducerKey(record) {
|
|
129
|
+
const id = record["capsule_id"];
|
|
130
|
+
const signature = hexBytes(record["signature"]);
|
|
131
|
+
const key = record["key_id"];
|
|
132
|
+
if (typeof id !== "string" || id === "" || signature === undefined)
|
|
133
|
+
return undefined;
|
|
134
|
+
if (typeof key !== "string" || hexBytes(key) === undefined)
|
|
135
|
+
return undefined;
|
|
136
|
+
const result = await verifyProducerEnvelope(id, signature);
|
|
137
|
+
if (!result.ok || result.publicKey === undefined)
|
|
138
|
+
return undefined;
|
|
139
|
+
const verified = Array.from(result.publicKey, (b) => b.toString(16).padStart(2, "0")).join("");
|
|
140
|
+
return verified === key.toLowerCase() ? key : undefined;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* The deal's last step: the record at the highest log position whose
|
|
144
|
+
* evidence record header (see recordHeader) is a step's. As in Go
|
|
145
|
+
* (`lastStepRecord`), a position must be a non-negative integer above 0: the
|
|
146
|
+
* search starts at 0 and takes only a greater one.
|
|
147
|
+
*/
|
|
148
|
+
async function lastStepRecord(value) {
|
|
149
|
+
const memberships = obj(obj(value["completeness_certificate"])["memberships"]);
|
|
150
|
+
const records = Array.isArray(value["records"]) ? value["records"] : [];
|
|
151
|
+
let last;
|
|
152
|
+
let lastSeq = 0n;
|
|
153
|
+
for (const raw of records) {
|
|
154
|
+
const record = obj(raw);
|
|
155
|
+
const type = (await recordHeader(value, record))?.["record_type"];
|
|
156
|
+
if (typeof type !== "string" || !STEP_TYPES.has(type))
|
|
157
|
+
continue;
|
|
158
|
+
const id = record["capsule_id"];
|
|
159
|
+
if (typeof id !== "string")
|
|
160
|
+
continue;
|
|
161
|
+
const seq = jsonUint(obj(obj(memberships[id])["log_coordinates"])["seq"]);
|
|
162
|
+
if (seq !== undefined && seq > lastSeq) {
|
|
163
|
+
last = record;
|
|
164
|
+
lastSeq = seq;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return last;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* A record's evidence record header, as Go's `recordHeader` reads it: the
|
|
171
|
+
* embedded `evidence_record_header` (an x-deal-v0 record's), taken as the
|
|
172
|
+
* bundle states it; else the record's disclosed agent_input
|
|
173
|
+
* (`disclosures[<capsule_id>].agent_input`, an x-deal-v1 book record's),
|
|
174
|
+
* only when it matches the digest the record's Capsule commits. Undefined
|
|
175
|
+
* when it has neither.
|
|
176
|
+
*/
|
|
177
|
+
async function recordHeader(value, record) {
|
|
178
|
+
const embedded = record["evidence_record_header"];
|
|
179
|
+
if (isObj(embedded))
|
|
180
|
+
return embedded;
|
|
181
|
+
const id = record["capsule_id"];
|
|
182
|
+
if (typeof id !== "string" || id === "")
|
|
183
|
+
return undefined;
|
|
184
|
+
const disclosed = obj(obj(value["disclosures"])[id])["agent_input"];
|
|
185
|
+
if (!isObj(disclosed))
|
|
186
|
+
return undefined;
|
|
187
|
+
const capsule = {};
|
|
188
|
+
for (const [k, v] of Object.entries(record))
|
|
189
|
+
if (k !== "signature" && k !== "key_id")
|
|
190
|
+
capsule[k] = v;
|
|
191
|
+
const checked = await verifyDisclosureEnvelope({
|
|
192
|
+
capsule,
|
|
193
|
+
disclosures: { agent_input: disclosed },
|
|
194
|
+
});
|
|
195
|
+
return checked.ok && checked.disclosuresMatched === 1 ? disclosed : undefined;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* A JSON non-negative integer, as evidencebook's JSONUint reads one from a
|
|
199
|
+
* bundle decoded with UseNumber: a number only, never a string, and never -0
|
|
200
|
+
* (strconv.ParseUint refuses "-0"). One limit of the page's JSON.parse: a
|
|
201
|
+
* number written `22.0` or `2.2e1` arrives here as 22, which Go refuses; the
|
|
202
|
+
* page cannot see the spelling.
|
|
203
|
+
*/
|
|
204
|
+
export function jsonUint(value) {
|
|
205
|
+
return typeof value === "number" &&
|
|
206
|
+
Number.isSafeInteger(value) &&
|
|
207
|
+
value >= 0 &&
|
|
208
|
+
!Object.is(value, -0)
|
|
209
|
+
? BigInt(value)
|
|
210
|
+
: undefined;
|
|
211
|
+
}
|
|
212
|
+
function hexBytes(value) {
|
|
213
|
+
if (typeof value !== "string" ||
|
|
214
|
+
value.length % 2 !== 0 ||
|
|
215
|
+
!/^[0-9a-fA-F]*$/u.test(value))
|
|
216
|
+
return undefined;
|
|
217
|
+
const out = new Uint8Array(value.length / 2);
|
|
218
|
+
for (let i = 0; i < out.length; i++)
|
|
219
|
+
out[i] = parseInt(value.slice(2 * i, 2 * i + 2), 16);
|
|
220
|
+
return out;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* An RFC 3339 time as one comparable instant, to the nanosecond, as Go's
|
|
224
|
+
* time.Parse(time.RFC3339Nano) reads it and Equal compares it: the year read
|
|
225
|
+
* as written (0000-9999), an upper-case T and Z, any number of fraction
|
|
226
|
+
* digits of which nine are kept. Undefined when it is not one. Go's general
|
|
227
|
+
* parser also takes a comma before the fraction and a one-digit hour, which
|
|
228
|
+
* this refuses: capsulectl writes neither, and a refusal here only declines
|
|
229
|
+
* a receipt Go would pass, never the other way.
|
|
230
|
+
*/
|
|
231
|
+
export function instant(value) {
|
|
232
|
+
if (typeof value !== "string")
|
|
233
|
+
return undefined;
|
|
234
|
+
const m = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:(Z)|([+-])(\d{2}):(\d{2}))$/u.exec(value);
|
|
235
|
+
if (m === null)
|
|
236
|
+
return undefined;
|
|
237
|
+
const [, y, mo, d, h, mi, s, frac, z, sign, oh, om] = m;
|
|
238
|
+
const fields = [y, mo, d, h, mi, s].map(Number);
|
|
239
|
+
const [year, month, day, hour, minute, second] = fields;
|
|
240
|
+
if (month < 1 ||
|
|
241
|
+
month > 12 ||
|
|
242
|
+
day < 1 ||
|
|
243
|
+
day > civil(year, month + 1, 0).getUTCDate() ||
|
|
244
|
+
hour > 23 ||
|
|
245
|
+
minute > 59 ||
|
|
246
|
+
second > 59)
|
|
247
|
+
return undefined;
|
|
248
|
+
let offset = 0;
|
|
249
|
+
if (z === undefined) {
|
|
250
|
+
const offHour = Number(oh);
|
|
251
|
+
const offMinute = Number(om);
|
|
252
|
+
if (offHour > 23 || offMinute > 59)
|
|
253
|
+
return undefined;
|
|
254
|
+
offset = (sign === "-" ? -1 : 1) * (offHour * 60 + offMinute) * 60;
|
|
255
|
+
}
|
|
256
|
+
const at = civil(year, month, day);
|
|
257
|
+
at.setUTCHours(hour, minute, second, 0);
|
|
258
|
+
const seconds = BigInt(at.getTime() / 1000) - BigInt(offset);
|
|
259
|
+
// Go reads any number of fraction digits and keeps nine.
|
|
260
|
+
const nanos = (frac ?? "").slice(0, 9).padEnd(9, "0");
|
|
261
|
+
return `${seconds}.${nanos}`;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* A UTC date with the year taken as written: Date.UTC reads a year 0-99 as
|
|
265
|
+
* 1900-1999, setUTCFullYear does not.
|
|
266
|
+
*/
|
|
267
|
+
function civil(year, month, day) {
|
|
268
|
+
const at = new Date(0);
|
|
269
|
+
at.setUTCFullYear(year, month - 1, day);
|
|
270
|
+
return at;
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=deal-standalone-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deal-standalone-report.js","sourceRoot":"","sources":["../src/deal-standalone-report.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,GAEvB,MAAM,0CAA0C,CAAC;AAIlD,MAAM,OAAO,GAAG,WAAW,CAAC;AAC5B,MAAM,OAAO,GAAG,WAAW,CAAC;AAC5B,MAAM,UAAU,GAAG,kBAAkB,CAAC;AACtC,MAAM,OAAO,GAAG,eAAe,CAAC;AAChC,MAAM,aAAa,GAAG,wBAAwB,CAAC;AAC/C,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,gBAAgB,EAAE,aAAa,CAAC,CAAC,CAAC;AAC3E,MAAM,cAAc,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EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC7D,yDAAyD;IACzD,MAAM,KAAK,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACtD,OAAO,GAAG,OAAO,IAAI,KAAK,EAAE,CAAC;AAC/B,CAAC;AAED;;;GAGG;AACH,SAAS,KAAK,CAAC,IAAY,EAAE,KAAa,EAAE,GAAW;IACrD,MAAM,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;IACvB,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IACxC,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
2
|
+
import { dealStandaloneReport } from "./deal-standalone-report.js";
|
|
2
3
|
import { AGENT_INPUT_ORIGINALS_EXTENSION, BOOK_PAYLOADS_EXTENSION, buildVerifiedBundleContext, carriedCapsuleCommitment, committedDigest, disclosureOf, logCoordinates, PUBLISHED_CAPSULE_RECORD_TYPE, recordTimes, resolveCarriedInput, isVerifiedBundleContext, REQUIREMENT_CLAIM, readOutcomeReportTerms, withCountersigners, } from "@action-state-group/agent-action-capsule";
|
|
3
4
|
import { BUILTIN_MANIFEST_COMPOSED, BUILTIN_MANIFEST_EVALUATION_SUMMARY_GRAPH, BUILTIN_MANIFEST_NO_AGGREGATE, BUILTIN_MANIFEST_REPORT_ROWS, BUILTIN_MANIFEST_RESULT, BUILTIN_MANIFEST_RESULT_COMPLIANCE, BUILTIN_MANIFEST_RESULT_CONTRACT_REPORT, BUILTIN_MANIFEST_RESULT_OUTCOME_REPORT, } from "./builtin-manifests.js";
|
|
4
5
|
import { classifyCountersignatures, declaredProducerKeys, } from "@action-state-group/agent-action-capsule";
|
|
@@ -2501,6 +2502,10 @@ async function openReceipt(text, panel, options) {
|
|
|
2501
2502
|
return "unreadable";
|
|
2502
2503
|
}
|
|
2503
2504
|
const context = await buildVerifiedBundleContext(bundle);
|
|
2505
|
+
// A deal copy whose standalone report fails the page's own check did not
|
|
2506
|
+
// pass its checks: said as such, never as a kind with no viewer.
|
|
2507
|
+
if ((await dealStandaloneReport(bundle)) === "fail")
|
|
2508
|
+
return "unverified";
|
|
2504
2509
|
const registry = options.registry ?? defaultRegistry;
|
|
2505
2510
|
const resolution = await registry.resolve(context, DEFAULT_AUDIENCE, DEFAULT_FORMAT);
|
|
2506
2511
|
if (resolution.kind !== "module" ||
|