@noobdemon/noob-cli 1.10.1 → 1.10.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/repl.js +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noobdemon/noob-cli",
3
- "version": "1.10.1",
3
+ "version": "1.10.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/repl.js CHANGED
@@ -151,13 +151,13 @@ export async function startRepl(opts = {}) {
151
151
  const tokenMeter = new TokenMeter();
152
152
 
153
153
  // Set terminal title bar — hiện trên CMD/PowerShell.
154
+ // session chưa được khai báo ở đây → updateTitle() gọi SAU khi session = null (dòng ~295).
154
155
  const updateTitle = () => {
155
156
  const name = session?.title
156
157
  ? session.title.slice(0, 40) + (session.title.length > 40 ? "…" : "")
157
158
  : state.model.name;
158
159
  process.title = `noob — ${name}`;
159
160
  };
160
- updateTitle();
161
161
 
162
162
  // Prompt = dòng trạng thái sống. Luôn phản ánh yolo + version theo thời gian
163
163
  // thực (vẽ lại mỗi lượt và ngay khi Shift+Tab), nên không cần gõ /status.
@@ -291,6 +291,7 @@ export async function startRepl(opts = {}) {
291
291
 
292
292
  // ── phiên (session): lưu lịch sử + resume giống Claude Code ───────────────
293
293
  let session = null;
294
+ updateTitle(); // gọi lần đầu — state.model đã có, session chưa
294
295
  const persist = () => {
295
296
  if (!session || !state.history.length) return; // đừng lưu phiên rỗng
296
297
  session.history = state.history; // giữ đồng bộ tuyệt đối với history sống