@cygnuxlabs/tracekit 1.3.0 → 1.4.1

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.
@@ -1,7 +1,7 @@
1
1
  export { MAX_ENTRIES, MAX_ENTRY, MAX_TOTAL, Unusable, readZip } from "./zip.js";
2
2
  export { StrictJSONError, canonicalize, strictParse, strictParseBytes } from "./jcs.js";
3
3
  /** The bundle format version this verifier implements: a bundle needing a later one is UNVERIFIABLE. */
4
- export declare const VERSION = "1.3.0";
4
+ export declare const VERSION = "1.4.1";
5
5
  export declare const EXIT_OK = 0, EXIT_FAIL = 1, EXIT_BAD = 2, EXIT_WARN = 3;
6
6
  export type Check = {
7
7
  check: string;
@@ -16,19 +16,35 @@ export declare class Report {
16
16
  notes: string[];
17
17
  integrity: string;
18
18
  assurance: string;
19
+ /** The Findings line: signed findings, an opinion of the run kept apart from its integrity (null: none). */
20
+ findings: string | null;
19
21
  /** Checks the bundle needs that this verifier does not implement. */
20
22
  unsupported: string[];
21
23
  check(check: string, ok: boolean, detail?: string, problems?: string[], warn?: boolean): void;
22
24
  unsupport(what: string): void;
23
25
  }
24
26
  type J = any;
25
- /** Verify a v2 bundle (zip bytes) against the verifier's own pinned trust config (JSON bytes). Never throws. */
26
- export declare function verify(bundle: Uint8Array, trust: Uint8Array): Promise<{
27
+ /**
28
+ * Verify a v2 bundle (zip bytes) against the verifier's own pinned trust config (JSON bytes). Never throws. `names`: the
29
+ * files' paths, for the commands a bundle that needs a newer verifier is told to run. `trust` null (the browser page,
30
+ * when no trust config is chosen): every check that needs no pinned key, and never VERIFIED: a changed record still
31
+ * FAILS, and an intact bundle is UNVERIFIABLE, since anyone can sign a bundle and its checkpoint with keys of their own.
32
+ */
33
+ export declare function verify(bundle: Uint8Array, trust: Uint8Array | null, names?: {
34
+ bundle: string;
35
+ trust: string;
36
+ }): Promise<{
27
37
  report: Report;
28
38
  code: number;
29
39
  }>;
30
40
  /** §4: null when `r` is a v2 record signed by one of `keys` (SPKI DER) with an allowed algorithm that is the key's own,
31
41
  * else why not. */
32
42
  export declare function verifyRecord(r: J, keys: Uint8Array[], algs: string[]): Promise<string | null>;
33
- /** The report as text, as the reference CLI prints it; control characters in bundle-derived strings are dropped. */
43
+ /** {run file: its entries in order} of a bundle's `names`: the run's file, runs/<id>.jsonl, or its parts,
44
+ * runs/<id>.part-0001.jsonl, ..., whose records read in that order are the run's (format-v2.md §9). */
45
+ export declare function runFiles(names: Iterable<string>): Map<string, string[]>;
46
+ /** `x` without control characters and the bidirectional and zero-width format characters that would reorder or hide
47
+ * the text around them, as the report prints bundle-derived strings. */
48
+ export declare const clean: (x: string) => string;
49
+ /** The report as text, as the reference CLI prints it; `clean` drops characters from bundle-derived strings. */
34
50
  export declare function formatReport(rep: Report): string;