open-plan-annotator 1.9.0 → 1.9.2

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.
@@ -5,14 +5,14 @@
5
5
  },
6
6
  "metadata": {
7
7
  "description": "Interactive plan annotation plugin for Claude Code",
8
- "version": "1.9.0"
8
+ "version": "1.9.2"
9
9
  },
10
10
  "plugins": [
11
11
  {
12
12
  "name": "open-plan-annotator",
13
13
  "source": "./",
14
14
  "description": "Interactive plan annotation UI: review, strikethrough, and comment on Claude's plans before approving. Fully local, no external services.",
15
- "version": "1.9.0",
15
+ "version": "1.9.2",
16
16
  "author": {
17
17
  "name": "ndom91"
18
18
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "open-plan-annotator",
3
3
  "description": "Interactive plan annotation UI: review, strikethrough, and comment on Claude's plans before approving. Fully local, no external services.",
4
- "version": "1.9.0",
4
+ "version": "1.9.2",
5
5
  "author": {
6
6
  "name": "ndom91"
7
7
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-plan-annotator",
3
- "version": "1.9.0",
3
+ "version": "1.9.2",
4
4
  "type": "module",
5
5
  "description": "Fully local plugin for interactive plan annotation from your Agentic assistants",
6
6
  "author": "ndom91",
@@ -84,10 +84,10 @@
84
84
  }
85
85
  },
86
86
  "optionalDependencies": {
87
- "@open-plan-annotator/runtime-darwin-arm64": "1.9.0",
88
- "@open-plan-annotator/runtime-darwin-x64": "1.9.0",
89
- "@open-plan-annotator/runtime-linux-arm64": "1.9.0",
90
- "@open-plan-annotator/runtime-linux-x64": "1.9.0"
87
+ "@open-plan-annotator/runtime-darwin-arm64": "1.9.2",
88
+ "@open-plan-annotator/runtime-darwin-x64": "1.9.2",
89
+ "@open-plan-annotator/runtime-linux-arm64": "1.9.2",
90
+ "@open-plan-annotator/runtime-linux-x64": "1.9.2"
91
91
  },
92
92
  "overrides": {
93
93
  "uuid": "^14.0.0"
@@ -6,7 +6,9 @@
6
6
  // 1. Determines plugin version from the sibling package.json.
7
7
  // 2. Picks the runtime package matching the host platform/arch.
8
8
  // 3. If the target binary already exists at the resolver's fallback path
9
- // (`packages/runtime-<platform>-<arch>/bin/open-plan-annotator`), exits 0.
9
+ // (`packages/runtime-<platform>-<arch>/bin/open-plan-annotator`) AND its
10
+ // `--version` matches the plugin version, exits 0. A version mismatch
11
+ // (stale binary left from a prior version) falls through to reinstall.
10
12
  // 4. Otherwise fetches the package manifest from the npm registry,
11
13
  // downloads the tarball, verifies its integrity against `dist.integrity`,
12
14
  // extracts it via system `tar`, and atomically moves the binary into place.
@@ -56,8 +58,18 @@ const targetDir = join(pluginRoot, "packages", `runtime-${platformKey}`, "bin");
56
58
  const targetBinary = join(targetDir, "open-plan-annotator");
57
59
 
58
60
  if (existsSync(targetBinary)) {
59
- // Fast path: nothing to do.
60
- process.exit(0);
61
+ // Fast path: skip the download only when the installed binary's version
62
+ // matches the plugin version. Checking existence alone is not enough — a
63
+ // stale binary from a previous plugin version can be left in place when a
64
+ // new version dir is created (e.g. copied install trees), which would pin
65
+ // the runtime to the old version forever. Re-probe and reinstall on drift.
66
+ const installedVersion = readBinaryVersion(targetBinary);
67
+ if (installedVersion === version) {
68
+ process.exit(0);
69
+ }
70
+ process.stderr.write(
71
+ `open-plan-annotator: installed runtime is ${installedVersion ?? "unknown"}, expected ${version}; reinstalling…\n`,
72
+ );
61
73
  }
62
74
 
63
75
  process.stderr.write(
@@ -130,6 +142,29 @@ try {
130
142
  process.exit(1);
131
143
  }
132
144
 
145
+ /**
146
+ * Probe an installed runtime binary for its version string.
147
+ *
148
+ * Runs `<binary> --version` and returns the trimmed stdout, or null if the
149
+ * binary can't be executed or doesn't respond (treated as stale → reinstall).
150
+ *
151
+ * @param {string} binaryPath
152
+ * @returns {string | null}
153
+ */
154
+ function readBinaryVersion(binaryPath) {
155
+ try {
156
+ const out = execFileSync(binaryPath, ["--version"], {
157
+ timeout: 5_000,
158
+ stdio: ["ignore", "pipe", "ignore"],
159
+ encoding: "utf8",
160
+ });
161
+ const trimmed = out.trim();
162
+ return trimmed.length > 0 ? trimmed : null;
163
+ } catch {
164
+ return null;
165
+ }
166
+ }
167
+
133
168
  /**
134
169
  * Fetch a URL with redirect handling and return the response buffer.
135
170
  *