opencode-supertask 0.1.27 → 0.1.28
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/cli/index.js
CHANGED
|
@@ -26465,16 +26465,18 @@ function latestVersion() {
|
|
|
26465
26465
|
const detail = `${result.stderr ?? ""}`.trim();
|
|
26466
26466
|
throw new Error(`[supertask] \u67E5\u8BE2 npm latest \u5931\u8D25: ${detail || `\u9000\u51FA\u7801 ${result.status}`}`);
|
|
26467
26467
|
}
|
|
26468
|
-
let
|
|
26468
|
+
let response;
|
|
26469
26469
|
try {
|
|
26470
|
-
|
|
26470
|
+
response = JSON.parse(output);
|
|
26471
26471
|
} catch {
|
|
26472
26472
|
throw new Error(`[supertask] npm latest \u8FD4\u56DE\u65E0\u6CD5\u89E3\u6790: ${output || "(empty)"}`);
|
|
26473
26473
|
}
|
|
26474
|
-
|
|
26475
|
-
|
|
26474
|
+
const versions = typeof response === "string" ? [response] : Array.isArray(response) && response.every((value) => typeof value === "string") ? response : [];
|
|
26475
|
+
const uniqueVersions = [...new Set(versions)];
|
|
26476
|
+
if (uniqueVersions.length !== 1 || !isSemanticVersion(uniqueVersions[0])) {
|
|
26477
|
+
throw new Error(`[supertask] npm latest \u7248\u672C\u65E0\u6548: ${String(response)}`);
|
|
26476
26478
|
}
|
|
26477
|
-
return
|
|
26479
|
+
return uniqueVersions[0];
|
|
26478
26480
|
}
|
|
26479
26481
|
function resolveInstalledVersion(expectedVersion) {
|
|
26480
26482
|
const override = process.env.SUPERTASK_PLUGIN_PACKAGE_DIR;
|