@yeaft/webchat-agent 0.1.21 → 0.1.23

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "description": "Remote agent for Yeaft WebChat — connects worker machines to the central server",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -129,8 +129,9 @@ export async function handleListDirectory(msg) {
129
129
  } else {
130
130
  // Unix: 列出根目录
131
131
  const entries = await readdir('/', { withFileTypes: true });
132
+ const SKIP_DIRS = new Set(['.git', 'node_modules', '__pycache__', '.next', '.nuxt', '.cache']);
132
133
  const result = entries
133
- .filter(e => !e.name.startsWith('.'))
134
+ .filter(e => !(e.isDirectory() && SKIP_DIRS.has(e.name)))
134
135
  .map(e => ({ name: e.name, type: e.isDirectory() ? 'directory' : 'file', size: 0 }))
135
136
  .sort((a, b) => a.name.localeCompare(b.name));
136
137
  ctx.sendToServer({
@@ -161,10 +162,11 @@ export async function handleListDirectory(msg) {
161
162
  const entries = await readdir(resolved, { withFileTypes: true });
162
163
  const result = [];
163
164
 
165
+ const SKIP_DIRS = new Set(['.git', 'node_modules', '__pycache__', '.next', '.nuxt', '.cache']);
166
+
164
167
  for (const entry of entries) {
165
- // 跳过隐藏文件和 node_modules
166
- if (entry.name.startsWith('.') && entry.name !== '..') continue;
167
- if (entry.name === 'node_modules') continue;
168
+ // 跳过大型/内部目录(.git, node_modules 等),但显示 dotfiles(.env, .gitignore 等)
169
+ if (entry.isDirectory() && SKIP_DIRS.has(entry.name)) continue;
168
170
 
169
171
  try {
170
172
  const fullPath = join(resolved, entry.name);
@@ -26,7 +26,6 @@ export async function handleFileSearch(msg) {
26
26
  const entries = await readdir(dir, { withFileTypes: true });
27
27
  for (const entry of entries) {
28
28
  if (results.length >= MAX_RESULTS) return;
29
- if (entry.name.startsWith('.') && depth > 0) continue;
30
29
  if (skipDirs.has(entry.name) && entry.isDirectory()) continue;
31
30
 
32
31
  const fullPath = join(dir, entry.name);