feat(agent): 用对话起草巡检(schedule.draft_check + 起草巡检 Skill + 计划页入口与对话卡片)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-10-03 00:04:31 +08:00
1 parent 8eb8a68295
commit 7c4ad901d9
14 files changed
+408 -7

No files matched your search

@@ -1,6 +1,6 @@
import { useQueryClient } from "@tanstack/react-query";
import { SCHEDULE_CHANGED_EVENT, type ScheduledJob } from "@umt/contracts";
import { AlertTriangle, Bot, CalendarClock, Plus } from "lucide-react";
import { AlertTriangle, Bot, CalendarClock, Plus, Sparkles } from "lucide-react";
import { type ReactNode, useEffect, useRef, useState } from "react";
import { useLocation } from "react-router";
import { usePiUpstreamModels, usePiUpstreams } from "~/api/pi.ts";
@@ -14,6 +14,7 @@ import { useSse } from "~/lib/sse.ts";
import { AgentCheckCard, type DefaultUpstream } from "./agent-check-card.tsx";
import { AgentCheckDialog } from "./agent-check-dialog.tsx";
import { AutoTaskList } from "./auto-task-list.tsx";
import { DraftCheckDialog } from "./draft-check-dialog.tsx";
import { formatUsd } from "./labels.ts";
import { RunsSheet } from "./runs-sheet.tsx";
@@ -101,6 +102,7 @@ export function PlanBoard({ highlightJob }: { highlightJob?: string }) {
const now = useNow();
const { hash } = useLocation();
const [editing, setEditing] = useState<{ job: ScheduledJob | null; key: number } | null>(null);
const [drafting, setDrafting] = useState(false);
const [history, setHistory] = useState<ScheduledJob | null>(null);
const data = board.data;
@@ -169,10 +171,16 @@ export function PlanBoard({ highlightJob }: { highlightJob?: string }) {
: "到点让智能体按目标检查并汇报。"
}
actions={
<Button size="sm" onClick={() => setEditing({ job: null, key: Date.now() })}>
<Plus />
新建巡检
</Button>
<>
<Button size="sm" variant="outline" onClick={() => setDrafting(true)}>
<Sparkles />
用对话起草
</Button>
<Button size="sm" onClick={() => setEditing({ job: null, key: Date.now() })}>
<Plus />
新建巡检
</Button>
</>
}
/>
{checks.length === 0 ? (
@@ -218,6 +226,7 @@ export function PlanBoard({ highlightJob }: { highlightJob?: string }) {
{editing ? (
<AgentCheckDialog key={editing.key} open job={editing.job} onOpenChange={(o) => !o && setEditing(null)} />
) : null}
{drafting ? <DraftCheckDialog open onOpenChange={setDrafting} /> : null}
<RunsSheet job={history} onClose={() => setHistory(null)} />
</>
);