/** * Trusted advisory guide manifest: types, canonical encoding, and parsing. * * A manifest is a signed, time-boxed bundle of advisory guide bindings. Each * entry binds a stable guide id to the SHA-256 digest of its advisory text, so * the advisory content can be fetched separately and verified against the * signed manifest. Manifests are advisory text only: they never carry * instructions to execute or configuration to apply. */ export declare const GUIDES_MANIFEST_VERSION = 1; /** Maximum byte length of a single advisory text file. */ export declare const GUIDE_ADVISORY_MAX_BYTES: number; /** Maximum number of guides bound by a single manifest. */ export declare const GUIDE_MANIFEST_MAX_ENTRIES = 256; /** Maximum manifest JSON byte length (enforced at fetch and cache read time). */ export declare const GUIDE_MANIFEST_MAX_BYTES: number; export declare const GUIDE_ID_MAX_LENGTH = 128; export declare const GUIDE_TITLE_MAX_LENGTH = 256; export interface GuideEntryV1 { /** Path-safe, stable guide id, e.g. "troubleshooting/socket". */ id: string; /** Human-readable advisory title. */ title: string; /** Hex SHA-256 of the advisory text bytes; binds content to the signed manifest. */ sha256: string; } export interface GuideManifestV1 { version: 1; /** Stable channel identity the signature binds to; the rollback floor is per manifestId. */ manifestId: string; /** Key id of the pinned Ed25519 public key that detached-signed the canonical manifest bytes. */ keyId: string; /** Monotonic per-manifestId sequence; the cache refuses installs at or below the floor. */ sequence: number; /** Milliseconds since epoch; the manifest is not authoritative before this instant. */ issuedAt: number; /** Milliseconds since epoch; the manifest is not authoritative after this instant. */ expiresAt: number; /** Minimum SDK advisory client version required to consume this manifest. */ minimumSdkVersion: number; guides: GuideEntryV1[]; } /** * Deterministic UTF-8 encoding of a guide manifest. Object keys are sorted, * separators are compact, and the output is byte-identical for semantically * equal manifests regardless of the original JSON formatting. The detached * Ed25519 signature is verified over exactly these bytes, so a re-formatted * manifest file still verifies while any semantic change breaks the signature. */ export declare function canonicalGuideManifestBytes(manifest: GuideManifestV1): Buffer; export type GuideManifestParseResult = { ok: true; manifest: GuideManifestV1; } | { ok: false; error: { code: "invalid_manifest" | "unsupported_version"; message: string; }; }; /** * Strict shape validation for a parsed manifest value. Fails closed on any * out-of-bounds field; a manifest for a newer format version is refused with * `unsupported_version` so callers can distinguish "too new" from "malformed". */ export declare function parseGuideManifest(value: unknown): GuideManifestParseResult;