@marver-design/marver 0.26.0 → 0.26.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 +54 -0
- package/README.md +2 -2
- package/dist/{anchor-check-Dg5xpNnU.mjs → anchor-check-l-ny3UzH.mjs} +1 -1
- package/dist/{audio-CmSRYFEs.mjs → audio-Dw1lfMdb.mjs} +14 -0
- package/dist/{bake-DtVlm0_F.mjs → bake-C-awKgLA.mjs} +1 -1
- package/dist/{build-C_gUgcdC.mjs → build-BDRiO_mP.mjs} +3 -3
- package/dist/{capture-CrqvU_jh.mjs → capture-vadKjuCo.mjs} +2 -1
- package/dist/cli.mjs +6 -6
- package/dist/{daemon-DZo6o3rU.mjs → daemon-DL6Fwq6D.mjs} +394 -270
- package/dist/{dev-_Nlsc6v9.mjs → dev-Bw_qYWWq.mjs} +24 -11
- package/dist/{marks-NQi0wZJ4.mjs → marks-DyWMv_Z1.mjs} +1 -1
- package/dist/perf-C75MZ73h.mjs +167 -0
- package/dist/perf-jam-BU3TVrZu.mjs +239 -0
- package/dist/{plugin-CTD0rydA.mjs → plugin-DkGmZs_r.mjs} +42 -22
- package/dist/{poster-ChjXGTS5.mjs → poster-BdtSKMDm.mjs} +2 -1
- package/dist/{publish-bakes-CEP_2NRc.mjs → publish-bakes-9RzRToXV.mjs} +2 -2
- package/dist/{queue-BuiCKSX1.mjs → queue-29ok5_eZ.mjs} +2 -2
- package/dist/{session-qZWKt_VA.mjs → session-BAaJsK5c.mjs} +1 -1
- package/dist/{shot-DqcxJibP.mjs → shot-DQeR_Pfn.mjs} +337 -19
- package/dist/shot-XQV7HC9A.mjs +139 -0
- package/dist/speech-worker.mjs +40 -5
- package/docs/jam-session.md +24 -7
- package/docs/live-jam.md +8 -0
- package/package.json +1 -1
- package/src/client/frame-host/inspect.js +8 -3
- package/src/client/frame-host/keys.js +6 -2
- package/src/client/shell/App.tsx +8 -4
- package/src/client/shell/JamSurface.tsx +9 -3
- package/src/client/shell/Play.tsx +11 -7
- package/src/client/shell/Toolbar.tsx +5 -4
- package/src/client/shell/canvas/FrameNode.tsx +3 -2
- package/src/client/shell/icons.tsx +2 -0
- package/src/client/shell/jam-capture.ts +77 -11
- package/src/client/shell/jam-keys.ts +47 -18
- package/src/client/shell/jam-lane.tsx +46 -5
- package/src/client/shell/jam-panel.tsx +63 -13
- package/src/client/shell/jam-state.ts +48 -6
- package/src/client/shell/jam-surface-parts.tsx +10 -6
- package/src/client/shell/store.ts +14 -5
- package/src/client/shell/styles.css +28 -8
- package/src/client/stage/main.tsx +2 -0
- package/templates/instructions/jam.md +5 -3
- package/dist/perf-D6VmmJ2q.mjs +0 -68
- package/dist/shot-CNbHoZ6H.mjs +0 -86
|
@@ -618,6 +618,20 @@ function apiMiddleware(root, opts = {}) {
|
|
|
618
618
|
});
|
|
619
619
|
return json(res, 200, { ok: true });
|
|
620
620
|
}
|
|
621
|
+
if (path === "perf/jam" && req.method === "POST") {
|
|
622
|
+
if (!ownerGated(req)) return json(res, 403, { error: "forbidden" });
|
|
623
|
+
const raw = await readBody(req);
|
|
624
|
+
if (raw == null) return json(res, 400, { error: "body too large or unreadable" });
|
|
625
|
+
let b;
|
|
626
|
+
try {
|
|
627
|
+
b = JSON.parse(raw);
|
|
628
|
+
} catch {
|
|
629
|
+
return json(res, 400, { error: "malformed JSON" });
|
|
630
|
+
}
|
|
631
|
+
if (!b || b.kind !== "capture" && b.kind !== "upload") return json(res, 400, { error: "kind must be capture or upload" });
|
|
632
|
+
(await import("./perf-jam-BU3TVrZu.mjs").then((n) => n.n)).logJam(root, b);
|
|
633
|
+
return json(res, 200, { ok: true });
|
|
634
|
+
}
|
|
621
635
|
if (path === "sizes" && req.method === "GET") {
|
|
622
636
|
const frames = readManifestFrames();
|
|
623
637
|
if (!frames) return json(res, 200, {
|
|
@@ -1025,7 +1039,7 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1025
1039
|
};
|
|
1026
1040
|
const asPng = url.searchParams.get("format") === "png";
|
|
1027
1041
|
const origin = opts.origin?.() ?? `http://${req.headers.host ?? "localhost"}`;
|
|
1028
|
-
const { shootFrame } = await import("./shot-
|
|
1042
|
+
const { shootFrame } = await import("./shot-DQeR_Pfn.mjs");
|
|
1029
1043
|
const r = await shootFrame({
|
|
1030
1044
|
root,
|
|
1031
1045
|
viewports: opts.viewports ?? {},
|
|
@@ -1045,7 +1059,8 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1045
1059
|
scale: r.scale,
|
|
1046
1060
|
...r.truncated ? { truncated: true } : {},
|
|
1047
1061
|
...r.unsettled ? { unsettled: true } : {},
|
|
1048
|
-
...r.note ? { note: r.note } : {}
|
|
1062
|
+
...r.note ? { note: r.note } : {},
|
|
1063
|
+
recaptures: r.recaptures
|
|
1049
1064
|
};
|
|
1050
1065
|
if (!asPng) return json(res, 200, summary);
|
|
1051
1066
|
const png = readFileSync(join(root, r.path));
|
|
@@ -1075,7 +1090,7 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1075
1090
|
if (typeof theme !== "string" || !/^[a-z0-9-]+$/i.test(theme)) return json(res, 400, { error: "invalid theme" });
|
|
1076
1091
|
const scale = body.scale === void 0 ? void 0 : body.scale;
|
|
1077
1092
|
if (scale !== void 0 && !(Number.isInteger(scale) && scale >= 1 && scale <= 4)) return json(res, 400, { error: "invalid scale" });
|
|
1078
|
-
const { resolveFrames, shootBatch } = await import("./shot-
|
|
1093
|
+
const { resolveFrames, shootBatch } = await import("./shot-DQeR_Pfn.mjs");
|
|
1079
1094
|
const sel = resolveFrames(root, body);
|
|
1080
1095
|
if (!sel.ok) return json(res, sel.status, { error: sel.error });
|
|
1081
1096
|
const origin = opts.origin?.() ?? `http://${req.headers.host ?? "localhost"}`;
|
|
@@ -1109,7 +1124,7 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1109
1124
|
if (typeof target === "string") return json(res, 400, { error: target });
|
|
1110
1125
|
const others = Array.isArray(b.others) ? b.others.filter((o) => typeof o?.key === "string").slice(0, 200) : [];
|
|
1111
1126
|
const origin = opts.origin?.() ?? `http://${req.headers.host ?? "localhost"}`;
|
|
1112
|
-
const { checkAnchor, CheckInputError } = await import("./anchor-check-
|
|
1127
|
+
const { checkAnchor, CheckInputError } = await import("./anchor-check-l-ny3UzH.mjs");
|
|
1113
1128
|
try {
|
|
1114
1129
|
return json(res, 200, await checkAnchor({
|
|
1115
1130
|
root,
|
|
@@ -1137,7 +1152,7 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1137
1152
|
return json(res, 400, { error: "malformed JSON" });
|
|
1138
1153
|
}
|
|
1139
1154
|
if (!body || typeof body !== "object" || !Array.isArray(body.asks) || !body.asks.length || body.asks.length > 200) return json(res, 400, { error: "asks must list 1-200 frames" });
|
|
1140
|
-
const { bakeBatch, ASK_MAX } = await import("./bake-
|
|
1155
|
+
const { bakeBatch, ASK_MAX } = await import("./bake-C-awKgLA.mjs");
|
|
1141
1156
|
let manifest = {};
|
|
1142
1157
|
try {
|
|
1143
1158
|
manifest = JSON.parse(readFileSync(join(root, "design", "manifest.json"), "utf8"));
|
|
@@ -1201,8 +1216,8 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1201
1216
|
if (path === "poster" && req.method === "GET") {
|
|
1202
1217
|
if (!ownerGated(req)) return json(res, 403, { error: "forbidden" });
|
|
1203
1218
|
const src = url.searchParams.get("src") ?? "";
|
|
1204
|
-
const { ensurePoster, isLocalClip } = await import("./poster-
|
|
1205
|
-
const { isLocalAssetRef } = await import("./build-
|
|
1219
|
+
const { ensurePoster, isLocalClip } = await import("./poster-BdtSKMDm.mjs");
|
|
1220
|
+
const { isLocalAssetRef } = await import("./build-BDRiO_mP.mjs");
|
|
1206
1221
|
if (!isLocalAssetRef(src) || !isLocalClip(src)) return json(res, 400, { error: "src must be a clip under design/assets/" });
|
|
1207
1222
|
const r = await ensurePoster(join(root, "design", "assets"), src);
|
|
1208
1223
|
if (!r.ok) return json(res, r.error.includes("does not exist") ? 404 : 503, { error: r.error });
|
|
@@ -1367,7 +1382,7 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1367
1382
|
} catch {
|
|
1368
1383
|
return json(res, 400, { error: "malformed JSON" });
|
|
1369
1384
|
}
|
|
1370
|
-
const { ACTIONS } = await import("./queue-
|
|
1385
|
+
const { ACTIONS } = await import("./queue-29ok5_eZ.mjs");
|
|
1371
1386
|
if (!b || typeof b.id !== "string" || !Number.isInteger(b.rev) || !ACTIONS.includes(b.action) || b.body !== void 0 && typeof b.body !== "string") return json(res, 400, { error: "expected { id, rev, action, body? }" });
|
|
1372
1387
|
if ("kind" in b) return json(res, 400, { error: "a capture has no category" });
|
|
1373
1388
|
const { jamLive } = await import("./live-Cgzsicwi.mjs");
|
|
@@ -1377,13 +1392,13 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1377
1392
|
}
|
|
1378
1393
|
if (path === "jam/audio-ticket" && req.method === "POST") {
|
|
1379
1394
|
if (!ownerGated(req)) return json(res, 403, { error: "forbidden" });
|
|
1380
|
-
const { issueTicket, speechLive } = await import("./audio-
|
|
1395
|
+
const { issueTicket, speechLive } = await import("./audio-Dw1lfMdb.mjs");
|
|
1381
1396
|
if (!speechLive.svc) return json(res, 409, { error: "jam is not running here" });
|
|
1382
1397
|
return json(res, 200, { ticket: issueTicket() });
|
|
1383
1398
|
}
|
|
1384
1399
|
if (path === "jam/voice" && (req.method === "GET" || req.method === "POST")) {
|
|
1385
1400
|
if (!ownerGated(req)) return json(res, 403, { error: "forbidden" });
|
|
1386
|
-
const { speechLive } = await import("./audio-
|
|
1401
|
+
const { speechLive } = await import("./audio-Dw1lfMdb.mjs");
|
|
1387
1402
|
const { downloadModels, downloadState, DOWNLOAD_MB } = await import("./speech-models-DomiLQcY.mjs");
|
|
1388
1403
|
if (!speechLive.svc) return json(res, 409, { error: "jam is not running here" });
|
|
1389
1404
|
if (req.method === "POST") {
|
|
@@ -1412,7 +1427,7 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1412
1427
|
if (!jamLive.session || !jamLive.view) return json(res, 409, { error: "jam is not running here" });
|
|
1413
1428
|
if (req.method === "GET") {
|
|
1414
1429
|
const ses = jamLive.view().session ?? null;
|
|
1415
|
-
const { readTalk, talkMinutes, recordFile } = await import("./session-
|
|
1430
|
+
const { readTalk, talkMinutes, recordFile } = await import("./session-BAaJsK5c.mjs").then((n) => n.s);
|
|
1416
1431
|
const folder = ses ? recordFile(root, ses.since, ses.id).replace(/[^/]+$/, "") : null;
|
|
1417
1432
|
return json(res, 200, {
|
|
1418
1433
|
session: ses,
|
|
@@ -1443,7 +1458,7 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1443
1458
|
});
|
|
1444
1459
|
}
|
|
1445
1460
|
if (b.action !== "start") {
|
|
1446
|
-
const { speechLive } = await import("./audio-
|
|
1461
|
+
const { speechLive } = await import("./audio-Dw1lfMdb.mjs");
|
|
1447
1462
|
if (!await (speechLive.svc?.finishTalk(b.id) ?? Promise.resolve(true)).catch(() => false) && b.action === "wrapup" && b.includeTalk !== false) return json(res, 409, {
|
|
1448
1463
|
ok: false,
|
|
1449
1464
|
error: "what was said is still being written down - write the record again in a moment (or leave what was said out)"
|
|
@@ -1505,7 +1520,7 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1505
1520
|
}
|
|
1506
1521
|
if (path === "jam/capture" && req.method === "GET") {
|
|
1507
1522
|
if (!ownerGated(req)) return json(res, 403, { error: "forbidden" });
|
|
1508
|
-
const { readCapture } = await import("./capture-
|
|
1523
|
+
const { readCapture } = await import("./capture-vadKjuCo.mjs").then((n) => n.i);
|
|
1509
1524
|
const id = url.searchParams.get("id") ?? "";
|
|
1510
1525
|
const cap = readCapture(root, id);
|
|
1511
1526
|
if (!cap) return json(res, 404, { error: "no such capture" });
|
|
@@ -1528,11 +1543,11 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1528
1543
|
} catch {
|
|
1529
1544
|
return json(res, 400, { error: "malformed JSON" });
|
|
1530
1545
|
}
|
|
1531
|
-
const { CAPTURE_ID, readCapture, addPicture, sweepPictures } = await import("./capture-
|
|
1546
|
+
const { CAPTURE_ID, readCapture, addPicture, sweepPictures } = await import("./capture-vadKjuCo.mjs").then((n) => n.i);
|
|
1532
1547
|
if (!b || typeof b.capture !== "string" || !CAPTURE_ID.test(b.capture) || typeof b.frame !== "string") return json(res, 400, { error: "expected { capture, frame, theme?, viewport? }" });
|
|
1533
1548
|
if (readCapture(root, b.capture)) return json(res, 409, { error: "that capture is sealed" });
|
|
1534
1549
|
const theme = typeof b.theme === "string" && /^[a-z0-9-]+$/i.test(b.theme) ? b.theme : "light";
|
|
1535
|
-
const { shootFrame } = await import("./shot-
|
|
1550
|
+
const { shootFrame } = await import("./shot-DQeR_Pfn.mjs");
|
|
1536
1551
|
const origin = opts.origin?.() ?? `http://${req.headers.host ?? "localhost"}`;
|
|
1537
1552
|
const vp = typeof b.viewport === "string" ? opts.viewports?.[b.viewport] : void 0;
|
|
1538
1553
|
const dim = (v) => typeof v === "number" && Number.isFinite(v) ? Math.round(v) : void 0;
|
|
@@ -1553,15 +1568,20 @@ function apiMiddleware(root, opts = {}) {
|
|
|
1553
1568
|
});
|
|
1554
1569
|
if (!r.ok) return json(res, r.error.startsWith("unknown frame") ? 404 : 503, { error: r.error });
|
|
1555
1570
|
sweepPictures(root);
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1571
|
+
const unchecked = /not checked for a stale surface/.test(r.note ?? "");
|
|
1572
|
+
return json(res, 200, {
|
|
1573
|
+
id: addPicture(root, r.path, {
|
|
1574
|
+
frame: b.frame,
|
|
1575
|
+
capture: b.capture,
|
|
1576
|
+
...unchecked ? { unchecked: true } : {}
|
|
1577
|
+
}),
|
|
1578
|
+
...unchecked ? { unchecked: true } : {}
|
|
1579
|
+
});
|
|
1560
1580
|
}
|
|
1561
1581
|
if (path === "jam/picture" && req.method === "GET") {
|
|
1562
1582
|
const site = String(req.headers["sec-fetch-site"] ?? "");
|
|
1563
1583
|
if (!ownerGated(req) && !(cookie(req, "mv_c") && (site === "same-origin" || site === "none"))) return json(res, 403, { error: "forbidden" });
|
|
1564
|
-
const { picturePath } = await import("./capture-
|
|
1584
|
+
const { picturePath } = await import("./capture-vadKjuCo.mjs").then((n) => n.i);
|
|
1565
1585
|
const p = picturePath(root, url.searchParams.get("id") ?? "");
|
|
1566
1586
|
if (!p) return json(res, 404, { error: "no such picture" });
|
|
1567
1587
|
const png = readFileSync(p.path);
|
|
@@ -2099,7 +2119,7 @@ function marverPlugin(ctx) {
|
|
|
2099
2119
|
};
|
|
2100
2120
|
const prune = () => setTimeout(async () => {
|
|
2101
2121
|
try {
|
|
2102
|
-
(await import("./bake-
|
|
2122
|
+
(await import("./bake-C-awKgLA.mjs")).pruneBakes(root, bakeGen);
|
|
2103
2123
|
} catch {}
|
|
2104
2124
|
}, 500);
|
|
2105
2125
|
prune();
|
|
@@ -2279,7 +2299,7 @@ function marverPlugin(ctx) {
|
|
|
2279
2299
|
});
|
|
2280
2300
|
return;
|
|
2281
2301
|
}
|
|
2282
|
-
const { shootFrame, shootBatch, resolveFrames } = await import("./shot-
|
|
2302
|
+
const { shootFrame, shootBatch, resolveFrames } = await import("./shot-DQeR_Pfn.mjs");
|
|
2283
2303
|
if (ways[0] === "frame") {
|
|
2284
2304
|
if (typeof spec.frame !== "string") {
|
|
2285
2305
|
write({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { capture, t as findChrome } from "./shot-
|
|
1
|
+
import { capture, t as findChrome } from "./shot-DQeR_Pfn.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";
|
|
@@ -120,6 +120,7 @@ async function ensurePosterNow(assetsDir, src, out) {
|
|
|
120
120
|
ok: false,
|
|
121
121
|
error: `could not render a poster for ${basename(src)} - ${r.error}`
|
|
122
122
|
};
|
|
123
|
+
if (r.note && /not checked for a stale surface/.test(r.note)) console.warn(`[marver] poster ${basename(src)}: ${r.note}`);
|
|
123
124
|
try {
|
|
124
125
|
copyFileSync(tmp, out, constants.COPYFILE_EXCL);
|
|
125
126
|
} catch (err) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as slideSize } from "./cli.mjs";
|
|
2
|
-
import { planShot, t as findChrome } from "./shot-
|
|
3
|
-
import { ASK_MAX, bakeBatch } from "./bake-
|
|
2
|
+
import { planShot, t as findChrome } from "./shot-DQeR_Pfn.mjs";
|
|
3
|
+
import { ASK_MAX, bakeBatch } from "./bake-C-awKgLA.mjs";
|
|
4
4
|
import { MIME } from "./serve-C8rVheYk.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";
|
|
@@ -2,8 +2,8 @@ import { r as pidRuns, t as createExclusive } from "./dev-lock-DWSpa6nj.mjs";
|
|
|
2
2
|
import { r as replay } from "./events-CLH4ijKP.mjs";
|
|
3
3
|
import { a as readLog, i as listBoards } from "./comments-0BSbb04K.mjs";
|
|
4
4
|
import { a as deviceId, r as owned } from "./ledger-D54iROST.mjs";
|
|
5
|
-
import { S as threadId, _ as packetPath, b as sanitize, f as readCapture, h as buildPacket, l as hashOf, m as wordsSince, n as captureFrames, r as captureWords, s as factsOf, u as madeOf } from "./capture-
|
|
6
|
-
import { i as readWrapup, o as recordPathProblem } from "./session-
|
|
5
|
+
import { S as threadId, _ as packetPath, b as sanitize, f as readCapture, h as buildPacket, l as hashOf, m as wordsSince, n as captureFrames, r as captureWords, s as factsOf, u as madeOf } from "./capture-vadKjuCo.mjs";
|
|
6
|
+
import { i as readWrapup, o as recordPathProblem } from "./session-BAaJsK5c.mjs";
|
|
7
7
|
import { closeSync, existsSync, fsyncSync, mkdirSync, openSync, readFileSync, readdirSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
|
|
8
8
|
import { join } from "node:path";
|
|
9
9
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
|
-
import { f as readCapture } from "./capture-
|
|
2
|
+
import { f as readCapture } from "./capture-vadKjuCo.mjs";
|
|
3
3
|
import { appendFileSync, closeSync, existsSync, fsyncSync, lstatSync, mkdirSync, openSync, readFileSync, realpathSync, renameSync, writeSync } from "node:fs";
|
|
4
4
|
import { dirname, join, relative, sep } from "node:path";
|
|
5
5
|
import { createHash, randomBytes } from "node:crypto";
|