@agentprojectcontext/apx 1.60.0 → 1.60.1
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
|
@@ -23,6 +23,10 @@ const SKIP_DIRS = new Set([
|
|
|
23
23
|
"node_modules", ".git", "dist", "build", ".next", ".turbo", ".nuxt",
|
|
24
24
|
"coverage", ".cache", ".venv", "venv", "__pycache__", ".pytest_cache",
|
|
25
25
|
".idea", ".vscode", ".DS_Store",
|
|
26
|
+
// Dependency / build caches from other ecosystems — these dominate the tree
|
|
27
|
+
// (a Composer `vendor/` alone can be tens of thousands of files) and would
|
|
28
|
+
// otherwise exhaust the node budget before the project's own files list.
|
|
29
|
+
"vendor", "bower_components", "Pods", ".terraform", ".gradle",
|
|
26
30
|
]);
|
|
27
31
|
|
|
28
32
|
const TEXT_EXTS = new Set([
|
|
@@ -103,20 +107,35 @@ function walk(absDir, relPrefix, budget) {
|
|
|
103
107
|
dirs.sort((a, b) => a.name.localeCompare(b.name));
|
|
104
108
|
files.sort((a, b) => a.name.localeCompare(b.name));
|
|
105
109
|
|
|
110
|
+
// Two passes so a folder's OWN contents are never hidden by a deep subtree:
|
|
111
|
+
// 1) list every direct child (dirs + files) of this level, then
|
|
112
|
+
// 2) descend into the subdirs. Without this, a huge branch (e.g. `vendor/`)
|
|
113
|
+
// consumed the whole node budget depth-first and the sibling files that
|
|
114
|
+
// sort after the dirs — the project's root files — never got listed.
|
|
106
115
|
const out = [];
|
|
116
|
+
const pending = []; // dir nodes to recurse into after the direct listing
|
|
107
117
|
for (const ent of [...dirs, ...files]) {
|
|
108
118
|
if (budget.count >= MAX_NODES) {
|
|
109
119
|
budget.truncated = true;
|
|
110
|
-
|
|
120
|
+
return out;
|
|
111
121
|
}
|
|
112
122
|
budget.count += 1;
|
|
113
123
|
const rel = relPrefix ? `${relPrefix}/${ent.name}` : ent.name;
|
|
114
124
|
if (ent.isDirectory()) {
|
|
115
|
-
|
|
125
|
+
const node = { name: ent.name, path: rel, type: "dir", children: [] };
|
|
126
|
+
out.push(node);
|
|
127
|
+
pending.push({ node, abs: path.join(absDir, ent.name), rel });
|
|
116
128
|
} else {
|
|
117
129
|
out.push({ name: ent.name, path: rel, type: "file", kind: classifyKind(ent.name) });
|
|
118
130
|
}
|
|
119
131
|
}
|
|
132
|
+
for (const { node, abs, rel } of pending) {
|
|
133
|
+
if (budget.count >= MAX_NODES) {
|
|
134
|
+
budget.truncated = true;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
node.children = walk(abs, rel, budget);
|
|
138
|
+
}
|
|
120
139
|
return out;
|
|
121
140
|
}
|
|
122
141
|
|