snow-ai 0.4.19 → 0.4.20
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/bundle/cli.mjs +15 -6
- package/package.json +1 -1
package/bundle/cli.mjs
CHANGED
|
@@ -472702,7 +472702,7 @@ var init_codebaseIndexAgent = __esm({
|
|
|
472702
472702
|
this.progressCallback = progressCallback;
|
|
472703
472703
|
}
|
|
472704
472704
|
try {
|
|
472705
|
-
this.fileWatcher = fs32.watch(this.projectRoot, { recursive: true }, (
|
|
472705
|
+
this.fileWatcher = fs32.watch(this.projectRoot, { recursive: true }, (eventType, filename) => {
|
|
472706
472706
|
if (!filename)
|
|
472707
472707
|
return;
|
|
472708
472708
|
const filePath = path39.join(this.projectRoot, filename);
|
|
@@ -472714,12 +472714,21 @@ var init_codebaseIndexAgent = __esm({
|
|
|
472714
472714
|
if (!_CodebaseIndexAgent.CODE_EXTENSIONS.has(ext)) {
|
|
472715
472715
|
return;
|
|
472716
472716
|
}
|
|
472717
|
-
|
|
472718
|
-
|
|
472719
|
-
|
|
472720
|
-
|
|
472717
|
+
const fileExists = fs32.existsSync(filePath);
|
|
472718
|
+
if (eventType === "rename") {
|
|
472719
|
+
if (fileExists) {
|
|
472720
|
+
logger.debug(`File created/renamed, indexing: ${relativePath}`);
|
|
472721
|
+
this.debounceFileChange(filePath, relativePath);
|
|
472722
|
+
} else {
|
|
472723
|
+
logger.debug(`File deleted/renamed away, removing from index: ${relativePath}`);
|
|
472724
|
+
this.db.deleteChunksByFile(relativePath);
|
|
472725
|
+
}
|
|
472726
|
+
} else if (eventType === "change") {
|
|
472727
|
+
if (fileExists) {
|
|
472728
|
+
logger.debug(`File modified, reindexing: ${relativePath}`);
|
|
472729
|
+
this.debounceFileChange(filePath, relativePath);
|
|
472730
|
+
}
|
|
472721
472731
|
}
|
|
472722
|
-
this.debounceFileChange(filePath, relativePath);
|
|
472723
472732
|
});
|
|
472724
472733
|
this.db.setWatcherEnabled(true);
|
|
472725
472734
|
logger.info("File watcher started successfully");
|