opencode-supertask 0.1.37 → 0.1.39

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/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  All notable user-facing changes are recorded here. This project follows semantic versioning while it is in the `0.x` development series.
4
4
 
5
+ ## [0.1.39] - 2026-07-18
6
+
7
+ ### Fixed
8
+
9
+ - `supertask upgrade` now exits without reinstalling or restarting when the CLI, effective plugin configuration, plugin cache, and ready PM2 Gateway already match npm `latest`.
10
+ - Added `supertask upgrade --force` for intentionally reinstalling the current version, refreshing the Gateway environment, and restarting PM2.
11
+ - The OpenCode `supertask_upgrade` tool now reports an up-to-date no-op instead of restarting an already converged Gateway.
12
+
13
+ [0.1.39]: https://github.com/vbgate/opencode-supertask/compare/v0.1.38...v0.1.39
14
+
15
+ ## [0.1.38] - 2026-07-18
16
+
17
+ ### Fixed
18
+
19
+ - `supertask doctor` now reads large resolved OpenCode configurations through a private temporary file, avoiding truncated JSON when OpenCode exits before a captured stdout pipe is fully drained.
20
+ - Successful runs no longer label truncated or unstructured JSONL fragments as failure reasons in task details and execution logs.
21
+
22
+ [0.1.38]: https://github.com/vbgate/opencode-supertask/compare/v0.1.37...v0.1.38
23
+
5
24
  ## [0.1.37] - 2026-07-18
6
25
 
7
26
  ### Fixed
package/README.md CHANGED
@@ -32,11 +32,11 @@ supertask gateway # foreground mode: no pm2 required
32
32
 
33
33
  The plugin never installs global dependencies by itself. Without a running Gateway, queue-management tools still work, but scheduled and queued tasks are not executed and the Dashboard is unavailable.
34
34
 
35
- Upgrades do not require uninstalling. Run `supertask upgrade`: it pins the exact latest plugin, replaces the Gateway, detects whether the global `supertask` came from npm or Bun, and synchronizes the CLI to that same version. `supertask doctor` fails if the CLI, plugin, Gateway package, or ready lock disagree. Versions through 0.1.33 cannot retroactively update their own old CLI, so upgrade from those releases by installing the new global CLI once with the original package manager, then run the new `supertask upgrade`.
35
+ Upgrades do not require uninstalling. Run `supertask upgrade`: it pins the exact latest plugin, replaces the Gateway, detects whether the global `supertask` came from npm or Bun, and synchronizes the CLI to that same version. When the CLI, effective plugin, cache, and ready Gateway already match npm `latest`, the command exits without reinstalling or restarting; use `supertask upgrade --force` to intentionally refresh the environment and restart the current version. `supertask doctor` fails if the CLI, plugin, Gateway package, or ready lock disagree. Versions through 0.1.33 cannot retroactively update their own old CLI, so upgrade from those releases by installing the new global CLI once with the original package manager, then run the new `supertask upgrade`.
36
36
 
37
37
  Gateway task execution currently requires macOS or Linux. Windows is rejected at startup until the Worker can use an OS Job Object to guarantee that detached OpenCode descendants cannot survive cancellation or recovery.
38
38
 
39
- Run `supertask install` and `supertask upgrade` from the same terminal environment in which `opencode run --agent <name>` works. An explicit install or upgrade refreshes the Gateway's OpenCode/XDG/provider execution environment while keeping the proven Bun path, PM2 identity, database/config scope, and rollback runtime pinned. This matters when a custom primary agent selects a provider through environment variables or a non-default OpenCode config directory.
39
+ Run `supertask install` and `supertask upgrade` from the same terminal environment in which `opencode run --agent <name>` works. An install or version-changing upgrade refreshes the Gateway's OpenCode/XDG/provider execution environment while keeping the proven Bun path, PM2 identity, database/config scope, and rollback runtime pinned. Use `supertask upgrade --force` when the version is already current but the saved environment needs refreshing.
40
40
 
41
41
  ### Uninstall
42
42
 
@@ -131,7 +131,7 @@ supertask config # show current config
131
131
  supertask doctor [--json] # static end-to-end runtime diagnostics
132
132
  supertask doctor --smoke [--smoke-agent build] [--smoke-model provider/model]
133
133
  # queue one real Gateway/OpenCode verification task
134
- supertask upgrade # pin latest plugin version and replace Gateway
134
+ supertask upgrade [--force] # update if needed; force refreshes and restarts
135
135
 
136
136
  # Task management
137
137
  supertask add -n "Task" -a "agent" -p "prompt" --importance 5 \
@@ -295,9 +295,9 @@ supertask gateway # 前台运行:不需要 pm2
295
295
 
296
296
  插件不会自行安装全局依赖。Gateway 未运行时仍可管理队列,但不会执行排队/定时任务,也不会启动 Web 控制台。
297
297
 
298
- 升级无需卸载,执行 `supertask upgrade`。它会精确安装最新插件、替换 Gateway,并根据全局 `supertask` 的真实路径识别 npm 或 Bun 后同步 CLI;无法安全确认包管理器时会明确失败并给出精确命令。`doctor` 把 CLI、插件、Gateway 任一版本不一致视为异常。由于 0.1.33 及更早版本还不具备 CLI 自动同步能力,从这些版本升级时先用原包管理器安装一次新 CLI,再运行新版 `supertask upgrade`。
298
+ 升级无需卸载,执行 `supertask upgrade`。它会精确安装最新插件、替换 Gateway,并根据全局 `supertask` 的真实路径识别 npm 或 Bun 后同步 CLI;当 CLI、有效插件配置、缓存和就绪 Gateway 已全部匹配 npm `latest` 时直接返回,不重新安装或重启。需要在同版本下强制刷新环境时执行 `supertask upgrade --force`。无法安全确认包管理器时会明确失败并给出精确命令。`doctor` 把 CLI、插件、Gateway 任一版本不一致视为异常。由于 0.1.33 及更早版本还不具备 CLI 自动同步能力,从这些版本升级时先用原包管理器安装一次新 CLI,再运行新版 `supertask upgrade`。
299
299
 
300
- 请在手动执行 `opencode run --agent <名称>` 能工作的同一个终端环境中运行 `supertask install` 或 `supertask upgrade`。显式安装/升级会刷新 Gateway 使用的 OpenCode、XDG 与模型 Provider 执行环境,同时固定已经验证的 Bun、PM2、数据库/配置作用域,并保留完整旧环境用于失败回滚。这能避免自定义主 Agent 在终端正常、但 Gateway 仍沿用旧 Provider 凭据或旧 OpenCode 配置目录。
300
+ 请在手动执行 `opencode run --agent <名称>` 能工作的同一个终端环境中运行 `supertask install` 或 `supertask upgrade`。安装或发生版本变化的升级会刷新 Gateway 使用的 OpenCode、XDG 与模型 Provider 执行环境,同时固定已经验证的 Bun、PM2、数据库/配置作用域,并保留完整旧环境用于失败回滚。同版本下需要刷新旧 Provider 凭据或 OpenCode 配置目录时使用 `supertask upgrade --force`。
301
301
 
302
302
  ### 快速开始
303
303
 
package/dist/cli/index.js CHANGED
@@ -22220,18 +22220,33 @@ var init_semver = __esm({
22220
22220
  var update_exports = {};
22221
22221
  __export(update_exports, {
22222
22222
  getGlobalCliDiagnostic: () => getGlobalCliDiagnostic,
22223
+ getLatestVersion: () => getLatestVersion,
22223
22224
  getOpenCodePluginDiagnostic: () => getOpenCodePluginDiagnostic,
22224
22225
  installLatestPlugin: () => installLatestPlugin,
22225
22226
  installPluginVersion: () => installPluginVersion,
22227
+ isVersionConverged: () => isVersionConverged,
22226
22228
  resolveConfiguredPluginSpec: () => resolveConfiguredPluginSpec,
22227
22229
  resolveInstalledPlugin: () => resolveInstalledPlugin,
22228
22230
  resolveInstalledPluginVersion: () => resolveInstalledPluginVersion,
22229
22231
  updateGlobalCli: () => updateGlobalCli
22230
22232
  });
22231
22233
  import { spawnSync as spawnSync3 } from "child_process";
22232
- import { existsSync as existsSync6, readFileSync as readFileSync4, readdirSync, realpathSync } from "fs";
22233
- import { homedir as homedir4 } from "os";
22234
+ import {
22235
+ chmodSync as chmodSync3,
22236
+ closeSync,
22237
+ existsSync as existsSync6,
22238
+ mkdtempSync,
22239
+ openSync,
22240
+ readFileSync as readFileSync4,
22241
+ readdirSync,
22242
+ realpathSync,
22243
+ rmSync as rmSync2
22244
+ } from "fs";
22245
+ import { homedir as homedir4, tmpdir as tmpdir2 } from "os";
22234
22246
  import { dirname as dirname7, join as join5, resolve as resolve4 } from "path";
22247
+ function isVersionConverged(version2, state2) {
22248
+ return state2.packageVersion === version2 && state2.plugin.ok && state2.plugin.version === version2 && state2.plugin.cachedVersion === version2 && (!state2.cli.installed || state2.cli.version === version2) && state2.gateway.pm2Installed && state2.gateway.processFound && state2.gateway.status === "online" && state2.gateway.ready && state2.gateway.runningVersion === version2 && state2.gateway.gatewayPackageVersion === version2 && state2.gateway.scopeMatches;
22249
+ }
22235
22250
  function pluginAt(packageDir) {
22236
22251
  const packageJson = join5(packageDir, "package.json");
22237
22252
  const gatewayEntry = join5(packageDir, "dist/gateway/index.js");
@@ -22399,7 +22414,7 @@ function updateGlobalCli(version2) {
22399
22414
  }
22400
22415
  return { ...after, action: "updated" };
22401
22416
  }
22402
- function latestVersion() {
22417
+ function getLatestVersion() {
22403
22418
  const result = spawnSync3(npmBin(), [
22404
22419
  "view",
22405
22420
  PACKAGE_NAME,
@@ -22467,11 +22482,6 @@ function resolveConfiguredPluginSpec(value) {
22467
22482
  };
22468
22483
  }
22469
22484
  function getOpenCodePluginDiagnostic() {
22470
- const result = spawnSync3(opencodeBin(), ["debug", "config", "--pure"], {
22471
- encoding: "utf8",
22472
- env: process.env,
22473
- timeout: 3e4
22474
- });
22475
22485
  const failed = (message) => ({
22476
22486
  ok: false,
22477
22487
  spec: "",
@@ -22481,51 +22491,77 @@ function getOpenCodePluginDiagnostic() {
22481
22491
  packageDir: null,
22482
22492
  error: message
22483
22493
  });
22484
- if (result.error) {
22485
- return failed(`[supertask] \u65E0\u6CD5\u8BFB\u53D6 OpenCode \u6700\u7EC8\u914D\u7F6E: ${result.error.message}`);
22486
- }
22487
- if (result.status !== 0) {
22488
- const detail = `${result.stderr ?? ""}`.trim();
22489
- return failed(`[supertask] \u65E0\u6CD5\u8BFB\u53D6 OpenCode \u6700\u7EC8\u914D\u7F6E: ${detail || `\u9000\u51FA\u7801 ${result.status}`}`);
22490
- }
22491
- let config;
22494
+ let outputDirectory = null;
22495
+ let outputFd = null;
22492
22496
  try {
22493
- config = JSON.parse(`${result.stdout ?? ""}`);
22494
- } catch {
22495
- return failed("[supertask] OpenCode \u6700\u7EC8\u914D\u7F6E\u4E0D\u662F\u6709\u6548 JSON");
22496
- }
22497
- let configured;
22498
- try {
22499
- configured = resolveConfiguredPluginSpec(config);
22500
- } catch (error) {
22501
- return failed(error instanceof Error ? error.message : String(error));
22502
- }
22503
- if (!configured.exact || configured.version === null) {
22504
- return {
22505
- ok: false,
22506
- ...configured,
22507
- cachedVersion: null,
22508
- packageDir: null,
22509
- error: `[supertask] OpenCode \u63D2\u4EF6\u5FC5\u987B\u56FA\u5B9A\u7CBE\u786E\u7248\u672C\uFF0C\u4E0D\u80FD\u4F7F\u7528 ${configured.spec}`
22510
- };
22511
- }
22512
- try {
22513
- const installed = resolveInstalledPluginVersion(configured.version);
22514
- return {
22515
- ok: true,
22516
- ...configured,
22517
- cachedVersion: installed.version,
22518
- packageDir: installed.packageDir,
22519
- error: null
22520
- };
22497
+ outputDirectory = mkdtempSync(join5(tmpdir2(), "opencode-supertask-config-"));
22498
+ chmodSync3(outputDirectory, 448);
22499
+ const outputPath = join5(outputDirectory, "resolved-config.json");
22500
+ outputFd = openSync(outputPath, "w", 384);
22501
+ const result = spawnSync3(opencodeBin(), ["debug", "config", "--pure"], {
22502
+ encoding: "utf8",
22503
+ env: process.env,
22504
+ timeout: 3e4,
22505
+ stdio: ["ignore", outputFd, "pipe"]
22506
+ });
22507
+ closeSync(outputFd);
22508
+ outputFd = null;
22509
+ if (result.error) {
22510
+ return failed(`[supertask] \u65E0\u6CD5\u8BFB\u53D6 OpenCode \u6700\u7EC8\u914D\u7F6E: ${result.error.message}`);
22511
+ }
22512
+ if (result.status !== 0) {
22513
+ const detail = `${result.stderr ?? ""}`.trim();
22514
+ return failed(`[supertask] \u65E0\u6CD5\u8BFB\u53D6 OpenCode \u6700\u7EC8\u914D\u7F6E: ${detail || `\u9000\u51FA\u7801 ${result.status}`}`);
22515
+ }
22516
+ let config;
22517
+ try {
22518
+ config = JSON.parse(readFileSync4(outputPath, "utf8"));
22519
+ } catch {
22520
+ return failed("[supertask] OpenCode \u6700\u7EC8\u914D\u7F6E\u4E0D\u662F\u6709\u6548 JSON");
22521
+ }
22522
+ let configured;
22523
+ try {
22524
+ configured = resolveConfiguredPluginSpec(config);
22525
+ } catch (error) {
22526
+ return failed(error instanceof Error ? error.message : String(error));
22527
+ }
22528
+ if (!configured.exact || configured.version === null) {
22529
+ return {
22530
+ ok: false,
22531
+ ...configured,
22532
+ cachedVersion: null,
22533
+ packageDir: null,
22534
+ error: `[supertask] OpenCode \u63D2\u4EF6\u5FC5\u987B\u56FA\u5B9A\u7CBE\u786E\u7248\u672C\uFF0C\u4E0D\u80FD\u4F7F\u7528 ${configured.spec}`
22535
+ };
22536
+ }
22537
+ try {
22538
+ const installed = resolveInstalledPluginVersion(configured.version);
22539
+ return {
22540
+ ok: true,
22541
+ ...configured,
22542
+ cachedVersion: installed.version,
22543
+ packageDir: installed.packageDir,
22544
+ error: null
22545
+ };
22546
+ } catch (error) {
22547
+ return {
22548
+ ok: false,
22549
+ ...configured,
22550
+ cachedVersion: null,
22551
+ packageDir: null,
22552
+ error: error instanceof Error ? error.message : String(error)
22553
+ };
22554
+ }
22521
22555
  } catch (error) {
22522
- return {
22523
- ok: false,
22524
- ...configured,
22525
- cachedVersion: null,
22526
- packageDir: null,
22527
- error: error instanceof Error ? error.message : String(error)
22528
- };
22556
+ return failed(`[supertask] \u65E0\u6CD5\u8BFB\u53D6 OpenCode \u6700\u7EC8\u914D\u7F6E: ${error instanceof Error ? error.message : String(error)}`);
22557
+ } finally {
22558
+ if (outputFd !== null) {
22559
+ try {
22560
+ closeSync(outputFd);
22561
+ } catch {
22562
+ }
22563
+ }
22564
+ if (outputDirectory !== null) rmSync2(outputDirectory, { recursive: true, force: true });
22529
22565
  }
22530
22566
  }
22531
22567
  function installPluginVersion(version2) {
@@ -22552,7 +22588,7 @@ function installPluginVersion(version2) {
22552
22588
  return resolveInstalledPluginVersion(version2);
22553
22589
  }
22554
22590
  function installLatestPlugin() {
22555
- return installPluginVersion(latestVersion());
22591
+ return installPluginVersion(getLatestVersion());
22556
22592
  }
22557
22593
  var PACKAGE_NAME;
22558
22594
  var init_update2 = __esm({
@@ -27740,7 +27776,7 @@ function shellQuote(value) {
27740
27776
  if (/^[A-Za-z0-9_./:@%+=,-]+$/.test(value)) return value;
27741
27777
  return `'${value.replace(/'/g, `'"'"'`)}'`;
27742
27778
  }
27743
- function presentRunLog(log) {
27779
+ function presentRunLog(log, includeErrors = true) {
27744
27780
  let command = null;
27745
27781
  const textParts = [];
27746
27782
  const errors = [];
@@ -27752,7 +27788,7 @@ function presentRunLog(log) {
27752
27788
  try {
27753
27789
  parsed = recordValue(JSON.parse(trimmed));
27754
27790
  } catch {
27755
- errors.push(line);
27791
+ if (includeErrors) errors.push(line);
27756
27792
  continue;
27757
27793
  }
27758
27794
  if (!parsed) continue;
@@ -27776,7 +27812,7 @@ function presentRunLog(log) {
27776
27812
  const tool = typeof part?.tool === "string" ? part.tool : typeof parsed.tool === "string" ? parsed.tool : null;
27777
27813
  if (tool && (eventType === "tool_use" || partType === "tool")) tools.push(tool);
27778
27814
  const error = typeof parsed.error === "string" ? parsed.error : typeof part?.error === "string" ? part.error : null;
27779
- if (error) errors.push(error);
27815
+ if (error && includeErrors) errors.push(error);
27780
27816
  }
27781
27817
  return {
27782
27818
  command,
@@ -27785,8 +27821,8 @@ function presentRunLog(log) {
27785
27821
  tools
27786
27822
  };
27787
27823
  }
27788
- function renderRunLog(runId, taskName, log, locale) {
27789
- const presentation = presentRunLog(log);
27824
+ function renderRunLog(runId, taskName, log, locale, includeErrors) {
27825
+ const presentation = presentRunLog(log, includeErrors);
27790
27826
  const command = presentation.command ? `<div class="run-command"><div class="log-section-head"><strong>${t(locale, "logs.command")}</strong><button type="button" class="btn" onclick="copyRunCommand(${runId})">${icon("copy")}${t(locale, "action.copyCommand")}</button></div><div class="command-cwd">${esc(presentation.command.cwd)}</div><pre id="command-${runId}">${esc(presentation.command.command)}</pre></div>` : "";
27791
27827
  const errors = presentation.errors.length > 0 ? `<div class="run-error"><strong>${t(locale, "logs.error")}</strong><pre>${esc(presentation.errors.join("\n"))}</pre></div>` : "";
27792
27828
  const tools = presentation.tools.length > 0 ? `<div class="run-tools"><strong>${t(locale, "logs.tools")}</strong><div class="actions">${presentation.tools.map((tool) => `<span class="tag">${esc(tool)}</span>`).join("")}</div></div>` : "";
@@ -28234,7 +28270,7 @@ var init_web = __esm({
28234
28270
  const rows = runs.map((run) => {
28235
28271
  const status = safeStatus(run.status);
28236
28272
  const resumable = isValidSessionId(run.sessionId);
28237
- const log = run.log ? renderRunLog(run.id, run.taskName, run.log, locale) : "";
28273
+ const log = run.log ? renderRunLog(run.id, run.taskName, run.log, locale, run.status !== "done") : "";
28238
28274
  return `<tr class="run-summary-row">
28239
28275
  <td class="faint" data-label="${t(locale, "table.run")}">#${run.id}</td>
28240
28276
  <td data-primary data-label="${t(locale, "table.task")}"><div class="task-name">${esc(run.taskName)} <span class="faint">#${run.taskId}</span></div>${run.model ? `<div style="margin-top:4px"><span class="tag">${esc(run.model)}</span></div>` : ""}</td>
@@ -28365,7 +28401,7 @@ var init_web = __esm({
28365
28401
  const runs = await TaskRunService.listByTaskId(id);
28366
28402
  return c.json({
28367
28403
  ...task,
28368
- _resultPresentation: task.resultLog ? presentRunLog(task.resultLog) : null,
28404
+ _resultPresentation: task.resultLog ? presentRunLog(task.resultLog, task.status !== "done") : null,
28369
28405
  _runs: runs
28370
28406
  });
28371
28407
  });
@@ -29701,25 +29737,43 @@ program2.command("uninstall").description(t2("\u505C\u6B62\u5E76\u79FB\u9664 PM2
29701
29737
  process.exit(1);
29702
29738
  }
29703
29739
  });
29704
- program2.command("upgrade").description(t2("\u66F4\u65B0 OpenCode \u63D2\u4EF6\u7F13\u5B58\u5E76\u91CD\u542F Gateway", "update the OpenCode plugin cache and restart the Gateway")).action(async () => {
29705
- console.log(t2("\u6B63\u5728\u66F4\u65B0 opencode-supertask...", "Updating opencode-supertask..."));
29740
+ program2.command("upgrade").description(t2("\u66F4\u65B0 OpenCode \u63D2\u4EF6\u3001CLI \u548C Gateway\uFF1B\u5DF2\u662F\u6700\u65B0\u7248\u672C\u65F6\u4E0D\u91CD\u542F", "update the OpenCode plugin, CLI, and Gateway without restarting when already current")).option("--force", t2("\u5373\u4F7F\u5DF2\u662F\u6700\u65B0\u7248\u672C\u4E5F\u91CD\u65B0\u5B89\u88C5\u5E76\u91CD\u542F Gateway", "reinstall and restart the Gateway even when already current")).action(async (options) => {
29741
+ console.log(t2("\u6B63\u5728\u68C0\u67E5 opencode-supertask \u66F4\u65B0...", "Checking for opencode-supertask updates..."));
29706
29742
  let installed;
29707
29743
  let previousVersion;
29744
+ let targetVersion;
29745
+ let updater;
29708
29746
  try {
29709
- const { resolveInstalledPlugin: resolveInstalledPlugin2 } = await Promise.resolve().then(() => (init_update2(), update_exports));
29710
- previousVersion = resolveInstalledPlugin2().version;
29747
+ updater = await Promise.resolve().then(() => (init_update2(), update_exports));
29748
+ const { getGatewayDiagnostic: getGatewayDiagnostic2 } = await Promise.resolve().then(() => (init_pm2(), pm2_exports));
29749
+ targetVersion = updater.getLatestVersion();
29750
+ const plugin = updater.getOpenCodePluginDiagnostic();
29751
+ const cli = updater.getGlobalCliDiagnostic();
29752
+ const gateway = getGatewayDiagnostic2();
29753
+ if (!options.force && updater.isVersionConverged(targetVersion, {
29754
+ packageVersion: getPackageVersion(),
29755
+ plugin,
29756
+ cli,
29757
+ gateway
29758
+ })) {
29759
+ console.log(t2(
29760
+ `SuperTask \u5DF2\u662F\u6700\u65B0\u7248\u672C v${targetVersion}\uFF0C\u65E0\u9700\u5347\u7EA7\uFF1BGateway \u672A\u91CD\u542F\u3002`,
29761
+ `SuperTask is already up to date at v${targetVersion}; the Gateway was not restarted.`
29762
+ ));
29763
+ return;
29764
+ }
29765
+ previousVersion = plugin.version ?? updater.resolveInstalledPlugin().version;
29711
29766
  } catch (error) {
29712
- console.error(t2("\u65E0\u6CD5\u786E\u8BA4\u5F53\u524D OpenCode \u63D2\u4EF6\u7248\u672C\uFF0C\u5DF2\u53D6\u6D88\u5347\u7EA7\uFF1A", "Could not determine the current OpenCode plugin version; upgrade cancelled: ") + (error instanceof Error ? error.message : String(error)));
29767
+ console.error(t2("\u65E0\u6CD5\u68C0\u67E5\u5F53\u524D\u7248\u672C\uFF0C\u5DF2\u53D6\u6D88\u5347\u7EA7\uFF1A", "Could not check the current version; upgrade cancelled: ") + (error instanceof Error ? error.message : String(error)));
29713
29768
  process.exit(1);
29714
29769
  }
29770
+ console.log(t2("\u6B63\u5728\u66F4\u65B0 opencode-supertask...", "Updating opencode-supertask..."));
29715
29771
  try {
29716
- const { installLatestPlugin: installLatestPlugin2 } = await Promise.resolve().then(() => (init_update2(), update_exports));
29717
- installed = installLatestPlugin2();
29772
+ installed = updater.installPluginVersion(targetVersion);
29718
29773
  } catch (err) {
29719
29774
  let detail = err instanceof Error ? err.message : String(err);
29720
29775
  try {
29721
- const { installPluginVersion: installPluginVersion2 } = await Promise.resolve().then(() => (init_update2(), update_exports));
29722
- installPluginVersion2(previousVersion);
29776
+ updater.installPluginVersion(previousVersion);
29723
29777
  } catch (rollbackError) {
29724
29778
  detail += `; OpenCode \u63D2\u4EF6\u56DE\u6EDA\u5931\u8D25: ${rollbackError instanceof Error ? rollbackError.message : String(rollbackError)}`;
29725
29779
  }
@@ -29763,8 +29817,7 @@ SuperTask upgraded: ${result.before ?? "unknown"} \u2192 ${result.after}`
29763
29817
  let detail = err instanceof Error ? err.message : String(err);
29764
29818
  try {
29765
29819
  if (previousVersion !== installed.version) {
29766
- const { installPluginVersion: installPluginVersion2 } = await Promise.resolve().then(() => (init_update2(), update_exports));
29767
- installPluginVersion2(previousVersion);
29820
+ updater.installPluginVersion(previousVersion);
29768
29821
  }
29769
29822
  } catch (rollbackError) {
29770
29823
  detail += `; Gateway \u5DF2\u56DE\u6EDA\uFF0C\u4F46 OpenCode \u63D2\u4EF6\u56DE\u6EDA\u5931\u8D25: ${rollbackError instanceof Error ? rollbackError.message : String(rollbackError)}`;