/** * Shared response envelope + error mapping for the web server. * Mirrors the CLI envelope shape: { ok: true, data } | { ok: false, code, message }. */ import type { Context } from "hono"; import type { z } from "zod"; export type Envelope = { ok: true; data: unknown; } | { ok: false; code: string; message: string; }; export declare function ok(data: unknown): Envelope; export declare function fail(code: string, message: string): Envelope; /** * Runs a handler and maps the result to the envelope + HTTP status. * DagError codes containing NOT_FOUND map to 404, known conflict codes to 409, * other DagErrors to 400, unknown errors to 500. */ export declare function respond(c: Context, fn: () => Promise, successStatus?: 200 | 201 | 202): Promise; /** * Returns the project directory, throwing DagError if the project does not exist. */ export declare function assertProjectSlug(slug: string): void; export declare function requireProjectDir(slug: string): string; /** * Parses and validates a JSON request body against a zod schema. * Throws ZodError (mapped to 400 INVALID_BODY by respond()). */ export declare function parseBody(c: Context, schema: S): Promise>; //# sourceMappingURL=respond.d.ts.map