/** `conversation` namespace dictionaries. */

/** Dictionary namespace owned by this plugin. */
export const NS = 'conversation'

// The claimed /plan hint and the plan-mode textarea placeholder share one
// string: both describe the same next action.
const PLAN_NEXT_ACTION_ZH = '描述你的任务以生成计划'
const PLAN_NEXT_ACTION_EN = 'describe your task to generate plan'

/** Simplified Chinese dictionary (the key-set source of truth). */
export const zh = {
  'view.chat': '对话',
  'hint.plan': PLAN_NEXT_ACTION_ZH,
  'hint.goal': '输入目标，智能体将持续执行',
  'hint.goal.active': '当前目标进行中。可输入 edit 修改 / pause 暂停 / resume 继续 / clear 清除',
  'placeholder.plan': PLAN_NEXT_ACTION_ZH,
  'placeholder.default': '给智能体发消息',
  'placeholder.unavailable': '会话不可用',
  'placeholder.hero': '描述你想要构建的内容',
  'placeholder.workspace': '选择一个工作区开始',
  'input.commands': '命令',
  'input.stop': '停止生成',
  'input.send': '发送消息',
  'input.accessMode': '访问模式，当前：{name}',
  'context.aria': '上下文已用 {percent}',
  'context.used': '上下文已用',
  'context.system': '系统提示词',
  'context.tools': '工具',
  'context.messages': '对话消息',
  'stats.counts': '{turns} 轮 · {steps} 步',
  'stats.llm': 'LLM {duration}',
  'stats.toolCall': '工具调用 {duration}',
  'stats.ttftAverage': '首 token 平均 {duration}',
  'stats.tokensPerSecond': '{throughput} tok/s',
  'stats.cacheHit': '缓存命中 {percent}%',
  'stats.tokens': '输入 {input} tok · 输出 {output} tok',
  'settings.enter.title': '繁忙时 Enter 键行为',
  'settings.enter.description': '仅在智能体运行时生效；Cmd/Ctrl+Enter 使用另一行为',
  'settings.enter.queue': '排队发送',
  'settings.enter.steer': '插话发送',
  'access.confirm.title': '确认启用 Full access？',
  'access.confirm.description': '启用 Full access 后，agent 将减少确认步骤，并且可以直接执行更多操作，包括敏感操作、文件修改或外部命令。仅建议在你信任当前任务时使用。',
  'access.confirm.acknowledge': '我已了解风险，并愿意继续',
  'access.confirm.cancel': '取消',
  'access.confirm.enable': '启用 Full access',
  'hero.headline': '开始构建吧',
  'hero.preview': '预览版',
  'hero.chooseWorkspace': '选择工作区',
  'session.hierarchy': '会话层级',
  'details.title': '详情',
  'details.close': '关闭详情',
  'details.empty': '点击消息流中的工具行查看详情',
  'details.notInWindow': '该调用不在当前窗口内',
  'details.input': '输入',
  'details.output': '输出',
  'details.running': '运行中…',
  'todo.title': '任务',
  'todo.progress.done': '{done} 已完成',
  'todo.progress.active': '{active} 进行中',
  'todo.progress.pending': '{pending} 待处理',
  'todo.rowTitle': '更新任务清单',
  'todo.completed': '{done}/{total} 已完成',
  'chat.loadingHistory': '载入历史…',
  'chat.loadError': '历史加载失败：{message}（{code}）',
  'chat.loadOlder': '加载更早',
  'chat.toBottom': '回到底部',
  'message.extraBlock': '附加内容块',
  'message.contextInjection': '上下文注入',
  'message.contextRecall': '跨会话召回',
  'message.context.instructions.loaded': '已载入',
  'message.context.instructions.added': '已新增',
  'message.context.instructions.updated': '已更新',
  'message.context.instructions.removed': '已移除',
  'message.context.catalog.replaced': '替换目录',
  'message.context.catalog.more': '…还有 {count} 条',
  'message.context.snapshot.supersedes': '取代先前的快照',
  'message.context.relay.from': '来自会话 {session}',
  'message.context.recall.counts': '保留 {retained} 条 · 省略 {omitted} 条',
  'message.context.recall.truncated': '已截断',
  'message.steering': '插话',
  'message.compaction': '上下文已压缩',
  'message.compaction.expand': '点击查看压缩摘要',
  'message.compaction.unavailable': '压缩摘要不可用',
  'message.unknownSurface': '未知 surface 事件：{type}',
  'message.unknownBlock': '未知内容块',
  'message.stopped': '已停止',
  'message.branch': '在新对话中分支',
  'message.branchUnavailable': '仅可从已完成轮次的最后一条消息分支',
  'message.retry.active': '正在重试模型请求',
  'message.retry.cancelled': '模型请求重试已取消',
  'message.retry.started': '已重试模型请求',
  'message.retry.scheduled': '等待重试模型请求',
  'message.retry.status': '{label}（{retry}/{maximum}） · {seconds}s',
  'message.retry.delay': '重试延迟：',
  'message.retry.failure': '失败原因：',
  'message.turnError': '本轮运行失败',
  'message.ranFor': '用时 {duration}',
  'message.ttft': '首 token {seconds}秒',
  'message.tokensPerSecond': '{tps} tok/s',
  'duration.seconds': '{seconds}秒',
  'duration.minutes': '{minutes}分{seconds}秒',
  'command.running': '执行中…',
  'command.failed': '命令失败',
  'command.done': '已完成',
  'command.title': '命令',
  'approval.waiting': '等待审批',
  'approval.detail.aria': '审批详情',
  'approval.escalation': '工具 {toolName} 请求越权执行',
  'approval.reject': '拒绝',
  'approval.allowOnce': '允许一次',
  'ask.rowTitle': '提问',
  'ask.waiting': '等待回答',
  'ask.cancelled': '已取消',
  'ask.interrupted': '已中断',
  'ask.answered': '{answered}/{total} 已回答',
  'bash.running': '运行中',
  'bash.failed': '失败',
  'bash.stopped': '已停止',
  'row.running': '运行中',
  'row.failed': '失败',
  'row.stopped': '已停止',
  'queue.count': '{n} 条排队消息',
  'queue.edit': '编辑排队消息',
  'queue.edit.unsupported': '包含非文本内容，暂不支持编辑',
  'queue.save': '保存排队消息',
  'queue.cancelEdit': '取消编辑',
  'queue.remove': '删除排队消息',
  'queue.steer': '插话发送',
  'queue.steer.unavailable': '仅运行中可插话发送',
  'queue.editFailed': '编辑失败：这条消息可能已经开始发送。',
  'queue.removeFailed': '删除失败：这条消息可能已经开始发送。',
  'queue.steerFailed': '插话发送失败，请重试。',
  'terminal.signal': '信号 {signal}',
  'terminal.exitCode': '退出码 {code}',
  'terminal.running': '运行中',
  'terminal.failed': '失败',
  'terminal.done': '已完成',
  'terminal.noOutput': '无输出',
  'terminal.collapseAria': '收起输出',
  'terminal.expandAria': '展开其余 {n} 行输出',
  'terminal.expandRest': '… 其余 {n} 行',
  'json.truncated': '… 已截断，共 {total} 字符',
  'clock.md': '{m}月{d}日',
  'clock.ymd': '{y}年{m}月{d}日',
} satisfies Record<string, string>

/** The conversation namespace key union. */
export type ConversationKey = keyof typeof zh

/** English dictionary, checked complete against the zh key set. */
export const en = {
  'view.chat': 'Chat',
  'hint.plan': PLAN_NEXT_ACTION_EN,
  'hint.goal': 'describe the objective for a long-running task',
  'hint.goal.active': 'goal active — edit / pause / resume / clear',
  'placeholder.plan': PLAN_NEXT_ACTION_EN,
  'placeholder.default': 'Message the agent',
  'placeholder.unavailable': 'Session unavailable',
  'placeholder.hero': 'Describe what you want to build',
  'placeholder.workspace': 'Choose a workspace to start',
  'input.commands': 'Commands',
  'input.stop': 'Stop generating',
  'input.send': 'Send message',
  'input.accessMode': 'Access mode, current: {name}',
  'context.aria': '{percent} of context used',
  'context.used': 'of context used',
  'context.system': 'System prompt',
  'context.tools': 'Tools',
  'context.messages': 'Messages',
  'stats.counts': '{turns} turns · {steps} steps',
  'stats.llm': 'LLM {duration}',
  'stats.toolCall': 'Tool call {duration}',
  'stats.ttftAverage': 'TTFT avg {duration}',
  'stats.tokensPerSecond': '{throughput} tok/s',
  'stats.cacheHit': 'Cache hit {percent}%',
  'stats.tokens': 'Input {input} tok · Output {output} tok',
  'settings.enter.title': 'Enter behavior while busy',
  'settings.enter.description': 'Busy only; Cmd/Ctrl+Enter uses the other behavior',
  'settings.enter.queue': 'Queue',
  'settings.enter.steer': 'Steer',
  'access.confirm.title': 'Enable Full access?',
  'access.confirm.description': 'Full access reduces confirmation steps and lets the agent perform more actions directly, including sensitive operations, file changes, or external commands. Only use it when you trust the current task.',
  'access.confirm.acknowledge': 'I understand the risks and want to continue',
  'access.confirm.cancel': 'Cancel',
  'access.confirm.enable': 'Enable Full access',
  'hero.headline': 'Let\'s start building',
  'hero.preview': 'Preview',
  'hero.chooseWorkspace': 'Choose workspace',
  'session.hierarchy': 'Session hierarchy',
  'details.title': 'Details',
  'details.close': 'Close details',
  'details.empty': 'Click a tool row in the message flow to view its details',
  'details.notInWindow': 'This call is outside the current window',
  'details.input': 'Input',
  'details.output': 'Output',
  'details.running': 'Running…',
  'todo.title': 'To-dos',
  'todo.progress.done': '{done} completed',
  'todo.progress.active': '{active} in progress',
  'todo.progress.pending': '{pending} pending',
  'todo.rowTitle': 'Update to-do list',
  'todo.completed': '{done}/{total} completed',
  'chat.loadingHistory': 'Loading history…',
  'chat.loadError': 'Failed to load history: {message} ({code})',
  'chat.loadOlder': 'Load earlier',
  'chat.toBottom': 'Back to bottom',
  'message.extraBlock': 'Extra content block',
  'message.contextInjection': 'Context injection',
  'message.contextRecall': 'Session recall',
  'message.context.instructions.loaded': 'loaded',
  'message.context.instructions.added': 'added',
  'message.context.instructions.updated': 'updated',
  'message.context.instructions.removed': 'removed',
  'message.context.catalog.replaced': 'Replacement catalog',
  'message.context.catalog.more': '… {count} more',
  'message.context.snapshot.supersedes': 'Supersedes earlier snapshots',
  'message.context.relay.from': 'From session {session}',
  'message.context.recall.counts': '{retained} kept · {omitted} omitted',
  'message.context.recall.truncated': 'truncated',
  'message.steering': 'Interjection',
  'message.compaction': 'Context compacted',
  'message.compaction.expand': 'View compaction summary',
  'message.compaction.unavailable': 'Compaction summary unavailable',
  'message.unknownSurface': 'Unknown surface event: {type}',
  'message.unknownBlock': 'Unknown content block',
  'message.stopped': 'Stopped',
  'message.branch': 'Branch into a new conversation',
  'message.branchUnavailable': 'Available only on the last message of a completed turn',
  'message.retry.active': 'Retrying model request',
  'message.retry.cancelled': 'Model request retry cancelled',
  'message.retry.started': 'Retried model request',
  'message.retry.scheduled': 'Waiting to retry model request',
  'message.retry.status': '{label} ({retry}/{maximum}) · {seconds}s',
  'message.retry.delay': 'Retry delay: ',
  'message.retry.failure': 'Failure reason: ',
  'message.turnError': 'This turn failed',
  'message.ranFor': 'Ran for {duration}',
  'message.ttft': 'TTFT {seconds}s',
  'message.tokensPerSecond': '{tps} tok/s',
  'duration.seconds': '{seconds}s',
  'duration.minutes': '{minutes}m {seconds}s',
  'command.running': 'Running…',
  'command.failed': 'Command failed',
  'command.done': 'Completed',
  'command.title': 'Command',
  'approval.waiting': 'Waiting for approval',
  'approval.detail.aria': 'Approval details',
  'approval.escalation': 'Tool {toolName} requests privileged execution',
  'approval.reject': 'Reject',
  'approval.allowOnce': 'Allow once',
  'ask.rowTitle': 'Ask question',
  'ask.waiting': 'waiting',
  'ask.cancelled': 'cancelled',
  'ask.interrupted': 'interrupted',
  'ask.answered': '{answered}/{total} answered',
  'bash.running': 'Running',
  'bash.failed': 'Failed',
  'bash.stopped': 'Stopped',
  'row.running': 'Running',
  'row.failed': 'Failed',
  'row.stopped': 'Stopped',
  'queue.count': '{n} queued messages',
  'queue.edit': 'Edit queued message',
  'queue.edit.unsupported': 'Contains non-text content; editing is not supported yet',
  'queue.save': 'Save queued message',
  'queue.cancelEdit': 'Cancel editing',
  'queue.remove': 'Remove queued message',
  'queue.steer': 'Steer queued message',
  'queue.steer.unavailable': 'Steering is available only while the agent is running',
  'queue.editFailed': 'Edit failed: this message may have already started sending.',
  'queue.removeFailed': 'Removal failed: this message may have already started sending.',
  'queue.steerFailed': 'Steering failed. Try again.',
  'terminal.signal': 'signal {signal}',
  'terminal.exitCode': 'exit code {code}',
  'terminal.running': 'Running',
  'terminal.failed': 'Failed',
  'terminal.done': 'Done',
  'terminal.noOutput': 'No output',
  'terminal.collapseAria': 'Collapse output',
  'terminal.expandAria': 'Expand the remaining {n} output lines',
  'terminal.expandRest': '… {n} more lines',
  'json.truncated': '… truncated, {total} characters total',
  'clock.md': '{m}/{d}',
  'clock.ymd': '{y}-{m}-{d}',
} satisfies Record<ConversationKey, string>
