@marver-design/marver 0.23.0 → 0.23.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +1 -1
  3. package/dist/{bake-l6N12qgx.mjs → bake-DQtnDB8-.mjs} +1 -1
  4. package/dist/{board-status-D_lHZZ09.mjs → board-status-BZSzc9Hp.mjs} +1 -1
  5. package/dist/{boards-DbVJlbd5.mjs → boards-BRLnoTC3.mjs} +14 -6
  6. package/dist/{boards-CahYhF5B.mjs → boards-Dv-Ipd8G.mjs} +13 -6
  7. package/dist/{build-CuRhHXcY.mjs → build-_ndp_dXn.mjs} +15 -11
  8. package/dist/cli.mjs +10 -10
  9. package/dist/{comments-0d3e274b.mjs → comments-BlqyZh3D.mjs} +1 -1
  10. package/dist/{config-g-J8NrPn.mjs → config-BUKprFAp.mjs} +1 -1
  11. package/dist/{context-fAtQLHt2.mjs → context-CdkNiKdJ.mjs} +3 -3
  12. package/dist/{daemon-DZ367fiM.mjs → daemon-BvMPdQ3k.mjs} +5 -4
  13. package/dist/{dev-R6zvwbqX.mjs → dev-Cf-4eqaC.mjs} +7 -7
  14. package/dist/{init-DAnBlt-V.mjs → init-hfZV7TwY.mjs} +9 -4
  15. package/dist/{link-CcfAfKY-.mjs → link-BodAbIQz.mjs} +3 -3
  16. package/dist/{manifest-BkjJ5OQk.mjs → manifest-TpfDWldB.mjs} +8 -3
  17. package/dist/{plugin-C1avHL7g.mjs → plugin-DoXql0ZZ.mjs} +59 -33
  18. package/dist/{poster-Bc4-3DlQ.mjs → poster-XBmUvQiL.mjs} +1 -1
  19. package/dist/{publish-bakes-DQWn14IY.mjs → publish-bakes-KKTHWqq3.mjs} +2 -2
  20. package/dist/{shot-CVOlQHUr.mjs → shot-DOD8v6fJ.mjs} +2 -2
  21. package/dist/{shot-C1YR_Sqx.mjs → shot-Dh6fV1Lm.mjs} +1 -1
  22. package/dist/{work-CJ8OIpBD.mjs → work-ClFFq0Qh.mjs} +2 -2
  23. package/dist/{work-CiUvBVa6.mjs → work-ayuL_9Kk.mjs} +1 -1
  24. package/docs/boards-and-folders.md +6 -1
  25. package/docs/sticky-notes.md +1 -1
  26. package/package.json +1 -1
  27. package/src/client/content/index.tsx +4 -0
  28. package/src/client/content/md.ts +3 -2
  29. package/src/client/shell/App.tsx +2 -1
  30. package/src/client/shell/BoardList.tsx +5 -0
  31. package/src/client/shell/store.ts +19 -8
  32. package/src/client/shell/styles.css +1 -0
  33. package/src/client/shell/tidy.ts +34 -3
  34. package/src/shared/frames.ts +3 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,39 @@
2
2
 
3
3
  Notable changes to `@marver-design/marver`. Format follows [Keep a Changelog](https://keepachangelog.com); versions follow semver.
4
4
 
5
+ ## 0.23.1 - 2026-10-14
6
+
7
+ ### Fixed
8
+
9
+ - **A board file that is not JSON says why.** One stray character used to leave only `could not
10
+ load "<board>" - staying on <board>`, while `marver boards` listed it as fine. Now the parser's
11
+ own words, with the line and column, appear in four places:
12
+ - a red mark on the board's sidebar row;
13
+ - the toast;
14
+ - the dev server's log;
15
+ - a `(invalid JSON: …)` note on the board's line in `marver boards`.
16
+ (#6)
17
+ - **Folders inside a scene that start with `_` stay off the canvas.** Files in a folder such as
18
+ `_snapshot/` (the iterate guide's frozen copies) were registered as frames, shown on all scenes,
19
+ and shot as frames with no default export. Inside a scene, a `_` now marks infrastructure for a
20
+ folder as it already did for a file; a scene's own folder name is unaffected. (#8)
21
+ - **Tables in a wide `Doc` use its width.** Every `Md` was held to a 72-character measure, so a
22
+ comparison table in `<Doc layout="wide">` wrapped into a tall, half-empty column. In a wide Doc,
23
+ prose keeps that measure and a table grows as far as its cells need, up to the Doc's width. (#12)
24
+ - **HTML comments stay invisible in markdown.** `Md` and sticky notes printed `<!-- ... -->` as
25
+ text, as on a start board's index around its generated table. Comments are now dropped; any other
26
+ raw HTML still shows as plain text. (#15)
27
+ - **An empty phase scene waits quietly.** A feature board names its lo-fi and hi-fi scenes before
28
+ they hold a frame, and the canvas warned `unknown scene ... skipped` on every render, toast
29
+ included. A scene with a brief and no frames is now known, and the layout passes over it and its
30
+ spacer; a misspelt name still warns. (#18)
31
+ - **Re-running `init` keeps the project's name.** `npx marver init` on an existing project rewrote
32
+ `design/manifest.json`'s project line to the folder name and dropped its description, until the
33
+ next `dev`. It now keeps the line it finds. (#13)
34
+ - **No theme warning where no theme is needed.** A canvas made only of content frames (`Doc`, `Md`,
35
+ `Diagram`) brings its own styling, but every boot warned "no theme configured" with a banner. The
36
+ warning now waits for a frame that needs the app's styles. (#4)
37
+
5
38
  ## 0.23.0 - 2026-10-06
6
39
 
7
40
  ### Added
package/README.md CHANGED
@@ -112,7 +112,7 @@ The same glow, driven from the terminal. When your agent takes a request, it cre
112
112
  | `npx marver work …` | Working glow from the terminal: `start <scene/frame …>` · `done … \| --all` (prints the canvas link) · `list` |
113
113
  | `npx marver link <scene/frame \| scene ...>` | The canvas link that lands on those frames - their board, selected and in view (needs `dev` running) |
114
114
  | `npx marver shot <frame ...> \| --scene <name> \| --all [--scale 1-4] [--json]` | Render frames headless and print the PNG paths (needs `dev` running); a scene is one browser, several frames at a time; 2x by default |
115
- | `npx marver boards [--json]` | The sidebar as the files say it is: folders and sub-folders, boards in reading order with their title, type, status, `order` and description, the landing board |
115
+ | `npx marver boards [--json]` | The sidebar as the files say it is: folders and sub-folders, boards in reading order with their title, type, status, `order` and description, the landing board; a board file that is not valid JSON says why, with line and column |
116
116
  | `npx marver boards new <name> [--folder f] [--type t]` | A board in its type's starting layout - a feature's spec, lo-fi and hi-fi bands, a start board rendering `context/` |
117
117
  | `npx marver folders add <module ...>` | Add a typed folder: `start`, `features`, `surfaces`, `projects`, `feedback`, `context`, `decks`, `archive` |
118
118
  | `npx marver context init \| check \| index` | Set up `context/`; check it (exit 0 / 1 / 2; `--base`, `--body-file` for a pull request); regenerate the index's capability table |
@@ -1,4 +1,4 @@
1
- import { AREA, SURFACE, pool, shotConcurrency, withBrowser } from "./shot-CVOlQHUr.mjs";
1
+ import { AREA, SURFACE, pool, shotConcurrency, withBrowser } from "./shot-DOD8v6fJ.mjs";
2
2
  import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, utimesSync, writeFileSync } from "node:fs";
3
3
  import { join, sep } from "node:path";
4
4
  import { createHash } from "node:crypto";
@@ -1,4 +1,4 @@
1
- import { A as readCapability, E as HAS_STATUS, M as readStatusWord, P as resolveType, j as readReason, w as DECISIONS } from "./boards-DbVJlbd5.mjs";
1
+ import { D as HAS_STATUS, F as resolveType, M as readReason, N as readStatusWord, T as DECISIONS, j as readCapability } from "./boards-BRLnoTC3.mjs";
2
2
  import { lstatSync, readFileSync, readdirSync, statSync } from "node:fs";
3
3
  import { join } from "node:path";
4
4
  //#region src/shared/context.ts
@@ -410,6 +410,18 @@ const nodeExists = (p) => {
410
410
  return false;
411
411
  }
412
412
  };
413
+ /** A board file's JSON, or why it is not JSON - the parser's own words, naming the line and column (#6). */
414
+ function parseBoard(content) {
415
+ try {
416
+ return { json: JSON.parse(content) };
417
+ } catch (e) {
418
+ const msg = e.message, lines = content.split("\n");
419
+ return {
420
+ json: null,
421
+ error: /end of JSON input$/.test(msg) ? `${msg} (line ${lines.length} column ${lines[lines.length - 1].length + 1})` : msg
422
+ };
423
+ }
424
+ }
413
425
  /** Every board file: name, raw content, hash, and its JSON (null when malformed). `skipped`
414
426
  * names the entries that looked like boards but were not regular files. */
415
427
  function listBoardFiles(boardsDir) {
@@ -426,16 +438,12 @@ function listBoardFiles(boardsDir) {
426
438
  continue;
427
439
  }
428
440
  const content = readFileSync(file, "utf8");
429
- let json = null;
430
- try {
431
- json = JSON.parse(content);
432
- } catch {}
433
441
  boards.push({
434
442
  name: f.slice(0, -5),
435
443
  file,
436
444
  content,
437
445
  sha256: hash(content),
438
- json
446
+ ...parseBoard(content)
439
447
  });
440
448
  }
441
449
  return {
@@ -609,4 +617,4 @@ function appendFolders(dir, file, folders) {
609
617
  throw new Error(`design/boards/${FOLDERS_FILE} kept changing while folders were added - try again`);
610
618
  }
611
619
  //#endregion
612
- export { readCapability as A, BOARD_TYPES as C, KIND_FOLDERS as D, HAS_STATUS as E, settableStatuses as F, hash as I, readStatusWord as M, readType as N, PROPOSED_PUBLISH as O, resolveType as P, wireKids as S, FOLDER_MODULES as T, humanize as _, checkRealDirs as a, readTitle as b, nodeExists as c, BOARD_NAME as d, FOLDERS_FILE as f, folderMap as g, folderEntries as h, checkBoardsDir as i, readReason as j, knownType as k, readRegistry as l, flatten as m, addFolders as n, isRegularFile as o, buildTree as p, boardFields as r, listBoardFiles as s, AUTHOR_FIELDS as t, withRegistryLock as u, isBoardName as v, DECISIONS as w, validateWire as x, readDescription as y };
620
+ export { knownType as A, wireKids as C, HAS_STATUS as D, FOLDER_MODULES as E, resolveType as F, settableStatuses as I, hash as L, readReason as M, readStatusWord as N, KIND_FOLDERS as O, readType as P, validateWire as S, DECISIONS as T, folderMap as _, checkRealDirs as a, readDescription as b, nodeExists as c, withRegistryLock as d, BOARD_NAME as f, folderEntries as g, flatten as h, checkBoardsDir as i, readCapability as j, PROPOSED_PUBLISH as k, parseBoard as l, buildTree as m, addFolders as n, isRegularFile as o, FOLDERS_FILE as p, boardFields as r, listBoardFiles as s, AUTHOR_FIELDS as t, readRegistry as u, humanize as v, BOARD_TYPES as w, readTitle as x, isBoardName as y };
@@ -1,6 +1,6 @@
1
1
  import { r as NAME } from "./cli.mjs";
2
- import { A as readCapability, C as BOARD_TYPES, P as resolveType, T as FOLDER_MODULES, _ as humanize, a as checkRealDirs, g as folderMap, i as checkBoardsDir, k as knownType, l as readRegistry, m as flatten, n as addFolders, p as buildTree, r as boardFields, s as listBoardFiles, v as isBoardName } from "./boards-DbVJlbd5.mjs";
3
- import { a as PHASE_LABEL, s as STATUS_LABEL, t as annotateBoards } from "./board-status-D_lHZZ09.mjs";
2
+ import { A as knownType, E as FOLDER_MODULES, F as resolveType, _ as folderMap, a as checkRealDirs, h as flatten, i as checkBoardsDir, j as readCapability, m as buildTree, n as addFolders, r as boardFields, s as listBoardFiles, u as readRegistry, v as humanize, w as BOARD_TYPES, y as isBoardName } from "./boards-BRLnoTC3.mjs";
3
+ import { a as PHASE_LABEL, s as STATUS_LABEL, t as annotateBoards } from "./board-status-BZSzc9Hp.mjs";
4
4
  import { existsSync, mkdirSync, writeFileSync } from "node:fs";
5
5
  import { join } from "node:path";
6
6
  //#region src/cli/boards.ts
@@ -19,7 +19,8 @@ function boardsCommand(root, opts) {
19
19
  if (reg.state === "malformed") throw new Error(reg.error);
20
20
  const rows = boards.map((b) => ({
21
21
  name: b.name,
22
- ...boardFields(b.json, isBoardName)
22
+ ...boardFields(b.json, isBoardName),
23
+ ...b.error ? { error: b.error } : {}
23
24
  }));
24
25
  const tree = buildTree(rows, reg.folders);
25
26
  const hasAll = boards.some((b) => b.name === "all-scenes");
@@ -30,11 +31,13 @@ function boardsCommand(root, opts) {
30
31
  ...r,
31
32
  ...notes.get(r.name) ?? {}
32
33
  }));
34
+ const invalid = Object.fromEntries(boards.flatMap((b) => b.error ? [[b.name, b.error]] : []));
33
35
  console.log(JSON.stringify({
34
36
  tree,
35
37
  boards: out,
36
38
  landing: flatten(tree)[0] ?? (hasAll ? "all-scenes" : null),
37
- registry: reg.state === "ok" ? "design/boards/_folders.json" : null
39
+ registry: reg.state === "ok" ? "design/boards/_folders.json" : null,
40
+ ...Object.keys(invalid).length ? { invalid } : {}
38
41
  }, null, 2));
39
42
  return;
40
43
  }
@@ -54,9 +57,13 @@ function boardsCommand(root, opts) {
54
57
  const st = a.status ? ` · ${STATUS_LABEL[a.status.status]}${a.status.fill ? ` (${PHASE_LABEL[a.status.fill]})` : ""}${a.status.reason ? `: ${a.status.reason}` : ""}` : "";
55
58
  return a.type === "plain" && !st ? "" : ` [${a.type}${st}]`;
56
59
  };
60
+ const bad = (n) => {
61
+ const e = boards.find((b) => b.name === n)?.error;
62
+ return e ? ` (invalid JSON: ${e})` : "";
63
+ };
57
64
  const boardLine = (n) => {
58
65
  const r = rows.find((x) => x.name === n);
59
- return `${n}${title(r?.title)}${kind(n)}${order(n)}${desc(r?.description)}`;
66
+ return `${n}${bad(n)}${title(r?.title)}${kind(n)}${order(n)}${desc(r?.description)}`;
60
67
  };
61
68
  const count = (f) => {
62
69
  const boards = f.items.filter((k) => k.kind === "board").length, subs = f.items.length - boards;
@@ -76,7 +83,7 @@ function boardsCommand(root, opts) {
76
83
  }
77
84
  };
78
85
  print(tree, "", null);
79
- if (hasAll) console.log("all-scenes (auto, always last)");
86
+ if (hasAll) console.log(`all-scenes${bad("all-scenes")} (auto, always last)`);
80
87
  const landing = flatten(tree)[0];
81
88
  if (landing) console.log(`\nlanding board: ${landing}`);
82
89
  console.log(`registry: ${reg.state === "ok" ? "design/boards/_folders.json" : "none (no empty or ranked folders yet)"}`);
@@ -1,9 +1,9 @@
1
1
  import { a as ROUTE, r as NAME } from "./cli.mjs";
2
- import { O as PROPOSED_PUBLISH, i as checkBoardsDir, l as readRegistry, m as flatten, p as buildTree, r as boardFields, s as listBoardFiles, v as isBoardName } from "./boards-DbVJlbd5.mjs";
3
- import { c as publishableStatus, o as PUBLISHABLE } from "./board-status-D_lHZZ09.mjs";
4
- import { o as scanFrames } from "./manifest-BkjJ5OQk.mjs";
5
- import { n as loadConfig, r as detectHost } from "./config-g-J8NrPn.mjs";
6
- import { a as autoWidthOf, c as readSizes, n as tailwind3Css, o as keptSizes, r as tailwind4Plugin, s as measuringFrames, t as marverPlugin } from "./plugin-C1avHL7g.mjs";
2
+ import { h as flatten, i as checkBoardsDir, k as PROPOSED_PUBLISH, m as buildTree, r as boardFields, s as listBoardFiles, u as readRegistry, y as isBoardName } from "./boards-BRLnoTC3.mjs";
3
+ import { c as publishableStatus, o as PUBLISHABLE } from "./board-status-BZSzc9Hp.mjs";
4
+ import { o as scanFrames } from "./manifest-TpfDWldB.mjs";
5
+ import { n as loadConfig, r as detectHost } from "./config-BUKprFAp.mjs";
6
+ import { a as autoWidthOf, c as readSizes, n as tailwind3Css, o as keptSizes, r as tailwind4Plugin, s as measuringFrames, t as marverPlugin } from "./plugin-DoXql0ZZ.mjs";
7
7
  import { cpSync, existsSync, mkdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
8
8
  import { basename, dirname, join, sep } from "node:path";
9
9
  import { fileURLToPath } from "node:url";
@@ -369,7 +369,7 @@ function publishedTree(published, allBoards, folders) {
369
369
  /** The bundle's manifest: the published frames, and descriptions of published things ONLY -
370
370
  * the project's, the published scenes' (their brief path only when source is revealed),
371
371
  * the published boards' and the folders those sit in. No unpublished name or sentence. */
372
- function publishedManifest(manifest, pubFrames, publishedNames, strip, showStatus = /* @__PURE__ */ new Set()) {
372
+ function publishedManifest(manifest, pubFrames, publishedNames, strip, showStatus = /* @__PURE__ */ new Set(), recipeScenes = /* @__PURE__ */ new Set()) {
373
373
  const pubScenes = new Set(pubFrames.map((f) => f.scene));
374
374
  const pubBoardSet = new Set(publishedNames);
375
375
  const pubBoards = (manifest.boards ?? []).filter((b) => pubBoardSet.has(b.name)).map(({ status, ...b }) => {
@@ -386,14 +386,17 @@ function publishedManifest(manifest, pubFrames, publishedNames, strip, showStatu
386
386
  ...manifest.project ? { project: manifest.project } : {},
387
387
  ...pubFolders.length ? { folders: pubFolders } : {},
388
388
  ...pubBoards.length ? { boards: pubBoards } : {},
389
- scenes: manifest.scenes.filter((s) => pubScenes.has(s.name)).map(({ name, title, description, brief, note }) => ({
389
+ scenes: manifest.scenes.flatMap(({ name, title, description, brief, note }) => pubScenes.has(name) ? [{
390
390
  name,
391
391
  frames: pubFrames.filter((f) => f.scene === name).length,
392
392
  ...title ? { title } : {},
393
393
  ...description ? { description } : {},
394
394
  ...brief && !strip ? { brief } : {},
395
395
  ...note ? { note } : {}
396
- })),
396
+ }] : recipeScenes.has(name) ? [{
397
+ name,
398
+ frames: 0
399
+ }] : []),
397
400
  frames: pubFrames
398
401
  };
399
402
  }
@@ -575,7 +578,8 @@ async function buildSite(root, boardsFlag, allBoardsFlag, embedSeeds, textures =
575
578
  file: opaquePath(f.id, f.kind === "html" ? ".html" : "")
576
579
  })) : frames;
577
580
  const showStatus = new Set(publishedNames.filter((n) => policy.boards[n]?.showStatus));
578
- const pubManifest = publishedManifest(manifest, pubFrames, publishedNames, strip, showStatus);
581
+ const lanes = (x) => Array.isArray(x) ? x : [];
582
+ const pubManifest = publishedManifest(manifest, pubFrames, publishedNames, strip, showStatus, new Set(Object.values(boards).flatMap((b) => [...lanes(b?.layout?.rows), ...lanes(b?.layout?.columns)]).flatMap(lanes).filter((a) => typeof a === "string")));
579
583
  for (const n of publishedNames) {
580
584
  const pb = policy.boards[n];
581
585
  if (pb?.type !== "slides" && pb?.open !== "slides") continue;
@@ -758,7 +762,7 @@ async function buildSite(root, boardsFlag, allBoardsFlag, embedSeeds, textures =
758
762
  const realAssets = existsSync(assetsDir) ? realpathSync(assetsDir) : null;
759
763
  for (const r of refs) {
760
764
  if (!isLocalAssetRef(r) || !r.endsWith(".poster.png") || existsSync(join(assetsDir, r))) continue;
761
- const { ensurePoster } = await import("./poster-Bc4-3DlQ.mjs");
765
+ const { ensurePoster } = await import("./poster-XBmUvQiL.mjs");
762
766
  const g = await ensurePoster(assetsDir, r.slice(0, -11));
763
767
  if (!g.ok) throw new Error(`design/assets/${r}: ${g.error}`);
764
768
  console.log(` poster: rendered design/assets/${r} (${g.width}×${g.height})`);
@@ -825,7 +829,7 @@ async function buildSite(root, boardsFlag, allBoardsFlag, embedSeeds, textures =
825
829
  }));
826
830
  let textureLine = " textures: skipped (--no-textures)";
827
831
  if (textures && bakeGen) {
828
- const { bakePublished } = await import("./publish-bakes-DQWn14IY.mjs");
832
+ const { bakePublished } = await import("./publish-bakes-KKTHWqq3.mjs");
829
833
  const pubFrameFile = new Map(pubFrames.map((f) => [f.id, f]));
830
834
  const r = await bakePublished({
831
835
  root,
package/dist/cli.mjs CHANGED
@@ -82,7 +82,7 @@ cli.command("init", "Scaffold design/ in this repo").option("--mode <mode>", "st
82
82
  console.error(`[${NAME}] --kind ${opts.kind}: use product or knowledge`);
83
83
  process.exit(1);
84
84
  }
85
- const { init } = await import("./init-DAnBlt-V.mjs");
85
+ const { init } = await import("./init-hfZV7TwY.mjs");
86
86
  init(resolve$1(opts.root), {
87
87
  mode: opts.mode === "embedded" ? "embedded" : "studio",
88
88
  demo: opts.demo !== false,
@@ -90,7 +90,7 @@ cli.command("init", "Scaffold design/ in this repo").option("--mode <mode>", "st
90
90
  });
91
91
  });
92
92
  for (const [name, desc] of [["dev", "Start the local canvas (everything on: hot reload, comments, Live Jam)"], ["canvas", "Start the local canvas - same as dev"]]) cli.command(name, desc).option("--root <dir>", "Host repo root", { default: "." }).option("--port <port>", "Port (default 5199)").action(async (opts) => {
93
- const { dev } = await import("./dev-R6zvwbqX.mjs");
93
+ const { dev } = await import("./dev-Cf-4eqaC.mjs");
94
94
  let port;
95
95
  if (opts.port !== void 0) {
96
96
  const n = Number(opts.port);
@@ -100,7 +100,7 @@ for (const [name, desc] of [["dev", "Start the local canvas (everything on: hot
100
100
  await dev(resolve$1(opts.root), port);
101
101
  });
102
102
  cli.command("build", "Static export → design/.dist (what ships comes from design/publish.json - publishing is default-closed)").option("--boards <names>", "Publish only these boards (comma-separated); overrides the publish policy").option("--all-boards", "Publish every board - the loud override for the default-closed policy").option("--embed-seeds", "Copy comment history INTO the web root (identifying - every event carries its author's email)").option("--no-textures", "Skip compiling the glass textures the published frames rest under (needs Chrome; a CI without one skips on its own)").option("--root <dir>", "Host repo root", { default: "." }).action(async (opts) => {
103
- const { buildSite } = await import("./build-CuRhHXcY.mjs");
103
+ const { buildSite } = await import("./build-_ndp_dXn.mjs");
104
104
  try {
105
105
  const boards = opts.boards === void 0 ? void 0 : typeof opts.boards === "string" ? opts.boards : "";
106
106
  await buildSite(resolve$1(opts.root), boards, opts.allBoards === true, opts.embedSeeds === true, opts.textures !== false && !process.env.MARVER_NO_TEXTURES);
@@ -119,7 +119,7 @@ cli.command("serve", "Serve design/.dist (set MARVER_PASSWORD to gate it)").opti
119
119
  serve(resolve$1(opts.root), port);
120
120
  });
121
121
  cli.command("comments <action> [value]", "Comment collaboration: connect <url> · sync · list · new <scene/frame> · reply <thread> · resolve <thread> · invite <email> · revoke <email>").option("--root <dir>", "Host repo root", { default: "." }).option("--token <token>", "connect: the canvas's MARVER_CLI_TOKEN (default $MARVER_CLI_TOKEN) - the identity-mode path").option("--invite <token>", "connect: claim this invite instead of signing in").option("--canvas-password <password>", "connect: the canvas gate password (default $MARVER_PASSWORD or prompt)").option("--email <email>", "connect: account email (skips the prompt)").option("--password <password>", "connect: account password (skips the prompt - mind your shell history)").option("--name <name>", "connect --invite: display name for the new account").option("--open", "list: only unresolved threads").option("--json", "list: machine-readable output").option("--board <board>", "list: scope to one board · new: the board to pin on (default: the one its link opens)").option("--body <text>", "new / reply: the text").option("--on <text>", "new: pin on the element showing this text (default: the frame, top right)").option("--addressed-in <frame>", "resolve: the variant frame that answered the feedback").action(async (action, value, opts) => {
122
- const { commentsCommand } = await import("./comments-0d3e274b.mjs");
122
+ const { commentsCommand } = await import("./comments-BlqyZh3D.mjs");
123
123
  try {
124
124
  await commentsCommand(resolve$1(opts.root), action, value, opts);
125
125
  } catch (err) {
@@ -137,7 +137,7 @@ cli.command("share <action> [value]", "Sharing roster (owner): add <who> · remo
137
137
  }
138
138
  });
139
139
  cli.command("work <action> [...frames]", "Working state on the canvas: start <scene/frame ...> · done <scene/frame ...> | --all · list").option("--root <dir>", "Host repo root", { default: "." }).option("--ttl <minutes>", "start: minutes before the glow self-expires (default 10, max 30)").option("--all", "done: clear every working frame").action(async (action, frames, opts) => {
140
- const { workCommand } = await import("./work-CJ8OIpBD.mjs");
140
+ const { workCommand } = await import("./work-ClFFq0Qh.mjs");
141
141
  try {
142
142
  await workCommand(resolve$1(opts.root), action, frames ?? [], opts);
143
143
  } catch (err) {
@@ -146,7 +146,7 @@ cli.command("work <action> [...frames]", "Working state on the canvas: start <sc
146
146
  }
147
147
  });
148
148
  cli.command("link [...targets]", "The canvas link that lands on frames: link <scene/frame | scene ...> - their board, in canvas mode, selected and fitted").option("--root <dir>", "Host repo root", { default: "." }).option("--board <board>", "The board to open (default: the first board that shows them all, else all-scenes)").action(async (targets, opts) => {
149
- const { linkCommand } = await import("./link-CcfAfKY-.mjs");
149
+ const { linkCommand } = await import("./link-BodAbIQz.mjs");
150
150
  try {
151
151
  await linkCommand(resolve$1(opts.root), targets ?? [], opts);
152
152
  } catch (err) {
@@ -155,7 +155,7 @@ cli.command("link [...targets]", "The canvas link that lands on frames: link <sc
155
155
  }
156
156
  });
157
157
  cli.command("boards [action] [name]", "The sidebar as files: every folder and board in reading order, with types and statuses · new <name>: a board in its type's starting layout").option("--root <dir>", "Host repo root", { default: "." }).option("--json", "The tree as JSON ({ tree, boards, landing, registry })").option("--type <type>", "new: start | feature | surface | project | feedback | context | deck | archive (default: the folder's)").option("--folder <folder>", "new: the folder it sits in").option("--title <title>", "new: what humans see").option("--description <sentence>", "new: what agents read").option("--capability <slug>", "new: the capability it shows, when not its own name").action(async (action, name, opts) => {
158
- const { boardsCommand, boardsNew } = await import("./boards-CahYhF5B.mjs");
158
+ const { boardsCommand, boardsNew } = await import("./boards-Dv-Ipd8G.mjs");
159
159
  try {
160
160
  if (action === void 0) boardsCommand(resolve$1(opts.root), opts);
161
161
  else if (action === "new") {
@@ -171,7 +171,7 @@ cli.command("boards [action] [name]", "The sidebar as files: every folder and bo
171
171
  }
172
172
  });
173
173
  cli.command("folders <action> [...modules]", "The shared sidebar's typed folders · add <start|features|surfaces|projects|feedback|context|decks|archive ...>").option("--root <dir>", "Host repo root", { default: "." }).action(async (action, modules, opts) => {
174
- const { foldersAdd } = await import("./boards-CahYhF5B.mjs");
174
+ const { foldersAdd } = await import("./boards-Dv-Ipd8G.mjs");
175
175
  try {
176
176
  if (action !== "add") throw new Error(`unknown action "${action}" - \`folders add <module ...>\``);
177
177
  const { added, existing } = foldersAdd(resolve$1(opts.root), modules);
@@ -183,7 +183,7 @@ cli.command("folders <action> [...modules]", "The shared sidebar's typed folders
183
183
  }
184
184
  });
185
185
  cli.command("context <action>", "The project's context/ (spec 19) · init: create it · check: keep it true (exit 0 pass, 1 fail, 2 cannot determine) · index: regenerate the index's capability table").option("--root <dir>", "Host repo root", { default: "." }).option("--base <ref>", "check: the pull request's base - a change to a contracted capability's code must change its contract or say why (in ci, read from the event)").option("--head <ref>", "check: the pull request's head (default HEAD)").option("--body-file <file>", "check: the pull request's body, for `no-contract-change: <capability> - <why>`").option("--json", "check: the findings as JSON ({ exit, failures, unsure, notes })").option("--kind <kind>", "init: product (a shipped record) or knowledge (a delivered record)", { default: "product" }).action(async (action, opts) => {
186
- const ctx = await import("./context-fAtQLHt2.mjs");
186
+ const ctx = await import("./context-CdkNiKdJ.mjs");
187
187
  const root = resolve$1(opts.root);
188
188
  try {
189
189
  if (action === "init") {
@@ -219,7 +219,7 @@ cli.command("context <action>", "The project's context/ (spec 19) · init: creat
219
219
  }
220
220
  });
221
221
  cli.command("shot [...frames]", "Render frames headless and print the PNG paths (needs `dev` running): ids, --scene <name> or --all").option("--root <dir>", "Host repo root", { default: "." }).option("--scene <name>", "Every frame of one scene").option("--all", "Every frame of the canvas").option("--theme <name>", "Theme to render (default: light)").option("--scale <n>", "Device pixels per CSS px, 1-4 (default: 2; 4 for print-quality stills)").option("--json", "Print the results as JSON ({ results: [...] }) instead of paths").action(async (frames, opts) => {
222
- const { shotCommand } = await import("./shot-C1YR_Sqx.mjs");
222
+ const { shotCommand } = await import("./shot-Dh6fV1Lm.mjs");
223
223
  try {
224
224
  await shotCommand(resolve$1(opts.root), frames, opts);
225
225
  } catch (err) {
@@ -124,7 +124,7 @@ async function commentsCommand(root, action, value, opts) {
124
124
  }
125
125
  case "new": {
126
126
  if (!value || !opts.body) throw new Error("usage: comments new <scene/frame> --body \"...\" [--on \"<text on screen>\"] [--board <board>]");
127
- const { resolveLink, devOrigin } = await import("./link-CcfAfKY-.mjs");
127
+ const { resolveLink, devOrigin } = await import("./link-BodAbIQz.mjs");
128
128
  const r = resolveLink(root, [value], opts.board);
129
129
  if (r.exact.length !== 1) throw new Error(`"${value}" is a folder of frames - pin a note on one frame: comments new <scene/frame>`);
130
130
  const frame = r.exact[0];
@@ -1,4 +1,4 @@
1
- import { y as readDescription } from "./boards-DbVJlbd5.mjs";
1
+ import { b as readDescription } from "./boards-BRLnoTC3.mjs";
2
2
  import { i as onPath, n as AGENT_NAMES, r as detectAgent, t as AGENT_BIN } from "./agent-BsieQGTD.mjs";
3
3
  import { existsSync, readFileSync } from "node:fs";
4
4
  import { join } from "node:path";
@@ -1,9 +1,9 @@
1
1
  import { r as NAME } from "./cli.mjs";
2
- import { M as readStatusWord, a as checkRealDirs } from "./boards-DbVJlbd5.mjs";
3
- import { C as parseMap, E as wordCount, S as looseTables, T as tables, _ as globRe, b as levelsIn, d as EVIDENCE_COLUMN, f as GENERATED, g as frontMatter, h as capabilityTable, l as CITATION, m as availableLevels, p as LEVEL, u as CITED_FILE, v as hasGlob, w as proseLines, x as lf, y as isRecordTable } from "./board-status-D_lHZZ09.mjs";
2
+ import { N as readStatusWord, a as checkRealDirs } from "./boards-BRLnoTC3.mjs";
3
+ import { C as parseMap, E as wordCount, S as looseTables, T as tables, _ as globRe, b as levelsIn, d as EVIDENCE_COLUMN, f as GENERATED, g as frontMatter, h as capabilityTable, l as CITATION, m as availableLevels, p as LEVEL, u as CITED_FILE, v as hasGlob, w as proseLines, x as lf, y as isRecordTable } from "./board-status-BZSzc9Hp.mjs";
4
4
  import { pkgDir } from "./managed-HwHVNI3h.mjs";
5
5
  import { t as writeManaged } from "./managed-write-Bo-oPc-i.mjs";
6
- import { o as scanFrames } from "./manifest-BkjJ5OQk.mjs";
6
+ import { o as scanFrames } from "./manifest-TpfDWldB.mjs";
7
7
  import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
8
8
  import { basename, dirname, join, normalize, relative, sep } from "node:path";
9
9
  import { execFileSync } from "node:child_process";
@@ -1,8 +1,8 @@
1
1
  import { n as replay } from "./events-B3LBn74P.mjs";
2
2
  import { i as readLog, r as listBoards, t as appendEvents } from "./comments-DZyobpxG.mjs";
3
3
  import { n as localProfile } from "./profile-CrZohD6g.mjs";
4
- import { c as toFrameId } from "./manifest-BkjJ5OQk.mjs";
5
- import { a as workActivity } from "./work-CiUvBVa6.mjs";
4
+ import { c as toFrameId } from "./manifest-TpfDWldB.mjs";
5
+ import { a as workActivity } from "./work-ayuL_9Kk.mjs";
6
6
  import { has, t as deviceId } from "./ledger-BNXW14Xw.mjs";
7
7
  import { closeSync, existsSync, fsyncSync, mkdirSync, openSync, readFileSync, readdirSync, renameSync, rmSync, statSync, unlinkSync, watch, writeFileSync, writeSync } from "node:fs";
8
8
  import { join } from "node:path";
@@ -996,8 +996,9 @@ const sceneFrameMtimes = (root) => {
996
996
  return out;
997
997
  }
998
998
  for (const rel of entries) {
999
- const base = rel.split("/").pop() ?? rel;
1000
- if (base.startsWith("_") || !FRAME_FILE.test(base)) continue;
999
+ const parts = rel.split(/[\\/]/);
1000
+ const base = parts[parts.length - 1];
1001
+ if (!FRAME_FILE.test(base) || base.startsWith("_") || parts.slice(1, -1).some((s) => s.startsWith("_"))) continue;
1001
1002
  try {
1002
1003
  out.set(toFrameId(`scenes/${rel}`), statSync(join(scenesDir, rel)).mtimeMs);
1003
1004
  } catch {}
@@ -1,6 +1,6 @@
1
1
  import { i as PKG, r as NAME } from "./cli.mjs";
2
- import { n as loadConfig, r as detectHost } from "./config-g-J8NrPn.mjs";
3
- import { n as tailwind3Css, r as tailwind4Plugin, t as marverPlugin } from "./plugin-C1avHL7g.mjs";
2
+ import { n as loadConfig, r as detectHost } from "./config-BUKprFAp.mjs";
3
+ import { n as tailwind3Css, r as tailwind4Plugin, t as marverPlugin } from "./plugin-DoXql0ZZ.mjs";
4
4
  import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, statSync, watch } from "node:fs";
5
5
  import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
6
6
  import { fileURLToPath } from "node:url";
@@ -454,12 +454,12 @@ async function dev(root, portFlag) {
454
454
  console.log(`\n ${NAME} · ${projectName} → http://localhost:${port}/\n`);
455
455
  setTimeout(async () => {
456
456
  try {
457
- await (await import("./shot-CVOlQHUr.mjs")).sweepGhosts((m) => console.log(` ${m}`));
457
+ await (await import("./shot-DOD8v6fJ.mjs")).sweepGhosts((m) => console.log(` ${m}`));
458
458
  } catch {}
459
459
  }, 0);
460
460
  try {
461
461
  const { staleManagedInstructions } = await import("./managed-HwHVNI3h.mjs");
462
- const { installedVersion } = await import("./plugin-C1avHL7g.mjs").then((n) => n.i);
462
+ const { installedVersion } = await import("./plugin-DoXql0ZZ.mjs").then((n) => n.i);
463
463
  const stale = staleManagedInstructions(root);
464
464
  if (stale.length) {
465
465
  const shown = stale.slice(0, 4).join(", ") + (stale.length > 4 ? `, +${stale.length - 4} more` : "");
@@ -469,7 +469,7 @@ async function dev(root, portFlag) {
469
469
  } catch {}
470
470
  try {
471
471
  if (!existsSync(join(root, "context"))) {
472
- const n = (await import("./manifest-BkjJ5OQk.mjs").then((n) => n.i)).statusBoards(root).length;
472
+ const n = (await import("./manifest-TpfDWldB.mjs").then((n) => n.i)).statusBoards(root).length;
473
473
  if (n) console.log(` ${n} feature/project board${n === 1 ? "" : "s"}, no context/ - every status reads Backlog. To start it, tell your agent: "Set up our context."\n`);
474
474
  }
475
475
  } catch {}
@@ -488,7 +488,7 @@ async function dev(root, portFlag) {
488
488
  };
489
489
  tick();
490
490
  setInterval(tick, 3e4).unref();
491
- const { workActivity, writeDevInfo, removeDevInfo, boardsShowing, onBoardsChanged, nextActivitySeq } = await import("./work-CiUvBVa6.mjs").then((n) => n.o);
491
+ const { workActivity, writeDevInfo, removeDevInfo, boardsShowing, onBoardsChanged, nextActivitySeq } = await import("./work-ayuL_9Kk.mjs").then((n) => n.o);
492
492
  let sent = "";
493
493
  const broadcast = (frames) => {
494
494
  const state = {
@@ -543,7 +543,7 @@ async function dev(root, portFlag) {
543
543
  } catch {}
544
544
  }
545
545
  if (config.jam) {
546
- const { startJam } = await import("./daemon-DZ367fiM.mjs");
546
+ const { startJam } = await import("./daemon-BvMPdQ3k.mjs");
547
547
  const jam = startJam(root, config.jam, (m) => console.log(m), (board) => server.ws.send("sh:jam-comment", { board }));
548
548
  if (jam) {
549
549
  const close = server.close.bind(server);
@@ -1,10 +1,10 @@
1
1
  import { r as NAME } from "./cli.mjs";
2
- import { D as KIND_FOLDERS, T as FOLDER_MODULES, n as addFolders } from "./boards-DbVJlbd5.mjs";
2
+ import { E as FOLDER_MODULES, O as KIND_FOLDERS, n as addFolders } from "./boards-BRLnoTC3.mjs";
3
3
  import { r as detectAgent } from "./agent-BsieQGTD.mjs";
4
4
  import { MANAGED_PREFIX, enumerateInstructionTemplates, hashBody, pkgDir } from "./managed-HwHVNI3h.mjs";
5
5
  import { t as writeManaged } from "./managed-write-Bo-oPc-i.mjs";
6
- import { l as writeManifest, o as scanFrames } from "./manifest-BkjJ5OQk.mjs";
7
- import { i as readJson, r as detectHost, t as DEFAULTS } from "./config-g-J8NrPn.mjs";
6
+ import { l as writeManifest, o as scanFrames } from "./manifest-TpfDWldB.mjs";
7
+ import { i as readJson, r as detectHost, t as DEFAULTS } from "./config-BUKprFAp.mjs";
8
8
  import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
9
9
  import { basename, dirname, join, relative } from "node:path";
10
10
  //#region src/cli/init.ts
@@ -218,7 +218,12 @@ function init(root, opts) {
218
218
  created.push("design/scenes/demo/ (3 frames)");
219
219
  }
220
220
  if (host.tsconfigSweepsDesign) patchTsconfigExclude(root);
221
- writeManifest(root, scanFrames(root, { name: basename(root) }));
221
+ const prev = readJson(join(design, "manifest.json"))?.project;
222
+ const str = (v) => typeof v === "string" && v ? v : void 0;
223
+ writeManifest(root, scanFrames(root, {
224
+ name: str(prev?.name) ?? basename(root),
225
+ description: str(prev?.description)
226
+ }));
222
227
  console.log(`\n${NAME} initialized (${opts.mode} mode). Created:`);
223
228
  for (const f of created) console.log(` + ${f}`);
224
229
  if (host.router === "next") console.log(`\n note: Next.js support is partial - frames render outside Next, so next/font, next/image and Server Components do not exist inside them (details in design/AGENTS.md).`);
@@ -1,7 +1,7 @@
1
1
  import { r as NAME } from "./cli.mjs";
2
- import { P as resolveType, g as folderMap, i as checkBoardsDir, l as readRegistry, m as flatten, p as buildTree, r as boardFields, s as listBoardFiles, v as isBoardName } from "./boards-DbVJlbd5.mjs";
3
- import { o as scanFrames } from "./manifest-BkjJ5OQk.mjs";
4
- import { i as readDevInfo } from "./work-CiUvBVa6.mjs";
2
+ import { F as resolveType, _ as folderMap, h as flatten, i as checkBoardsDir, m as buildTree, r as boardFields, s as listBoardFiles, u as readRegistry, y as isBoardName } from "./boards-BRLnoTC3.mjs";
3
+ import { o as scanFrames } from "./manifest-TpfDWldB.mjs";
4
+ import { i as readDevInfo } from "./work-ayuL_9Kk.mjs";
5
5
  import { join } from "node:path";
6
6
  //#region src/cli/link.ts
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
2
  import { i as PKG, n as CONTENT_WIDTH } from "./cli.mjs";
3
- import { I as hash, a as checkRealDirs, b as readTitle, h as folderEntries, i as checkBoardsDir, l as readRegistry, m as flatten, p as buildTree, r as boardFields, s as listBoardFiles, v as isBoardName, y as readDescription } from "./boards-DbVJlbd5.mjs";
4
- import { t as annotateBoards } from "./board-status-D_lHZZ09.mjs";
3
+ import { L as hash, a as checkRealDirs, b as readDescription, g as folderEntries, h as flatten, i as checkBoardsDir, m as buildTree, r as boardFields, s as listBoardFiles, u as readRegistry, x as readTitle, y as isBoardName } from "./boards-BRLnoTC3.mjs";
4
+ import { t as annotateBoards } from "./board-status-BZSzc9Hp.mjs";
5
5
  import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
6
6
  import { join, relative, sep } from "node:path";
7
7
  import { randomBytes } from "node:crypto";
@@ -368,8 +368,9 @@ function scanFrames(root, project) {
368
368
  const layoutDocs = /* @__PURE__ */ new Map();
369
369
  for (const base of ["scenes", "components"]) for (const abs of walk(join(design, base))) {
370
370
  const name = abs.split(sep).pop();
371
- if (name.startsWith("_") || !FRAME_EXT.test(name)) continue;
372
371
  const rel = relative(design, abs).split(sep).join("/");
372
+ const folders = rel.split("/").slice(base === "scenes" ? 2 : 1, -1);
373
+ if (!FRAME_EXT.test(name) || name.startsWith("_") || folders.some((s) => s.startsWith("_"))) continue;
373
374
  const id = toFrameId(rel);
374
375
  const scene = id.includes("/") ? id.split("/")[0] : "";
375
376
  if (base === "scenes" && RESERVED_SCENES.has(scene)) {
@@ -421,6 +422,10 @@ function scanFrames(root, project) {
421
422
  inferVariantGroups(frames);
422
423
  const sceneCounts = /* @__PURE__ */ new Map();
423
424
  for (const f of frames) sceneCounts.set(f.scene, (sceneCounts.get(f.scene) ?? 0) + 1);
425
+ const scenesDir = join(design, "scenes");
426
+ if (existsSync(scenesDir)) {
427
+ for (const e of readdirSync(scenesDir, { withFileTypes: true })) if (e.isDirectory() && !e.name.startsWith(".") && !RESERVED_SCENES.has(e.name) && !sceneCounts.has(e.name) && existsSync(join(scenesDir, e.name, "_brief.md"))) sceneCounts.set(e.name, 0);
428
+ }
424
429
  const scenes = [...sceneCounts.entries()].map(([name, n]) => {
425
430
  const note = sceneNote(root, name);
426
431
  return {
@@ -1,15 +1,20 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
2
  import { a as ROUTE, i as PKG, r as NAME } from "./cli.mjs";
3
- import { A as readCapability, E as HAS_STATUS, F as settableStatuses, I as hash, M as readStatusWord, N as readType, P as resolveType, S as wireKids, b as readTitle, c as nodeExists, d as BOARD_NAME, f as FOLDERS_FILE, g as folderMap, i as checkBoardsDir, j as readReason, l as readRegistry, o as isRegularFile, p as buildTree, r as boardFields, s as listBoardFiles, t as AUTHOR_FIELDS, u as withRegistryLock, x as validateWire, y as readDescription } from "./boards-DbVJlbd5.mjs";
4
- import { i as readContextFacts, n as planNames, r as planWithStage, t as annotateBoards } from "./board-status-D_lHZZ09.mjs";
3
+ import { C as wireKids, D as HAS_STATUS, F as resolveType, I as settableStatuses, L as hash, M as readReason, N as readStatusWord, P as readType, S as validateWire, _ as folderMap, b as readDescription, c as nodeExists, d as withRegistryLock, f as BOARD_NAME, i as checkBoardsDir, j as readCapability, l as parseBoard, m as buildTree, o as isRegularFile, p as FOLDERS_FILE, r as boardFields, s as listBoardFiles, t as AUTHOR_FIELDS, u as readRegistry, x as readTitle } from "./boards-BRLnoTC3.mjs";
4
+ import { i as readContextFacts, n as planNames, r as planWithStage, t as annotateBoards } from "./board-status-BZSzc9Hp.mjs";
5
5
  import { n as localProfile, t as isConnected } from "./profile-CrZohD6g.mjs";
6
- import { a as rendersDoc, l as writeManifest, n as isNoteFile, o as scanFrames, r as layoutDocSource, s as setSceneTitle, t as affectedFrameIds } from "./manifest-BkjJ5OQk.mjs";
7
- import { n as loadConfig } from "./config-g-J8NrPn.mjs";
8
- import { r as boardsChanged } from "./work-CiUvBVa6.mjs";
6
+ import { a as rendersDoc, l as writeManifest, n as isNoteFile, o as scanFrames, r as layoutDocSource, s as setSceneTitle, t as affectedFrameIds } from "./manifest-TpfDWldB.mjs";
7
+ import { n as loadConfig } from "./config-BUKprFAp.mjs";
8
+ import { r as boardsChanged } from "./work-ayuL_9Kk.mjs";
9
9
  import { closeSync, copyFileSync, existsSync, linkSync, mkdirSync, openSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, watch, writeFileSync } from "node:fs";
10
10
  import { basename, dirname, join, resolve, sep } from "node:path";
11
11
  import { fileURLToPath } from "node:url";
12
12
  import { randomBytes } from "node:crypto";
13
+ //#region src/shared/frames.ts
14
+ /** A canvas made of content frames alone (Doc, Md, Diagram ship their own styling) needs no theme -
15
+ * only an app frame does (#4). Empty counts as not content-only: the warning still helps there. */
16
+ const contentOnly = (frames) => frames.length > 0 && frames.every((f) => !!f.intent);
17
+ //#endregion
13
18
  //#region src/server/sizes.ts
14
19
  /**
15
20
  * Content-frame heights - `design/boards/_sizes.json`, committed.
@@ -280,7 +285,8 @@ function apiMiddleware(root, opts = {}) {
280
285
  const files = listBoardFiles(boardsDir).boards;
281
286
  const rows = files.map((b) => ({
282
287
  name: b.name,
283
- ...boardFields(b.json, validName)
288
+ ...boardFields(b.json, validName),
289
+ ...b.error ? { error: b.error } : {}
284
290
  }));
285
291
  const reg = readRegistry(boardsDir);
286
292
  const regFolders = reg.state === "ok" ? reg.folders : [];
@@ -774,14 +780,12 @@ function apiMiddleware(root, opts = {}) {
774
780
  if (req.method === "GET") {
775
781
  if (!existsSync(p)) return json(res, 200, { board: null });
776
782
  const content = readFileSync(p, "utf8");
777
- try {
778
- return json(res, 200, {
779
- board: JSON.parse(content),
780
- sha256: hash(content)
781
- });
782
- } catch {
783
- return json(res, 422, { error: `board "${boardMatch[1]}" is not valid JSON - fix the file` });
784
- }
783
+ const parsed = parseBoard(content);
784
+ if (parsed.error) return json(res, 422, { error: `design/boards/${boardMatch[1]}.json is not valid JSON - ${parsed.error}` });
785
+ return json(res, 200, {
786
+ board: parsed.json,
787
+ sha256: hash(content)
788
+ });
785
789
  }
786
790
  if (req.method === "PUT") {
787
791
  const raw = await readBody(req);
@@ -821,7 +825,7 @@ function apiMiddleware(root, opts = {}) {
821
825
  }
822
826
  }
823
827
  if (path === "shot" && req.method === "GET") {
824
- const { readDevInfo } = await import("./work-CiUvBVa6.mjs").then((n) => n.o);
828
+ const { readDevInfo } = await import("./work-ayuL_9Kk.mjs").then((n) => n.o);
825
829
  const token = readDevInfo(root)?.token;
826
830
  if (!ownerGated(req) && !(token && req.headers["x-mv-work"] === token)) return json(res, 403, { error: "forbidden" });
827
831
  const frameId = url.searchParams.get("frame") ?? "";
@@ -837,7 +841,7 @@ function apiMiddleware(root, opts = {}) {
837
841
  };
838
842
  const asPng = url.searchParams.get("format") === "png";
839
843
  const origin = opts.origin?.() ?? `http://${req.headers.host ?? "localhost"}`;
840
- const { shootFrame } = await import("./shot-CVOlQHUr.mjs");
844
+ const { shootFrame } = await import("./shot-DOD8v6fJ.mjs");
841
845
  const r = await shootFrame({
842
846
  root,
843
847
  viewports: opts.viewports ?? {},
@@ -870,7 +874,7 @@ function apiMiddleware(root, opts = {}) {
870
874
  return res.end(png);
871
875
  }
872
876
  if (path === "shots" && req.method === "POST") {
873
- const { readDevInfo } = await import("./work-CiUvBVa6.mjs").then((n) => n.o);
877
+ const { readDevInfo } = await import("./work-ayuL_9Kk.mjs").then((n) => n.o);
874
878
  const token = readDevInfo(root)?.token;
875
879
  if (!ownerGated(req) && !(token && req.headers["x-mv-work"] === token)) return json(res, 403, { error: "forbidden" });
876
880
  const raw = await readBody(req);
@@ -887,7 +891,7 @@ function apiMiddleware(root, opts = {}) {
887
891
  if (typeof theme !== "string" || !/^[a-z0-9-]+$/i.test(theme)) return json(res, 400, { error: "invalid theme" });
888
892
  const scale = body.scale === void 0 ? void 0 : body.scale;
889
893
  if (scale !== void 0 && !(Number.isInteger(scale) && scale >= 1 && scale <= 4)) return json(res, 400, { error: "invalid scale" });
890
- const { resolveFrames, shootBatch } = await import("./shot-CVOlQHUr.mjs");
894
+ const { resolveFrames, shootBatch } = await import("./shot-DOD8v6fJ.mjs");
891
895
  const sel = resolveFrames(root, body);
892
896
  if (!sel.ok) return json(res, sel.status, { error: sel.error });
893
897
  const origin = opts.origin?.() ?? `http://${req.headers.host ?? "localhost"}`;
@@ -915,7 +919,7 @@ function apiMiddleware(root, opts = {}) {
915
919
  return json(res, 400, { error: "malformed JSON" });
916
920
  }
917
921
  if (!body || typeof body !== "object" || !Array.isArray(body.asks) || !body.asks.length || body.asks.length > 200) return json(res, 400, { error: "asks must list 1-200 frames" });
918
- const { bakeBatch, ASK_MAX } = await import("./bake-l6N12qgx.mjs");
922
+ const { bakeBatch, ASK_MAX } = await import("./bake-DQtnDB8-.mjs");
919
923
  let manifest = {};
920
924
  try {
921
925
  manifest = JSON.parse(readFileSync(join(root, "design", "manifest.json"), "utf8"));
@@ -959,8 +963,8 @@ function apiMiddleware(root, opts = {}) {
959
963
  if (path === "poster" && req.method === "GET") {
960
964
  if (!ownerGated(req)) return json(res, 403, { error: "forbidden" });
961
965
  const src = url.searchParams.get("src") ?? "";
962
- const { ensurePoster, isLocalClip } = await import("./poster-Bc4-3DlQ.mjs");
963
- const { isLocalAssetRef } = await import("./build-CuRhHXcY.mjs");
966
+ const { ensurePoster, isLocalClip } = await import("./poster-XBmUvQiL.mjs");
967
+ const { isLocalAssetRef } = await import("./build-_ndp_dXn.mjs");
964
968
  if (!isLocalAssetRef(src) || !isLocalClip(src)) return json(res, 400, { error: "src must be a clip under design/assets/" });
965
969
  const r = await ensurePoster(join(root, "design", "assets"), src);
966
970
  if (!r.ok) return json(res, r.error.includes("does not exist") ? 404 : 503, { error: r.error });
@@ -1002,14 +1006,14 @@ function apiMiddleware(root, opts = {}) {
1002
1006
  return json(res, 200, { user: localProfile(root) });
1003
1007
  }
1004
1008
  if (path === "work") {
1005
- const { workActivity, readDevInfo, WORK_TTL_DEFAULT, WORK_TTL_MAX } = await import("./work-CiUvBVa6.mjs").then((n) => n.o);
1009
+ const { workActivity, readDevInfo, WORK_TTL_DEFAULT, WORK_TTL_MAX } = await import("./work-ayuL_9Kk.mjs").then((n) => n.o);
1006
1010
  const tokenOk = () => {
1007
1011
  const t = readDevInfo(root)?.token;
1008
1012
  return !!t && req.headers["x-mv-work"] === t;
1009
1013
  };
1010
1014
  if (req.method === "GET") {
1011
1015
  if (!ownerGated(req) && !tokenOk()) return json(res, 403, { error: "forbidden" });
1012
- const { boardsShowing, activityClock } = await import("./work-CiUvBVa6.mjs").then((n) => n.o);
1016
+ const { boardsShowing, activityClock } = await import("./work-ayuL_9Kk.mjs").then((n) => n.o);
1013
1017
  const frames = workActivity.active();
1014
1018
  return json(res, 200, {
1015
1019
  frames,
@@ -1313,6 +1317,10 @@ function marverPlugin(ctx) {
1313
1317
  revision: `${bootId}:${++invRev}`
1314
1318
  });
1315
1319
  }, 120);
1320
+ /** No theme is only a problem for app frames: a canvas made of content frames alone (Doc, Md,
1321
+ * Diagram ship their own styling) needs none (#4). The shell decides its banner from the live
1322
+ * manifest; the config carries only whether a theme exists. */
1323
+ const themeMissing = () => themeFile() == null && !contentOnly(manifest.frames);
1316
1324
  /** Theme resolution: design/theme.css wrapper > configured > detected > empty (spec §5.4). */
1317
1325
  const themeFile = () => {
1318
1326
  const wrapper = join(root, "design", "theme.css");
@@ -1331,7 +1339,7 @@ function marverPlugin(ctx) {
1331
1339
  },
1332
1340
  load(id) {
1333
1341
  if (id === "\0virtual:sh-theme.css") {
1334
- console.warn("[marver] no theme detected - frames render unstyled. Create design/theme.css importing your app's stylesheet (or set `theme` in design/config.ts).");
1342
+ if (themeMissing()) console.warn("[marver] no theme detected - frames render unstyled. Create design/theme.css importing your app's stylesheet (or set `theme` in design/config.ts).");
1335
1343
  return "/* marver: no theme configured */";
1336
1344
  }
1337
1345
  if (id === "\0virtual:sh-config") {
@@ -1476,7 +1484,7 @@ function marverPlugin(ctx) {
1476
1484
  };
1477
1485
  const prune = () => setTimeout(async () => {
1478
1486
  try {
1479
- (await import("./bake-l6N12qgx.mjs")).pruneBakes(root, bakeGen);
1487
+ (await import("./bake-DQtnDB8-.mjs")).pruneBakes(root, bakeGen);
1480
1488
  } catch {}
1481
1489
  }, 500);
1482
1490
  prune();
@@ -1525,6 +1533,15 @@ function marverPlugin(ctx) {
1525
1533
  try {
1526
1534
  mkdirSync(boardsDir, { recursive: true });
1527
1535
  const timers = /* @__PURE__ */ new Map();
1536
+ const badBoards = /* @__PURE__ */ new Map();
1537
+ const reportBad = (file, content, error) => {
1538
+ if (badBoards.get(file) === hash(content)) return;
1539
+ badBoards.set(file, hash(content));
1540
+ console.warn(`[marver] design/boards/${file} is not valid JSON - ${error}`);
1541
+ };
1542
+ if (!checkBoardsDir(root, boardsDir)) {
1543
+ for (const b of listBoardFiles(boardsDir).boards) if (b.error) reportBad(`${b.name}.json`, b.content, b.error);
1544
+ }
1528
1545
  let listTimer;
1529
1546
  const watcher = watch(boardsDir, (_event, file) => {
1530
1547
  if (!file || !file.endsWith(".json") || file === "_sizes.json") return;
@@ -1537,14 +1554,23 @@ function marverPlugin(ctx) {
1537
1554
  clearTimeout(timers.get(file));
1538
1555
  timers.set(file, setTimeout(() => {
1539
1556
  timers.delete(file);
1557
+ let content;
1558
+ if (!isRegularFile(join(boardsDir, file))) return;
1540
1559
  try {
1541
- const content = readFileSync(join(boardsDir, file), "utf8");
1542
- JSON.parse(content);
1543
- server.ws.send("sh:board", {
1544
- name: file.replace(/\.json$/, ""),
1545
- sha256: hash(content)
1546
- });
1547
- } catch {}
1560
+ content = readFileSync(join(boardsDir, file), "utf8");
1561
+ } catch {
1562
+ return;
1563
+ }
1564
+ const { error } = parseBoard(content);
1565
+ if (error) {
1566
+ if (!checkBoardsDir(root, boardsDir)) reportBad(file, content, error);
1567
+ return;
1568
+ }
1569
+ badBoards.delete(file);
1570
+ server.ws.send("sh:board", {
1571
+ name: file.replace(/\.json$/, ""),
1572
+ sha256: hash(content)
1573
+ });
1548
1574
  }, 120));
1549
1575
  });
1550
1576
  server.httpServer?.once("close", () => watcher.close());
@@ -1629,7 +1655,7 @@ function marverPlugin(ctx) {
1629
1655
  });
1630
1656
  return;
1631
1657
  }
1632
- const { shootFrame, shootBatch, resolveFrames } = await import("./shot-CVOlQHUr.mjs");
1658
+ const { shootFrame, shootBatch, resolveFrames } = await import("./shot-DOD8v6fJ.mjs");
1633
1659
  if (ways[0] === "frame") {
1634
1660
  if (typeof spec.frame !== "string") {
1635
1661
  write({
@@ -1,4 +1,4 @@
1
- import { capture, t as findChrome } from "./shot-CVOlQHUr.mjs";
1
+ import { capture, t as findChrome } from "./shot-DOD8v6fJ.mjs";
2
2
  import { constants, copyFileSync, existsSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from "node:fs";
3
3
  import { basename, dirname, join, sep } from "node:path";
4
4
  import { pathToFileURL } from "node:url";
@@ -1,6 +1,6 @@
1
1
  import { o as slideSize } from "./cli.mjs";
2
- import { planShot, t as findChrome } from "./shot-CVOlQHUr.mjs";
3
- import { ASK_MAX, bakeBatch } from "./bake-l6N12qgx.mjs";
2
+ import { planShot, t as findChrome } from "./shot-DOD8v6fJ.mjs";
3
+ import { ASK_MAX, bakeBatch } from "./bake-DQtnDB8-.mjs";
4
4
  import { MIME } from "./serve-z5qtj_wJ.mjs";
5
5
  import { copyFileSync, lstatSync, mkdirSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
6
6
  import { extname, isAbsolute, join, relative, resolve } from "node:path";
@@ -337,8 +337,8 @@ async function shootFrame(opts) {
337
337
  };
338
338
  const plan = planShot(frame, viewports, size);
339
339
  if (frame.kind !== "html") try {
340
- const { scanAssetRefs } = await import("./build-CuRhHXcY.mjs");
341
- const { ensurePoster } = await import("./poster-Bc4-3DlQ.mjs");
340
+ const { scanAssetRefs } = await import("./build-_ndp_dXn.mjs");
341
+ const { ensurePoster } = await import("./poster-XBmUvQiL.mjs");
342
342
  const refs = scanAssetRefs(readFileSync(join(root, frame.file), "utf8"), frame.file);
343
343
  for (const r of refs) if (r.endsWith(".poster.png")) await ensurePoster(join(root, "design", "assets"), r.slice(0, -11));
344
344
  } catch {}
@@ -1,5 +1,5 @@
1
1
  import { r as NAME } from "./cli.mjs";
2
- import { i as readDevInfo } from "./work-CiUvBVa6.mjs";
2
+ import { i as readDevInfo } from "./work-ayuL_9Kk.mjs";
3
3
  //#region src/cli/shot.ts
4
4
  /**
5
5
  * `marver shot <scene/frame> [...]`, `--scene <name>`, `--all` - render frames headless and
@@ -1,5 +1,5 @@
1
1
  import { r as NAME } from "./cli.mjs";
2
- import { i as readDevInfo, n as WORK_TTL_MAX, t as WORK_TTL_DEFAULT } from "./work-CiUvBVa6.mjs";
2
+ import { i as readDevInfo, n as WORK_TTL_MAX, t as WORK_TTL_DEFAULT } from "./work-ayuL_9Kk.mjs";
3
3
  //#region src/cli/work.ts
4
4
  /**
5
5
  * `marver work` - the coding agent's hand on the canvas working state.
@@ -66,7 +66,7 @@ async function workCommand(root, action, frames, opts) {
66
66
  });
67
67
  console.log(active.length ? `still working: ${active.join(", ")}` : "nothing working - all clear");
68
68
  const done = before.filter((f) => !active.includes(f));
69
- const link = done.length ? await (await import("./link-CcfAfKY-.mjs")).linkLine(root, done) : null;
69
+ const link = done.length ? await (await import("./link-BodAbIQz.mjs")).linkLine(root, done) : null;
70
70
  if (link) console.log(`on the canvas: ${link}`);
71
71
  return;
72
72
  }
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
- import { s as listBoardFiles } from "./boards-DbVJlbd5.mjs";
2
+ import { s as listBoardFiles } from "./boards-BRLnoTC3.mjs";
3
3
  import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
4
4
  import { join } from "node:path";
5
5
  import { randomBytes } from "node:crypto";
@@ -78,6 +78,10 @@ nests a sub-folder with `parent`:
78
78
  with its rank, the landing board - and `--json` gives the same tree. The landing board is the first
79
79
  board in that reading order, down through folders.
80
80
 
81
+ A board file that is not valid JSON says why, with the line and column: a red mark on its row in the
82
+ sidebar (hover it), the toast when you open it, the dev server's log, and an `(invalid JSON: …)` note
83
+ on its line in `npx marver boards` (`invalid` in `--json`).
84
+
81
85
  ### Sizes
82
86
 
83
87
  A content frame - a `Doc` of markdown, diagrams and images - is as tall as its content, which only a
@@ -171,7 +175,8 @@ long as the work, so nobody sets it.
171
175
  - `npx marver boards new <name> --folder features` - a board in its type's starting layout: a
172
176
  feature's three phase scenes as three bands (spec, lo-fi, hi-fi), a start board rendering
173
177
  `context/INDEX.md` and `context/shipped.md`, a deck on its title slide. `--type` overrides the
174
- folder's; `--title`, `--description`, `--capability` fill the rest.
178
+ folder's; `--title`, `--description`, `--capability` fill the rest. A phase scene with its brief
179
+ and no frame yet waits quietly: its band takes no room until its first frame lands.
175
180
 
176
181
  ## Agents
177
182
 
@@ -17,7 +17,7 @@ One markdown file, nothing to declare:
17
17
 
18
18
  Markdown with the Md block's rules: headings, lists, tables, emphasis, code; `[text](goto:scene/frame)`
19
19
  links jump to a frame; `http(s)` links open a new tab; images come from `design/assets/`; raw HTML is
20
- inert. A scene note is 380 wide, a frame note 260; when a frame has both, they stack in one column,
20
+ inert, shown as plain text, and HTML comments (`<!-- ... -->`) are not shown at all. A scene note is 380 wide, a frame note 260; when a frame has both, they stack in one column,
21
21
  scene first. An edit lands on the canvas as you save, without reloading the frame.
22
22
 
23
23
  The room is the layout's job. Every layout the shell composes (a board's `layout` recipe, the auto
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marver-design/marver",
3
- "version": "0.23.0",
3
+ "version": "0.23.1",
4
4
  "description": "The agent-native design canvas. A design/ folder, one command, a canvas of live frames built from your repo's real components - comment @marver and your own coding agent does the work. The tool ships no AI.",
5
5
  "type": "module",
6
6
  "private": false,
@@ -272,6 +272,10 @@ body { margin: 0; }
272
272
  breathe ABOVE far more than below, so structure reads at a glance. Every
273
273
  list-style is re-asserted: host Tailwind preflight strips markers. */
274
274
  .mv-md { max-width: 72ch; min-width: 0; font-size: 16px; line-height: 1.65; }
275
+ /* #12: prose keeps its measure, but a table straight in a wide Doc grows past it as far as its
276
+ cells need, up to the Doc's own width (cqi) - never into a Row's neighbour */
277
+ .mv-doc-wide { container-type: inline-size; }
278
+ .mv-doc-wide > .mv-md table { width: max-content; min-width: 100%; max-width: 100cqi; }
275
279
  .mv-md > :first-child { margin-top: 0; }
276
280
  .mv-md > :last-child { margin-bottom: 0; }
277
281
  .mv-md h1 { font-size: 30px; line-height: 1.16; letter-spacing: -0.021em; font-weight: 700; margin: 44px 0 14px; }
@@ -39,8 +39,9 @@ export function assetUrl(src: string): string | null {
39
39
  const marked = new Marked({
40
40
  gfm: true,
41
41
  renderer: {
42
- // raw HTML (block or inline) renders as its literal text - inert by construction
43
- html(token: any) { return escapeHtml(String(token.text ?? '')) },
42
+ // raw HTML (block or inline) renders as its literal text - inert by construction. Comments
43
+ // are the exception: markdown readers never show them, an unclosed one runs to the end (#15)
44
+ html(token: any) { return escapeHtml(String(token.text ?? '').replace(/<!--(?:-?>|[\s\S]*?(?:-->|$))/g, '')) },
44
45
  // marked leaves the text INSIDE a raw block (<script>, <style>, <pre>, <textarea>) unescaped
45
46
  // (`token.escaped`); here every text token is escaped - there is no raw block to serve
46
47
  text(token: any) {
@@ -15,6 +15,7 @@ import { poweredByUrl } from '../../shared/utm.ts'
15
15
  import { avatarFallback, useComments } from './comments-store.ts'
16
16
  import { goTo, navigated, revealFrame } from './goto.ts'
17
17
  import { useNotes } from './notes.ts'
18
+ import { contentOnly } from '../../shared/frames.ts'
18
19
  import { CommentButton, DevicePicker, HideUIButton, LaserButton, Popover, ThemePicker, toggleHideUI, usePopover } from './Toolbar.tsx'
19
20
 
20
21
  const commentsStore = () => useComments.getState()
@@ -969,7 +970,7 @@ export function App() {
969
970
 
970
971
  {CONFIG.setup
971
972
  ? <div className="sh-banner">no app detected - designs would be built from nothing. See design/instructions/setup.md, then restart</div>
972
- : CONFIG.noTheme && <div className="sh-banner">no theme configured - frames render unstyled. Create design/theme.css importing your app's stylesheet (or set theme in design/config.ts)</div>}
973
+ : CONFIG.noTheme && !contentOnly(manifest?.frames ?? []) && <div className="sh-banner">no theme configured - frames render unstyled. Create design/theme.css importing your app's stylesheet (or set theme in design/config.ts)</div>}
973
974
  <UpdatePill />
974
975
 
975
976
  <JamToasts toasts={toasts} />
@@ -461,6 +461,11 @@ export function BoardList({ onMenu }: { onMenu: MenuOpener }) {
461
461
  <span>{label(n)}</span>
462
462
  {/* the status for a screen reader, part of the board button's own name: the glyph is the eye's */}
463
463
  {meta[n]?.status && <span className="sh-sr" data-status-text>{`, ${statusTip(meta[n]).replace(/\n/g, '; ')}`}</span>}
464
+ {meta[n]?.error && (
465
+ <Tip side="right" label={<div className="sh-tip-lines"><b>Not valid JSON - fix the file</b><small>{`design/boards/${n}.json: ${meta[n].error}`}</small></div>}>
466
+ <i className="st st-error" data-board-error aria-label={`not valid JSON: ${meta[n].error}`}>!</i>
467
+ </Tip>
468
+ )}
464
469
  {meta[n]?.status && (
465
470
  <Tip side="right" label={<StatusTipLabel m={meta[n]} />}>
466
471
  <i className="st" data-status={meta[n].status!.status} aria-hidden="true"><StatusIcon status={meta[n].status!.status} fill={meta[n].status!.fill} /></i>
@@ -164,6 +164,8 @@ export interface BoardMeta {
164
164
  status?: { status: Status; row?: number; fill?: Phase; reason?: string; evidence?: string[] }
165
165
  /** what a person may set it to from the sidebar (dev only) - shared/board-types settableStatuses */
166
166
  settable?: StatusWord[]
167
+ /** the board file is not valid JSON: the parser's words, line and column (#6) */
168
+ error?: string
167
169
  }
168
170
 
169
171
  /** The sidebar tree: root boards and folders in rank order, each folder's boards and
@@ -173,7 +175,7 @@ export interface BoardMeta {
173
175
  export async function fetchBoardTree(): Promise<TreeSnapshot> {
174
176
  if (DATA) return { tree: DATA.tree ?? DATA.names.filter((n) => n !== 'all-scenes').map((n) => ({ kind: 'board', name: n })), base: { boards: {}, folders: null }, titles: DATA.titles ?? {}, meta: DATA.meta ?? {} }
175
177
  const [boards, reg] = await Promise.all([
176
- fetch(`${ROUTE}/api/boards`).then((r) => r.json()) as Promise<{ name: string; sha256: string; order?: number; folder?: string; title?: string; type?: BoardType; status?: BoardMeta['status'] | null; settable?: StatusWord[] }[]>,
178
+ fetch(`${ROUTE}/api/boards`).then((r) => r.json()) as Promise<{ name: string; sha256: string; order?: number; folder?: string; title?: string; type?: BoardType; status?: BoardMeta['status'] | null; settable?: StatusWord[]; error?: string }[]>,
177
179
  fetch(`${ROUTE}/api/folders`).then(async (r) => {
178
180
  const j = await r.json() as { folders?: { name: string; order?: number; parent?: string; title?: string }[]; sha256?: string | null; error?: string }
179
181
  if (!r.ok) throw new Error(j?.error ?? `folders ${r.status}`)
@@ -184,7 +186,7 @@ export async function fetchBoardTree(): Promise<TreeSnapshot> {
184
186
  tree: buildTree(boards, reg.folders ?? []),
185
187
  base: { boards: Object.fromEntries(boards.map((b) => [b.name, b.sha256])), folders: reg.sha256 ?? null },
186
188
  titles: Object.fromEntries(boards.flatMap((b) => (b.title ? [[b.name, b.title]] : []))),
187
- meta: Object.fromEntries(boards.map((b) => [b.name, { ...(b.type && b.type !== 'plain' ? { type: b.type } : {}), ...(b.status ? { status: b.status } : {}), ...(b.settable?.length ? { settable: b.settable } : {}) }])),
189
+ meta: Object.fromEntries(boards.map((b) => [b.name, { ...(b.type && b.type !== 'plain' ? { type: b.type } : {}), ...(b.status ? { status: b.status } : {}), ...(b.settable?.length ? { settable: b.settable } : {}), ...(b.error ? { error: b.error } : {}) }])),
188
190
  }
189
191
  }
190
192
  /** A tree read's types and statuses, kept under the same latest-wins rule as its titles. */
@@ -399,12 +401,20 @@ function defaultSize(frame: FrameEntry) {
399
401
  }
400
402
 
401
403
  let resizedInGesture = false
404
+ /** Why a board's last load failed, from the server (a parse error names its line) - for its toast. */
405
+ const loadErrors = new Map<string, string>()
406
+ const whyNot = (name: string) => { const e = loadErrors.get(name); return e ? ` - ${e}` : '' }
402
407
 
403
408
  /** sceneRows is the legacy shorthand for a plain rows layout. */
404
409
  const effectiveLayout = (layout: BoardLayout | null, sceneRows: string[][] | null): BoardLayout | undefined =>
405
410
  layout ?? (sceneRows?.length ? { rows: sceneRows.map((r) => [...r]) } : undefined)
406
411
 
412
+ /** Every scene of the project, empty phase scenes included - a layout naming one is no typo (#18).
413
+ * A published bundle carries the empty scenes its recipes name, so it lays out as dev does. */
414
+ const knownScenes = (m: Manifest | null): ReadonlySet<string> => new Set(m?.scenes.map((s) => s.name))
415
+
407
416
  const layoutWarn = (msg: string) => {
417
+ if (PUBLISHED) return // a viewer cannot fix a recipe - the owner sees it in dev (#18: empty phase scenes)
408
418
  console.warn('[marver layout]', msg)
409
419
  try { useStore.getState().toast(`layout: ${msg}`) } catch { /* store not ready during boot */ }
410
420
  }
@@ -673,6 +683,7 @@ export const useStore = create<State>((set, get) => {
673
683
  * keeps whatever board is currently mounted. */
674
684
  const loadBoardState = async (boardName: string): Promise<Partial<State> | null> => {
675
685
  clearNoteHeights() // heights are per column drawn; a key shared by two board files carries none across
686
+ loadErrors.delete(boardName)
676
687
  try {
677
688
  let raw: any
678
689
  const saved = loadSavedHeights() // in parallel with the manifest; every size below reads it
@@ -711,7 +722,7 @@ export const useStore = create<State>((set, get) => {
711
722
  loaded = body?.board == null ? 'fresh' : body // board:null = not materialized yet
712
723
  }
713
724
  else if (res.status === 404) loaded = 'fresh' // older servers still 404 fresh boards
714
- else loaded = null // anything else must not commit an empty canvas
725
+ else { loadErrors.set(boardName, (await res.json().catch(() => null))?.error ?? ''); loaded = null } // anything else must not commit an empty canvas - and says why (#6)
715
726
  }
716
727
  if (loaded === null) return null
717
728
  if (loaded !== 'fresh') {
@@ -848,7 +859,7 @@ export const useStore = create<State>((set, get) => {
848
859
  // a board with a recipe re-applies it (spec 18 - room is the layout's job)
849
860
  const cramped = !!boardHash && !needTidy && !!(layout || sceneRows?.length || boardAuto) && notesCramped(nodes, manifest)
850
861
  if ((!boardHash || needTidy || cramped) && nodes.length) {
851
- const placedAll = tidy(tidyInput(nodes, manifest), effectiveLayout(layout, sceneRows), layoutWarn)
862
+ const placedAll = tidy(tidyInput(nodes, manifest), effectiveLayout(layout, sceneRows), layoutWarn, knownScenes(manifest))
852
863
  for (const pl of placedAll) { const n = nodes.find((x) => x.key === pl.key)!; n.x = pl.x; n.y = pl.y }
853
864
  laidOut = sizeRecord(nodes)
854
865
  }
@@ -858,7 +869,7 @@ export const useStore = create<State>((set, get) => {
858
869
  // surface recipe problems at load (dry-run): materialized boards otherwise
859
870
  // never run tidy, so a broken agent-authored layout would fail silently
860
871
  if (layout && boardHash && !needTidy && !cramped && nodes.length) {
861
- tidy(tidyInput(nodes, manifest), layout, layoutWarn)
872
+ tidy(tidyInput(nodes, manifest), layout, layoutWarn, knownScenes(manifest))
862
873
  }
863
874
  return { manifest, nodes, boardHash, boardAuto, deviceView, sceneRows, layout, layoutRaw, baseLayout, laidOut, baseLaidOut, selection: [], dirty: prunedAtLoad || cramped }
864
875
  } catch { return null }
@@ -876,7 +887,7 @@ export const useStore = create<State>((set, get) => {
876
887
  const revAtStart = editRev, scenesAtStart = scenesRev
877
888
  const next = await loadBoardState(boardName)
878
889
  if (seq !== loadSeq) return false // a newer load superseded this one
879
- if (!next) { get().toast(`board "${boardName}" failed to load`); return false }
890
+ if (!next) { get().toast(`board "${boardName}" failed to load${whyNot(boardName)}`); return false }
880
891
  // the user kept editing while we fetched - their newer state wins over the reload
881
892
  if (get().board !== boardName || editRev !== revAtStart || (mayCommit && !mayCommit())) return false
882
893
  const live = get().manifest // a WS manifest update may have landed mid-fetch
@@ -909,7 +920,7 @@ export const useStore = create<State>((set, get) => {
909
920
  // there is never an empty intermediate state and nothing to roll back
910
921
  const next = await loadBoardState(name)
911
922
  if (mySwitch !== switchSeq) return
912
- if (!next) { get().toast(`could not load "${name}" - staying on ${get().board}`); return }
923
+ if (!next) { get().toast(`could not load "${name}"${whyNot(name)} - staying on ${get().board}`); return }
913
924
  // edits may have landed on the still-mounted old board during the target load
914
925
  for (let i = 0; i < 5 && get().dirty && ok; i++) { clearTimeout(saveTimer); ok = await get().save() }
915
926
  if (mySwitch !== switchSeq) return
@@ -1512,7 +1523,7 @@ export const useStore = create<State>((set, get) => {
1512
1523
  },
1513
1524
  runTidy() {
1514
1525
  const { nodes, manifest, sceneRows, layout } = get()
1515
- const placed = tidy(tidyInput(nodes, manifest), effectiveLayout(layout, sceneRows), layoutWarn)
1526
+ const placed = tidy(tidyInput(nodes, manifest), effectiveLayout(layout, sceneRows), layoutWarn, knownScenes(manifest))
1516
1527
  set((s) => ({
1517
1528
  nodes: s.nodes.map((n) => {
1518
1529
  const p = placed.find((x) => x.key === n.key)
@@ -472,6 +472,7 @@ body.sh-space .sh-node { pointer-events: none } /* space-drag
472
472
  /* spec 20: a feature or project board's status ring sits at the row's end, in its own colours -
473
473
  never the accent of the current row - with its evidence in the tooltip */
474
474
  .sh-panel .it.board .st { flex: none; display: inline-flex; margin-left: auto; font-style: normal }
475
+ .sh-panel .it.board .st-error { width: 14px; height: 14px; border-radius: 7px; justify-content: center; align-items: center; font: 700 10px/1 system-ui; color: #fff; background: #ff3b30 }
475
476
  /* the settled statuses' fills, one value per theme: done is the content palette's green (Apple's
476
477
  systemGreen); archived is Apple's brown - its increased-contrast value on light, its default on
477
478
  dark, where the increased-contrast one turns peach - so it reads as the same brown box in both */
@@ -21,6 +21,19 @@ export interface BoardLayout extends Flow { scenes?: Record<string, Flow> }
21
21
  export type Warn = (msg: string) => void
22
22
 
23
23
  const isSpace = (x: unknown): x is Space => !!x && typeof x === 'object' && !Array.isArray(x)
24
+ /** Drop the items `isGone` names, each with the spacer that led into it (or, at the start, the
25
+ * one that followed it) - what is left reads as if the item was never there. */
26
+ function dropGone<T>(items: T[], isGone: (x: T) => boolean): T[] {
27
+ const out: T[] = []
28
+ let skip = false
29
+ for (const it of items) {
30
+ if (isGone(it)) { if (isSpace(out[out.length - 1])) out.pop(); else if (!out.length) skip = true; continue }
31
+ if (skip && isSpace(it)) { skip = false; continue }
32
+ skip = false
33
+ out.push(it)
34
+ }
35
+ return out
36
+ }
24
37
  const units = (s: Space, warn: Warn): number =>
25
38
  Number.isInteger(s.space) && s.space > 0 ? s.space : (warn(`invalid space ${JSON.stringify(s.space)} - using 1`), 1)
26
39
 
@@ -268,7 +281,9 @@ function layoutScene(scene: string, members: TidyNode[], flow: Flow | undefined,
268
281
  * array is never reordered (iframe law G-1). Two passes: each scene lays out its
269
282
  * frames (recipe or default lane), then the board flow places the scene boxes.
270
283
  */
271
- export function tidy(nodes: TidyNode[], layout?: BoardLayout, warn: Warn = () => {}): Placed[] {
284
+ /** `known`: every scene of the project. A layout naming a known scene with no node on this board
285
+ * (an empty phase scene, frames not pinned here) skips it quietly; only an unknown name warns (#18). */
286
+ export function tidy(nodes: TidyNode[], layout?: BoardLayout, warn: Warn = () => {}, known?: ReadonlySet<string>): Placed[] {
272
287
  const scenes = [...new Set(nodes.map((n) => n.scene))]
273
288
 
274
289
  // pass 1: per-scene relative layouts + bounding boxes
@@ -300,7 +315,23 @@ export function tidy(nodes: TidyNode[], layout?: BoardLayout, warn: Warn = () =>
300
315
  // PLAIN tidy (default trailing lanes), never a silent pick
301
316
  let boardFlow: Flow
302
317
  if (layout && layout.rows && layout.columns) { warn('layout has rows AND columns - ignoring it (plain tidy)'); boardFlow = { rows: [] } }
303
- else if (layout && (layout.rows || layout.columns)) boardFlow = { rows: layout.rows, columns: layout.columns }
318
+ else if (layout && (layout.rows || layout.columns)) {
319
+ // #18: a known scene with nothing on this board (an empty phase scene) leaves the recipe
320
+ // with the spacer that went with it, so the rest lays out as if it was never named - quietly
321
+ const gone = (a: unknown) => typeof a === 'string' && !!known?.has(a) && !sceneBoxes.has(a)
322
+ const prune = (flow?: Array<Lane | Space>) => {
323
+ if (!flow || !known) return flow
324
+ const emptied = new Set<unknown>()
325
+ const lanes = flow.map((e) => {
326
+ if (!Array.isArray(e) || !e.some(gone)) return e
327
+ const kept = dropGone(e, gone)
328
+ if (kept.every(isSpace)) emptied.add(kept)
329
+ return kept
330
+ })
331
+ return dropGone(lanes, (e) => emptied.has(e))
332
+ }
333
+ boardFlow = { rows: prune(layout.rows), columns: prune(layout.columns) }
334
+ }
304
335
  else boardFlow = { rows: [] } // default: every scene its own trailing lane (alphabetical)
305
336
 
306
337
  const listed = new Set<string>()
@@ -315,7 +346,7 @@ export function tidy(nodes: TidyNode[], layout?: BoardLayout, warn: Warn = () =>
315
346
  boardFlow,
316
347
  (atom) => {
317
348
  const b = sceneBoxes.get(atom)
318
- if (!b) warn(`unknown scene "${atom}" in layout - skipped`)
349
+ if (!b && !known?.has(atom)) warn(`unknown scene "${atom}" in layout - skipped`)
319
350
  return b ?? null
320
351
  },
321
352
  trailing,
@@ -0,0 +1,3 @@
1
+ /** A canvas made of content frames alone (Doc, Md, Diagram ship their own styling) needs no theme -
2
+ * only an app frame does (#4). Empty counts as not content-only: the warning still helps there. */
3
+ export const contentOnly = (frames: readonly { intent?: string }[]): boolean => frames.length > 0 && frames.every((f) => !!f.intent)