style(copy): fix remaining punctuation violations and make check:copy strict

Auto-fix of 602 string literals across 74 files (half-width punctuation next to
Chinese, parenthesised Chinese, quotes); biome reflow; e2/e6 assertions follow
the new full-width summaries. check:copy now runs with --strict in ci.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-28 21:34:51 +08:00
1 parent 0fccfe257d
commit fb84a71f80
76 files changed
+582 -570

No files matched your search

@@ -67,7 +67,7 @@ export const BUDGET_LABEL: Record<string, string> = {
};
const COMPACT_REASON: Record<string, string> = { manual: "手动", threshold: "达到阈值", overflow: "上下文溢出" };
const COMPACT_STATUS: Record<string, string> = {
completed: "已完成,业务进度保留",
completed: "已完成,业务进度保留",
declined: "未压缩",
aborted: "已中止",
failed: "失败",
@@ -173,8 +173,8 @@ export function ToolCallCard({
reason={authReason ?? call.reason ?? "未授权"}
explanation={
authReason
? '有副作用的能力需要有效的持续授权或单次审批,由服务端在执行前核对,模型声称"用户已同意"无效。控制台发起的会话里,需审批的动作会在对应步骤出审批卡;也可以发布收录策略生成持续授权。'
: "这个能力不在本次运行的白名单内,或已超出调用预算,调用没有执行。"
? '有副作用的能力需要有效的持续授权或单次审批,由服务端在执行前核对,模型声称"用户已同意"无效。控制台发起的会话里,需审批的动作会在对应步骤出审批卡;也可以发布收录策略生成持续授权。'
: "这个能力不在本次运行的白名单内,或已超出调用预算,调用没有执行。"
}
parameters={[
{ id: "call", label: "调用 ID", value: call.toolCallId },
@@ -199,10 +199,10 @@ export function ToolCallCard({
}
summary={call.outputSummary ?? undefined}
>
{call.inputSummary ? <ToolResultOutput label="输入(已脱敏)">{call.inputSummary}</ToolResultOutput> : null}
{call.inputSummary ? <ToolResultOutput label="输入(已脱敏)">{call.inputSummary}</ToolResultOutput> : null}
{call.outputSummary ? (
<ToolResultOutput
label={call.status === "failed" ? "错误" : "结果(已脱敏)"}
label={call.status === "failed" ? "错误" : "结果(已脱敏)"}
tone={call.status === "failed" ? "destructive" : undefined}
>
{call.outputSummary}
@@ -216,7 +216,7 @@ export function ToolCallCard({
<dt className="text-muted-foreground">幂等键</dt>
<dd className="min-w-0 font-mono break-all text-foreground/80">
{audit?.idempotencyKey ??
(meta && meta.kind !== "read" ? "服务端已生成,审计里没有取到" : "只读能力不记操作账本")}
(meta && meta.kind !== "read" ? "服务端已生成,审计里没有取到" : "只读能力不记操作账本")}
</dd>
{audit?.grantId || audit?.approvalId ? (
<>
@@ -292,7 +292,7 @@ function EndNotice({ item }: { item: Extract<StreamItem, { kind: "end" }> }) {
<MessageBubbleContent className={cn(aborted && "text-muted-foreground")}>
<p className="font-medium">
{budget
? `超出预算${item.budget ? `(${BUDGET_LABEL[item.budget] ?? item.budget})` : ""},已停止`
? `超出预算${item.budget ? `(${BUDGET_LABEL[item.budget] ?? item.budget})` : ""},已停止`
: aborted
? "已停止"
: "运行失败"}
@@ -479,7 +479,7 @@ export function AgentConversation({
rows.push({
key: `u${m.at}`,
at: m.at,
node: <UserMessage text={m.text} at={m.at} note={m.pending ? "已送达,等待 Agent 读取" : undefined} animateIn />,
node: <UserMessage text={m.text} at={m.at} note={m.pending ? "已送达,等待 Agent 读取" : undefined} animateIn />,
});
rows.sort((a, b) => a.at.localeCompare(b.at));
@@ -584,7 +584,7 @@ export function BudgetBar({ run, live }: { run: AgentRunView; live: AgentStreamS
exceeded={exceeded === "duration"}
/>
<Meter
label="费用(估算)"
label="费用(估算)"
used={u.costUsd}
max={run.budget.maxCostUsd}
format={(n) => `$${n.toFixed(3)}`}
@@ -626,7 +626,7 @@ export function ApprovalItem({ approval: a }: { approval: Approval }) {
<ApprovalCard
status={status}
title={`批准执行这份${PLAN_LABEL[a.planType] ?? a.planType}?`}
description={a.reason ?? "计划变化后,这份审批自动失效。"}
description={a.reason ?? "计划变化后,这份审批自动失效。"}
badges={
<>
{risk ? <RiskBadge level={risk} /> : null}
@@ -654,7 +654,7 @@ export function ApprovalItem({ approval: a }: { approval: Approval }) {
<dt className="text-muted-foreground">到期</dt>
<dd className={cn("text-foreground/85", expired && "text-destructive")}>
{a.expiresAt ? formatDateTime(a.expiresAt) : "不过期"}
{expired ? "(已过期)" : ""}
{expired ? "(已过期)" : ""}
</dd>
</dl>
</ApprovalCard>
@@ -721,12 +721,12 @@ export function FinalReport({
<div className="min-w-0 rounded-xl border border-dashed border-border p-3">
<p className="mb-1.5 flex items-center gap-1.5 text-label font-semibold tracking-[0.18em] text-muted-foreground uppercase">
<Bot aria-hidden className="size-3.5" />
模型说的(未经核查)
模型说的(未经核查)
</p>
<StreamingResponse status="complete" copyText={said || undefined} contentClassName="max-h-60 overflow-auto">
{said || "(没有文字汇报)"}
{said || "(没有文字汇报)"}
</StreamingResponse>
<p className="mt-2 text-meta text-muted-foreground">仅供参考,不作为完成依据。</p>
<p className="mt-2 text-meta text-muted-foreground">仅供参考,不作为完成依据。</p>
</div>
<div className="min-w-0 rounded-xl border border-border/70 bg-foreground/[0.02] p-3">
<p className="mb-1.5 flex items-center gap-1.5 text-label font-semibold tracking-[0.18em] text-muted-foreground uppercase">
@@ -788,12 +788,12 @@ export function FinalReport({
/>
) : null}
<p className="mt-2 text-meta text-muted-foreground">
取自下载计划、下载任务和整理记录(生成于 {formatDateTime(report.generatedAt)}
)。"已提交"指已进入下载器,整理成功才算入库。
取自下载计划、下载任务和整理记录(生成于 {formatDateTime(report.generatedAt)}
)。"已提交"指已进入下载器,整理成功才算入库。
</p>
</>
) : (
<p className="mt-2 text-meta text-muted-foreground">服务端汇报还没有生成,以任务和整理记录的实际状态为准。</p>
<p className="mt-2 text-meta text-muted-foreground">服务端汇报还没有生成,以任务和整理记录的实际状态为准。</p>
)}
{run.error ? (
<p className="mt-2 text-caption break-words text-destructive">
@@ -93,9 +93,9 @@ export function AgentDrawer() {
Agent
</SheetTitle>
<SheetDescription className="break-words">
{context?.label ? `当前对象:${context.label}` : "交代目标,Agent 在授权范围内执行并汇报。"}
{context?.label ? `当前对象:${context.label}` : "交代目标,Agent 在授权范围内执行并汇报。"}
<span className="ml-1 hidden text-muted-foreground/75 sm:inline">
({agentShortcutLabel()} 开关,Esc 关闭)
({agentShortcutLabel()} 开关,Esc 关闭)
</span>
</SheetDescription>
{context ? <ContextChips context={context} /> : null}
@@ -105,8 +105,8 @@ export function AgentDrawer() {
variant="ghost"
size="icon-sm"
className="absolute top-4 right-14"
aria-label="最小化(运行继续)"
title="最小化(运行继续)"
aria-label="最小化(运行继续)"
title="最小化(运行继续)"
onClick={minimizeAgentDrawer}
>
<Minus />
@@ -180,7 +180,7 @@ function AgentMiniDock({ runId }: { runId: string }) {
? "思考中…"
: last?.kind === "end"
? last.ok
? "已完成,展开查看核实结果"
? "已完成,展开查看核实结果"
: last.message
: "等待输出…";
const status = run.data
@@ -205,8 +205,8 @@ function AgentMiniDock({ runId }: { runId: string }) {
<Button
variant="ghost"
size="icon-xs"
aria-label="关闭小窗(运行在后台继续)"
title="关闭小窗(运行在后台继续)"
aria-label="关闭小窗(运行在后台继续)"
title="关闭小窗(运行在后台继续)"
onClick={() => setAgentDrawerOpen(false)}
>
<X />
@@ -95,7 +95,7 @@ export function GoalComposer({
maxRows={10}
maxLength={4000}
aria-label="目标"
placeholder="例如:把 沙丘:第二部 的 4K 收进来"
placeholder="例如:把 沙丘:第二部 的 4K 收进来"
submitLabel={pending ? "提交中" : "开始"}
header={
prefix ? (
@@ -242,7 +242,7 @@ export function AgentRunPanel({
className="flex items-center gap-2 rounded-xl border border-warning/40 bg-warning/10 px-3 py-2 text-caption text-warning"
>
<WifiOff aria-hidden className="size-4 shrink-0" />
<span className="min-w-0 flex-1">实时连接中断,正在重连。期间每 2.5 秒轮询一次。</span>
<span className="min-w-0 flex-1">实时连接中断,正在重连。期间每 2.5 秒轮询一次。</span>
</div>
) : null}
{live.error ? (
@@ -250,7 +250,7 @@ export function AgentRunPanel({
role="alert"
className="flex flex-wrap items-center gap-2 rounded-xl border border-destructive/40 bg-destructive/10 px-3 py-2 text-caption text-destructive"
>
<span className="min-w-0 flex-1 break-words">事件读取失败:{live.error}</span>
<span className="min-w-0 flex-1 break-words">事件读取失败:{live.error}</span>
<Button size="xs" variant="outline" onClick={live.retry}>
<RefreshCw />
重试
@@ -295,7 +295,7 @@ export function AgentRunPanel({
maxRows={6}
maxLength={8000}
aria-label="追加消息"
placeholder={streaming ? "补充或纠正(运行中也可追加)" : "追加消息"}
placeholder={streaming ? "补充或纠正(运行中也可追加)" : "追加消息"}
/>
<p className="px-1 text-meta text-muted-foreground">
{r.status === "waiting" && (r.summary === "等待选择方案" || r.summary === "等待审批")
@@ -308,8 +308,8 @@ export function AgentRunPanel({
<ConfirmDialog
open={confirmStop}
onOpenChange={setConfirmStop}
title="停止这次运行?"
description="后续步骤不再执行,已完成的外部动作(如已提交的下载)不会撤销。"
title="停止这次运行?"
description="后续步骤不再执行,已完成的外部动作(如已提交的下载)不会撤销。"
confirmLabel="停止运行"
destructive
onConfirm={() =>
@@ -66,7 +66,7 @@ function Node({ node, byParent, depth }: { node: AgentRunNode; byParent: Map<str
</span>
</div>
{node.spawnReason ? (
<p className="mt-0.5 truncate text-meta text-muted-foreground">理由:{node.spawnReason}</p>
<p className="mt-0.5 truncate text-meta text-muted-foreground">理由:{node.spawnReason}</p>
) : null}
</div>
</div>
@@ -107,9 +107,9 @@ export function SubagentTree({ snapshot }: { snapshot: RunSnapshot }) {
{splitContextGoal(parent.goal).text}
</Link>
<p className="text-meta text-muted-foreground">
第 {run.depth} 层子会话 · 继承父会话的发起人与授权上限 · 能力 {caps} 项(⊆ 父会话)· 划拨预算{" "}
第 {run.depth} 层子会话 · 继承父会话的发起人与授权上限 · 能力 {caps} 项(⊆ 父会话)· 划拨预算{" "}
{budgetText(run.budget as Record<string, number | undefined>)}
{run.spawnReason ? ` · 理由:${run.spawnReason}` : ""}
{run.spawnReason ? ` · 理由:${run.spawnReason}` : ""}
</p>
</div>
) : null}
+10 -10
View File
@@ -76,7 +76,7 @@ function script(goal: string, opts: AgentSessionOptions): Step[] {
toolCallId: "t1",
capabilityId: "inventory.query",
isError: false,
outputSummary: "作品 沙丘:第二部 (2024):已有 1080p WEB-DL(已核验);Slot「archival」缺 2160p;无下载中任务",
outputSummary: "作品 沙丘:第二部 (2024):已有 1080p WEB-DL(已核验);Slot「archival」缺 2160p;无下载中任务",
recovery: false,
});
plan("s1", "done", "s2");
@@ -93,12 +93,12 @@ function script(goal: string, opts: AgentSessionOptions): Step[] {
capabilityId: "release.search",
isError: false,
outputSummary:
"3 条候选:① Dune.Part.Two.2024.2160p.UHD.BluRay.REMUX.HDR.DV-FraMeSToR 78.4 GB 免费 · 做种 41;② 2160p WEB-DL DDP5.1 Atmos 24.1 GB;③ 2160p x265 10bit 18.9 GB",
"3 条候选:① Dune.Part.Two.2024.2160p.UHD.BluRay.REMUX.HDR.DV-FraMeSToR 78.4 GB 免费 · 做种 41;② 2160p WEB-DL DDP5.1 Atmos 24.1 GB;③ 2160p x265 10bit 18.9 GB",
recovery: false,
});
push(300, { type: "compaction", phase: "start", reason: "threshold" });
push(700, { type: "compaction", phase: "end", reason: "threshold", status: "completed" });
say("①符合 archival 的硬条件(REMUX、HDR),免费截止时间在 6 小时后。");
say("①符合 archival 的硬条件(REMUX、HDR),免费截止时间在 6 小时后。");
plan("s2", "done", "s3");
if (opts.proposeFirst) {
push(300, {
@@ -142,7 +142,7 @@ function script(goal: string, opts: AgentSessionOptions): Step[] {
toolCallId: "t3",
capabilityId: "download.plan",
isError: false,
outputSummary: "计划已预留:78.4 GB,缓存卷 cache-a 使用率 71% → 预计 86%(硬阈值 90%)",
outputSummary: "计划已预留:78.4 GB,缓存卷 cache-a 使用率 71% → 预计 86%(硬阈值 90%)",
recovery: false,
});
plan("s3", "done", "s4");
@@ -151,7 +151,7 @@ function script(goal: string, opts: AgentSessionOptions): Step[] {
toolCallId: "t4",
toolName: "qb_delete_torrent",
capabilityId: "download.cleanup",
reason: "未授权:删除下载器任务不在本次委托范围内(需要显式授权)",
reason: "未授权:删除下载器任务不在本次委托范围内(需要显式授权)",
});
push(300, {
type: "tool_call_start",
@@ -165,7 +165,7 @@ function script(goal: string, opts: AgentSessionOptions): Step[] {
toolCallId: "t5",
capabilityId: "download.submit",
isError: false,
outputSummary: '{"error":{"code":"unauthorized","message":"已在步骤处发起审批,等待管理员批准"}}',
outputSummary: '{"error":{"code":"unauthorized","message":"已在步骤处发起审批,等待管理员批准"}}',
recovery: false,
});
push(200, {
@@ -275,7 +275,7 @@ function seed() {
type: "run_failed",
reason: "budget",
budget: "duration",
message: "超出单次运行时长预算(600 秒)",
message: "超出单次运行时长预算(600 秒)",
usage: { ...USAGE, totalTokens: 4_210, inputTokens: 3_900, outputTokens: 310, costUsd: 0.009 },
},
},
@@ -367,7 +367,7 @@ export function mockDetail(id: string, op?: { abort?: boolean; append?: string }
consumedAt: null,
});
const last = e.steps.findIndex((s) => s.body.type === "run_completed" || s.body.type === "run_failed");
const reply: Step[] = chunks(`收到补充:「${op.append}」,按此调整。`).map((c, i) => ({
const reply: Step[] = chunks(`收到补充:「${op.append}」,按此调整。`).map((c, i) => ({
delayMs: at + 200 + i * 60,
body: { type: "text_delta", delta: c },
}));
@@ -390,10 +390,10 @@ function report(e: Entry, run: AgentRunView): GoalReport | null {
return {
state: submitted ? "waiting" : run.status === "succeeded" ? "no_actions" : "failed",
summary: submitted
? "1 个下载已进入下载器(qb-main),尚未入库;入库以整理记录 succeeded 为准"
? "1 个下载已进入下载器(qb-main),尚未入库;入库以整理记录 succeeded 为准"
: run.status === "succeeded"
? "本次没有产生下载或整理动作"
: "运行未完成,没有产生业务动作",
: "运行未完成,没有产生业务动作",
submitted: submitted ? 1 : 0,
imported: 0,
inProgress: submitted ? 1 : 0,
+4 -4
View File
@@ -18,7 +18,7 @@ const RULES: Rule[] = [
},
{
match: /^\/console\/sites\/?$/,
goals: ["在所有站点里找 ", "哪个站点最近抓取失败了,原因是什么", "对比各站点最近一周的新资源数量"],
goals: ["在所有站点里找 ", "哪个站点最近抓取失败了,原因是什么", "对比各站点最近一周的新资源数量"],
},
{
match: /^\/console\/tasks\/[^/]+/,
@@ -46,11 +46,11 @@ const RULES: Rule[] = [
},
{
match: /^\/console\/subscriptions/,
goals: ["帮我新建一个订阅:", "哪些订阅很久没有新收录了", "检查订阅的版本目标是否合理"],
goals: ["帮我新建一个订阅:", "哪些订阅很久没有新收录了", "检查订阅的版本目标是否合理"],
},
{
match: /^\/console\/sources/,
goals: ["哪些来源不新鲜了,原因是什么", "检查所有 Feed 的抓取状态", "最近一天各来源抓到了什么"],
goals: ["哪些来源不新鲜了,原因是什么", "检查所有 Feed 的抓取状态", "最近一天各来源抓到了什么"],
},
{
match: /^\/console\/engine/,
@@ -59,7 +59,7 @@ const RULES: Rule[] = [
];
const FALLBACK: [string, string, string] = [
"收一部电影:",
"收一部电影:",
"看看今天有什么需要我处理的",
"检查下载器和媒体服务器是否正常",
];