chore(workflow): 工作流相关代码中文文案全部英文化

源码(src/workflow/ + packages/workflow-engine/src/)的中文注释、
用户可见错误消息、字符串字面量;测试文件的标题与注释;同步 6 条
硬编码断言到英文化后的错误消息。

Co-Authored-By: glm-5.2 <zai-org@claude-code-best.win>
This commit is contained in:
claude-code-best
2026-06-14 15:48:29 +08:00
parent 490714dbcb
commit 4903f544b7
71 changed files with 1091 additions and 1077 deletions

View File

@@ -1,6 +1,6 @@
import type { AgentProgress, RunProgress } from '../progress/store.js'
/** run 状态 → 圆点字符(顶部 tab 用)。 */
/** run status -> dot character (used by top tab). */
export const STATUS_DOT: Record<RunProgress['status'], string> = {
running: '●',
completed: '✓',
@@ -8,7 +8,7 @@ export const STATUS_DOT: Record<RunProgress['status'], string> = {
killed: '■',
}
/** run 状态 → ink theme 颜色 token(沿用现有 WorkflowList 配色)。 */
/** run status -> ink theme color token (follows existing WorkflowList palette). */
export const RUN_STATUS_COLOR: Record<RunProgress['status'], string> = {
running: 'warning',
completed: 'success',
@@ -16,7 +16,7 @@ export const RUN_STATUS_COLOR: Record<RunProgress['status'], string> = {
killed: 'subtle',
}
/** run 状态 → 展示文字header 用;对齐参考图 done/running)。 */
/** run status -> display text (used by header; aligns with reference image done/running). */
export const RUN_STATUS_TEXT: Record<RunProgress['status'], string> = {
running: 'running',
completed: 'done',
@@ -24,7 +24,7 @@ export const RUN_STATUS_TEXT: Record<RunProgress['status'], string> = {
killed: 'killed',
}
/** phase 在侧栏的合并状态(含 pendingmeta 声明但未启动)。 */
/** merged phase status in the sidebar (includes pending: declared by meta but not started). */
export type PhaseStatus = 'running' | 'done' | 'pending'
export const PHASE_MARK: Record<PhaseStatus, string> = {
@@ -39,14 +39,14 @@ export const PHASE_COLOR: Record<PhaseStatus, string> = {
pending: 'subtle',
}
/** agent 行的视觉:标记字符 + 颜色running 由 UI 用 spinner 动画覆盖 mark */
/** visual for an agent row: mark character + color (running has the mark overridden by a spinner animation in UI). */
export type AgentVisual = { mark: string; color: string }
/**
* agent 状态 → 视觉。
* - running ● warningUI 用 spinner 动画覆盖 mark
* - done·dead ✗ error
* - done·ok ✓ success
* agent status -> visual.
* - running -> ● warning (UI overrides mark with spinner animation)
* - done·dead -> ✗ error
* - done·ok -> ✓ success
*/
export function agentVisual(a: AgentProgress): AgentVisual {
if (a.status === 'running') return { mark: '●', color: 'warning' }
@@ -54,15 +54,15 @@ export function agentVisual(a: AgentProgress): AgentVisual {
return { mark: '✓', color: 'success' }
}
/** token 数 → 展示字符串(<1000 原值;否则保留 1 位小数 + k)。 */
/** token count -> display string (<1000 keeps the raw value; otherwise keeps 1 decimal + k). */
export function formatTokenCount(n: number | undefined): string {
if (!n) return '0'
return n >= 1000 ? `${(n / 1000).toFixed(1)}k` : String(n)
}
/**
* agent 行右侧统计文本:`model · Nk tok · N tool`
* 无 model 时省略前段running 中 token/tool 由 agent_progress 实时刷新。
* right-side stats text for an agent row: `model · Nk tok · N tool`.
* Omits the prefix when there is no model; token/tool refresh in real time via agent_progress while running.
*/
export function agentMetaText(a: AgentProgress): string {
const parts: string[] = []