/** * [WHO]: Provides detectGrubLocale(), grubText(), type GrubLocale for localized /grub prompts and TUI messages * [FROM]: Depends on core/platform/i18n locale type * [TO]: Consumed by grub-controller.ts, grub-parser.ts, index.ts for user-language-aware Grub UX * [HERE]: extensions/builtin/grub/grub-i18n.ts - small locale helper scoped to the Grub extension */ import type { Locale } from "../../../core/platform/i18n/index.js"; export type GrubLocale = Locale; export declare function detectGrubLocale(text: string, fallback?: Locale): GrubLocale; export declare function languageName(locale: GrubLocale): string; export declare function grubText(locale: GrubLocale): (typeof GRUB_TEXT)[GrubLocale]; export declare function formatDuration(ms: number): string; declare const GRUB_TEXT: { readonly en: { readonly prefix: "[Grub]"; readonly missingGoal: "Missing grub goal."; readonly usage: readonly ["[Grub] Usage:", " /grub [--max-iter N] [--max-fail N] Start a focused long-running task", " /grub status [--json] Show progress", " /grub resume Continue a saved task", " /grub stop Stop the current task", "", "[Grub] Progress is saved under .grub// so it can continue later.", "Use /grub status --json only when you need the full saved details.", "", "[Grub] The task keeps working until it finishes, gets blocked, is stopped,", "or reaches a safety limit. It cannot mark itself done while checklist items remain."]; readonly activeTask: "Active task"; readonly lastTask: "Last task"; readonly status: "Status"; readonly phase: "Phase"; readonly goal: "Goal"; readonly started: "Started"; readonly updated: "Updated"; readonly currentIteration: "Current iteration"; readonly completedIterations: "Completed iterations"; readonly awaitingResult: "Awaiting result"; readonly yes: "yes"; readonly no: "no"; readonly consecutiveFailures: "Consecutive failures"; readonly maxIterations: "Max iterations"; readonly harnessDir: "Harness dir"; readonly featureList: "Feature list"; readonly progressLog: "Progress log"; readonly initScript: "Init script"; readonly stateFile: "State file"; readonly featuresPassing: (passing: number, total: number) => string; readonly remainingFeatures: (ids: string[], hidden: number) => string; readonly lastSummary: "Last summary"; readonly lastNextStep: "Last next step"; readonly lastError: "Last error"; readonly noActive: "No grub task is active."; readonly noStarted: "No grub task has been started in this session."; readonly decision: "Decision"; readonly summary: "Summary"; readonly nextStep: "Next step"; readonly resumeSummary: (id: string, iteration: number, phase: string) => string; readonly resumeHint: "Use /grub status to review progress, /grub resume to continue, or /grub stop to abandon it."; readonly startingIteration: (iteration: number, id: string) => string; readonly startedTask: (id: string) => string; readonly initPhase: "First step: create the task checklist and a repeatable smoke check before changing code."; readonly safetyLimits: (maxIterations: number, maxFailures: number) => string; readonly resuming: (id: string) => string; readonly stopped: (id: string) => string; readonly protocolExit: "[Grub] The grub protocol has ended for this task. From now on, work like a normal assistant: carry out the user's instructions directly, and do NOT output any more blocks."; readonly noActiveRunning: "No active grub task is running."; readonly noPersisted: "There is no saved grub task to continue."; readonly failedResume: (id: string, message: string) => string; readonly failedAdopt: (message: string) => string; readonly failedNoAssistant: "This round ended without a usable update."; readonly iterationFailedRetry: (iteration: number | undefined) => string; readonly invalidLoopState: "I could not read the round summary from the assistant response."; readonly invalidLoopRetry: (iteration: number | undefined) => string; readonly loopStateExample: ""; readonly loopStateFormatHint: (iteration: number | undefined) => string; readonly prematureComplete: (reason: string) => string; readonly statsHeading: "Run summary"; readonly statDuration: (ms: number) => string; readonly statTurns: (turns: number) => string; readonly statToolCalls: (calls: number) => string; readonly statTokens: (usage: { input: number; output: number; cacheRead: number; cacheWrite: number; totalTokens: number; }) => string; readonly statCost: (cost: number) => string; readonly completionReport: (duration: string, turns: number, toolCalls: number, usage: { input: number; output: number; totalTokens: number; }) => string; readonly recapHeading: "Recap"; readonly recapEmpty: "(No decision summary recorded.)"; readonly harnessCreated: "- Harness created by /grub."; readonly structuredFeatureNote: "- Structured feature list lives in feature-list.json; only passes/evidence may change."; readonly initScriptNote: "- init.sh performs get-bearings + smoke before every iteration."; readonly iterationsHeading: "## Iterations"; readonly appendIterationNote: "- (append one short entry per iteration with verification evidence)"; readonly progressLogTitle: (id: string) => string; readonly initializationHeading: "## Initialization"; readonly task: "Task"; readonly progress: "Progress"; readonly round: "Round"; readonly state: "State"; readonly savedIn: "Saved in"; readonly taskFiles: "Task files"; readonly next: "Next"; readonly lastUpdate: "Last update"; readonly lastIssue: "Needs attention"; readonly preparing: "Preparing checklist and smoke check"; readonly working: "Working through the checklist"; readonly waiting: "waiting for this round to finish"; readonly ready: "ready for the next round"; readonly finished: "finished"; readonly blocked: "blocked"; readonly stoppedState: "stopped"; readonly failed: "stopped after repeated issues"; readonly unknownProgress: "Progress: checklist not ready yet"; readonly advancedJson: "Use /grub status --json for full saved details."; }; readonly zh: { readonly prefix: "[Grub]"; readonly missingGoal: "缺少 grub 目标。"; readonly usage: readonly ["[Grub] 用法:", " /grub <目标> [--max-iter N] [--max-fail N] 启动一个聚焦的长任务", " /grub status [--json] 查看进度", " /grub resume 继续已保存的任务", " /grub stop 停止当前任务", "", "[Grub] 进度会保存在 .grub//,之后可以继续。", "只有需要完整保存细节时,才使用 /grub status --json。", "", "[Grub] 任务会持续推进,直到完成、阻塞、被停止,或触发安全上限。", "只要清单里还有未完成项,它就不能把自己标记为完成。"]; readonly activeTask: "当前任务"; readonly lastTask: "最近任务"; readonly status: "状态"; readonly phase: "阶段"; readonly goal: "目标"; readonly started: "开始时间"; readonly updated: "更新时间"; readonly currentIteration: "当前轮次"; readonly completedIterations: "已完成轮次"; readonly awaitingResult: "等待结果"; readonly yes: "是"; readonly no: "否"; readonly consecutiveFailures: "连续失败"; readonly maxIterations: "最大轮次"; readonly harnessDir: "Harness 目录"; readonly featureList: "功能清单"; readonly progressLog: "进度日志"; readonly initScript: "初始化脚本"; readonly stateFile: "状态文件"; readonly featuresPassing: (passing: number, total: number) => string; readonly remainingFeatures: (ids: string[], hidden: number) => string; readonly lastSummary: "上次总结"; readonly lastNextStep: "下一步"; readonly lastError: "最近错误"; readonly noActive: "当前没有 grub 任务。"; readonly noStarted: "本会话还没有启动 grub 任务。"; readonly decision: "决策"; readonly summary: "总结"; readonly nextStep: "下一步"; readonly resumeSummary: (id: string, iteration: number, phase: string) => string; readonly resumeHint: "可用 /grub status 查看进度,/grub resume 继续,或 /grub stop 放弃。"; readonly startingIteration: (iteration: number, id: string) => string; readonly startedTask: (id: string) => string; readonly initPhase: "第一步:先建立任务清单和可重复的烟测,再修改代码。"; readonly safetyLimits: (maxIterations: number, maxFailures: number) => string; readonly resuming: (id: string) => string; readonly stopped: (id: string) => string; readonly protocolExit: "[Grub] 该任务的 grub 协议到此结束。从现在起按普通对话方式工作:直接执行用户指令,禁止再输出 块。"; readonly noActiveRunning: "当前没有正在运行的 grub 任务。"; readonly noPersisted: "没有可继续的已保存 grub 任务。"; readonly failedResume: (id: string, message: string) => string; readonly failedAdopt: (message: string) => string; readonly failedNoAssistant: "这一轮没有得到可用更新。"; readonly iterationFailedRetry: (iteration: number | undefined) => string; readonly invalidLoopState: "我无法从 assistant 回复中读到本轮总结。"; readonly invalidLoopRetry: (iteration: number | undefined) => string; readonly loopStateExample: ""; readonly loopStateFormatHint: (iteration: number | undefined) => string; readonly prematureComplete: (reason: string) => string; readonly statsHeading: "本次运行总览"; readonly statDuration: (ms: number) => string; readonly statTurns: (turns: number) => string; readonly statToolCalls: (calls: number) => string; readonly statTokens: (usage: { input: number; output: number; cacheRead: number; cacheWrite: number; totalTokens: number; }) => string; readonly statCost: (cost: number) => string; readonly completionReport: (duration: string, turns: number, toolCalls: number, usage: { input: number; output: number; totalTokens: number; }) => string; readonly recapHeading: "Recap"; readonly recapEmpty: "(没有记录到本轮决策摘要。)"; readonly harnessCreated: "- Harness 由 /grub 创建。"; readonly structuredFeatureNote: "- 结构化功能清单位于 feature-list.json;后续只能修改 passes/evidence。"; readonly initScriptNote: "- 每轮开始前由 init.sh 执行环境定位和烟测。"; readonly iterationsHeading: "## 迭代记录"; readonly appendIterationNote: "- (每轮追加一条简短记录,包含验证证据)"; readonly progressLogTitle: (id: string) => string; readonly initializationHeading: "## 初始化"; readonly task: "任务"; readonly progress: "进度"; readonly round: "轮次"; readonly state: "状态"; readonly savedIn: "保存位置"; readonly taskFiles: "任务文件"; readonly next: "下一步"; readonly lastUpdate: "最近更新"; readonly lastIssue: "需要注意"; readonly preparing: "正在准备清单和烟测"; readonly working: "正在按清单推进"; readonly waiting: "正在等待本轮完成"; readonly ready: "可继续下一轮"; readonly finished: "已完成"; readonly blocked: "已阻塞"; readonly stoppedState: "已停止"; readonly failed: "因连续问题已停止"; readonly unknownProgress: "进度:清单尚未准备好"; readonly advancedJson: "如需完整保存细节,可使用 /grub status --json。"; }; }; export {};