@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.
@@ -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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bolloon/bolloon-agent",
3
- "version": "0.3.32",
3
+ "version": "0.3.33",
4
4
  "type": "module",
5
5
  "description": "P2P AI Document Agent - 全局安装后执行 `bolloon` 启动产品",
6
6
  "main": "dist/cli-entry.js",