nestor-sh 2.0.1 → 2.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/dist/nestor.mjs CHANGED
@@ -143112,16 +143112,16 @@ function createApp(config2) {
143112
143112
  next();
143113
143113
  });
143114
143114
  if (studioDistDir) {
143115
- app.use("/studio", express.static(studioDistDir));
143116
- app.get("/studio/*", (req, res, next) => {
143115
+ app.get("/studio", (req, res) => {
143117
143116
  if (!studioState.enabled) {
143118
- res.status(403).json({
143119
- error: {
143120
- code: "STUDIO_DISABLED",
143121
- message: "Nestor Studio is currently disabled."
143122
- }
143123
- });
143124
- return;
143117
+ return res.status(403).json({ error: { code: "STUDIO_DISABLED", message: "Studio is disabled." } });
143118
+ }
143119
+ res.sendFile(join16(studioDistDir, "index.html"));
143120
+ });
143121
+ app.use("/studio", express.static(studioDistDir, { index: false }));
143122
+ app.get("/studio/*", (req, res) => {
143123
+ if (!studioState.enabled) {
143124
+ return res.status(403).json({ error: { code: "STUDIO_DISABLED", message: "Studio is disabled." } });
143125
143125
  }
143126
143126
  res.sendFile(join16(studioDistDir, "index.html"));
143127
143127
  });
@@ -159811,7 +159811,9 @@ function registerStartCommand(program2) {
159811
159811
  try {
159812
159812
  const { createNestorServer: createNestorServer2 } = await Promise.resolve().then(() => (init_dist5(), dist_exports3));
159813
159813
  const __cli_dirname = path21.dirname(fileURLToPath4(import.meta.url));
159814
- const studioDir = path21.resolve(__cli_dirname, "../../ui/dist");
159814
+ const bundledStudio = path21.resolve(__cli_dirname, "studio");
159815
+ const monorepoStudio = path21.resolve(__cli_dirname, "../../ui/dist");
159816
+ const studioDir = fs20.existsSync(bundledStudio) ? bundledStudio : fs20.existsSync(monorepoStudio) ? monorepoStudio : void 0;
159815
159817
  serverHandle = createNestorServer2({
159816
159818
  host,
159817
159819
  port,
@@ -159819,7 +159821,7 @@ function registerStartCommand(program2) {
159819
159821
  apiKey: config2.security.approvalMode !== "off" ? void 0 : void 0,
159820
159822
  // no API key in v0.1
159821
159823
  studio: { enabled: studioEnabled },
159822
- studioDir: fs20.existsSync(studioDir) ? studioDir : void 0,
159824
+ studioDir,
159823
159825
  dataDir,
159824
159826
  logger
159825
159827
  });