@noobdemon/noob-cli 1.9.8 → 1.9.10

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/agent.js +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noobdemon/noob-cli",
3
- "version": "1.9.8",
3
+ "version": "1.9.10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/agent.js CHANGED
@@ -33,7 +33,7 @@ Available tools (each is self-contained; pick the SMALLEST tool that answers the
33
33
  Context is finite. Don't slurp the whole repo up front. Discover information progressively: list_dir/glob to map → grep to locate → read_file (with offset+limit for big files) to inspect only what matters. Each tool result spends your attention budget — make every call earn it. When a tool returns a huge blob, extract the few facts you need, then move on; don't re-read it later (the result stays in history).
34
34
 
35
35
  # Rules
36
- - TODO-BASED EXECUTION: For any multi-step task (3+ actions), CREATE a todo list FIRST in your response text (NOT in a file just write them as "- [ ] task name" in your reply). Then WORK THROUGH EVERY ITEM, checking them off ("- [x] task name") as you complete each. The runtime parses your text for these markers and shows a progress bar to the user. BEFORE summarizing or claiming "done", verify ALL items are "- [x]". If ANY remain unchecked, CONTINUE do not stop. NEVER stop mid-plan.
36
+ - TODO-BASED EXECUTION: For any multi-step task (3+ actions), you MUST do TWO things in the SAME response: (1) write the todo list as "- [ ] task" markers, and (2) IMMEDIATELY start working on the FIRST unchecked item do NOT stop after writing the list. The todo list is NOT output it is a planning step. NEVER output a todo list and then stop. After checking off an item ("- [x]"), CONTINUE to the next unchecked item in the SAME response. Only stop when ALL items are "- [x]" or you are waiting for a tool result. Before claiming "done", verify ALL items are checked. NEVER stop mid-plan.
37
37
  - GROUND TRUTH = real TOOL RESULTs in this conversation, not your memory or what you intended to do. A file changed only if a write_file/edit_file result confirms it (see the FILES CHANGED list). A test passed / build succeeded / command worked only if a run_command result above shows it. Never narrate outcomes you didn't observe; if you haven't checked, say so and check now (read_file / list_dir / run the command). Before any "done/summary" reply, reconcile every file and result you're about to claim against the actual tool results above — if it isn't there, you didn't do it yet.
38
38
  - Investigate before editing: read the relevant files first; never invent file contents.
39
39
  - Make the smallest change that fully solves the task. Match the surrounding code style.
@@ -513,6 +513,9 @@ export async function runAgent({ history, model, signal, onTool, onStatus, onDel
513
513
 
514
514
  const system = buildSystem(history, extraToolsDoc, goal, recentSessions);
515
515
  const message = buildUserMessage(history);
516
+ // Cập nhật context tokens realtime — đếm system + message sau khi build xong.
517
+ // Mỗi iteration (tool call, steer) history thay đổi → size thay đổi → cần update.
518
+ tokenMeter?.setContext(countTokens(system) + countTokens(message));
516
519
  tokenMeter?.addInput(countTokens(message));
517
520
  onStatus?.("thinking");
518
521
  onDelta?.({ type: "step-start" });