From c599d3127060251de7b41f197001931c2b467aa4 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Tue, 19 May 2026 13:57:06 +0800 Subject: [PATCH] auto-sync: 2026-05-19 13:57:06 --- .../src/components/CheckpointPanel.tsx | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/components/CheckpointPanel.tsx b/src/frontend/src/components/CheckpointPanel.tsx index bd67c0b..1264255 100644 --- a/src/frontend/src/components/CheckpointPanel.tsx +++ b/src/frontend/src/components/CheckpointPanel.tsx @@ -1,7 +1,41 @@ -import { useState } from 'react'; +import { useState, useEffect } from 'react'; import { api } from '../api'; import { useStore } from '../store'; -import type { CheckpointInfo, HumanInputCheckpoint } from '../api'; + +// ── 类型定义(对齐后端 checkpoints 表) ── + +interface Checkpoint { + id: string; + task_id: string; + type: 'verify' | 'decision' | 'action'; + title: string; + description: string | null; + status: 'pending' | 'approved' | 'rejected'; + payload: string; // JSON string + created_at: string; + resolved_at: string | null; + resolved_by: string | null; + resolve_note: string | null; +} + +// payload 结构 +type VerifyPayload = { + version: 1; + auto_checks?: { label: string; passed: boolean }[]; + human_steps?: string[]; + preview_url?: string; +}; + +type DecisionPayload = { + version: 1; + options: { id: string; label: string; desc?: string; pros?: string[]; cons?: string[]; recommended?: boolean }[]; +}; + +type ActionPayload = { + version: 1; + steps: { id: string; desc: string; command?: string }[]; + verify_command?: string; +}; const AGENT_EMOJI: Record = { 'pangtong-fujunshi': '🐦', 'simayi-challenger': '🦅', 'jiangwei-infra': '🔧',