feat: add task records and verified engineering check jobs

This commit is contained in:
Agent Workbench Dev
2026-10-29 14:03:50 +08:00
parent 93f4d90ccb
commit 2ea34850c4
26 changed files with 2703 additions and 56 deletions
+6 -3
View File
@@ -1,5 +1,6 @@
import { useEffect, useRef } from 'react';
import type { ReactNode, ButtonHTMLAttributes } from 'react';
import { createPortal } from 'react-dom';
import { AlertTriangle, Check, ChevronRight, Circle, Clock3, FileCode2, LoaderCircle, RotateCw, ShieldQuestion, SquareTerminal, X, XCircle } from 'lucide-react';
import type { Change, ToolEvent, RuntimeFailure } from './types';
@@ -8,6 +9,8 @@ const statusNames: Record<string, string> = {
paused: '已暂停', failed: '需要处理', stopping: '正在停止', pending: '待审查', applied: '已应用',
rejected: '已撤回', conflict: '文件已变化', waiting: '等待确认', denied: '已拒绝', interrupted: '已中断',
retrying: '自动重试',
queued: '待执行', validating: '核对中', unknown: '结果待核对', unverified: '未验证',
not_configured: '尚未检查', passed: '检查通过', cancelled: '已取消', stale: '需重新检查',
};
export function Status({ value }: { value: string }) {
return <span className={'status status-' + value}><span className="status-dot" />{statusNames[value] || value}</span>;
@@ -34,12 +37,12 @@ export function Modal({ title, description, children, onClose, wide = false }: {
document.addEventListener('keydown', handle);
return () => { document.removeEventListener('keydown', handle); previous?.focus(); };
}, []);
return <div className="modal-backdrop" onMouseDown={event => { if (event.target === event.currentTarget) onClose(); }}>
return createPortal(<div className="modal-backdrop" onMouseDown={event => { if (event.target === event.currentTarget) onClose(); }}>
<div ref={panel} role="dialog" aria-modal="true" aria-label={title} className={'modal ' + (wide ? 'modal-wide' : '')}>
<div className="modal-heading"><div><h2>{title}</h2>{description && <p>{description}</p>}</div><IconButton label="关闭窗口" onClick={onClose}><X size={18} /></IconButton></div>
{children}
</div>
</div>;
</div>, document.body);
}
export function DiffView({ change }: { change: Change }) {
let before = 1, after = 1;
@@ -62,7 +65,7 @@ export function DiffView({ change }: { change: Change }) {
}
export function ToolRow({ event, selected = false, onSelect }: { event: ToolEvent; selected?: boolean; onSelect: () => void }) {
const phase = event.phase;
const Symbol = phase === 'waiting' ? ShieldQuestion : ['running', 'retrying'].includes(phase) ? LoaderCircle
const Symbol = ['waiting', 'unknown', 'unverified', 'queued', 'validating'].includes(phase) ? ShieldQuestion : ['running', 'retrying'].includes(phase) ? LoaderCircle
: ['failed', 'denied', 'interrupted'].includes(phase) ? XCircle : Check;
const detail = event.tool === 'run_command' ? String(event.input?.command || '')
: event.tool === 'read_file' || event.tool === 'propose_file' ? String(event.input?.path || '')