/**
 * Type guard for successful tool responses
 */
export function isToolSuccess(response) {
    return response.type === 'success';
}
/**
 * Type guard for error tool responses
 */
export function isToolError(response) {
    return response.type === 'error';
}
/**
 * Type guard for warning tool responses
 */
export function isToolWarning(response) {
    return response.type === 'warning';
}
/**
 * Type guard for progress tool responses
 */
export function isToolProgress(response) {
    return response.type === 'progress';
}
/**
 * Type guard for successful Result
 */
export function isOk(result) {
    return result.ok;
}
/**
 * Type guard for failed Result
 */
export function isErr(result) {
    return !result.ok;
}
/**
 * Creates a successful Result
 */
export function ok(value) {
    return { ok: true, value };
}
/**
 * Creates a failed Result
 */
export function err(error) {
    return { ok: false, error };
}
/**
 * Unwraps a Result, throwing if it's an error
 */
export function unwrap(result) {
    if (result.ok) {
        return result.value;
    }
    throw result.error;
}
/**
 * Unwraps a Result, returning a default value if it's an error
 */
export function unwrapOr(result, defaultValue) {
    return result.ok ? result.value : defaultValue;
}
/**
 * Maps a successful Result to a new value
 */
export function map(result, fn) {
    return result.ok ? { ok: true, value: fn(result.value) } : result;
}
/**
 * Maps an error Result to a new error
 */
export function mapErr(result, fn) {
    return result.ok ? result : { ok: false, error: fn(result.error) };
}
//# sourceMappingURL=types.js.map