opencode-webui 1.0.0 → 1.0.2
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/package.json +2 -2
- package/server/index.ts +8 -1
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Web UI for the OpenCode coding agent — chat, streaming, tool cards, and extensions over the OpenCode engine's HTTP API.",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.2",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@fontsource-variable/geist": "^5.3.0",
|
|
46
|
-
"@opencode-ai/client": "
|
|
46
|
+
"@opencode-ai/client": "0.0.0-next-17444",
|
|
47
47
|
"@shadcn/react": "^0.3.0",
|
|
48
48
|
"@xterm/addon-fit": "^0.11.0",
|
|
49
49
|
"@xterm/xterm": "^6.0.0",
|
package/server/index.ts
CHANGED
|
@@ -553,7 +553,14 @@ const server: Server<Record<string, unknown>> = Bun.serve({
|
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
555
|
|
|
556
|
-
|
|
556
|
+
// Serve the built frontend when it exists (npm package + compiled binary).
|
|
557
|
+
// Production binaries force NODE_ENV=production via embed-shim; npm users
|
|
558
|
+
// get dist/ in the tarball but run with NODE_ENV unset — detect an
|
|
559
|
+
// installed package (no src/ on disk) vs a dev checkout (vite owns the
|
|
560
|
+
// frontend). Dev with a stale dist/ still goes to vite for HMR.
|
|
561
|
+
const hasDist = existsSync(join(DIST_DIR, "index.html"));
|
|
562
|
+
const isDevCheckout = existsSync(join(APP_ROOT, "vite.config.ts"));
|
|
563
|
+
if (Bun.env.NODE_ENV === "production" || (hasDist && !isDevCheckout)) {
|
|
557
564
|
if (method === "GET" || method === "HEAD") {
|
|
558
565
|
let filePath = decodeURIComponent(path);
|
|
559
566
|
if (filePath === "/") filePath = "/index.html";
|