feat: advance and highlight next AI suggestion on accept/deny/copy-to-note, remove copied suggestion from inline list, and add native Linux .deb packaging

This commit is contained in:
Schwitzz
2026-10-30 13:01:40 -05:00
parent 951aa81055
commit 6bc681df5f
7 changed files with 497 additions and 6 deletions
+25
View File
@@ -1,7 +1,10 @@
import { existsSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import Fastify from "fastify";
import cors from "@fastify/cors";
import cookie from "@fastify/cookie";
import fastifyStatic from "@fastify/static";
import websocket from "@fastify/websocket";
import { ZodError } from "zod";
import { config } from "./config.js";
@@ -68,6 +71,28 @@ export async function buildApp() {
registerAdminRoutes(app);
registerWs(app);
// Serve the built web app when apps/web/dist (or PUBSCRIPT_WEB_DIST) is present
const here = dirname(fileURLToPath(import.meta.url));
const webRoot =
process.env.PUBSCRIPT_WEB_DIST || resolve(here, "../../apps/web/dist");
if (existsSync(webRoot) && existsSync(resolve(webRoot, "index.html"))) {
await app.register(fastifyStatic, {
root: webRoot,
prefix: "/",
wildcard: false,
});
app.setNotFoundHandler((req, reply) => {
if (
req.method === "GET" &&
!req.url.startsWith("/api/") &&
!req.url.startsWith("/ws")
) {
return reply.sendFile("index.html");
}
return reply.code(404).send({ error: "not_found" });
});
}
return app;
}