@marver-design/marver 0.27.0 → 0.28.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 +195 -0
- package/README.md +9 -4
- package/dist/{anchor-check-ChdDqL5z.mjs → anchor-check-PHUOFj1N.mjs} +1 -1
- package/dist/{audio-Dw1lfMdb.mjs → audio-DX4POHAj.mjs} +39 -4
- package/dist/{board-tree-DRioF94d.mjs → board-tree-BXR8dw4b.mjs} +3 -1
- package/dist/{boards-DlTcpF47.mjs → boards-BeWtjGUM.mjs} +50 -5
- package/dist/boards-EH2onUXM.mjs +995 -0
- package/dist/{build-DZnFysGU.mjs → build-BsAyLMT1.mjs} +9 -22
- package/dist/{capture-vadKjuCo.mjs → capture-DdZ6xgoz.mjs} +92 -30
- package/dist/cli.mjs +56 -21
- package/dist/{collab-Dxg2trOK.mjs → collab-BEAcXrBb.mjs} +1 -1
- package/dist/{comments-DxOkCSNE.mjs → comments-CrBHPEQl.mjs} +4 -4
- package/dist/config-BezZTiov.mjs +182 -0
- package/dist/conn-BMiHS42T.mjs +222 -0
- package/dist/connectors-MR9d-EBP.mjs +290 -0
- package/dist/{context-HQ4Giw58.mjs → context-BUnFiyA3.mjs} +3 -3
- package/dist/{daemon-BSA0lV8d.mjs → daemon-C5dg2R-V.mjs} +2188 -183
- package/dist/{dev-eQJhWsqg.mjs → dev-D7YS7iT2.mjs} +25 -14
- package/dist/{init-COD0x48i.mjs → init-WE5lQkQL.mjs} +8 -3
- package/dist/jam-Cj5gBvwD.mjs +373 -0
- package/dist/{link-DDXZVGtv.mjs → link-BFFRgrMt.mjs} +4 -4
- package/dist/listener-DdLEM79A.mjs +80 -0
- package/dist/{ls-D7O1G505.mjs → ls-BZ5TAtd5.mjs} +1 -1
- package/dist/{manifest-Nl3KSVOk.mjs → manifest-DPZ3WNg_.mjs} +2 -2
- package/dist/{marks-CWM3WJjc.mjs → marks-Dyn6tmjp.mjs} +3 -3
- package/dist/{marks-CKgzucHZ.mjs → marks-Kmdab_5w.mjs} +3 -3
- package/dist/{marver-id-gate-BjF6v4bT.mjs → marver-id-gate-D-R0hSt_.mjs} +1 -1
- package/dist/perf-Cn5LiRaY.mjs +1319 -0
- package/dist/perf-jam-QxD_UnzN.mjs +635 -0
- package/dist/permit-DDa6wqOs.mjs +187 -0
- package/dist/plugin-C_0yb-Fq.mjs +5089 -0
- package/dist/{poster-Bx83ZYVK.mjs → poster-DHi6I1fO.mjs} +1 -1
- package/dist/{profile-Bh5Y5zpW.mjs → profile-jIS6BcAs.mjs} +1 -1
- package/dist/{publish-bakes-aljgm45S.mjs → publish-bakes-r4PEZuPl.mjs} +3 -3
- package/dist/{queue-CAM_vNmX.mjs → queue-c-6aTHEz.mjs} +164 -25
- package/dist/{recover-t9Pno3u9.mjs → recover-nrLEVLyJ.mjs} +2 -2
- package/dist/{serve-C8rVheYk.mjs → serve-Dp3nHstu.mjs} +3 -3
- package/dist/{session-BAaJsK5c.mjs → session-DyVE7cCk.mjs} +1 -1
- package/dist/{share-W5H3BNvP.mjs → share-Ce4tP7ji.mjs} +1 -1
- package/dist/{shot-LFhC-WYD.mjs → shot-BrRtqaiS.mjs} +34 -8
- package/dist/{shot-DoHLl6ig.mjs → shot-DBWN8hPP.mjs} +1 -1
- package/dist/sizes-wjXDev3b.mjs +139 -0
- package/dist/{slots-DCDo3N0x.mjs → slots-CFNnegCc.mjs} +8 -1
- package/dist/speech-worker.mjs +23 -3
- package/dist/{sync-BQVlHZpx.mjs → sync-CQdGARJ9.mjs} +1 -1
- package/dist/transport-C5FnY9ni.mjs +203 -0
- package/dist/{work-BroFwnup.mjs → work-BYWD_1Zf.mjs} +3 -3
- package/dist/{work-Bp1p39kq.mjs → work-DJxH7cCX.mjs} +1 -1
- package/docs/jam-session.md +42 -16
- package/docs/live-jam.md +92 -10
- package/docs/performance.md +197 -35
- package/package.json +1 -1
- package/src/client/content/video.tsx +10 -2
- package/src/client/shell/App.tsx +10 -3
- package/src/client/shell/Comments.tsx +5 -3
- package/src/client/shell/ContextMenu.tsx +5 -3
- package/src/client/shell/JamSurface.tsx +56 -21
- package/src/client/shell/LockedApp.tsx +3 -0
- package/src/client/shell/Play.tsx +4 -2
- package/src/client/shell/Tip.tsx +3 -1
- package/src/client/shell/api.ts +47 -20
- package/src/client/shell/app-bridge.ts +254 -0
- package/src/client/shell/app-perf.ts +92 -0
- package/src/client/shell/canvas/Canvas.tsx +115 -22
- package/src/client/shell/canvas/FrameNode.tsx +10 -6
- package/src/client/shell/canvas/admission.ts +23 -8
- package/src/client/shell/canvas/ctl.ts +6 -0
- package/src/client/shell/canvas/sleep.ts +57 -17
- package/src/client/shell/canvas/updates.ts +2 -1
- package/src/client/shell/icons.tsx +1 -0
- package/src/client/shell/inset.ts +44 -0
- package/src/client/shell/jam-capture.ts +113 -33
- package/src/client/shell/jam-keys.ts +40 -9
- package/src/client/shell/jam-lane.tsx +14 -5
- package/src/client/shell/jam-lines.ts +66 -9
- package/src/client/shell/jam-panel.tsx +61 -6
- package/src/client/shell/jam-queue.ts +50 -8
- package/src/client/shell/jam-session.tsx +53 -4
- package/src/client/shell/jam-surface-parts.tsx +6 -3
- package/src/client/shell/jam-ui.tsx +6 -1
- package/src/client/shell/jam-voice-wait.ts +21 -0
- package/src/client/shell/jam-voice.ts +62 -15
- package/src/client/shell/main.tsx +14 -1
- package/src/client/shell/marks-ui.tsx +5 -3
- package/src/client/shell/marver-app.ts +21 -0
- package/src/client/shell/perf-run-probe.ts +34 -0
- package/src/client/shell/perf-run.ts +70 -0
- package/src/client/shell/perf.ts +11 -0
- package/src/client/shell/recorder.ts +45 -3
- package/src/client/shell/store.ts +52 -24
- package/src/client/shell/styles.css +65 -17
- package/src/client/shell/tidy.ts +3 -2
- package/src/client/shell/unsaved.ts +81 -0
- package/src/client/shell/whiteout-probes.ts +141 -0
- package/src/shared/app-api.ts +205 -0
- package/src/shared/app-perf.ts +308 -0
- package/src/shared/approval.ts +20 -0
- package/src/shared/events.ts +1 -1
- package/src/shared/logo-sniff.ts +86 -0
- package/src/shared/machine.ts +132 -0
- package/src/shared/perf-run.ts +177 -0
- package/templates/AGENTS-embedded.md +31 -1
- package/templates/AGENTS-studio.md +31 -1
- package/templates/instructions/boards.md +10 -2
- package/templates/instructions/jam.md +90 -0
- package/dist/bake-DM_uWgAA.mjs +0 -786
- package/dist/boards-CGg6piKF.mjs +0 -342
- package/dist/perf-BWzQwZqj.mjs +0 -369
- package/dist/perf-BoDSkbEb.mjs +0 -429
- package/dist/perf-jam-D55U3FZK.mjs +0 -242
- package/dist/plugin-C-E7omsh.mjs +0 -2762
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { capture,
|
|
1
|
+
import { i as capture, p as findChrome } from "./shot-BrRtqaiS.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 {
|
|
3
|
-
import {
|
|
4
|
-
import { MIME } from "./serve-
|
|
2
|
+
import { o as ASK_MAX, s as bakeBatch } from "./plugin-C_0yb-Fq.mjs";
|
|
3
|
+
import { p as findChrome, s as planShot } from "./shot-BrRtqaiS.mjs";
|
|
4
|
+
import { MIME } from "./serve-Dp3nHstu.mjs";
|
|
5
5
|
import { copyFileSync, lstatSync, mkdirSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { extname, isAbsolute, join, relative, resolve } from "node:path";
|
|
7
7
|
import { createServer } from "node:http";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { n as createExclusive, r as pidRuns } from "./exclusive-B1RtpeeP.mjs";
|
|
2
2
|
import { r as replay } from "./events-CLH4ijKP.mjs";
|
|
3
3
|
import { a as readLog, i as listBoards } from "./comments-0BSbb04K.mjs";
|
|
4
|
+
import { n as localProfile } from "./profile-jIS6BcAs.mjs";
|
|
4
5
|
import { a as deviceId, r as owned } from "./ledger-D54iROST.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { i as readWrapup, o as recordPathProblem } from "./session-
|
|
6
|
+
import { C as sanitize, T as threadId, _ as buildPacket, f as readCapture, h as wordsSince, l as hashOf, n as captureFrames, p as requestWords, s as factsOf, u as madeOf, y as packetPath } from "./capture-DdZ6xgoz.mjs";
|
|
7
|
+
import { i as readWrapup, o as recordPathProblem } from "./session-DyVE7cCk.mjs";
|
|
7
8
|
import { closeSync, existsSync, fsyncSync, mkdirSync, openSync, readFileSync, readdirSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
|
|
8
9
|
import { join } from "node:path";
|
|
9
10
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
@@ -67,7 +68,8 @@ function readRaw(root) {
|
|
|
67
68
|
...j.session && typeof j.session.id === "string" && /^ses-\d{10,16}-[a-z0-9]{4,12}$/.test(j.session.id) && typeof j.session.since === "number" ? { session: {
|
|
68
69
|
id: j.session.id,
|
|
69
70
|
since: j.session.since
|
|
70
|
-
} } : {}
|
|
71
|
+
} } : {},
|
|
72
|
+
...j.receipts && typeof j.receipts === "object" && !Array.isArray(j.receipts) ? { receipts: Object.fromEntries(Object.entries(j.receipts).filter(([k, r]) => /^[0-9a-f-]{36}$/.test(k) && r && typeof r.at === "number" && r.out && typeof r.out === "object")) } : {}
|
|
71
73
|
} };
|
|
72
74
|
} catch {
|
|
73
75
|
return {};
|
|
@@ -341,6 +343,10 @@ function merge(j, queued, other, now) {
|
|
|
341
343
|
if (gone.exclusive || keep.exclusive) keep.exclusive = [.../* @__PURE__ */ new Set([...keep.exclusive ?? [], ...gone.exclusive ?? []])];
|
|
342
344
|
keep.shared = Math.max(keep.shared ?? 0, gone.shared ?? 0) || void 0;
|
|
343
345
|
for (const f of gone.frames) if (!keep.frames.includes(f)) keep.frames.push(f);
|
|
346
|
+
if (gone.alone) {
|
|
347
|
+
keep.alone = joinAlone(gone.alone, keep.alone ?? {});
|
|
348
|
+
delete gone.alone;
|
|
349
|
+
}
|
|
344
350
|
if (gone.batch || gone.ran?.length) keep.follows ??= gone.id;
|
|
345
351
|
keep.state = "queued";
|
|
346
352
|
keep.rev += 1;
|
|
@@ -363,6 +369,7 @@ function requeue(j, c, now, first = false) {
|
|
|
363
369
|
const other = c.thread ? onThread(j, c.board, c.thread).find((x) => x !== c && x.state === "queued") : void 0;
|
|
364
370
|
return other ? merge(j, other, c, now) : c;
|
|
365
371
|
}
|
|
372
|
+
/** (the three `session-` actions are a stalled session run's choices - the daemon answers them, spec 29b Part 7) */
|
|
366
373
|
const ACTIONS = [
|
|
367
374
|
"drop",
|
|
368
375
|
"retry",
|
|
@@ -374,7 +381,10 @@ const ACTIONS = [
|
|
|
374
381
|
"more",
|
|
375
382
|
"later",
|
|
376
383
|
"rename",
|
|
377
|
-
"note"
|
|
384
|
+
"note",
|
|
385
|
+
"session-again",
|
|
386
|
+
"session-background",
|
|
387
|
+
"session-drop"
|
|
378
388
|
];
|
|
379
389
|
/** One card action from the page (POST /jam/card). It applies only if the card is still at `rev`
|
|
380
390
|
* (two tabs cannot both decide); anything not allowed answers with the current card. */
|
|
@@ -418,9 +428,11 @@ function act(j, id, rev, action, now = Date.now(), body) {
|
|
|
418
428
|
};
|
|
419
429
|
}
|
|
420
430
|
if (action === "edit" && capture && c.state === "draft" && typeof body === "string") {
|
|
431
|
+
const text = body.slice(0, 2e4);
|
|
421
432
|
c.payload = {
|
|
422
433
|
...c.payload,
|
|
423
|
-
edited:
|
|
434
|
+
edited: text,
|
|
435
|
+
editedAt: text === c.payload?.edited && c.payload.editedAt ? c.payload.editedAt : now
|
|
424
436
|
};
|
|
425
437
|
c.rev += 1;
|
|
426
438
|
c.at = now;
|
|
@@ -535,8 +547,11 @@ const resultText = (j, batchId, card, fallback = "") => {
|
|
|
535
547
|
};
|
|
536
548
|
/** Freeze a card's brief as text, from the logs as they stand at claim. Covers every owner event it
|
|
537
549
|
* copies (the `covered` record that takes a plain reply off `marver marks`). */
|
|
538
|
-
function freezeBrief(j, ctx, c, events) {
|
|
539
|
-
const
|
|
550
|
+
function freezeBrief(j, ctx, c, events, others = true) {
|
|
551
|
+
const inThread = c.thread ? events.filter((e) => e.type === "create" && e.commentId === c.thread || e.type === "reply" && e.parentId === c.thread) : [];
|
|
552
|
+
const me = others ? void 0 : localProfile(ctx.root);
|
|
553
|
+
const mine = (a) => !!me && (me.email ? a?.email === me.email : !a?.email && a?.name === me.name);
|
|
554
|
+
const msgs = others ? inThread : inThread.filter((e) => c.events.includes(e.id) || !e.agent && isOwned(ctx, c.board, e.id) || !!e.agent && mine(e.author));
|
|
540
555
|
const dropped = new Set(j.cards.filter((x) => x.board === c.board && x.state === "dropped").flatMap((x) => x.events));
|
|
541
556
|
const asks = new Set(c.events);
|
|
542
557
|
const toMsg = (e) => {
|
|
@@ -552,6 +567,7 @@ function freezeBrief(j, ctx, c, events) {
|
|
|
552
567
|
owner: true,
|
|
553
568
|
rev
|
|
554
569
|
} : {},
|
|
570
|
+
...owner && rev !== e.id ? { edited: events.find((x) => x.id === rev)?.ts ?? e.ts } : {},
|
|
555
571
|
body: sanitize(body, Infinity),
|
|
556
572
|
ts: e.ts,
|
|
557
573
|
...note ? { note } : {}
|
|
@@ -569,7 +585,10 @@ function freezeBrief(j, ctx, c, events) {
|
|
|
569
585
|
brief.capture = {
|
|
570
586
|
record: cap.record,
|
|
571
587
|
recordHash: cap.hash,
|
|
572
|
-
...capCard.payload.edited !== void 0 ? {
|
|
588
|
+
...capCard.payload.edited !== void 0 ? {
|
|
589
|
+
edited: capCard.payload.edited,
|
|
590
|
+
...capCard.payload.editedAt ? { editedAt: capCard.payload.editedAt } : {}
|
|
591
|
+
} : {},
|
|
573
592
|
...capCard.payload.added?.length ? { added: capCard.payload.added } : {},
|
|
574
593
|
...capCard.payload.reviewed ? { reviewed: capCard.payload.reviewed } : {},
|
|
575
594
|
...note ? { note } : {}
|
|
@@ -602,6 +621,29 @@ function freezeBrief(j, ctx, c, events) {
|
|
|
602
621
|
}
|
|
603
622
|
return brief;
|
|
604
623
|
}
|
|
624
|
+
/** A brief frozen with other people's words (before 0.28, or with `jam.others` on), made owner-only: the owner's
|
|
625
|
+
* own messages and Marver's own replies stay; everyone else's, and anything whose author is not known, go. */
|
|
626
|
+
function ownerOnly(brief, me) {
|
|
627
|
+
const keep = (m) => !!m.owner || !!m.agent && m.author === me.name;
|
|
628
|
+
const asks = (l) => l.filter((m) => !!m.owner);
|
|
629
|
+
const cap = brief.capture;
|
|
630
|
+
return {
|
|
631
|
+
...brief,
|
|
632
|
+
history: brief.history.filter(keep),
|
|
633
|
+
asks: asks(brief.asks),
|
|
634
|
+
...brief.follows ? { follows: {
|
|
635
|
+
...brief.follows,
|
|
636
|
+
asks: asks(brief.follows.asks)
|
|
637
|
+
} } : {},
|
|
638
|
+
...cap?.reviewed ? { capture: {
|
|
639
|
+
...cap,
|
|
640
|
+
reviewed: {
|
|
641
|
+
...cap.reviewed,
|
|
642
|
+
asks: asks(cap.reviewed.asks)
|
|
643
|
+
}
|
|
644
|
+
} } : {}
|
|
645
|
+
};
|
|
646
|
+
}
|
|
605
647
|
/** Are a card's asks still the owner's? Each must be in its board's log and ledgered; the ones that
|
|
606
648
|
* are not are dropped, and a card with none left is dropped ("no longer authorized"). */
|
|
607
649
|
/** Is a capture still what was ledgered at confirm - its sealed record's hash and the confirmed edit?
|
|
@@ -655,11 +697,19 @@ function validate(ctx, c, events, now, j) {
|
|
|
655
697
|
}
|
|
656
698
|
return true;
|
|
657
699
|
}
|
|
700
|
+
/** Does a queued card run alone - once nothing runs and no hold is left, and while it waits nothing new starts? One that
|
|
701
|
+
* must edit a shared file does. So does one with no frame, unless a session takes the work now (F5): then it runs beside
|
|
702
|
+
* the others, each frame it makes claimed with `--run` - never one back from a run that left its session, as a run Marver
|
|
703
|
+
* spawns finds the frames it made only when nothing ran beside it. A card that holds a frame - yours, or one an earlier
|
|
704
|
+
* run of it made - is a request on that frame like any other: what it holds now decides, never what it held once. The
|
|
705
|
+
* one rule: the queue, the lane and the holds read it. */
|
|
706
|
+
const runsAlone = (c, session) => !!c.exclusive || !c.frames.length && (!!c.alone || !session(c.kind === "wrapup"));
|
|
658
707
|
/** Claim what can run now: the queued cards of one board on one single frame join one batch, in
|
|
659
708
|
* run order, up to 8; a card naming several frames runs alone and waits for all of them; a card
|
|
660
|
-
* with no frame
|
|
661
|
-
* no hold is left, and while it waits
|
|
662
|
-
*
|
|
709
|
+
* with no frame runs beside them while a session takes the work, each its own run; one that runs
|
|
710
|
+
* alone (`runsAlone`) runs exclusive - once nothing runs and no hold is left, and while it waits
|
|
711
|
+
* nothing new starts. Briefs are frozen, cards turn working, and each packet is written to its
|
|
712
|
+
* file. Returns the new batches (already in the journal). */
|
|
663
713
|
function form(j, ctx, o, now = Date.now()) {
|
|
664
714
|
const logs = /* @__PURE__ */ new Map();
|
|
665
715
|
const log = (board) => {
|
|
@@ -667,12 +717,13 @@ function form(j, ctx, o, now = Date.now()) {
|
|
|
667
717
|
if (!l) logs.set(board, l = readLog(ctx.dir, board));
|
|
668
718
|
return l;
|
|
669
719
|
};
|
|
670
|
-
|
|
720
|
+
const alone = (c) => runsAlone(c, (record) => !!o.session?.(record));
|
|
721
|
+
for (const c of j.cards) if (c.state === "queued" && alone(c)) validate(ctx, c, log(c.board), now, j);
|
|
671
722
|
const queued = j.cards.filter((c) => c.state === "queued").sort((a, b) => a.order - b.order || a.made - b.made);
|
|
672
|
-
const exclusive = queued.filter(
|
|
723
|
+
const exclusive = queued.filter(alone);
|
|
673
724
|
const forming = [];
|
|
674
725
|
if (exclusive.length) {
|
|
675
|
-
if (o.exclusiveRunning || o.running.size || o.anyHold() || o.free < 1) return {
|
|
726
|
+
if (o.exclusiveRunning || o.running.size || o.active || o.anyHold() || o.free < 1) return {
|
|
676
727
|
batches: [],
|
|
677
728
|
exclusiveWaiting: !o.exclusiveRunning
|
|
678
729
|
};
|
|
@@ -686,32 +737,64 @@ function form(j, ctx, o, now = Date.now()) {
|
|
|
686
737
|
});
|
|
687
738
|
} else if (!o.exclusiveRunning) {
|
|
688
739
|
const reserved = new Set(o.running);
|
|
689
|
-
|
|
740
|
+
const formedNow = /* @__PURE__ */ new Set();
|
|
741
|
+
let took = 0;
|
|
742
|
+
const one = !!o.session?.(false);
|
|
743
|
+
const spawns = (b) => b.cards.some((c) => !!c.alone?.spawn);
|
|
744
|
+
const taken = (session) => forming.filter((b) => !one ? !!b.for === session : !session || !spawns(b)).length;
|
|
745
|
+
const sharable = (c, f) => !c.alone && !formedNow.has(f) && !!o.share?.(f);
|
|
746
|
+
for (const c of queued) if (!c.frames.length) {
|
|
747
|
+
const s = o.session(c.kind === "wrapup");
|
|
748
|
+
if (taken(true) >= s.room) continue;
|
|
749
|
+
if (!validate(ctx, c, log(c.board), now, j)) continue;
|
|
750
|
+
forming.push({
|
|
751
|
+
board: c.board,
|
|
752
|
+
frames: [],
|
|
753
|
+
cards: [c],
|
|
754
|
+
single: false,
|
|
755
|
+
for: {
|
|
756
|
+
conn: s.conn,
|
|
757
|
+
inc: s.inc
|
|
758
|
+
}
|
|
759
|
+
});
|
|
760
|
+
took += 1;
|
|
761
|
+
} else if (c.frames.length === 1) {
|
|
690
762
|
const f = c.frames[0];
|
|
691
|
-
const join = forming.find((b) => b.single && b.board === c.board && b.frames[0] === f && b.cards.length < 8);
|
|
763
|
+
const join = forming.find((b) => b.single && b.board === c.board && b.frames[0] === f && b.cards.length < 8 && !(c.alone && b.overlaps));
|
|
692
764
|
if (join) {
|
|
693
765
|
if (validate(ctx, c, log(c.board), now, j)) join.cards.push(c);
|
|
694
766
|
continue;
|
|
695
767
|
}
|
|
696
|
-
|
|
768
|
+
const shared = reserved.has(f) && (o.shareRoom ?? 0) > took && sharable(c, f);
|
|
769
|
+
if (reserved.has(f) && !shared || o.held(f) || taken(false) >= o.free) continue;
|
|
697
770
|
if (!validate(ctx, c, log(c.board), now, j)) continue;
|
|
698
771
|
forming.push({
|
|
699
772
|
board: c.board,
|
|
700
773
|
frames: [f],
|
|
701
774
|
cards: [c],
|
|
702
|
-
single: true
|
|
775
|
+
single: true,
|
|
776
|
+
...shared ? { overlaps: o.share(f) } : {}
|
|
703
777
|
});
|
|
778
|
+
if (shared) took += 1;
|
|
704
779
|
reserved.add(f);
|
|
780
|
+
formedNow.add(f);
|
|
705
781
|
} else {
|
|
706
|
-
|
|
782
|
+
const busy = c.frames.filter((f) => reserved.has(f));
|
|
783
|
+
const shared = busy.length > 0 && (o.shareRoom ?? 0) > took && busy.every((f) => sharable(c, f));
|
|
784
|
+
if (busy.length && !shared || c.frames.some((f) => o.held(f)) || taken(false) >= o.free) continue;
|
|
707
785
|
if (!validate(ctx, c, log(c.board), now, j)) continue;
|
|
708
786
|
forming.push({
|
|
709
787
|
board: c.board,
|
|
710
788
|
frames: [...c.frames],
|
|
711
789
|
cards: [c],
|
|
712
|
-
single: false
|
|
790
|
+
single: false,
|
|
791
|
+
...shared ? { overlaps: [...new Set(busy.flatMap((f) => o.share(f)))] } : {}
|
|
713
792
|
});
|
|
714
|
-
|
|
793
|
+
if (shared) took += 1;
|
|
794
|
+
for (const f of c.frames) {
|
|
795
|
+
reserved.add(f);
|
|
796
|
+
formedNow.add(f);
|
|
797
|
+
}
|
|
715
798
|
}
|
|
716
799
|
}
|
|
717
800
|
const batches = [];
|
|
@@ -721,7 +804,7 @@ function form(j, ctx, o, now = Date.now()) {
|
|
|
721
804
|
const packetMembers = [];
|
|
722
805
|
const threads = replay(log(f.board));
|
|
723
806
|
for (const c of f.cards) {
|
|
724
|
-
const brief = freezeBrief(j, ctx, c, log(c.board));
|
|
807
|
+
const brief = freezeBrief(j, ctx, c, log(c.board), o.others !== false);
|
|
725
808
|
const id = `m${members.length + 1}`;
|
|
726
809
|
c.brief = brief;
|
|
727
810
|
c.batch = batchId;
|
|
@@ -745,6 +828,28 @@ function form(j, ctx, o, now = Date.now()) {
|
|
|
745
828
|
});
|
|
746
829
|
}
|
|
747
830
|
const files = f.exclusive ? [...new Set(f.cards.flatMap((c) => c.exclusive ?? []))] : void 0;
|
|
831
|
+
const back = f.cards.find((c) => c.alone?.spawn)?.alone;
|
|
832
|
+
const created = [...new Set(f.cards.flatMap((c) => c.alone?.created ?? []))].filter((x) => f.frames.includes(x));
|
|
833
|
+
const kept = /* @__PURE__ */ new Map();
|
|
834
|
+
for (const s of f.cards.flatMap((c) => c.alone?.shots ?? [])) {
|
|
835
|
+
if (!f.frames.includes(s.frame)) continue;
|
|
836
|
+
const k = kept.get(s.frame);
|
|
837
|
+
if (!k || s.at !== void 0 && (k.at === void 0 || s.at < k.at)) kept.set(s.frame, {
|
|
838
|
+
before: s.before,
|
|
839
|
+
...s.at !== void 0 ? { at: s.at } : {}
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
const shots = kept.size || created.length ? f.frames.filter((x) => !created.includes(x)).map((x) => {
|
|
843
|
+
const k = kept.get(x);
|
|
844
|
+
return {
|
|
845
|
+
frame: x,
|
|
846
|
+
...k ? {
|
|
847
|
+
before: k.before,
|
|
848
|
+
...k.at !== void 0 ? { beforeAt: k.at } : {}
|
|
849
|
+
} : {}
|
|
850
|
+
};
|
|
851
|
+
}) : void 0;
|
|
852
|
+
for (const c of f.cards) delete c.alone;
|
|
748
853
|
const b = {
|
|
749
854
|
batchId,
|
|
750
855
|
members,
|
|
@@ -753,7 +858,18 @@ function form(j, ctx, o, now = Date.now()) {
|
|
|
753
858
|
state: "claimed",
|
|
754
859
|
leaseUntil: 0,
|
|
755
860
|
attempts: 0,
|
|
756
|
-
at: now
|
|
861
|
+
at: now,
|
|
862
|
+
others: o.others !== false,
|
|
863
|
+
...f.overlaps?.length && o.sharer ? {
|
|
864
|
+
overlaps: f.overlaps,
|
|
865
|
+
share: { ...o.sharer }
|
|
866
|
+
} : f.for ? { share: f.for } : {},
|
|
867
|
+
...back ? {
|
|
868
|
+
handoff: "spawn",
|
|
869
|
+
...back.why ? { handoffWhy: back.why } : {}
|
|
870
|
+
} : {},
|
|
871
|
+
...created.length ? { created } : {},
|
|
872
|
+
...shots ? { shots } : {}
|
|
757
873
|
};
|
|
758
874
|
j.batches.push(b);
|
|
759
875
|
writePacket(ctx.root, buildPacket(batchId, packetMembers, f.frames, f.exclusive ? files : void 0), new Set(j.batches.filter((x) => x.state === "claimed").map((x) => x.batchId)));
|
|
@@ -764,6 +880,25 @@ function form(j, ctx, o, now = Date.now()) {
|
|
|
764
880
|
exclusiveWaiting: exclusive.length > 0 && batches.length === 0
|
|
765
881
|
};
|
|
766
882
|
}
|
|
883
|
+
/** What a card waiting again carries from the runs that left it (F4) - joined, never replaced: a second run let go into the
|
|
884
|
+
* same card (a follow-up on its thread) adds the frames it made, and a frame's picture from before any edit is the
|
|
885
|
+
* first one kept (Codex's review: the second requeue replaced the first's, and its review started from partial work). */
|
|
886
|
+
function joinAlone(was, add) {
|
|
887
|
+
const created = [.../* @__PURE__ */ new Set([...was?.created ?? [], ...add.created ?? []])];
|
|
888
|
+
const shots = [...was?.shots ?? []].map((x) => ({ ...x }));
|
|
889
|
+
for (const x of add.shots ?? []) {
|
|
890
|
+
const i = shots.findIndex((y) => y.frame === x.frame);
|
|
891
|
+
if (i < 0) shots.push({ ...x });
|
|
892
|
+
else if (x.at !== void 0 && (shots[i].at === void 0 || x.at < shots[i].at)) shots[i] = { ...x };
|
|
893
|
+
}
|
|
894
|
+
const why = was?.why ?? add.why;
|
|
895
|
+
return {
|
|
896
|
+
...was?.spawn || add.spawn ? { spawn: true } : {},
|
|
897
|
+
...why ? { why } : {},
|
|
898
|
+
...created.length ? { created } : {},
|
|
899
|
+
...shots.length ? { shots } : {}
|
|
900
|
+
};
|
|
901
|
+
}
|
|
767
902
|
const PACKETS_KEPT = 50;
|
|
768
903
|
/** Write a batch's packet once (a rerun reads the same file) and forget old ones - never one an
|
|
769
904
|
* unfinished batch (`keep`) still needs to resume. */
|
|
@@ -1095,7 +1230,11 @@ function addCapture(j, record, hash, now = Date.now()) {
|
|
|
1095
1230
|
* text stays in the record), its facts, the capture it stands for; pinned on the first point, else
|
|
1096
1231
|
* its first frame, else the board. Deterministic ids, so a resumed confirm writes it once. */
|
|
1097
1232
|
function captureComment(c, record, at, author, now = Date.now()) {
|
|
1098
|
-
const words =
|
|
1233
|
+
const words = requestWords({
|
|
1234
|
+
record,
|
|
1235
|
+
edited: c.payload?.edited,
|
|
1236
|
+
added: c.payload?.added
|
|
1237
|
+
});
|
|
1099
1238
|
return {
|
|
1100
1239
|
id: `cap-${c.id}-e`,
|
|
1101
1240
|
ts: now,
|
|
@@ -1316,4 +1455,4 @@ function createQueue(root, onUpgrade, alive = () => true) {
|
|
|
1316
1455
|
};
|
|
1317
1456
|
}
|
|
1318
1457
|
//#endregion
|
|
1319
|
-
export { ACTIONS, act, addCapture, addWrapup, answeredSince, answers, beginStep, captureComment, captureIntact, conflictStep, createQueue, ctxFor, endSession, endStep, fail, form, looksGood, moreWrapup, releaseLock as n, payloadKey, pending, prune, redelivering, sameComment, settle, startSession, stillOwned, acquireLock as t, textOf, undelivered, wrapupIntact, wrapupOf };
|
|
1458
|
+
export { ACTIONS, act, addCapture, addWrapup, answeredSince, answers, beginStep, captureComment, captureIntact, conflictStep, createQueue, ctxFor, endSession, endStep, fail, form, joinAlone, looksGood, moreWrapup, releaseLock as n, ownerOnly, payloadKey, pending, prune, redelivering, requeue, runsAlone, sameComment, settle, startSession, stillOwned, acquireLock as t, textOf, undelivered, wrapupIntact, wrapupOf };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as NAME } from "./cli.mjs";
|
|
2
|
-
import { d as recoverTarget, h as workspaceId, r as legacyEntry, u as recoverEntries } from "./slots-
|
|
3
|
-
import { DevStartError, dev } from "./dev-
|
|
2
|
+
import { d as recoverTarget, h as workspaceId, r as legacyEntry, u as recoverEntries } from "./slots-CFNnegCc.mjs";
|
|
3
|
+
import { DevStartError, dev } from "./dev-D7YS7iT2.mjs";
|
|
4
4
|
//#region src/cli/recover.ts
|
|
5
5
|
/**
|
|
6
6
|
* `marver dev --recover` (spec 28 A1.6). A Jam capture the page could not send waits in that browser's
|
|
@@ -75,7 +75,7 @@ async function serve(root, portFlag) {
|
|
|
75
75
|
* accounts get in. Null when there is no roster to consult. */
|
|
76
76
|
let guestDoorOpen = null;
|
|
77
77
|
if (process.env.MARVER_DATA_DIR) {
|
|
78
|
-
const { collabHandler } = await import("./collab-
|
|
78
|
+
const { collabHandler } = await import("./collab-BEAcXrBb.mjs");
|
|
79
79
|
const { appendEvents, readLog } = await import("./comments-0BSbb04K.mjs").then((n) => n.n);
|
|
80
80
|
const { dataDir } = await import("./comments-0BSbb04K.mjs").then((n) => n.n);
|
|
81
81
|
const dir = dataDir();
|
|
@@ -147,7 +147,7 @@ async function serve(root, portFlag) {
|
|
|
147
147
|
console.error(`[${NAME}] MARVER_ID_ISSUER is set but MARVER_PUBLIC_ORIGIN is not.\n Every assertion is bound to this canvas's exact origin, and it cannot be\n inferred from request headers - a proxy can make any request look local.\n Set it to the origin people actually reach this canvas on:\n MARVER_PUBLIC_ORIGIN=https://canvas.example.com\n MARVER_PUBLIC_ORIGIN=http://localhost:${portFlag ?? (Number(process.env.PORT) || 4199)} (development)`);
|
|
148
148
|
process.exit(1);
|
|
149
149
|
}
|
|
150
|
-
const { marverIdHandler } = await import("./marver-id-gate-
|
|
150
|
+
const { marverIdHandler } = await import("./marver-id-gate-D-R0hSt_.mjs");
|
|
151
151
|
const { dataDir } = await import("./comments-0BSbb04K.mjs").then((n) => n.n);
|
|
152
152
|
const canvasName = humanName(meta.name);
|
|
153
153
|
const { ceilingsFromRights } = await import("./auth-Dix8wrXV.mjs").then((n) => n.R);
|
|
@@ -316,7 +316,7 @@ function isCosmetic(pathname) {
|
|
|
316
316
|
try {
|
|
317
317
|
decoded = decodeURIComponent(pathname);
|
|
318
318
|
} catch {}
|
|
319
|
-
return /^\/__mv\/favicon\/[\w-]+(?:\.[\w-]+)+$/.test(decoded) || /^\/__mv\/logo\.(?:svg|png)$/.test(decoded);
|
|
319
|
+
return /^\/__mv\/favicon\/[\w-]+(?:\.[\w-]+)+$/.test(decoded) || /^\/__mv\/logo\.(?:svg|png|ico)$/.test(decoded);
|
|
320
320
|
}
|
|
321
321
|
/** The Marver logo mark (ParallelogramDuo, same as the shell's sidebar). */
|
|
322
322
|
const MARK_AT = (size) => `<svg viewBox="0 0 256 256" width="${size}" height="${size}" fill="currentColor" aria-hidden><path d="M239.29,59.28l-64.8,144a8,8,0,0,1-7.3,4.72H24a8,8,0,0,1-7.3-11.28l64.8-144A8,8,0,0,1,88.81,48H232A8,8,0,0,1,239.29,59.28Z" opacity=".1"/><path d="M245.43,47.31A15.94,15.94,0,0,0,232,40H88.81a16,16,0,0,0-14.59,9.43l-64.8,144A16,16,0,0,0,24,216H167.19a16,16,0,0,0,14.59-9.43l64.8-144A16,16,0,0,0,245.43,47.31ZM167.19,200H24L88.81,56H232Z"/></svg>`;
|
|
@@ -1,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-DdZ6xgoz.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";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as NAME } from "./cli.mjs";
|
|
2
2
|
import { M as resolveAccess } from "./auth-Dix8wrXV.mjs";
|
|
3
|
-
import { i as loadCollab } from "./sync-
|
|
3
|
+
import { i as loadCollab } from "./sync-CQdGARJ9.mjs";
|
|
4
4
|
//#region src/cli/share.ts
|
|
5
5
|
/**
|
|
6
6
|
* `marver share <action>` - the roster from the terminal (01-sharing §9).
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
1
2
|
import { a as ROUTE, o as slideSize } from "./cli.mjs";
|
|
2
|
-
import { t as logJam } from "./perf-jam-
|
|
3
|
+
import { t as logJam } from "./perf-jam-QxD_UnzN.mjs";
|
|
3
4
|
import { copyFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
4
5
|
import { join } from "node:path";
|
|
5
6
|
import { randomBytes } from "node:crypto";
|
|
@@ -58,6 +59,9 @@ const FLAGS = [
|
|
|
58
59
|
...containerFlags(process.platform, process.getuid?.()),
|
|
59
60
|
...process.env.MV_CHROME_FLAGS?.split(" ").filter(Boolean) ?? []
|
|
60
61
|
];
|
|
62
|
+
/** The flags every browser here launches with (a headless perf run's line says them: runs compare only with runs
|
|
63
|
+
* that launched alike, spec 28 A3.8 #22). */
|
|
64
|
+
const launchFlags = () => [...FLAGS];
|
|
61
65
|
const HANDSHAKE_MS = 15e3;
|
|
62
66
|
const MAX_MESSAGE = 1 << 30;
|
|
63
67
|
/** The pipe's framing: NUL-terminated messages, arriving in chunks split anywhere - inside a
|
|
@@ -432,6 +436,26 @@ function unfilterRow(raw, up, out, bpp) {
|
|
|
432
436
|
* and the browser closed in the operation's finally - never idle, never shared, never
|
|
433
437
|
* outliving the server.
|
|
434
438
|
*/
|
|
439
|
+
var shot_exports = /* @__PURE__ */ __exportAll({
|
|
440
|
+
AREA: () => AREA,
|
|
441
|
+
BATCH_MAX: () => 200,
|
|
442
|
+
MOUNTED: () => MOUNTED,
|
|
443
|
+
SURFACE: () => SURFACE,
|
|
444
|
+
capture: () => capture,
|
|
445
|
+
captureIn: () => captureIn,
|
|
446
|
+
frameUrl: () => frameUrl,
|
|
447
|
+
manifestFrame: () => manifestFrame,
|
|
448
|
+
planShot: () => planShot,
|
|
449
|
+
pool: () => pool,
|
|
450
|
+
resolveFrames: () => resolveFrames,
|
|
451
|
+
shootBatch: () => shootBatch,
|
|
452
|
+
shootFrame: () => shootFrame,
|
|
453
|
+
shotConcurrency: () => shotConcurrency,
|
|
454
|
+
shotEvent: () => shotEvent,
|
|
455
|
+
shotSeams: () => shotSeams,
|
|
456
|
+
sweepGhosts: () => sweepGhosts,
|
|
457
|
+
withBrowser: () => withBrowser
|
|
458
|
+
});
|
|
435
459
|
const slug = (frameId) => frameId.replace(/\//g, "--");
|
|
436
460
|
const clamp = (n, lo, hi) => Math.min(hi, Math.max(lo, n));
|
|
437
461
|
const num = (v) => typeof v === "number" && Number.isFinite(v) && v > 0 ? v : void 0;
|
|
@@ -500,8 +524,8 @@ async function shootFrame(opts) {
|
|
|
500
524
|
};
|
|
501
525
|
const plan = planShot(frame, viewports, size);
|
|
502
526
|
if (frame.kind !== "html") try {
|
|
503
|
-
const { scanAssetRefs } = await import("./build-
|
|
504
|
-
const { ensurePoster } = await import("./poster-
|
|
527
|
+
const { scanAssetRefs } = await import("./build-BsAyLMT1.mjs");
|
|
528
|
+
const { ensurePoster } = await import("./poster-DHi6I1fO.mjs");
|
|
505
529
|
const refs = scanAssetRefs(readFileSync(join(root, frame.file), "utf8"), frame.file);
|
|
506
530
|
for (const r of refs) if (r.endsWith(".poster.png")) await ensurePoster(join(root, "design", "assets"), r.slice(0, -11));
|
|
507
531
|
} catch {}
|
|
@@ -511,7 +535,7 @@ async function shootFrame(opts) {
|
|
|
511
535
|
const explicit = opts.scale !== void 0;
|
|
512
536
|
const relFor = (used) => {
|
|
513
537
|
const tag = !explicit || scale === 2 && used === 2 ? "" : used === scale ? `@${scale}x` : `@${scale}x-as-${used}x`;
|
|
514
|
-
return `design/.local/shots/${slug(frameId)}--${theme}${tag}.png`;
|
|
538
|
+
return `design/.local/shots/${slug(frameId)}--${theme}${tag}${opts.lane === "picture" ? ".picture" : ""}.png`;
|
|
515
539
|
};
|
|
516
540
|
const tmp = join(shotsDir, `.${slug(frameId)}--${theme}.${randomBytes(6).toString("hex")}.tmp.png`);
|
|
517
541
|
const req = {
|
|
@@ -522,7 +546,7 @@ async function shootFrame(opts) {
|
|
|
522
546
|
fullHeight: plan.fullHeight,
|
|
523
547
|
scale
|
|
524
548
|
};
|
|
525
|
-
const result = browser ? await captureIn(req, browser) : await capture(req);
|
|
549
|
+
const result = browser ? await captureIn(req, browser) : await capture(req, opts.lane ?? "shot");
|
|
526
550
|
logJam(root, shotEvent(frameId, scale, result));
|
|
527
551
|
if (!result.ok) {
|
|
528
552
|
rmSync(tmp, { force: true });
|
|
@@ -790,10 +814,12 @@ function sweepTemps(dir) {
|
|
|
790
814
|
* write the same output at the same time. Posters have their own lane - a frame being shot
|
|
791
815
|
* may ask for its poster mid-render, and on the shot's lane that request would wait for the
|
|
792
816
|
* very shot that is waiting for it - and so do anchor checks, which have a deadline of their
|
|
793
|
-
* own and must not wait out a batch of shots
|
|
817
|
+
* own and must not wait out a batch of shots, and a capture's pictures: a capture waits at most 20 s for each,
|
|
818
|
+
* and a bake pass on the shot lane (a frame can take 20 s to settle) would outlast that. */
|
|
794
819
|
const chains = /* @__PURE__ */ new Map();
|
|
795
|
-
function withBrowser(lane, fn) {
|
|
820
|
+
function withBrowser(lane, fn, o = {}) {
|
|
796
821
|
const run = async () => {
|
|
822
|
+
if (o.skip?.()) return o.skipped;
|
|
797
823
|
const b = await Browser.launch();
|
|
798
824
|
try {
|
|
799
825
|
return await fn(b);
|
|
@@ -1263,4 +1289,4 @@ async function captureOnce({ url, width, height, out, fullHeight = false, timeou
|
|
|
1263
1289
|
}
|
|
1264
1290
|
}
|
|
1265
1291
|
//#endregion
|
|
1266
|
-
export {
|
|
1292
|
+
export { frameUrl as a, pool as c, withBrowser as d, Browser as f, capture as i, shotConcurrency as l, launchFlags as m, MOUNTED as n, manifestFrame as o, findChrome as p, SURFACE as r, planShot as s, AREA as t, shot_exports as u };
|
|
@@ -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-DJxH7cCX.mjs";
|
|
3
3
|
import { existsSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { randomBytes } from "node:crypto";
|