@rbbtsn0w/adg 0.7.1-beta.7 → 0.7.1-beta.8
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/src/telemetry.js +19 -3
- package/package.json +1 -1
package/dist/src/telemetry.js
CHANGED
|
@@ -166,17 +166,33 @@ export function sanitizeArgs(args) {
|
|
|
166
166
|
const safePositionals = executableName === "adg"
|
|
167
167
|
? new Set(["plugin", "plugins", "skill", "skills", "update", "add", "remove", "sync", "list", "status", "inspect", "validate", "migrate", "cache", "marketplace", "link", "unlink", "enable", "disable", "import-skills"])
|
|
168
168
|
: executableName === "git"
|
|
169
|
-
? new Set(["clone", "fetch", "pull", "rev-parse", "ls-remote", "show", "init", "add", "commit"])
|
|
169
|
+
? new Set(["clone", "fetch", "pull", "rev-parse", "ls-remote", "show", "init", "add", "commit", "sparse-checkout"])
|
|
170
170
|
: executableName === "npm"
|
|
171
171
|
? new Set(["install", "update", "exec"])
|
|
172
172
|
: new Set();
|
|
173
|
+
const optionsWithValues = executableName === "git"
|
|
174
|
+
? new Set(["-C", "-c", "--git-dir", "--work-tree", "--namespace", "--exec-path", "--super-prefix", "--config-env", "--attr-source"])
|
|
175
|
+
: executableName === "npm"
|
|
176
|
+
? new Set(["--prefix", "--workspace", "-w", "--userconfig", "--cache", "--registry"])
|
|
177
|
+
: new Set();
|
|
178
|
+
let commandPositionFound = false;
|
|
179
|
+
let optionValueExpected = false;
|
|
173
180
|
return [executableName ?? "", ...rest.map((arg, index) => {
|
|
181
|
+
if (optionValueExpected) {
|
|
182
|
+
optionValueExpected = false;
|
|
183
|
+
return "[VALUE]";
|
|
184
|
+
}
|
|
174
185
|
if (arg.startsWith("-")) {
|
|
186
|
+
if (!commandPositionFound && !arg.includes("=") && optionsWithValues.has(arg)) {
|
|
187
|
+
optionValueExpected = true;
|
|
188
|
+
}
|
|
175
189
|
return arg.includes("=") ? "[FLAG]=[VALUE]" : "[FLAG]";
|
|
176
190
|
}
|
|
177
191
|
const positionIsStructural = (executableName === "adg" && index <= 1) ||
|
|
178
|
-
(executableName === "git"
|
|
179
|
-
|
|
192
|
+
((executableName === "git" || executableName === "npm") && !commandPositionFound);
|
|
193
|
+
if (executableName === "git" || executableName === "npm") {
|
|
194
|
+
commandPositionFound = true;
|
|
195
|
+
}
|
|
180
196
|
if (positionIsStructural && safePositionals.has(arg)) {
|
|
181
197
|
return arg;
|
|
182
198
|
}
|