@marver-design/marver 0.26.1 → 0.27.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.
- package/CHANGELOG.md +104 -0
- package/README.md +8 -3
- package/dist/{anchor-check-l-ny3UzH.mjs → anchor-check-ChdDqL5z.mjs} +1 -1
- package/dist/{bake-C-awKgLA.mjs → bake-DM_uWgAA.mjs} +1 -1
- package/dist/{boards-DYG22tOe.mjs → boards-DlTcpF47.mjs} +1 -1
- package/dist/{build-BDRiO_mP.mjs → build-DZnFysGU.mjs} +4 -4
- package/dist/cli.mjs +28 -16
- package/dist/{comments-BqXua-XL.mjs → comments-DxOkCSNE.mjs} +4 -4
- package/dist/{daemon-DL6Fwq6D.mjs → daemon-BSA0lV8d.mjs} +8 -6
- package/dist/detect-C0wpaePX.mjs +125 -0
- package/dist/dev-eQJhWsqg.mjs +1273 -0
- package/dist/dev-lock-C_FC70Mu.mjs +65 -0
- package/dist/exclusive-B1RtpeeP.mjs +150 -0
- package/dist/{init-D8DtrK_F.mjs → init-COD0x48i.mjs} +5 -3
- package/dist/{link-BNzLvdhI.mjs → link-DDXZVGtv.mjs} +20 -8
- package/dist/ls-D7O1G505.mjs +38 -0
- package/dist/{marks-DyWMv_Z1.mjs → marks-CWM3WJjc.mjs} +1 -1
- package/dist/perf-BWzQwZqj.mjs +369 -0
- package/dist/perf-BoDSkbEb.mjs +429 -0
- package/dist/{perf-jam-BU3TVrZu.mjs → perf-jam-D55U3FZK.mjs} +5 -2
- package/dist/{plugin-DkGmZs_r.mjs → plugin-C-E7omsh.mjs} +394 -55
- package/dist/{poster-BdtSKMDm.mjs → poster-Bx83ZYVK.mjs} +1 -1
- package/dist/{profile-WU9qcbIo.mjs → profile-Bh5Y5zpW.mjs} +1 -1
- package/dist/{publish-bakes-9RzRToXV.mjs → publish-bakes-aljgm45S.mjs} +2 -2
- package/dist/{queue-29ok5_eZ.mjs → queue-CAM_vNmX.mjs} +1 -1
- package/dist/recover-t9Pno3u9.mjs +66 -0
- package/dist/{share--oFJ1bCI.mjs → share-W5H3BNvP.mjs} +1 -1
- package/dist/{shot-XQV7HC9A.mjs → shot-DoHLl6ig.mjs} +1 -1
- package/dist/{shot-DQeR_Pfn.mjs → shot-LFhC-WYD.mjs} +9 -3
- package/dist/slots-DCDo3N0x.mjs +471 -0
- package/dist/{sync-DKk-yT1V.mjs → sync-BQVlHZpx.mjs} +4 -3
- package/dist/{work-F5u-twpJ.mjs → work-Bp1p39kq.mjs} +4 -2
- package/dist/{work-VvX_JIgl.mjs → work-BroFwnup.mjs} +4 -2
- package/docs/boards-and-folders.md +3 -1
- package/docs/jam-session.md +55 -1
- package/docs/performance.md +262 -0
- package/package.json +2 -2
- package/src/client/content/index.tsx +3 -0
- package/src/client/content/video.tsx +6 -2
- package/src/client/frame-host/bridge.js +22 -6
- package/src/client/frame-host/main.tsx +17 -5
- package/src/client/shell/App.tsx +180 -25
- package/src/client/shell/BoardList.tsx +5 -5
- package/src/client/shell/Comments.tsx +3 -2
- package/src/client/shell/JamSurface.tsx +4 -2
- package/src/client/shell/LockedApp.tsx +5 -5
- package/src/client/shell/Play.tsx +16 -8
- package/src/client/shell/Toolbar.tsx +12 -1
- package/src/client/shell/api.ts +206 -0
- package/src/client/shell/canvas/Canvas.tsx +30 -3
- package/src/client/shell/canvas/FrameNode.tsx +12 -3
- package/src/client/shell/canvas/admission.ts +8 -1
- package/src/client/shell/canvas/camera-broadcast.ts +15 -5
- package/src/client/shell/canvas/ctl.ts +2 -0
- package/src/client/shell/canvas/frame-registry.ts +28 -2
- package/src/client/shell/canvas/sleep.ts +4 -1
- package/src/client/shell/comments-store.ts +12 -4
- package/src/client/shell/goto.ts +22 -10
- package/src/client/shell/jam-capture.ts +22 -8
- package/src/client/shell/jam-keys.ts +4 -0
- package/src/client/shell/jam-panel.tsx +3 -0
- package/src/client/shell/jam-queue.ts +3 -3
- package/src/client/shell/jam-session.tsx +14 -8
- package/src/client/shell/jam-voice.ts +7 -5
- package/src/client/shell/legacy-links.ts +2 -2
- package/src/client/shell/main.tsx +4 -0
- package/src/client/shell/notes.ts +8 -1
- package/src/client/shell/perf.ts +69 -58
- package/src/client/shell/recorder-core.ts +183 -0
- package/src/client/shell/recorder.ts +565 -0
- package/src/client/shell/store.ts +254 -98
- package/src/client/shell/styles.css +26 -1
- package/templates/AGENTS-embedded.md +22 -4
- package/templates/AGENTS-studio.md +22 -4
- package/templates/demo/dark.tsx +1 -1
- package/templates/demo/welcome.tsx +1 -1
- package/templates/instructions/welcome.md +6 -3
- package/dist/config-Cf7EjAMf.mjs +0 -292
- package/dist/dev-Bw_qYWWq.mjs +0 -755
- package/dist/dev-lock-DWSpa6nj.mjs +0 -179
- package/dist/perf-C75MZ73h.mjs +0 -167
- package/dist/perf-DPbLGhhO.mjs +0 -49
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,110 @@
|
|
|
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.27.0 - 2026-10-23
|
|
6
|
+
|
|
7
|
+
### Highlights
|
|
8
|
+
|
|
9
|
+
- **Each canvas takes a slot: localhost:4805 to 4824.** `marver dev` no longer works its port out from the folder's
|
|
10
|
+
path (5200-5399). It takes one of twenty fixed ports - this project's last one when it is free, else the first free
|
|
11
|
+
one - so a project usually gets its address back. A port another program holds is skipped, and said; with all twenty
|
|
12
|
+
taken it stops before starting, lists them and says how to free one. A canvas that ran before says where it moved on
|
|
13
|
+
its first start: "ports are now fixed slots: this canvas is at http://localhost:4806/".
|
|
14
|
+
- **`npx marver ls`** lists the canvases running on this Mac - slot, link, name, version, state, uptime, folder - with
|
|
15
|
+
`--json` for agents (never a canvas's key). It needs no repo and leaves out a canvas that died without stopping; one
|
|
16
|
+
that has begun to stop shows `closing` and holds its slot until it has gone.
|
|
17
|
+
- **A tab left open can no longer write into another project.** A tab whose canvas had stopped kept talking to
|
|
18
|
+
whatever started next on its port, and could save its board into another project whose board file matched. Now every
|
|
19
|
+
request it makes, and every frame, play-stage and Jam-picture address, names its project, and another project
|
|
20
|
+
refuses them before reading or writing anything. The tab says what happened and the way back ("This canvas stopped -
|
|
21
|
+
run npx marver dev to bring it back"), and that your unsaved edits are kept in it when it holds some; comments and
|
|
22
|
+
Jam captures wait for the canvas. When its canvas answers again, the tab saves, then reloads on the view you had
|
|
23
|
+
once nothing is in progress (a capture, words not sent, a drag): "Back - your edits were saved". If the board's file
|
|
24
|
+
changed on disk meanwhile, the file wins, as it always has, and the tab's unsaved board edits are lost ("board
|
|
25
|
+
changed on disk - canvas layout reloaded"); a board renamed or removed meanwhile is not created again. Leaving a
|
|
26
|
+
stopped tab with unsaved board edits asks first.
|
|
27
|
+
- **`npx marver perf --loads`** says what each board load did, from the page: the time until the frames in view were
|
|
28
|
+
ready, until all were and until the board settled, or why the load was cut; how often the board moved and why; the
|
|
29
|
+
five slowest frames, each with its wait in the queue and its own time; errors, and frames that never answered or are
|
|
30
|
+
missing. `--json` for agents; plain `marver perf` adds a line per load. Its record (`design/.local/perf/page.jsonl`)
|
|
31
|
+
can hold file paths, so it stays on your machine; it costs nothing at rest ([Performance](docs/performance.md)).
|
|
32
|
+
- **Pictures work with Chrome 156.0.8078.47 and later.** That update made a headless page read as hidden when another
|
|
33
|
+
window covers it, and each picture has a window of its own, so a picture could wait on a paint that never came.
|
|
34
|
+
Marver's Chrome now runs every page as if seen (`marver shot`, agent pictures, copy as image, video posters, Jam).
|
|
35
|
+
- **Your agent keeps the canvas up.** A canvas an agent starts dies with its job (Claude Code stops a background job
|
|
36
|
+
after 10 minutes), and the link it gave you with it. The agent instructions now say: `npx marver ls` first; none
|
|
37
|
+
running, ask you to run `npx marver dev` in your own terminal; if it starts one, detached so it outlives it (output
|
|
38
|
+
in `design/.local/dev.log`), its link read from `npx marver ls`. Where a sandbox keeps the canvas from starting or
|
|
39
|
+
being reached, the agent asks you to run it; `marver shot`, `marks`, `ls` and `perf --loads` still work there.
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- **A port you chose stays yours.** `--port <n>`, or a `port` in `design/config.ts` other than the scaffolded 5199, is
|
|
44
|
+
tried first, as before; when it is taken, the canvas takes a slot and says so. A port in 4805-4824 claims exactly
|
|
45
|
+
that slot: when something else holds it, `marver dev` stops and says what. A port from `design/config.ts` is named
|
|
46
|
+
as the canvas starts ("remove it to use the slots"); a new `design/config.ts` has it only as a commented example.
|
|
47
|
+
- **A start that fails leaves nothing behind.** Its lock, its slot, a half-made server and the watchers are given
|
|
48
|
+
back; it says what failed ("port 4806 was just taken by another program - start again", for one) and exits with 1.
|
|
49
|
+
- **`marver dev` says when it stops**: "canvas stopped - open tabs keep their edits and save when it is back".
|
|
50
|
+
- **One project key, the one 0.26 used.** Marver names a project by one key, made from the folder's real path - 0.26's
|
|
51
|
+
key for a canvas started with `npx marver dev` - so a capture waiting in a page keeps it; only the address moved.
|
|
52
|
+
- **Five viewer preferences are kept per project.** Your view theme, the update notice you closed, the mentions you
|
|
53
|
+
opened, which sticky notes show and which folders are folded were kept per address, shared by projects that ran
|
|
54
|
+
there in turn. A local canvas now keeps them per project at each address and carries them nowhere else: they start
|
|
55
|
+
fresh after the upgrade, and on a slot the canvas has not used before. A published canvas is unchanged.
|
|
56
|
+
- **No service workers on a local canvas**: an address is reused by whichever canvas starts there next, and a worker
|
|
57
|
+
would outlive its canvas. A PWA prototype shows its screens, not its offline behaviour.
|
|
58
|
+
- **`__mvPerf.report()` has new names:** `over33ms` (a count) and `over17ms` replace `dropped` and `droppedFrac`;
|
|
59
|
+
`longTask*` become `longFrame*`.
|
|
60
|
+
- **The frame-time sampler rests with the canvas:** it runs only during a pan, a zoom or a layout animation.
|
|
61
|
+
|
|
62
|
+
### Added
|
|
63
|
+
|
|
64
|
+
- **`npx marver dev --recover`** starts a canvas on an address it ran on before - exactly its port, the address it
|
|
65
|
+
bound and the project key that run used, never another - so a Jam capture left unsent in that browser sends itself.
|
|
66
|
+
Alone it lists the last five addresses, newest first, then the one 0.26 gave the folder; `--recover <n>` starts on
|
|
67
|
+
one; `--recover --port <p>` on the port 0.26 moved to. A canvas whose slot was taken says where it ran last time,
|
|
68
|
+
which canvas runs there now, and that a tab still open there keeps its unsaved edits (and an unsent capture waits)
|
|
69
|
+
until this canvas runs there again: "stop "atlas" and this canvas, then `npx marver dev --recover 2`" ([A capture
|
|
70
|
+
left on an old address](docs/jam-session.md#a-capture-left-on-an-old-address)).
|
|
71
|
+
- **The document proof.** An app that opens the canvas page can check the page comes from that canvas: send
|
|
72
|
+
`x-mv-nonce`, get `x-mv-instance` and a signed `x-mv-proof` back. Without the header nothing changes.
|
|
73
|
+
- **`MARVER_HOME`** moves `~/.marver` - running canvases, slot preferences, collaboration credentials - and
|
|
74
|
+
`marver ls` reads it too. The speech model stays in `~/.marver/models` (`MARVER_MODELS` moves it).
|
|
75
|
+
|
|
76
|
+
### Fixed
|
|
77
|
+
|
|
78
|
+
- **Editing `.env` no longer stops Live Jam.** Vite restarts the canvas's server in place when an `.env` file changes,
|
|
79
|
+
and 0.26 took that for a stop: Live Jam stopped, comments written from the terminal no longer reached the page at
|
|
80
|
+
once, and `marver shot`, `work` and `link` lost the canvas. Now only the server restarts.
|
|
81
|
+
- **A link, back or forward reads its board once**, not twice (each fires two browser events).
|
|
82
|
+
- **The demo frames show their bottom button whole**: `welcome` and `dark` ran past the frame and cut it off.
|
|
83
|
+
- **A frame's error card comes from the document it shows**: a late error from a document it replaced is ignored.
|
|
84
|
+
- **The dev server never serves `~/.marver`**, which holds the running canvases' keys and the collaboration
|
|
85
|
+
credentials - not even when your project's workspace root is your home folder.
|
|
86
|
+
- **In a sandbox, `marver dev` says why it cannot start.** Where every file watcher fails (`EMFILE` in Codex's
|
|
87
|
+
sandbox), it ended with Node's own error; it now says to ask the person to run `npx marver dev` in their own
|
|
88
|
+
terminal and exits with 1, leaving nothing behind - as when a watcher fails later.
|
|
89
|
+
- **A canvas out of reach is not "not running".** In a sandbox that keeps an agent off localhost, `marver link` said
|
|
90
|
+
the canvas was not running, an invitation to start a second one. When `design/.local/dev.json` names a process that
|
|
91
|
+
runs, `link` prints the link and says the canvas runs but cannot be reached from here; so do `work start` and
|
|
92
|
+
`work done`.
|
|
93
|
+
- **The perf logs are yours alone**: `design/.local/perf/` is mode 700 and its files 600, older ones included; at
|
|
94
|
+
start each log loses lines older than 14 days, and past 2 MB its oldest half (`page.jsonl` keeps 8 MB).
|
|
95
|
+
|
|
96
|
+
### Upgrading
|
|
97
|
+
|
|
98
|
+
`npm install @marver-design/marver@latest`, then `npx marver init` to refresh the agent instructions (they find the
|
|
99
|
+
canvas with `npx marver ls`, ask you to start it in your own terminal or start it so it outlives them - never with a
|
|
100
|
+
port - and read `npx marver perf --loads`). **Before you upgrade**, open each canvas once in the browser you make
|
|
101
|
+
captures in, with its old version still running and Live Jam on: a capture left unsent there sends itself. One left
|
|
102
|
+
behind comes back with `npx marver dev --recover`. On its first start each canvas moves to a slot and says where; a
|
|
103
|
+
bookmark to its old address no longer reaches it (`marver ls` lists the new one). A `port` you set in
|
|
104
|
+
`design/config.ts` stays until you remove the line. The five viewer preferences start fresh. **Then close every tab a
|
|
105
|
+
0.26 canvas opened** (send or save what they hold first) and open the canvas again from its new link: a page 0.26
|
|
106
|
+
served names no project in its requests, so the protection above - a stopped tab that never writes into another
|
|
107
|
+
project - covers pages loaded from 0.27 on, not those older tabs.
|
|
108
|
+
|
|
5
109
|
## 0.26.1 - 2026-10-20
|
|
6
110
|
|
|
7
111
|
### Fixed
|
package/README.md
CHANGED
|
@@ -8,14 +8,14 @@
|
|
|
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) · [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) · [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
|
|
|
15
15
|
```bash
|
|
16
16
|
npm i -D @marver-design/marver
|
|
17
17
|
npx marver init # scaffolds design/ (detects shadcn, Tailwind, your router)
|
|
18
|
-
npx marver dev # canvas
|
|
18
|
+
npx marver dev # the canvas, on a free slot (localhost:4805-4824) - it prints the link (npx marver canvas works too)
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Then, to your agent:
|
|
@@ -106,7 +106,9 @@ The same glow, driven from the terminal. When your agent takes a request, it cre
|
|
|
106
106
|
| Command | What it does |
|
|
107
107
|
|---|---|
|
|
108
108
|
| `npx marver init [--kind product\|knowledge]` | Scaffold `design/` in this repo (safe to re-run; refreshes managed files); a fresh canvas gets the kind's typed folders |
|
|
109
|
-
| `npx marver dev` / `canvas` | Start the local canvas - hot reload, comments, Live Jam armed (`--port
|
|
109
|
+
| `npx marver dev` / `canvas` | Start the local canvas - hot reload, comments, Live Jam armed. It takes a free slot, localhost:4805-4824, usually the same one next time, and prints its link (`--port <n>`: a port of its own) |
|
|
110
|
+
| `npx marver ls [--json]` | The canvases running on this Mac: slot, link, name, version, state, uptime, folder - no repo needed |
|
|
111
|
+
| `npx marver dev --recover [n]` | Start the canvas on an address it ran on before, so a Jam capture left unsent in that browser sends itself; alone it lists them ([Jam sessions](docs/jam-session.md#a-capture-left-on-an-old-address)) |
|
|
110
112
|
| `npx marver build` | Static export → `design/.dist`; what ships comes from `design/publish.json` (default-closed) |
|
|
111
113
|
| `npx marver serve` | Serve the export; `MARVER_ID_ISSUER` or `MARVER_PASSWORD` gates it, `MARVER_DATA_DIR` persists comments + accounts |
|
|
112
114
|
| `npx marver share …` | The roster (owner): `add <who> [--role]` · `remove` · `block` / `unblock` · `general <mode>` · `list` · `requests` · `explain <who>` · `who` |
|
|
@@ -114,11 +116,14 @@ The same glow, driven from the terminal. When your agent takes a request, it cre
|
|
|
114
116
|
| `npx marver work …` | Working glow from the terminal: `start <scene/frame …>` · `done … \| --all` (prints the canvas link) · `list` |
|
|
115
117
|
| `npx marver link <scene/frame \| scene ...>` | The canvas link that lands on those frames - their board, selected and in view (needs `dev` running) |
|
|
116
118
|
| `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 |
|
|
119
|
+
| `npx marver perf [--loads \| --jam] [--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 ([Performance](docs/performance.md)) |
|
|
117
120
|
| `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 |
|
|
118
121
|
| `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/` |
|
|
119
122
|
| `npx marver folders add <module ...>` | Add a typed folder: `start`, `features`, `surfaces`, `projects`, `feedback`, `context`, `decks`, `archive` |
|
|
120
123
|
| `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 |
|
|
121
124
|
|
|
125
|
+
**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.
|
|
126
|
+
|
|
122
127
|
## Shortcuts
|
|
123
128
|
|
|
124
129
|
**Canvas** - two-finger scroll pans · pinch or ctrl/cmd+scroll zooms · space+drag pans from anywhere · click empty canvas deselects / exits interact.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MOUNTED, frameUrl, manifestFrame, planShot, withBrowser } from "./shot-
|
|
1
|
+
import { MOUNTED, frameUrl, manifestFrame, planShot, withBrowser } from "./shot-LFhC-WYD.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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AREA, SURFACE, pool, shotConcurrency, withBrowser } from "./shot-
|
|
1
|
+
import { AREA, SURFACE, pool, shotConcurrency, withBrowser } from "./shot-LFhC-WYD.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";
|
|
@@ -2,7 +2,7 @@ import { r as NAME } from "./cli.mjs";
|
|
|
2
2
|
import { a as checkRealDirs, d as readMembership, f as readRegistry, i as checkBoardsDir, n as addFolders, r as boardFields, s as listBoardFiles, u as pinFrames } from "./boards-CGg6piKF.mjs";
|
|
3
3
|
import { T as readCapability, a as buildTree, b as FOLDER_MODULES, c as folderMap, f as isBoardName, k as resolveType, o as flatten, u as humanize, v as BOARD_TYPES, w as knownType } from "./board-tree-DRioF94d.mjs";
|
|
4
4
|
import { _ as STATUS_LABEL, d as annotateBoards, h as PHASE_LABEL, s as scanFrames } from "./manifest-Nl3KSVOk.mjs";
|
|
5
|
-
import { resolveTargets } from "./link-
|
|
5
|
+
import { resolveTargets } from "./link-DDXZVGtv.mjs";
|
|
6
6
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { join } from "node:path";
|
|
8
8
|
//#region src/cli/boards.ts
|
|
@@ -3,8 +3,8 @@ import { f as readRegistry, i as checkBoardsDir, o as isRegularFile, r as boardF
|
|
|
3
3
|
import { C as PROPOSED_PUBLISH, a as buildTree, f as isBoardName, l as framesOn, o as flatten, t as ALL_SCENES } from "./board-tree-DRioF94d.mjs";
|
|
4
4
|
import { g as PUBLISHABLE, s as scanFrames, v as publishableStatus } from "./manifest-Nl3KSVOk.mjs";
|
|
5
5
|
import { a as readLog, o as shareable, r as legacyExposure, t as appendEvents } from "./comments-0BSbb04K.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import { a as autoWidthOf, c as readSizes, n as tailwind3Css, o as keptSizes, r as tailwind4Plugin, s as measuringFrames, t as marverPlugin } from "./plugin-
|
|
6
|
+
import { t as detectHost } from "./detect-C0wpaePX.mjs";
|
|
7
|
+
import { a as autoWidthOf, c as readSizes, l as loadConfig, n as tailwind3Css, o as keptSizes, r as tailwind4Plugin, s as measuringFrames, t as marverPlugin } from "./plugin-C-E7omsh.mjs";
|
|
8
8
|
import { cpSync, existsSync, mkdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
9
9
|
import { basename, dirname, join, sep } from "node:path";
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
@@ -785,7 +785,7 @@ async function buildSite(root, boardsFlag, allBoardsFlag, embedSeeds, textures =
|
|
|
785
785
|
const realAssets = existsSync(assetsDir) ? realpathSync(assetsDir) : null;
|
|
786
786
|
for (const r of refs) {
|
|
787
787
|
if (!isLocalAssetRef(r) || !r.endsWith(".poster.png") || existsSync(join(assetsDir, r))) continue;
|
|
788
|
-
const { ensurePoster } = await import("./poster-
|
|
788
|
+
const { ensurePoster } = await import("./poster-Bx83ZYVK.mjs");
|
|
789
789
|
const g = await ensurePoster(assetsDir, r.slice(0, -11));
|
|
790
790
|
if (!g.ok) throw new Error(`design/assets/${r}: ${g.error}`);
|
|
791
791
|
console.log(` poster: rendered design/assets/${r} (${g.width}×${g.height})`);
|
|
@@ -862,7 +862,7 @@ async function buildSite(root, boardsFlag, allBoardsFlag, embedSeeds, textures =
|
|
|
862
862
|
}));
|
|
863
863
|
let textureLine = " textures: skipped (--no-textures)";
|
|
864
864
|
if (textures && bakeGen) {
|
|
865
|
-
const { bakePublished } = await import("./publish-bakes-
|
|
865
|
+
const { bakePublished } = await import("./publish-bakes-aljgm45S.mjs");
|
|
866
866
|
const pubFrameFile = new Map(pubFrames.map((f) => [f.id, f]));
|
|
867
867
|
const r = await bakePublished({
|
|
868
868
|
root,
|
package/dist/cli.mjs
CHANGED
|
@@ -82,31 +82,43 @@ 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-
|
|
85
|
+
const { init } = await import("./init-COD0x48i.mjs");
|
|
86
86
|
init(resolve$1(opts.root), {
|
|
87
87
|
mode: opts.mode === "embedded" ? "embedded" : "studio",
|
|
88
88
|
demo: opts.demo !== false,
|
|
89
89
|
kind: opts.kind
|
|
90
90
|
});
|
|
91
91
|
});
|
|
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>", "
|
|
93
|
-
const { dev, DevLockError } = await import("./dev-
|
|
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-eQJhWsqg.mjs");
|
|
94
94
|
let port;
|
|
95
95
|
if (opts.port !== void 0) {
|
|
96
96
|
const n = Number(opts.port);
|
|
97
97
|
if (Number.isInteger(n) && n > 0 && n < 65536) port = n;
|
|
98
98
|
else console.warn(`[${NAME}] ignoring invalid --port "${opts.port}"`);
|
|
99
99
|
}
|
|
100
|
+
const onFail = (err) => {
|
|
101
|
+
console.error(`\n ${err.message}\n`);
|
|
102
|
+
process.exit(1);
|
|
103
|
+
};
|
|
100
104
|
try {
|
|
101
|
-
await
|
|
105
|
+
if (opts.recover !== void 0 && opts.recover !== false) await (await import("./recover-t9Pno3u9.mjs")).recoverCommand(resolve$1(opts.root), opts.recover, port, { onFail });
|
|
106
|
+
else await dev(resolve$1(opts.root), {
|
|
107
|
+
port,
|
|
108
|
+
onFail
|
|
109
|
+
});
|
|
102
110
|
} catch (err) {
|
|
103
|
-
if (!(err instanceof
|
|
111
|
+
if (!(err instanceof DevStartError)) throw err;
|
|
104
112
|
console.error(`\n ${err.message}\n`);
|
|
113
|
+
if (!(err instanceof DevLockError) && /^the canvas could not start/.test(err.message) && err.cause instanceof Error && err.cause.stack) console.error(err.cause.stack);
|
|
105
114
|
process.exit(1);
|
|
106
115
|
}
|
|
107
116
|
});
|
|
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-D7O1G505.mjs")).lsCommand({ json: opts.json === true });
|
|
119
|
+
});
|
|
108
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) => {
|
|
109
|
-
const { buildSite } = await import("./build-
|
|
121
|
+
const { buildSite } = await import("./build-DZnFysGU.mjs");
|
|
110
122
|
try {
|
|
111
123
|
const boards = opts.boards === void 0 ? void 0 : typeof opts.boards === "string" ? opts.boards : "";
|
|
112
124
|
await buildSite(resolve$1(opts.root), boards, opts.allBoards === true, opts.embedSeeds === true, opts.textures !== false && !process.env.MARVER_NO_TEXTURES);
|
|
@@ -125,7 +137,7 @@ cli.command("serve", "Serve design/.dist (set MARVER_PASSWORD to gate it)").opti
|
|
|
125
137
|
serve(resolve$1(opts.root), port);
|
|
126
138
|
});
|
|
127
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) => {
|
|
128
|
-
const { commentsCommand } = await import("./comments-
|
|
140
|
+
const { commentsCommand } = await import("./comments-DxOkCSNE.mjs");
|
|
129
141
|
try {
|
|
130
142
|
await commentsCommand(resolve$1(opts.root), action, value, opts);
|
|
131
143
|
} catch (err) {
|
|
@@ -134,7 +146,7 @@ cli.command("comments <action> [value]", "Comment collaboration: connect <url>
|
|
|
134
146
|
}
|
|
135
147
|
});
|
|
136
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) => {
|
|
137
|
-
const { shareCommand } = await import("./share
|
|
149
|
+
const { shareCommand } = await import("./share-W5H3BNvP.mjs");
|
|
138
150
|
try {
|
|
139
151
|
await shareCommand(resolve$1(opts.root), action, value, opts);
|
|
140
152
|
} catch (err) {
|
|
@@ -143,7 +155,7 @@ cli.command("share <action> [value]", "Sharing roster (owner): add <who> · remo
|
|
|
143
155
|
}
|
|
144
156
|
});
|
|
145
157
|
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) => {
|
|
146
|
-
const { workCommand } = await import("./work-
|
|
158
|
+
const { workCommand } = await import("./work-BroFwnup.mjs");
|
|
147
159
|
try {
|
|
148
160
|
await workCommand(resolve$1(opts.root), action, frames ?? [], opts);
|
|
149
161
|
} catch (err) {
|
|
@@ -152,7 +164,7 @@ cli.command("work <action> [...frames]", "Working state on the canvas: start <sc
|
|
|
152
164
|
}
|
|
153
165
|
});
|
|
154
166
|
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 one link per board)").action(async (targets, opts) => {
|
|
155
|
-
const { linkCommand } = await import("./link-
|
|
167
|
+
const { linkCommand } = await import("./link-DDXZVGtv.mjs");
|
|
156
168
|
try {
|
|
157
169
|
await linkCommand(resolve$1(opts.root), targets ?? [], opts);
|
|
158
170
|
} catch (err) {
|
|
@@ -161,7 +173,7 @@ cli.command("link [...targets]", "The canvas link that lands on frames: link <sc
|
|
|
161
173
|
}
|
|
162
174
|
});
|
|
163
175
|
cli.command("boards [action] [...args]", "The sidebar as files: every folder and board in reading order, with types and statuses, and the frames on no board · new <name>: a board in its type's starting layout · pin <board> <scene/frame ...>: put frames on a board").option("--root <dir>", "Host repo root", { default: "." }).option("--json", "The tree as JSON ({ tree, boards, landing, unplaced, 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, args, opts) => {
|
|
164
|
-
const { boardsCommand, boardsNew, boardsPin } = await import("./boards-
|
|
176
|
+
const { boardsCommand, boardsNew, boardsPin } = await import("./boards-DlTcpF47.mjs");
|
|
165
177
|
const [name, ...frames] = args ?? [];
|
|
166
178
|
try {
|
|
167
179
|
if (action === void 0) boardsCommand(resolve$1(opts.root), opts);
|
|
@@ -183,7 +195,7 @@ cli.command("boards [action] [...args]", "The sidebar as files: every folder and
|
|
|
183
195
|
}
|
|
184
196
|
});
|
|
185
197
|
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) => {
|
|
186
|
-
const { foldersAdd } = await import("./boards-
|
|
198
|
+
const { foldersAdd } = await import("./boards-DlTcpF47.mjs");
|
|
187
199
|
try {
|
|
188
200
|
if (action !== "add") throw new Error(`unknown action "${action}" - \`folders add <module ...>\``);
|
|
189
201
|
const { added, existing } = foldersAdd(resolve$1(opts.root), modules);
|
|
@@ -231,15 +243,15 @@ cli.command("context <action>", "The project's context/ (spec 19) · init: creat
|
|
|
231
243
|
}
|
|
232
244
|
});
|
|
233
245
|
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) => {
|
|
234
|
-
const { marksCommand } = await import("./marks-
|
|
246
|
+
const { marksCommand } = await import("./marks-CWM3WJjc.mjs");
|
|
235
247
|
marksCommand(resolve$1(opts.root), opts);
|
|
236
248
|
});
|
|
237
|
-
cli.command("perf", "The reload log: what each edit reloaded, page-wide reloads, the slowest frames to settle; --jam: Jam's timings").option("--root <dir>", "Host repo root", { default: "." }).option("--minutes <n>", "How far back to read (default 60; 24 h with --jam)").option("--jam", "Jam's timings: captures, pictures, words, naming, runs, shots - numbers only (design/.local/perf/jam.jsonl)").option("--json", "Machine-readable output").action(async (opts) => {
|
|
238
|
-
const { perfCommand } = await import("./perf-
|
|
249
|
+
cli.command("perf", "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").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: time to the visible frames ready, all ready, quiet, the last move and settled (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 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("--json", "Machine-readable output").action(async (opts) => {
|
|
250
|
+
const { perfCommand } = await import("./perf-BoDSkbEb.mjs");
|
|
239
251
|
perfCommand(resolve$1(opts.root), opts);
|
|
240
252
|
});
|
|
241
253
|
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) => {
|
|
242
|
-
const { shotCommand } = await import("./shot-
|
|
254
|
+
const { shotCommand } = await import("./shot-DoHLl6ig.mjs");
|
|
243
255
|
try {
|
|
244
256
|
await shotCommand(resolve$1(opts.root), frames, opts);
|
|
245
257
|
} catch (err) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as NAME } from "./cli.mjs";
|
|
2
|
-
import { i as readDevInfo } from "./work-
|
|
2
|
+
import { i as readDevInfo } from "./work-Bp1p39kq.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-
|
|
6
|
-
import { n as localProfile } from "./profile-
|
|
5
|
+
import { a as syncOnce, i as loadCollab, n as connectClaim, r as connectToken, t as connect } from "./sync-BQVlHZpx.mjs";
|
|
6
|
+
import { n as localProfile } from "./profile-Bh5Y5zpW.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";
|
|
@@ -132,7 +132,7 @@ async function commentsCommand(root, action, value, opts) {
|
|
|
132
132
|
case "new": {
|
|
133
133
|
if (opts.thread !== void 0) return addToThread(root, String(opts.thread), value, opts);
|
|
134
134
|
if (!value || !opts.body) throw new Error("usage: comments new <scene/frame> --body \"...\" --on \"<words it shows>\" | --at \"<selector or data-testid>\" [--nth <n>] [--fyi] [--board <board>]");
|
|
135
|
-
const { resolveLink, devOrigin } = await import("./link-
|
|
135
|
+
const { resolveLink, devOrigin } = await import("./link-DDXZVGtv.mjs");
|
|
136
136
|
const r = resolveLink(root, [value], opts.board);
|
|
137
137
|
if (r.exact.length !== 1) throw new Error(`"${value}" is a folder of frames - pin a note on one frame: comments new <scene/frame>`);
|
|
138
138
|
if (!r.board) throw new Error(`a note needs a board to live on - ${r.hints.join("\n")}`);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { l as toFrameId } from "./manifest-Nl3KSVOk.mjs";
|
|
2
|
-
import { a as workActivity } from "./work-
|
|
2
|
+
import { a as workActivity } from "./work-Bp1p39kq.mjs";
|
|
3
3
|
import { r as replay } from "./events-CLH4ijKP.mjs";
|
|
4
4
|
import { a as readLog, t as appendEvents } from "./comments-0BSbb04K.mjs";
|
|
5
|
-
import { n as localProfile } from "./profile-
|
|
5
|
+
import { n as localProfile } from "./profile-Bh5Y5zpW.mjs";
|
|
6
6
|
import { r as uncheckedAnchor } from "./anchor-5H1vnoLu.mjs";
|
|
7
7
|
import { i as record, t as has } from "./ledger-D54iROST.mjs";
|
|
8
8
|
import { _ as packetPath, a as checkRecord, c as firstPoint, d as picturePath, f as readCapture, g as goalText, h as buildPacket, n as captureFrames, o as continues, p as storeCapture, r as captureWords, t as CAPTURE_ID, v as parseAgentText, x as sharedFile, y as parseMembers } from "./capture-vadKjuCo.mjs";
|
|
9
9
|
import { a as recordFile, c as storeWrapup, i as readWrapup, n as buildWrapup, o as recordPathProblem, r as moreOf, t as SESSION_ID } from "./session-BAaJsK5c.mjs";
|
|
10
|
-
import { act, addCapture, addWrapup, answeredSince, beginStep, captureComment, captureIntact, conflictStep, createQueue, ctxFor, endSession, endStep, fail, form, looksGood, moreWrapup, n as releaseLock, payloadKey, pending, prune, redelivering, sameComment, settle, startSession, stillOwned, t as acquireLock, textOf, undelivered, wrapupIntact, wrapupOf } from "./queue-
|
|
11
|
-
import { t as logJam } from "./perf-jam-
|
|
10
|
+
import { act, addCapture, addWrapup, answeredSince, beginStep, captureComment, captureIntact, conflictStep, createQueue, ctxFor, endSession, endStep, fail, form, looksGood, moreWrapup, n as releaseLock, payloadKey, pending, prune, redelivering, sameComment, settle, startSession, stillOwned, t as acquireLock, textOf, undelivered, wrapupIntact, wrapupOf } from "./queue-CAM_vNmX.mjs";
|
|
11
|
+
import { t as logJam } from "./perf-jam-D55U3FZK.mjs";
|
|
12
12
|
import { jamReservations, restoreHolds } from "./reserve-BURNQ2Y3.mjs";
|
|
13
13
|
import { jamLive } from "./live-Cgzsicwi.mjs";
|
|
14
14
|
import { lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, watch, writeFileSync } from "node:fs";
|
|
@@ -2496,8 +2496,9 @@ function createJam(root, cfg, adapter, log = () => {}, hooks = {}) {
|
|
|
2496
2496
|
* activity set (work.ts) - the `marver work` CLI writes the same set, so the canvas shows
|
|
2497
2497
|
* one merged glow, and its holds are also reservations (reserve.ts), restored here before
|
|
2498
2498
|
* anything is scheduled. Returns null when the adapter is unavailable or another dev server
|
|
2499
|
-
* already holds the repo lock (that one runs the loop; this one watches without it).
|
|
2500
|
-
|
|
2499
|
+
* already holds the repo lock (that one runs the loop; this one watches without it). `watched` takes the comments
|
|
2500
|
+
* watcher as it is made, so its error is the dev server's to say (dev.ts watchGuard), never Node's unhandled one. */
|
|
2501
|
+
function startJam(root, cfg, log = () => {}, onChanged = () => {}, anchor, onQueue, shoot, watched) {
|
|
2501
2502
|
const adapter = adapters[cfg.agent] ?? null;
|
|
2502
2503
|
if (!adapter) {
|
|
2503
2504
|
log(` jam: the "${cfg.agent}" adapter is not available yet; Live Jam is off`);
|
|
@@ -2534,6 +2535,7 @@ function startJam(root, cfg, log = () => {}, onChanged = () => {}, anchor, onQue
|
|
|
2534
2535
|
let watcher = null;
|
|
2535
2536
|
try {
|
|
2536
2537
|
watcher = watch(commentsDir, { persistent: false }, schedule);
|
|
2538
|
+
watched?.(watcher);
|
|
2537
2539
|
} catch {}
|
|
2538
2540
|
const interval = setInterval(() => void core.poke(), RESCAN_MS);
|
|
2539
2541
|
interval.unref?.();
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
//#region src/server/detect.ts
|
|
4
|
+
function readJson(file) {
|
|
5
|
+
try {
|
|
6
|
+
return JSON.parse(stripJsonComments(readFileSync(file, "utf8")));
|
|
7
|
+
} catch {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function stripJsonComments(s) {
|
|
12
|
+
let out = "", inStr = false, inLine = false, inBlock = false;
|
|
13
|
+
for (let i = 0; i < s.length; i++) {
|
|
14
|
+
const c = s[i], n = s[i + 1];
|
|
15
|
+
if (inLine) {
|
|
16
|
+
if (c === "\n") {
|
|
17
|
+
inLine = false;
|
|
18
|
+
out += c;
|
|
19
|
+
}
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
if (inBlock) {
|
|
23
|
+
if (c === "*" && n === "/") {
|
|
24
|
+
inBlock = false;
|
|
25
|
+
i++;
|
|
26
|
+
}
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (inStr) {
|
|
30
|
+
out += c;
|
|
31
|
+
if (c === "\\") {
|
|
32
|
+
out += n ?? "";
|
|
33
|
+
i++;
|
|
34
|
+
} else if (c === "\"") inStr = false;
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
if (c === "\"") {
|
|
38
|
+
inStr = true;
|
|
39
|
+
out += c;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (c === "/" && n === "/") {
|
|
43
|
+
inLine = true;
|
|
44
|
+
i++;
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (c === "/" && n === "*") {
|
|
48
|
+
inBlock = true;
|
|
49
|
+
i++;
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
out += c;
|
|
53
|
+
}
|
|
54
|
+
let res = "", inS = false;
|
|
55
|
+
for (let i = 0; i < out.length; i++) {
|
|
56
|
+
const c = out[i];
|
|
57
|
+
if (inS) {
|
|
58
|
+
res += c;
|
|
59
|
+
if (c === "\\") {
|
|
60
|
+
res += out[i + 1] ?? "";
|
|
61
|
+
i++;
|
|
62
|
+
} else if (c === "\"") inS = false;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (c === "\"") {
|
|
66
|
+
inS = true;
|
|
67
|
+
res += c;
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (c === ",") {
|
|
71
|
+
let j = i + 1;
|
|
72
|
+
while (j < out.length && /\s/.test(out[j])) j++;
|
|
73
|
+
if (out[j] === "}" || out[j] === "]") continue;
|
|
74
|
+
}
|
|
75
|
+
res += c;
|
|
76
|
+
}
|
|
77
|
+
return res;
|
|
78
|
+
}
|
|
79
|
+
function detectHost(root) {
|
|
80
|
+
const pkg = readJson(join(root, "package.json")) ?? {};
|
|
81
|
+
const deps = {
|
|
82
|
+
...pkg.dependencies,
|
|
83
|
+
...pkg.devDependencies
|
|
84
|
+
};
|
|
85
|
+
const twRange = deps["tailwindcss"];
|
|
86
|
+
const tailwind = !twRange ? null : /(^|[^\d])4\./.test(twRange) || twRange.startsWith("^4") || twRange.startsWith("~4") ? 4 : 3;
|
|
87
|
+
const router = deps["next"] ? "next" : deps["react-router"] || deps["react-router-dom"] ? "react-router" : null;
|
|
88
|
+
const routerPkg = deps["react-router-dom"] ? "react-router-dom" : "react-router";
|
|
89
|
+
const toaster = deps["sonner"] ? "sonner" : deps["react-hot-toast"] ? "react-hot-toast" : null;
|
|
90
|
+
let shadcn = null;
|
|
91
|
+
const comp = readJson(join(root, "components.json"));
|
|
92
|
+
if (comp?.tailwind?.css) shadcn = {
|
|
93
|
+
themeCss: comp.tailwind.css,
|
|
94
|
+
uiAlias: comp.aliases?.ui ?? "@/components/ui"
|
|
95
|
+
};
|
|
96
|
+
const themeCss = shadcn?.themeCss && existsSync(join(root, shadcn.themeCss)) ? shadcn.themeCss : firstExisting(root, [
|
|
97
|
+
"src/index.css",
|
|
98
|
+
"src/styles/theme.css",
|
|
99
|
+
"src/styles/globals.css",
|
|
100
|
+
"src/app/globals.css",
|
|
101
|
+
"app/globals.css",
|
|
102
|
+
"src/globals.css",
|
|
103
|
+
"src/style.css",
|
|
104
|
+
"styles/globals.css"
|
|
105
|
+
]);
|
|
106
|
+
const ts = readJson(join(root, "tsconfig.json"));
|
|
107
|
+
const include = ts?.include;
|
|
108
|
+
const exclude = ts?.exclude ?? [];
|
|
109
|
+
const sweeps = ts != null && !exclude.some((e) => e === "design" || e.startsWith("design/")) && (!include || include.some((i) => i === "." || i.startsWith("**") || i.startsWith("design")));
|
|
110
|
+
return {
|
|
111
|
+
tailwind,
|
|
112
|
+
router,
|
|
113
|
+
routerPkg,
|
|
114
|
+
toaster,
|
|
115
|
+
shadcn,
|
|
116
|
+
themeCss,
|
|
117
|
+
tsconfigSweepsDesign: !!sweeps
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function firstExisting(root, candidates) {
|
|
121
|
+
for (const c of candidates) if (existsSync(join(root, c))) return c;
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
export { readJson as n, detectHost as t };
|