nestor-sh 2.0.0 → 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
  });
@@ -159958,7 +159960,7 @@ async function runNonInteractiveInstall() {
159958
159960
  console.log(chalk2.dim(" Save this key \u2014 it won't be shown again."));
159959
159961
  console.log();
159960
159962
  console.log(chalk2.green("Setup complete! Start Nestor with:"));
159961
- console.log(chalk2.cyan(" npx nestor start"));
159963
+ console.log(chalk2.cyan(" npx nestor-sh start"));
159962
159964
  }
159963
159965
  async function runInteractiveInstall() {
159964
159966
  p.intro(chalk2.bgCyan(" Nestor Setup Wizard "));
@@ -160087,7 +160089,7 @@ Admin API key: ${apiKey}
160087
160089
  ${chalk2.dim("Save this key \u2014 it won't be shown again.")}`,
160088
160090
  "Setup complete"
160089
160091
  );
160090
- p.outro(chalk2.green("Nestor is ready! Run: ") + chalk2.cyan("npx nestor start"));
160092
+ p.outro(chalk2.green("Nestor is ready! Run: ") + chalk2.cyan("npx nestor-sh start"));
160091
160093
  }
160092
160094
 
160093
160095
  // src/commands/agent.ts