// engine/hooks/handlers/on-spec-change.ts — on-spec-change hook handler (SPEC-137)
// Triggered when spec files (planu/specs/**) change.
// ---------------------------------------------------------------------------
// Pattern matching
// ---------------------------------------------------------------------------
/**
 * Returns true for planu/specs/**\/*.md files.
 */
export function isSpecFile(filePath) {
    if (!filePath.startsWith('planu/specs/')) {
        return false;
    }
    if (!filePath.endsWith('.md')) {
        return false;
    }
    return true;
}
// ---------------------------------------------------------------------------
// Handler
// ---------------------------------------------------------------------------
/**
 * Handle a spec file change event.
 * Fire-and-forget — all errors are caught internally.
 */
export function handleOnSpecChange(event, projectPath) {
    try {
        if (!isSpecFile(event.path)) {
            return Promise.resolve();
        }
        console.warn(`[hooks] Spec change detected: ${event.path} (${event.type}) in ${projectPath}`);
    }
    catch (err) {
        console.warn(`[hooks] on-spec-change error for ${event.path}:`, err);
    }
    return Promise.resolve();
}
//# sourceMappingURL=on-spec-change.js.map