feat(telegram): persist callback owner review snapshots
This commit is contained in:
@@ -328,6 +328,7 @@ interface KmStaleCallbackOwnerReviewTriage {
|
||||
|
||||
interface KmStaleCompletionSummary {
|
||||
schema_version?: string;
|
||||
source_schema_version?: string | null;
|
||||
project_id?: string | null;
|
||||
incident_id?: string | null;
|
||||
status?: string | null;
|
||||
@@ -346,6 +347,7 @@ interface KmStaleCompletionSummary {
|
||||
related_total?: number;
|
||||
related_items?: KmStaleCompletionSummaryItem[];
|
||||
work_item?: KmStaleCallbackOwnerReviewWorkItem | null;
|
||||
triage?: KmStaleCallbackOwnerReviewTriage | null;
|
||||
}
|
||||
|
||||
interface CallbackReplyEvent {
|
||||
@@ -369,6 +371,7 @@ interface CallbackReplyEvent {
|
||||
run_detail_href?: string | null;
|
||||
awooop_status_chain?: AwoooPStatusChain | null;
|
||||
km_stale_completion_summary?: KmStaleCompletionSummary | null;
|
||||
persisted_km_stale_completion_summary?: KmStaleCompletionSummary | null;
|
||||
}
|
||||
|
||||
interface CallbackRepliesResponse {
|
||||
@@ -1587,6 +1590,58 @@ function CallbackKmCompletionSummary({
|
||||
);
|
||||
}
|
||||
|
||||
function CallbackKmCompletionSnapshot({
|
||||
snapshot,
|
||||
}: {
|
||||
snapshot?: KmStaleCompletionSummary | null;
|
||||
}) {
|
||||
const t = useTranslations("awooop.callbackReply.events.kmCompletion");
|
||||
if (!snapshot) return null;
|
||||
|
||||
const statusKey = normalizeKmCompletionStatus(snapshot.status);
|
||||
const triage = snapshot.triage ?? null;
|
||||
|
||||
return (
|
||||
<div className="mt-3 border-t border-[#e0ddd4] pt-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<ShieldCheck className="h-3.5 w-3.5 text-[#1f5b9b]" aria-hidden="true" />
|
||||
<p className="text-xs font-semibold text-[#141413]">
|
||||
{t("snapshotTitle")}
|
||||
</p>
|
||||
</div>
|
||||
<div className="mt-2 grid gap-1 text-xs leading-5 text-[#5f5b52]">
|
||||
<p>
|
||||
{t("snapshotStatus", {
|
||||
status: t(`statuses.${statusKey}` as never),
|
||||
ready: snapshot.ready_count ?? 0,
|
||||
blocked: snapshot.blocked_count ?? 0,
|
||||
completed: snapshot.completed_count ?? 0,
|
||||
failed: snapshot.failed_count ?? 0,
|
||||
})}
|
||||
</p>
|
||||
{triage ? (
|
||||
<>
|
||||
<p>
|
||||
{t("snapshotFlow", {
|
||||
stage: triage.flow_stage ?? "--",
|
||||
strategy: triage.matching_strategy ?? "--",
|
||||
})}
|
||||
</p>
|
||||
<p>
|
||||
{t("snapshotAutomation", {
|
||||
lead: triage.ai_lead_agent ?? "--",
|
||||
state: triage.automation_state ?? "--",
|
||||
safe: String(triage.safe_to_auto_repair ?? false),
|
||||
blocker: triage.blocking_reason ?? "--",
|
||||
})}
|
||||
</p>
|
||||
</>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function CallbackReplyEvidencePanel({
|
||||
events,
|
||||
total,
|
||||
@@ -1680,6 +1735,9 @@ function CallbackReplyEvidencePanel({
|
||||
<CallbackKmCompletionSummary
|
||||
summary={event.km_stale_completion_summary}
|
||||
/>
|
||||
<CallbackKmCompletionSnapshot
|
||||
snapshot={event.persisted_km_stale_completion_summary}
|
||||
/>
|
||||
<Link
|
||||
href={runHref as never}
|
||||
className="mt-3 inline-flex items-center gap-1.5 border border-[#d8d3c7] bg-[#faf9f3] px-2 py-1 text-xs font-semibold text-[#2e2b26] hover:border-[#1f6feb] hover:bg-[#edf4ff] hover:text-[#0f4fa8]"
|
||||
|
||||
Reference in New Issue
Block a user