@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.
@@ -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" && index === 0) ||
179
- (executableName === "npm" && index === 0);
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbbtsn0w/adg",
3
- "version": "0.7.1-beta.7",
3
+ "version": "0.7.1-beta.8",
4
4
  "description": "Agent Directory Group (ADG) toolkit — two domains: plugins and skills.",
5
5
  "type": "module",
6
6
  "license": "MIT",