@noobdemon/noob-cli 1.10.15 → 1.10.17
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.
- package/package.json +1 -1
- package/src/agent.js +4 -4
package/package.json
CHANGED
package/src/agent.js
CHANGED
|
@@ -199,6 +199,8 @@ function runtimeContext() {
|
|
|
199
199
|
"- IMPORTANT: run_command runs in PowerShell on Windows — do NOT use Unix tools.",
|
|
200
200
|
" Use: Get-Content (not cat), Get-ChildItem (not ls), Select-String (not grep),",
|
|
201
201
|
" (Get-Content f | Measure-Object -Line) (not wc -l). Paths use backslashes.",
|
|
202
|
+
"- Trên Windows, script chạy bằng `script.bat` hoặc `script.cmd`, KHÔNG dùng `./script` (Unix).",
|
|
203
|
+
" VD: gradlew → gradlew.bat, mvnw → mvnw.cmd.",
|
|
202
204
|
"- Prefer the dedicated tools (read_file / list_dir / grep / glob) over shell commands;",
|
|
203
205
|
" they are cross-platform. Use run_command mainly for builds/tests/installs.",
|
|
204
206
|
);
|
|
@@ -522,10 +524,8 @@ export async function runAgent({ history, model, signal, onTool, onStatus, onDel
|
|
|
522
524
|
|
|
523
525
|
const system = buildSystem(history, extraToolsDoc, goal, recentSessions);
|
|
524
526
|
const message = buildUserMessage(history);
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
tokenMeter?.setContext(countTokens(system) + countTokens(message));
|
|
528
|
-
tokenMeter?.addInput(countTokens(message));
|
|
527
|
+
tokenMeter?.addInput(countTokens(system) + countTokens(message));
|
|
528
|
+
tokenMeter?.setContext(tokenMeter.total);
|
|
529
529
|
onStatus?.("thinking");
|
|
530
530
|
onDelta?.({ type: "step-start" });
|
|
531
531
|
// Stream + auto-retry: bao lớp resilience cho lỗi stream cut / empty / network.
|