scream-code 0.19.0 → 0.19.1
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.
|
@@ -36,7 +36,7 @@ function optionalBuildString(value) {
|
|
|
36
36
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
37
37
|
}
|
|
38
38
|
const SCREAM_BUILD_INFO = {
|
|
39
|
-
version: optionalBuildString("0.19.
|
|
39
|
+
version: optionalBuildString("0.19.1"),
|
|
40
40
|
channel: optionalBuildString(""),
|
|
41
41
|
commit: optionalBuildString(""),
|
|
42
42
|
buildTarget: optionalBuildString("darwin-arm64")
|
|
@@ -20772,13 +20772,12 @@ function createGateway(options) {
|
|
|
20772
20772
|
});
|
|
20773
20773
|
});
|
|
20774
20774
|
if (options.uiDir !== void 0 && existsSync(options.uiDir)) {
|
|
20775
|
-
|
|
20776
|
-
app.
|
|
20777
|
-
app.get("*", serveStatic({ path: join(root, "index.html") }));
|
|
20775
|
+
app.use("*", serveStatic({ root: options.uiDir }));
|
|
20776
|
+
app.get("*", serveStatic({ path: join(options.uiDir, "index.html") }));
|
|
20778
20777
|
}
|
|
20779
20778
|
app.notFound((context) => {
|
|
20780
20779
|
if (context.req.path.startsWith("/api/")) return context.json(apiError("not_found", `No route for ${context.req.path}`), 404);
|
|
20781
|
-
return context.text("Bot UI is
|
|
20780
|
+
return context.text("The Bot UI is missing from this installation. Reinstall or upgrade `scream`; from a source checkout run `pnpm --filter scream-code bot:build`.\n", 404);
|
|
20782
20781
|
});
|
|
20783
20782
|
return app;
|
|
20784
20783
|
}
|
|
@@ -20792,14 +20791,26 @@ function createGateway(options) {
|
|
|
20792
20791
|
* returned URL; tests drive the app directly through `createGateway`.
|
|
20793
20792
|
*/
|
|
20794
20793
|
const DEFAULT_BOT_NAME = "Scream";
|
|
20795
|
-
/**
|
|
20794
|
+
/**
|
|
20795
|
+
* Candidate `dist/bot-ui` locations across bundled, installed and source layouts.
|
|
20796
|
+
* All segments go through `node:path`, so the same list works on Windows.
|
|
20797
|
+
*/
|
|
20798
|
+
function uiDirCandidates(moduleDir, cwd, joinPath = join) {
|
|
20799
|
+
return [
|
|
20800
|
+
joinPath(moduleDir, "bot-ui"),
|
|
20801
|
+
joinPath(moduleDir, "../dist/bot-ui"),
|
|
20802
|
+
joinPath(cwd, "dist", "bot-ui"),
|
|
20803
|
+
joinPath(moduleDir, "../../../../dist/bot-ui"),
|
|
20804
|
+
joinPath(moduleDir, "../../../dist/bot-ui"),
|
|
20805
|
+
joinPath(moduleDir, "../../dist/bot-ui")
|
|
20806
|
+
];
|
|
20807
|
+
}
|
|
20808
|
+
/** First candidate that actually contains a built index page. */
|
|
20809
|
+
function pickUiDir(candidates) {
|
|
20810
|
+
return candidates.find((candidate) => existsSync(join(candidate, "index.html")));
|
|
20811
|
+
}
|
|
20796
20812
|
function resolveUiDir() {
|
|
20797
|
-
const found =
|
|
20798
|
-
join(process.cwd(), "dist", "bot-ui"),
|
|
20799
|
-
join(import.meta.dirname, "../../../../dist/bot-ui"),
|
|
20800
|
-
join(import.meta.dirname, "../../../dist/bot-ui"),
|
|
20801
|
-
join(import.meta.dirname, "../../dist/bot-ui")
|
|
20802
|
-
].find((candidate) => existsSync(join(candidate, "index.html")));
|
|
20813
|
+
const found = pickUiDir(uiDirCandidates(import.meta.dirname, process.cwd()));
|
|
20803
20814
|
if (found !== void 0) warnIfStaleBuild(found);
|
|
20804
20815
|
return found;
|
|
20805
20816
|
}
|
package/dist/main.mjs
CHANGED
|
@@ -6,7 +6,7 @@ const __dirname = __cjsShimDirname(__filename);
|
|
|
6
6
|
import "./suppress-sqlite-warning-C2VB0doZ.mjs";
|
|
7
7
|
//#region src/main.ts
|
|
8
8
|
try {
|
|
9
|
-
(await import("./app-
|
|
9
|
+
(await import("./app-p26PYlkc.mjs")).main();
|
|
10
10
|
} catch (error) {
|
|
11
11
|
process.stderr.write(`${error instanceof Error ? error.stack ?? error.message : String(error)}\n`);
|
|
12
12
|
process.exit(1);
|