@delicious233/codex-browser-bridge 1.5.2 → 1.5.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.
- package/checksums.json +7 -0
- package/package.json +2 -1
- package/scripts/install.js +31 -10
package/checksums.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delicious233/codex-browser-bridge",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "MCP server that exposes Codex Desktop's Chrome browser bridge for Claude Code and other agents.",
|
|
6
6
|
"bin": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"bin/codex-browser-bridge.js",
|
|
15
|
+
"checksums.json",
|
|
15
16
|
"scripts/install.js"
|
|
16
17
|
],
|
|
17
18
|
"repository": {
|
package/scripts/install.js
CHANGED
|
@@ -41,6 +41,26 @@ function parseChecksumLine(line) {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
function findChecksum(text, asset) {
|
|
45
|
+
return text
|
|
46
|
+
.split(/\r?\n/)
|
|
47
|
+
.map(parseChecksumLine)
|
|
48
|
+
.find((entry) => entry && entry.file === asset);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function embeddedChecksum(asset) {
|
|
52
|
+
const file = path.join(__dirname, "..", "checksums.json");
|
|
53
|
+
if (!fs.existsSync(file)) return null;
|
|
54
|
+
const checksums = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
55
|
+
if (!checksums || !checksums.files || typeof checksums.files[asset] !== "string") {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
hash: checksums.files[asset].toLowerCase(),
|
|
60
|
+
file: asset,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
44
64
|
async function main() {
|
|
45
65
|
if (process.platform !== "win32") {
|
|
46
66
|
console.error("codex-browser-bridge only supports Windows (requires named pipes).");
|
|
@@ -68,16 +88,15 @@ async function main() {
|
|
|
68
88
|
|
|
69
89
|
const base = `https://github.com/${repo}/releases/download/${tag}`;
|
|
70
90
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (!checksum) throw new Error(`checksum not found for ${asset} in ${checksumsURL}`);
|
|
91
|
+
let checksum = embeddedChecksum(asset);
|
|
92
|
+
if (!checksum) {
|
|
93
|
+
const checksumsURL = `${base}/checksums.txt`;
|
|
94
|
+
const checksums = await requestBuffer(checksumsURL).catch((err) => {
|
|
95
|
+
throw new Error(`could not download checksums for ${tag}: ${err.message}`);
|
|
96
|
+
});
|
|
97
|
+
checksum = findChecksum(checksums.toString("utf8"), asset);
|
|
98
|
+
if (!checksum) throw new Error(`checksum not found for ${asset} in ${checksumsURL}`);
|
|
99
|
+
}
|
|
81
100
|
|
|
82
101
|
// Download binary
|
|
83
102
|
console.log(`Downloading codex-browser-bridge ${tag} (${arch})...`);
|
|
@@ -102,6 +121,8 @@ if (require.main === module) {
|
|
|
102
121
|
}
|
|
103
122
|
|
|
104
123
|
module.exports = {
|
|
124
|
+
embeddedChecksum,
|
|
125
|
+
findChecksum,
|
|
105
126
|
parseChecksumLine,
|
|
106
127
|
sha256,
|
|
107
128
|
};
|