@marver-design/marver 0.28.0 → 0.30.0

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 (105) hide show
  1. package/CHANGELOG.md +103 -0
  2. package/README.md +4 -3
  3. package/dist/{anchor-check-PHUOFj1N.mjs → anchor-check-c52IDkiQ.mjs} +1 -1
  4. package/dist/{build-BsAyLMT1.mjs → build-C3mUtjEn.mjs} +7 -4
  5. package/dist/{capture-DdZ6xgoz.mjs → capture-DEtM4qm5.mjs} +168 -5
  6. package/dist/cli.mjs +11 -11
  7. package/dist/{comments-CrBHPEQl.mjs → comments-XNhMmSSu.mjs} +2 -2
  8. package/dist/{connectors-MR9d-EBP.mjs → connectors-DekQvKt9.mjs} +3 -1
  9. package/dist/{daemon-C5dg2R-V.mjs → daemon-B0Wi1OQ3.mjs} +30 -29
  10. package/dist/{dev-D7YS7iT2.mjs → dev-5dlxoW28.mjs} +19 -14
  11. package/dist/{init-WE5lQkQL.mjs → init-CYlFaRzG.mjs} +1 -1
  12. package/dist/logo-CXY-1yrn.mjs +305 -0
  13. package/dist/{ls-BZ5TAtd5.mjs → ls-NqmePKOf.mjs} +1 -1
  14. package/dist/{marks-Kmdab_5w.mjs → marks-BnNANic9.mjs} +20 -1
  15. package/dist/{marks-Dyn6tmjp.mjs → marks-DBp3h1Mc.mjs} +2 -5
  16. package/dist/{marver-id-gate-D-R0hSt_.mjs → marver-id-gate-vBLb_Icb.mjs} +1 -1
  17. package/dist/{perf-Cn5LiRaY.mjs → perf-6MOTHxay.mjs} +751 -122
  18. package/dist/perf-BCxAo0IS.mjs +1743 -0
  19. package/dist/{plugin-C_0yb-Fq.mjs → plugin-CXRoMA8g.mjs} +1382 -810
  20. package/dist/{poster-DHi6I1fO.mjs → poster-CYmCa00B.mjs} +1 -1
  21. package/dist/{profile-jIS6BcAs.mjs → profile-B1FKOM1e.mjs} +1 -1
  22. package/dist/{publish-bakes-r4PEZuPl.mjs → publish-bakes-C_2ZtHou.mjs} +3 -3
  23. package/dist/{queue-c-6aTHEz.mjs → queue-DeSQm24g.mjs} +29 -14
  24. package/dist/{recover-nrLEVLyJ.mjs → recover-XD8iXJOj.mjs} +2 -2
  25. package/dist/{serve-Dp3nHstu.mjs → serve-DQv3Ti6X.mjs} +8 -4
  26. package/dist/{session-DyVE7cCk.mjs → session-VDJfXEEm.mjs} +1 -1
  27. package/dist/{share-Ce4tP7ji.mjs → share-Bu_kuOKL.mjs} +1 -1
  28. package/dist/{shot-BrRtqaiS.mjs → shot-CRRGgxru.mjs} +3 -3
  29. package/dist/{slots-CFNnegCc.mjs → slots-Dn4Onb0V.mjs} +101 -3
  30. package/dist/{sync-CQdGARJ9.mjs → sync-CMozOwZ0.mjs} +1 -1
  31. package/docs/app.md +194 -0
  32. package/docs/boards-and-folders.md +11 -0
  33. package/docs/jam-session.md +12 -3
  34. package/docs/live-jam.md +3 -0
  35. package/docs/performance.md +99 -19
  36. package/docs/publish.md +7 -0
  37. package/package.json +1 -1
  38. package/src/client/frame-host/bridge.js +17 -8
  39. package/src/client/frame-host/inplace.ts +124 -0
  40. package/src/client/frame-host/inspect.d.ts +1 -0
  41. package/src/client/frame-host/inspect.js +13 -4
  42. package/src/client/frame-host/main.tsx +12 -3
  43. package/src/client/frame-host/messages.ts +85 -0
  44. package/src/client/frame-host/signals.d.ts +15 -0
  45. package/src/client/frame-host/signals.js +219 -0
  46. package/src/client/recorder-level.ts +41 -0
  47. package/src/client/shell/App.tsx +158 -88
  48. package/src/client/shell/BoardList.tsx +103 -48
  49. package/src/client/shell/Comments.tsx +71 -46
  50. package/src/client/shell/ContextMenu.tsx +8 -6
  51. package/src/client/shell/JamSurface.tsx +187 -71
  52. package/src/client/shell/LockedApp.tsx +19 -3
  53. package/src/client/shell/Play.tsx +110 -62
  54. package/src/client/shell/StatusPicker.tsx +19 -9
  55. package/src/client/shell/Toolbar.tsx +15 -7
  56. package/src/client/shell/api.ts +25 -7
  57. package/src/client/shell/app-bridge.ts +23 -9
  58. package/src/client/shell/app-perf.ts +31 -1
  59. package/src/client/shell/canvas/Canvas.tsx +17 -6
  60. package/src/client/shell/canvas/FrameNode.tsx +25 -12
  61. package/src/client/shell/canvas/Sticky.tsx +4 -2
  62. package/src/client/shell/canvas/ctl.ts +2 -0
  63. package/src/client/shell/canvas/ready-watch.ts +4 -0
  64. package/src/client/shell/canvas/sleep.ts +2 -0
  65. package/src/client/shell/canvas/updates.ts +13 -6
  66. package/src/client/shell/commands.ts +765 -0
  67. package/src/client/shell/comments-store.ts +56 -27
  68. package/src/client/shell/goto.ts +15 -9
  69. package/src/client/shell/jam-capture.ts +39 -15
  70. package/src/client/shell/jam-keys.ts +303 -111
  71. package/src/client/shell/jam-lane.tsx +19 -12
  72. package/src/client/shell/jam-lines.ts +10 -1
  73. package/src/client/shell/jam-panel.tsx +68 -53
  74. package/src/client/shell/jam-queue.ts +6 -1
  75. package/src/client/shell/jam-session.tsx +41 -37
  76. package/src/client/shell/jam-state.ts +28 -5
  77. package/src/client/shell/jam-surface-parts.tsx +8 -6
  78. package/src/client/shell/jam-ui.tsx +12 -5
  79. package/src/client/shell/jam-voice.ts +4 -2
  80. package/src/client/shell/live-picture.ts +134 -0
  81. package/src/client/shell/main.tsx +7 -1
  82. package/src/client/shell/marks-ui.tsx +11 -0
  83. package/src/client/shell/open-item.ts +83 -0
  84. package/src/client/shell/open-resolve.ts +50 -0
  85. package/src/client/shell/perf.ts +51 -5
  86. package/src/client/shell/recorder-core.ts +4 -1
  87. package/src/client/shell/recorder-hmr.ts +36 -0
  88. package/src/client/shell/recorder-reloads.ts +264 -0
  89. package/src/client/shell/recorder-seams.ts +116 -0
  90. package/src/client/shell/recorder-self.ts +73 -0
  91. package/src/client/shell/recorder-signals-core.ts +139 -0
  92. package/src/client/shell/recorder-signals.ts +485 -0
  93. package/src/client/shell/recorder.ts +115 -41
  94. package/src/client/shell/store.ts +62 -24
  95. package/src/client/shell/styles.css +2 -0
  96. package/src/client/shell/whiteout-probes.ts +3 -1
  97. package/src/client/stage/main.tsx +39 -12
  98. package/src/shared/app-api.ts +201 -9
  99. package/src/shared/app-perf.ts +103 -8
  100. package/src/shared/app-report.ts +586 -0
  101. package/src/shared/perf-records.ts +445 -0
  102. package/src/shared/perf-run.ts +6 -2
  103. package/templates/instructions/jam.md +4 -0
  104. package/dist/live-Cgzsicwi.mjs +0 -4
  105. package/dist/perf-jam-QxD_UnzN.mjs +0 -635
package/CHANGELOG.md CHANGED
@@ -2,6 +2,109 @@
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.30.0 - 2026-11-04
6
+
7
+ ### Highlights
8
+
9
+ - **Marver now records what happens on your canvas closely enough to explain it.** This release changes no behaviour and
10
+ fixes no slowness; it makes slowness measurable. It all stays on your Mac, in `design/.local/perf/`.
11
+ - **One edit, followed to the frames it redrew.** Each file change gets an id, carried from the save to every frame:
12
+ which frames were asked to redraw, which were awake, off screen or asleep, how long each waited in line and how long it
13
+ took. A page-wide reload now names the file behind it - or says `ambiguous` and lists the candidates when two saves
14
+ overlap. Records say what is known, never a guess.
15
+ - **Why a board loaded again:** what triggered it, who may have written the file, and what was ready when a load was cut off.
16
+ - **Every command you give, however you give it.** C for comments, I for a picture, ⇧P for a path, a menu item, a button,
17
+ a right-click: what it was, how you gave it, whether it worked or why not, and how long until its effect showed. C is
18
+ done when comments mode has reached every visible frame; copy image when the clipboard holds the image. Names and key
19
+ combinations only: never what you type, a comment's words, or what is on your clipboard.
20
+ - **Theme switches and modes, timed:** from the key press to the last visible frame repainted, for the theme, comments,
21
+ laser, inspect, interact, play, slides and Jam, with the errors that happened in each.
22
+ - **Re-renders:** how often each frame's React tree committed, per minute, and how much of that was during a gesture.
23
+ - **What held up a zoom:** the three longest stalls of each gesture and the script behind them, the zoom level, and how many
24
+ frames were awake.
25
+ - **More kinds of bugs:** console errors (warnings are counted only), build errors, a lost dev-server connection, failed
26
+ requests, images and files that would not load, frames that went silent.
27
+ - **`npx marver perf --all`:** one summary of every canvas on this Mac, no repo needed. **`npx marver perf --live`:** the
28
+ records as they happen, in a terminal. Details: [Performance](docs/performance.md).
29
+
30
+ ### Added
31
+
32
+ - `npx marver perf run <board> --recorder core|full`, and a `self` record every 5 minutes: what the recorder itself costs.
33
+ Its budget: a board's load within 5 % with everything on, a gesture's p95 within 0.5 ms.
34
+ - With the Mac app 1.0.1: white-out windows around a board load, a theme switch and a frame's reload, not only gestures.
35
+
36
+ ### Changed
37
+
38
+ - Every perf log keeps 14 days, whole: a live file plus closed segments deleted by age, never rewritten, with a safety cap
39
+ per file. On a very heavy canvas that can reach about 85 MB (`page.jsonl` and `reloads.jsonl`), 176 MB at the caps.
40
+ - Error and console-error messages are kept as the code produced them, 200 characters, on this Mac. In rare cases one
41
+ can hold text you typed; the recorder's own hooks never read input values, the clipboard or request bodies.
42
+
43
+ ### Upgrading
44
+
45
+ Nothing to do. 0.30 reads 0.29's records in every view, with the same output. **marver 0.29 reading 0.30's data** skips the
46
+ new kinds, reads only each live file (so it shows less history), and its `--crashes` loses "the minute before" with app
47
+ 1.0.1, since samples moved to `samples.jsonl`.
48
+
49
+ ## 0.29.0 - 2026-10-31
50
+
51
+ ### Highlights
52
+
53
+ - **Your agent sees a capture's pictures.** A run was given the ids of a capture's pictures and no way to open them,
54
+ so no picture you took reached your agent. Each request now lists its pictures - the frame each shows and the file
55
+ to open, `design/.local/jam/pictures/<id>.png` - and `design/instructions/jam.md` tells the agent to open the ones it
56
+ needs. In a browser as in the Mac app.
57
+ - **The Mac app tells you when a canvas needs you.** A running canvas now tells Marver's Mac app (0.3) what waits on
58
+ you - a question from Marver, a capture ready to review, a run that failed or stalled - and whether an agent is
59
+ working or a Jam session runs, as it changes. The app counts it on the canvas's tab, hidden or not; with notices on,
60
+ a canvas you are not looking at sends one, and the Dock counts them all. A canvas on 0.28 or earlier shows none of
61
+ this in the app. In a browser nothing changes: the sidebar and the lane say it as before
62
+ ([What needs you](docs/boards-and-folders.md#what-is-new-what-needs-you)).
63
+ - **A notice opens what it names.** Click one in the Mac app and the canvas opens it on its board, where you can see
64
+ it: a question in its thread on the frame (Play is left, and comment pins you hid with `⇧C` come back for it), or,
65
+ when no frame on the board holds it, in a panel with a field to answer; a review in its review; a failed run with
66
+ Retry in view, a stalled one with its three choices (a stalled capture's or Jam session's on its tile in the lane,
67
+ on the board you are on). On a board locked to play, Play stays and the thread opens over it. An item that has moved
68
+ on opens as it is now - a resolved thread read-only - and one that is gone opens its board. Nothing moves while you
69
+ are capturing or have words you have not sent.
70
+ - **A picture in play is what you saw, in the Mac app.** With app 0.3, a capture's pictures in play - `I`, and the ones
71
+ it takes itself as you point and as it ends - are the stage as it was on your screen: a menu you opened, text you
72
+ typed, the comment pins. They are captioned "as you saw it" in the read-back and the review. One is taken once the
73
+ whole stage is in view with nothing over it and has shown its screen for a second (a device preset, a slide fitted
74
+ to the window); otherwise, in a browser, and whenever the app cannot take it, the picture is a fresh render of the
75
+ frame, as before ([Jam sessions](docs/jam-session.md)).
76
+
77
+ ### Added
78
+
79
+ - **A published canvas wears your logo in the browser's tab.** When your repo has a logo (`design/logo.svg`, or the
80
+ first logo file `marver build` finds), it is the only tab icon of the canvas and its sign-in page, so a browser tab -
81
+ and the Mac app's tab for a shared canvas - shows it rather than Marver's mark; without one, Marver's mark as before.
82
+ A canvas published before keeps Marver's mark until you build it again
83
+ ([Publishing](docs/publish.md#name-the-canvas)).
84
+ - `npx marver perf --jam` counts the Mac app's live pictures - kept, failed, rendered instead - and lists a capture
85
+ whose live pictures failed among what went wrong.
86
+
87
+ ### Changed
88
+
89
+ - **Opening a capture's thread shows it where you can see it.** Clicking an "Asks you" tile, or Open thread on a
90
+ capture, opens its thread on the frame: Play is left and comment pins you hid with `⇧C` come back, where it used to
91
+ open unseen under them. With no frame on the board for it, it opens in the capture's panel as before, and on a board
92
+ locked to play, in that panel over Play; a resolved thread opens read-only in the thread panel.
93
+
94
+ ### Fixed
95
+
96
+ - **A canvas in a subfolder of a git repository keeps Jam's hook files out of commits.** In a monorepo, or a
97
+ `canvas/` folder beside your app, `.codex/hooks.json` and `.cursor/hooks.json` showed up in `git status` as new
98
+ files: their line in `.git/info/exclude` named them from the repository's top, not from the canvas's folder. It
99
+ names the folder now.
100
+
101
+ ### Upgrading
102
+
103
+ `npm install @marver-design/marver@latest`, then `npx marver init` to refresh the agent instructions
104
+ (`instructions/jam.md`: a capture's pictures are files to open, and what a live one shows). Restart each canvas; the
105
+ Mac app picks up what a canvas can do as it starts. A published canvas wears your logo once you build and deploy it
106
+ again.
107
+
5
108
  ## 0.28.0 - 2026-10-29
6
109
 
7
110
  ### Highlights
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  Screens, prototypes, specs, and now slide decks - all real code, all on one canvas, all shareable with people who sign in as themselves.
10
10
 
11
- [marver.design](https://marver.design) · [Boards and folders](docs/boards-and-folders.md) · [Context](docs/context.md) · [Slides](docs/slides.md) · [Sticky notes](docs/sticky-notes.md) · [Live Jam](docs/live-jam.md) · [Jam sessions](docs/jam-session.md) · [Performance](docs/performance.md) · [Deploying a canvas](docs/publish.md) · [Sharing](docs/sharing.md) · [Changelog](CHANGELOG.md) · [Contributing](CONTRIBUTING.md) · [Issues](https://github.com/TNEP4/marver/issues)
11
+ [marver.design](https://marver.design) · [Mac app](docs/app.md) · [Boards and folders](docs/boards-and-folders.md) · [Context](docs/context.md) · [Slides](docs/slides.md) · [Sticky notes](docs/sticky-notes.md) · [Live Jam](docs/live-jam.md) · [Jam sessions](docs/jam-session.md) · [Performance](docs/performance.md) · [Deploying a canvas](docs/publish.md) · [Sharing](docs/sharing.md) · [Changelog](CHANGELOG.md) · [Contributing](CONTRIBUTING.md) · [Issues](https://github.com/TNEP4/marver/issues)
12
12
 
13
13
  ## Quickstart
14
14
 
@@ -119,6 +119,7 @@ The same glow, driven from the terminal. When your agent takes a request, it cre
119
119
  | `npx marver link <scene/frame \| scene ...>` | The canvas link that lands on those frames - their board, selected and in view (needs `dev` running) |
120
120
  | `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 |
121
121
  | `npx marver perf [--loads \| --jam \| --runs] [--json]` | What the canvas did lately: each edit's reloads; `--loads` each board load (time to settled, how many moves and why, the slowest frames, errors); `--jam` Jam's timings; `--runs` the headless runs compared ([Performance](docs/performance.md)) |
122
+ | `npx marver perf --all` / `--live` | Every canvas on this Mac in one summary, no repo needed; or the records as they happen, in a terminal. |
122
123
  | `npx marver perf run <board> [--slow] [--repeat n]` | Measure a board the same way every time - a load, a fit, a zoom and a pan in the canvas's own headless Chrome, read-only - so you or your agent can compare before and after a change (needs `dev` running; [Headless runs](docs/performance.md#headless-runs)) |
123
124
  | `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 |
124
125
  | `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/` |
@@ -127,7 +128,7 @@ The same glow, driven from the terminal. When your agent takes a request, it cre
127
128
 
128
129
  **Where the canvas runs.** Each canvas on your Mac takes one of twenty fixed ports, localhost:4805 to localhost:4824 - usually the same one each time - and prints its link; `npx marver ls` lists them all. `--port <n>`, or a `port` in `design/config.ts` (other than the old 5199), gives a canvas a port of its own instead. Because an address is reused by whichever canvas starts there next, a tab left open after its canvas stopped says so, and how to bring it back, and keeps your unsaved edits until its own canvas is back, and a local canvas runs no service workers.
129
130
 
130
- **The Mac app.** In Marver's Mac app a canvas tells the app what it holds, so closing its tab, quitting or reloading asks before losing unsaved work, and the app follows its theme and shows its View and Jam items in the menu bar. In a browser none of this runs; browsers ask before a reload or a close loses unsaved work too.
131
+ **The Mac app.** In Marver's Mac app a canvas tells the app what it holds, so closing its tab, quitting or reloading asks before losing unsaved work, and the app follows its theme and shows its View and Jam items in the menu bar. Since 0.29 (app 0.3) it also tells the app what needs you - a question, a capture to review, a run that failed or stalled - which the app counts on the canvas's tab and, with notices on, sends as a notice that opens it; and a capture's pictures in play are your screen as you saw it ([what needs you](docs/boards-and-folders.md#what-is-new-what-needs-you)). In a browser none of this runs; browsers ask before a reload or a close loses unsaved work too.
131
132
 
132
133
  ## Shortcuts
133
134
 
@@ -152,7 +153,7 @@ The same glow, driven from the terminal. When your agent takes a request, it cre
152
153
 
153
154
  - **Next.js**: supported with one caveat - frames render in Vite, outside Next. `next/font` CSS variables are undefined inside frames (give font tokens a fallback chain), `next/image`/`next/link` should be plain `img`/`data-goto` in frames, and Server Components cannot run there. `init` writes the specifics into `design/AGENTS.md` when it detects Next.
154
155
  - **Upgrade**: `npm i -D @marver-design/marver@latest && npx marver init`. The canvas tells you when a new version is out (one anonymous registry check per day, cached in `design/.local/`; `MARVER_NO_UPDATE_CHECK=1` disables), and warns when your `design/instructions/` predate the installed package. Re-running init refreshes the managed files (AGENTS.md, `design/instructions/`) - your edits to them are detected and preserved; when both you and a release changed a file, the fresh version is staged at `design/.local/latest/` for you (or your agent) to merge. Everything else in `design/` is yours and never touched.
155
- - **Name your canvas**: `share: { name: "Your App" }` in `design/config.ts` titles the gate, labels the brand pill, names the canvas in `marver ls`, and tags every powered-by link. Unset, the gate falls back to your `package.json` name and the canvas shell to the directory name - `app` inside most containers. Its logo is the first of `share.logo`, `design/logo.svg|png`, `public/logo.svg|png` and `public/favicon.svg|png|ico` that is a real file in the repo (never a symlink) of at most 256 KB, an SVG, PNG or ICO by its bytes; the gate page and the Mac app's tab wear it.
156
+ - **Name your canvas**: `share: { name: "Your App" }` in `design/config.ts` titles the gate, labels the brand pill, names the canvas in `marver ls`, and tags every powered-by link. Unset, the gate falls back to your `package.json` name and the canvas shell to the directory name - `app` inside most containers. Its logo is the first of `share.logo`, `design/logo.svg|png`, `public/logo.svg|png` and `public/favicon.svg|png|ico` that is a real file in the repo (never a symlink) of at most 256 KB, an SVG, PNG or ICO by its bytes; the gate page, a published canvas's browser tab (built with 0.29 or later) and the Mac app's tab wear it.
156
157
  - **Uninstall**: delete `design/`, remove the dependency. (If `init` patched your tsconfig `exclude`, revert that one line.)
157
158
 
158
159
  ## Status
@@ -1,4 +1,4 @@
1
- import { a as frameUrl, d as withBrowser, n as MOUNTED, o as manifestFrame, s as planShot } from "./shot-BrRtqaiS.mjs";
1
+ import { a as frameUrl, d as withBrowser, n as MOUNTED, o as manifestFrame, s as planShot } from "./shot-CRRGgxru.mjs";
2
2
  //#region src/server/anchor-check.ts
3
3
  /**
4
4
  * The anchor check (spec 26, Part 6): `comments new --on|--at`, `comments move` and a Live Jam re-pin
@@ -5,8 +5,9 @@ import { g as PUBLISHABLE, s as scanFrames, v as publishableStatus } from "./man
5
5
  import { a as readLog, o as shareable, r as legacyExposure, t as appendEvents } from "./comments-0BSbb04K.mjs";
6
6
  import { t as detectHost } from "./detect-C0wpaePX.mjs";
7
7
  import { n as loadConfig } from "./config-BezZTiov.mjs";
8
- import { i as publishLogo, n as tailwind3Css, r as tailwind4Plugin, t as marverPlugin } from "./plugin-C_0yb-Fq.mjs";
8
+ import { n as tailwind3Css, r as tailwind4Plugin, t as marverPlugin } from "./plugin-CXRoMA8g.mjs";
9
9
  import { i as measuringFrames, n as autoWidthOf, o as readSizes, r as keptSizes } from "./sizes-wjXDev3b.mjs";
10
+ import { i as publishLogo, n as logoIcons } from "./logo-CXY-1yrn.mjs";
10
11
  import { cpSync, existsSync, mkdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
11
12
  import { basename, dirname, join, sep } from "node:path";
12
13
  import { fileURLToPath } from "node:url";
@@ -750,7 +751,8 @@ async function buildSite(root, boardsFlag, allBoardsFlag, embedSeeds, textures =
750
751
  "bridge.js",
751
752
  "inspect.js",
752
753
  "keys.js",
753
- "trail.js"
754
+ "trail.js",
755
+ "signals.js"
754
756
  ]) cpSync(join(clientDir, "frame-host", f), join(outDir, "assets", f));
755
757
  const frameCss = cssFor("frame").map((f) => `<link rel="stylesheet" href="/${f}" />`).join("\n");
756
758
  for (const f of frames.filter((x) => x.kind === "html")) {
@@ -787,7 +789,7 @@ async function buildSite(root, boardsFlag, allBoardsFlag, embedSeeds, textures =
787
789
  const realAssets = existsSync(assetsDir) ? realpathSync(assetsDir) : null;
788
790
  for (const r of refs) {
789
791
  if (!isLocalAssetRef(r) || !r.endsWith(".poster.png") || existsSync(join(assetsDir, r))) continue;
790
- const { ensurePoster } = await import("./poster-DHi6I1fO.mjs");
792
+ const { ensurePoster } = await import("./poster-CYmCa00B.mjs");
791
793
  const g = await ensurePoster(assetsDir, r.slice(0, -11));
792
794
  if (!g.ok) throw new Error(`design/assets/${r}: ${g.error}`);
793
795
  console.log(` poster: rendered design/assets/${r} (${g.width}×${g.height})`);
@@ -836,6 +838,7 @@ async function buildSite(root, boardsFlag, allBoardsFlag, embedSeeds, textures =
836
838
  } catch {}
837
839
  if (config.share.name) name = config.share.name;
838
840
  const logo = publishLogo(root, config.share.logo, outDir, (m) => console.warn(` ${m}`));
841
+ if (logo) writeFileSync(join(outDir, "index.html"), logoIcons(readFileSync(join(outDir, "index.html"), "utf8"), logo));
839
842
  writeFileSync(join(outDir, "meta.json"), JSON.stringify({
840
843
  name,
841
844
  branding: config.share.branding,
@@ -849,7 +852,7 @@ async function buildSite(root, boardsFlag, allBoardsFlag, embedSeeds, textures =
849
852
  }));
850
853
  let textureLine = " textures: skipped (--no-textures)";
851
854
  if (textures && bakeGen) {
852
- const { bakePublished } = await import("./publish-bakes-r4PEZuPl.mjs");
855
+ const { bakePublished } = await import("./publish-bakes-C_2ZtHou.mjs");
853
856
  const pubFrameFile = new Map(pubFrames.map((f) => [f.id, f]));
854
857
  const r = await bakePublished({
855
858
  root,
@@ -1,8 +1,11 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
2
+ import { m as BOUNDS } from "./slots-Dn4Onb0V.mjs";
2
3
  import { n as readTarget } from "./anchor-5H1vnoLu.mjs";
3
4
  import { closeSync, copyFileSync, existsSync, fsyncSync, mkdirSync, openSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync, writeSync } from "node:fs";
4
5
  import { join, relative, resolve, sep } from "node:path";
5
6
  import { createHash, randomBytes } from "node:crypto";
7
+ import { promisify } from "node:util";
8
+ import { crc32, inflate } from "node:zlib";
6
9
  //#region src/server/jam/packet.ts
7
10
  const CAP = 4096;
8
11
  /** Strip ANSI escapes and control chars (keep \n and \t), and cap length. */
@@ -66,6 +69,8 @@ function goalText(packet, subagents = true, runner) {
66
69
  "A frame they pointed at can be WHERE they want something new (\"a new frame to the right of this one\"), not",
67
70
  "what to change: then leave that frame as it is and make the new one - Marver moves the capture's thread onto it.",
68
71
  "`added` are notes they wrote after the capture ended, in its read-back: read them after the timeline.",
72
+ "Its pictures are files: the member's `pictures` names each one's `file` - open the ones you need. A `live` one is",
73
+ "the owner's screen in play as they saw it (an open menu, text they typed); the others are fresh renders of the frame.",
69
74
  ""
70
75
  ] : [],
71
76
  ...packet.members.some((m) => m.brief.wrapup) ? [
@@ -368,14 +373,18 @@ var capture_exports = /* @__PURE__ */ __exportAll({
368
373
  MAX_PICTURES: () => 12,
369
374
  PICTURE_ID: () => PICTURE_ID,
370
375
  addPicture: () => addPicture,
376
+ addPictureBytes: () => addPictureBytes,
371
377
  captureFrames: () => captureFrames,
372
378
  captureWords: () => captureWords,
379
+ checkPng: () => checkPng,
373
380
  checkRecord: () => checkRecord,
374
381
  continues: () => continues,
375
382
  factsOf: () => factsOf,
376
383
  firstPoint: () => firstPoint,
377
384
  hashOf: () => hashOf,
385
+ isPng: () => isPng,
378
386
  madeOf: () => madeOf,
387
+ packetPictures: () => packetPictures,
379
388
  picturePath: () => picturePath,
380
389
  readCapture: () => readCapture,
381
390
  requestWords: () => requestWords,
@@ -537,7 +546,8 @@ function stepOf(v) {
537
546
  "key",
538
547
  "pick",
539
548
  "end"
540
- ].includes(o.why) ? o.why : "key"
549
+ ].includes(o.why) ? o.why : "key",
550
+ ...o.source === "live" ? { source: "live" } : {}
541
551
  } : null;
542
552
  case "missing": return {
543
553
  ...base,
@@ -773,13 +783,47 @@ function picturePath(root, id) {
773
783
  return null;
774
784
  }
775
785
  }
776
- /** Pictures whose capture never sealed are removed after an hour. */
786
+ /** Keep a live picture's bytes (A4.6 #37) - already checked whole (`checkPng`) - as a jam picture: the same store and
787
+ * index as a render, the file 600, `source: 'live'` on its entry. */
788
+ function addPictureBytes(root, png, entry) {
789
+ const id = `p-${randomBytes(8).toString("hex")}`;
790
+ mkdirSync(picturesDir(root), { recursive: true });
791
+ const file = join("pictures", `${id}.png`);
792
+ writeFileSync(join(jamDir(root), file), png, {
793
+ mode: 384,
794
+ flag: "wx"
795
+ });
796
+ const ix = readIndex(root);
797
+ ix[id] = {
798
+ file,
799
+ when: Date.now(),
800
+ ...entry
801
+ };
802
+ writeIndex(root, ix);
803
+ return id;
804
+ }
805
+ /** Pictures no record keeps are removed after an hour: one whose capture never sealed, and (A4.6 #36) one its sealed
806
+ * capture's record does not list - a live upload or a render that landed after its shot had settled without it. One
807
+ * found listed is marked, so a record is read for it once; a record that cannot be read keeps everything. */
777
808
  function sweepPictures(root, now = Date.now()) {
778
809
  const ix = readIndex(root);
810
+ const lists = /* @__PURE__ */ new Map();
811
+ const listOf = (capture) => {
812
+ if (!lists.has(capture)) lists.set(capture, readCapture(root, capture)?.record.pictures ?? null);
813
+ return lists.get(capture);
814
+ };
779
815
  let changed = false;
780
816
  for (const [id, e] of Object.entries(ix)) {
781
- if (!e.capture || e.batch || now - e.when < 36e5) continue;
782
- if (existsSync(join(capturesDir(root), `${e.capture}.json`))) continue;
817
+ if (!e.capture || e.batch || e.listed || now - e.when < 36e5) continue;
818
+ if (existsSync(join(capturesDir(root), `${e.capture}.json`))) {
819
+ const listed = listOf(e.capture);
820
+ if (!listed) continue;
821
+ if (listed.includes(id)) {
822
+ e.listed = true;
823
+ changed = true;
824
+ continue;
825
+ }
826
+ }
783
827
  try {
784
828
  rmSync(join(jamDir(root), e.file), { force: true });
785
829
  } catch {}
@@ -788,5 +832,124 @@ function sweepPictures(root, now = Date.now()) {
788
832
  }
789
833
  if (changed) writeIndex(root, ix);
790
834
  }
835
+ /** The pictures a packet member's brief names - its capture's, the capture it reviewed, a session record's captures' -
836
+ * each once, as files the agent can open (A4.6 #38): `file` relative to the repo, resolved through `picturePath`, so an
837
+ * id that no longer resolves is left out; `live` for the owner's screen in play. */
838
+ function packetPictures(root, brief) {
839
+ const ids = [
840
+ ...brief.capture?.record.pictures ?? [],
841
+ ...brief.capture?.reviewed?.capture?.record.pictures ?? [],
842
+ ...(brief.wrapup?.content.captures ?? []).flatMap((c) => c.record.pictures ?? [])
843
+ ];
844
+ const out = [];
845
+ for (const id of new Set(ids)) {
846
+ const p = picturePath(root, id);
847
+ if (!p) continue;
848
+ out.push({
849
+ id,
850
+ frame: p.entry.frame,
851
+ file: [
852
+ "design",
853
+ ".local",
854
+ "jam",
855
+ ...p.entry.file.split(/[\\/]/)
856
+ ].join("/"),
857
+ ...p.entry.source === "live" ? { live: true } : {}
858
+ });
859
+ }
860
+ return out;
861
+ }
862
+ const PNG_SIGNATURE = [
863
+ 137,
864
+ 80,
865
+ 78,
866
+ 71,
867
+ 13,
868
+ 10,
869
+ 26,
870
+ 10
871
+ ];
872
+ /** Does it open with the PNG signature? The route's 415, before the whole check. */
873
+ const isPng = (b) => b.length >= 8 && PNG_SIGNATURE.every((x, i) => b[i] === x);
874
+ /** what Chromium's `toPNG()` writes: 8-bit RGBA (6), or RGB (2) for an opaque image - and its bytes a pixel */
875
+ const CHANNELS = {
876
+ 6: 4,
877
+ 2: 3
878
+ };
879
+ const inflateAsync = promisify(inflate);
880
+ let checking = Promise.resolve();
881
+ /**
882
+ * A PNG checked whole, with no decoder added: its size, or why not. Every chunk walked from the signature, each length
883
+ * inside the body and each CRC right; `IHDR` first, 13 bytes, 1-4096 a side, 8-bit RGBA or RGB, never interlaced; the
884
+ * `IDAT` chunks consecutive, `IEND` last and empty, nothing after it; any other critical chunk refused, ancillary ones
885
+ * skipped. The joined `IDAT` inflated to exactly the raw size (a filter byte a row, each 0-4), never past it. Undoing
886
+ * the filters cannot fail on such data, so it is not done. One check at a time in the server, so at most one raw image
887
+ * is held.
888
+ */
889
+ function checkPng(bytes) {
890
+ const run = checking.then(() => checkPngNow(bytes));
891
+ checking = run.catch(() => {});
892
+ return run;
893
+ }
894
+ async function checkPngNow(bytes) {
895
+ if (!isPng(bytes)) return "not a PNG";
896
+ const b = Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength);
897
+ let head = null;
898
+ const idat = [];
899
+ let idatEnded = false, ended = false;
900
+ for (let off = 8; off < b.length;) {
901
+ if (ended) return "data after IEND";
902
+ if (b.length - off < 12) return "a chunk cut short";
903
+ const len = b.readUInt32BE(off);
904
+ const type = b.toString("latin1", off + 4, off + 8);
905
+ if (!/^[A-Za-z]{4}$/.test(type)) return "a chunk with no name";
906
+ if (len > b.length - off - 12) return `${type} cut short`;
907
+ const data = b.subarray(off + 8, off + 8 + len);
908
+ if (crc32(b.subarray(off + 4, off + 8 + len)) !== b.readUInt32BE(off + 8 + len)) return `${type}'s CRC is wrong`;
909
+ off += 12 + len;
910
+ if (!head) {
911
+ if (type !== "IHDR" || len !== 13) return "IHDR is not first";
912
+ const width = data.readUInt32BE(0), height = data.readUInt32BE(4);
913
+ if (width < 1 || height < 1 || width > BOUNDS.captureLong || height > BOUNDS.captureLong) return `${width}x${height} is past ${BOUNDS.captureLong}`;
914
+ if (data[8] !== 8 || !CHANNELS[data[9]]) return `bit depth ${data[8]}, colour type ${data[9]}: not 8-bit RGBA or RGB`;
915
+ if (data[10] || data[11] || data[12]) return "compression, filter or interlace other than 0";
916
+ head = {
917
+ width,
918
+ height,
919
+ channels: CHANNELS[data[9]]
920
+ };
921
+ continue;
922
+ }
923
+ if (type === "IDAT") {
924
+ if (idatEnded) return "IDAT chunks apart";
925
+ idat.push(data);
926
+ continue;
927
+ }
928
+ if (idat.length) idatEnded = true;
929
+ if (type === "IEND") {
930
+ if (len) return "IEND not empty";
931
+ ended = true;
932
+ continue;
933
+ }
934
+ if (type.charCodeAt(0) < 97) return `a critical ${type}`;
935
+ }
936
+ if (!head) return "no IHDR";
937
+ if (!ended) return "no IEND";
938
+ if (!idat.length) return "no IDAT";
939
+ const row = 1 + head.width * head.channels;
940
+ const size = head.height * row;
941
+ let raw;
942
+ try {
943
+ raw = await inflateAsync(Buffer.concat(idat), { maxOutputLength: size });
944
+ } catch {
945
+ return "IDAT does not inflate to its size";
946
+ }
947
+ if (raw.length !== size) return "IDAT inflates short";
948
+ for (let y = 0; y < head.height; y++) if (raw[y * row] > 4) return `row ${y}'s filter is ${raw[y * row]}`;
949
+ return {
950
+ width: head.width,
951
+ height: head.height
952
+ };
953
+ }
791
954
  //#endregion
792
- export { sanitize as C, refusedAsk as S, threadId as T, buildPacket as _, checkRecord as a, parseAgentText as b, firstPoint as c, picturePath as d, readCapture as f, wordsUntil as g, wordsSince as h, capture_exports as i, hashOf as l, storeCapture as m, captureFrames as n, continues as o, requestWords as p, captureWords as r, factsOf as s, CAPTURE_ID as t, madeOf as u, goalText as v, sharedWhy as w, parseMembers as x, packetPath as y };
955
+ export { refusedAsk as C, threadId as E, parseMembers as S, sharedWhy as T, wordsUntil as _, checkRecord as a, packetPath as b, firstPoint as c, packetPictures as d, picturePath as f, wordsSince as g, storeCapture as h, capture_exports as i, hashOf as l, requestWords as m, captureFrames as n, continues as o, readCapture as p, captureWords as r, factsOf as s, CAPTURE_ID as t, madeOf as u, buildPacket as v, sanitize as w, parseAgentText as x, goalText as y };
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-WE5lQkQL.mjs");
85
+ const { init } = await import("./init-CYlFaRzG.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>", "A port of its own (default: a free slot, localhost:4805-4824 - usually the same one next time; a port in that range takes exactly that slot)").option("--recover [n]", "Run on an address this canvas had before, where an unsent Jam capture waits: alone it lists them; with a number it starts on that one; --recover --port <p>: the port 0.26 used").action(async (opts) => {
93
- const { dev, DevStartError, DevLockError } = await import("./dev-D7YS7iT2.mjs");
93
+ const { dev, DevStartError, DevLockError } = await import("./dev-5dlxoW28.mjs");
94
94
  let port;
95
95
  if (opts.port !== void 0) {
96
96
  const n = Number(opts.port);
@@ -102,7 +102,7 @@ for (const [name, desc] of [["dev", "Start the local canvas (everything on: hot
102
102
  process.exit(1);
103
103
  };
104
104
  try {
105
- if (opts.recover !== void 0 && opts.recover !== false) await (await import("./recover-nrLEVLyJ.mjs")).recoverCommand(resolve$1(opts.root), opts.recover, port, { onFail });
105
+ if (opts.recover !== void 0 && opts.recover !== false) await (await import("./recover-XD8iXJOj.mjs")).recoverCommand(resolve$1(opts.root), opts.recover, port, { onFail });
106
106
  else await dev(resolve$1(opts.root), {
107
107
  port,
108
108
  onFail
@@ -115,10 +115,10 @@ for (const [name, desc] of [["dev", "Start the local canvas (everything on: hot
115
115
  }
116
116
  });
117
117
  cli.command("ls", "The canvases running on this Mac: slot, link, name, version, state, uptime, folder (no repo needed)").option("--json", "Machine-readable output (never a canvas's key)").action(async (opts) => {
118
- (await import("./ls-BZ5TAtd5.mjs")).lsCommand({ json: opts.json === true });
118
+ (await import("./ls-NqmePKOf.mjs")).lsCommand({ json: opts.json === true });
119
119
  });
120
120
  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) => {
121
- const { buildSite } = await import("./build-BsAyLMT1.mjs");
121
+ const { buildSite } = await import("./build-C3mUtjEn.mjs");
122
122
  try {
123
123
  const boards = opts.boards === void 0 ? void 0 : typeof opts.boards === "string" ? opts.boards : "";
124
124
  await buildSite(resolve$1(opts.root), boards, opts.allBoards === true, opts.embedSeeds === true, opts.textures !== false && !process.env.MARVER_NO_TEXTURES);
@@ -128,7 +128,7 @@ cli.command("build", "Static export → design/.dist (what ships comes from desi
128
128
  }
129
129
  });
130
130
  cli.command("serve", "Serve design/.dist (set MARVER_PASSWORD to gate it)").option("--root <dir>", "Host repo root", { default: "." }).option("--port <port>", "Port (default $PORT or 4199)").action(async (opts) => {
131
- const { serve } = await import("./serve-Dp3nHstu.mjs");
131
+ const { serve } = await import("./serve-DQv3Ti6X.mjs");
132
132
  let port;
133
133
  if (opts.port !== void 0) {
134
134
  const n = Number(opts.port);
@@ -137,7 +137,7 @@ cli.command("serve", "Serve design/.dist (set MARVER_PASSWORD to gate it)").opti
137
137
  serve(resolve$1(opts.root), port);
138
138
  });
139
139
  cli.command("comments <action> [value]", "Comment collaboration: connect <url> · sync · list · new <scene/frame> · reply <thread> · move <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 / move: pin on the element showing these words").option("--at <selector>", "new / move: pin on the element this data-testid or CSS selector names (an element without words, like an icon)").option("--nth <n>", "new / move: which of several matching elements (1 = the first)").option("--viewport <name>", "new / move: check the frame at this viewport (default: its own)").option("--theme <name>", "new / move: check the frame in this theme (default: light)").option("--thread <id>", "new: add the note to this open thread instead of pinning a new one").option("--fyi", "new: the note asks nothing (default: it asks - it comes first for the human)").option("--ask", "reply: the reply asks the human something").option("--addressed-in <frame>", "resolve: the variant frame that answered the feedback").action(async (action, value, opts) => {
140
- const { commentsCommand } = await import("./comments-CrBHPEQl.mjs");
140
+ const { commentsCommand } = await import("./comments-XNhMmSSu.mjs");
141
141
  try {
142
142
  await commentsCommand(resolve$1(opts.root), action, value, opts);
143
143
  } catch (err) {
@@ -146,7 +146,7 @@ cli.command("comments <action> [value]", "Comment collaboration: connect <url>
146
146
  }
147
147
  });
148
148
  cli.command("share <action> [value]", "Sharing roster (owner): add <who> · remove <who> · block/unblock <email> · general <mode> · list · requests · explain <who> · who").option("--root <dir>", "Host repo root", { default: "." }).option("--role <role>", "add / requests --approve: view (default) or comment").option("--expires <iso>", "add: expiry timestamp, e.g. 2026-12-31T00:00:00Z").option("--approve <email>", "requests: approve this pending request (canvas-wide in v1)").option("--decline <email>", "requests: decline this pending request (silent to the asker)").option("--json", "list: machine-readable output").action(async (action, value, opts) => {
149
- const { shareCommand } = await import("./share-Ce4tP7ji.mjs");
149
+ const { shareCommand } = await import("./share-Bu_kuOKL.mjs");
150
150
  try {
151
151
  await shareCommand(resolve$1(opts.root), action, value, opts);
152
152
  } catch (err) {
@@ -264,15 +264,15 @@ cli.command("context <action>", "The project's context/ (spec 19) · init: creat
264
264
  }
265
265
  });
266
266
  cli.command("marks", "What the human has not reviewed: frames waiting on them (the ones that ask first), their answers nothing has acted on yet, and frames new since they looked").option("--root <dir>", "Host repo root", { default: "." }).option("--json", "Machine-readable output").option("--all", "Also list the answers from before 0.26 that may already be handled").action(async (opts) => {
267
- const { marksCommand } = await import("./marks-Dyn6tmjp.mjs");
267
+ const { marksCommand } = await import("./marks-DBp3h1Mc.mjs");
268
268
  marksCommand(resolve$1(opts.root), opts);
269
269
  });
270
- cli.command("perf [action] [board]", "The reload log: what each edit reloaded, page-wide reloads, the slowest frames to settle, one line per board load; --loads: what each board load did; --jam: Jam's timings; `perf run <board>`: a headless run of the board, read-only (needs `dev` running); --runs: those runs compared; --crashes, --flashes, --machine: the Mac app's records").option("--root <dir>", "Host repo root", { default: "." }).option("--minutes <n>", "How far back to read (default 60; 24 h with --jam)").option("--loads", "Board loads, from the page, each board by its title: time to the visible frames ready and all ready (each frame's first render), still from the last move and settled (a second still after it) - or why it was cut, and how many frames were ready by then - how many moves and their causes, when the first frame started, the slowest frames to settle (their last height) and how long each waited for its turn to start, errors (design/.local/perf/page.jsonl)").option("--jam", "Jam's timings: captures, pictures, words, naming, runs, shots - numbers only (design/.local/perf/jam.jsonl)").option("--runs", "The headless runs (`perf run`), compared only inside a cohort (script, board, Chrome, flags, machine, power, --slow, bakes): the latest against the one before with the same inputs, and against the last with other inputs; overlapped and invalid runs listed apart (design/.local/perf/runs.jsonl)").option("--against <run>", "With --runs: the latest run of that run's cohort against it, whatever their inputs (you changed something on purpose)").option("--crashes", "The Mac app's crashes and hangs of this repo's canvases, each joined to its board load by page (what had settled, the last gesture), the minute before it, and the GPU and utility processes' ends by time (~/.marver/perf/app.jsonl, app-dev.jsonl)").option("--flashes", "The flashes marked in the Mac app (⌃⌥F) on this repo's canvases: the board, the gesture the mark fell in (or the one ending within 2 s of it), the GPU process's events, pressure at the mark, the GPU figures and the picture's path; the white-out detector's candidates apart, automatic and not verified").option("--machine", "The machine profiles the Mac app and headless runs wrote (~/.marver/perf/machine), by host, which is current, and how many records and runs name each").option("--all", "With --flashes: also the marks made on other canvases or on Home").option("--days <n>", "How far back --runs, --crashes, --flashes and --machine read (default 14)").option("--slow", "With `run`: the CPU throttled 4x (a stand-in for a slower Mac's CPU, not its GPU or memory)").option("--repeat <n>", "With `run`: how many runs, one after another (1-5, default 1)").option("--json", "Machine-readable output").action(async (action, board, opts) => {
270
+ cli.command("perf [action] [board]", "The reload log: what each edit reloaded, page-wide reloads, the slowest frames to settle, one line per board load; --loads: what each board load did; --jam: Jam's timings; `perf run <board>`: a headless run of the board, read-only (needs `dev` running); --runs: those runs compared; --crashes, --flashes, --machine: the Mac app's records; --all: every canvas this Mac knows, one summary; --live: a tail in the terminal").option("--root <dir>", "Host repo root", { default: "." }).option("--minutes <n>", "How far back to read (default 60; 24 h with --jam)").option("--loads", "Board loads, from the page, each board by its title: time to the visible frames ready and all ready (each frame's first render), still from the last move and settled (a second still after it) - or why it was cut, and how many frames were ready by then - how many moves and their causes, when the first frame started, the slowest frames to settle (their last height) and how long each waited for its turn to start, errors (design/.local/perf/page.jsonl)").option("--jam", "Jam's timings: captures, pictures, words, naming, runs, shots - numbers only (design/.local/perf/jam.jsonl)").option("--runs", "The headless runs (`perf run`), compared only inside a cohort (script, board, Chrome, flags, machine, power, --slow, bakes): the latest against the one before with the same inputs, and against the last with other inputs; overlapped and invalid runs listed apart (design/.local/perf/runs.jsonl)").option("--against <run>", "With --runs: the latest run of that run's cohort against it, whatever their inputs (you changed something on purpose)").option("--crashes", "The Mac app's crashes and hangs of this repo's canvases, each joined to its board load by page (what had settled, the last gesture), the minute before it, and the GPU and utility processes' ends by time (~/.marver/perf/app.jsonl, app-dev.jsonl)").option("--flashes", "The flashes marked in the Mac app (⌃⌥F) on this repo's canvases: the board, the gesture the mark fell in (or the one ending within 2 s of it), the GPU process's events, pressure at the mark, the GPU figures and the picture's path; the white-out detector's candidates apart, automatic and not verified").option("--machine", "The machine profiles the Mac app and headless runs wrote (~/.marver/perf/machine), by host, which is current, and how many records and runs name each").option("--all", "Every canvas this Mac knows (running, or that the app remembers): one summary per canvas and the Mac app's, no repo needed; with --live, every known canvas's live files; with --flashes, also the marks made on other canvases or on Home").option("--live", "A tail in the terminal: the live files of this repo (--all: every known canvas) and the app's app.jsonl, from now, one line per record - about 3 s behind (Ctrl-C ends it)").option("--kinds <list>", "With --live: only these kinds, comma-separated (load,cmd,error, ...)").option("--days <n>", "How far back --all, --runs, --crashes, --flashes and --machine read (default 14)").option("--slow", "With `run`: the CPU throttled 4x (a stand-in for a slower Mac's CPU, not its GPU or memory)").option("--repeat <n>", "With `run`: how many runs, one after another (1-5, default 1)").option("--recorder <level>", "With `run`: core (only what the run's driver reads, 0.29's load tracking) or full (everything the recorder records, the default); the two never compare as one").option("--json", "Machine-readable output").action(async (action, board, opts) => {
271
271
  if (action !== void 0 && action !== "run") {
272
272
  console.error(`[${NAME}] unknown action "${action}" - the one action is run: ${NAME} perf run <board>`);
273
273
  process.exit(1);
274
274
  }
275
- const { perfCommand, perfRunCommand } = await import("./perf-Cn5LiRaY.mjs");
275
+ const { perfCommand, perfRunCommand } = await import("./perf-6MOTHxay.mjs");
276
276
  const typed = (v) => typeof v === "number" ? process.argv.find((t) => !t.startsWith("-") && Number(t) === v) ?? String(v) : v === void 0 ? void 0 : String(v);
277
277
  if (action !== "run") return perfCommand(resolve$1(opts.root), {
278
278
  ...opts,
@@ -2,8 +2,8 @@ import { r as NAME } from "./cli.mjs";
2
2
  import { i as readDevInfo } from "./work-DJxH7cCX.mjs";
3
3
  import { r as replay } from "./events-CLH4ijKP.mjs";
4
4
  import { a as readLog, i as listBoards, t as appendEvents } from "./comments-0BSbb04K.mjs";
5
- import { a as syncOnce, i as loadCollab, n as connectClaim, r as connectToken, t as connect } from "./sync-CQdGARJ9.mjs";
6
- import { n as localProfile } from "./profile-jIS6BcAs.mjs";
5
+ import { a as syncOnce, i as loadCollab, n as connectClaim, r as connectToken, t as connect } from "./sync-CMozOwZ0.mjs";
6
+ import { n as localProfile } from "./profile-B1FKOM1e.mjs";
7
7
  import { a as runningAgent } from "./agent-BsieQGTD.mjs";
8
8
  import { n as readTarget, r as uncheckedAnchor } from "./anchor-5H1vnoLu.mjs";
9
9
  import { join } from "node:path";
@@ -151,7 +151,9 @@ function exclude(root, rel) {
151
151
  if (r.status !== 0) return;
152
152
  const p = r.stdout.trim();
153
153
  const file = isAbsolute(p) ? p : join(root, p);
154
- const line = `/${rel.split("\\").join("/")}`;
154
+ const prefix = git(root, ["rev-parse", "--show-prefix"]);
155
+ if (prefix.status !== 0) return;
156
+ const line = `/${prefix.stdout.trim()}${rel.split("\\").join("/")}`;
155
157
  let text = "";
156
158
  try {
157
159
  text = readFileSync(file, "utf8");