@hesohq/verify-wasm 0.4.3 → 0.5.0-dev.81

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/heso_wasm.js CHANGED
@@ -29,12 +29,16 @@ export class ActionVerdict {
29
29
  let deferred1_0;
30
30
  let deferred1_1;
31
31
  try {
32
- const ret = wasm.__wbg_get_actionverdict_trust_level(this.__wbg_ptr);
33
- deferred1_0 = ret[0];
34
- deferred1_1 = ret[1];
35
- return getStringFromWasm0(ret[0], ret[1]);
32
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
33
+ wasm.__wbg_get_actionverdict_trust_level(retptr, this.__wbg_ptr);
34
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
35
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
36
+ deferred1_0 = r0;
37
+ deferred1_1 = r1;
38
+ return getStringFromWasm0(r0, r1);
36
39
  } finally {
37
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
40
+ wasm.__wbindgen_add_to_stack_pointer(16);
41
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
38
42
  }
39
43
  }
40
44
  /**
@@ -46,12 +50,16 @@ export class ActionVerdict {
46
50
  let deferred1_0;
47
51
  let deferred1_1;
48
52
  try {
49
- const ret = wasm.__wbg_get_actionverdict_verdict(this.__wbg_ptr);
50
- deferred1_0 = ret[0];
51
- deferred1_1 = ret[1];
52
- return getStringFromWasm0(ret[0], ret[1]);
53
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
54
+ wasm.__wbg_get_actionverdict_verdict(retptr, this.__wbg_ptr);
55
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
56
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
57
+ deferred1_0 = r0;
58
+ deferred1_1 = r1;
59
+ return getStringFromWasm0(r0, r1);
53
60
  } finally {
54
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
61
+ wasm.__wbindgen_add_to_stack_pointer(16);
62
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
55
63
  }
56
64
  }
57
65
  /**
@@ -60,7 +68,7 @@ export class ActionVerdict {
60
68
  * @param {string} arg0
61
69
  */
62
70
  set trust_level(arg0) {
63
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
71
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
64
72
  const len0 = WASM_VECTOR_LEN;
65
73
  wasm.__wbg_set_actionverdict_trust_level(this.__wbg_ptr, ptr0, len0);
66
74
  }
@@ -70,7 +78,7 @@ export class ActionVerdict {
70
78
  * @param {string} arg0
71
79
  */
72
80
  set verdict(arg0) {
73
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
81
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
74
82
  const len0 = WASM_VECTOR_LEN;
75
83
  wasm.__wbg_set_actionverdict_verdict(this.__wbg_ptr, ptr0, len0);
76
84
  }
@@ -105,12 +113,16 @@ export class ApprovalTokenClaims {
105
113
  let deferred1_0;
106
114
  let deferred1_1;
107
115
  try {
108
- const ret = wasm.__wbg_get_approvaltokenclaims_approver_public_key(this.__wbg_ptr);
109
- deferred1_0 = ret[0];
110
- deferred1_1 = ret[1];
111
- return getStringFromWasm0(ret[0], ret[1]);
116
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
117
+ wasm.__wbg_get_approvaltokenclaims_approver_public_key(retptr, this.__wbg_ptr);
118
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
119
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
120
+ deferred1_0 = r0;
121
+ deferred1_1 = r1;
122
+ return getStringFromWasm0(r0, r1);
112
123
  } finally {
113
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
124
+ wasm.__wbindgen_add_to_stack_pointer(16);
125
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
114
126
  }
115
127
  }
116
128
  /**
@@ -121,12 +133,16 @@ export class ApprovalTokenClaims {
121
133
  let deferred1_0;
122
134
  let deferred1_1;
123
135
  try {
124
- const ret = wasm.__wbg_get_approvaltokenclaims_decision(this.__wbg_ptr);
125
- deferred1_0 = ret[0];
126
- deferred1_1 = ret[1];
127
- return getStringFromWasm0(ret[0], ret[1]);
136
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
137
+ wasm.__wbg_get_approvaltokenclaims_decision(retptr, this.__wbg_ptr);
138
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
139
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
140
+ deferred1_0 = r0;
141
+ deferred1_1 = r1;
142
+ return getStringFromWasm0(r0, r1);
128
143
  } finally {
129
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
144
+ wasm.__wbindgen_add_to_stack_pointer(16);
145
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
130
146
  }
131
147
  }
132
148
  /**
@@ -135,7 +151,7 @@ export class ApprovalTokenClaims {
135
151
  */
136
152
  get expiry_unix_secs() {
137
153
  const ret = wasm.__wbg_get_approvaltokenclaims_expiry_unix_secs(this.__wbg_ptr);
138
- return ret;
154
+ return takeObject(ret);
139
155
  }
140
156
  /**
141
157
  * The 32-byte random nonce as a `Uint8Array`.
@@ -143,7 +159,7 @@ export class ApprovalTokenClaims {
143
159
  */
144
160
  get nonce() {
145
161
  const ret = wasm.__wbg_get_approvaltokenclaims_nonce(this.__wbg_ptr);
146
- return ret;
162
+ return takeObject(ret);
147
163
  }
148
164
  /**
149
165
  * The scope string encoded in the token.
@@ -153,12 +169,16 @@ export class ApprovalTokenClaims {
153
169
  let deferred1_0;
154
170
  let deferred1_1;
155
171
  try {
156
- const ret = wasm.__wbg_get_approvaltokenclaims_scope(this.__wbg_ptr);
157
- deferred1_0 = ret[0];
158
- deferred1_1 = ret[1];
159
- return getStringFromWasm0(ret[0], ret[1]);
172
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
173
+ wasm.__wbg_get_approvaltokenclaims_scope(retptr, this.__wbg_ptr);
174
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
175
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
176
+ deferred1_0 = r0;
177
+ deferred1_1 = r1;
178
+ return getStringFromWasm0(r0, r1);
160
179
  } finally {
161
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
180
+ wasm.__wbindgen_add_to_stack_pointer(16);
181
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
162
182
  }
163
183
  }
164
184
  /**
@@ -166,7 +186,7 @@ export class ApprovalTokenClaims {
166
186
  * @param {string} arg0
167
187
  */
168
188
  set approver_public_key(arg0) {
169
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
189
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
170
190
  const len0 = WASM_VECTOR_LEN;
171
191
  wasm.__wbg_set_approvaltokenclaims_approver_public_key(this.__wbg_ptr, ptr0, len0);
172
192
  }
@@ -175,7 +195,7 @@ export class ApprovalTokenClaims {
175
195
  * @param {string} arg0
176
196
  */
177
197
  set decision(arg0) {
178
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
198
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
179
199
  const len0 = WASM_VECTOR_LEN;
180
200
  wasm.__wbg_set_approvaltokenclaims_decision(this.__wbg_ptr, ptr0, len0);
181
201
  }
@@ -184,21 +204,21 @@ export class ApprovalTokenClaims {
184
204
  * @param {bigint} arg0
185
205
  */
186
206
  set expiry_unix_secs(arg0) {
187
- wasm.__wbg_set_approvaltokenclaims_expiry_unix_secs(this.__wbg_ptr, arg0);
207
+ wasm.__wbg_set_approvaltokenclaims_expiry_unix_secs(this.__wbg_ptr, addHeapObject(arg0));
188
208
  }
189
209
  /**
190
210
  * The 32-byte random nonce as a `Uint8Array`.
191
211
  * @param {Uint8Array} arg0
192
212
  */
193
213
  set nonce(arg0) {
194
- wasm.__wbg_set_approvaltokenclaims_nonce(this.__wbg_ptr, arg0);
214
+ wasm.__wbg_set_approvaltokenclaims_nonce(this.__wbg_ptr, addHeapObject(arg0));
195
215
  }
196
216
  /**
197
217
  * The scope string encoded in the token.
198
218
  * @param {string} arg0
199
219
  */
200
220
  set scope(arg0) {
201
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
221
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
202
222
  const len0 = WASM_VECTOR_LEN;
203
223
  wasm.__wbg_set_approvaltokenclaims_scope(this.__wbg_ptr, ptr0, len0);
204
224
  }
@@ -230,26 +250,40 @@ export class ChainResult {
230
250
  * @returns {string | undefined}
231
251
  */
232
252
  get detail() {
233
- const ret = wasm.__wbg_get_chainresult_detail(this.__wbg_ptr);
234
- let v1;
235
- if (ret[0] !== 0) {
236
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
237
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
253
+ try {
254
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
255
+ wasm.__wbg_get_chainresult_detail(retptr, this.__wbg_ptr);
256
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
257
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
258
+ let v1;
259
+ if (r0 !== 0) {
260
+ v1 = getStringFromWasm0(r0, r1).slice();
261
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
262
+ }
263
+ return v1;
264
+ } finally {
265
+ wasm.__wbindgen_add_to_stack_pointer(16);
238
266
  }
239
- return v1;
240
267
  }
241
268
  /**
242
269
  * Error kind string. Only set when `ok == false`.
243
270
  * @returns {string | undefined}
244
271
  */
245
272
  get error() {
246
- const ret = wasm.__wbg_get_chainresult_error(this.__wbg_ptr);
247
- let v1;
248
- if (ret[0] !== 0) {
249
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
250
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
273
+ try {
274
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
275
+ wasm.__wbg_get_chainresult_error(retptr, this.__wbg_ptr);
276
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
277
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
278
+ let v1;
279
+ if (r0 !== 0) {
280
+ v1 = getStringFromWasm0(r0, r1).slice();
281
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
282
+ }
283
+ return v1;
284
+ } finally {
285
+ wasm.__wbindgen_add_to_stack_pointer(16);
251
286
  }
252
- return v1;
253
287
  }
254
288
  /**
255
289
  * Number of receipts verified. Only set when `ok == true`.
@@ -280,7 +314,7 @@ export class ChainResult {
280
314
  * @param {string | null} [arg0]
281
315
  */
282
316
  set detail(arg0) {
283
- var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
317
+ var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
284
318
  var len0 = WASM_VECTOR_LEN;
285
319
  wasm.__wbg_set_chainresult_detail(this.__wbg_ptr, ptr0, len0);
286
320
  }
@@ -289,7 +323,7 @@ export class ChainResult {
289
323
  * @param {string | null} [arg0]
290
324
  */
291
325
  set error(arg0) {
292
- var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
326
+ var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
293
327
  var len0 = WASM_VECTOR_LEN;
294
328
  wasm.__wbg_set_chainresult_error(this.__wbg_ptr, ptr0, len0);
295
329
  }
@@ -301,21 +335,739 @@ export class ChainResult {
301
335
  wasm.__wbg_set_chainresult_length(this.__wbg_ptr, isLikeNone(arg0) ? Number.MAX_SAFE_INTEGER : (arg0) >>> 0);
302
336
  }
303
337
  /**
304
- * `true` when every link verified.
305
- * @param {boolean} arg0
338
+ * `true` when every link verified.
339
+ * @param {boolean} arg0
340
+ */
341
+ set ok(arg0) {
342
+ wasm.__wbg_set_chainresult_ok(this.__wbg_ptr, arg0);
343
+ }
344
+ /**
345
+ * The `seq` at which the error occurred. Only set when `ok == false`.
346
+ * @param {number | null} [arg0]
347
+ */
348
+ set seq(arg0) {
349
+ wasm.__wbg_set_chainresult_seq(this.__wbg_ptr, isLikeNone(arg0) ? Number.MAX_SAFE_INTEGER : (arg0) >>> 0);
350
+ }
351
+ }
352
+ if (Symbol.dispose) ChainResult.prototype[Symbol.dispose] = ChainResult.prototype.free;
353
+
354
+ /**
355
+ * The result of an offline CloudTrail feed-completeness check.
356
+ */
357
+ export class CloudTrailFeedVerdict {
358
+ static __wrap(ptr) {
359
+ const obj = Object.create(CloudTrailFeedVerdict.prototype);
360
+ obj.__wbg_ptr = ptr;
361
+ CloudTrailFeedVerdictFinalization.register(obj, obj.__wbg_ptr, obj);
362
+ return obj;
363
+ }
364
+ __destroy_into_raw() {
365
+ const ptr = this.__wbg_ptr;
366
+ this.__wbg_ptr = 0;
367
+ CloudTrailFeedVerdictFinalization.unregister(this);
368
+ return ptr;
369
+ }
370
+ free() {
371
+ const ptr = this.__destroy_into_raw();
372
+ wasm.__wbg_cloudtrailfeedverdict_free(ptr, 0);
373
+ }
374
+ /**
375
+ * 0-based head-first index at which the chain broke / a digest was rejected;
376
+ * `None` for `Complete`.
377
+ * @returns {number | undefined}
378
+ */
379
+ get broken_at() {
380
+ const ret = wasm.__wbg_get_cloudtrailfeedverdict_broken_at(this.__wbg_ptr);
381
+ return ret === Number.MAX_SAFE_INTEGER ? undefined : ret;
382
+ }
383
+ /**
384
+ * Number of hourly digests whose signature + chain link verified.
385
+ * @returns {number}
386
+ */
387
+ get digests_verified() {
388
+ const ret = wasm.__wbg_get_cloudtrailfeedverdict_digests_verified(this.__wbg_ptr);
389
+ return ret >>> 0;
390
+ }
391
+ /**
392
+ * `true` ONLY when an unbroken signed chain proved completeness back to the
393
+ * starting (genesis) digest — the single state that earns a third-party
394
+ * `feed_complete` claim. A `ChainGap` (disclosed gap) reports `false`.
395
+ * @returns {boolean}
396
+ */
397
+ get feed_complete() {
398
+ const ret = wasm.__wbg_get_cloudtrailfeedverdict_feed_complete(this.__wbg_ptr);
399
+ return ret !== 0;
400
+ }
401
+ /**
402
+ * The kind tag of the outcome: `"Complete"`, `"ChainGap"`, `"Empty"`,
403
+ * `"Malformed"`, `"NoMatchingKey"`, `"SignatureInvalid"`,
404
+ * `"PreviousHashMismatch"`, `"PreviousSignatureMismatch"`,
405
+ * `"PreviousObjectMismatch"`.
406
+ * @returns {string}
407
+ */
408
+ get kind() {
409
+ let deferred1_0;
410
+ let deferred1_1;
411
+ try {
412
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
413
+ wasm.__wbg_get_cloudtrailfeedverdict_kind(retptr, this.__wbg_ptr);
414
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
415
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
416
+ deferred1_0 = r0;
417
+ deferred1_1 = r1;
418
+ return getStringFromWasm0(r0, r1);
419
+ } finally {
420
+ wasm.__wbindgen_add_to_stack_pointer(16);
421
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
422
+ }
423
+ }
424
+ /**
425
+ * Number of signed log files the verified digests committed to across the
426
+ * window. For `Complete` this is the SIGNED, COMPLETE inventory the window
427
+ * provably covers (no log file could have been added, removed, or modified
428
+ * without breaking the chain). `0` for non-window outcomes.
429
+ * @returns {number}
430
+ */
431
+ get signed_log_files_count() {
432
+ const ret = wasm.__wbg_get_cloudtrailfeedverdict_signed_log_files_count(this.__wbg_ptr);
433
+ return ret >>> 0;
434
+ }
435
+ /**
436
+ * The signed log-file inventory as a JSON array of
437
+ * `{s3_bucket, s3_object, hash_value, …}` — the proof page renders these so a
438
+ * third party can confirm WHICH files the window covers. `"[]"` for
439
+ * non-window outcomes.
440
+ * @returns {string}
441
+ */
442
+ get signed_log_files_json() {
443
+ let deferred1_0;
444
+ let deferred1_1;
445
+ try {
446
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
447
+ wasm.__wbg_get_cloudtrailfeedverdict_signed_log_files_json(retptr, this.__wbg_ptr);
448
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
449
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
450
+ deferred1_0 = r0;
451
+ deferred1_1 = r1;
452
+ return getStringFromWasm0(r0, r1);
453
+ } finally {
454
+ wasm.__wbindgen_add_to_stack_pointer(16);
455
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
456
+ }
457
+ }
458
+ /**
459
+ * `digestEndTime` of the head digest (window upper bound). `None` unless the
460
+ * outcome carries a window.
461
+ * @returns {string | undefined}
462
+ */
463
+ get window_end() {
464
+ try {
465
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
466
+ wasm.__wbg_get_cloudtrailfeedverdict_window_end(retptr, this.__wbg_ptr);
467
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
468
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
469
+ let v1;
470
+ if (r0 !== 0) {
471
+ v1 = getStringFromWasm0(r0, r1).slice();
472
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
473
+ }
474
+ return v1;
475
+ } finally {
476
+ wasm.__wbindgen_add_to_stack_pointer(16);
477
+ }
478
+ }
479
+ /**
480
+ * `digestEndTime` of the starting digest reached (`Complete`) or the last
481
+ * verified digest before the gap (`ChainGap`). `None` otherwise.
482
+ * @returns {string | undefined}
483
+ */
484
+ get window_start() {
485
+ try {
486
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
487
+ wasm.__wbg_get_cloudtrailfeedverdict_window_start(retptr, this.__wbg_ptr);
488
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
489
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
490
+ let v1;
491
+ if (r0 !== 0) {
492
+ v1 = getStringFromWasm0(r0, r1).slice();
493
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
494
+ }
495
+ return v1;
496
+ } finally {
497
+ wasm.__wbindgen_add_to_stack_pointer(16);
498
+ }
499
+ }
500
+ /**
501
+ * 0-based head-first index at which the chain broke / a digest was rejected;
502
+ * `None` for `Complete`.
503
+ * @param {number | null} [arg0]
504
+ */
505
+ set broken_at(arg0) {
506
+ wasm.__wbg_set_cloudtrailfeedverdict_broken_at(this.__wbg_ptr, isLikeNone(arg0) ? Number.MAX_SAFE_INTEGER : (arg0) >>> 0);
507
+ }
508
+ /**
509
+ * Number of hourly digests whose signature + chain link verified.
510
+ * @param {number} arg0
511
+ */
512
+ set digests_verified(arg0) {
513
+ wasm.__wbg_set_cloudtrailfeedverdict_digests_verified(this.__wbg_ptr, arg0);
514
+ }
515
+ /**
516
+ * `true` ONLY when an unbroken signed chain proved completeness back to the
517
+ * starting (genesis) digest — the single state that earns a third-party
518
+ * `feed_complete` claim. A `ChainGap` (disclosed gap) reports `false`.
519
+ * @param {boolean} arg0
520
+ */
521
+ set feed_complete(arg0) {
522
+ wasm.__wbg_set_cloudtrailfeedverdict_feed_complete(this.__wbg_ptr, arg0);
523
+ }
524
+ /**
525
+ * The kind tag of the outcome: `"Complete"`, `"ChainGap"`, `"Empty"`,
526
+ * `"Malformed"`, `"NoMatchingKey"`, `"SignatureInvalid"`,
527
+ * `"PreviousHashMismatch"`, `"PreviousSignatureMismatch"`,
528
+ * `"PreviousObjectMismatch"`.
529
+ * @param {string} arg0
530
+ */
531
+ set kind(arg0) {
532
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
533
+ const len0 = WASM_VECTOR_LEN;
534
+ wasm.__wbg_set_cloudtrailfeedverdict_kind(this.__wbg_ptr, ptr0, len0);
535
+ }
536
+ /**
537
+ * Number of signed log files the verified digests committed to across the
538
+ * window. For `Complete` this is the SIGNED, COMPLETE inventory the window
539
+ * provably covers (no log file could have been added, removed, or modified
540
+ * without breaking the chain). `0` for non-window outcomes.
541
+ * @param {number} arg0
542
+ */
543
+ set signed_log_files_count(arg0) {
544
+ wasm.__wbg_set_cloudtrailfeedverdict_signed_log_files_count(this.__wbg_ptr, arg0);
545
+ }
546
+ /**
547
+ * The signed log-file inventory as a JSON array of
548
+ * `{s3_bucket, s3_object, hash_value, …}` — the proof page renders these so a
549
+ * third party can confirm WHICH files the window covers. `"[]"` for
550
+ * non-window outcomes.
551
+ * @param {string} arg0
552
+ */
553
+ set signed_log_files_json(arg0) {
554
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
555
+ const len0 = WASM_VECTOR_LEN;
556
+ wasm.__wbg_set_cloudtrailfeedverdict_signed_log_files_json(this.__wbg_ptr, ptr0, len0);
557
+ }
558
+ /**
559
+ * `digestEndTime` of the head digest (window upper bound). `None` unless the
560
+ * outcome carries a window.
561
+ * @param {string | null} [arg0]
562
+ */
563
+ set window_end(arg0) {
564
+ var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
565
+ var len0 = WASM_VECTOR_LEN;
566
+ wasm.__wbg_set_cloudtrailfeedverdict_window_end(this.__wbg_ptr, ptr0, len0);
567
+ }
568
+ /**
569
+ * `digestEndTime` of the starting digest reached (`Complete`) or the last
570
+ * verified digest before the gap (`ChainGap`). `None` otherwise.
571
+ * @param {string | null} [arg0]
572
+ */
573
+ set window_start(arg0) {
574
+ var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
575
+ var len0 = WASM_VECTOR_LEN;
576
+ wasm.__wbg_set_cloudtrailfeedverdict_window_start(this.__wbg_ptr, ptr0, len0);
577
+ }
578
+ }
579
+ if (Symbol.dispose) CloudTrailFeedVerdict.prototype[Symbol.dispose] = CloudTrailFeedVerdict.prototype.free;
580
+
581
+ /**
582
+ * The kind-tagged verdict of [`verify_commitment_wasm`]. `verdict` is one of
583
+ * `"Valid"`, `"InvalidSignature"`, `"FingerprintMismatch"`, `"WrongAlgorithm"`,
584
+ * `"Malformed"`; a recipient accepts the commitment ONLY on `"Valid"`.
585
+ * `signer_fpr` carries the recomputed `blake3(pubkey)` fingerprint (only
586
+ * meaningful on `"Valid"`).
587
+ */
588
+ export class CommitmentVerdict {
589
+ static __wrap(ptr) {
590
+ const obj = Object.create(CommitmentVerdict.prototype);
591
+ obj.__wbg_ptr = ptr;
592
+ CommitmentVerdictFinalization.register(obj, obj.__wbg_ptr, obj);
593
+ return obj;
594
+ }
595
+ __destroy_into_raw() {
596
+ const ptr = this.__wbg_ptr;
597
+ this.__wbg_ptr = 0;
598
+ CommitmentVerdictFinalization.unregister(this);
599
+ return ptr;
600
+ }
601
+ free() {
602
+ const ptr = this.__destroy_into_raw();
603
+ wasm.__wbg_commitmentverdict_free(ptr, 0);
604
+ }
605
+ /**
606
+ * The recomputed `blake3(pubkey)` fingerprint (only set on `"Valid"`).
607
+ * @returns {string}
608
+ */
609
+ get signer_fpr() {
610
+ let deferred1_0;
611
+ let deferred1_1;
612
+ try {
613
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
614
+ wasm.__wbg_get_commitmentverdict_signer_fpr(retptr, this.__wbg_ptr);
615
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
616
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
617
+ deferred1_0 = r0;
618
+ deferred1_1 = r1;
619
+ return getStringFromWasm0(r0, r1);
620
+ } finally {
621
+ wasm.__wbindgen_add_to_stack_pointer(16);
622
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
623
+ }
624
+ }
625
+ /**
626
+ * The verdict tag.
627
+ * @returns {string}
628
+ */
629
+ get verdict() {
630
+ let deferred1_0;
631
+ let deferred1_1;
632
+ try {
633
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
634
+ wasm.__wbg_get_commitmentverdict_verdict(retptr, this.__wbg_ptr);
635
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
636
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
637
+ deferred1_0 = r0;
638
+ deferred1_1 = r1;
639
+ return getStringFromWasm0(r0, r1);
640
+ } finally {
641
+ wasm.__wbindgen_add_to_stack_pointer(16);
642
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
643
+ }
644
+ }
645
+ /**
646
+ * The recomputed `blake3(pubkey)` fingerprint (only set on `"Valid"`).
647
+ * @param {string} arg0
648
+ */
649
+ set signer_fpr(arg0) {
650
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
651
+ const len0 = WASM_VECTOR_LEN;
652
+ wasm.__wbg_set_commitmentverdict_signer_fpr(this.__wbg_ptr, ptr0, len0);
653
+ }
654
+ /**
655
+ * The verdict tag.
656
+ * @param {string} arg0
657
+ */
658
+ set verdict(arg0) {
659
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
660
+ const len0 = WASM_VECTOR_LEN;
661
+ wasm.__wbg_set_commitmentverdict_verdict(this.__wbg_ptr, ptr0, len0);
662
+ }
663
+ }
664
+ if (Symbol.dispose) CommitmentVerdict.prototype[Symbol.dispose] = CommitmentVerdict.prototype.free;
665
+
666
+ /**
667
+ * The base verdict + the rendered signed metrics + the offline-recomputed cost.
668
+ *
669
+ * `verdict` / `trust_level` are exactly what [`verify_action_receipt_wasm`]
670
+ * returns. The metric fields are the SIGNED values (the closed `status` /
671
+ * `token_source` enums rendered to their wire snake_case strings). `cost_display`
672
+ * / `recomputed_cost_micros` are RECOMPUTED from the rate card the caller passed
673
+ * in — `priced == false` (and both `None`) when that card does not price the
674
+ * model; never a guessed figure. `card_id_matches` tells the reader whether the
675
+ * card handed in is the one the receipt actually named.
676
+ */
677
+ export class MetricsVerdict {
678
+ static __wrap(ptr) {
679
+ const obj = Object.create(MetricsVerdict.prototype);
680
+ obj.__wbg_ptr = ptr;
681
+ MetricsVerdictFinalization.register(obj, obj.__wbg_ptr, obj);
682
+ return obj;
683
+ }
684
+ __destroy_into_raw() {
685
+ const ptr = this.__wbg_ptr;
686
+ this.__wbg_ptr = 0;
687
+ MetricsVerdictFinalization.unregister(this);
688
+ return ptr;
689
+ }
690
+ free() {
691
+ const ptr = this.__destroy_into_raw();
692
+ wasm.__wbg_metricsverdict_free(ptr, 0);
693
+ }
694
+ /**
695
+ * Request bytes sent, when the transport exposed it.
696
+ * @returns {number | undefined}
697
+ */
698
+ get bytes_in() {
699
+ const ret = wasm.__wbg_get_metricsverdict_bytes_in(this.__wbg_ptr);
700
+ return ret === Number.MAX_SAFE_INTEGER ? undefined : ret;
701
+ }
702
+ /**
703
+ * Response bytes received, when the transport exposed it.
704
+ * @returns {number | undefined}
705
+ */
706
+ get bytes_out() {
707
+ const ret = wasm.__wbg_get_metricsverdict_bytes_out(this.__wbg_ptr);
708
+ return ret === Number.MAX_SAFE_INTEGER ? undefined : ret;
709
+ }
710
+ /**
711
+ * Whether the passed-in card is the one the receipt named.
712
+ * @returns {boolean}
713
+ */
714
+ get card_id_matches() {
715
+ const ret = wasm.__wbg_get_metricsverdict_card_id_matches(this.__wbg_ptr);
716
+ return ret !== 0;
717
+ }
718
+ /**
719
+ * Recomputed cost as a 6-decimal display string; `None` when not priced.
720
+ * @returns {string | undefined}
721
+ */
722
+ get cost_display() {
723
+ try {
724
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
725
+ wasm.__wbg_get_metricsverdict_cost_display(retptr, this.__wbg_ptr);
726
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
727
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
728
+ let v1;
729
+ if (r0 !== 0) {
730
+ v1 = getStringFromWasm0(r0, r1).slice();
731
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
732
+ }
733
+ return v1;
734
+ } finally {
735
+ wasm.__wbindgen_add_to_stack_pointer(16);
736
+ }
737
+ }
738
+ /**
739
+ * Wall-clock duration in whole milliseconds.
740
+ * @returns {number | undefined}
741
+ */
742
+ get duration_ms() {
743
+ const ret = wasm.__wbg_get_metricsverdict_duration_ms(this.__wbg_ptr);
744
+ return ret === Number.MAX_SAFE_INTEGER ? undefined : ret;
745
+ }
746
+ /**
747
+ * Whether the receipt carried a signed `metrics` block.
748
+ * @returns {boolean}
749
+ */
750
+ get has_metrics() {
751
+ const ret = wasm.__wbg_get_metricsverdict_has_metrics(this.__wbg_ptr);
752
+ return ret !== 0;
753
+ }
754
+ /**
755
+ * The `provider/model` key derived from the signed `action.fields`.
756
+ * @returns {string | undefined}
757
+ */
758
+ get model_key() {
759
+ try {
760
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
761
+ wasm.__wbg_get_metricsverdict_model_key(retptr, this.__wbg_ptr);
762
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
763
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
764
+ let v1;
765
+ if (r0 !== 0) {
766
+ v1 = getStringFromWasm0(r0, r1).slice();
767
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
768
+ }
769
+ return v1;
770
+ } finally {
771
+ wasm.__wbindgen_add_to_stack_pointer(16);
772
+ }
773
+ }
774
+ /**
775
+ * `true` iff the model is priced by the passed-in card.
776
+ * @returns {boolean}
777
+ */
778
+ get priced() {
779
+ const ret = wasm.__wbg_get_metricsverdict_priced(this.__wbg_ptr);
780
+ return ret !== 0;
781
+ }
782
+ /**
783
+ * The rate-card id AS NAMED in the signed receipt.
784
+ * @returns {string | undefined}
785
+ */
786
+ get rate_card_id() {
787
+ try {
788
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
789
+ wasm.__wbg_get_metricsverdict_rate_card_id(retptr, this.__wbg_ptr);
790
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
791
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
792
+ let v1;
793
+ if (r0 !== 0) {
794
+ v1 = getStringFromWasm0(r0, r1).slice();
795
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
796
+ }
797
+ return v1;
798
+ } finally {
799
+ wasm.__wbindgen_add_to_stack_pointer(16);
800
+ }
801
+ }
802
+ /**
803
+ * Recomputed cost in micro-USD (`BigInt`); `None` when not priced.
804
+ * @returns {bigint | undefined}
805
+ */
806
+ get recomputed_cost_micros() {
807
+ try {
808
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
809
+ wasm.__wbg_get_metricsverdict_recomputed_cost_micros(retptr, this.__wbg_ptr);
810
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
811
+ var r2 = getDataViewMemory0().getBigInt64(retptr + 8 * 1, true);
812
+ return r0 === 0 ? undefined : BigInt.asUintN(64, r2);
813
+ } finally {
814
+ wasm.__wbindgen_add_to_stack_pointer(16);
815
+ }
816
+ }
817
+ /**
818
+ * Transport-level retries before this outcome.
819
+ * @returns {number | undefined}
820
+ */
821
+ get retries() {
822
+ const ret = wasm.__wbg_get_metricsverdict_retries(this.__wbg_ptr);
823
+ return ret === Number.MAX_SAFE_INTEGER ? undefined : ret;
824
+ }
825
+ /**
826
+ * Transport status code, when one applied.
827
+ * @returns {number | undefined}
828
+ */
829
+ get status_code() {
830
+ const ret = wasm.__wbg_get_metricsverdict_status_code(this.__wbg_ptr);
831
+ return ret === Number.MAX_SAFE_INTEGER ? undefined : ret;
832
+ }
833
+ /**
834
+ * Execution-outcome class, wire snake_case (`"ok"`, `"server_error"`, …).
835
+ * @returns {string | undefined}
836
+ */
837
+ get status() {
838
+ try {
839
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
840
+ wasm.__wbg_get_metricsverdict_status(retptr, this.__wbg_ptr);
841
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
842
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
843
+ let v1;
844
+ if (r0 !== 0) {
845
+ v1 = getStringFromWasm0(r0, r1).slice();
846
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
847
+ }
848
+ return v1;
849
+ } finally {
850
+ wasm.__wbindgen_add_to_stack_pointer(16);
851
+ }
852
+ }
853
+ /**
854
+ * Token-count source, wire snake_case (`"provider_reported"`/`"estimated"`).
855
+ * @returns {string | undefined}
856
+ */
857
+ get token_source() {
858
+ try {
859
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
860
+ wasm.__wbg_get_metricsverdict_token_source(retptr, this.__wbg_ptr);
861
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
862
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
863
+ let v1;
864
+ if (r0 !== 0) {
865
+ v1 = getStringFromWasm0(r0, r1).slice();
866
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
867
+ }
868
+ return v1;
869
+ } finally {
870
+ wasm.__wbindgen_add_to_stack_pointer(16);
871
+ }
872
+ }
873
+ /**
874
+ * Provider-reported (or estimated) input tokens.
875
+ * @returns {number | undefined}
876
+ */
877
+ get tokens_in() {
878
+ const ret = wasm.__wbg_get_metricsverdict_tokens_in(this.__wbg_ptr);
879
+ return ret === Number.MAX_SAFE_INTEGER ? undefined : ret;
880
+ }
881
+ /**
882
+ * Provider-reported (or estimated) output tokens.
883
+ * @returns {number | undefined}
884
+ */
885
+ get tokens_out() {
886
+ const ret = wasm.__wbg_get_metricsverdict_tokens_out(this.__wbg_ptr);
887
+ return ret === Number.MAX_SAFE_INTEGER ? undefined : ret;
888
+ }
889
+ /**
890
+ * The re-derived trust level (`"L0"`/`"L1"`); `""` unless `verdict == "Valid"`.
891
+ * @returns {string}
892
+ */
893
+ get trust_level() {
894
+ let deferred1_0;
895
+ let deferred1_1;
896
+ try {
897
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
898
+ wasm.__wbg_get_metricsverdict_trust_level(retptr, this.__wbg_ptr);
899
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
900
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
901
+ deferred1_0 = r0;
902
+ deferred1_1 = r1;
903
+ return getStringFromWasm0(r0, r1);
904
+ } finally {
905
+ wasm.__wbindgen_add_to_stack_pointer(16);
906
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
907
+ }
908
+ }
909
+ /**
910
+ * The base `ActionOutcome` verdict tag (`"Valid"`, `"HashMismatch"`, …).
911
+ * @returns {string}
912
+ */
913
+ get verdict() {
914
+ let deferred1_0;
915
+ let deferred1_1;
916
+ try {
917
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
918
+ wasm.__wbg_get_metricsverdict_verdict(retptr, this.__wbg_ptr);
919
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
920
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
921
+ deferred1_0 = r0;
922
+ deferred1_1 = r1;
923
+ return getStringFromWasm0(r0, r1);
924
+ } finally {
925
+ wasm.__wbindgen_add_to_stack_pointer(16);
926
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
927
+ }
928
+ }
929
+ /**
930
+ * Request bytes sent, when the transport exposed it.
931
+ * @param {number | null} [arg0]
932
+ */
933
+ set bytes_in(arg0) {
934
+ wasm.__wbg_set_metricsverdict_bytes_in(this.__wbg_ptr, isLikeNone(arg0) ? Number.MAX_SAFE_INTEGER : (arg0) >>> 0);
935
+ }
936
+ /**
937
+ * Response bytes received, when the transport exposed it.
938
+ * @param {number | null} [arg0]
939
+ */
940
+ set bytes_out(arg0) {
941
+ wasm.__wbg_set_metricsverdict_bytes_out(this.__wbg_ptr, isLikeNone(arg0) ? Number.MAX_SAFE_INTEGER : (arg0) >>> 0);
942
+ }
943
+ /**
944
+ * Whether the passed-in card is the one the receipt named.
945
+ * @param {boolean} arg0
946
+ */
947
+ set card_id_matches(arg0) {
948
+ wasm.__wbg_set_metricsverdict_card_id_matches(this.__wbg_ptr, arg0);
949
+ }
950
+ /**
951
+ * Recomputed cost as a 6-decimal display string; `None` when not priced.
952
+ * @param {string | null} [arg0]
953
+ */
954
+ set cost_display(arg0) {
955
+ var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
956
+ var len0 = WASM_VECTOR_LEN;
957
+ wasm.__wbg_set_metricsverdict_cost_display(this.__wbg_ptr, ptr0, len0);
958
+ }
959
+ /**
960
+ * Wall-clock duration in whole milliseconds.
961
+ * @param {number | null} [arg0]
962
+ */
963
+ set duration_ms(arg0) {
964
+ wasm.__wbg_set_metricsverdict_duration_ms(this.__wbg_ptr, isLikeNone(arg0) ? Number.MAX_SAFE_INTEGER : (arg0) >>> 0);
965
+ }
966
+ /**
967
+ * Whether the receipt carried a signed `metrics` block.
968
+ * @param {boolean} arg0
969
+ */
970
+ set has_metrics(arg0) {
971
+ wasm.__wbg_set_metricsverdict_has_metrics(this.__wbg_ptr, arg0);
972
+ }
973
+ /**
974
+ * The `provider/model` key derived from the signed `action.fields`.
975
+ * @param {string | null} [arg0]
976
+ */
977
+ set model_key(arg0) {
978
+ var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
979
+ var len0 = WASM_VECTOR_LEN;
980
+ wasm.__wbg_set_metricsverdict_model_key(this.__wbg_ptr, ptr0, len0);
981
+ }
982
+ /**
983
+ * `true` iff the model is priced by the passed-in card.
984
+ * @param {boolean} arg0
985
+ */
986
+ set priced(arg0) {
987
+ wasm.__wbg_set_metricsverdict_priced(this.__wbg_ptr, arg0);
988
+ }
989
+ /**
990
+ * The rate-card id AS NAMED in the signed receipt.
991
+ * @param {string | null} [arg0]
992
+ */
993
+ set rate_card_id(arg0) {
994
+ var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
995
+ var len0 = WASM_VECTOR_LEN;
996
+ wasm.__wbg_set_metricsverdict_rate_card_id(this.__wbg_ptr, ptr0, len0);
997
+ }
998
+ /**
999
+ * Recomputed cost in micro-USD (`BigInt`); `None` when not priced.
1000
+ * @param {bigint | null} [arg0]
1001
+ */
1002
+ set recomputed_cost_micros(arg0) {
1003
+ wasm.__wbg_set_metricsverdict_recomputed_cost_micros(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? BigInt(0) : arg0);
1004
+ }
1005
+ /**
1006
+ * Transport-level retries before this outcome.
1007
+ * @param {number | null} [arg0]
1008
+ */
1009
+ set retries(arg0) {
1010
+ wasm.__wbg_set_metricsverdict_retries(this.__wbg_ptr, isLikeNone(arg0) ? Number.MAX_SAFE_INTEGER : (arg0) >>> 0);
1011
+ }
1012
+ /**
1013
+ * Transport status code, when one applied.
1014
+ * @param {number | null} [arg0]
1015
+ */
1016
+ set status_code(arg0) {
1017
+ wasm.__wbg_set_metricsverdict_status_code(this.__wbg_ptr, isLikeNone(arg0) ? Number.MAX_SAFE_INTEGER : (arg0) >>> 0);
1018
+ }
1019
+ /**
1020
+ * Execution-outcome class, wire snake_case (`"ok"`, `"server_error"`, …).
1021
+ * @param {string | null} [arg0]
1022
+ */
1023
+ set status(arg0) {
1024
+ var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1025
+ var len0 = WASM_VECTOR_LEN;
1026
+ wasm.__wbg_set_metricsverdict_status(this.__wbg_ptr, ptr0, len0);
1027
+ }
1028
+ /**
1029
+ * Token-count source, wire snake_case (`"provider_reported"`/`"estimated"`).
1030
+ * @param {string | null} [arg0]
1031
+ */
1032
+ set token_source(arg0) {
1033
+ var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1034
+ var len0 = WASM_VECTOR_LEN;
1035
+ wasm.__wbg_set_metricsverdict_token_source(this.__wbg_ptr, ptr0, len0);
1036
+ }
1037
+ /**
1038
+ * Provider-reported (or estimated) input tokens.
1039
+ * @param {number | null} [arg0]
1040
+ */
1041
+ set tokens_in(arg0) {
1042
+ wasm.__wbg_set_metricsverdict_tokens_in(this.__wbg_ptr, isLikeNone(arg0) ? Number.MAX_SAFE_INTEGER : (arg0) >>> 0);
1043
+ }
1044
+ /**
1045
+ * Provider-reported (or estimated) output tokens.
1046
+ * @param {number | null} [arg0]
1047
+ */
1048
+ set tokens_out(arg0) {
1049
+ wasm.__wbg_set_metricsverdict_tokens_out(this.__wbg_ptr, isLikeNone(arg0) ? Number.MAX_SAFE_INTEGER : (arg0) >>> 0);
1050
+ }
1051
+ /**
1052
+ * The re-derived trust level (`"L0"`/`"L1"`); `""` unless `verdict == "Valid"`.
1053
+ * @param {string} arg0
306
1054
  */
307
- set ok(arg0) {
308
- wasm.__wbg_set_chainresult_ok(this.__wbg_ptr, arg0);
1055
+ set trust_level(arg0) {
1056
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1057
+ const len0 = WASM_VECTOR_LEN;
1058
+ wasm.__wbg_set_metricsverdict_trust_level(this.__wbg_ptr, ptr0, len0);
309
1059
  }
310
1060
  /**
311
- * The `seq` at which the error occurred. Only set when `ok == false`.
312
- * @param {number | null} [arg0]
1061
+ * The base `ActionOutcome` verdict tag (`"Valid"`, `"HashMismatch"`, …).
1062
+ * @param {string} arg0
313
1063
  */
314
- set seq(arg0) {
315
- wasm.__wbg_set_chainresult_seq(this.__wbg_ptr, isLikeNone(arg0) ? Number.MAX_SAFE_INTEGER : (arg0) >>> 0);
1064
+ set verdict(arg0) {
1065
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1066
+ const len0 = WASM_VECTOR_LEN;
1067
+ wasm.__wbg_set_metricsverdict_verdict(this.__wbg_ptr, ptr0, len0);
316
1068
  }
317
1069
  }
318
- if (Symbol.dispose) ChainResult.prototype[Symbol.dispose] = ChainResult.prototype.free;
1070
+ if (Symbol.dispose) MetricsVerdict.prototype[Symbol.dispose] = MetricsVerdict.prototype.free;
319
1071
 
320
1072
  /**
321
1073
  * The verified, decoded result of a delegation envelope.
@@ -343,7 +1095,7 @@ export class VerifiedDelegation {
343
1095
  */
344
1096
  get authorized_key() {
345
1097
  const ret = wasm.__wbg_get_verifieddelegation_authorized_key(this.__wbg_ptr);
346
- return ret;
1098
+ return takeObject(ret);
347
1099
  }
348
1100
  /**
349
1101
  * The envelope's expiry as Unix seconds (`BigInt`).
@@ -351,7 +1103,7 @@ export class VerifiedDelegation {
351
1103
  */
352
1104
  get expiry_unix_secs() {
353
1105
  const ret = wasm.__wbg_get_verifieddelegation_expiry_unix_secs(this.__wbg_ptr);
354
- return ret;
1106
+ return takeObject(ret);
355
1107
  }
356
1108
  /**
357
1109
  * The envelope's not_before as Unix seconds (`BigInt`).
@@ -359,7 +1111,7 @@ export class VerifiedDelegation {
359
1111
  */
360
1112
  get not_before_unix_secs() {
361
1113
  const ret = wasm.__wbg_get_verifieddelegation_not_before_unix_secs(this.__wbg_ptr);
362
- return ret;
1114
+ return takeObject(ret);
363
1115
  }
364
1116
  /**
365
1117
  * The scope the delegated authority was bound to.
@@ -369,12 +1121,16 @@ export class VerifiedDelegation {
369
1121
  let deferred1_0;
370
1122
  let deferred1_1;
371
1123
  try {
372
- const ret = wasm.__wbg_get_verifieddelegation_scope(this.__wbg_ptr);
373
- deferred1_0 = ret[0];
374
- deferred1_1 = ret[1];
375
- return getStringFromWasm0(ret[0], ret[1]);
1124
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1125
+ wasm.__wbg_get_verifieddelegation_scope(retptr, this.__wbg_ptr);
1126
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1127
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1128
+ deferred1_0 = r0;
1129
+ deferred1_1 = r1;
1130
+ return getStringFromWasm0(r0, r1);
376
1131
  } finally {
377
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1132
+ wasm.__wbindgen_add_to_stack_pointer(16);
1133
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
378
1134
  }
379
1135
  }
380
1136
  /**
@@ -385,12 +1141,16 @@ export class VerifiedDelegation {
385
1141
  let deferred1_0;
386
1142
  let deferred1_1;
387
1143
  try {
388
- const ret = wasm.__wbg_get_verifieddelegation_sub(this.__wbg_ptr);
389
- deferred1_0 = ret[0];
390
- deferred1_1 = ret[1];
391
- return getStringFromWasm0(ret[0], ret[1]);
1144
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1145
+ wasm.__wbg_get_verifieddelegation_sub(retptr, this.__wbg_ptr);
1146
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1147
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1148
+ deferred1_0 = r0;
1149
+ deferred1_1 = r1;
1150
+ return getStringFromWasm0(r0, r1);
392
1151
  } finally {
393
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1152
+ wasm.__wbindgen_add_to_stack_pointer(16);
1153
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
394
1154
  }
395
1155
  }
396
1156
  /**
@@ -398,28 +1158,28 @@ export class VerifiedDelegation {
398
1158
  * @param {Uint8Array} arg0
399
1159
  */
400
1160
  set authorized_key(arg0) {
401
- wasm.__wbg_set_verifieddelegation_authorized_key(this.__wbg_ptr, arg0);
1161
+ wasm.__wbg_set_verifieddelegation_authorized_key(this.__wbg_ptr, addHeapObject(arg0));
402
1162
  }
403
1163
  /**
404
1164
  * The envelope's expiry as Unix seconds (`BigInt`).
405
1165
  * @param {bigint} arg0
406
1166
  */
407
1167
  set expiry_unix_secs(arg0) {
408
- wasm.__wbg_set_verifieddelegation_expiry_unix_secs(this.__wbg_ptr, arg0);
1168
+ wasm.__wbg_set_verifieddelegation_expiry_unix_secs(this.__wbg_ptr, addHeapObject(arg0));
409
1169
  }
410
1170
  /**
411
1171
  * The envelope's not_before as Unix seconds (`BigInt`).
412
1172
  * @param {bigint} arg0
413
1173
  */
414
1174
  set not_before_unix_secs(arg0) {
415
- wasm.__wbg_set_verifieddelegation_not_before_unix_secs(this.__wbg_ptr, arg0);
1175
+ wasm.__wbg_set_verifieddelegation_not_before_unix_secs(this.__wbg_ptr, addHeapObject(arg0));
416
1176
  }
417
1177
  /**
418
1178
  * The scope the delegated authority was bound to.
419
1179
  * @param {string} arg0
420
1180
  */
421
1181
  set scope(arg0) {
422
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1182
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
423
1183
  const len0 = WASM_VECTOR_LEN;
424
1184
  wasm.__wbg_set_verifieddelegation_scope(this.__wbg_ptr, ptr0, len0);
425
1185
  }
@@ -428,7 +1188,7 @@ export class VerifiedDelegation {
428
1188
  * @param {string} arg0
429
1189
  */
430
1190
  set sub(arg0) {
431
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1191
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
432
1192
  const len0 = WASM_VECTOR_LEN;
433
1193
  wasm.__wbg_set_verifieddelegation_sub(this.__wbg_ptr, ptr0, len0);
434
1194
  }
@@ -443,13 +1203,21 @@ if (Symbol.dispose) VerifiedDelegation.prototype[Symbol.dispose] = VerifiedDeleg
443
1203
  * @returns {Uint8Array}
444
1204
  */
445
1205
  export function actionCanonicalBytes(content_json) {
446
- const ptr0 = passStringToWasm0(content_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
447
- const len0 = WASM_VECTOR_LEN;
448
- const ret = wasm.actionCanonicalBytes(ptr0, len0);
449
- if (ret[2]) {
450
- throw takeFromExternrefTable0(ret[1]);
1206
+ try {
1207
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1208
+ const ptr0 = passStringToWasm0(content_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1209
+ const len0 = WASM_VECTOR_LEN;
1210
+ wasm.actionCanonicalBytes(retptr, ptr0, len0);
1211
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1212
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1213
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1214
+ if (r2) {
1215
+ throw takeObject(r1);
1216
+ }
1217
+ return takeObject(r0);
1218
+ } finally {
1219
+ wasm.__wbindgen_add_to_stack_pointer(16);
451
1220
  }
452
- return takeFromExternrefTable0(ret[0]);
453
1221
  }
454
1222
 
455
1223
  /**
@@ -462,20 +1230,126 @@ export function anchoredContentHash(content_json) {
462
1230
  let deferred3_0;
463
1231
  let deferred3_1;
464
1232
  try {
465
- const ptr0 = passStringToWasm0(content_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1233
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1234
+ const ptr0 = passStringToWasm0(content_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
466
1235
  const len0 = WASM_VECTOR_LEN;
467
- const ret = wasm.anchoredContentHash(ptr0, len0);
468
- var ptr2 = ret[0];
469
- var len2 = ret[1];
470
- if (ret[3]) {
1236
+ wasm.anchoredContentHash(retptr, ptr0, len0);
1237
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1238
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1239
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1240
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1241
+ var ptr2 = r0;
1242
+ var len2 = r1;
1243
+ if (r3) {
471
1244
  ptr2 = 0; len2 = 0;
472
- throw takeFromExternrefTable0(ret[2]);
1245
+ throw takeObject(r2);
473
1246
  }
474
1247
  deferred3_0 = ptr2;
475
1248
  deferred3_1 = len2;
476
1249
  return getStringFromWasm0(ptr2, len2);
477
1250
  } finally {
478
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1251
+ wasm.__wbindgen_add_to_stack_pointer(16);
1252
+ wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
1253
+ }
1254
+ }
1255
+
1256
+ /**
1257
+ * Assemble the on-the-wire approval-token frame from the detached signature the
1258
+ * in-browser approver key produced over [`approval_token_payload_wasm`]. Pure
1259
+ * assemble, no key. The base64 of these bytes is the bearer `token_b64`.
1260
+ *
1261
+ * Byte order (see [`heso_action::domain::approval_token_frame`], the ONE source —
1262
+ * the kernel verifier parses EXACTLY this and rejects trailing bytes):
1263
+ * `nonce(32) ++ expiry(BE8) ++ decision_tag(1) ++ scope_len(BE4) ++ scope
1264
+ * ++ signature(64) ++ pubkey(32)`
1265
+ *
1266
+ * `nonce` — 32 raw bytes (Uint8Array); MUST equal the nonce signed over.
1267
+ * `expiryUnixSecs` — token expiry as BigInt Unix seconds.
1268
+ * `decision` — `"approved"` or `"rejected"`.
1269
+ * `scope` — the UTF-8 scope string.
1270
+ * `signature` — 64 raw Ed25519 signature bytes (Uint8Array).
1271
+ * `pubkey` — 32 raw Ed25519 public-key bytes (Uint8Array).
1272
+ * @param {Uint8Array} nonce
1273
+ * @param {bigint} expiry_unix_secs
1274
+ * @param {string} decision
1275
+ * @param {string} scope
1276
+ * @param {Uint8Array} signature
1277
+ * @param {Uint8Array} pubkey
1278
+ * @returns {Uint8Array}
1279
+ */
1280
+ export function approvalTokenFrame(nonce, expiry_unix_secs, decision, scope, signature, pubkey) {
1281
+ try {
1282
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1283
+ const ptr0 = passArray8ToWasm0(nonce, wasm.__wbindgen_export);
1284
+ const len0 = WASM_VECTOR_LEN;
1285
+ const ptr1 = passStringToWasm0(decision, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1286
+ const len1 = WASM_VECTOR_LEN;
1287
+ const ptr2 = passStringToWasm0(scope, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1288
+ const len2 = WASM_VECTOR_LEN;
1289
+ const ptr3 = passArray8ToWasm0(signature, wasm.__wbindgen_export);
1290
+ const len3 = WASM_VECTOR_LEN;
1291
+ const ptr4 = passArray8ToWasm0(pubkey, wasm.__wbindgen_export);
1292
+ const len4 = WASM_VECTOR_LEN;
1293
+ wasm.approvalTokenFrame(retptr, ptr0, len0, addHeapObject(expiry_unix_secs), ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
1294
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1295
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1296
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1297
+ if (r2) {
1298
+ throw takeObject(r1);
1299
+ }
1300
+ return takeObject(r0);
1301
+ } finally {
1302
+ wasm.__wbindgen_add_to_stack_pointer(16);
1303
+ }
1304
+ }
1305
+
1306
+ /**
1307
+ * Return the EXACT bytes the approver's Ed25519 key must sign for an approval
1308
+ * token (the Option-C in-browser minter signs THESE, never any hand-rolled
1309
+ * bytes). Mirrors [`l1_cosign_payload_wasm`]: pure assemble, no OsRng, no key —
1310
+ * the browser holds the key, this only produces the payload a detached signer
1311
+ * covers.
1312
+ *
1313
+ * Byte order (see [`heso_action::domain::approval_token_signed_payload`], the ONE
1314
+ * source — the kernel verifier recomputes the identical bytes):
1315
+ * `APPROVAL_TOKEN_SIGNING_DOMAIN ++ nonce(32) ++ expiry(BE8) ++ decision_tag(1)
1316
+ * ++ scope_len(BE4) ++ scope ++ action_canonical_bytes`
1317
+ *
1318
+ * `contentJson` — the `ActionContent` JSON; canonicalized through the SAME
1319
+ * RFC-8785 path as [`action_canonical_bytes_wasm`] (the
1320
+ * browser MUST NOT hand-roll JCS).
1321
+ * `nonce` — 32 raw replay-prevention bytes (Uint8Array).
1322
+ * `expiryUnixSecs` — token expiry as BigInt Unix seconds.
1323
+ * `decision` — `"approved"` or `"rejected"` (the SEC-02 decision binding).
1324
+ * `scope` — the UTF-8 scope string.
1325
+ * @param {string} content_json
1326
+ * @param {Uint8Array} nonce
1327
+ * @param {bigint} expiry_unix_secs
1328
+ * @param {string} decision
1329
+ * @param {string} scope
1330
+ * @returns {Uint8Array}
1331
+ */
1332
+ export function approvalTokenPayload(content_json, nonce, expiry_unix_secs, decision, scope) {
1333
+ try {
1334
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1335
+ const ptr0 = passStringToWasm0(content_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1336
+ const len0 = WASM_VECTOR_LEN;
1337
+ const ptr1 = passArray8ToWasm0(nonce, wasm.__wbindgen_export);
1338
+ const len1 = WASM_VECTOR_LEN;
1339
+ const ptr2 = passStringToWasm0(decision, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1340
+ const len2 = WASM_VECTOR_LEN;
1341
+ const ptr3 = passStringToWasm0(scope, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1342
+ const len3 = WASM_VECTOR_LEN;
1343
+ wasm.approvalTokenPayload(retptr, ptr0, len0, ptr1, len1, addHeapObject(expiry_unix_secs), ptr2, len2, ptr3, len3);
1344
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1345
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1346
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1347
+ if (r2) {
1348
+ throw takeObject(r1);
1349
+ }
1350
+ return takeObject(r0);
1351
+ } finally {
1352
+ wasm.__wbindgen_add_to_stack_pointer(16);
479
1353
  }
480
1354
  }
481
1355
 
@@ -490,22 +1364,91 @@ export function chainHashHex(prev_hex, action_hex) {
490
1364
  let deferred4_0;
491
1365
  let deferred4_1;
492
1366
  try {
493
- const ptr0 = passStringToWasm0(prev_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1367
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1368
+ const ptr0 = passStringToWasm0(prev_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
494
1369
  const len0 = WASM_VECTOR_LEN;
495
- const ptr1 = passStringToWasm0(action_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1370
+ const ptr1 = passStringToWasm0(action_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
496
1371
  const len1 = WASM_VECTOR_LEN;
497
- const ret = wasm.chainHashHex(ptr0, len0, ptr1, len1);
498
- var ptr3 = ret[0];
499
- var len3 = ret[1];
500
- if (ret[3]) {
1372
+ wasm.chainHashHex(retptr, ptr0, len0, ptr1, len1);
1373
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1374
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1375
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1376
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1377
+ var ptr3 = r0;
1378
+ var len3 = r1;
1379
+ if (r3) {
501
1380
  ptr3 = 0; len3 = 0;
502
- throw takeFromExternrefTable0(ret[2]);
1381
+ throw takeObject(r2);
503
1382
  }
504
1383
  deferred4_0 = ptr3;
505
1384
  deferred4_1 = len3;
506
1385
  return getStringFromWasm0(ptr3, len3);
507
1386
  } finally {
508
- wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1387
+ wasm.__wbindgen_add_to_stack_pointer(16);
1388
+ wasm.__wbindgen_export3(deferred4_0, deferred4_1, 1);
1389
+ }
1390
+ }
1391
+
1392
+ /**
1393
+ * PURE. Return the RFC-8785 (JCS) canonical bytes of a commitment envelope JSON
1394
+ * string — the exact bytes the detached operator signature is computed over
1395
+ * (after the `COMMITMENT_SIGNING_DOMAIN` prefix). Delegates to the single kernel
1396
+ * JCS impl; never re-canonicalizes. Throws `[MALFORMED]` if the JSON does not
1397
+ * parse as a `CommitmentEnvelope` and `[CANON]` if it cannot be canonicalized.
1398
+ * @param {string} envelope_json
1399
+ * @returns {Uint8Array}
1400
+ */
1401
+ export function commitmentEnvelopeCanonicalBytes(envelope_json) {
1402
+ try {
1403
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1404
+ const ptr0 = passStringToWasm0(envelope_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1405
+ const len0 = WASM_VECTOR_LEN;
1406
+ wasm.commitmentEnvelopeCanonicalBytes(retptr, ptr0, len0);
1407
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1408
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1409
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1410
+ if (r2) {
1411
+ throw takeObject(r1);
1412
+ }
1413
+ return takeObject(r0);
1414
+ } finally {
1415
+ wasm.__wbindgen_add_to_stack_pointer(16);
1416
+ }
1417
+ }
1418
+
1419
+ /**
1420
+ * The **commitment fingerprint** of an Ed25519 public key: `blake3(raw_pubkey)`,
1421
+ * the full 32-byte digest, lowercase 64-hex, NO prefix — the value the producer
1422
+ * puts in the wire `signer_fpr`. DISTINCT from the `heso:`-prefixed Grade-0
1423
+ * signer fingerprint. Throws `[MALFORMED]` if `pubkey_b64` is not base64 of
1424
+ * exactly 32 bytes.
1425
+ * @param {string} pubkey_b64
1426
+ * @returns {string}
1427
+ */
1428
+ export function commitmentFingerprint(pubkey_b64) {
1429
+ let deferred3_0;
1430
+ let deferred3_1;
1431
+ try {
1432
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1433
+ const ptr0 = passStringToWasm0(pubkey_b64, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1434
+ const len0 = WASM_VECTOR_LEN;
1435
+ wasm.commitmentFingerprint(retptr, ptr0, len0);
1436
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1437
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1438
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1439
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1440
+ var ptr2 = r0;
1441
+ var len2 = r1;
1442
+ if (r3) {
1443
+ ptr2 = 0; len2 = 0;
1444
+ throw takeObject(r2);
1445
+ }
1446
+ deferred3_0 = ptr2;
1447
+ deferred3_1 = len2;
1448
+ return getStringFromWasm0(ptr2, len2);
1449
+ } finally {
1450
+ wasm.__wbindgen_add_to_stack_pointer(16);
1451
+ wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
509
1452
  }
510
1453
  }
511
1454
 
@@ -519,20 +1462,26 @@ export function contentHash(content_json) {
519
1462
  let deferred3_0;
520
1463
  let deferred3_1;
521
1464
  try {
522
- const ptr0 = passStringToWasm0(content_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1465
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1466
+ const ptr0 = passStringToWasm0(content_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
523
1467
  const len0 = WASM_VECTOR_LEN;
524
- const ret = wasm.contentHash(ptr0, len0);
525
- var ptr2 = ret[0];
526
- var len2 = ret[1];
527
- if (ret[3]) {
1468
+ wasm.contentHash(retptr, ptr0, len0);
1469
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1470
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1471
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1472
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1473
+ var ptr2 = r0;
1474
+ var len2 = r1;
1475
+ if (r3) {
528
1476
  ptr2 = 0; len2 = 0;
529
- throw takeFromExternrefTable0(ret[2]);
1477
+ throw takeObject(r2);
530
1478
  }
531
1479
  deferred3_0 = ptr2;
532
1480
  deferred3_1 = len2;
533
1481
  return getStringFromWasm0(ptr2, len2);
534
1482
  } finally {
535
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1483
+ wasm.__wbindgen_add_to_stack_pointer(16);
1484
+ wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
536
1485
  }
537
1486
  }
538
1487
 
@@ -575,15 +1524,23 @@ export function contentHash(content_json) {
575
1524
  * @returns {Uint8Array}
576
1525
  */
577
1526
  export function l1CosignPayload(suspended_content_json, approver_record_json) {
578
- const ptr0 = passStringToWasm0(suspended_content_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
579
- const len0 = WASM_VECTOR_LEN;
580
- const ptr1 = passStringToWasm0(approver_record_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
581
- const len1 = WASM_VECTOR_LEN;
582
- const ret = wasm.l1CosignPayload(ptr0, len0, ptr1, len1);
583
- if (ret[2]) {
584
- throw takeFromExternrefTable0(ret[1]);
1527
+ try {
1528
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1529
+ const ptr0 = passStringToWasm0(suspended_content_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1530
+ const len0 = WASM_VECTOR_LEN;
1531
+ const ptr1 = passStringToWasm0(approver_record_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1532
+ const len1 = WASM_VECTOR_LEN;
1533
+ wasm.l1CosignPayload(retptr, ptr0, len0, ptr1, len1);
1534
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1535
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1536
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1537
+ if (r2) {
1538
+ throw takeObject(r1);
1539
+ }
1540
+ return takeObject(r0);
1541
+ } finally {
1542
+ wasm.__wbindgen_add_to_stack_pointer(16);
585
1543
  }
586
- return takeFromExternrefTable0(ret[0]);
587
1544
  }
588
1545
 
589
1546
  /**
@@ -594,11 +1551,52 @@ export function l1CosignPayload(suspended_content_json, approver_record_json) {
594
1551
  * @param {string} toml_src
595
1552
  */
596
1553
  export function parsePolicy(toml_src) {
597
- const ptr0 = passStringToWasm0(toml_src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
598
- const len0 = WASM_VECTOR_LEN;
599
- const ret = wasm.parsePolicy(ptr0, len0);
600
- if (ret[1]) {
601
- throw takeFromExternrefTable0(ret[0]);
1554
+ try {
1555
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1556
+ const ptr0 = passStringToWasm0(toml_src, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1557
+ const len0 = WASM_VECTOR_LEN;
1558
+ wasm.parsePolicy(retptr, ptr0, len0);
1559
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1560
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1561
+ if (r1) {
1562
+ throw takeObject(r0);
1563
+ }
1564
+ } finally {
1565
+ wasm.__wbindgen_add_to_stack_pointer(16);
1566
+ }
1567
+ }
1568
+
1569
+ /**
1570
+ * Parse a C2SP signed-note checkpoint and return its `{origin, size, root_hex,
1571
+ * text}` as a JSON string. Does NO signature verification — call
1572
+ * `verifyNoteAgainstKey` for that. Throws `[NOTE]` on a malformed note.
1573
+ * @param {string} note
1574
+ * @returns {string}
1575
+ */
1576
+ export function parseSignedNote(note) {
1577
+ let deferred3_0;
1578
+ let deferred3_1;
1579
+ try {
1580
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1581
+ const ptr0 = passStringToWasm0(note, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1582
+ const len0 = WASM_VECTOR_LEN;
1583
+ wasm.parseSignedNote(retptr, ptr0, len0);
1584
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1585
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1586
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1587
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1588
+ var ptr2 = r0;
1589
+ var len2 = r1;
1590
+ if (r3) {
1591
+ ptr2 = 0; len2 = 0;
1592
+ throw takeObject(r2);
1593
+ }
1594
+ deferred3_0 = ptr2;
1595
+ deferred3_1 = len2;
1596
+ return getStringFromWasm0(ptr2, len2);
1597
+ } finally {
1598
+ wasm.__wbindgen_add_to_stack_pointer(16);
1599
+ wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
602
1600
  }
603
1601
  }
604
1602
 
@@ -615,20 +1613,26 @@ export function policyRulesFromToml(toml_src) {
615
1613
  let deferred3_0;
616
1614
  let deferred3_1;
617
1615
  try {
618
- const ptr0 = passStringToWasm0(toml_src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1616
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1617
+ const ptr0 = passStringToWasm0(toml_src, wasm.__wbindgen_export, wasm.__wbindgen_export2);
619
1618
  const len0 = WASM_VECTOR_LEN;
620
- const ret = wasm.policyRulesFromToml(ptr0, len0);
621
- var ptr2 = ret[0];
622
- var len2 = ret[1];
623
- if (ret[3]) {
1619
+ wasm.policyRulesFromToml(retptr, ptr0, len0);
1620
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1621
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1622
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1623
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1624
+ var ptr2 = r0;
1625
+ var len2 = r1;
1626
+ if (r3) {
624
1627
  ptr2 = 0; len2 = 0;
625
- throw takeFromExternrefTable0(ret[2]);
1628
+ throw takeObject(r2);
626
1629
  }
627
1630
  deferred3_0 = ptr2;
628
1631
  deferred3_1 = len2;
629
1632
  return getStringFromWasm0(ptr2, len2);
630
1633
  } finally {
631
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1634
+ wasm.__wbindgen_add_to_stack_pointer(16);
1635
+ wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
632
1636
  }
633
1637
  }
634
1638
 
@@ -665,17 +1669,25 @@ export function policyRulesFromToml(toml_src) {
665
1669
  * @returns {Uint8Array}
666
1670
  */
667
1671
  export function quorumCosignPayload(suspended_content_json, threshold, roster_json, approver_record_json) {
668
- const ptr0 = passStringToWasm0(suspended_content_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
669
- const len0 = WASM_VECTOR_LEN;
670
- const ptr1 = passStringToWasm0(roster_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
671
- const len1 = WASM_VECTOR_LEN;
672
- const ptr2 = passStringToWasm0(approver_record_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
673
- const len2 = WASM_VECTOR_LEN;
674
- const ret = wasm.quorumCosignPayload(ptr0, len0, threshold, ptr1, len1, ptr2, len2);
675
- if (ret[2]) {
676
- throw takeFromExternrefTable0(ret[1]);
1672
+ try {
1673
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1674
+ const ptr0 = passStringToWasm0(suspended_content_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1675
+ const len0 = WASM_VECTOR_LEN;
1676
+ const ptr1 = passStringToWasm0(roster_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1677
+ const len1 = WASM_VECTOR_LEN;
1678
+ const ptr2 = passStringToWasm0(approver_record_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1679
+ const len2 = WASM_VECTOR_LEN;
1680
+ wasm.quorumCosignPayload(retptr, ptr0, len0, threshold, ptr1, len1, ptr2, len2);
1681
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1682
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1683
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1684
+ if (r2) {
1685
+ throw takeObject(r1);
1686
+ }
1687
+ return takeObject(r0);
1688
+ } finally {
1689
+ wasm.__wbindgen_add_to_stack_pointer(16);
677
1690
  }
678
- return takeFromExternrefTable0(ret[0]);
679
1691
  }
680
1692
 
681
1693
  /**
@@ -689,20 +1701,26 @@ export function ruleToSentence(rule_json) {
689
1701
  let deferred3_0;
690
1702
  let deferred3_1;
691
1703
  try {
692
- const ptr0 = passStringToWasm0(rule_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1704
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1705
+ const ptr0 = passStringToWasm0(rule_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
693
1706
  const len0 = WASM_VECTOR_LEN;
694
- const ret = wasm.ruleToSentence(ptr0, len0);
695
- var ptr2 = ret[0];
696
- var len2 = ret[1];
697
- if (ret[3]) {
1707
+ wasm.ruleToSentence(retptr, ptr0, len0);
1708
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1709
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1710
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1711
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1712
+ var ptr2 = r0;
1713
+ var len2 = r1;
1714
+ if (r3) {
698
1715
  ptr2 = 0; len2 = 0;
699
- throw takeFromExternrefTable0(ret[2]);
1716
+ throw takeObject(r2);
700
1717
  }
701
1718
  deferred3_0 = ptr2;
702
1719
  deferred3_1 = len2;
703
1720
  return getStringFromWasm0(ptr2, len2);
704
1721
  } finally {
705
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1722
+ wasm.__wbindgen_add_to_stack_pointer(16);
1723
+ wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
706
1724
  }
707
1725
  }
708
1726
 
@@ -717,22 +1735,67 @@ export function shortHash(hex, prefix) {
717
1735
  let deferred4_0;
718
1736
  let deferred4_1;
719
1737
  try {
720
- const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1738
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1739
+ const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
721
1740
  const len0 = WASM_VECTOR_LEN;
722
- var ptr1 = isLikeNone(prefix) ? 0 : passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1741
+ var ptr1 = isLikeNone(prefix) ? 0 : passStringToWasm0(prefix, wasm.__wbindgen_export, wasm.__wbindgen_export2);
723
1742
  var len1 = WASM_VECTOR_LEN;
724
- const ret = wasm.shortHash(ptr0, len0, ptr1, len1);
725
- var ptr3 = ret[0];
726
- var len3 = ret[1];
727
- if (ret[3]) {
1743
+ wasm.shortHash(retptr, ptr0, len0, ptr1, len1);
1744
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1745
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1746
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1747
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1748
+ var ptr3 = r0;
1749
+ var len3 = r1;
1750
+ if (r3) {
1751
+ ptr3 = 0; len3 = 0;
1752
+ throw takeObject(r2);
1753
+ }
1754
+ deferred4_0 = ptr3;
1755
+ deferred4_1 = len3;
1756
+ return getStringFromWasm0(ptr3, len3);
1757
+ } finally {
1758
+ wasm.__wbindgen_add_to_stack_pointer(16);
1759
+ wasm.__wbindgen_export3(deferred4_0, deferred4_1, 1);
1760
+ }
1761
+ }
1762
+
1763
+ /**
1764
+ * The frozen top-tree leaf VALUE committing one org's epoch snapshot:
1765
+ * `SHA-256(TOP_LEAF_DOMAIN || org_id(16) || epoch(BE8) || org_root(32))`,
1766
+ * 64-hex. The stage-2 commitment a two-stage inclusion proof rides. Throws
1767
+ * `[ORG]`/`[ROOT]` on malformed inputs.
1768
+ * @param {string} org_id_hyphenated
1769
+ * @param {bigint} epoch
1770
+ * @param {string} org_root_hex
1771
+ * @returns {string}
1772
+ */
1773
+ export function topLeafValue(org_id_hyphenated, epoch, org_root_hex) {
1774
+ let deferred4_0;
1775
+ let deferred4_1;
1776
+ try {
1777
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1778
+ const ptr0 = passStringToWasm0(org_id_hyphenated, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1779
+ const len0 = WASM_VECTOR_LEN;
1780
+ const ptr1 = passStringToWasm0(org_root_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1781
+ const len1 = WASM_VECTOR_LEN;
1782
+ wasm.topLeafValue(retptr, ptr0, len0, epoch, ptr1, len1);
1783
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1784
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1785
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1786
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1787
+ var ptr3 = r0;
1788
+ var len3 = r1;
1789
+ if (r3) {
728
1790
  ptr3 = 0; len3 = 0;
729
- throw takeFromExternrefTable0(ret[2]);
1791
+ throw takeObject(r2);
730
1792
  }
731
1793
  deferred4_0 = ptr3;
732
1794
  deferred4_1 = len3;
733
1795
  return getStringFromWasm0(ptr3, len3);
734
1796
  } finally {
735
- wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1797
+ wasm.__wbindgen_add_to_stack_pointer(16);
1798
+ wasm.__wbindgen_export3(deferred4_0, deferred4_1, 1);
736
1799
  }
737
1800
  }
738
1801
 
@@ -745,11 +1808,18 @@ export function shortHash(hex, prefix) {
745
1808
  * @param {string} rules_json
746
1809
  */
747
1810
  export function validateNoFloorBypass(rules_json) {
748
- const ptr0 = passStringToWasm0(rules_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
749
- const len0 = WASM_VECTOR_LEN;
750
- const ret = wasm.validateNoFloorBypass(ptr0, len0);
751
- if (ret[1]) {
752
- throw takeFromExternrefTable0(ret[0]);
1811
+ try {
1812
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1813
+ const ptr0 = passStringToWasm0(rules_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1814
+ const len0 = WASM_VECTOR_LEN;
1815
+ wasm.validateNoFloorBypass(retptr, ptr0, len0);
1816
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1817
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1818
+ if (r1) {
1819
+ throw takeObject(r0);
1820
+ }
1821
+ } finally {
1822
+ wasm.__wbindgen_add_to_stack_pointer(16);
753
1823
  }
754
1824
  }
755
1825
 
@@ -768,12 +1838,41 @@ export function validateNoFloorBypass(rules_json) {
768
1838
  * @returns {ActionVerdict}
769
1839
  */
770
1840
  export function verifyActionReceipt(receipt_bytes) {
771
- const ptr0 = passArray8ToWasm0(receipt_bytes, wasm.__wbindgen_malloc);
1841
+ const ptr0 = passArray8ToWasm0(receipt_bytes, wasm.__wbindgen_export);
772
1842
  const len0 = WASM_VECTOR_LEN;
773
1843
  const ret = wasm.verifyActionReceipt(ptr0, len0);
774
1844
  return ActionVerdict.__wrap(ret);
775
1845
  }
776
1846
 
1847
+ /**
1848
+ * Verify a single `ActionReceipt` AND render its signed metrics + recompute cost
1849
+ * from the passed-in public rate card.
1850
+ *
1851
+ * Runs the EXISTING [`verify_action_receipt`] for the base outcome + trust level
1852
+ * (so that path is byte-for-byte unchanged), then — when the receipt parses —
1853
+ * renders the signed metrics and recomputes the cost via the pure
1854
+ * `heso_action::metrics_view::metrics_view`. Never panics:
1855
+ *
1856
+ * - receipt fails to PARSE ⇒ base verdict + `has_metrics: false` (no metrics).
1857
+ * - rate card fails to PARSE ⇒ base verdict + rendered metrics, but `priced:
1858
+ * false` and `cost_display: None` (cost cannot be recomputed without a card).
1859
+ * - everything parses ⇒ full metrics + recomputed cost.
1860
+ *
1861
+ * `receipt_bytes` — the raw `ActionReceipt` JSON bytes (`Uint8Array`).
1862
+ * `rate_card_json` — the public rate-card JSON the cost is recomputed from.
1863
+ * @param {Uint8Array} receipt_bytes
1864
+ * @param {string} rate_card_json
1865
+ * @returns {MetricsVerdict}
1866
+ */
1867
+ export function verifyActionReceiptWithRates(receipt_bytes, rate_card_json) {
1868
+ const ptr0 = passArray8ToWasm0(receipt_bytes, wasm.__wbindgen_export);
1869
+ const len0 = WASM_VECTOR_LEN;
1870
+ const ptr1 = passStringToWasm0(rate_card_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1871
+ const len1 = WASM_VECTOR_LEN;
1872
+ const ret = wasm.verifyActionReceiptWithRates(ptr0, len0, ptr1, len1);
1873
+ return MetricsVerdict.__wrap(ret);
1874
+ }
1875
+
777
1876
  /**
778
1877
  * Verify a serialized approval token and return its decoded claims.
779
1878
  *
@@ -799,19 +1898,27 @@ export function verifyActionReceipt(receipt_bytes) {
799
1898
  * @returns {ApprovalTokenClaims}
800
1899
  */
801
1900
  export function verifyApprovalToken(token, action_canonical, now_unix_secs, seen_nonces, required_scope, required_decision, registered_keys_b64) {
802
- const ptr0 = passArray8ToWasm0(token, wasm.__wbindgen_malloc);
803
- const len0 = WASM_VECTOR_LEN;
804
- const ptr1 = passArray8ToWasm0(action_canonical, wasm.__wbindgen_malloc);
805
- const len1 = WASM_VECTOR_LEN;
806
- const ptr2 = passStringToWasm0(required_scope, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
807
- const len2 = WASM_VECTOR_LEN;
808
- const ptr3 = passStringToWasm0(required_decision, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
809
- const len3 = WASM_VECTOR_LEN;
810
- const ret = wasm.verifyApprovalToken(ptr0, len0, ptr1, len1, now_unix_secs, seen_nonces, ptr2, len2, ptr3, len3, registered_keys_b64);
811
- if (ret[2]) {
812
- throw takeFromExternrefTable0(ret[1]);
1901
+ try {
1902
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1903
+ const ptr0 = passArray8ToWasm0(token, wasm.__wbindgen_export);
1904
+ const len0 = WASM_VECTOR_LEN;
1905
+ const ptr1 = passArray8ToWasm0(action_canonical, wasm.__wbindgen_export);
1906
+ const len1 = WASM_VECTOR_LEN;
1907
+ const ptr2 = passStringToWasm0(required_scope, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1908
+ const len2 = WASM_VECTOR_LEN;
1909
+ const ptr3 = passStringToWasm0(required_decision, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1910
+ const len3 = WASM_VECTOR_LEN;
1911
+ wasm.verifyApprovalToken(retptr, ptr0, len0, ptr1, len1, addHeapObject(now_unix_secs), addHeapObject(seen_nonces), ptr2, len2, ptr3, len3, addHeapObject(registered_keys_b64));
1912
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1913
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1914
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1915
+ if (r2) {
1916
+ throw takeObject(r1);
1917
+ }
1918
+ return ApprovalTokenClaims.__wrap(r0);
1919
+ } finally {
1920
+ wasm.__wbindgen_add_to_stack_pointer(16);
813
1921
  }
814
- return ApprovalTokenClaims.__wrap(ret[0]);
815
1922
  }
816
1923
 
817
1924
  /**
@@ -822,13 +1929,91 @@ export function verifyApprovalToken(token, action_canonical, now_unix_secs, seen
822
1929
  * @returns {ChainResult}
823
1930
  */
824
1931
  export function verifyChain(receipts_bytes) {
825
- const ptr0 = passArray8ToWasm0(receipts_bytes, wasm.__wbindgen_malloc);
826
- const len0 = WASM_VECTOR_LEN;
827
- const ret = wasm.verifyChain(ptr0, len0);
828
- if (ret[2]) {
829
- throw takeFromExternrefTable0(ret[1]);
1932
+ try {
1933
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1934
+ const ptr0 = passArray8ToWasm0(receipts_bytes, wasm.__wbindgen_export);
1935
+ const len0 = WASM_VECTOR_LEN;
1936
+ wasm.verifyChain(retptr, ptr0, len0);
1937
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1938
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1939
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1940
+ if (r2) {
1941
+ throw takeObject(r1);
1942
+ }
1943
+ return ChainResult.__wrap(r0);
1944
+ } finally {
1945
+ wasm.__wbindgen_add_to_stack_pointer(16);
1946
+ }
1947
+ }
1948
+
1949
+ /**
1950
+ * **REJECT-MORE-ONLY.** Verify an AWS CloudTrail signed digest-file chain
1951
+ * **offline**, proving feed completeness from the frozen bundle bytes + the
1952
+ * PINNED AWS public keys alone — no network, no AWS call, no HESO endpoint.
1953
+ *
1954
+ * `proof_json` is a [`heso_action::cloudtrail::CloudTrailFeedProof`] JSON: the
1955
+ * digest chain (HEAD FIRST), the head's out-of-band `x-amz-meta-signature`, and
1956
+ * the pinned per-Region AWS public keys (PKCS#1 DER, base64 — exactly as
1957
+ * `ListPublicKeys` returns them; this verifier wraps them into SPKI internally,
1958
+ * the #1 implementation trap handled once in the kernel).
1959
+ *
1960
+ * The AWS key is trusted **out of band** (CT pin-the-key model): a digest whose
1961
+ * `digestPublicKeyFingerprint` matches no pinned key FAILS with
1962
+ * `kind = "NoMatchingKey"`. The verdict separates `feed_complete` (window
1963
+ * completeness, claimable to a third party for this STRONG rail) from a
1964
+ * disclosed `ChainGap` — never collapsing a gap into a green badge.
1965
+ *
1966
+ * Throws `[CT_PARSE]` only if `proof_json` is not a valid `CloudTrailFeedProof`;
1967
+ * every cryptographic / chain failure is a non-throwing kind tag instead.
1968
+ * @param {string} proof_json
1969
+ * @returns {CloudTrailFeedVerdict}
1970
+ */
1971
+ export function verifyCloudTrailFeed(proof_json) {
1972
+ try {
1973
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1974
+ const ptr0 = passStringToWasm0(proof_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1975
+ const len0 = WASM_VECTOR_LEN;
1976
+ wasm.verifyCloudTrailFeed(retptr, ptr0, len0);
1977
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1978
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1979
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1980
+ if (r2) {
1981
+ throw takeObject(r1);
1982
+ }
1983
+ return CloudTrailFeedVerdict.__wrap(r0);
1984
+ } finally {
1985
+ wasm.__wbindgen_add_to_stack_pointer(16);
830
1986
  }
831
- return ChainResult.__wrap(ret[0]);
1987
+ }
1988
+
1989
+ /**
1990
+ * REJECT-MORE-ONLY. Verify a detached commitment-envelope signature in the
1991
+ * browser — the recipient independently confirms a commitment the same way the
1992
+ * cloud does.
1993
+ *
1994
+ * Parses `envelope_bytes` as a `CommitmentEnvelope`, re-canonicalizes VIA THE
1995
+ * KERNEL, `verify_strict`-checks the detached Ed25519 signature under
1996
+ * `COMMITMENT_SIGNING_DOMAIN`, and confirms the recomputed commitment
1997
+ * fingerprint (`blake3(pubkey)`) equals `claimed_signer_fpr`. Produces ZERO new
1998
+ * canonical/signed bytes. Never throws — every outcome is a kind-tagged
1999
+ * [`CommitmentVerdict`].
2000
+ * @param {Uint8Array} envelope_bytes
2001
+ * @param {string} operator_pubkey_b64
2002
+ * @param {string} detached_sig_b64
2003
+ * @param {string} claimed_signer_fpr
2004
+ * @returns {CommitmentVerdict}
2005
+ */
2006
+ export function verifyCommitment(envelope_bytes, operator_pubkey_b64, detached_sig_b64, claimed_signer_fpr) {
2007
+ const ptr0 = passArray8ToWasm0(envelope_bytes, wasm.__wbindgen_export);
2008
+ const len0 = WASM_VECTOR_LEN;
2009
+ const ptr1 = passStringToWasm0(operator_pubkey_b64, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2010
+ const len1 = WASM_VECTOR_LEN;
2011
+ const ptr2 = passStringToWasm0(detached_sig_b64, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2012
+ const len2 = WASM_VECTOR_LEN;
2013
+ const ptr3 = passStringToWasm0(claimed_signer_fpr, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2014
+ const len3 = WASM_VECTOR_LEN;
2015
+ const ret = wasm.verifyCommitment(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
2016
+ return CommitmentVerdict.__wrap(ret);
832
2017
  }
833
2018
 
834
2019
  /**
@@ -843,17 +2028,25 @@ export function verifyChain(receipts_bytes) {
843
2028
  * @returns {boolean}
844
2029
  */
845
2030
  export function verifyConsistency(old_size, old_root_hex, new_size, new_root_hex, proof_hashes_json) {
846
- const ptr0 = passStringToWasm0(old_root_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
847
- const len0 = WASM_VECTOR_LEN;
848
- const ptr1 = passStringToWasm0(new_root_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
849
- const len1 = WASM_VECTOR_LEN;
850
- const ptr2 = passStringToWasm0(proof_hashes_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
851
- const len2 = WASM_VECTOR_LEN;
852
- const ret = wasm.verifyConsistency(old_size, ptr0, len0, new_size, ptr1, len1, ptr2, len2);
853
- if (ret[2]) {
854
- throw takeFromExternrefTable0(ret[1]);
2031
+ try {
2032
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2033
+ const ptr0 = passStringToWasm0(old_root_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2034
+ const len0 = WASM_VECTOR_LEN;
2035
+ const ptr1 = passStringToWasm0(new_root_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2036
+ const len1 = WASM_VECTOR_LEN;
2037
+ const ptr2 = passStringToWasm0(proof_hashes_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2038
+ const len2 = WASM_VECTOR_LEN;
2039
+ wasm.verifyConsistency(retptr, old_size, ptr0, len0, new_size, ptr1, len1, ptr2, len2);
2040
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2041
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2042
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2043
+ if (r2) {
2044
+ throw takeObject(r1);
2045
+ }
2046
+ return r0 !== 0;
2047
+ } finally {
2048
+ wasm.__wbindgen_add_to_stack_pointer(16);
855
2049
  }
856
- return ret[0] !== 0;
857
2050
  }
858
2051
 
859
2052
  /**
@@ -881,23 +2074,31 @@ export function verifyConsistency(old_size, old_root_hex, new_size, new_root_hex
881
2074
  * @returns {VerifiedDelegation}
882
2075
  */
883
2076
  export function verifyDelegation(wire, registered_operator_key, action_hash, approval_token, required_scope, required_decision, now_unix_secs) {
884
- const ptr0 = passArray8ToWasm0(wire, wasm.__wbindgen_malloc);
885
- const len0 = WASM_VECTOR_LEN;
886
- const ptr1 = passArray8ToWasm0(registered_operator_key, wasm.__wbindgen_malloc);
887
- const len1 = WASM_VECTOR_LEN;
888
- const ptr2 = passArray8ToWasm0(action_hash, wasm.__wbindgen_malloc);
889
- const len2 = WASM_VECTOR_LEN;
890
- const ptr3 = passArray8ToWasm0(approval_token, wasm.__wbindgen_malloc);
891
- const len3 = WASM_VECTOR_LEN;
892
- const ptr4 = passStringToWasm0(required_scope, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
893
- const len4 = WASM_VECTOR_LEN;
894
- const ptr5 = passStringToWasm0(required_decision, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
895
- const len5 = WASM_VECTOR_LEN;
896
- const ret = wasm.verifyDelegation(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, now_unix_secs);
897
- if (ret[2]) {
898
- throw takeFromExternrefTable0(ret[1]);
899
- }
900
- return VerifiedDelegation.__wrap(ret[0]);
2077
+ try {
2078
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2079
+ const ptr0 = passArray8ToWasm0(wire, wasm.__wbindgen_export);
2080
+ const len0 = WASM_VECTOR_LEN;
2081
+ const ptr1 = passArray8ToWasm0(registered_operator_key, wasm.__wbindgen_export);
2082
+ const len1 = WASM_VECTOR_LEN;
2083
+ const ptr2 = passArray8ToWasm0(action_hash, wasm.__wbindgen_export);
2084
+ const len2 = WASM_VECTOR_LEN;
2085
+ const ptr3 = passArray8ToWasm0(approval_token, wasm.__wbindgen_export);
2086
+ const len3 = WASM_VECTOR_LEN;
2087
+ const ptr4 = passStringToWasm0(required_scope, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2088
+ const len4 = WASM_VECTOR_LEN;
2089
+ const ptr5 = passStringToWasm0(required_decision, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2090
+ const len5 = WASM_VECTOR_LEN;
2091
+ wasm.verifyDelegation(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, addHeapObject(now_unix_secs));
2092
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2093
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2094
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2095
+ if (r2) {
2096
+ throw takeObject(r1);
2097
+ }
2098
+ return VerifiedDelegation.__wrap(r0);
2099
+ } finally {
2100
+ wasm.__wbindgen_add_to_stack_pointer(16);
2101
+ }
901
2102
  }
902
2103
 
903
2104
  /**
@@ -917,17 +2118,92 @@ export function verifyDelegation(wire, registered_operator_key, action_hash, app
917
2118
  * @returns {boolean}
918
2119
  */
919
2120
  export function verifyInclusion(leaf_value_hex, index, size, root_hex, proof_hashes_json) {
920
- const ptr0 = passStringToWasm0(leaf_value_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
921
- const len0 = WASM_VECTOR_LEN;
922
- const ptr1 = passStringToWasm0(root_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
923
- const len1 = WASM_VECTOR_LEN;
924
- const ptr2 = passStringToWasm0(proof_hashes_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
925
- const len2 = WASM_VECTOR_LEN;
926
- const ret = wasm.verifyInclusion(ptr0, len0, index, size, ptr1, len1, ptr2, len2);
927
- if (ret[2]) {
928
- throw takeFromExternrefTable0(ret[1]);
2121
+ try {
2122
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2123
+ const ptr0 = passStringToWasm0(leaf_value_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2124
+ const len0 = WASM_VECTOR_LEN;
2125
+ const ptr1 = passStringToWasm0(root_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2126
+ const len1 = WASM_VECTOR_LEN;
2127
+ const ptr2 = passStringToWasm0(proof_hashes_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2128
+ const len2 = WASM_VECTOR_LEN;
2129
+ wasm.verifyInclusion(retptr, ptr0, len0, index, size, ptr1, len1, ptr2, len2);
2130
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2131
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2132
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2133
+ if (r2) {
2134
+ throw takeObject(r1);
2135
+ }
2136
+ return r0 !== 0;
2137
+ } finally {
2138
+ wasm.__wbindgen_add_to_stack_pointer(16);
2139
+ }
2140
+ }
2141
+
2142
+ /**
2143
+ * Verify a parsed C2SP signed-note checkpoint against a PINNED Ed25519 log
2144
+ * public key (base64, raw 32 bytes). Returns `true` iff at least one signature
2145
+ * line is from the pinned key AND `verify_strict`s over the note text.
2146
+ *
2147
+ * The pinned key is supplied by the caller (trusted out of band, CT-style) — a
2148
+ * note signed by any non-pinned key returns `false`. Throws `[NOTE]` if the
2149
+ * note is malformed or `[KEY]` if the pubkey is not base64 of 32 bytes.
2150
+ * @param {string} note
2151
+ * @param {string} log_pubkey_b64
2152
+ * @returns {boolean}
2153
+ */
2154
+ export function verifyNoteAgainstKey(note, log_pubkey_b64) {
2155
+ try {
2156
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2157
+ const ptr0 = passStringToWasm0(note, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2158
+ const len0 = WASM_VECTOR_LEN;
2159
+ const ptr1 = passStringToWasm0(log_pubkey_b64, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2160
+ const len1 = WASM_VECTOR_LEN;
2161
+ wasm.verifyNoteAgainstKey(retptr, ptr0, len0, ptr1, len1);
2162
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2163
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2164
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2165
+ if (r2) {
2166
+ throw takeObject(r1);
2167
+ }
2168
+ return r0 !== 0;
2169
+ } finally {
2170
+ wasm.__wbindgen_add_to_stack_pointer(16);
2171
+ }
2172
+ }
2173
+
2174
+ /**
2175
+ * Verify a single commit-and-reveal field reveal against its signed redaction
2176
+ * marker — recompute `BLAKE3(salt ++ field_path ++ value)` and check equality
2177
+ * with `marker.commitment`. The browser/offline counterpart to the Node
2178
+ * `verifyRevealJs`: the missing half that lets a web auditor reveal-and-prove a
2179
+ * redacted field with only the receipt + the customer-supplied sidecar.
2180
+ *
2181
+ * `reveal_json` — a `FieldReveal`: `{ field_path, salt_hex, value_json }`.
2182
+ * `marker_json` — the matching `RedactionMarker` from the signed receipt.
2183
+ *
2184
+ * Returns `true` iff the reveal recomputes the marker's commitment.
2185
+ * @param {string} reveal_json
2186
+ * @param {string} marker_json
2187
+ * @returns {boolean}
2188
+ */
2189
+ export function verifyReveal(reveal_json, marker_json) {
2190
+ try {
2191
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2192
+ const ptr0 = passStringToWasm0(reveal_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2193
+ const len0 = WASM_VECTOR_LEN;
2194
+ const ptr1 = passStringToWasm0(marker_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2195
+ const len1 = WASM_VECTOR_LEN;
2196
+ wasm.verifyReveal(retptr, ptr0, len0, ptr1, len1);
2197
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2198
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2199
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2200
+ if (r2) {
2201
+ throw takeObject(r1);
2202
+ }
2203
+ return r0 !== 0;
2204
+ } finally {
2205
+ wasm.__wbindgen_add_to_stack_pointer(16);
929
2206
  }
930
- return ret[0] !== 0;
931
2207
  }
932
2208
 
933
2209
  /**
@@ -936,13 +2212,21 @@ export function verifyInclusion(leaf_value_hex, index, size, root_hex, proof_has
936
2212
  * @returns {ChainResult}
937
2213
  */
938
2214
  export function verifySessionChain(receipts_bytes) {
939
- const ptr0 = passArray8ToWasm0(receipts_bytes, wasm.__wbindgen_malloc);
940
- const len0 = WASM_VECTOR_LEN;
941
- const ret = wasm.verifySessionChain(ptr0, len0);
942
- if (ret[2]) {
943
- throw takeFromExternrefTable0(ret[1]);
2215
+ try {
2216
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2217
+ const ptr0 = passArray8ToWasm0(receipts_bytes, wasm.__wbindgen_export);
2218
+ const len0 = WASM_VECTOR_LEN;
2219
+ wasm.verifySessionChain(retptr, ptr0, len0);
2220
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2221
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2222
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2223
+ if (r2) {
2224
+ throw takeObject(r1);
2225
+ }
2226
+ return ChainResult.__wrap(r0);
2227
+ } finally {
2228
+ wasm.__wbindgen_add_to_stack_pointer(16);
944
2229
  }
945
- return ChainResult.__wrap(ret[0]);
946
2230
  }
947
2231
 
948
2232
  /**
@@ -956,39 +2240,47 @@ export function verifySessionChain(receipts_bytes) {
956
2240
  * @returns {ChainResult}
957
2241
  */
958
2242
  export function verifySessionChainWithRotation(receipts_bytes, producer_key, decision_key) {
959
- const ptr0 = passArray8ToWasm0(receipts_bytes, wasm.__wbindgen_malloc);
960
- const len0 = WASM_VECTOR_LEN;
961
- const ptr1 = passStringToWasm0(producer_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
962
- const len1 = WASM_VECTOR_LEN;
963
- var ptr2 = isLikeNone(decision_key) ? 0 : passStringToWasm0(decision_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
964
- var len2 = WASM_VECTOR_LEN;
965
- const ret = wasm.verifySessionChainWithRotation(ptr0, len0, ptr1, len1, ptr2, len2);
966
- if (ret[2]) {
967
- throw takeFromExternrefTable0(ret[1]);
2243
+ try {
2244
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2245
+ const ptr0 = passArray8ToWasm0(receipts_bytes, wasm.__wbindgen_export);
2246
+ const len0 = WASM_VECTOR_LEN;
2247
+ const ptr1 = passStringToWasm0(producer_key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2248
+ const len1 = WASM_VECTOR_LEN;
2249
+ var ptr2 = isLikeNone(decision_key) ? 0 : passStringToWasm0(decision_key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2250
+ var len2 = WASM_VECTOR_LEN;
2251
+ wasm.verifySessionChainWithRotation(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
2252
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2253
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2254
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2255
+ if (r2) {
2256
+ throw takeObject(r1);
2257
+ }
2258
+ return ChainResult.__wrap(r0);
2259
+ } finally {
2260
+ wasm.__wbindgen_add_to_stack_pointer(16);
968
2261
  }
969
- return ChainResult.__wrap(ret[0]);
970
2262
  }
971
2263
  function __wbg_get_imports() {
972
2264
  const import0 = {
973
2265
  __proto__: null,
974
2266
  __wbg_Error_ef53bc310eb298a0: function(arg0, arg1) {
975
2267
  const ret = Error(getStringFromWasm0(arg0, arg1));
976
- return ret;
2268
+ return addHeapObject(ret);
977
2269
  },
978
2270
  __wbg___wbindgen_bigint_get_as_i64_38130e98eecd467d: function(arg0, arg1) {
979
- const v = arg1;
2271
+ const v = getObject(arg1);
980
2272
  const ret = typeof(v) === 'bigint' ? v : undefined;
981
2273
  getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
982
2274
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
983
2275
  },
984
2276
  __wbg___wbindgen_jsval_eq_1068e624fa87f6ab: function(arg0, arg1) {
985
- const ret = arg0 === arg1;
2277
+ const ret = getObject(arg0) === getObject(arg1);
986
2278
  return ret;
987
2279
  },
988
2280
  __wbg___wbindgen_string_get_72bdf95d3ae505b1: function(arg0, arg1) {
989
- const obj = arg1;
2281
+ const obj = getObject(arg1);
990
2282
  const ret = typeof(obj) === 'string' ? obj : undefined;
991
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2283
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
992
2284
  var len1 = WASM_VECTOR_LEN;
993
2285
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
994
2286
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
@@ -997,44 +2289,42 @@ function __wbg_get_imports() {
997
2289
  throw new Error(getStringFromWasm0(arg0, arg1));
998
2290
  },
999
2291
  __wbg_get_unchecked_33f6e5c9e2f2d6b2: function(arg0, arg1) {
1000
- const ret = arg0[arg1 >>> 0];
1001
- return ret;
2292
+ const ret = getObject(arg0)[arg1 >>> 0];
2293
+ return addHeapObject(ret);
1002
2294
  },
1003
2295
  __wbg_length_4a591ecaa01354d9: function(arg0) {
1004
- const ret = arg0.length;
2296
+ const ret = getObject(arg0).length;
1005
2297
  return ret;
1006
2298
  },
1007
2299
  __wbg_length_66f1a4b2e9026940: function(arg0) {
1008
- const ret = arg0.length;
2300
+ const ret = getObject(arg0).length;
1009
2301
  return ret;
1010
2302
  },
1011
2303
  __wbg_new_from_slice_18fa1f71286d66b8: function(arg0, arg1) {
1012
2304
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1013
- return ret;
2305
+ return addHeapObject(ret);
1014
2306
  },
1015
2307
  __wbg_new_with_length_36a4998e27b014c5: function(arg0) {
1016
2308
  const ret = new Uint8Array(arg0 >>> 0);
1017
- return ret;
2309
+ return addHeapObject(ret);
1018
2310
  },
1019
2311
  __wbg_prototypesetcall_3249fc62a0fafa30: function(arg0, arg1, arg2) {
1020
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
2312
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
1021
2313
  },
1022
2314
  __wbg_set_29c99a8aac1c01e5: function(arg0, arg1, arg2) {
1023
- arg0.set(getArrayU8FromWasm0(arg1, arg2));
2315
+ getObject(arg0).set(getArrayU8FromWasm0(arg1, arg2));
1024
2316
  },
1025
2317
  __wbindgen_cast_0000000000000001: function(arg0) {
1026
2318
  // Cast intrinsic for `U64 -> Externref`.
1027
2319
  const ret = BigInt.asUintN(64, arg0);
1028
- return ret;
2320
+ return addHeapObject(ret);
1029
2321
  },
1030
- __wbindgen_init_externref_table: function() {
1031
- const table = wasm.__wbindgen_externrefs;
1032
- const offset = table.grow(4);
1033
- table.set(0, undefined);
1034
- table.set(offset + 0, undefined);
1035
- table.set(offset + 1, null);
1036
- table.set(offset + 2, true);
1037
- table.set(offset + 3, false);
2322
+ __wbindgen_object_clone_ref: function(arg0) {
2323
+ const ret = getObject(arg0);
2324
+ return addHeapObject(ret);
2325
+ },
2326
+ __wbindgen_object_drop_ref: function(arg0) {
2327
+ takeObject(arg0);
1038
2328
  },
1039
2329
  };
1040
2330
  return {
@@ -1052,10 +2342,34 @@ const ApprovalTokenClaimsFinalization = (typeof FinalizationRegistry === 'undefi
1052
2342
  const ChainResultFinalization = (typeof FinalizationRegistry === 'undefined')
1053
2343
  ? { register: () => {}, unregister: () => {} }
1054
2344
  : new FinalizationRegistry(ptr => wasm.__wbg_chainresult_free(ptr, 1));
2345
+ const CloudTrailFeedVerdictFinalization = (typeof FinalizationRegistry === 'undefined')
2346
+ ? { register: () => {}, unregister: () => {} }
2347
+ : new FinalizationRegistry(ptr => wasm.__wbg_cloudtrailfeedverdict_free(ptr, 1));
2348
+ const CommitmentVerdictFinalization = (typeof FinalizationRegistry === 'undefined')
2349
+ ? { register: () => {}, unregister: () => {} }
2350
+ : new FinalizationRegistry(ptr => wasm.__wbg_commitmentverdict_free(ptr, 1));
2351
+ const MetricsVerdictFinalization = (typeof FinalizationRegistry === 'undefined')
2352
+ ? { register: () => {}, unregister: () => {} }
2353
+ : new FinalizationRegistry(ptr => wasm.__wbg_metricsverdict_free(ptr, 1));
1055
2354
  const VerifiedDelegationFinalization = (typeof FinalizationRegistry === 'undefined')
1056
2355
  ? { register: () => {}, unregister: () => {} }
1057
2356
  : new FinalizationRegistry(ptr => wasm.__wbg_verifieddelegation_free(ptr, 1));
1058
2357
 
2358
+ function addHeapObject(obj) {
2359
+ if (heap_next === heap.length) heap.push(heap.length + 1);
2360
+ const idx = heap_next;
2361
+ heap_next = heap[idx];
2362
+
2363
+ heap[idx] = obj;
2364
+ return idx;
2365
+ }
2366
+
2367
+ function dropObject(idx) {
2368
+ if (idx < 1028) return;
2369
+ heap[idx] = heap_next;
2370
+ heap_next = idx;
2371
+ }
2372
+
1059
2373
  function getArrayU8FromWasm0(ptr, len) {
1060
2374
  ptr = ptr >>> 0;
1061
2375
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
@@ -1081,6 +2395,13 @@ function getUint8ArrayMemory0() {
1081
2395
  return cachedUint8ArrayMemory0;
1082
2396
  }
1083
2397
 
2398
+ function getObject(idx) { return heap[idx]; }
2399
+
2400
+ let heap = new Array(1024).fill(undefined);
2401
+ heap.push(undefined, null, true, false);
2402
+
2403
+ let heap_next = heap.length;
2404
+
1084
2405
  function isLikeNone(x) {
1085
2406
  return x === undefined || x === null;
1086
2407
  }
@@ -1129,10 +2450,10 @@ function passStringToWasm0(arg, malloc, realloc) {
1129
2450
  return ptr;
1130
2451
  }
1131
2452
 
1132
- function takeFromExternrefTable0(idx) {
1133
- const value = wasm.__wbindgen_externrefs.get(idx);
1134
- wasm.__externref_table_dealloc(idx);
1135
- return value;
2453
+ function takeObject(idx) {
2454
+ const ret = getObject(idx);
2455
+ dropObject(idx);
2456
+ return ret;
1136
2457
  }
1137
2458
 
1138
2459
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
@@ -1171,7 +2492,6 @@ function __wbg_finalize_init(instance, module) {
1171
2492
  wasmModule = module;
1172
2493
  cachedDataViewMemory0 = null;
1173
2494
  cachedUint8ArrayMemory0 = null;
1174
- wasm.__wbindgen_start();
1175
2495
  return wasm;
1176
2496
  }
1177
2497