plugin-updater 1.1.2 → 1.1.3

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -123,10 +123,12 @@ export async function activate(opencodeHookInput) {
123
123
  await earlyLaunch(configDir, gitPlugins);
124
124
  }
125
125
  // consumers like the loader TUI import this module for its API only — running
126
- // the full updater sequence on import would print over their screen
127
- if (process.env.PLUGIN_UPDATER_LIBRARY_MODE !== "1") {
128
- // signal loaders (which activate later in the same process) that we are
129
- // self-driving updates, so their runEarlyLaunchHooks skips a duplicate pass
126
+ // the full updater sequence on import would print over their screen.
127
+ // The ACTIVATION guard makes self-activation idempotent PER PROCESS: opencode may
128
+ // load plugin-updater as more than one module instance (its npm-plugin copy plus a
129
+ // loader's separately-resolved copy), and each would otherwise run earlyLaunch. The
130
+ // first sets the flag; later instances (and the loaders' runEarlyLaunchHooks) skip.
131
+ if (process.env.PLUGIN_UPDATER_LIBRARY_MODE !== "1" && process.env.PLUGIN_UPDATER_ACTIVATION !== "1") {
130
132
  process.env.PLUGIN_UPDATER_ACTIVATION = "1";
131
133
  activate();
132
134
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plugin-updater",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Plugin lifecycle manager for OpenCode and Claude Code launchers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",