Prechádzať zdrojové kódy

feat(i18n): 全面汉化项目用户可见文本

本批翻译覆盖了 19 个文件,共计 ~335 行用户英文字符串替换为中文。

修改范围:
- bridge/: 连接状态文本汉化
- cli/: MCP 命令处理及自动模式提示
- commands/: GitHub App 安装、额外用量、洞察报告、插件管理等命令的
  错误消息、说明文本、菜单标签汉化
- commands/insights.ts: 报告标签全汉化(目标/成功/摩擦/满意度等类别)
- utils/: 上下文建议文本汉化
- bootstrap/: 状态相关注释汉化
- commands/mcp/: IdP 连接配置翻译
- 组件 ManagePlugins.tsx: 更新标记菜单标签汉化

跳过编译产物(含 react/compiler-runtime 的 .tsx 文件)
Jarvis 2 mesiacov pred
rodič
commit
3556eb7f78

+ 130 - 140
src/bootstrap/state.ts

@@ -10,10 +10,10 @@ import { cwd } from 'process'
 import type { HookEvent, ModelUsage } from 'src/entrypoints/agentSdkTypes.js'
 import type { AgentColorName } from 'src/tools/AgentTool/agentColorManager.js'
 import type { HookCallbackMatcher } from 'src/types/hooks.js'
-// Indirection for browser-sdk build (package.json "browser" field swaps
-// crypto.ts for crypto.browser.ts). Pure leaf re-export of node:crypto —
-// zero circular-dep risk. Path-alias import bypasses bootstrap-isolation
-// (rule only checks ./ and / prefixes); explicit disable documents intent.
+// 用于浏览器端构建的间接引用(package.json 的 "browser" 字段会将
+// crypto.ts 替换为 crypto.browser.ts)。纯叶子节点重新导出 node:crypto —
+// 零循环依赖风险。路径别名导入绕过了启动隔离(
+// 规则仅检查 ./ 和 / 前缀);显式禁用说明了意图。
 // eslint-disable-next-line custom-rules/bootstrap-isolation
 import { randomUUID } from 'src/utils/crypto.js'
 import type { ModelSetting } from 'src/utils/model/model.js'
@@ -23,17 +23,16 @@ import { resetSettingsCache } from 'src/utils/settings/settingsCache.js'
 import type { PluginHookMatcher } from 'src/utils/settings/types.js'
 import { createSignal } from 'src/utils/signal.js'
 
-// Union type for registered hooks - can be SDK callbacks or native plugin hooks
+// 注册钩子的联合类型——可以是 SDK 回调或原生插件钩子
 type RegisteredHookMatcher = HookCallbackMatcher | PluginHookMatcher
 
 import type { SessionId } from 'src/types/ids.js'
 
-// DO NOT ADD MORE STATE HERE - BE JUDICIOUS WITH GLOBAL STATE
+// 不要再加状态了——请谨慎对待全局状态
 
-// dev: true on entries that came via --dangerously-load-development-channels.
-// The allowlist gate checks this per-entry (not the session-wide
-// hasDevChannels bit) so passing both flags doesn't let the dev dialog's
-// acceptance leak allowlist-bypass to the --channels entries.
+// dev: 对于通过 --dangerously-load-development-channels 传入的条目为 true。
+// 白名单门控逐条目检查此项(而非会话范围的 hasDevChannels 标志),
+// 因此同时传入两个标志不会让开发对话框的接受行为泄漏白名单绕过权限到 --channels 条目。
 export type ChannelEntry =
   | { kind: 'plugin'; name: string; marketplace: string; dev?: boolean }
   | { kind: 'server'; name: string; dev?: boolean }
@@ -44,9 +43,9 @@ export type AttributedCounter = {
 
 type State = {
   originalCwd: string
-  // Stable project root - set once at startup (including by --worktree flag),
-  // never updated by mid-session EnterWorktreeTool.
-  // Use for project identity (history, skills, sessions) not file operations.
+  // 稳定的项目根目录 - 启动时设置一次(包括 --worktree 标志),
+  // 会话中途的 EnterWorktreeTool 永远不会更新它。
+  // 用于项目标识(历史记录、技能、会话),不用于文件操作。
   projectRoot: string
   totalCostUSD: number
   totalAPIDuration: number
@@ -70,10 +69,9 @@ type State = {
   modelStrings: ModelStrings | null
   isInteractive: boolean
   kairosActive: boolean
-  // When true, ensureToolResultPairing throws on mismatch instead of
-  // repairing with synthetic placeholders. HFI opts in at startup so
-  // trajectories fail fast rather than conditioning the model on fake
-  // tool_results.
+  // 当为 true 时,ensureToolResultPairing 在不匹配时抛出异常,
+  // 而不是用合成占位符修复。HFI 在启动时选择加入,因此
+  // 轨迹会快速失败,而不是用假的 tool_result 训练模型。
   strictToolResultPairing: boolean
   sdkAgentProgressSummariesEnabled: boolean
   userMsgOptIn: boolean
@@ -98,7 +96,7 @@ type State = {
   activeTimeCounter: AttributedCounter | null
   statsStore: { observe(name: string, value: number): void } | null
   sessionId: SessionId
-  // Parent session ID for tracking session lineage (e.g., plan mode -> implementation)
+  // 父会话 ID,用于跟踪会话谱系(例如,规划模式 -> 实现)
   parentSessionId: SessionId | undefined
   // Logger state
   loggerProvider: LoggerProvider | null
@@ -112,69 +110,68 @@ type State = {
   agentColorIndex: number
   // Last API request for bug reports
   lastAPIRequest: Omit<BetaMessageStreamParams, 'messages'> | null
-  // Messages from the last API request (ant-only; reference, not clone).
-  // Captures the exact post-compaction, CLAUDE.md-injected message set sent
-  // to the API so /share's serialized_conversation.json reflects reality.
+  // 上次 API 请求的消息(ant 专用;引用,非克隆)。
+  // 捕获发送给 API 的压缩后、CLAUDE.md 注入的确切消息集,
+  // 以便 /share 的 serialized_conversation.json 反映实际情况。
   lastAPIRequestMessages: BetaMessageStreamParams['messages'] | null
   // Last auto-mode classifier request(s) for /share transcript
   lastClassifierRequests: unknown[] | null
-  // CLAUDE.md content cached by context.ts for the auto-mode classifier.
-  // Breaks the yoloClassifier → claudemd → filesystem → permissions cycle.
+  // CLAUDE.md 内容缓存,供自动模式分类器使用。
+  // 打破 yoloClassifier → claudemd → 文件系统 → 权限的循环。
   cachedClaudeMdContent: string | null
   // In-memory error log for recent errors
   inMemoryErrorLog: Array<{ error: string; timestamp: string }>
-  // Session-only plugins from --plugin-dir flag
+  // 来自 --plugin-dir 标志的仅会话插件
   inlinePlugins: Array<string>
-  // Explicit --chrome / --no-chrome flag value (undefined = not set on CLI)
+  // 显式 --chrome / --no-chrome 标志值(undefined = 未在 CLI 设置)
   chromeFlagOverride: boolean | undefined
-  // Use cowork_plugins directory instead of plugins (--cowork flag or env var)
+  // 使用 cowork_plugins 目录代替 plugins(--cowork 标志或环境变量)
   useCoworkPlugins: boolean
-  // Session-only bypass permissions mode flag (not persisted)
+  // 仅会话的绕过权限模式标志(不持久化)
   sessionBypassPermissionsMode: boolean
-  // Session-only flag gating the .claude/scheduled_tasks.json watcher
-  // (useScheduledTasks). Set by cronScheduler.start() when the JSON has
-  // entries, or by CronCreateTool. Not persisted.
+  // 仅会话的标志,用于控制 .claude/scheduled_tasks.json 监视器
+  // (useScheduledTasks)。当 JSON 有条目时由 cronScheduler.start() 设置,
+  // 或由 CronCreateTool 设置。不持久化。
   scheduledTasksEnabled: boolean
-  // Session-only cron tasks created via CronCreate with durable: false.
-  // Fire on schedule like file-backed tasks but are never written to
-  // .claude/scheduled_tasks.json — they die with the process. Typed via
-  // SessionCronTask below (not importing from cronTasks.ts keeps
-  // bootstrap a leaf of the import DAG).
+  // 通过 CronCreate 以 durable: false 创建的仅会话定时任务。
+  // 按调度触发,类似文件支持的任务,但永远不会写入
+  // .claude/scheduled_tasks.json —— 它们随进程终止而消失。类型通过
+  // 下面的 SessionCronTask 定义(不从 cronTasks.ts 导入以保持
+  // bootstrap 为导入 DAG 的叶子节点)。
   sessionCronTasks: SessionCronTask[]
-  // Teams created this session via TeamCreate. cleanupSessionTeams()
-  // removes these on gracefulShutdown so subagent-created teams don't
-  // persist on disk forever (gh-32730). TeamDelete removes entries to
-  // avoid double-cleanup. Lives here (not teamHelpers.ts) so
-  // resetStateForTests() clears it between tests.
+  // 本会话通过 TeamCreate 创建的团队。cleanupSessionTeams()
+  // 在优雅关闭时移除它们,以避免子代理创建的团队永远残留在磁盘上
+  // (gh-32730)。TeamDelete 移除条目以避免重复清理。
+  // 放在这里(而非 teamHelpers.ts)以便 resetStateForTests() 在测试间清除。
   sessionCreatedTeams: Set<string>
-  // Session-only trust flag for home directory (not persisted to disk)
-  // When running from home dir, trust dialog is shown but not saved to disk.
-  // This flag allows features requiring trust to work during the session.
+  // 仅会话的家庭目录信任标志(不持久化到磁盘)
+  // 从家庭目录运行时,显示信任对话框但不保存到磁盘。
+  // 此标志允许需要信任的功能在会话期间正常工作。
   sessionTrustAccepted: boolean
-  // Session-only flag to disable session persistence to disk
+  // 仅会话的标志,禁用会话持久化到磁盘
   sessionPersistenceDisabled: boolean
-  // Track if user has exited plan mode in this session (for re-entry guidance)
+  // 跟踪用户是否在此会话中退出了规划模式(用于重新进入引导)
   hasExitedPlanMode: boolean
-  // Track if we need to show the plan mode exit attachment (one-time notification)
+  // 跟踪是否需要显示规划模式退出附件(一次性通知)
   needsPlanModeExitAttachment: boolean
-  // Track if we need to show the auto mode exit attachment (one-time notification)
+  // 跟踪是否需要显示自动模式退出附件(一次性通知)
   needsAutoModeExitAttachment: boolean
-  // Track if LSP plugin recommendation has been shown this session (only show once)
+  // 跟踪 LSP 插件推荐是否已在本会话中显示(仅显示一次)
   lspRecommendationShownThisSession: boolean
-  // SDK init event state - jsonSchema for structured output
+  // SDK 初始化事件状态 - 结构化输出的 jsonSchema
   initJsonSchema: Record<string, unknown> | null
-  // Registered hooks - SDK callbacks and plugin native hooks
+  // 已注册的钩子 - SDK 回调和插件原生钩子
   registeredHooks: Partial<Record<HookEvent, RegisteredHookMatcher[]>> | null
-  // Cache for plan slugs: sessionId -> wordSlug
+  // 规划 slug 缓存:sessionId -> wordSlug
   planSlugCache: Map<string, string>
-  // Track teleported session for reliability logging
+  // 跟踪远程连接会话以进行可靠性日志记录
   teleportedSessionInfo: {
     isTeleported: boolean
     hasLoggedFirstMessage: boolean
     sessionId: string | null
   } | null
-  // Track invoked skills for preservation across compaction
-  // Keys are composite: `${agentId ?? ''}:${skillName}` to prevent cross-agent overwrites
+  // 跟踪调用的技能,以便在压缩时保留
+  // 键是组合的:`${agentId ?? ''}:${skillName}` 以防止跨代理覆盖
   invokedSkills: Map<
     string,
     {
@@ -185,81 +182,74 @@ type State = {
       agentId: string | null
     }
   >
-  // Track slow operations for dev bar display (ant-only)
+  // 跟踪慢速操作以在开发栏显示(仅 ant)
   slowOperations: Array<{
     operation: string
     durationMs: number
     timestamp: number
   }>
-  // SDK-provided betas (e.g., context-1m-2025-08-07)
+  // SDK 提供的 beta 功能(例如,context-1m-2025-08-07)
   sdkBetas: string[] | undefined
-  // Main thread agent type (from --agent flag or settings)
+  // 主线程代理类型(来自 --agent 标志或设置)
   mainThreadAgentType: string | undefined
-  // Remote mode (--remote flag)
+  // 远程模式(--remote 标志)
   isRemoteMode: boolean
-  // Direct connect server URL (for display in header)
+  // 直连服务器 URL(用于在头部显示)
   directConnectServerUrl: string | undefined
-  // System prompt section cache state
+  // 系统提示片段缓存状态
   systemPromptSectionCache: Map<string, string | null>
-  // Last date emitted to the model (for detecting midnight date changes)
+  // 上次向模型发送的日期(用于检测午夜日期变化)
   lastEmittedDate: string | null
-  // Additional directories from --add-dir flag (for CLAUDE.md loading)
+  // 来自 --add-dir 标志的额外目录(用于 CLAUDE.md 加载)
   additionalDirectoriesForClaudeMd: string[]
-  // Channel server allowlist from --channels flag (servers whose channel
-  // notifications should register this session). Parsed once in main.tsx —
-  // the tag decides trust model: 'plugin' → marketplace verification +
-  // allowlist, 'server' → allowlist always fails (schema is plugin-only).
-  // Either kind needs entry.dev to bypass allowlist.
+  // 来自 --channels 标志的通道服务器白名单(其通道通知应注册到本会话的服务器)
+  // 在 main.tsx 中解析一次——标签决定信任模型:'plugin' → 市场验证 +
+  // 白名单,'server' → 白名单始终失败(schema 仅限插件)。
+  // 两种类型都需要 entry.dev 来绕过白名单。
   allowedChannels: ChannelEntry[]
-  // True if any entry in allowedChannels came from
-  // --dangerously-load-development-channels (so ChannelsNotice can name the
-  // right flag in policy-blocked messages)
+  // 如果 allowedChannels 中任何条目来自
+  // --dangerously-load-development-channels(以便 ChannelsNotice 可在被策略拦截的消息中
+  // 指出正确的标志名称)
   hasDevChannels: boolean
-  // Dir containing the session's `.jsonl`; null = derive from originalCwd.
+  // 包含会话 `.jsonl` 的目录;null = 从 originalCwd 推导。
   sessionProjectDir: string | null
-  // Cached prompt cache 1h TTL allowlist from GrowthBook (session-stable)
+  // GrowthBook 缓存的 prompt cache 1h TTL 白名单(会话稳定)
   promptCache1hAllowlist: string[] | null
-  // Cached 1h TTL user eligibility (session-stable). Latched on first
-  // evaluation so mid-session overage flips don't change the cache_control
-  // TTL, which would bust the server-side prompt cache.
+  // 缓存的 1h TTL 用户资格(会话稳定)。首次评估时锁定,使会话中的超额翻转
+  // 不会改变 cache_control TTL,否则会破坏服务器端 prompt 缓存。
   promptCache1hEligible: boolean | null
-  // Sticky-on latch for AFK_MODE_BETA_HEADER. Once auto mode is first
-  // activated, keep sending the header for the rest of the session so
-  // Shift+Tab toggles don't bust the ~50-70K token prompt cache.
+  // AFK_MODE_BETA_HEADER 的粘性开启锁存。首次激活自动模式后,
+  // 会话剩余时间持续发送此标头,使 Shift+Tab 切换不会破坏 ~50-70K 令牌的 prompt 缓存。
   afkModeHeaderLatched: boolean | null
-  // Sticky-on latch for FAST_MODE_BETA_HEADER. Once fast mode is first
-  // enabled, keep sending the header so cooldown enter/exit doesn't
-  // double-bust the prompt cache. The `speed` body param stays dynamic.
+  // FAST_MODE_BETA_HEADER 的粘性开启锁存。首次启用快速模式后,
+  // 保持发送标头,避免冷启动进出双重破坏 prompt 缓存。`speed` body 参数保持动态。
   fastModeHeaderLatched: boolean | null
-  // Sticky-on latch for the cache-editing beta header. Once cached
-  // microcompact is first enabled, keep sending the header so mid-session
-  // GrowthBook/settings toggles don't bust the prompt cache.
+  // 缓存编辑 beta 标头的粘性开启锁存。首次启用缓存微压缩后,
+  // 保持发送标头,避免会话中的 GrowthBook/设置切换破坏 prompt 缓存。
   cacheEditingHeaderLatched: boolean | null
-  // Sticky-on latch for clearing thinking from prior tool loops. Triggered
-  // when >1h since last API call (confirmed cache miss — no cache-hit
-  // benefit to keeping thinking). Once latched, stays on so the newly-warmed
-  // thinking-cleared cache isn't busted by flipping back to keep:'all'.
-  thinkingClearLatched: boolean | null
-  // Current prompt ID (UUID) correlating a user prompt with subsequent OTel events
+  // 清除之前工具循环思考的粘性开启锁存。当距上次 API 调用超过 1h 时触发
+  // (确认缓存未命中——保留思考无缓存命中好处)。锁定后保持开启,
+  // 使新预热的清除思考缓存不会因切回 keep:'all' 而被破坏。
+  // 当前提示 ID (UUID),将用户提示与后续 OTel 事件关联
   promptId: string | null
-  // Last API requestId for the main conversation chain (not subagents).
-  // Updated after each successful API response for main-session queries.
-  // Read at shutdown to send cache eviction hints to inference.
+  // 主对话链的最后 API requestId(不含子代理)。
+  // 在每次主会话查询的 API 响应成功后更新。
+  // 在关闭时读取,以向推理端发送缓存驱逐提示。
   lastMainRequestId: string | undefined
-  // Timestamp (Date.now()) of the last successful API call completion.
-  // Used to compute timeSinceLastApiCallMs in tengu_api_success for
-  // correlating cache misses with idle time (cache TTL is ~5min).
+  // 上次成功 API 调用完成的时间戳(Date.now())。
+  // 用于在 tengu_api_success 中计算 timeSinceLastApiCallMs,
+  // 以将缓存未命中与空闲时间关联(缓存 TTL 约 5 分钟)。
   lastApiCompletionTimestamp: number | null
-  // Set to true after compaction (auto or manual /compact). Consumed by
-  // logAPISuccess to tag the first post-compaction API call so we can
-  // distinguish compaction-induced cache misses from TTL expiry.
+  // 压缩(自动或手动 /compact)后设置为 true。由
+  // logAPISuccess 消费,以标记压缩后的第一次 API 调用,使我们能
+  // 区分压缩导致的缓存未命中与 TTL 过期。
   pendingPostCompaction: boolean
 }
 
-// ALSO HERE - THINK THRICE BEFORE MODIFYING
+// 这里是——修改前三思
 function getInitialState(): State {
-  // Resolve symlinks in cwd to match behavior of shell.ts setCwd
-  // This ensures consistency with how paths are sanitized for session storage
+  // 解析 cwd 中的符号链接,以匹配 shell.ts 的 setCwd 行为
+  // 这确保路径清理的一致性,以便会话存储
   let resolvedCwd = ''
   if (
     typeof process !== 'undefined' &&
@@ -270,7 +260,7 @@ function getInitialState(): State {
     try {
       resolvedCwd = realpathSync(rawCwd).normalize('NFC')
     } catch {
-      // File Provider EPERM on CloudStorage mounts (lstat per path component).
+      // CloudStorage 挂载时文件提供程序 EPERM(逐路径组件 lstat)。
       resolvedCwd = rawCwd.normalize('NFC')
     }
   }
@@ -317,7 +307,7 @@ function getInitialState(): State {
       'flagSettings',
       'policySettings',
     ],
-    // Telemetry state
+    // 遥测状态
     meter: null,
     sessionCounter: null,
     locCounter: null,
@@ -330,92 +320,92 @@ function getInitialState(): State {
     statsStore: null,
     sessionId: randomUUID() as SessionId,
     parentSessionId: undefined,
-    // Logger state
+    // 日志记录器状态
     loggerProvider: null,
     eventLogger: null,
-    // Meter provider state
+    // Meter 提供者状态
     meterProvider: null,
     tracerProvider: null,
-    // Agent color state
+    // 代理颜色状态
     agentColorMap: new Map(),
     agentColorIndex: 0,
-    // Last API request for bug reports
+    // 用于 bug 报告的上次 API 请求
     lastAPIRequest: null,
     lastAPIRequestMessages: null,
-    // Last auto-mode classifier request(s) for /share transcript
+    // 用于 /share 转录的上次自动模式分类器请求
     lastClassifierRequests: null,
     cachedClaudeMdContent: null,
-    // In-memory error log for recent errors
+    // 最近错误的内存日志
     inMemoryErrorLog: [],
-    // Session-only plugins from --plugin-dir flag
+    // 来自 --plugin-dir 标志的仅会话插件
     inlinePlugins: [],
-    // Explicit --chrome / --no-chrome flag value (undefined = not set on CLI)
+    // 显式 --chrome / --no-chrome 标志值(undefined = 未在 CLI 设置)
     chromeFlagOverride: undefined,
-    // Use cowork_plugins directory instead of plugins
+    // 使用 cowork_plugins 目录代替 plugins
     useCoworkPlugins: false,
-    // Session-only bypass permissions mode flag (not persisted)
+    // 仅会话的绕过权限模式标志(不持久化)
     sessionBypassPermissionsMode: false,
-    // Scheduled tasks disabled until flag or dialog enables them
+    // 定时任务默认禁用,直到标志或对话框启用
     scheduledTasksEnabled: false,
     sessionCronTasks: [],
     sessionCreatedTeams: new Set(),
-    // Session-only trust flag (not persisted to disk)
+    // 仅会话的信任标志(不持久化到磁盘)
     sessionTrustAccepted: false,
-    // Session-only flag to disable session persistence to disk
+    // 仅会话的标志,禁用会话持久化到磁盘
     sessionPersistenceDisabled: false,
-    // Track if user has exited plan mode in this session
+    // 跟踪用户是否在此会话中退出了规划模式
     hasExitedPlanMode: false,
-    // Track if we need to show the plan mode exit attachment
+    // 跟踪是否需要显示规划模式退出附件
     needsPlanModeExitAttachment: false,
-    // Track if we need to show the auto mode exit attachment
+    // 跟踪是否需要显示自动模式退出附件
     needsAutoModeExitAttachment: false,
-    // Track if LSP plugin recommendation has been shown this session
+    // 跟踪 LSP 插件推荐是否已在本会话中显示
     lspRecommendationShownThisSession: false,
-    // SDK init event state
+    // SDK 初始化事件状态
     initJsonSchema: null,
     registeredHooks: null,
-    // Cache for plan slugs
+    // 规划 slug 缓存
     planSlugCache: new Map(),
-    // Track teleported session for reliability logging
+    // 跟踪远程连接会话以进行可靠性日志记录
     teleportedSessionInfo: null,
-    // Track invoked skills for preservation across compaction
+    // 跟踪调用的技能以在压缩时保留
     invokedSkills: new Map(),
-    // Track slow operations for dev bar display
+    // 跟踪开发栏显示的慢速操作
     slowOperations: [],
-    // SDK-provided betas
+    // SDK 提供的 beta 功能
     sdkBetas: undefined,
-    // Main thread agent type
+    // 主线程代理类型
     mainThreadAgentType: undefined,
-    // Remote mode
+    // 远程模式
     isRemoteMode: false,
     ...(process.env.USER_TYPE === 'ant'
       ? {
           replBridgeActive: false,
         }
       : {}),
-    // Direct connect server URL
+    // 直连服务器 URL
     directConnectServerUrl: undefined,
-    // System prompt section cache state
+    // 系统提示片段缓存状态
     systemPromptSectionCache: new Map(),
-    // Last date emitted to the model
+    // 上次向模型发送的日期
     lastEmittedDate: null,
-    // Additional directories from --add-dir flag (for CLAUDE.md loading)
+    // 来自 --add-dir 标志的额外目录(用于 CLAUDE.md 加载)
     additionalDirectoriesForClaudeMd: [],
-    // Channel server allowlist from --channels flag
+    // 来自 --channels 标志的通道服务器白名单
     allowedChannels: [],
     hasDevChannels: false,
-    // Session project dir (null = derive from originalCwd)
+    // 会话项目目录(null = 从 originalCwd 推导)
     sessionProjectDir: null,
-    // Prompt cache 1h allowlist (null = not yet fetched from GrowthBook)
+    // Prompt cache 1h 白名单(null = 尚未从 GrowthBook 获取)
     promptCache1hAllowlist: null,
-    // Prompt cache 1h eligibility (null = not yet evaluated)
+    // Prompt cache 1h 资格(null = 尚未评估)
     promptCache1hEligible: null,
-    // Beta header latches (null = not yet triggered)
+    // Beta 标头锁存(null = 尚未触发)
     afkModeHeaderLatched: null,
     fastModeHeaderLatched: null,
     cacheEditingHeaderLatched: null,
     thinkingClearLatched: null,
-    // Current prompt ID
+    // 当前提示 ID
     promptId: null,
     lastMainRequestId: undefined,
     lastApiCompletionTimestamp: null,
@@ -425,7 +415,7 @@ function getInitialState(): State {
   return state
 }
 
-// AND ESPECIALLY HERE
+// 特别是这里
 const STATE: State = getInitialState()
 
 export function getSessionId(): SessionId {

+ 26 - 26
src/bridge/bridgeMain.ts

@@ -506,7 +506,7 @@ export async function runBridgeLoop(
           // Also skip for timeout-killed sessions — the timeout watchdog
           // already logged a clear timeout message.
           if (!wasTimedOut && !loopSignal.aborted) {
-            failureMessage = stderrSummary ?? 'Process exited with error'
+            failureMessage = stderrSummary ?? '进程异常退出'
             logger.logSessionFailed(sessionId, failureMessage)
             logError(new Error(`Bridge session failed: ${failureMessage}`))
           }
@@ -2026,7 +2026,7 @@ export async function bridgeMain(args: string[]): Promise<void> {
     if (!valid.includes(permissionMode)) {
       // biome-ignore lint/suspicious/noConsole: intentional error output
       console.error(
-        `Error: Invalid permission mode '${permissionMode}'. Valid modes: ${valid.join(', ')}`,
+        `错误:无效的权限模式 '${permissionMode}'。有效模式:${valid.join(', ')}`,
       )
       // eslint-disable-next-line custom-rules/no-process-exit
       process.exit(1)
@@ -2069,7 +2069,7 @@ export async function bridgeMain(args: string[]): Promise<void> {
     ]).catch(() => {})
     // biome-ignore lint/suspicious/noConsole: intentional error output
     console.error(
-      'Error: Multi-session Remote Control is not enabled for your account yet.',
+      '错误:多会话远程控制尚未对您的账户启用。',
     )
     // eslint-disable-next-line custom-rules/no-process-exit
     process.exit(1)
@@ -2086,7 +2086,7 @@ export async function bridgeMain(args: string[]): Promise<void> {
   if (!checkHasTrustDialogAccepted()) {
     // biome-ignore lint/suspicious/noConsole:: intentional console output
     console.error(
-      `Error: Workspace not trusted. Please run \`claude\` in ${dir} first to review and accept the workspace trust dialog.`,
+      `错误:工作区未被信任。请先在 ${dir} 中运行 \`claude\` 以查看并接受工作区信任对话框。`,
     )
     // eslint-disable-next-line custom-rules/no-process-exit
     process.exit(1)
@@ -2122,10 +2122,10 @@ export async function bridgeMain(args: string[]): Promise<void> {
     })
     // biome-ignore lint/suspicious/noConsole:: intentional console output
     console.log(
-      '\nRemote Control lets you access this CLI session from the web (claude.ai/code)\nor the Claude app, so you can pick up where you left off on any device.\n\nYou can disconnect remote access anytime by running /remote-control again.\n',
+      '\n远程控制允许您从 Web(claude.ai/code)\n或 Claude 应用访问此 CLI 会话,以便在任何设备上继续工作。\n\n您可以随时通过再次运行 /remote-control 断开远程访问。\n',
     )
     const answer = await new Promise<string>(resolve => {
-      rl.question('Enable Remote Control? (y/n) ', resolve)
+      rl.question('是否启用远程控制?(y/n) ', resolve)
     })
     rl.close()
     saveGlobalConfig(current => {
@@ -2154,7 +2154,7 @@ export async function bridgeMain(args: string[]): Promise<void> {
     if (!found) {
       // biome-ignore lint/suspicious/noConsole: intentional error output
       console.error(
-        `Error: No recent session found in this directory or its worktrees. Run \`claude remote-control\` to start a new one.`,
+        `错误:在此目录或其工作树中未找到近期会话。请运行 \`claude remote-control\` 启动新会话。`,
       )
       // eslint-disable-next-line custom-rules/no-process-exit
       process.exit(1)
@@ -2165,7 +2165,7 @@ export async function bridgeMain(args: string[]): Promise<void> {
     const fromWt = pointerDir !== dir ? ` from worktree ${pointerDir}` : ''
     // biome-ignore lint/suspicious/noConsole: intentional info output
     console.error(
-      `Resuming session ${pointer.sessionId} (${ageStr} ago)${fromWt}\u2026`,
+      `正在恢复会话 ${pointer.sessionId}(${ageStr} 前${fromWt ? `,来自工作树 ${pointerDir}` : ''})\u2026`,
     )
     resumeSessionId = pointer.sessionId
     // Track where the pointer came from so the #20460 exit(1) paths below
@@ -2186,7 +2186,7 @@ export async function bridgeMain(args: string[]): Promise<void> {
   ) {
     // biome-ignore lint/suspicious/noConsole:: intentional console output
     console.error(
-      'Error: Remote Control base URL uses HTTP. Only HTTPS or localhost HTTP is allowed.',
+      '错误:远程控制的基准 URL 使用了 HTTP。仅允许 HTTPS 或 localhost HTTP。',
     )
     // eslint-disable-next-line custom-rules/no-process-exit
     process.exit(1)
@@ -2225,7 +2225,7 @@ export async function bridgeMain(args: string[]): Promise<void> {
   if (savedSpawnMode === 'worktree' && !worktreeAvailable) {
     // biome-ignore lint/suspicious/noConsole: intentional warning output
     console.error(
-      'Warning: Saved spawn mode is worktree but this directory is not a git repository. Falling back to same-dir.',
+      '警告:已保存的生成模式为 worktree,但此目录不是 git 仓库。已回退到 same-dir。',
     )
     savedSpawnMode = undefined
     saveCurrentProjectConfig(current => {
@@ -2252,14 +2252,14 @@ export async function bridgeMain(args: string[]): Promise<void> {
     })
     // biome-ignore lint/suspicious/noConsole: intentional dialog output
     console.log(
-      `\nClaude Remote Control is launching in spawn mode which lets you create new sessions in this project from Claude Code on Web or your Mobile app. Learn more here: https://code.claude.com/docs/en/remote-control\n\n` +
-        `Spawn mode for this project:\n` +
-        `  [1] same-dir \u2014 sessions share the current directory (default)\n` +
-        `  [2] worktree \u2014 each session gets an isolated git worktree\n\n` +
-        `This can be changed later or explicitly set with --spawn=same-dir or --spawn=worktree.\n`,
+      `\nClaude 远程控制正在以生成模式启动,该模式允许您从 Web 端的 Claude Code 或移动应用在此项目中创建新会话。了解更多:https://code.claude.com/docs/en/remote-control\n\n` +
+        `此项目的生成模式:\n` +
+        `  [1] same-dir(同目录) \u2014 会话共享当前目录(默认)\n` +
+        `  [2] worktree(工作树) \u2014 每个会话获得独立的 git 工作树\n\n` +
+        `这可以在日后更改,或通过 --spawn=same-dir 或 --spawn=worktree 显式设置。\n`,
     )
     const answer = await new Promise<string>(resolve => {
-      rl.question('Choose [1/2] (default: 1): ', resolve)
+      rl.question('选择 [1/2](默认:1):', resolve)
     })
     rl.close()
     const chosen: 'same-dir' | 'worktree' =
@@ -2331,7 +2331,7 @@ export async function bridgeMain(args: string[]): Promise<void> {
   if (spawnMode === 'worktree' && !worktreeAvailable) {
     // biome-ignore lint/suspicious/noConsole: intentional error output
     console.error(
-      `Error: Worktree mode requires a git repository or WorktreeCreate hooks configured. Use --spawn=session for single-session mode.`,
+      `错误:工作树模式需要 git 仓库或已配置 WorktreeCreate 钩子。请使用 --spawn=session 进入单会话模式。`,
     )
     // eslint-disable-next-line custom-rules/no-process-exit
     process.exit(1)
@@ -2392,7 +2392,7 @@ export async function bridgeMain(args: string[]): Promise<void> {
       }
       // biome-ignore lint/suspicious/noConsole: intentional error output
       console.error(
-        `Error: Session ${resumeSessionId} not found. It may have been archived or expired, or your login may have lapsed (run \`claude /login\`).`,
+        `错误:找不到会话 ${resumeSessionId}。该会话可能已被归档或过期,或者您的登录已失效(请运行 \`claude /login\`)。`,
       )
       // eslint-disable-next-line custom-rules/no-process-exit
       process.exit(1)
@@ -2404,7 +2404,7 @@ export async function bridgeMain(args: string[]): Promise<void> {
       }
       // biome-ignore lint/suspicious/noConsole: intentional error output
       console.error(
-        `Error: Session ${resumeSessionId} has no environment_id. It may never have been attached to a bridge.`,
+        `错误:会话 ${resumeSessionId} 没有 environment_id。该会话可能从未连接过桥接。`,
       )
       // eslint-disable-next-line custom-rules/no-process-exit
       process.exit(1)
@@ -2459,7 +2459,7 @@ export async function bridgeMain(args: string[]): Promise<void> {
     // biome-ignore lint/suspicious/noConsole:: intentional console output
     console.error(
       err instanceof BridgeFatalError && err.status === 404
-        ? 'Remote Control environments are not available for your account.'
+        ? '远程控制环境不适用于您的账户。'
         : `Error: ${errorMessage(err)}`,
     )
     // eslint-disable-next-line custom-rules/no-process-exit
@@ -2483,7 +2483,7 @@ export async function bridgeMain(args: string[]): Promise<void> {
       )
       // biome-ignore lint/suspicious/noConsole: intentional warning output
       console.warn(
-        `Warning: Could not resume session ${resumeSessionId} — its environment has expired. Creating a fresh session instead.`,
+        `警告:无法恢复会话 ${resumeSessionId} — 其环境已过期。将改为创建新会话。`,
       )
       // Don't deregister — we're going to use this new environment.
       // effectiveResumeSessionId stays undefined → fresh session path below.
@@ -2535,8 +2535,8 @@ export async function bridgeMain(args: string[]): Promise<void> {
         // biome-ignore lint/suspicious/noConsole: intentional error output
         console.error(
           isFatal
-            ? `Error: ${errorMessage(err)}`
-            : `Error: Failed to reconnect session ${resumeSessionId}: ${errorMessage(err)}\nThe session may still be resumable — try running the same command again.`,
+            ? `错误:${errorMessage(err)}`
+            : `错误:无法重新连接会话 ${resumeSessionId}:${errorMessage(err)}\n该会话可能仍可恢复 - 请尝试再次运行相同的命令。`,
         )
         // eslint-disable-next-line custom-rules/no-process-exit
         process.exit(1)
@@ -2629,8 +2629,8 @@ export async function bridgeMain(args: string[]): Promise<void> {
       })
       logger.logStatus(
         newMode === 'worktree'
-          ? 'Spawn mode: worktree (new sessions get isolated git worktrees)'
-          : 'Spawn mode: same-dir (new sessions share the current directory)',
+          ? '生成模式:worktree(新会话将获得独立的 git 工作树)'
+          : '生成模式:same-dir(新会话共享当前目录)',
       )
       logger.setSpawnModeDisplay(newMode)
       logger.refreshDisplay()
@@ -2847,7 +2847,7 @@ export async function runBridgeHeadless(
     !baseUrl.includes('127.0.0.1')
   ) {
     throw new BridgeHeadlessPermanentError(
-      'Remote Control base URL uses HTTP. Only HTTPS or localhost HTTP is allowed.',
+      '远程控制的基准 URL 使用了 HTTP。仅允许 HTTPS 或 localhost HTTP。',
     )
   }
   const sessionIngressUrl =

+ 11 - 11
src/bridge/bridgeStatusUtil.ts

@@ -113,10 +113,10 @@ export function computeShimmerSegments(
 /** Computed bridge status label and color from connection state. */
 export type BridgeStatusInfo = {
   label:
-    | 'Remote Control failed'
-    | 'Remote Control reconnecting'
-    | 'Remote Control active'
-    | 'Remote Control connecting\u2026'
+    | '远程控制失败'
+    | '远程控制正在重新连接'
+    | '远程控制已激活'
+    | '远程控制正在连接\u2026'
   color: 'error' | 'warning' | 'success'
 }
 
@@ -132,26 +132,26 @@ export function getBridgeStatus({
   sessionActive: boolean
   reconnecting: boolean
 }): BridgeStatusInfo {
-  if (error) return { label: 'Remote Control failed', color: 'error' }
+  if (error) return { label: '远程控制失败', color: 'error' }
   if (reconnecting)
-    return { label: 'Remote Control reconnecting', color: 'warning' }
+    return { label: '远程控制正在重新连接', color: 'warning' }
   if (sessionActive || connected)
-    return { label: 'Remote Control active', color: 'success' }
-  return { label: 'Remote Control connecting\u2026', color: 'warning' }
+    return { label: '远程控制已激活', color: 'success' }
+  return { label: '远程控制正在连接\u2026', color: 'warning' }
 }
 
 /** Footer text shown when bridge is idle (Ready state). */
 export function buildIdleFooterText(url: string): string {
-  return `Code everywhere with the Claude app or ${url}`
+  return `通过 Claude 应用随处编码,或访问 ${url}`
 }
 
 /** Footer text shown when a session is active (Connected state). */
 export function buildActiveFooterText(url: string): string {
-  return `Continue coding in the Claude app or ${url}`
+  return `继续在 Claude 应用中编码,或访问 ${url}`
 }
 
 /** Footer text shown when the bridge has failed. */
-export const FAILED_FOOTER_TEXT = 'Something went wrong, please try again'
+export const FAILED_FOOTER_TEXT = '出现错误,请重试'
 
 /**
  * Wrap text in an OSC 8 terminal hyperlink. Zero visual width for layout purposes.

+ 26 - 26
src/bridge/bridgeUI.ts

@@ -162,7 +162,7 @@ export function createBridgeLogger(options: {
       suffix += chalk.dim(' \u00b7 ') + chalk.dim(branch)
     }
     writeStatus(
-      `${chalk.yellow(frame)} ${chalk.yellow('Connecting')}${suffix}\n`,
+      `${chalk.yellow(frame)} ${chalk.yellow('正在连接')}${suffix}\n`,
     )
   }
 
@@ -223,7 +223,7 @@ export function createBridgeLogger(options: {
 
     if (process.env.USER_TYPE === 'ant' && debugLogPath) {
       writeStatus(
-        `${chalk.yellow('[ANT-ONLY] Logs:')} ${chalk.dim(debugLogPath)}\n`,
+        `${chalk.yellow('[仅限ANT] 日志:')} ${chalk.dim(debugLogPath)}\n`,
       )
     }
     writeStatus(`${indicatorColor(indicator)} ${stateText}${suffix}\n`)
@@ -232,15 +232,15 @@ export function createBridgeLogger(options: {
     if (sessionMax > 1) {
       const modeHint =
         spawnMode === 'worktree'
-          ? 'New sessions will be created in an isolated worktree'
-          : 'New sessions will be created in the current directory'
+          ? '新会话将在隔离的工作树中创建'
+          : '新会话将在当前目录中创建'
       writeStatus(
-        `    ${chalk.dim(`Capacity: ${sessionActive}/${sessionMax} \u00b7 ${modeHint}`)}\n`,
+        `    ${chalk.dim(`容量:${sessionActive}/${sessionMax} \u00b7 ${modeHint}`)}\n`,
       )
       for (const [, info] of sessionDisplayInfo) {
         const titleText = info.title
           ? truncatePrompt(info.title, 35)
-          : chalk.dim('Attached')
+          : chalk.dim('已连接')
         const titleLinked = wrapWithOsc8Link(titleText, info.url)
         const act = info.activity
         const showAct = act && act.type !== 'result' && act.type !== 'error'
@@ -256,10 +256,10 @@ export function createBridgeLogger(options: {
     if (sessionMax === 1) {
       const modeText =
         spawnMode === 'single-session'
-          ? 'Single session \u00b7 exits when complete'
+          ? '单会话 \u00b7 完成后退出'
           : spawnMode === 'worktree'
-            ? `Capacity: ${sessionActive}/1 \u00b7 New sessions will be created in an isolated worktree`
-            : `Capacity: ${sessionActive}/1 \u00b7 New sessions will be created in the current directory`
+            ? `容量:${sessionActive}/1 \u00b7 新会话将在隔离的工作树中创建`
+            : `容量:${sessionActive}/1 \u00b7 新会话将在当前目录中创建`
       writeStatus(`    ${chalk.dim(modeText)}\n`)
     }
 
@@ -281,10 +281,10 @@ export function createBridgeLogger(options: {
         ? buildIdleFooterText(url)
         : buildActiveFooterText(url)
       const qrHint = qrVisible
-        ? chalk.dim.italic('space to hide QR code')
-        : chalk.dim.italic('space to show QR code')
+        ? chalk.dim.italic('按空格键隐藏二维码')
+        : chalk.dim.italic('按空格键显示二维码')
       const toggleHint = spawnModeDisplay
-        ? chalk.dim.italic(' \u00b7 w to toggle spawn mode')
+        ? chalk.dim.italic(' \u00b7 按 w 切换生成模式')
         : ''
       writeStatus(`${chalk.dim(footerText)}\n`)
       writeStatus(`${qrHint}${toggleHint}\n`)
@@ -299,19 +299,19 @@ export function createBridgeLogger(options: {
       regenerateQr(connectUrl)
 
       if (verbose) {
-        write(chalk.dim(`Remote Control`) + ` v${MACRO.VERSION}\n`)
+        write(chalk.dim(`远程控制`) + ` v${MACRO.VERSION}\n`)
       }
       if (verbose) {
         if (config.spawnMode !== 'single-session') {
-          write(chalk.dim(`Spawn mode: `) + `${config.spawnMode}\n`)
+          write(chalk.dim(`生成模式:`) + `${config.spawnMode}\n`)
           write(
-            chalk.dim(`Max concurrent sessions: `) + `${config.maxSessions}\n`,
+            chalk.dim(`最大并发会话数:`) + `${config.maxSessions}\n`,
           )
         }
-        write(chalk.dim(`Environment ID: `) + `${environmentId}\n`)
+        write(chalk.dim(`环境 ID:`) + `${environmentId}\n`)
       }
       if (config.sandbox) {
-        write(chalk.dim(`Sandbox: `) + `${chalk.green('Enabled')}\n`)
+        write(chalk.dim(`沙盒:`) + `${chalk.green('已启用')}\n`)
       }
       write('\n')
 
@@ -324,7 +324,7 @@ export function createBridgeLogger(options: {
         const short = truncatePrompt(prompt, 80)
         printLog(
           chalk.dim(`[${timestamp()}]`) +
-            ` Session started: ${chalk.white(`"${short}"`)} (${chalk.dim(sessionId)})\n`,
+            ` 会话已启动:${chalk.white(`"${short}"`)} (${chalk.dim(sessionId)})\n`,
         )
       }
     },
@@ -332,14 +332,14 @@ export function createBridgeLogger(options: {
     logSessionComplete(sessionId: string, durationMs: number): void {
       printLog(
         chalk.dim(`[${timestamp()}]`) +
-          ` Session ${chalk.green('completed')} (${formatDuration(durationMs)}) ${chalk.dim(sessionId)}\n`,
+          ` 会话已${chalk.green('完成')} (${formatDuration(durationMs)}) ${chalk.dim(sessionId)}\n`,
       )
     },
 
     logSessionFailed(sessionId: string, error: string): void {
       printLog(
         chalk.dim(`[${timestamp()}]`) +
-          ` Session ${chalk.red('failed')}: ${error} ${chalk.dim(sessionId)}\n`,
+          ` 会话${chalk.red('失败')}:${error} ${chalk.dim(sessionId)}\n`,
       )
     },
 
@@ -354,13 +354,13 @@ export function createBridgeLogger(options: {
     },
 
     logError(message: string): void {
-      printLog(chalk.red(`[${timestamp()}] Error: ${message}`) + '\n')
+      printLog(chalk.red(`[${timestamp()}] 错误:${message}`) + '\n')
     },
 
     logReconnected(disconnectedMs: number): void {
       printLog(
         chalk.dim(`[${timestamp()}]`) +
-          ` ${chalk.green('Reconnected')} after ${formatDuration(disconnectedMs)}\n`,
+          ` ${chalk.green('已重新连接')},断开时长 ${formatDuration(disconnectedMs)}\n`,
       )
     },
 
@@ -377,7 +377,7 @@ export function createBridgeLogger(options: {
       stopConnecting()
 
       currentState = 'idle'
-      currentStateText = 'Ready'
+      currentStateText = '就绪'
       lastToolSummary = null
       lastToolTime = 0
       activeSessionUrl = null
@@ -388,7 +388,7 @@ export function createBridgeLogger(options: {
     setAttached(sessionId: string): void {
       stopConnecting()
       currentState = 'attached'
-      currentStateText = 'Connected'
+      currentStateText = '已连接'
       lastToolSummary = null
       lastToolTime = 0
       // Multi-session: keep footer/QR on the environment connect URL so users
@@ -420,7 +420,7 @@ export function createBridgeLogger(options: {
         BRIDGE_SPINNER_FRAMES[connectingTick % BRIDGE_SPINNER_FRAMES.length]!
       connectingTick++
       writeStatus(
-        `${chalk.yellow(frame)} ${chalk.yellow('Reconnecting')} ${chalk.dim('\u00b7')} ${chalk.dim(`retrying in ${delayStr}`)} ${chalk.dim('\u00b7')} ${chalk.dim(`disconnected ${elapsedStr}`)}\n`,
+        `${chalk.yellow(frame)} ${chalk.yellow('重新连接中')} ${chalk.dim('\u00b7')} ${chalk.dim(`将在 ${delayStr} 后重试`)} ${chalk.dim('\u00b7')} ${chalk.dim(`已断开 ${elapsedStr}`)}\n`,
       )
     },
 
@@ -438,7 +438,7 @@ export function createBridgeLogger(options: {
       }
 
       writeStatus(
-        `${chalk.red(BRIDGE_FAILED_INDICATOR)} ${chalk.red('Remote Control Failed')}${suffix}\n`,
+        `${chalk.red(BRIDGE_FAILED_INDICATOR)} ${chalk.red('远程控制失败')}${suffix}\n`,
       )
       writeStatus(`${chalk.dim(FAILED_FOOTER_TEXT)}\n`)
 

+ 1 - 1
src/bridge/envLessBridgeConfig.ts

@@ -147,7 +147,7 @@ export async function getEnvLessBridgeConfig(): Promise<EnvLessBridgeConfig> {
 export async function checkEnvLessBridgeMinVersion(): Promise<string | null> {
   const cfg = await getEnvLessBridgeConfig()
   if (cfg.min_version && lt(MACRO.VERSION, cfg.min_version)) {
-    return `Your version of Claude Code (${MACRO.VERSION}) is too old for Remote Control.\nVersion ${cfg.min_version} or higher is required. Run \`claude update\` to update.`
+    return `您的 Claude Code 版本 (${MACRO.VERSION}) 太旧,无法使用远程控制。\n需要版本 ${cfg.min_version} 或更高。请运行 \`claude update\` 进行更新。`
   }
   return null
 }

+ 2 - 2
src/bridge/remoteBridgeCore.ts

@@ -177,7 +177,7 @@ export async function initEnvLessBridgeCore(
     cfg,
   )
   if (!createdSessionId) {
-    onStateChange?.('failed', 'Session creation failed — see debug log')
+    onStateChange?.('failed', '会话创建失败 - 请查看调试日志')
     logBridgeSkip('v2_session_create_failed', undefined, true)
     return null
   }
@@ -198,7 +198,7 @@ export async function initEnvLessBridgeCore(
     cfg,
   )
   if (!credentials) {
-    onStateChange?.('failed', 'Remote credentials fetch failed — see debug log')
+    onStateChange?.('failed', '远程凭据获取失败 - 请查看调试日志')
     logBridgeSkip('v2_remote_creds_failed', undefined, true)
     void archiveSession(
       sessionId,

+ 2 - 2
src/bridge/replBridge.ts

@@ -2230,7 +2230,7 @@ async function startWorkPollLoop({
           )
           onStateChange?.(
             'failed',
-            'Environment deleted and re-registration limit reached',
+            '环境已删除且达到重新注册上限',
           )
           onFatalError?.()
           break
@@ -2263,7 +2263,7 @@ async function startWorkPollLoop({
 
         onStateChange?.(
           'failed',
-          'Environment deleted and re-registration failed',
+          '环境已删除且重新注册失败',
         )
         onFatalError?.()
         break

+ 2 - 2
src/cli/handlers/agents.ts

@@ -60,10 +60,10 @@ export async function agentsHandler(): Promise<void> {
 
   if (lines.length === 0) {
     // biome-ignore lint/suspicious/noConsole:: intentional console output
-    console.log('No agents found.')
+    console.log('未找到智能体。')
   } else {
     // biome-ignore lint/suspicious/noConsole:: intentional console output
-    console.log(`${totalActive} active agents\n`)
+    console.log(`${totalActive} 个活跃智能体\n`)
     // biome-ignore lint/suspicious/noConsole:: intentional console output
     console.log(lines.join('\n').trimEnd())
   }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 48 - 48
src/cli/handlers/mcp.tsx


+ 5 - 5
src/commands/createMovedToPluginCommand.ts

@@ -45,16 +45,16 @@ export function createMovedToPluginCommand({
         return [
           {
             type: 'text',
-            text: `This command has been moved to a plugin. Tell the user:
+            text: `此命令已移至插件。请告诉用户:
 
-1. To install the plugin, run:
+1. 要安装该插件,请运行:
    claude plugin install ${pluginName}@claude-code-marketplace
 
-2. After installation, use /${pluginName}:${pluginCommand} to run this command
+2. 安装后,使用 /${pluginName}:${pluginCommand} 来运行此命令
 
-3. For more information, see: https://github.com/anthropics/claude-code-marketplace/blob/main/${pluginName}/README.md
+3. 有关更多信息,请参阅:https://github.com/anthropics/claude-code-marketplace/blob/main/${pluginName}/README.md
 
-Do not attempt to run the command. Simply inform the user about the plugin installation.`,
+请勿尝试运行该命令。只需向用户说明插件安装步骤即可。`,
           },
         ]
       }

+ 7 - 7
src/commands/extra-usage/extra-usage-core.ts

@@ -45,7 +45,7 @@ export async function runExtraUsage(): Promise<ExtraUsageResult> {
       return {
         type: 'message',
         value:
-          'Your organization already has unlimited extra usage. No request needed.',
+          '您的组织已拥有无限额外使用量。无需请求。',
       }
     }
 
@@ -54,7 +54,7 @@ export async function runExtraUsage(): Promise<ExtraUsageResult> {
       if (eligibility?.is_allowed === false) {
         return {
           type: 'message',
-          value: 'Please contact your admin to manage extra usage settings.',
+          value: '请联系您的管理员以管理额外使用量设置。',
         }
       }
     } catch (error) {
@@ -71,7 +71,7 @@ export async function runExtraUsage(): Promise<ExtraUsageResult> {
         return {
           type: 'message',
           value:
-            'You have already submitted a request for extra usage to your admin.',
+            '您已经向管理员提交了额外使用量的请求。',
         }
       }
     } catch (error) {
@@ -87,8 +87,8 @@ export async function runExtraUsage(): Promise<ExtraUsageResult> {
       return {
         type: 'message',
         value: extraUsage?.is_enabled
-          ? 'Request sent to your admin to increase extra usage.'
-          : 'Request sent to your admin to enable extra usage.',
+          ? '已向您的管理员发送请求以增加额外使用量。'
+          : '已向您的管理员发送请求以启用额外使用量。',
       }
     } catch (error) {
       logError(error as Error)
@@ -97,7 +97,7 @@ export async function runExtraUsage(): Promise<ExtraUsageResult> {
 
     return {
       type: 'message',
-      value: 'Please contact your admin to manage extra usage settings.',
+      value: '请联系您的管理员以管理额外使用量设置。',
     }
   }
 
@@ -112,7 +112,7 @@ export async function runExtraUsage(): Promise<ExtraUsageResult> {
     logError(error as Error)
     return {
       type: 'message',
-      value: `Failed to open browser. Please visit ${url} to manage extra usage.`,
+      value: `无法打开浏览器。请访问 ${url} 以管理额外使用量。`,
     }
   }
 }

+ 2 - 2
src/commands/extra-usage/extra-usage-noninteractive.ts

@@ -10,7 +10,7 @@ export async function call(): Promise<{ type: 'text'; value: string }> {
   return {
     type: 'text',
     value: result.opened
-      ? `Browser opened to manage extra usage. If it didn't open, visit: ${result.url}`
-      : `Please visit ${result.url} to manage extra usage.`,
+      ? `浏览器已打开以管理额外使用量。如果未打开,请访问:${result.url}`
+      : `请访问 ${result.url} 以管理额外使用量。`,
   }
 }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 2 - 2
src/commands/extra-usage/extra-usage.tsx


+ 1 - 1
src/commands/heapdump/heapdump.ts

@@ -6,7 +6,7 @@ export async function call(): Promise<{ type: 'text'; value: string }> {
   if (!result.success) {
     return {
       type: 'text',
-      value: `Failed to create heap dump: ${result.error}`,
+      value: `创建堆转储失败:${result.error}`,
     }
   }
 

+ 59 - 59
src/commands/insights.ts

@@ -352,66 +352,66 @@ const EXTENSION_TO_LANGUAGE: Record<string, string> = {
 const LABEL_MAP: Record<string, string> = {
   // Goal categories
   debug_investigate: 'Debug/Investigate',
-  implement_feature: 'Implement Feature',
-  fix_bug: 'Fix Bug',
-  write_script_tool: 'Write Script/Tool',
-  refactor_code: 'Refactor Code',
-  configure_system: 'Configure System',
-  create_pr_commit: 'Create PR/Commit',
-  analyze_data: 'Analyze Data',
-  understand_codebase: 'Understand Codebase',
-  write_tests: 'Write Tests',
-  write_docs: 'Write Docs',
-  deploy_infra: 'Deploy/Infra',
-  warmup_minimal: 'Cache Warmup',
+  implement_feature: '实现功能',
+  fix_bug: '修复 Bug',
+  write_script_tool: '编写脚本/工具',
+  refactor_code: '重构代码',
+  configure_system: '配置系统',
+  create_pr_commit: '创建 PR/提交',
+  analyze_data: '分析数据',
+  understand_codebase: '理解代码库',
+  write_tests: '编写测试',
+  write_docs: '编写文档',
+  deploy_infra: '部署/基础设施',
+  warmup_minimal: '缓存预热',
   // Success factors
-  fast_accurate_search: 'Fast/Accurate Search',
-  correct_code_edits: 'Correct Code Edits',
-  good_explanations: 'Good Explanations',
-  proactive_help: 'Proactive Help',
-  multi_file_changes: 'Multi-file Changes',
-  handled_complexity: 'Multi-file Changes',
-  good_debugging: 'Good Debugging',
+  fast_accurate_search: '快速/准确搜索',
+  correct_code_edits: '正确的代码修改',
+  good_explanations: '清晰解释',
+  proactive_help: '主动帮助',
+  multi_file_changes: '多文件修改',
+  handled_complexity: '处理复杂性',
+  good_debugging: '良好的调试',
   // Friction types
-  misunderstood_request: 'Misunderstood Request',
-  wrong_approach: 'Wrong Approach',
-  buggy_code: 'Buggy Code',
-  user_rejected_action: 'User Rejected Action',
-  claude_got_blocked: 'Claude Got Blocked',
-  user_stopped_early: 'User Stopped Early',
-  wrong_file_or_location: 'Wrong File/Location',
-  excessive_changes: 'Excessive Changes',
-  slow_or_verbose: 'Slow/Verbose',
-  tool_failed: 'Tool Failed',
-  user_unclear: 'User Unclear',
-  external_issue: 'External Issue',
+  misunderstood_request: '误解请求',
+  wrong_approach: '方法错误',
+  buggy_code: '代码有 Bug',
+  user_rejected_action: '用户拒绝操作',
+  claude_got_blocked: 'Claude 被阻止',
+  user_stopped_early: '用户提前停止',
+  wrong_file_or_location: '文件/位置错误',
+  excessive_changes: '过多更改',
+  slow_or_verbose: '慢/冗长',
+  tool_failed: '工具失败',
+  user_unclear: '用户表达不清',
+  external_issue: '外部问题',
   // Satisfaction labels
-  frustrated: 'Frustrated',
-  dissatisfied: 'Dissatisfied',
-  likely_satisfied: 'Likely Satisfied',
-  satisfied: 'Satisfied',
-  happy: 'Happy',
-  unsure: 'Unsure',
-  neutral: 'Neutral',
-  delighted: 'Delighted',
+  frustrated: '沮丧',
+  dissatisfied: '不满意',
+  likely_satisfied: '可能满意',
+  satisfied: '满意',
+  happy: '开心',
+  unsure: '不确定',
+  neutral: '中立',
+  delighted: '惊喜',
   // Session types
-  single_task: 'Single Task',
-  multi_task: 'Multi Task',
-  iterative_refinement: 'Iterative Refinement',
-  exploration: 'Exploration',
-  quick_question: 'Quick Question',
+  single_task: '单任务',
+  multi_task: '多任务',
+  iterative_refinement: '迭代优化',
+  exploration: '探索',
+  quick_question: '快速提问',
   // Outcomes
-  fully_achieved: 'Fully Achieved',
-  mostly_achieved: 'Mostly Achieved',
-  partially_achieved: 'Partially Achieved',
-  not_achieved: 'Not Achieved',
-  unclear_from_transcript: 'Unclear',
+  fully_achieved: '完全实现',
+  mostly_achieved: '大部分实现',
+  partially_achieved: '部分实现',
+  not_achieved: '未实现',
+  unclear_from_transcript: '不明确',
   // Helpfulness
-  unhelpful: 'Unhelpful',
-  slightly_helpful: 'Slightly Helpful',
-  moderately_helpful: 'Moderately Helpful',
-  very_helpful: 'Very Helpful',
-  essential: 'Essential',
+  unhelpful: '无帮助',
+  slightly_helpful: '略有帮',
+  moderately_helpful: '中等帮助',
+  very_helpful: '很有帮助',
+  essential: '不可或缺',
 }
 
 // Lazy getters: getClaudeConfigHomeDir() is memoized and reads process.env.
@@ -1900,14 +1900,14 @@ function generateResponseTimeHistogram(times: number[]): string {
 }
 
 function generateTimeOfDayChart(messageHours: number[]): string {
-  if (messageHours.length === 0) return '<p class="empty">No time data</p>'
+  if (messageHours.length === 0) return '<p class="empty">无时间数据</p>'
 
   // Group into time periods
   const periods = [
-    { label: 'Morning (6-12)', range: [6, 7, 8, 9, 10, 11] },
-    { label: 'Afternoon (12-18)', range: [12, 13, 14, 15, 16, 17] },
-    { label: 'Evening (18-24)', range: [18, 19, 20, 21, 22, 23] },
-    { label: 'Night (0-6)', range: [0, 1, 2, 3, 4, 5] },
+    { label: '上午 (6-12)', range: [6, 7, 8, 9, 10, 11] },
+    { label: '下午 (12-18)', range: [12, 13, 14, 15, 16, 17] },
+    { label: '傍晚 (18-24)', range: [18, 19, 20, 21, 22, 23] },
+    { label: '夜间 (0-6)', range: [0, 1, 2, 3, 4, 5] },
   ]
 
   const hourCounts: Record<number, number> = {}

+ 7 - 7
src/commands/install-github-app/install-github-app.tsx

@@ -81,7 +81,7 @@ function InstallGitHubApp(props: {
       warnings.push({
         title: 'GitHub CLI 未认证',
         message: 'GitHub CLI 似乎未通过身份验证。',
-        instructions: ['Run: gh auth login', 'Follow the prompts to authenticate with GitHub', 'Or set up authentication using environment variables or other methods']
+        instructions: ['运行: gh auth login', '按照提示完成 GitHub 身份验证', '或者通过环境变量或其他方法设置身份验证']
       });
     } else {
       // Check if required scopes are present in the Token scopes line
@@ -100,9 +100,9 @@ function InstallGitHubApp(props: {
           setState(prev => ({
             ...prev,
             step: 'error',
-            error: `GitHub CLI is missing required permissions: ${missingScopes.join(', ')}.`,
-            errorReason: 'Missing required scopes',
-            errorInstructions: [`Your GitHub CLI authentication is missing the "${missingScopes.join('" and "')}" ${plural(missingScopes.length, 'scope')} needed to manage GitHub Actions and secrets.`, '', 'To fix this, run:', '  gh auth refresh -h github.com -s repo,workflow', '', 'This will add the necessary permissions to manage workflows and secrets.']
+            error: `GitHub CLI 缺少所需权限: ${missingScopes.join(', ')}。`,
+            errorReason: '缺少所需权限',
+            errorInstructions: [`您的 GitHub CLI 身份验证缺少 "${missingScopes.join('" 和 "')}" 权限,无法管理 GitHub Actions 和密钥。`, '', '修复方法:', '  gh auth refresh -h github.com -s repo,workflow', '', '这将添加管理工作流和密钥所需的权限。']
           }));
           return;
         }
@@ -310,8 +310,8 @@ function InstallGitHubApp(props: {
       } else if (!permissionCheck.hasAccess) {
         repoWarnings.push({
           title: '需要管理员权限',
-          message: `You might need admin permissions on ${repoName_1} to set up GitHub Actions.`,
-          instructions: ['Repository admins can install GitHub Apps and set secrets', 'Ask a repository admin to run this command if setup fails', 'Alternatively, you can use the manual setup instructions']
+          message: `在 ${repoName_1} 上设置 GitHub Actions 可能需要管理员权限。`,
+          instructions: ['仓库管理员可以安装 GitHub Apps 并设置密钥', '如果安装失败,请让仓库管理员运行此命令', '或者,您可以使用手动安装说明']
         });
       }
       const workflowExists = await checkExistingWorkflowFile(repoName_1);
@@ -383,7 +383,7 @@ function InstallGitHubApp(props: {
         setState(prev_16 => ({
           ...prev_16,
           step: 'error',
-          error: 'API key is required'
+          error: '需要 API 密钥'
         }));
         return;
       }

+ 1 - 1
src/commands/mcp/xaaIdpCommand.ts

@@ -218,7 +218,7 @@ export function registerMcpXaaIdpCommand(mcp: Command): void {
 
   xaaIdp
     .command('show')
-    .description('Show the current IdP connection config')
+    .description('显示当前 IdP 连接配置')
     .action(() => {
       const idp = getXaaIdpSettings()
       if (!idp) {

+ 1 - 1
src/commands/plugin/ManagePlugins.tsx

@@ -1312,7 +1312,7 @@ export function ManagePlugins({
     // Update/Uninstall options — not available for built-in plugins
     if (!isBuiltin_1) {
       menuItems.push({
-        label: selectedPlugin.pendingUpdate ? 'Unmark for update' : 'Mark for update',
+        label: selectedPlugin.pendingUpdate ? '标记为不更新' : '标记为更新',
         action: async () => {
           try {
             const localError = await checkIfLocalPlugin(selectedPlugin.plugin.name, selectedPlugin.marketplace);

+ 2 - 2
src/utils/contextSuggestions.ts

@@ -227,9 +227,9 @@ function checkAutoCompactDisabled(
   ) {
     suggestions.push({
       severity: 'info',
-      title: 'Autocompact is disabled',
+      title: '自动压缩已禁用',
       detail:
-        'Without autocompact, you will hit context limits and lose the conversation. Enable it in /config or use /compact manually.',
+        '未启用自动压缩将触及上下文限制并丢失对话。请在 /config 中启用,或手动执行 /compact。',
     })
   }
 }

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov