import { OutfitterError, Result } from "@outfitter/contracts"; import { ZodType } from "zod"; /** A single block entry in the manifest. */ interface BlockEntry { /** ISO 8601 timestamp of when the block was installed or last updated. */ installedAt: string; /** Tooling version the block was installed from. */ installedFrom: string; } /** The full manifest structure. */ interface Manifest { /** Map of block name to install metadata. */ blocks: Record; /** Manifest format version. Currently always 1. */ version: 1; } /** * Schema for a single block entry in the manifest. */ declare const BlockEntrySchema: ZodType; /** * Schema for the manifest file. */ declare const ManifestSchema: ZodType; /** * Reads and validates `.outfitter/manifest.json`. * * @param cwd - Working directory containing the `.outfitter/` folder * @returns The parsed manifest, or `null` if the file does not exist * * @example * ```typescript * const result = await readManifest(process.cwd()); * if (result.isOk() && result.value) { * console.log(result.value.blocks); * } * ``` */ declare function readManifest(cwd: string): Promise>; /** * Writes a manifest to `.outfitter/manifest.json`. * * Creates the `.outfitter/` directory if it does not exist. * Writes atomically via `Bun.write`. * * @param cwd - Working directory to write the manifest into * @param manifest - The manifest data to write * * @example * ```typescript * await writeManifest(process.cwd(), { version: 1, blocks: {} }); * ``` */ declare function writeManifest(cwd: string, manifest: Manifest): Promise>; /** * Adds or updates a block entry in the manifest (read-modify-write). * * If no manifest exists, creates a new one. If the block already exists, * updates its `installedFrom` and `installedAt` fields. * * @param cwd - Working directory containing the project * @param blockName - Name of the block to stamp * @param toolingVersion - Version of the tooling package the block was installed from * * @example * ```typescript * await stampBlock(process.cwd(), "biome", "0.2.1"); * ``` */ declare function stampBlock(cwd: string, blockName: string, toolingVersion: string): Promise>; export { writeManifest, stampBlock, readManifest, ManifestSchema, Manifest, BlockEntrySchema, BlockEntry };