mrvn-cli 0.6.0 → 0.6.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.
package/dist/index.js CHANGED
@@ -18709,21 +18709,22 @@ import { fileURLToPath } from "url";
18709
18709
  var __dirname = path5.dirname(fileURLToPath(import.meta.url));
18710
18710
  var cachedStyles = null;
18711
18711
  function renderStyles() {
18712
- if (!cachedStyles) {
18713
- const candidates = [
18714
- path5.join(__dirname, "..", "static", "styles.css"),
18715
- path5.resolve("src/web/static/styles.css"),
18716
- path5.resolve("dist/web/static/styles.css")
18717
- ];
18718
- for (const p of candidates) {
18719
- if (fs5.existsSync(p)) {
18720
- cachedStyles = fs5.readFileSync(p, "utf-8");
18721
- return cachedStyles;
18722
- }
18712
+ if (cachedStyles) return cachedStyles;
18713
+ const candidates = [
18714
+ path5.join(__dirname, "..", "static", "styles.css"),
18715
+ // dev source layout
18716
+ path5.join(__dirname, "web", "static", "styles.css"),
18717
+ // bundled prod layout
18718
+ path5.resolve("src/web/static/styles.css"),
18719
+ path5.resolve("dist/web/static/styles.css")
18720
+ ];
18721
+ for (const p of candidates) {
18722
+ if (fs5.existsSync(p)) {
18723
+ cachedStyles = fs5.readFileSync(p, "utf-8");
18724
+ return cachedStyles;
18723
18725
  }
18724
- throw new Error(`styles.css not found. Searched: ${candidates.join(", ")}`);
18725
18726
  }
18726
- return cachedStyles;
18727
+ throw new Error(`styles.css not found. Searched: ${candidates.join(", ")}`);
18727
18728
  }
18728
18729
 
18729
18730
  // src/web/templates/pages/documents.ts
@@ -22827,11 +22828,12 @@ function handleRequest(req, res, store, projectName, navGroups) {
22827
22828
  const navTypes = store.registeredTypes;
22828
22829
  try {
22829
22830
  if (pathname === "/styles.css") {
22831
+ const css = renderStyles();
22830
22832
  res.writeHead(200, {
22831
22833
  "Content-Type": "text/css",
22832
22834
  "Cache-Control": "public, max-age=300"
22833
22835
  });
22834
- res.end(renderStyles());
22836
+ res.end(css);
22835
22837
  return;
22836
22838
  }
22837
22839
  const oldRootMatch = pathname.match(/^\/([a-z-]+)$/);
@@ -23052,8 +23054,12 @@ function handleRequest(req, res, store, projectName, navGroups) {
23052
23054
  notFound(res, projectName, navGroups, pathname, null);
23053
23055
  } catch (err) {
23054
23056
  console.error("[marvin web] Error handling request:", err);
23055
- res.writeHead(500, { "Content-Type": "text/html" });
23056
- res.end("<h1>500 \u2014 Internal Server Error</h1>");
23057
+ if (!res.headersSent) {
23058
+ res.writeHead(500, { "Content-Type": "text/html" });
23059
+ res.end("<h1>500 \u2014 Internal Server Error</h1>");
23060
+ } else {
23061
+ res.end();
23062
+ }
23057
23063
  }
23058
23064
  }
23059
23065
  function respond(res, html) {
@@ -33141,7 +33147,7 @@ function createProgram() {
33141
33147
  const program = new Command();
33142
33148
  program.name("marvin").description(
33143
33149
  "AI-powered product development assistant with Product Owner, Delivery Manager, and Technical Lead personas"
33144
- ).version("0.6.0");
33150
+ ).version("0.6.1");
33145
33151
  program.command("init").description("Initialize a new Marvin project in the current directory").action(async () => {
33146
33152
  await initCommand();
33147
33153
  });