// SPDX-License-Identifier: GPL-2.0-or-later // Copyright (C) 2026 Bryan Joshua Pedini export type HarnessErrorKind = 'timeout' | 'spawn' | 'prerequisite' | 'protocol' | 'transport' | 'leak' | 'infrastructure'; export class HarnessError extends Error { readonly kind: HarnessErrorKind; readonly details?: unknown; constructor(kind: HarnessErrorKind, message: string, details?: unknown) { super(`[harness:${kind}] ${message}`); this.name = 'HarnessError'; this.kind = kind; this.details = details; } } export function isHarnessError(e: unknown): e is HarnessError { return e instanceof HarnessError; }