文案(智能体):停止 / 方案 / 子会话 / 压缩上下文等按术语表与 human-copy 重写
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
1 parent
0338037a96
commit
775d1589e4
16 files changed
+49
-49
No files matched your search
@@ -86,7 +86,7 @@ export const BUDGET_LABEL: Record<string, string> = {
|
||||
const COMPACT_STATUS: Record<string, string> = {
|
||||
completed: "已完成",
|
||||
declined: "没有压缩",
|
||||
aborted: "已中止",
|
||||
aborted: "已停止",
|
||||
failed: "失败",
|
||||
};
|
||||
|
||||
@@ -108,7 +108,7 @@ export function contextLabel(context: string | null): string | null {
|
||||
const first = context.split(" · ")[0] ?? "";
|
||||
// 前缀里第一段是界面给的名称(「作品:沙丘2」);没有名称时只剩 key=ID,不上屏
|
||||
if (!first || first.includes("=")) return null;
|
||||
return first.replace(/^(作品|资源|下载|整理记录|站点|任务|引擎任务)[::]\s*/, "");
|
||||
return first.replace(/^(作品|资源|下载|整理记录|站点|任务|引擎任务|后台任务)[::]\s*/, "");
|
||||
}
|
||||
|
||||
export function UserMessage({
|
||||
@@ -289,7 +289,7 @@ export function StepSummary({
|
||||
const thinking = activity.some((a) => a.kind === "thinking");
|
||||
const head = current
|
||||
? `${done ? `${done},` : ""}${runningText(current)}…`
|
||||
: done || (running ? "思考中…" : thinking ? "想了一下" : "过程说明");
|
||||
: done || (running ? "思考中…" : thinking ? "思考过程" : "过程说明");
|
||||
return (
|
||||
<div className="w-full min-w-0" data-slot="step-summary">
|
||||
<button
|
||||
@@ -365,7 +365,7 @@ export function DeniedLines({ runId, calls }: { runId: string; calls: ToolCallVi
|
||||
{
|
||||
onSuccess: () => {
|
||||
setSent((s) => new Set(s).add(c.capabilityId));
|
||||
toast.success("已批准,智能体重试这一步");
|
||||
toast.success("已批准,智能体会重试这一步");
|
||||
},
|
||||
onError: (e) => toast.error(errorMessage(e)),
|
||||
},
|
||||
@@ -399,7 +399,7 @@ function EndNotice({ item }: { item: Extract<StreamItem, { kind: "end" }> }) {
|
||||
<CircleSlash aria-hidden className="mt-0.5 size-3.5 shrink-0" />
|
||||
<span className="min-w-0 break-words">
|
||||
{budget
|
||||
? `超出预算(${BUDGET_LABEL[item.budget ?? ""] ?? "用量"}),已停止。已完成的动作不会撤销;调大预算后发消息可以继续。`
|
||||
? `超出预算(${BUDGET_LABEL[item.budget ?? ""] ?? "用量"}),已停止。已完成的操作不会撤销,调大预算后发消息可继续`
|
||||
: aborted
|
||||
? "已停止。"
|
||||
: `运行失败${item.message ? `:${humanizeReason(item.message) ?? item.message}` : ""}`}
|
||||
@@ -523,7 +523,7 @@ export function AgentConversation({
|
||||
<UserMessage text={run.goal} tag={isProposeFirst(run) ? "先给方案" : undefined} />
|
||||
{blocks.map((b, bi) =>
|
||||
b.kind === "user" ? (
|
||||
<UserMessage key={b.key} text={b.text} note={b.pending ? "已送达,等待智能体读取" : undefined} animateIn />
|
||||
<UserMessage key={b.key} text={b.text} note={b.pending ? "已发送,等智能体读取" : undefined} animateIn />
|
||||
) : (
|
||||
<section key={b.key} aria-label="智能体回合" className="flex w-full min-w-0 flex-col items-start gap-2">
|
||||
{b.parts.map((p, pi) => {
|
||||
@@ -587,7 +587,7 @@ export function AgentConversation({
|
||||
return (
|
||||
<MessageMarker key={p.key}>
|
||||
<Layers aria-hidden className="size-3.5 shrink-0" />
|
||||
整理上下文 ·{" "}
|
||||
压缩上下文 ·{" "}
|
||||
{p.item.done ? (COMPACT_STATUS[p.item.status ?? "completed"] ?? p.item.status) : "进行中…"}
|
||||
</MessageMarker>
|
||||
);
|
||||
@@ -626,7 +626,7 @@ function DraftCheckCard({ jobId, name }: { jobId: string; name: string }) {
|
||||
<CalendarCog aria-hidden className="size-4 shrink-0 text-muted-foreground" />
|
||||
巡检草稿「{name}」<StatusBadge>未启用</StatusBadge>
|
||||
</p>
|
||||
<p className="mt-0.5 text-meta text-muted-foreground">到计划页检查目标、间隔和能力,确认后打开开关启用。</p>
|
||||
<p className="mt-0.5 text-meta text-muted-foreground">在计划页检查目标、间隔和能力后启用。</p>
|
||||
</div>
|
||||
<Button asChild size="sm" variant="outline">
|
||||
<Link to={`${consolePath("schedules")}?job=${encodeURIComponent(jobId)}`}>检查并启用</Link>
|
||||
@@ -672,8 +672,8 @@ export function resultFacts(report: GoalReport | null): ResultFact[] {
|
||||
});
|
||||
}
|
||||
if (r.imported && r.imported !== done.length) facts.push({ text: `已整理 ${r.imported} 个` });
|
||||
if (r.inProgress) facts.push({ text: `${r.inProgress} 个还在进行` });
|
||||
if (r.failed) facts.push({ text: `${r.failed} 个没有成功`, tone: "warning" });
|
||||
if (r.inProgress) facts.push({ text: `${r.inProgress} 个进行中` });
|
||||
if (r.failed) facts.push({ text: `${r.failed} 个失败`, tone: "warning" });
|
||||
return facts.length ? facts : [{ text: "没有提交下载或整理" }];
|
||||
}
|
||||
|
||||
@@ -859,7 +859,7 @@ export function RunAnnouncer({ status, finished }: { status: AgentRunStatus; fin
|
||||
const [msg, setMsg] = useState("");
|
||||
const prev = useRef(status);
|
||||
useEffect(() => {
|
||||
if (prev.current !== status) setMsg(`运行${RUN_STATUS_LABEL[status]}`);
|
||||
if (prev.current !== status) setMsg(`会话${RUN_STATUS_LABEL[status]}`);
|
||||
prev.current = status;
|
||||
}, [status]);
|
||||
useEffect(() => {
|
||||
|
||||
Reference in new issue
Block a user