@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
|
-
|
|
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] });
|
package/dist/src/render/ui.js
CHANGED
|
@@ -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
|
-
|
|
42
|
-
|
|
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 (
|
|
48
|
+
if (normP.startsWith(home + "/"))
|
|
45
49
|
return "~" + p.slice(home.length);
|
|
46
50
|
return p;
|
|
47
51
|
}
|
package/dist/src/update-check.js
CHANGED
|
@@ -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 +=
|
|
103
|
+
body += chunk;
|
|
100
104
|
});
|
|
101
105
|
res.on("end", () => {
|
|
102
106
|
try {
|