- 「未经核查」只在最终汇报左栏标题保留一处,删「仅供参考」与数据来源说明; 右栏改叫「实际结果」,去掉「运行已完成」「工具成功 N」徽章,计数只列非零项, 状态值用中文标签,不再显示计划 / 记录短 ID - 工具卡片只标会改数据的动作和中高风险;能力 ID、scope、幂等、耗时、调用 ID、 schema 入口收进技术信息;拒绝说明改成一句「要你批准」 - 用量只显示费用与时长,工具调用数、token、模型、会话 ID 进技术信息(超限时照常显示) - 会话标题 shortGoalTitle:去上下文前缀、UUID、JSON 参数,能力 ID 换中文名,取第一句,40 字截断 - 入口去口号:删「交代目标,边做边汇报」与抽屉里的重复快捷键说明 - 对话组件结构不动 Co-Authored-By: Claude Opus 5.5 <[email protected]>
50 lines
2.0 KiB
TypeScript
50 lines
2.0 KiB
TypeScript
import { ArrowLeft } from "lucide-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 { shortGoalTitle } from "~/components/agent/agent-store.ts";
|
|
import { PageHeader } from "~/components/console/page-header.tsx";
|
|
import { Button } from "~/components/ui/button.tsx";
|
|
|
|
// 会话页:左栏会话列表(xl 以上)· 中间会话列(统一最大宽度,输入区固定在底部)· 右侧栏状态/步骤/预算(lg 以上;
|
|
// 更窄时换成会话列顶部的可折叠概况条)。
|
|
export default function AgentRunPage() {
|
|
const { runId = "" } = useParams();
|
|
const run = useAgentRun(runId);
|
|
const mock = agentMockEnabled();
|
|
const suffix = mock ? "?mock=1" : "";
|
|
return (
|
|
<>
|
|
<PageHeader
|
|
title="智能体会话"
|
|
description={
|
|
run.data ? (
|
|
<span className="line-clamp-2 break-words" title={run.data.run.goal}>
|
|
{shortGoalTitle(run.data.run.goal)}
|
|
</span>
|
|
) : (
|
|
"加载中…"
|
|
)
|
|
}
|
|
actions={
|
|
<Button asChild variant="ghost" size="sm">
|
|
<Link to={`/console/agent${suffix}`}>
|
|
<ArrowLeft />
|
|
全部会话
|
|
</Link>
|
|
</Button>
|
|
}
|
|
/>
|
|
<div className="grid grid-cols-1 gap-4 xl:grid-cols-[minmax(0,16rem)_minmax(0,1fr)]">
|
|
<aside className="pg-slab hidden rounded-xl p-3 xl:block xl:h-[calc(100dvh-13rem)] xl:overflow-hidden">
|
|
<AgentSessionList activeId={runId} hrefFor={(id) => `/console/agent/${id}${suffix}`} 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>
|
|
</>
|
|
);
|
|
}
|