@wpro-eng/opencode-config 1.5.1 → 1.6.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.
- package/dist/index.js +34 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10403,10 +10403,16 @@ var WpromoteConfigPlugin = async (ctx) => {
|
|
|
10403
10403
|
if (gitignoreResult.modified) {
|
|
10404
10404
|
log(`Added _plugins/ to .gitignore at ${gitignoreResult.gitRoot}`);
|
|
10405
10405
|
}
|
|
10406
|
+
let updateApplied = false;
|
|
10407
|
+
let updateFrom = null;
|
|
10408
|
+
let updateTo = null;
|
|
10406
10409
|
try {
|
|
10407
10410
|
const updateResult = await checkAndUpdate();
|
|
10408
10411
|
if (updateResult.installed) {
|
|
10409
|
-
|
|
10412
|
+
updateApplied = true;
|
|
10413
|
+
updateFrom = updateResult.previousVersion;
|
|
10414
|
+
updateTo = updateResult.latestVersion;
|
|
10415
|
+
log(`Plugin updated: ${updateFrom ?? "unknown"} \u2192 ${updateTo}`);
|
|
10410
10416
|
}
|
|
10411
10417
|
} catch (err) {
|
|
10412
10418
|
logError(`Auto-update check failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -10445,6 +10451,33 @@ var WpromoteConfigPlugin = async (ctx) => {
|
|
|
10445
10451
|
}
|
|
10446
10452
|
}
|
|
10447
10453
|
log(message);
|
|
10454
|
+
const pluginVersion = getPluginVersion();
|
|
10455
|
+
const showToasts = async () => {
|
|
10456
|
+
try {
|
|
10457
|
+
if (updateApplied && updateTo) {
|
|
10458
|
+
await ctx.client.tui.showToast({
|
|
10459
|
+
body: {
|
|
10460
|
+
title: "wpromote-config updated",
|
|
10461
|
+
message: `${updateFrom ?? "unknown"} \u2192 ${updateTo}`,
|
|
10462
|
+
variant: "success",
|
|
10463
|
+
duration: 5000
|
|
10464
|
+
}
|
|
10465
|
+
});
|
|
10466
|
+
} else {
|
|
10467
|
+
await ctx.client.tui.showToast({
|
|
10468
|
+
body: {
|
|
10469
|
+
title: "wpromote-config",
|
|
10470
|
+
message: `v${pluginVersion ?? "unknown"}`,
|
|
10471
|
+
variant: "info",
|
|
10472
|
+
duration: 3000
|
|
10473
|
+
}
|
|
10474
|
+
});
|
|
10475
|
+
}
|
|
10476
|
+
} catch {
|
|
10477
|
+
logDebug("Could not show startup toast (TUI may not be ready)");
|
|
10478
|
+
}
|
|
10479
|
+
};
|
|
10480
|
+
showToasts();
|
|
10448
10481
|
return {
|
|
10449
10482
|
config: async (config) => {
|
|
10450
10483
|
if (config.plugin !== undefined && !Array.isArray(config.plugin)) {
|