codexapp 0.1.42 → 0.1.44

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/dist/index.html CHANGED
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Codex Web Local</title>
7
- <script type="module" crossorigin src="/assets/index-Dwgxc732.js"></script>
8
- <link rel="stylesheet" crossorigin href="/assets/index-eKA4YUIc.css">
7
+ <script type="module" crossorigin src="/assets/index-BBu62h6l.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/assets/index-Dw2NQxoK.css">
9
9
  </head>
10
10
  <body class="bg-slate-950">
11
11
  <div id="app"></div>
package/dist-cli/index.js CHANGED
@@ -2682,6 +2682,20 @@ var IMAGE_CONTENT_TYPES = {
2682
2682
  ".svg": "image/svg+xml",
2683
2683
  ".webp": "image/webp"
2684
2684
  };
2685
+ function renderFrontendMissingHtml(message, details) {
2686
+ const lines = details && details.length > 0 ? `<pre>${details.join("\n")}</pre>` : "";
2687
+ return [
2688
+ "<!doctype html>",
2689
+ '<html lang="en">',
2690
+ '<head><meta charset="utf-8"><title>Codex Web UI Error</title></head>',
2691
+ "<body>",
2692
+ `<h1>${message}</h1>`,
2693
+ lines,
2694
+ '<p><a href="/">Back to chat</a></p>',
2695
+ "</body>",
2696
+ "</html>"
2697
+ ].join("");
2698
+ }
2685
2699
  function normalizeLocalImagePath(rawPath) {
2686
2700
  const trimmed = rawPath.trim();
2687
2701
  if (!trimmed) return "";
@@ -2807,20 +2821,19 @@ function createServer(options = {}) {
2807
2821
  }
2808
2822
  app.use((_req, res) => {
2809
2823
  if (!hasFrontendAssets) {
2810
- res.status(503).type("text/plain").send(
2811
- [
2812
- "Codex web UI assets are missing.",
2824
+ res.status(503).type("text/html; charset=utf-8").send(
2825
+ renderFrontendMissingHtml("Codex web UI assets are missing.", [
2813
2826
  `Expected: ${spaEntryFile}`,
2814
2827
  "If running from source, build frontend assets with: npm run build:frontend",
2815
2828
  "If running with npx, clear the npx cache and reinstall codexapp."
2816
- ].join("\n")
2829
+ ])
2817
2830
  );
2818
2831
  return;
2819
2832
  }
2820
2833
  res.sendFile(spaEntryFile, (error) => {
2821
2834
  if (!error) return;
2822
2835
  if (!res.headersSent) {
2823
- res.status(404).type("text/plain").send("Frontend entry file not found.");
2836
+ res.status(404).type("text/html; charset=utf-8").send(renderFrontendMissingHtml("Frontend entry file not found."));
2824
2837
  }
2825
2838
  });
2826
2839
  });