/** * Install-manifest fetching + validation for the codexpethub CLI. * * The manifest is the canonical agent-facing artifact described in * architecture §9.1 ("codexpethub.install.v1"). The CLI mirrors the same * security posture the Worker enforces server-side: schema_version must be * pinned, every file URL must live on a small allow-list of hosts, and any * response outside `application/json` is rejected. * * Zero runtime dependencies — `node:https` / `node:http` only. */ export declare const MANIFEST_SCHEMA_VERSION = "codexpethub.install.v1"; export declare const DEFAULT_REGISTRY_URL = "https://codexpethub.com"; export declare class ManifestError extends Error { readonly code: ManifestErrorCode; constructor(code: ManifestErrorCode, message: string); } export type ManifestErrorCode = "host_not_allowed" | "network_error" | "http_error" | "content_type_invalid" | "schema_version_mismatch" | "manifest_invalid" | "manifest_too_large"; export interface ManifestFile { role: "pet_json" | "spritesheet"; path: string; url: string; content_type: string; size: number; sha256: string; } export interface InstallManifest { schema_version: typeof MANIFEST_SCHEMA_VERSION; site: string; generated_at: string; pet: { id: string; slug: string; display_name: string; version: number; canonical_url: string; description: string; license: string; author_name: string | null; }; format: { kind: string; required_files: readonly string[]; atlas: { width: number; height: number; columns: number; rows: number; cell_width: number; cell_height: number; }; states: Array<{ name: string; row: number; frames: number; }>; }; files: ManifestFile[]; security: { execute_code: boolean; allow_external_urls_in_pet_json: boolean; verify_hashes_required: boolean; allowed_install_files: readonly string[]; }; human_instructions: { after_install: string; }; } export interface FetchOptions { /** * Override for unit tests — receives the request URL and returns the raw * body + headers. When omitted the function uses node:https / node:http. */ fetchImpl?: (url: URL) => Promise; } export interface HttpResponse { status: number; contentType: string | undefined; body: Buffer; } /** * Returns true when the URL is safe to download from per the CLI's * host allow-list. Production traffic is locked to HTTPS on the two * canonical hosts; local development and tests may use HTTP/HTTPS on * loopback hostnames. */ export declare function isAllowedHost(url: URL): boolean; /** * Parses a registry URL string and returns the validated URL object. * Throws ManifestError(host_not_allowed) if the URL is not on the allow-list. */ export declare function resolveRegistryUrl(raw: string): URL; /** * Fetches the install manifest for a slug from the given registry URL, * validates schema_version and host allow-list on every file URL, then * returns the parsed manifest. */ export declare function fetchInstallManifest(slug: string, registryUrl?: string, options?: FetchOptions): Promise; /** * Type-guards an arbitrary object as an InstallManifest. Throws * ManifestError on any structural mismatch. Also enforces the host * allow-list on every file URL. */ export declare function validateManifest(input: unknown): InstallManifest; //# sourceMappingURL=manifest.d.ts.map