- session page shows the agent.plan TodoList (drawer: one-line progress); options and approval cards sit at their step; composer has a "先看方案再执行" toggle instead of the mode switch - settings expose option timeout, timeout action and approval validity; quick goals follow glossary Co-Authored-By: Claude Opus 5.5 <[email protected]>
41 lines
1.7 KiB
TypeScript
41 lines
1.7 KiB
TypeScript
import type { AgentRunStatus } from "@umt/contracts";
|
|
import { ArrowLeft } from "lucide-react";
|
|
import { useState } from "react";
|
|
import { Link, useParams } from "react-router";
|
|
import { agentMockEnabled, useAgentRun } from "~/api/agent.ts";
|
|
import { AgentRunPanel } from "~/components/agent/agent-run-panel.tsx";
|
|
import { AgentSessionList } from "~/components/agent/agent-session-list.tsx";
|
|
import { PageHeader } from "~/components/console/page-header.tsx";
|
|
import { Button } from "~/components/ui/button.tsx";
|
|
|
|
export default function AgentRunPage() {
|
|
const { runId = "" } = useParams();
|
|
const run = useAgentRun(runId);
|
|
const mock = agentMockEnabled();
|
|
const [status, setStatus] = useState<"" | AgentRunStatus>("");
|
|
return (
|
|
<>
|
|
<PageHeader
|
|
title="Agent 会话"
|
|
description={run.data ? <span className="line-clamp-2 break-words">{run.data.run.goal}</span> : "加载中…"}
|
|
actions={
|
|
<Button asChild variant="ghost" size="sm">
|
|
<Link to={`/console/agent${mock ? "?mock=1" : ""}`}>
|
|
<ArrowLeft />
|
|
全部会话
|
|
</Link>
|
|
</Button>
|
|
}
|
|
/>
|
|
<div className="grid grid-cols-1 gap-4 lg:grid-cols-[minmax(0,17rem)_minmax(0,1fr)]">
|
|
<aside className="pg-slab hidden rounded-xl p-3 lg:block lg:h-[calc(100dvh-13rem)] lg:overflow-hidden">
|
|
<AgentSessionList activeId={runId} status={status} onStatusChange={setStatus} className="h-full" />
|
|
</aside>
|
|
<div className="pg-slab flex h-[calc(100dvh-11rem)] min-h-[32rem] flex-col rounded-xl p-3 md:p-4 lg:h-[calc(100dvh-13rem)]">
|
|
<AgentRunPanel key={runId} runId={runId} className="flex-1" />
|
|
</div>
|
|
</div>
|
|
</>
|
|
);
|
|
}
|