@delicious233/codex-browser-bridge 1.5.2 → 1.5.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.
package/checksums.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": "v1.5.3",
3
+ "files": {
4
+ "codex-browser-bridge-arm64.exe": "f6b7ccca507b896ab404f92b867260316ebdc589ab575bc7f6d3b02265cf562b",
5
+ "codex-browser-bridge.exe": "7a9361bc414a9f46627866030b87d6ac2dc6713060718fa3a8f84c6dc42a80a4"
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delicious233/codex-browser-bridge",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
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": {
@@ -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
- // Download checksums
72
- const checksumsURL = `${base}/checksums.txt`;
73
- const checksums = await requestBuffer(checksumsURL).catch((err) => {
74
- throw new Error(`could not download checksums for ${tag}: ${err.message}`);
75
- });
76
- const checksum = checksums.toString("utf8")
77
- .split(/\r?\n/)
78
- .map(parseChecksumLine)
79
- .find((entry) => entry && entry.file === asset);
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
  };