mocode-ai 1.5.6 → 1.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -373,9 +373,10 @@ export function buildBasePrompt(sessionId = getCurrentSessionId()) {
373
373
  const notepadSection = buildNotepadSection(sessionId);
374
374
  // 静态主体:稳定段落集中在前,让支持 prompt caching 的后端能命中前缀缓存(#12)。
375
375
  // 约束:staticBody 的前缀段(尤其 ## Identity 第一行)必须是纯静态文本,
376
- // 不得嵌入会话级可变函数调用(如 t()/config.model)。否则 /language、/model
377
- // 切换会让最敏感的前缀变化,破坏自动前缀缓存命中。可变值统一放到
378
- // ## Reporting 段末尾(仍在切片边界之前,子 agent 仍能拿到)。
376
+ // 不得嵌入会话级可变函数调用(如 config.model)。否则 /model 切换会让最敏感的
377
+ // 前缀变化,破坏自动前缀缓存命中。
378
+ // 回复语言不写入提示词:模型按用户当轮提问语言自动识别(Voice 段的
379
+ // "Match the user's style and language" 已覆盖),/language 只切换终端 UI 文案。
379
380
  const staticBody = `## Identity
380
381
  You are mocode, a terminal coding agent.
381
382
 
@@ -422,8 +423,7 @@ ${buildVoiceSection()}
422
423
  - Stop immediately when no more tools are needed; give conclusions directly.
423
424
  - **Do not stop prematurely during exploration**: if you started investigating but haven't gathered enough information to answer the user's question, keep calling tools. Only stop when you have sufficient evidence or hit a dead end.
424
425
  - **No flattery / no preamble in conclusions**: skip "Sure", "好的", "我已经完成了" and similar no-information prefixes — jump straight to substance.
425
- - Report honestly: say success when successful, say where you're stuck when failing, and mention anything skipped. Reference code in "path:line" format (e.g., src/index.ts:42). Keep it concise.
426
- ${t('assistant.languageInstruction')}`;
426
+ - Report honestly: say success when successful, say where you're stuck when failing, and mention anything skipped. Reference code in "path:line" format (e.g., src/index.ts:42). Keep it concise.`;
427
427
  // 动态段(置于末尾):AGENTS.md 项目记忆 + notepad 索引/说明。工具簇特定指导由
428
428
  // ToolPolicyController.reminder() 按当前 turn 的 route 注入,避免旧全局 profile 与真实 schema 分裂。
429
429
  // 按需注入(#13):有内容的索引才拼对应标题,避免空标题噪声。
@@ -735,7 +735,7 @@ export function updateMemoryConfig(enabled) {
735
735
  config.memoryEnabled = enabled;
736
736
  process.env.MEMORY_ENABLED = enabled ? 'true' : 'false';
737
737
  }
738
- /** 切换界面与模型回复语言;持久化由 REPL 调用 config/file.ts 完成。 */
738
+ /** 切换终端界面语言(回复语言不写入提示词,由模型按用户提问自动识别);持久化由 REPL 调用 config/file.ts 完成。 */
739
739
  export function updateLanguageConfig(language) {
740
740
  setLanguage(language);
741
741
  process.env.MOCODE_LANGUAGE = language;
@@ -54,7 +54,7 @@ const zhCN = {
54
54
  'commands.imageAttach': '附加本地图片',
55
55
  'commands.imageList': '列出待发送图片',
56
56
  'commands.imageClear': '清空待发送图片',
57
- 'commands.language': '切换界面与回复语言',
57
+ 'commands.language': '切换界面语言',
58
58
  'commands.languageZh': '切换到中文',
59
59
  'commands.languageEn': 'Switch to English',
60
60
  'commands.upgrade': '升级 mocode 到最新版本',
@@ -327,7 +327,6 @@ const zhCN = {
327
327
  'upgrade.pkgName': '包名:mocode-ai',
328
328
  'upgrade.failed': '[upgrade] 失败:{message}',
329
329
  'upgrade.usage': '/upgrade 用法:\n /upgrade 升级到最新版本\n /upgrade now 同 /upgrade\n /upgrade check 检查当前版本与最新版本差异\n /upgrade status 显示当前本地版本',
330
- 'assistant.languageInstruction': 'Reply to the user in Chinese.',
331
330
  };
332
331
  const en = {
333
332
  'common.none': '(none)',
@@ -385,7 +384,7 @@ const en = {
385
384
  'commands.imageAttach': 'Attach a local image',
386
385
  'commands.imageList': 'List pending images',
387
386
  'commands.imageClear': 'Clear pending images',
388
- 'commands.language': 'Switch interface and reply language',
387
+ 'commands.language': 'Switch interface language',
389
388
  'commands.languageZh': '切换到中文',
390
389
  'commands.languageEn': 'Switch to English',
391
390
  'commands.upgrade': 'Upgrade mocode to the latest version',
@@ -658,7 +657,6 @@ const en = {
658
657
  'upgrade.pkgName': 'Package: mocode-ai',
659
658
  'upgrade.failed': '[upgrade] failed: {message}',
660
659
  'upgrade.usage': 'Usage: /upgrade\n /upgrade Upgrade to latest\n /upgrade now Same as /upgrade\n /upgrade check Check current vs latest\n /upgrade status Show current local version',
661
- 'assistant.languageInstruction': 'Reply to the user in English.',
662
660
  };
663
661
  const resources = {
664
662
  'zh-CN': zhCN,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mocode-ai",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "description": "终端编码 agent:LLM + tool-call 循环 + 流式输出(含思考)+ 25 个工具,接任意 OpenAI 兼容后端。",
5
5
  "type": "module",
6
6
  "bin": {