@bolloon/bolloon-agent 0.3.32 → 0.3.33
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/dist/cli/mention-data.js +5 -2
- package/package.json +1 -1
package/dist/cli/mention-data.js
CHANGED
|
@@ -151,11 +151,14 @@ const SKIP_DIRS = new Set([
|
|
|
151
151
|
'coverage', '.next', '.nuxt', '.venv', 'venv', '__pycache__', 'tmp', 'release',
|
|
152
152
|
'.bolloon', '.boll', '.turbo', '.idea', '.vscode', 'bin', 'lib', 'assets',
|
|
153
153
|
]);
|
|
154
|
-
/** cwd 有限深度 BFS, 只收文件, 上限 cap 个,
|
|
155
|
-
export async function loadFiles(_query, base = process.cwd(), maxDepth = 3, cap = 400) {
|
|
154
|
+
/** cwd 有限深度 BFS, 只收文件, 上限 cap 个, 排序稳定; 超时兜底 (冷缓存 fs.readdir 偶发挂起, 2026-08-05) */
|
|
155
|
+
export async function loadFiles(_query, base = process.cwd(), maxDepth = 3, cap = 400, timeoutMs = 5000) {
|
|
156
156
|
const out = [];
|
|
157
|
+
const deadline = Date.now() + timeoutMs;
|
|
157
158
|
const stack = [{ dir: base, depth: 0 }];
|
|
158
159
|
while (stack.length > 0 && out.length < cap) {
|
|
160
|
+
if (Date.now() > deadline)
|
|
161
|
+
break; // 超时返回已收集部分, 弹窗不卡"扫描中"
|
|
159
162
|
const { dir, depth } = stack.pop();
|
|
160
163
|
let entries;
|
|
161
164
|
try {
|