agent-guardrails 0.3.8 → 0.3.9
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/lib/daemon/worker.js +4 -0
- package/package.json +1 -1
package/lib/daemon/worker.js
CHANGED
|
@@ -264,6 +264,10 @@ export async function run({ repoRoot, config, foreground = false, locale = null
|
|
|
264
264
|
|
|
265
265
|
// Start file watcher
|
|
266
266
|
watcher = await createWatcher(repoRoot, config, (filePath) => {
|
|
267
|
+
const absolutePath = path.resolve(filePath);
|
|
268
|
+
if (!absolutePath.startsWith(path.resolve(repoRoot) + path.sep) && absolutePath !== path.resolve(repoRoot)) {
|
|
269
|
+
return; // 跳过项目目录外的文件变更
|
|
270
|
+
}
|
|
267
271
|
log(`File changed: ${filePath}`);
|
|
268
272
|
info.incrementChecks();
|
|
269
273
|
info.updateLastCheck();
|