mocode-ai 0.4.6 → 0.4.8

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.
@@ -591,10 +591,6 @@ export async function startRepl(initialHistory, sessionId, updateNotice = null,
591
591
  else {
592
592
  layout.contentWrite(bannerString(banner()));
593
593
  }
594
- if (updateNotice) {
595
- // 自更新提示:开场静态段(进 INPUT 态前),dim 一行,不与流式 / 输入争用。
596
- layout.contentWrite(` ${ui.gray}↳ ${updateNotice}${ui.reset}\n`);
597
- }
598
594
  if (!isModelConfigured()) {
599
595
  // 未配置 baseURL/apiKey:醒目提示引导 /model(不退出,REPL 仍可用;发消息会失败但不崩)。
600
596
  layout.contentWrite(`${ui.yellow} ⚠ 未配置大模型。输入 ${ui.cyan}/model${ui.yellow} 配置 baseURL / apiKey / model(即时生效),或退出后运行 ${ui.cyan}mocode config${ui.yellow} 走向导。${ui.reset}\n`);
@@ -620,6 +616,11 @@ export async function startRepl(initialHistory, sessionId, updateNotice = null,
620
616
  }
621
617
  }
622
618
  layout.contentWrite(`${ui.dim} /plan · /auto · Shift+Tab 切换模式(plan:只读探查 + 产出计划,审批后切 auto 执行)${ui.reset}\n`);
619
+ if (updateNotice) {
620
+ // 自更新提示:放 /plan · /auto 行下方,黄色(警示色)突出"你正在用的版本较旧",与 dim 提示区分。
621
+ // 开场静态段(进 INPUT 态前),一行,纯文本不与流式 / 输入争用。
622
+ layout.contentWrite(` ${ui.yellow}⚠ ${updateNotice}${ui.reset}\n`);
623
+ }
623
624
  /**
624
625
  * 切换 agent 模式(Shift+Tab 触发,经 prompt.ts 的 onCycleMode 回调)。
625
626
  * cycleMode 翻 agentMode + applyMode 重写 history[0] + refreshStatusBase 设状态行 modeTag;
@@ -126,13 +126,15 @@ export function compareSemver(a, b) {
126
126
  }
127
127
  return 0;
128
128
  }
129
- /** 纯决策:据当前版本 / 缓存 / 时间,算是否提示 / spawn / 后台刷新。无副作用,可离线测。 */
129
+ /** 纯决策:据当前版本 / 缓存 / 时间,算是否提示 / spawn / 后台刷新。无副作用,可离线测。
130
+ * notice 同时携带当前版本(`current`)与最新版本(`latest`),让 REPL 提示能向用户
131
+ * 清晰展示"你正在用的 mocode 是 X,最新是 Y",不只是单调的"有新版本"。 */
130
132
  export function evaluateUpdate(current, cache, now) {
131
133
  const refresh = !cache.latest || now - (cache.lastCheck ?? 0) > CHECK_INTERVAL_MS;
132
134
  let notice = null;
133
135
  let spawn = false;
134
136
  if (cache.latest && compareSemver(cache.latest, current) > 0) {
135
- notice = `检测到新版本 ${cache.latest},后台更新中,下次启动生效。`;
137
+ notice = `当前 mocode v${current} 已是较旧版本,最新为 v${cache.latest},后台更新中,下次启动生效。`;
136
138
  spawn = now - (cache.lastSpawn ?? 0) > SPAWN_INTERVAL_MS;
137
139
  }
138
140
  return { notice, spawn, refresh };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mocode-ai",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
4
  "description": "终端编码 agent:LLM + tool-call 循环 + 流式输出(含思考)+ 16 个工具,接任意 OpenAI 兼容后端。",
5
5
  "type": "module",
6
6
  "bin": {