'use strict'; /** * messages.js — bilingual message table for hook-emitted text. * * Language is resolved once per run via config.resolveLanguage() (env * NOMAD_LANG > team-config.json principal.language > 'en'). Every user-facing * string in this package flows through here — no bare Chinese or English * string literals live inside session-start.js / session-stop.js / precompact.js * / append-log.js. Add a language by adding a key here; nothing else needs * to change (per team-skeleton.md hardcoding point #10's spirit — don't bake * one deployment's language choice into the template as if it were universal). */ const TABLE = { en: { openingCheck: '[Session start] Read your memory/ folder first, then get to work.', charterPointer: (fileName) => '\n[Structure governance] Where files go / naming / new-slot rules are governed by "' + fileName + '" at the team root — consult it before creating or moving files outside your own agent home.\n', teamlogHeader: (n) => '\n[Recent team activity — top ' + n + ' lines of the team log (reverse-chronological, newest at top)]\n', teamlogFooter: '\n(Full log at the path configured under shared_paths.team_log. When you wrap up, add one line at the top in the same format.)\n', kanbanHeaderStructured: (total) => '\n[Shared kanban — In Progress (' + total + ' item(s), one line each = title + status)]\n', kanbanTruncatedNote: (shown) => '\n...(showing first ' + shown + ' item(s) only)', kanbanFooter: '\n(Full board at the path configured under shared_paths.kanban — includes next steps / requirements. Update your own section when you wrap up.)\n', kanbanHeaderRaw: (n) => '\n[Shared kanban — could not match the structured "In Progress" format; showing the first ' + n + ' line(s) as-is]\n', inboxUnread: (n) => '\n📬 You have ' + n + ' unread message(s) in your inbox — check it now: read what you can act on, then move handled items to the "already read" section.\n', sessionLockWarning: (harness, pid, acquiredAt) => '\n⚠️ [Cross-session soft-lock notice] This agent home appears to already have another session running — harness=' + harness + ' pid=' + pid + ' acquiredAt=' + acquiredAt + ' (this is a soft lock, non-blocking — use your judgement on whether it conflicts with your work)\n', stopReason: (appendLogHint) => '[Close-out check — don\'t lose what you learned this round] If there is anything worth keeping from this turn: ' + '1) update the relevant file(s) under your memory/ folder (with date + source); ' + '2) log anything cross-agent-relevant to the team log — do NOT edit the team log file directly (unlocked concurrent writes have caused real corruption), ' + 'always go through the append tool instead: ' + appendLogHint + ' ' + 'For a long entry or when running under PowerShell, write the entry to a temp file first and pass it with --file (see the tool\'s header comment). ' + 'Then stop. If there is genuinely nothing new, just reply "nothing new" and stop.', precompactMessage: '[Context is about to be compacted] Write down anything from this segment you haven\'t recorded yet, under your memory/ folder; ' + 'add one line to the top of the team log for anything cross-agent-relevant — before continuing, so details are not lost after compaction.', }, 'zh-CN': { openingCheck: '【开机自检】先读你自己的 记忆/ 目录再开工。', charterPointer: (fileName) => '\n【结构治理】文件放哪/命名/新槽位规则以团队根《' + fileName + '》为准——在自己家之外新建/移动文件前先查它。\n', teamlogHeader: (n) => '\n【全队最近动态 · 团队日志顶部摘录(倒序·最新在上,共 ' + n + ' 行)】\n', teamlogFooter: '\n(完整见 shared_paths.team_log 配置的路径。收工时务必在顶部按同样格式回写你这趟干了什么。)\n', kanbanHeaderStructured: (total) => '\n【共享看板 · 进行中(' + total + ' 项,每项一行=标题+状态)】\n', kanbanTruncatedNote: (shown) => '\n…(仅列前 ' + shown + ' 项)', kanbanFooter: '\n(全文见 shared_paths.kanban 配置的路径——含下一步/需求与变更。你主责的块收工时顺手刷状态行。)\n', kanbanHeaderRaw: (n) => '\n【共享看板 · 未匹配到结构化"进行中"格式,原样摘录前 ' + n + ' 行】\n', inboxUnread: (n) => '\n📬 你的收件箱有 ' + n + ' 条未读 → 开机必扫:能办的办掉,处理完移已读归档。\n', sessionLockWarning: (harness, pid, acquiredAt) => '\n⚠️ 【跨会话软锁提示】本员工 home 疑似已有其他会话在跑——harness=' + harness + ' pid=' + pid + ' acquiredAt=' + acquiredAt + '(软锁不阻塞,仅供你判断是否与该会话冲突/避让)\n', stopReason: (appendLogHint) => '【收工自检 · 别把这趟学到的弄丢】若本轮有值得留存的进展:1) 更新你 记忆/ 下相关文件(带日期/来源);' + '2) 回写团队日志——⛔别直接 Edit 日志文件(无锁并发写有真实损坏先例),统一走追加工具:' + appendLogHint + ' ' + '条目超长或在 PowerShell 环境则先把条目写进临时文件再 --file 传入(详见工具头注释)。' + '写完再停。若确无新增,回一句『无新增』即可停。', precompactMessage: '【上下文即将压缩】先把本段还没记下的进展写进你 记忆/ 下相关文件;跨员工相关的在团队日志顶部补一条,' + '再继续——避免压缩后细节丢失。', }, }; /** Return the message table for a resolved language, falling back to English for an unknown key. */ function get(lang) { return TABLE[lang] || TABLE.en; } module.exports = { TABLE, get };