@noobdemon/noob-cli 1.7.3 → 1.7.4
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 +14 -0
package/package.json
CHANGED
package/src/agent.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import os from "node:os";
|
|
2
2
|
import { stream } from "./api.js";
|
|
3
3
|
import { loadMemory } from "./memory.js";
|
|
4
|
+
import { listRoots } from "./tools.js";
|
|
4
5
|
import { t } from "./i18n.js";
|
|
5
6
|
import { countTokens } from "./tokens.js";
|
|
6
7
|
|
|
@@ -92,6 +93,19 @@ function runtimeContext() {
|
|
|
92
93
|
`- Shell for run_command: ${isWin ? "Windows PowerShell (powershell.exe)" : "bash"}`,
|
|
93
94
|
`- Current working directory: ${process.cwd()}`,
|
|
94
95
|
];
|
|
96
|
+
// Extra roots cấp qua /add-dir: model PHẢI biết để chủ động dùng (đọc/list/grep).
|
|
97
|
+
// Không liệt kê ở đây → model không 'thấy' thư mục đó tồn tại dù tools layer
|
|
98
|
+
// đã accept path.
|
|
99
|
+
try {
|
|
100
|
+
const roots = listRoots();
|
|
101
|
+
const extras = roots.slice(1); // [0] là cwd
|
|
102
|
+
if (extras.length) {
|
|
103
|
+
lines.push(
|
|
104
|
+
`- Extra roots cấp quyền qua /add-dir (tool path nằm trong các thư mục này cũng hợp lệ — dùng path tuyệt đối khi gọi tool):`,
|
|
105
|
+
);
|
|
106
|
+
for (const r of extras) lines.push(` • ${r}`);
|
|
107
|
+
}
|
|
108
|
+
} catch {}
|
|
95
109
|
if (isWin) {
|
|
96
110
|
lines.push(
|
|
97
111
|
"- IMPORTANT: run_command runs in PowerShell on Windows — do NOT use Unix tools.",
|