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

+10 -9
View File
@@ -86,7 +86,7 @@ export function fromBrowserError(e: unknown): unknown {
case "rate_limited":
return new BrowserServiceError("rate_limited", e.message);
default:
return new BrowserServiceError("upstream", `浏览器服务不可用:${e.message}`);
return new BrowserServiceError("upstream", `浏览器服务不可用:${e.message}`);
}
}
@@ -218,7 +218,8 @@ export class BrowserService {
.where("kind", "<>", "none");
if (id) q = q.where("id", "=", id);
const row = await q.orderBy("created_at").executeTakeFirst();
if (!row) throw new BrowserServiceError("precondition", "没有启用的浏览器服务(camofox),见 docs/runbook/browser.md");
if (!row)
throw new BrowserServiceError("precondition", "没有启用的浏览器服务(camofox),见 docs/runbook/browser.md");
return row;
}
@@ -329,13 +330,13 @@ export class BrowserService {
.executeTakeFirst();
if (!prow?.enabled) {
await this.closeRow(row, "provider_disabled");
throw new BrowserServiceError("precondition", "浏览器服务已停用,会话已关闭");
throw new BrowserServiceError("precondition", "浏览器服务已停用,会话已关闭");
}
const site = await this.liveSite(row.site_id).catch(() => null);
if (!site?.enabled) {
// 站点关闭即停止其网络访问(REQ §4.6、§4.7.3)
await this.closeRow(row, "site_disabled", prow);
throw new BrowserServiceError("precondition", "站点已停用,浏览器会话已关闭");
throw new BrowserServiceError("precondition", "站点已停用,浏览器会话已关闭");
}
const provider = this.providerFor(prow);
if (!provider.sessionInfo(row.id)) {
@@ -611,8 +612,8 @@ export class BrowserService {
kind: "other",
status: "awaiting_user",
severity: "warning",
title: `${site?.name ?? "站点"}:原站需要人工处理`,
summary: `${REASON_TEXT[reason] ?? reason}。在站点详情的原站视图接管会话,完成后交还。`,
title: `${site?.name ?? "站点"}:原站需要人工处理`,
summary: `${REASON_TEXT[reason] ?? reason}。在站点详情的原站视图接管会话,完成后交还。`,
subject_type: "browser_session",
subject_id: row.id,
dedupe_key: `browser.waiting:${row.id}`,
@@ -783,8 +784,8 @@ export class BrowserService {
throw new BrowserServiceError(
"conflict",
row.controller === "human"
? "会话正由人工接管,自动化动作已停止"
: `会话在等待人工处理(${REASON_TEXT[rs.waitingReason ?? ""] ?? rs.waitingReason ?? "未知原因"}),自动化动作已停止`,
? "会话正由人工接管,自动化动作已停止"
: `会话在等待人工处理(${REASON_TEXT[rs.waitingReason ?? ""] ?? rs.waitingReason ?? "未知原因"}),自动化动作已停止`,
);
}
}
@@ -803,7 +804,7 @@ export class BrowserService {
if (e instanceof BrowserError && e.kind === "not_found" && e.httpStatus === 404) {
const r = await loaded.provider.reconcileTabs(id).catch(() => null);
await this.persist(id, loaded.provider, { needsSnapshot: true });
if (r?.lost.length) throw new BrowserServiceError("conflict", "标签页已被浏览器服务回收,重新打开页面");
if (r?.lost.length) throw new BrowserServiceError("conflict", "标签页已被浏览器服务回收,重新打开页面");
}
await this.persist(id, loaded.provider).catch(() => {});
throw fromBrowserError(e);