"use client"; import React, { useState, useRef, useEffect, useMemo } from "react"; import DiagnosticsView from "@/components/diagnostics-view"; import GraphUpdateView from "@/components/graph-update-view"; import SituationGraphView from "@/components/situation-graph-view"; import InvestigationSummaryPanel from "@/components/investigation-summary-panel"; import InvestigationMap from "@/components/investigation-map"; // ── Technical summary detector (main view filters these) ─── const TECHNICAL_PATTERNS = [ /nodes?\s*[:\d]/i, /edges?\s*[:\d]/i, /\b(?:unknown|observation|conclusion)\b\s/i, /\bsorted\b/i, /by_kind/i, /\b(?:node|edge|unknown|state)\s+count/i, ]; function isTechnicalSummary(summary) { if (!summary || typeof summary !== "string") return false; const trimmed = summary.trim(); if (!trimmed) return false; for (const p of TECHNICAL_PATTERNS) { if (p.test(trimmed)) return true; } return false; } // ── Recovery state components (Phase 2) ─────────────────────── function ProviderUnavailableCard({ onRestart }) { return (
The reasoning service could not be reached. This is usually temporary — check that the local model is running and try again.
{onRestart && ( )}The reasoning service returned a response we could not interpret. This may indicate a temporary issue with the model output format.
{onRestart && ( )}{stateName ? `The system is in an unexpected state (${stateName}).` : "An unexpected internal error occurred."} Please restart the investigation to continue.
Your previous investigation state is still saved. You can continue where you left off or start fresh.
{onRestart && ( )}{q}
{whyMattersText && ({whyMattersText}
)}The available evidence supports the following understanding.
{summary && ({summary}
{summary}
Further progress requires additional evidence.
{summary}
{summary}
{turn.answer}
{turn.acknowledgement && ({turn.acknowledgement}
)}{text}
{statusText}
This has been running for {elapsed}s. {variant === "initial" && elapsed >= 45 && ( This can take around a minute with the current local model. )}