@rbbtsn0w/adg 0.3.0-beta.7 → 0.3.0

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.
@@ -108,13 +108,16 @@ export async function marketplaceUpgrade(opts) {
108
108
  return results;
109
109
  }
110
110
  /** Merge per-agent sync results from several passes into one entry per agent. */
111
- function mergeAgentResults(groups) {
111
+ export function mergeAgentResults(groups) {
112
112
  const merged = new Map();
113
113
  for (const r of groups.flat()) {
114
114
  const existing = merged.get(r.agent);
115
115
  if (existing) {
116
116
  existing.affected = [...new Set([...existing.affected, ...r.affected])];
117
- existing.skipped = existing.skipped || r.skipped;
117
+ // Skipped only when EVERY pass skipped the agent (CLI absent throughout).
118
+ // If any pass ran, the agent was processed — matches addPlugins' merge so
119
+ // a skipped local rescan can't mask a successful remote re-activation.
120
+ existing.skipped = existing.skipped && r.skipped;
118
121
  }
119
122
  else {
120
123
  merged.set(r.agent, { ...r, affected: [...r.affected] });
@@ -38,10 +38,14 @@ export function formatColumns(items, opts = {}) {
38
38
  }
39
39
  /** Abbreviate the home-directory prefix of an absolute path to `~` (POSIX `/` or Windows `\`). */
40
40
  export function abbrevHome(p) {
41
- const home = homedir();
42
- if (p === home)
41
+ // Compare with separators normalized to "/" so a forward-slash path still
42
+ // matches a backslash homedir() on Windows. Slicing the original `p` keeps
43
+ // its native separators in the abbreviated suffix (lengths are 1:1).
44
+ const home = homedir().replace(/\\/g, "/");
45
+ const normP = p.replace(/\\/g, "/");
46
+ if (normP === home)
43
47
  return "~";
44
- if (p.startsWith(home + "/") || p.startsWith(home + "\\"))
48
+ if (normP.startsWith(home + "/"))
45
49
  return "~" + p.slice(home.length);
46
50
  return p;
47
51
  }
@@ -85,10 +85,14 @@ export function resolveLatestForChannel(currentVersion, distTags) {
85
85
  export function scheduleUpdateCacheRefresh(currentVersion, env = process.env) {
86
86
  try {
87
87
  const req = https.get(REGISTRY_URL, { headers: { "User-Agent": `adg/${currentVersion}`, Accept: REGISTRY_ACCEPT } }, (res) => {
88
+ // Decode as UTF-8 at the stream level so multi-byte characters split
89
+ // across chunk boundaries are reassembled correctly (raw Buffers would
90
+ // corrupt them).
91
+ res.setEncoding("utf8");
88
92
  let body = "";
89
93
  let byteCount = 0;
90
94
  res.on("data", (chunk) => {
91
- byteCount += Buffer.byteLength(chunk);
95
+ byteCount += Buffer.byteLength(chunk, "utf8");
92
96
  if (byteCount > MAX_RESPONSE_BYTES) {
93
97
  // Oversized payload: stop reading and abort so we neither buffer
94
98
  // unbounded memory nor parse a partial body.
@@ -96,7 +100,7 @@ export function scheduleUpdateCacheRefresh(currentVersion, env = process.env) {
96
100
  req.destroy();
97
101
  return;
98
102
  }
99
- body += String(chunk);
103
+ body += chunk;
100
104
  });
101
105
  res.on("end", () => {
102
106
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbbtsn0w/adg",
3
- "version": "0.3.0-beta.7",
3
+ "version": "0.3.0",
4
4
  "description": "Agent Directory Group (ADG) toolkit — two domains: plugins and skills.",
5
5
  "type": "module",
6
6
  "license": "MIT",