auto-sync: 2026-05-19 13:57:06

This commit is contained in:
cfdaily
2026-05-19 13:57:06 +08:00
parent 9a965bd9e6
commit c599d31270
@@ -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<string, string> = {
'pangtong-fujunshi': '🐦', 'simayi-challenger': '🦅', 'jiangwei-infra': '🔧',