@rbbtsn0w/adg 0.6.0-beta.3 → 0.6.0-beta.4

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/bin/adg.js CHANGED
@@ -104,7 +104,6 @@ async function main(argv) {
104
104
  let status = 0;
105
105
  try {
106
106
  span.setAttribute("process.executable.name", "adg");
107
- span.setAttribute("process.executable.path", process.argv[1] || process.execPath);
108
107
  span.setAttribute("process.pid", process.pid);
109
108
  span.setAttribute("process.command_args", sanitizeArgs(["adg", ...argv]));
110
109
  // Check for an available update (reads local cache; schedules a background
@@ -90,7 +90,7 @@ export function cloneGitHub(src, dest, opts = {}) {
90
90
  }
91
91
  return dest;
92
92
  }
93
- const defaultGitRunner = (args) => {
93
+ export const defaultGitRunner = (args) => {
94
94
  const tracer = getTracer();
95
95
  return tracer.startActiveSpan("git", { kind: SpanKind.CLIENT }, (span) => {
96
96
  try {
@@ -50,32 +50,39 @@ export async function shutdownTelemetry() {
50
50
  }
51
51
  }
52
52
  }
53
+ /**
54
+ * Unconditionally redact any non-empty string passed to it.
55
+ * Telemetry consumers need the command skeleton (subcommands + flags),
56
+ * not path details. Returning a fixed placeholder eliminates all
57
+ * path-related privacy edge cases.
58
+ */
59
+ export function sanitizePath(path) {
60
+ if (!path)
61
+ return "";
62
+ return "[PATH]";
63
+ }
53
64
  export function sanitizeArgs(args) {
54
65
  return args.map((arg) => {
55
- if (arg.startsWith("ghp_") ||
56
- arg.startsWith("gho_") ||
57
- arg.startsWith("ghu_") ||
58
- arg.startsWith("ghs_") ||
59
- arg.startsWith("ghr_") ||
60
- arg.startsWith("github_pat_")) {
61
- return "[REDACTED_TOKEN]";
62
- }
63
- if (arg.includes("@") && (arg.startsWith("http://") || arg.startsWith("https://"))) {
64
- try {
65
- const url = new URL(arg);
66
- if (url.username) {
67
- url.username = "[REDACTED]";
68
- }
69
- if (url.password) {
70
- url.password = "[REDACTED]";
71
- }
72
- return url.toString();
66
+ if (arg.startsWith("-")) {
67
+ const eqIndex = arg.indexOf("=");
68
+ if (eqIndex !== -1) {
69
+ return `${arg.slice(0, eqIndex)}=[VALUE]`;
70
+ }
71
+ if (arg.startsWith("--") && /^--[a-zA-Z0-9-]+$/.test(arg)) {
72
+ return arg;
73
73
  }
74
- catch {
75
- return "[REDACTED_URL]";
74
+ if (/^-[a-zA-Z0-9]$/.test(arg)) {
75
+ return arg;
76
76
  }
77
+ if (/^-[a-zA-Z0-9]/.test(arg)) {
78
+ return `${arg.slice(0, 2)}[VALUE]`;
79
+ }
80
+ return "[VALUE]";
81
+ }
82
+ if (/^[a-z]+(-[a-z]+)*$/.test(arg) || /^[0-9]+$/.test(arg)) {
83
+ return arg;
77
84
  }
78
- return arg;
85
+ return "[VALUE]";
79
86
  });
80
87
  }
81
88
  /** Record a privacy-safe event without allowing telemetry to affect CLI behavior. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbbtsn0w/adg",
3
- "version": "0.6.0-beta.3",
3
+ "version": "0.6.0-beta.4",
4
4
  "description": "Agent Directory Group (ADG) toolkit — two domains: plugins and skills.",
5
5
  "type": "module",
6
6
  "license": "MIT",