open-plan-annotator 1.0.3 → 1.0.4
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.
|
@@ -12,7 +12,7 @@
|
|
|
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.0.
|
|
15
|
+
"version": "1.0.4",
|
|
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.0.
|
|
4
|
+
"version": "1.0.4",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "ndom91"
|
|
7
7
|
},
|
|
@@ -7,10 +7,11 @@ const fs = require("fs");
|
|
|
7
7
|
const binaryPath = path.join(__dirname, "open-plan-annotator-binary");
|
|
8
8
|
const installScript = path.join(__dirname, "..", "install.cjs");
|
|
9
9
|
|
|
10
|
-
// Buffer stdin immediately so it's not lost if we need to download first
|
|
10
|
+
// Buffer stdin immediately so it's not lost if we need to download first.
|
|
11
|
+
// Skip when stdin is a TTY (manual invocation) to avoid blocking forever.
|
|
11
12
|
let stdinBuffer;
|
|
12
13
|
try {
|
|
13
|
-
stdinBuffer = fs.readFileSync(0);
|
|
14
|
+
stdinBuffer = process.stdin.isTTY ? Buffer.alloc(0) : fs.readFileSync(0);
|
|
14
15
|
} catch {
|
|
15
16
|
stdinBuffer = Buffer.alloc(0);
|
|
16
17
|
}
|
package/install.cjs
CHANGED
|
@@ -176,9 +176,12 @@ async function main() {
|
|
|
176
176
|
const fallbackUrl = getDownloadUrl();
|
|
177
177
|
console.error(`Downloading open-plan-annotator for ${getPlatformKey()}...`);
|
|
178
178
|
|
|
179
|
+
let archiveBuffer;
|
|
180
|
+
|
|
181
|
+
// Try checksum-verified download via GitHub API first, fall back to direct URL
|
|
179
182
|
try {
|
|
180
183
|
const { assetName, assetUrl, expectedSha256 } = await resolveReleaseAssetAndChecksum();
|
|
181
|
-
|
|
184
|
+
archiveBuffer = await fetch(assetUrl);
|
|
182
185
|
const actualSha256 = sha256Hex(archiveBuffer);
|
|
183
186
|
|
|
184
187
|
if (actualSha256 !== expectedSha256) {
|
|
@@ -186,7 +189,21 @@ async function main() {
|
|
|
186
189
|
`Checksum verification failed for ${assetName} (expected ${expectedSha256}, got ${actualSha256})`,
|
|
187
190
|
);
|
|
188
191
|
}
|
|
192
|
+
} catch (verifiedErr) {
|
|
193
|
+
const message = verifiedErr && verifiedErr.message ? verifiedErr.message : String(verifiedErr);
|
|
194
|
+
console.error(`open-plan-annotator: checksum-verified install failed: ${message}`);
|
|
195
|
+
console.error(`Falling back to direct download (without checksum verification)...`);
|
|
189
196
|
|
|
197
|
+
try {
|
|
198
|
+
archiveBuffer = await fetch(fallbackUrl);
|
|
199
|
+
} catch (fallbackErr) {
|
|
200
|
+
const fbMsg = fallbackErr && fallbackErr.message ? fallbackErr.message : String(fallbackErr);
|
|
201
|
+
console.error(`open-plan-annotator: fallback download also failed: ${fbMsg}`);
|
|
202
|
+
throw verifiedErr;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
try {
|
|
190
207
|
const binaryBuffer = extractBinaryFromTarGz(archiveBuffer);
|
|
191
208
|
|
|
192
209
|
if (!fs.existsSync(destDir)) {
|
|
@@ -203,10 +220,6 @@ async function main() {
|
|
|
203
220
|
} catch {
|
|
204
221
|
// Temp file may not exist
|
|
205
222
|
}
|
|
206
|
-
|
|
207
|
-
const message = err && err.message ? err.message : String(err);
|
|
208
|
-
console.error(`open-plan-annotator: install failed: ${message}`);
|
|
209
|
-
console.error(`Fallback URL for diagnostics: ${fallbackUrl}`);
|
|
210
223
|
throw err;
|
|
211
224
|
}
|
|
212
225
|
}
|