trustedIn
Who a codebase trusts the attestations of, from its history.
import { trustPath } from "#codebase/tcmts/cli/attest"; import type { Trusted } from "#codebase/tcmts/cli/attest"; import type { Codebase } from "#codebase/tcmts/cli/codebase"; export function trustedIn(cb: Codebase): Trusted[] { const [hash] = cb.store.hashesAt(trustPath(cb)); if (!hash) return []; try { const v = JSON.parse(cb.store.getDef(hash)?.sourceText ?? "[]") as unknown; return Array.isArray(v) ? v.filter((t): t is Trusted => !!t && typeof (t as Trusted).did === "string") : []; } catch { return []; } }