plugin-updater 1.0.27 → 1.0.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.
Files changed (2) hide show
  1. package/dist/index.js +12 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -89,6 +89,18 @@ function getNpmGlobalRoot() {
89
89
  }
90
90
  function resolveNpmPluginVersion(name, configDir) {
91
91
  try {
92
+ // opencode installs npm plugins into ~/.cache/opencode/packages/<name>@<spec>/
93
+ const packageCache = path.join(os.homedir(), ".cache", "opencode", "packages");
94
+ if (fs.existsSync(packageCache)) {
95
+ for (const entry of fs.readdirSync(packageCache)) {
96
+ if (entry !== name && !entry.startsWith(`${name}@`))
97
+ continue;
98
+ const cachedPkg = path.join(packageCache, entry, "node_modules", name, "package.json");
99
+ if (fs.existsSync(cachedPkg)) {
100
+ return JSON.parse(fs.readFileSync(cachedPkg, "utf8")).version || "";
101
+ }
102
+ }
103
+ }
92
104
  const cacheDir = path.join(configDir, "cache", "node_modules");
93
105
  const globalNpm = getNpmGlobalRoot();
94
106
  const candidates = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plugin-updater",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "Plugin lifecycle manager for OpenCode and Claude Code launchers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",