@marver-design/marver 0.26.1 → 0.27.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.
Files changed (109) hide show
  1. package/CHANGELOG.md +198 -0
  2. package/README.md +12 -4
  3. package/dist/{anchor-check-l-ny3UzH.mjs → anchor-check-gkxkPAIv.mjs} +1 -1
  4. package/dist/{board-tree-DRioF94d.mjs → board-tree-BXR8dw4b.mjs} +3 -1
  5. package/dist/{boards-CGg6piKF.mjs → boards-BHKP5yhI.mjs} +1 -1
  6. package/dist/{boards-DYG22tOe.mjs → boards-BqUqKNW8.mjs} +4 -4
  7. package/dist/{build-BDRiO_mP.mjs → build-VgNg4rr8.mjs} +8 -23
  8. package/dist/cli.mjs +45 -19
  9. package/dist/{collab-Dxg2trOK.mjs → collab-BEAcXrBb.mjs} +1 -1
  10. package/dist/{comments-BqXua-XL.mjs → comments-YEU1Zhv9.mjs} +4 -4
  11. package/dist/{context-HQ4Giw58.mjs → context-Ccjrhr1J.mjs} +3 -3
  12. package/dist/{daemon-DL6Fwq6D.mjs → daemon-Dc9AH0M3.mjs} +9 -7
  13. package/dist/detect-C0wpaePX.mjs +125 -0
  14. package/dist/dev-lock-C_FC70Mu.mjs +65 -0
  15. package/dist/dev-ri6nAlRp.mjs +1273 -0
  16. package/dist/exclusive-B1RtpeeP.mjs +150 -0
  17. package/dist/{init-D8DtrK_F.mjs → init-W0nxR1OY.mjs} +8 -6
  18. package/dist/{link-BNzLvdhI.mjs → link-CdTgn94Y.mjs} +23 -11
  19. package/dist/ls-BZ5TAtd5.mjs +38 -0
  20. package/dist/{manifest-Nl3KSVOk.mjs → manifest-aFyDmL8C.mjs} +2 -2
  21. package/dist/{marks-DyWMv_Z1.mjs → marks-BF9pNEgH.mjs} +3 -3
  22. package/dist/{marks-CKgzucHZ.mjs → marks-CnCCfAbD.mjs} +3 -3
  23. package/dist/{marver-id-gate-BjF6v4bT.mjs → marver-id-gate-D-R0hSt_.mjs} +1 -1
  24. package/dist/perf-DkAUFT6W.mjs +1319 -0
  25. package/dist/perf-jam-BaH3Lg0m.mjs +635 -0
  26. package/dist/plugin-B8UghYuF.mjs +5242 -0
  27. package/dist/{poster-BdtSKMDm.mjs → poster-BNgafWMK.mjs} +1 -1
  28. package/dist/{profile-WU9qcbIo.mjs → profile-jIS6BcAs.mjs} +1 -1
  29. package/dist/{publish-bakes-9RzRToXV.mjs → publish-bakes-38Nja78p.mjs} +3 -3
  30. package/dist/{queue-29ok5_eZ.mjs → queue-CAM_vNmX.mjs} +1 -1
  31. package/dist/recover-B8AiI29B.mjs +66 -0
  32. package/dist/{serve-C8rVheYk.mjs → serve-Dp3nHstu.mjs} +3 -3
  33. package/dist/{share--oFJ1bCI.mjs → share-Ce4tP7ji.mjs} +1 -1
  34. package/dist/{shot-XQV7HC9A.mjs → shot-CMQgMVZm.mjs} +1 -1
  35. package/dist/{shot-DQeR_Pfn.mjs → shot-Ch24tiMO.mjs} +36 -5
  36. package/dist/slots-CFNnegCc.mjs +478 -0
  37. package/dist/{sync-DKk-yT1V.mjs → sync-CQdGARJ9.mjs} +4 -3
  38. package/dist/{work-VvX_JIgl.mjs → work-Bxz-ObF3.mjs} +4 -2
  39. package/dist/{work-F5u-twpJ.mjs → work-CNhFF9pU.mjs} +5 -3
  40. package/docs/boards-and-folders.md +3 -1
  41. package/docs/jam-session.md +57 -2
  42. package/docs/performance.md +424 -0
  43. package/package.json +2 -2
  44. package/src/client/content/index.tsx +3 -0
  45. package/src/client/content/video.tsx +16 -4
  46. package/src/client/frame-host/bridge.js +22 -6
  47. package/src/client/frame-host/main.tsx +17 -5
  48. package/src/client/shell/App.tsx +188 -26
  49. package/src/client/shell/BoardList.tsx +5 -5
  50. package/src/client/shell/Comments.tsx +8 -5
  51. package/src/client/shell/ContextMenu.tsx +5 -3
  52. package/src/client/shell/JamSurface.tsx +4 -2
  53. package/src/client/shell/LockedApp.tsx +8 -5
  54. package/src/client/shell/Play.tsx +20 -10
  55. package/src/client/shell/Tip.tsx +3 -1
  56. package/src/client/shell/Toolbar.tsx +12 -1
  57. package/src/client/shell/api.ts +233 -0
  58. package/src/client/shell/app-bridge.ts +254 -0
  59. package/src/client/shell/app-perf.ts +92 -0
  60. package/src/client/shell/canvas/Canvas.tsx +141 -21
  61. package/src/client/shell/canvas/FrameNode.tsx +22 -9
  62. package/src/client/shell/canvas/admission.ts +31 -9
  63. package/src/client/shell/canvas/camera-broadcast.ts +15 -5
  64. package/src/client/shell/canvas/ctl.ts +8 -0
  65. package/src/client/shell/canvas/frame-registry.ts +28 -2
  66. package/src/client/shell/canvas/sleep.ts +60 -17
  67. package/src/client/shell/canvas/updates.ts +2 -1
  68. package/src/client/shell/comments-store.ts +12 -4
  69. package/src/client/shell/goto.ts +22 -10
  70. package/src/client/shell/inset.ts +44 -0
  71. package/src/client/shell/jam-capture.ts +41 -22
  72. package/src/client/shell/jam-keys.ts +12 -3
  73. package/src/client/shell/jam-panel.tsx +9 -3
  74. package/src/client/shell/jam-queue.ts +3 -3
  75. package/src/client/shell/jam-session.tsx +14 -8
  76. package/src/client/shell/jam-voice.ts +55 -15
  77. package/src/client/shell/legacy-links.ts +2 -2
  78. package/src/client/shell/main.tsx +18 -1
  79. package/src/client/shell/marks-ui.tsx +5 -3
  80. package/src/client/shell/marver-app.ts +21 -0
  81. package/src/client/shell/notes.ts +8 -1
  82. package/src/client/shell/perf-run-probe.ts +34 -0
  83. package/src/client/shell/perf-run.ts +70 -0
  84. package/src/client/shell/perf.ts +80 -58
  85. package/src/client/shell/recorder-core.ts +183 -0
  86. package/src/client/shell/recorder.ts +607 -0
  87. package/src/client/shell/store.ts +294 -110
  88. package/src/client/shell/styles.css +72 -15
  89. package/src/client/shell/unsaved.ts +81 -0
  90. package/src/client/shell/whiteout-probes.ts +141 -0
  91. package/src/shared/app-api.ts +205 -0
  92. package/src/shared/app-perf.ts +308 -0
  93. package/src/shared/logo-sniff.ts +86 -0
  94. package/src/shared/machine.ts +132 -0
  95. package/src/shared/perf-run.ts +177 -0
  96. package/templates/AGENTS-embedded.md +25 -4
  97. package/templates/AGENTS-studio.md +25 -4
  98. package/templates/demo/dark.tsx +1 -1
  99. package/templates/demo/welcome.tsx +1 -1
  100. package/templates/instructions/boards.md +3 -1
  101. package/templates/instructions/welcome.md +6 -3
  102. package/dist/bake-C-awKgLA.mjs +0 -786
  103. package/dist/config-Cf7EjAMf.mjs +0 -292
  104. package/dist/dev-Bw_qYWWq.mjs +0 -755
  105. package/dist/dev-lock-DWSpa6nj.mjs +0 -179
  106. package/dist/perf-C75MZ73h.mjs +0 -167
  107. package/dist/perf-DPbLGhhO.mjs +0 -49
  108. package/dist/perf-jam-BU3TVrZu.mjs +0 -239
  109. package/dist/plugin-DkGmZs_r.mjs +0 -2423
@@ -1,4 +1,4 @@
1
- import { capture, t as findChrome } from "./shot-DQeR_Pfn.mjs";
1
+ import { i as capture, p as findChrome } from "./shot-Ch24tiMO.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,4 +1,4 @@
1
- import { i as loadCollab } from "./sync-DKk-yT1V.mjs";
1
+ import { i as loadCollab } from "./sync-CQdGARJ9.mjs";
2
2
  import { readFileSync } from "node:fs";
3
3
  import { join } from "node:path";
4
4
  //#region src/server/profile.ts
@@ -1,7 +1,7 @@
1
1
  import { o as slideSize } from "./cli.mjs";
2
- import { planShot, t as findChrome } from "./shot-DQeR_Pfn.mjs";
3
- import { ASK_MAX, bakeBatch } from "./bake-C-awKgLA.mjs";
4
- import { MIME } from "./serve-C8rVheYk.mjs";
2
+ import { o as ASK_MAX, s as bakeBatch } from "./plugin-B8UghYuF.mjs";
3
+ import { p as findChrome, s as planShot } from "./shot-Ch24tiMO.mjs";
4
+ import { MIME } from "./serve-Dp3nHstu.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";
7
7
  import { createServer } from "node:http";
@@ -1,4 +1,4 @@
1
- import { r as pidRuns, t as createExclusive } from "./dev-lock-DWSpa6nj.mjs";
1
+ import { n as createExclusive, r as pidRuns } from "./exclusive-B1RtpeeP.mjs";
2
2
  import { r as replay } from "./events-CLH4ijKP.mjs";
3
3
  import { a as readLog, i as listBoards } from "./comments-0BSbb04K.mjs";
4
4
  import { a as deviceId, r as owned } from "./ledger-D54iROST.mjs";
@@ -0,0 +1,66 @@
1
+ import { r as NAME } from "./cli.mjs";
2
+ import { d as recoverTarget, h as workspaceId, r as legacyEntry, u as recoverEntries } from "./slots-CFNnegCc.mjs";
3
+ import { DevStartError, dev } from "./dev-ri6nAlRp.mjs";
4
+ //#region src/cli/recover.ts
5
+ /**
6
+ * `marver dev --recover` (spec 28 A1.6). A Jam capture the page could not send waits in that browser's
7
+ * storage, at that page's address and under that workspace key, and goes out the next time a canvas
8
+ * opens there. When the canvas moved (0.27 moved every canvas to a slot; a later start can land on
9
+ * another slot), this starts it again on exactly an earlier address: its port, the address it bound,
10
+ * and the workspace key that run used - never another one. Alone it lists them: the project's recorded
11
+ * addresses, newest first, then the one 0.26 gave the folder.
12
+ */
13
+ const MONTHS = [
14
+ "Jan",
15
+ "Feb",
16
+ "Mar",
17
+ "Apr",
18
+ "May",
19
+ "Jun",
20
+ "Jul",
21
+ "Aug",
22
+ "Sep",
23
+ "Oct",
24
+ "Nov",
25
+ "Dec"
26
+ ];
27
+ const when = (t) => {
28
+ const d = new Date(t);
29
+ return `${d.getDate()} ${MONTHS[d.getMonth()]} ${String(d.getHours()).padStart(2, "0")}:${String(d.getMinutes()).padStart(2, "0")}`;
30
+ };
31
+ /** The list `--recover` prints (tests read `^\s+(\d+)\s+(http://localhost:\d+/)`). */
32
+ function formatEntries(root, entries) {
33
+ const own = workspaceId(root);
34
+ const width = Math.max(...entries.map((e) => e.url.length));
35
+ return [
36
+ "addresses this canvas ran on, newest first:",
37
+ ...entries.map((e, i) => ` ${String(i + 1).padStart(2)} ${e.url.padEnd(width)} ${e.legacy ? "the address 0.26 gave it" : `bound ${e.bind} ${e.from ? when(e.from) : "?"} - ${e.until ? when(e.until) : "?"}`}${e.ws !== own ? " (another workspace key)" : ""}`),
38
+ `start on one: npx ${NAME} dev --recover <n> - then open its link in the browser that made the capture`
39
+ ];
40
+ }
41
+ /** `--recover` alone (cac hands over `true`), `--recover <n>` (a number or its string), or `--recover --port <p>`. */
42
+ async function recoverCommand(root, which, port, with_ = {}) {
43
+ const listOnly = which === true || which === "";
44
+ if (!listOnly && port !== void 0) throw new DevStartError("give --recover <n>, or --recover --port <p> - not both");
45
+ if (port !== void 0) {
46
+ await dev(root, {
47
+ ...with_,
48
+ recover: recoverTarget(legacyEntry(root, port))
49
+ });
50
+ return;
51
+ }
52
+ const entries = recoverEntries(root);
53
+ if (listOnly) {
54
+ console.log(`\n${formatEntries(root, entries).map((l) => ` ${l}`).join("\n")}\n`);
55
+ return;
56
+ }
57
+ const n = Number(which);
58
+ const entry = Number.isInteger(n) && n >= 1 ? entries[n - 1] : void 0;
59
+ if (!entry) throw new DevStartError(`no address ${String(which)} - npx ${NAME} dev --recover lists them`);
60
+ await dev(root, {
61
+ ...with_,
62
+ recover: recoverTarget(entry)
63
+ });
64
+ }
65
+ //#endregion
66
+ export { recoverCommand };
@@ -75,7 +75,7 @@ async function serve(root, portFlag) {
75
75
  * accounts get in. Null when there is no roster to consult. */
76
76
  let guestDoorOpen = null;
77
77
  if (process.env.MARVER_DATA_DIR) {
78
- const { collabHandler } = await import("./collab-Dxg2trOK.mjs");
78
+ const { collabHandler } = await import("./collab-BEAcXrBb.mjs");
79
79
  const { appendEvents, readLog } = await import("./comments-0BSbb04K.mjs").then((n) => n.n);
80
80
  const { dataDir } = await import("./comments-0BSbb04K.mjs").then((n) => n.n);
81
81
  const dir = dataDir();
@@ -147,7 +147,7 @@ async function serve(root, portFlag) {
147
147
  console.error(`[${NAME}] MARVER_ID_ISSUER is set but MARVER_PUBLIC_ORIGIN is not.\n Every assertion is bound to this canvas's exact origin, and it cannot be\n inferred from request headers - a proxy can make any request look local.\n Set it to the origin people actually reach this canvas on:\n MARVER_PUBLIC_ORIGIN=https://canvas.example.com\n MARVER_PUBLIC_ORIGIN=http://localhost:${portFlag ?? (Number(process.env.PORT) || 4199)} (development)`);
148
148
  process.exit(1);
149
149
  }
150
- const { marverIdHandler } = await import("./marver-id-gate-BjF6v4bT.mjs");
150
+ const { marverIdHandler } = await import("./marver-id-gate-D-R0hSt_.mjs");
151
151
  const { dataDir } = await import("./comments-0BSbb04K.mjs").then((n) => n.n);
152
152
  const canvasName = humanName(meta.name);
153
153
  const { ceilingsFromRights } = await import("./auth-Dix8wrXV.mjs").then((n) => n.R);
@@ -316,7 +316,7 @@ function isCosmetic(pathname) {
316
316
  try {
317
317
  decoded = decodeURIComponent(pathname);
318
318
  } catch {}
319
- return /^\/__mv\/favicon\/[\w-]+(?:\.[\w-]+)+$/.test(decoded) || /^\/__mv\/logo\.(?:svg|png)$/.test(decoded);
319
+ return /^\/__mv\/favicon\/[\w-]+(?:\.[\w-]+)+$/.test(decoded) || /^\/__mv\/logo\.(?:svg|png|ico)$/.test(decoded);
320
320
  }
321
321
  /** The Marver logo mark (ParallelogramDuo, same as the shell's sidebar). */
322
322
  const MARK_AT = (size) => `<svg viewBox="0 0 256 256" width="${size}" height="${size}" fill="currentColor" aria-hidden><path d="M239.29,59.28l-64.8,144a8,8,0,0,1-7.3,4.72H24a8,8,0,0,1-7.3-11.28l64.8-144A8,8,0,0,1,88.81,48H232A8,8,0,0,1,239.29,59.28Z" opacity=".1"/><path d="M245.43,47.31A15.94,15.94,0,0,0,232,40H88.81a16,16,0,0,0-14.59,9.43l-64.8,144A16,16,0,0,0,24,216H167.19a16,16,0,0,0,14.59-9.43l64.8-144A16,16,0,0,0,245.43,47.31ZM167.19,200H24L88.81,56H232Z"/></svg>`;
@@ -1,6 +1,6 @@
1
1
  import { r as NAME } from "./cli.mjs";
2
2
  import { M as resolveAccess } from "./auth-Dix8wrXV.mjs";
3
- import { i as loadCollab } from "./sync-DKk-yT1V.mjs";
3
+ import { i as loadCollab } from "./sync-CQdGARJ9.mjs";
4
4
  //#region src/cli/share.ts
5
5
  /**
6
6
  * `marver share <action>` - the roster from the terminal (01-sharing §9).
@@ -1,5 +1,5 @@
1
1
  import { r as NAME } from "./cli.mjs";
2
- import { i as readDevInfo } from "./work-F5u-twpJ.mjs";
2
+ import { i as readDevInfo } from "./work-CNhFF9pU.mjs";
3
3
  import { existsSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
4
4
  import { join } from "node:path";
5
5
  import { randomBytes } from "node:crypto";
@@ -1,5 +1,6 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
1
2
  import { a as ROUTE, o as slideSize } from "./cli.mjs";
2
- import { t as logJam } from "./perf-jam-BU3TVrZu.mjs";
3
+ import { t as logJam } from "./perf-jam-BaH3Lg0m.mjs";
3
4
  import { copyFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
4
5
  import { join } from "node:path";
5
6
  import { randomBytes } from "node:crypto";
@@ -43,15 +44,24 @@ const PROFILE_PREFIXES = ["mv-shot-", "mv-browser-"];
43
44
  function containerFlags(platform, uid) {
44
45
  return platform === "linux" && uid === 0 ? ["--no-sandbox", "--disable-dev-shm-usage"] : [];
45
46
  }
47
+ const FOREGROUND = [
48
+ "--disable-backgrounding-occluded-windows",
49
+ "--disable-renderer-backgrounding",
50
+ "--disable-background-timer-throttling"
51
+ ];
46
52
  const FLAGS = [
47
53
  ...process.env.MV_CHROME_HEADED ? [] : ["--headless=new"],
48
54
  "--hide-scrollbars",
49
55
  "--no-first-run",
50
56
  "--no-default-browser-check",
51
57
  "--disable-extensions",
58
+ ...FOREGROUND,
52
59
  ...containerFlags(process.platform, process.getuid?.()),
53
60
  ...process.env.MV_CHROME_FLAGS?.split(" ").filter(Boolean) ?? []
54
61
  ];
62
+ /** The flags every browser here launches with (a headless perf run's line says them: runs compare only with runs
63
+ * that launched alike, spec 28 A3.8 #22). */
64
+ const launchFlags = () => [...FLAGS];
55
65
  const HANDSHAKE_MS = 15e3;
56
66
  const MAX_MESSAGE = 1 << 30;
57
67
  /** The pipe's framing: NUL-terminated messages, arriving in chunks split anywhere - inside a
@@ -426,6 +436,26 @@ function unfilterRow(raw, up, out, bpp) {
426
436
  * and the browser closed in the operation's finally - never idle, never shared, never
427
437
  * outliving the server.
428
438
  */
439
+ var shot_exports = /* @__PURE__ */ __exportAll({
440
+ AREA: () => AREA,
441
+ BATCH_MAX: () => 200,
442
+ MOUNTED: () => MOUNTED,
443
+ SURFACE: () => SURFACE,
444
+ capture: () => capture,
445
+ captureIn: () => captureIn,
446
+ frameUrl: () => frameUrl,
447
+ manifestFrame: () => manifestFrame,
448
+ planShot: () => planShot,
449
+ pool: () => pool,
450
+ resolveFrames: () => resolveFrames,
451
+ shootBatch: () => shootBatch,
452
+ shootFrame: () => shootFrame,
453
+ shotConcurrency: () => shotConcurrency,
454
+ shotEvent: () => shotEvent,
455
+ shotSeams: () => shotSeams,
456
+ sweepGhosts: () => sweepGhosts,
457
+ withBrowser: () => withBrowser
458
+ });
429
459
  const slug = (frameId) => frameId.replace(/\//g, "--");
430
460
  const clamp = (n, lo, hi) => Math.min(hi, Math.max(lo, n));
431
461
  const num = (v) => typeof v === "number" && Number.isFinite(v) && v > 0 ? v : void 0;
@@ -494,8 +524,8 @@ async function shootFrame(opts) {
494
524
  };
495
525
  const plan = planShot(frame, viewports, size);
496
526
  if (frame.kind !== "html") try {
497
- const { scanAssetRefs } = await import("./build-BDRiO_mP.mjs");
498
- const { ensurePoster } = await import("./poster-BdtSKMDm.mjs");
527
+ const { scanAssetRefs } = await import("./build-VgNg4rr8.mjs");
528
+ const { ensurePoster } = await import("./poster-BNgafWMK.mjs");
499
529
  const refs = scanAssetRefs(readFileSync(join(root, frame.file), "utf8"), frame.file);
500
530
  for (const r of refs) if (r.endsWith(".poster.png")) await ensurePoster(join(root, "design", "assets"), r.slice(0, -11));
501
531
  } catch {}
@@ -786,8 +816,9 @@ function sweepTemps(dir) {
786
816
  * very shot that is waiting for it - and so do anchor checks, which have a deadline of their
787
817
  * own and must not wait out a batch of shots. */
788
818
  const chains = /* @__PURE__ */ new Map();
789
- function withBrowser(lane, fn) {
819
+ function withBrowser(lane, fn, o = {}) {
790
820
  const run = async () => {
821
+ if (o.skip?.()) return o.skipped;
791
822
  const b = await Browser.launch();
792
823
  try {
793
824
  return await fn(b);
@@ -1257,4 +1288,4 @@ async function captureOnce({ url, width, height, out, fullHeight = false, timeou
1257
1288
  }
1258
1289
  }
1259
1290
  //#endregion
1260
- export { AREA, MOUNTED, SURFACE, capture, frameUrl, manifestFrame, planShot, pool, resolveFrames, shootBatch, shootFrame, shotConcurrency, sweepGhosts, findChrome as t, withBrowser };
1291
+ export { frameUrl as a, pool as c, withBrowser as d, Browser as f, capture as i, shotConcurrency as l, launchFlags as m, MOUNTED as n, manifestFrame as o, findChrome as p, SURFACE as r, planShot as s, AREA as t, shot_exports as u };