/**
 * Typed Error classes for the MCP pre-signed asset upload flow.
 *
 * The presign and finalize services throw these; `errorToMcpResult()` in
 * `mcp/tools.ts` maps each to a `fail()` envelope with a `code` discriminator
 * the agent can branch on. Generic `Error` thrown from the same call sites
 * fall through to the default "unknown" code. See ~/.claude/plans/
 * mcp-presigned-asset-upload.md decision R4.
 *
 * The `code` field is read by clients; the message is human-facing. Keep
 * codes stable across releases — agent prompts and downstream MCP-host UIs
 * key off them.
 */
export class AssetUploadError extends Error {
    /** Stable machine-readable identifier. Set by each subclass; the base
     *  class declares it so a generic catch can read `err.code` without a
     *  narrowing dance. */
    code = 'asset_upload_error';
    constructor(message) {
        super(message);
        this.name = this.constructor.name;
    }
}
export class InvalidMimeTypeError extends AssetUploadError {
    code = 'invalid_mime';
}
export class InvalidFilenameError extends AssetUploadError {
    code = 'invalid_filename';
}
export class ForbiddenError extends AssetUploadError {
    code = 'forbidden';
}
export class LocalBackendNotSupportedError extends AssetUploadError {
    code = 'local_backend';
}
export class TokenInvalidError extends AssetUploadError {
    code = 'token_invalid';
}
export class UploadNotReceivedError extends AssetUploadError {
    code = 'upload_not_received';
}
export class UploadValidationError extends AssetUploadError {
    code = 'upload_validation';
}
//# sourceMappingURL=asset-upload-errors.js.map