log-llm-config 1.0.26 → 1.0.27
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/log_config_files.js +19 -3
- package/package.json +1 -1
package/dist/log_config_files.js
CHANGED
|
@@ -84,10 +84,24 @@ const DIR_GLOB_BY_FILE_TYPE = {
|
|
|
84
84
|
};
|
|
85
85
|
/** Max depth for recursive glob (path containing **) to avoid runaway. */
|
|
86
86
|
const RECURSIVE_GLOB_MAX_DEPTH = 20;
|
|
87
|
+
/**
|
|
88
|
+
* Directories under home to skip when recursing (e.g. home-dir recursive glob for .clawhub/lock.json).
|
|
89
|
+
* These trigger macOS Files and Folders permission prompts; we don't need them for config collection.
|
|
90
|
+
*/
|
|
91
|
+
const HOME_RECURSE_SKIP_DIRS = new Set([
|
|
92
|
+
'Desktop',
|
|
93
|
+
'Documents',
|
|
94
|
+
'Downloads',
|
|
95
|
+
'Movies',
|
|
96
|
+
'Music',
|
|
97
|
+
'Pictures',
|
|
98
|
+
'Public',
|
|
99
|
+
]);
|
|
87
100
|
/**
|
|
88
101
|
* Expand a path pattern containing double-star into concrete file paths by recursing from a base dir.
|
|
89
102
|
* Finds e.g. all .clawhub/lock.json under home when suffix is /.clawhub/lock.json.
|
|
90
103
|
* Path pattern format: <base>**<suffix>.
|
|
104
|
+
* Skips Desktop, Documents, Downloads, etc. to avoid triggering macOS permission prompts.
|
|
91
105
|
*/
|
|
92
106
|
function expandRecursiveGlobPathPattern(pathPattern, fileType, home) {
|
|
93
107
|
const norm = pathPattern.replace(/\\/g, '/');
|
|
@@ -109,7 +123,7 @@ function expandRecursiveGlobPathPattern(pathPattern, fileType, home) {
|
|
|
109
123
|
const parts = after.split('/');
|
|
110
124
|
const dirName = parts[0];
|
|
111
125
|
const fileName = parts.length > 1 ? parts[parts.length - 1] : null;
|
|
112
|
-
function walk(dir, depth) {
|
|
126
|
+
function walk(dir, depth, isHomeRoot) {
|
|
113
127
|
if (depth > RECURSIVE_GLOB_MAX_DEPTH)
|
|
114
128
|
return;
|
|
115
129
|
if (!existsSync(dir))
|
|
@@ -119,13 +133,15 @@ function expandRecursiveGlobPathPattern(pathPattern, fileType, home) {
|
|
|
119
133
|
for (const entry of entries) {
|
|
120
134
|
const full = join(dir, entry.name);
|
|
121
135
|
if (entry.isDirectory()) {
|
|
136
|
+
if (isHomeRoot && HOME_RECURSE_SKIP_DIRS.has(entry.name))
|
|
137
|
+
continue;
|
|
122
138
|
if (entry.name === dirName) {
|
|
123
139
|
const filePath = parts.length === 1 ? full : join(full, ...parts.slice(1));
|
|
124
140
|
if (fileName && existsSync(filePath)) {
|
|
125
141
|
targets.push({ path: filePath, file_type: fileType });
|
|
126
142
|
}
|
|
127
143
|
}
|
|
128
|
-
walk(full, depth + 1);
|
|
144
|
+
walk(full, depth + 1, false);
|
|
129
145
|
}
|
|
130
146
|
}
|
|
131
147
|
}
|
|
@@ -133,7 +149,7 @@ function expandRecursiveGlobPathPattern(pathPattern, fileType, home) {
|
|
|
133
149
|
// ignore read errors
|
|
134
150
|
}
|
|
135
151
|
}
|
|
136
|
-
walk(basePath, 0);
|
|
152
|
+
walk(basePath, 0, true);
|
|
137
153
|
return targets;
|
|
138
154
|
}
|
|
139
155
|
/**
|