@seqyuan/annodex 0.1.54 → 0.1.56

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 (69) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +3 -3
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/required-server-files.js +1 -1
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_global-error.html +1 -1
  8. package/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next/server/app/_not-found.html +1 -1
  16. package/.next/server/app/_not-found.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  20. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  21. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  22. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  23. package/.next/server/app/api/internal/runtime/route.js +1 -1
  24. package/.next/server/app/api/version/route.js +1 -1
  25. package/.next/server/app/docs/changelog.html +2 -2
  26. package/.next/server/app/docs/changelog.rsc +1 -1
  27. package/.next/server/app/docs/changelog.segments/_full.segment.rsc +1 -1
  28. package/.next/server/app/docs/changelog.segments/_head.segment.rsc +1 -1
  29. package/.next/server/app/docs/changelog.segments/_index.segment.rsc +1 -1
  30. package/.next/server/app/docs/changelog.segments/_tree.segment.rsc +1 -1
  31. package/.next/server/app/docs/changelog.segments/docs/changelog/__PAGE__.segment.rsc +1 -1
  32. package/.next/server/app/docs/changelog.segments/docs/changelog.segment.rsc +1 -1
  33. package/.next/server/app/docs/changelog.segments/docs.segment.rsc +1 -1
  34. package/.next/server/app/index.html +1 -1
  35. package/.next/server/app/index.rsc +1 -1
  36. package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  37. package/.next/server/app/index.segments/_full.segment.rsc +1 -1
  38. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  39. package/.next/server/app/index.segments/_index.segment.rsc +1 -1
  40. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  41. package/.next/server/app/login.html +1 -1
  42. package/.next/server/app/login.rsc +1 -1
  43. package/.next/server/app/login.segments/_full.segment.rsc +1 -1
  44. package/.next/server/app/login.segments/_head.segment.rsc +1 -1
  45. package/.next/server/app/login.segments/_index.segment.rsc +1 -1
  46. package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  47. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  48. package/.next/server/app/login.segments/login.segment.rsc +1 -1
  49. package/.next/server/app/workspace/page.js +2 -2
  50. package/.next/server/app/workspace/page_client-reference-manifest.js +1 -1
  51. package/.next/server/app/workspace.html +1 -1
  52. package/.next/server/app/workspace.rsc +2 -2
  53. package/.next/server/app/workspace.segments/_full.segment.rsc +2 -2
  54. package/.next/server/app/workspace.segments/_head.segment.rsc +1 -1
  55. package/.next/server/app/workspace.segments/_index.segment.rsc +1 -1
  56. package/.next/server/app/workspace.segments/_tree.segment.rsc +1 -1
  57. package/.next/server/app/workspace.segments/workspace/__PAGE__.segment.rsc +2 -2
  58. package/.next/server/app/workspace.segments/workspace.segment.rsc +1 -1
  59. package/.next/server/app-paths-manifest.json +3 -3
  60. package/.next/server/chunks/6983.js +3 -3
  61. package/.next/server/middleware-build-manifest.js +1 -1
  62. package/.next/server/pages/404.html +1 -1
  63. package/.next/server/pages/500.html +1 -1
  64. package/.next/server/server-reference-manifest.json +1 -1
  65. package/.next/static/chunks/app/workspace/{page-cccacfa255ff7d01.js → page-74f6dd37ae8078e0.js} +2 -2
  66. package/lib/macos-codex-security.js +75 -2
  67. package/package.json +1 -1
  68. /package/.next/static/{CSz6uFOkLtpKpHvCD1S5n → J5i1iPyQwH3dIlgQM8SFk}/_buildManifest.js +0 -0
  69. /package/.next/static/{CSz6uFOkLtpKpHvCD1S5n → J5i1iPyQwH3dIlgQM8SFk}/_ssgManifest.js +0 -0
@@ -101,11 +101,24 @@ function codesignVerify(binaryPath, { timeoutMs = 5_000 } = {}) {
101
101
 
102
102
  /** Fast spawn-path check — only detect revoked certs (not full strict verify). */
103
103
  function needsRepairBeforeSpawn(binaryPath) {
104
+ // Fast check: codesign --verify (catches stripped/malformed signatures).
104
105
  const result = spawnSync(CODESIGN, ["--verify", binaryPath], {
105
106
  encoding: "utf8",
106
107
  timeout: 3_000,
107
108
  });
108
- return needsRevokedCertRepair(codesignOutput(result));
109
+ if (needsRevokedCertRepair(codesignOutput(result))) return true;
110
+
111
+ // codesign may say "valid on disk" while spctl detects revoked certs
112
+ // (CSSMERR_TP_CERT_REVOKED). Only spctl checks Apple's revocation DB.
113
+ // Use a shorter timeout on the spawn path (doctor uses 10s).
114
+ // Treat spctl timeout as needing repair: a valid cert should return
115
+ // quickly; a slow response usually means the revocation check is
116
+ // happening against a revoked cert. Worst case: unnecessary ad-hoc
117
+ // re-sign, which is harmless.
118
+ const sp = spctlAssess(binaryPath, 5_000);
119
+ if (sp.revoked || sp.timedOut) return true;
120
+
121
+ return false;
109
122
  }
110
123
 
111
124
  function shouldRepairCodexBinary(binaryPath) {
@@ -220,6 +233,51 @@ function looksLikeNativeCodexBinary(filePath) {
220
233
  return base === "codex" || base === "codex.exe";
221
234
  }
222
235
 
236
+ /** Given a codex executable path (may be a JS shim), find the real native binary. */
237
+ function resolveNativeBinaryFromShim(executablePath) {
238
+ if (!executablePath || !fs.existsSync(executablePath)) return null;
239
+ // If it's already a native binary (inside vendor/), return as-is
240
+ if (/vendor[/\\]/.test(executablePath)) return executablePath;
241
+
242
+ // Check if it's a JS shim (e.g. node_modules/.bin/codex)
243
+ try {
244
+ const content = fs.readFileSync(executablePath, "utf8").slice(0, 512);
245
+ if (content.includes("node") || content.includes("#!/")) {
246
+ // This is a shim/script — find the native binary nearby
247
+ const shimDir = path.dirname(executablePath);
248
+ const nodeModulesDir = path.join(shimDir, "..");
249
+
250
+ const platform = process.platform;
251
+ const arch = process.arch;
252
+ let pkgName;
253
+ let triple;
254
+ if (platform === "darwin") {
255
+ if (arch === "arm64") { pkgName = "codex-darwin-arm64"; triple = "aarch64-apple-darwin"; }
256
+ else if (arch === "x64") { pkgName = "codex-darwin-x64"; triple = "x86_64-apple-darwin"; }
257
+ else return null;
258
+ } else {
259
+ return null;
260
+ }
261
+ const binaryName = "codex";
262
+
263
+ const subPaths = [
264
+ path.join("vendor", triple, "bin", binaryName),
265
+ path.join("vendor", triple, "codex", binaryName),
266
+ ];
267
+ for (const sub of subPaths) {
268
+ const candidate = path.join(nodeModulesDir, "@openai", pkgName, sub);
269
+ if (fs.existsSync(candidate)) return candidate;
270
+ }
271
+ // Also try nested layout
272
+ for (const sub of subPaths) {
273
+ const candidate = path.join(nodeModulesDir, "@openai", "codex", "node_modules", "@openai", pkgName, sub);
274
+ if (fs.existsSync(candidate)) return candidate;
275
+ }
276
+ }
277
+ } catch { /* ignore */ }
278
+ return executablePath;
279
+ }
280
+
223
281
  function repairMacOSCodexPaths(binaryPaths, { force = false, mode = "doctor" } = {}) {
224
282
  if (!isDarwin()) return [];
225
283
  const seen = new Set();
@@ -273,8 +331,22 @@ function prepareMacOSCodexForSpawn(executablePath, cwd) {
273
331
  if (!isDarwin()) return { quarantine: { cleared: 0, paths: [] }, repairs: [] };
274
332
 
275
333
  const quarantine = { cleared: 0, paths: [], skipped: true };
334
+ if (!executablePath) return { quarantine, repairs: [] };
335
+
336
+ // If the resolved executable is a JS shim (e.g. node_modules/.bin/codex),
337
+ // find and repair the underlying native binary instead.
338
+ // Spawning the shim causes Node to exec the native binary as a grandchild,
339
+ // which macOS Gatekeeper may kill even after ad-hoc signing of the shim itself.
340
+ const resolvedNative = resolveNativeBinaryFromShim(executablePath);
341
+ if (resolvedNative && resolvedNative !== executablePath) {
342
+ console.log(
343
+ `[codex-server] Resolved native codex binary from shim: ${executablePath} -> ${resolvedNative}`,
344
+ );
345
+ prepareMacOSCodexForSpawn(resolvedNative, cwd);
346
+ return { quarantine, repairs: [], shimResolved: resolvedNative };
347
+ }
276
348
 
277
- if (!executablePath || !looksLikeNativeCodexBinary(executablePath)) {
349
+ if (!looksLikeNativeCodexBinary(executablePath)) {
278
350
  return { quarantine, repairs: [] };
279
351
  }
280
352
  if (isBinaryPrepared(executablePath) || preparingBinaries.has(executablePath)) {
@@ -312,5 +384,6 @@ module.exports = {
312
384
  needsRevokedCertRepair,
313
385
  clearMacOSQuarantine,
314
386
  repairMacOSCodexPaths,
387
+ resolveNativeBinaryFromShim,
315
388
  prepareMacOSCodexForSpawn,
316
389
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seqyuan/annodex",
3
- "version": "0.1.54",
3
+ "version": "0.1.56",
4
4
  "description": "AI-native bioinformatics workspace by Annoroad",
5
5
  "license": "MIT",
6
6
  "bin": {