@marver-design/marver 0.24.0 → 0.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/README.md +1 -1
- package/dist/anchor-DVV732zR.mjs +33 -0
- package/dist/anchor-check-DGZnYviN.mjs +135 -0
- package/dist/{bake-ZhXq-X9f.mjs → bake-BpxMZfij.mjs} +45 -6
- package/dist/{boards-BRLnoTC3.mjs → board-tree-DRioF94d.mjs} +21 -277
- package/dist/boards-CGg6piKF.mjs +342 -0
- package/dist/{boards-Dv-Ipd8G.mjs → boards-Csxj2WJn.mjs} +23 -9
- package/dist/{build-ckcinlWH.mjs → build-DKaGhoVN.mjs} +63 -37
- package/dist/cli.mjs +31 -17
- package/dist/{collab-mAiNZlDj.mjs → collab-gqNdScUE.mjs} +39 -9
- package/dist/{comments-DZyobpxG.mjs → comments-Zoch254k.mjs} +19 -1
- package/dist/{comments-Dx1hCVOT.mjs → comments-pTLlhjh4.mjs} +150 -20
- package/dist/{config-BUKprFAp.mjs → config-cKgZBRj0.mjs} +1 -1
- package/dist/{context-BncTXjLB.mjs → context-D2ugHqwO.mjs} +17 -123
- package/dist/{daemon-CQv73-jM.mjs → daemon-Cl8KXGW4.mjs} +146 -64
- package/dist/{dev-gv4NS6Fk.mjs → dev-Diqx1Rt8.mjs} +23 -11
- package/dist/{events-B3LBn74P.mjs → events-DnK_AnrW.mjs} +13 -15
- package/dist/imports-WBSnnHLb.mjs +143 -0
- package/dist/{init--3Moc4J7.mjs → init-DO4DhUt_.mjs} +28 -6
- package/dist/link-C-qUIuKU.mjs +160 -0
- package/dist/{board-status-BZSzc9Hp.mjs → manifest-DnAte_fB.mjs} +537 -13
- package/dist/marks-DFuintmJ.mjs +50 -0
- package/dist/marks-koRsbHfe.mjs +397 -0
- package/dist/{marver-id-gate-B_idGdHm.mjs → marver-id-gate-DGANtVyC.mjs} +2 -2
- package/dist/perf-CCisg-ny.mjs +49 -0
- package/dist/perf-QJIWtTw1.mjs +68 -0
- package/dist/{plugin-Sa08E7wO.mjs → plugin-dTF5reck.mjs} +425 -207
- package/dist/{poster-B2QPvKOq.mjs → poster-D-zjYpgk.mjs} +1 -1
- package/dist/{profile-CrZohD6g.mjs → profile-Do0nGkXO.mjs} +1 -1
- package/dist/{publish-bakes-BJR3huhu.mjs → publish-bakes-C_9VZ-Mq.mjs} +9 -9
- package/dist/{serve-z5qtj_wJ.mjs → serve-wv2QWdxB.mjs} +6 -6
- package/dist/{share-BD-wcDQq.mjs → share-ScamJcks.mjs} +1 -1
- package/dist/{shot-Cw96h5Kk.mjs → shot-CUlmkqFX.mjs} +19 -11
- package/dist/{shot-Dh6fV1Lm.mjs → shot-jdO_B6Qw.mjs} +1 -1
- package/dist/{summary-C7CAypbB.mjs → summary-CrW88e3q.mjs} +1 -1
- package/dist/{sync-DoA1vf4u.mjs → sync-C3035OnJ.mjs} +18 -8
- package/dist/{work-CBUfsOOT.mjs → work-CpJn1gwY.mjs} +8 -4
- package/dist/{work-ayuL_9Kk.mjs → work-GE88wb_3.mjs} +4 -4
- package/docs/boards-and-folders.md +62 -21
- package/docs/live-jam.md +10 -5
- package/package.json +1 -1
- package/src/client/frame-host/bridge.js +2 -1
- package/src/client/frame-host/inspect.js +195 -84
- package/src/client/frame-host/main.tsx +7 -2
- package/src/client/frame-host/registry.ts +5 -5
- package/src/client/shell/App.tsx +66 -22
- package/src/client/shell/BoardList.tsx +54 -11
- package/src/client/shell/Comments.tsx +79 -34
- package/src/client/shell/ContextMenu.tsx +5 -2
- package/src/client/shell/LockedApp.tsx +45 -12
- package/src/client/shell/Play.tsx +35 -34
- package/src/client/shell/Toolbar.tsx +3 -1
- package/src/client/shell/canvas/Canvas.tsx +1 -1
- package/src/client/shell/canvas/FrameNode.tsx +10 -5
- package/src/client/shell/canvas/sleep.ts +23 -4
- package/src/client/shell/canvas/updates.ts +55 -0
- package/src/client/shell/comments-store.ts +48 -19
- package/src/client/shell/goto.ts +11 -14
- package/src/client/shell/hash.ts +12 -5
- package/src/client/shell/icons.tsx +1 -2
- package/src/client/shell/legacy-links.ts +67 -0
- package/src/client/shell/marks-ui.tsx +17 -19
- package/src/client/shell/pin-layout.ts +37 -0
- package/src/client/shell/store.ts +312 -92
- package/src/client/shell/styles.css +10 -8
- package/src/client/stage/main.tsx +19 -2
- package/src/shared/anchor.ts +57 -0
- package/src/shared/board-tree.ts +27 -10
- package/src/shared/events.ts +19 -10
- package/src/shared/marks.ts +17 -12
- package/templates/AGENTS-embedded.md +34 -15
- package/templates/AGENTS-studio.md +34 -15
- package/templates/instructions/boards.md +9 -5
- package/templates/instructions/iterate.md +20 -10
- package/templates/instructions/jam.md +13 -4
- package/templates/instructions/publish.md +2 -1
- package/templates/instructions/reference/deck-story.md +2 -2
- package/dist/link-vXjxMHTG.mjs +0 -132
- package/dist/manifest-cyG3kbhk.mjs +0 -528
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { capture, t as findChrome } from "./shot-
|
|
1
|
+
import { capture, t as findChrome } from "./shot-CUlmkqFX.mjs";
|
|
2
2
|
import { constants, copyFileSync, existsSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { basename, dirname, join, sep } from "node:path";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as slideSize } from "./cli.mjs";
|
|
2
|
-
import { planShot, t as findChrome } from "./shot-
|
|
3
|
-
import { ASK_MAX, bakeBatch } from "./bake-
|
|
4
|
-
import { MIME } from "./serve-
|
|
2
|
+
import { planShot, t as findChrome } from "./shot-CUlmkqFX.mjs";
|
|
3
|
+
import { ASK_MAX, bakeBatch } from "./bake-BpxMZfij.mjs";
|
|
4
|
+
import { MIME } from "./serve-wv2QWdxB.mjs";
|
|
5
5
|
import { copyFileSync, lstatSync, mkdirSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { extname, isAbsolute, join, relative, resolve } from "node:path";
|
|
7
7
|
import { createServer } from "node:http";
|
|
@@ -23,10 +23,10 @@ import { createServer } from "node:http";
|
|
|
23
23
|
/** The shell's plain key for an ask (sleep.ts keyOf): frame|theme|w|h. */
|
|
24
24
|
const indexKey = (a) => `${a.frame}|${a.theme}|${Math.round(a.w)}|${Math.round(a.h)}`;
|
|
25
25
|
/** Every (frame, theme, size) a visitor can rest on: each published board's nodes, sized the way
|
|
26
|
-
* the shell sizes them (the node's own size, else the frame's default), each theme;
|
|
27
|
-
* `
|
|
26
|
+
* the shell sizes them (the node's own size, else the frame's default), each theme; a published
|
|
27
|
+
* `auto` board shows every frame - each at its default size. Sizes are rounded first, then held to
|
|
28
28
|
* the compiler's limits: an oversize node is skipped, never clamped to a document of another size. */
|
|
29
|
-
function publishedAsks(boards, themes, frames, viewports,
|
|
29
|
+
function publishedAsks(boards, themes, frames, viewports, autoBoard = false) {
|
|
30
30
|
const byId = new Map(frames.map((f) => [f.id, f]));
|
|
31
31
|
const seen = /* @__PURE__ */ new Map();
|
|
32
32
|
const add = (frame, w, h) => {
|
|
@@ -62,7 +62,7 @@ function publishedAsks(boards, themes, frames, viewports, allScenes = false) {
|
|
|
62
62
|
const s = f && size(f, n);
|
|
63
63
|
if (s) add(f.id, s.w, s.h);
|
|
64
64
|
}
|
|
65
|
-
if (
|
|
65
|
+
if (autoBoard) for (const f of frames) {
|
|
66
66
|
const s = size(f);
|
|
67
67
|
if (s) add(f.id, s.w, s.h);
|
|
68
68
|
}
|
|
@@ -125,10 +125,10 @@ function serveDir(dir) {
|
|
|
125
125
|
/** Compile the published boards' frames against the built site and ship the textures with it.
|
|
126
126
|
* Returns null when there is no Chrome to compile with. */
|
|
127
127
|
async function bakePublished(opts) {
|
|
128
|
-
const { root, outDir, gen, boards, themes, frames, viewports,
|
|
128
|
+
const { root, outDir, gen, boards, themes, frames, viewports, autoBoard, urlFor, log } = opts;
|
|
129
129
|
if (!findChrome()) return null;
|
|
130
130
|
const t0 = Date.now();
|
|
131
|
-
const asks = publishedAsks(boards, themes, frames, viewports,
|
|
131
|
+
const asks = publishedAsks(boards, themes, frames, viewports, autoBoard).filter((a) => urlFor(a.frame, a.theme));
|
|
132
132
|
const stats = {
|
|
133
133
|
asked: asks.length,
|
|
134
134
|
asleep: 0,
|
|
@@ -75,9 +75,9 @@ async function serve(root, portFlag) {
|
|
|
75
75
|
* accounts get in. Null when there is no roster to consult. */
|
|
76
76
|
let guestDoorOpen = null;
|
|
77
77
|
if (process.env.MARVER_DATA_DIR) {
|
|
78
|
-
const { collabHandler } = await import("./collab-
|
|
79
|
-
const { appendEvents, readLog } = await import("./comments-
|
|
80
|
-
const { dataDir } = await import("./comments-
|
|
78
|
+
const { collabHandler } = await import("./collab-gqNdScUE.mjs");
|
|
79
|
+
const { appendEvents, readLog } = await import("./comments-Zoch254k.mjs").then((n) => n.n);
|
|
80
|
+
const { dataDir } = await import("./comments-Zoch254k.mjs").then((n) => n.n);
|
|
81
81
|
const dir = dataDir();
|
|
82
82
|
for (const seedDir of [join(root, "design", ".dist-seeds"), join(dist, "design", "comments")]) {
|
|
83
83
|
if (!existsSync(seedDir)) continue;
|
|
@@ -147,8 +147,8 @@ async function serve(root, portFlag) {
|
|
|
147
147
|
console.error(`[${NAME}] MARVER_ID_ISSUER is set but MARVER_PUBLIC_ORIGIN is not.\n Every assertion is bound to this canvas's exact origin, and it cannot be\n inferred from request headers - a proxy can make any request look local.\n Set it to the origin people actually reach this canvas on:\n MARVER_PUBLIC_ORIGIN=https://canvas.example.com\n MARVER_PUBLIC_ORIGIN=http://localhost:${portFlag ?? (Number(process.env.PORT) || 4199)} (development)`);
|
|
148
148
|
process.exit(1);
|
|
149
149
|
}
|
|
150
|
-
const { marverIdHandler } = await import("./marver-id-gate-
|
|
151
|
-
const { dataDir } = await import("./comments-
|
|
150
|
+
const { marverIdHandler } = await import("./marver-id-gate-DGANtVyC.mjs");
|
|
151
|
+
const { dataDir } = await import("./comments-Zoch254k.mjs").then((n) => n.n);
|
|
152
152
|
const canvasName = humanName(meta.name);
|
|
153
153
|
const { ceilingsFromRights } = await import("./auth-DdUKeVKt.mjs").then((n) => n.R);
|
|
154
154
|
idHandler = marverIdHandler(dataDir(), idIssuer, canvasName, meta.branding, ceilingsFromRights(meta.rights ?? {}));
|
|
@@ -170,7 +170,7 @@ async function serve(root, portFlag) {
|
|
|
170
170
|
if (collab) {
|
|
171
171
|
const { ensureShare, reclampShare, ceilingsFromRights } = await import("./auth-DdUKeVKt.mjs").then((n) => n.R);
|
|
172
172
|
const { loadStore } = await import("./auth-DdUKeVKt.mjs").then((n) => n.r);
|
|
173
|
-
const { dataDir } = await import("./comments-
|
|
173
|
+
const { dataDir } = await import("./comments-Zoch254k.mjs").then((n) => n.n);
|
|
174
174
|
const dir = dataDir();
|
|
175
175
|
const ceilings = ceilingsFromRights(meta.rights ?? {});
|
|
176
176
|
const mode = idIssuer ? "private" : verifier ? "password" : "public";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as NAME } from "./cli.mjs";
|
|
2
2
|
import { M as resolveAccess } from "./auth-DdUKeVKt.mjs";
|
|
3
|
-
import { i as loadCollab } from "./sync-
|
|
3
|
+
import { i as loadCollab } from "./sync-C3035OnJ.mjs";
|
|
4
4
|
//#region src/cli/share.ts
|
|
5
5
|
/**
|
|
6
6
|
* `marver share <action>` - the roster from the terminal (01-sharing §9).
|
|
@@ -326,19 +326,15 @@ async function shootFrame(opts) {
|
|
|
326
326
|
ok: false,
|
|
327
327
|
error: "invalid scale"
|
|
328
328
|
};
|
|
329
|
-
|
|
330
|
-
try {
|
|
331
|
-
manifest = JSON.parse(readFileSync(join(root, "design", "manifest.json"), "utf8"));
|
|
332
|
-
} catch {}
|
|
333
|
-
const frame = (manifest.frames ?? []).find((f) => f.id === frameId);
|
|
329
|
+
const frame = manifestFrame(root, frameId);
|
|
334
330
|
if (!frame) return {
|
|
335
331
|
ok: false,
|
|
336
332
|
error: `unknown frame "${frameId}" - ids are in design/manifest.json`
|
|
337
333
|
};
|
|
338
334
|
const plan = planShot(frame, viewports, size);
|
|
339
335
|
if (frame.kind !== "html") try {
|
|
340
|
-
const { scanAssetRefs } = await import("./build-
|
|
341
|
-
const { ensurePoster } = await import("./poster-
|
|
336
|
+
const { scanAssetRefs } = await import("./build-DKaGhoVN.mjs");
|
|
337
|
+
const { ensurePoster } = await import("./poster-D-zjYpgk.mjs");
|
|
342
338
|
const refs = scanAssetRefs(readFileSync(join(root, frame.file), "utf8"), frame.file);
|
|
343
339
|
for (const r of refs) if (r.endsWith(".poster.png")) await ensurePoster(join(root, "design", "assets"), r.slice(0, -11));
|
|
344
340
|
} catch {}
|
|
@@ -352,7 +348,7 @@ async function shootFrame(opts) {
|
|
|
352
348
|
};
|
|
353
349
|
const tmp = join(shotsDir, `.${slug(frameId)}--${theme}.${randomBytes(6).toString("hex")}.tmp.png`);
|
|
354
350
|
const req = {
|
|
355
|
-
url:
|
|
351
|
+
url: frameUrl(origin, frame, theme),
|
|
356
352
|
width: plan.width,
|
|
357
353
|
height: plan.initialHeight,
|
|
358
354
|
out: tmp,
|
|
@@ -392,6 +388,17 @@ async function shootFrame(opts) {
|
|
|
392
388
|
...result.note ? { note: result.note } : {}
|
|
393
389
|
};
|
|
394
390
|
}
|
|
391
|
+
function manifestFrame(root, frameId) {
|
|
392
|
+
let manifest = {};
|
|
393
|
+
try {
|
|
394
|
+
manifest = JSON.parse(readFileSync(join(root, "design", "manifest.json"), "utf8"));
|
|
395
|
+
} catch {}
|
|
396
|
+
return (manifest.frames ?? []).find((f) => f.id === frameId) ?? null;
|
|
397
|
+
}
|
|
398
|
+
/** The URL a frame renders at on its own: an HTML frame is its file, a TSX frame the frame host. */
|
|
399
|
+
const frameUrl = (origin, frame, theme) => frame.kind === "html" ? `${origin}/${frame.file}?theme=${encodeURIComponent(theme)}` : `${origin}${ROUTE}/frame/?id=${encodeURIComponent(frame.id)}&theme=${encodeURIComponent(theme)}`;
|
|
400
|
+
/** True once the frame has mounted: #root (or the body, for an HTML frame) has children. */
|
|
401
|
+
const MOUNTED = `(() => { const el = document.getElementById('root') ?? document.body; return !!el && el.childElementCount > 0 && document.readyState !== 'loading' })()`;
|
|
395
402
|
/** Turn a selector into the ordered list of frame ids to shoot, or an error with the HTTP
|
|
396
403
|
* status it deserves. Ids the manifest does not know are kept (each fails its own entry);
|
|
397
404
|
* duplicates, an empty or oversize list, and a scene nobody belongs to are refused whole. */
|
|
@@ -610,7 +617,8 @@ function sweepTemps(dir) {
|
|
|
610
617
|
* or left idle. Operations on a lane queue as shots always did, so two operations never
|
|
611
618
|
* write the same output at the same time. Posters have their own lane - a frame being shot
|
|
612
619
|
* may ask for its poster mid-render, and on the shot's lane that request would wait for the
|
|
613
|
-
* very shot that is waiting for it
|
|
620
|
+
* very shot that is waiting for it - and so do anchor checks, which have a deadline of their
|
|
621
|
+
* own and must not wait out a batch of shots. */
|
|
614
622
|
const chains = /* @__PURE__ */ new Map();
|
|
615
623
|
function withBrowser(lane, fn) {
|
|
616
624
|
const run = async () => {
|
|
@@ -713,7 +721,7 @@ async function captureIn({ url, width, height, out, fullHeight = false, timeoutM
|
|
|
713
721
|
let ready = false;
|
|
714
722
|
while (Date.now() - t0 < timeoutMs) {
|
|
715
723
|
if ((await send("Runtime.evaluate", {
|
|
716
|
-
expression:
|
|
724
|
+
expression: MOUNTED,
|
|
717
725
|
returnByValue: true
|
|
718
726
|
}, sessionId).catch(() => null))?.result?.value) {
|
|
719
727
|
ready = true;
|
|
@@ -930,4 +938,4 @@ async function captureIn({ url, width, height, out, fullHeight = false, timeoutM
|
|
|
930
938
|
}
|
|
931
939
|
}
|
|
932
940
|
//#endregion
|
|
933
|
-
export { AREA, SURFACE, capture, planShot, pool, resolveFrames, shootBatch, shootFrame, shotConcurrency, sweepGhosts, findChrome as t, withBrowser };
|
|
941
|
+
export { AREA, MOUNTED, SURFACE, capture, frameUrl, manifestFrame, planShot, pool, resolveFrames, shootBatch, shootFrame, shotConcurrency, sweepGhosts, findChrome as t, withBrowser };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as NAME } from "./cli.mjs";
|
|
2
|
-
import { i as readDevInfo } from "./work-
|
|
2
|
+
import { i as readDevInfo } from "./work-GE88wb_3.mjs";
|
|
3
3
|
//#region src/cli/shot.ts
|
|
4
4
|
/**
|
|
5
5
|
* `marver shot <scene/frame> [...]`, `--scene <name>`, `--all` - render frames headless and
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as replay } from "./events-DnK_AnrW.mjs";
|
|
2
2
|
import { x as withLock } from "./auth-DdUKeVKt.mjs";
|
|
3
3
|
import { closeSync, fsyncSync, openSync, readFileSync, renameSync, writeSync } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { n as diffEvents } from "./events-DnK_AnrW.mjs";
|
|
3
|
+
import { a as readLog, i as listBoards, t as appendEvents } from "./comments-Zoch254k.mjs";
|
|
4
4
|
import { t as CLI_TOKEN_CHARS } from "./auth-DdUKeVKt.mjs";
|
|
5
5
|
import { chmodSync, closeSync, existsSync, mkdirSync, openSync, readFileSync, realpathSync, renameSync, unlinkSync, writeSync } from "node:fs";
|
|
6
6
|
import { join } from "node:path";
|
|
@@ -135,12 +135,17 @@ async function syncOnce(root, collab) {
|
|
|
135
135
|
const bres = await fetch(`${base}/__mv/api/boards`, { headers: auth });
|
|
136
136
|
if (bres.status === 401) throw new Error("the connect token was rejected - run `comments connect` again");
|
|
137
137
|
if (!bres.ok) throw new Error(`published canvas answered ${bres.status} - is it up?`);
|
|
138
|
-
const { rights } = await bres.json();
|
|
139
|
-
const boards = [.../* @__PURE__ */ new Set([
|
|
138
|
+
const { rights, legacy } = await bres.json();
|
|
139
|
+
const boards = [.../* @__PURE__ */ new Set([
|
|
140
|
+
...Object.keys(rights),
|
|
141
|
+
...listBoards(dir),
|
|
142
|
+
...legacy ? [legacy.board] : []
|
|
143
|
+
])];
|
|
140
144
|
const out = {};
|
|
141
145
|
const failures = [];
|
|
142
146
|
for (const board of boards) {
|
|
143
|
-
|
|
147
|
+
const old = legacy?.board === board;
|
|
148
|
+
if (!(board in rights) && !old) continue;
|
|
144
149
|
const res = await fetch(`${base}/__mv/api/comments/${board}`, { headers: auth });
|
|
145
150
|
if (!res.ok) {
|
|
146
151
|
failures.push(`${board}: pull ${res.status}`);
|
|
@@ -149,10 +154,11 @@ async function syncOnce(root, collab) {
|
|
|
149
154
|
const { events: remote } = await res.json();
|
|
150
155
|
const pulled = appendEvents(dir, board, remote).length;
|
|
151
156
|
let pushed = 0;
|
|
152
|
-
if (rights[board] === "comment") {
|
|
157
|
+
if (rights[board] === "comment" || old) {
|
|
153
158
|
const local = readLog(dir, board);
|
|
154
159
|
const marverThreads = localOnlyThreads(local);
|
|
155
|
-
const
|
|
160
|
+
const shipped = old ? threadIds(local, (e) => legacy.frames.includes(e.frame ?? "")) : null;
|
|
161
|
+
const missing = diffEvents(local, remote.map((e) => e.id)).filter((e) => !e.agent && !marverThreads.has(threadOf(e)) && (!shipped || shipped.has(threadOf(e))));
|
|
156
162
|
for (let i = 0; i < missing.length; i += 100) {
|
|
157
163
|
const r = await fetch(`${base}/__mv/api/comments/${board}`, {
|
|
158
164
|
method: "POST",
|
|
@@ -303,7 +309,11 @@ const threadOf = (e) => e.parentId ?? e.commentId ?? "";
|
|
|
303
309
|
* that resolves to one - the thread, and each reply in it (an edit or reaction names the reply) - is
|
|
304
310
|
* in the set, so `threadOf` of any event in such a thread hits it. */
|
|
305
311
|
function localOnlyThreads(events) {
|
|
306
|
-
|
|
312
|
+
return threadIds(events, (e) => !!e.agent);
|
|
313
|
+
}
|
|
314
|
+
/** Every id that resolves to a thread whose root passes `root` - the thread, and each reply in it. */
|
|
315
|
+
function threadIds(events, root) {
|
|
316
|
+
const roots = new Set(events.filter((e) => e.type === "create" && e.commentId && root(e)).map((e) => e.commentId));
|
|
307
317
|
const out = new Set(roots);
|
|
308
318
|
for (const e of events) if (e.type === "reply" && e.parentId && roots.has(e.parentId) && e.commentId) out.add(e.commentId);
|
|
309
319
|
return out;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as NAME } from "./cli.mjs";
|
|
2
|
-
import { i as readDevInfo, n as WORK_TTL_MAX, t as WORK_TTL_DEFAULT } from "./work-
|
|
2
|
+
import { i as readDevInfo, n as WORK_TTL_MAX, t as WORK_TTL_DEFAULT } from "./work-GE88wb_3.mjs";
|
|
3
3
|
//#region src/cli/work.ts
|
|
4
4
|
/**
|
|
5
5
|
* `marver work` - the coding agent's hand on the canvas working state.
|
|
6
6
|
*
|
|
7
7
|
* work start <scene/frame ...> [--ttl <minutes>] mark frames actively working
|
|
8
|
-
* work done <scene/frame ...> | --all clear the glow; print the canvas
|
|
8
|
+
* work done <scene/frame ...> | --all clear the glow; print the canvas links to them
|
|
9
9
|
* work list what is glowing right now
|
|
10
10
|
*
|
|
11
11
|
* The intended choreography (taught in design/AGENTS.md): on accepting a request,
|
|
@@ -66,8 +66,12 @@ async function workCommand(root, action, frames, opts) {
|
|
|
66
66
|
});
|
|
67
67
|
console.log(active.length ? `still working: ${active.join(", ")}` : "nothing working - all clear");
|
|
68
68
|
const done = before.filter((f) => !active.includes(f));
|
|
69
|
-
const
|
|
70
|
-
|
|
69
|
+
const { links, hints } = done.length ? await (await import("./link-C-qUIuKU.mjs")).handBack(root, done) : {
|
|
70
|
+
links: [],
|
|
71
|
+
hints: []
|
|
72
|
+
};
|
|
73
|
+
for (const l of links) console.log(`on the canvas: ${l}`);
|
|
74
|
+
for (const h of hints) console.log(`warning: ${h}`);
|
|
71
75
|
return;
|
|
72
76
|
}
|
|
73
77
|
case "list": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import { s as listBoardFiles } from "./boards-
|
|
2
|
+
import { s as listBoardFiles } from "./boards-CGg6piKF.mjs";
|
|
3
3
|
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { randomBytes } from "node:crypto";
|
|
@@ -155,12 +155,12 @@ function onBoardsChanged(fn) {
|
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
157
|
/** The boards that show any of these frames - what the sidebar lights while an agent works (the
|
|
158
|
-
* board's type icon shimmers): every board pinning one, every auto board,
|
|
159
|
-
*
|
|
158
|
+
* board's type icon shimmers): every board pinning one, and every auto board, which holds every
|
|
159
|
+
* frame. Sorted, so an unchanged answer compares equal. */
|
|
160
160
|
function boardsShowing(root, frames) {
|
|
161
161
|
if (!frames.length) return [];
|
|
162
162
|
const ix = indexOf(root);
|
|
163
|
-
const out =
|
|
163
|
+
const out = new Set(ix.auto);
|
|
164
164
|
for (const f of frames) for (const b of ix.byFrame.get(f) ?? []) out.add(b);
|
|
165
165
|
return [...out].sort();
|
|
166
166
|
}
|
|
@@ -22,6 +22,27 @@ Archive
|
|
|
22
22
|
Everything below works the same way at both levels, and the same from the sidebar as from the files
|
|
23
23
|
- so a person arranging boards by hand and an agent arranging them by writing files always agree.
|
|
24
24
|
|
|
25
|
+
## Every frame on a board
|
|
26
|
+
|
|
27
|
+
There is no board that holds everything (0.25 retired All Scenes). One rule instead: **every frame
|
|
28
|
+
goes on the board it belongs to - its feature, its spec, its flow - and a frame that belongs to two
|
|
29
|
+
goes on both.** A board shows the frames its nodes hold, or every frame when it says `"auto": true`.
|
|
30
|
+
|
|
31
|
+
- `npx marver boards pin <board> <scene/frame | scene ...>` puts frames on a board (appended as
|
|
32
|
+
nodes, the ones it already shows skipped).
|
|
33
|
+
- A frame on no board is never lost: the sidebar shows **Not on a board** when there are some - a
|
|
34
|
+
temporary view of just those frames, never saved, where right-click a frame's row, **Add to
|
|
35
|
+
board…**, puts it on one. Comments need a board to live on, so new ones are off there. The dev log
|
|
36
|
+
and `npx marver boards` list them too.
|
|
37
|
+
- `work done` still clears the glow for a frame on no board, and warns with where its scene's other
|
|
38
|
+
frames live; `comments new` refuses it until it is pinned.
|
|
39
|
+
- A fresh `marver init` puts its demo on a `welcome` board. A canvas with no board shows "No boards
|
|
40
|
+
yet - ask your agent to make one".
|
|
41
|
+
- Old `#/b/all-scenes` links still land: on the board that shows their frame (or most of their
|
|
42
|
+
frames, with a notice naming where the rest are). A leftover `design/boards/all-scenes.json` is set
|
|
43
|
+
aside - the dev log says once that it can go - and its threads keep working, published too, where
|
|
44
|
+
some published board shows their frame. `all-scenes` in `publish.json` is dropped with a warning.
|
|
45
|
+
|
|
25
46
|
## In the sidebar
|
|
26
47
|
|
|
27
48
|
- **New folder** - right-click the Boards header, or its `+`. Name it inline: what you type is its
|
|
@@ -49,24 +70,43 @@ The sidebar shows where to look.
|
|
|
49
70
|
|
|
50
71
|
- **New** - a frame that changed since you looked: its icon and title turn blue, with a dot at the
|
|
51
72
|
right of its row. On the canvas, its title above the card does the same.
|
|
52
|
-
- **
|
|
53
|
-
asks)
|
|
54
|
-
`1`, `2`. Answer in the thread and the bubble goes
|
|
55
|
-
the thread is resolved, and the frame turns blue if
|
|
73
|
+
- **Waiting on you** - Marver is waiting on you on a frame: a question (a note from your agent, or
|
|
74
|
+
a reply that asks), or work to review and resolve. Its icon turns orange, and an orange bubble at
|
|
75
|
+
the right holds how many threads are open - `1`, `2`. Answer in the thread and the bubble goes
|
|
76
|
+
hollow while the agent works; it is gone once the thread is resolved, and the frame turns blue if
|
|
77
|
+
the agent changed it.
|
|
56
78
|
- **One slot per row.** Every row keeps the one item at its right edge it has today, and what matters
|
|
57
|
-
most takes it:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
- **`U`** goes to the next frame that
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
79
|
+
most takes it: the bubble first, then the row's own count or status, then a frame's dot. A board
|
|
80
|
+
you are not on turns blue when its frames hold something new, and the bubble takes its status
|
|
81
|
+
glyph's place until answered. A closed folder or a folded scene changes only its count: blue when
|
|
82
|
+
something inside is new, the bubble when something inside waits on you.
|
|
83
|
+
- **`U`** goes to the next frame that asks you something, then the next one waiting on you, then the
|
|
84
|
+
next new one.
|
|
85
|
+
|
|
86
|
+
"Changed" means the frame or anything it reads changed - its file, its sticky note, a kit or a
|
|
87
|
+
spec's markdown it imports, a layout or the providers around it; an edit, your agent, a `git pull`
|
|
88
|
+
(even while `marver dev` was off) - or an agent named the frame in `npx marver work done`. A file
|
|
89
|
+
every frame reads lights every frame; **Mark all as seen** on the board clears them.
|
|
90
|
+
|
|
91
|
+
"Looked at" means you selected it, opened it from the sidebar or a link, opened it in focus or play,
|
|
92
|
+
kept it on screen at a readable zoom (50 % or more) for two seconds, or chose **Mark all as seen** on
|
|
93
|
+
a scene, board or folder - for the version on screen: a change still loading (or behind **Update** in
|
|
94
|
+
focus or play) stays new until its new version shows, and a look you made while it loaded counts as
|
|
95
|
+
soon as it does.
|
|
96
|
+
|
|
97
|
+
The marks start when `marver dev` starts, so whatever your agent makes before you open the canvas is
|
|
98
|
+
new when you do; everything already there the first time counts as seen. They live in
|
|
99
|
+
`design/.local/`, on this machine only, and a published canvas shows none. `npx marver marks` prints
|
|
100
|
+
them - for you, or for your agent at the start of a session.
|
|
101
|
+
|
|
102
|
+
## Edits land calmly
|
|
103
|
+
|
|
104
|
+
When a file changes, the canvas reloads only the frames that read it, a few at a time, the ones on
|
|
105
|
+
screen first; a frame off screen waits until you scroll to it, and one you are using (typing in it,
|
|
106
|
+
drawing a laser, commenting) waits until you are done. A content frame keeps its height while it
|
|
107
|
+
reloads, so the rows below stay still; if heights did change, the board moves once. The canvas page
|
|
108
|
+
itself never reloads for a design edit. `npx marver perf` shows what each edit reloaded and how long
|
|
109
|
+
it took (from `design/.local/perf/reloads.jsonl`).
|
|
70
110
|
|
|
71
111
|
## In the files
|
|
72
112
|
|
|
@@ -216,11 +256,12 @@ person's drag never silently erase each other.
|
|
|
216
256
|
|
|
217
257
|
`npx marver link <scene/frame | scene ...>` prints the canvas link that lands on those frames: the
|
|
218
258
|
board they sit on, in canvas mode, with them selected and the camera fitted to them - not the
|
|
219
|
-
full-screen focus view. The board is the first in sidebar order that shows them all
|
|
220
|
-
|
|
259
|
+
full-screen focus view. The board is the first in sidebar order that shows them all (archive boards
|
|
260
|
+
last); frames that sit on several boards get one link per board, and a frame on no board gets a hint
|
|
261
|
+
instead of a link. `--board` picks one. The link reads `#/b/<board>?f=<scene/frame>,...` (or
|
|
221
262
|
`?s=<scene>` for a whole scene), and a link naming a frame its board does not show follows the
|
|
222
|
-
frame to where it lives. `npx marver work done` prints the same
|
|
223
|
-
agent's reply ends with
|
|
263
|
+
frame to where it lives. `npx marver work done` prints the same links for the frames it clears, so an
|
|
264
|
+
agent's reply ends with them. A focus link (`#/f/<frame>`) opened on your dev canvas now has its way
|
|
224
265
|
back to the canvas (the grid button, or Esc); on a published canvas a focus link stays a page of
|
|
225
266
|
its own.
|
|
226
267
|
|
package/docs/live-jam.md
CHANGED
|
@@ -155,12 +155,17 @@ harness without a model rather than a guessed one.
|
|
|
155
155
|
## Notes from your chat agent
|
|
156
156
|
|
|
157
157
|
Live Jam answers comments; the same voice works the other way. An agent you are chatting with leaves
|
|
158
|
-
a note where it needs you - `npx marver comments new <scene/frame> --body "..."
|
|
159
|
-
screen>"
|
|
160
|
-
|
|
158
|
+
a note where it needs you - `npx marver comments new <scene/frame> --body "..." --on "<words on
|
|
159
|
+
screen>"` pins it on the element showing those words (`--at "<data-testid or selector>"` for one
|
|
160
|
+
without words) - and answers your threads with `npx marver comments reply`. With `marver dev`
|
|
161
|
+
running the note is checked in the rendered frame first: words the frame does not show are
|
|
162
|
+
refused with what it does show, and several matches need `--nth`. A follow-up joins its thread
|
|
163
|
+
(`comments new --thread <id>`), and a misplaced note moves (`comments move <thread> --on ...`).
|
|
164
|
+
Notes and replies post as Marver, with the same provenance, land on your canvas
|
|
161
165
|
at once, and raise the bottom-right pill with a ping - Marver's replies on one board fold into a
|
|
162
|
-
single notice ("2 replies", View walks through them), a
|
|
163
|
-
|
|
166
|
+
single notice ("2 replies", View walks through them), a message that asks (a note, unless the
|
|
167
|
+
agent wrote `--fyi`; a reply with `--ask`; a jam reply opened with ```` ```marver-reply ask ````)
|
|
168
|
+
stands on its own, and the frame wears the orange question
|
|
164
169
|
bubble in the sidebar until the thread is resolved. Reply in a note and it is a jam job like any
|
|
165
170
|
reply to Marver - no tag needed; while the chat agent still has that frame lit (`marver work
|
|
166
171
|
start`), the job waits for it. Notes stay on your machine for now, like jam replies; a reply to a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marver-design/marver",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.1",
|
|
4
4
|
"description": "The agent-native design canvas. A design/ folder, one command, a canvas of live frames built from your repo's real components - comment @marver and your own coding agent does the work. The tool ships no AI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -75,7 +75,8 @@ window.addEventListener('message', (e) => {
|
|
|
75
75
|
if (isHtmlFrame) {
|
|
76
76
|
// stamp the URL revision (see main.tsx) so the shell can drop a ready from a superseded document
|
|
77
77
|
const gen = new URLSearchParams(location.search).get('r') ?? ''
|
|
78
|
-
|
|
78
|
+
// and echo the revision the server stamped this document with (spec 26): what it shows
|
|
79
|
+
const ready = () => post({ type: 'sh:ready', id, gen, doc: document.querySelector('meta[name="mv-doc"]')?.getAttribute('content') ?? '' })
|
|
79
80
|
document.readyState === 'loading' ? addEventListener('DOMContentLoaded', ready) : ready()
|
|
80
81
|
}
|
|
81
82
|
|