@marver-design/marver 0.28.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +103 -0
- package/README.md +4 -3
- package/dist/{anchor-check-PHUOFj1N.mjs → anchor-check-c52IDkiQ.mjs} +1 -1
- package/dist/{build-BsAyLMT1.mjs → build-C3mUtjEn.mjs} +7 -4
- package/dist/{capture-DdZ6xgoz.mjs → capture-DEtM4qm5.mjs} +168 -5
- package/dist/cli.mjs +11 -11
- package/dist/{comments-CrBHPEQl.mjs → comments-XNhMmSSu.mjs} +2 -2
- package/dist/{connectors-MR9d-EBP.mjs → connectors-DekQvKt9.mjs} +3 -1
- package/dist/{daemon-C5dg2R-V.mjs → daemon-B0Wi1OQ3.mjs} +30 -29
- package/dist/{dev-D7YS7iT2.mjs → dev-5dlxoW28.mjs} +19 -14
- package/dist/{init-WE5lQkQL.mjs → init-CYlFaRzG.mjs} +1 -1
- package/dist/logo-CXY-1yrn.mjs +305 -0
- package/dist/{ls-BZ5TAtd5.mjs → ls-NqmePKOf.mjs} +1 -1
- package/dist/{marks-Kmdab_5w.mjs → marks-BnNANic9.mjs} +20 -1
- package/dist/{marks-Dyn6tmjp.mjs → marks-DBp3h1Mc.mjs} +2 -5
- package/dist/{marver-id-gate-D-R0hSt_.mjs → marver-id-gate-vBLb_Icb.mjs} +1 -1
- package/dist/{perf-Cn5LiRaY.mjs → perf-6MOTHxay.mjs} +751 -122
- package/dist/perf-BCxAo0IS.mjs +1743 -0
- package/dist/{plugin-C_0yb-Fq.mjs → plugin-CXRoMA8g.mjs} +1382 -810
- package/dist/{poster-DHi6I1fO.mjs → poster-CYmCa00B.mjs} +1 -1
- package/dist/{profile-jIS6BcAs.mjs → profile-B1FKOM1e.mjs} +1 -1
- package/dist/{publish-bakes-r4PEZuPl.mjs → publish-bakes-C_2ZtHou.mjs} +3 -3
- package/dist/{queue-c-6aTHEz.mjs → queue-DeSQm24g.mjs} +29 -14
- package/dist/{recover-nrLEVLyJ.mjs → recover-XD8iXJOj.mjs} +2 -2
- package/dist/{serve-Dp3nHstu.mjs → serve-DQv3Ti6X.mjs} +8 -4
- package/dist/{session-DyVE7cCk.mjs → session-VDJfXEEm.mjs} +1 -1
- package/dist/{share-Ce4tP7ji.mjs → share-Bu_kuOKL.mjs} +1 -1
- package/dist/{shot-BrRtqaiS.mjs → shot-CRRGgxru.mjs} +3 -3
- package/dist/{slots-CFNnegCc.mjs → slots-Dn4Onb0V.mjs} +101 -3
- package/dist/{sync-CQdGARJ9.mjs → sync-CMozOwZ0.mjs} +1 -1
- package/docs/app.md +194 -0
- package/docs/boards-and-folders.md +11 -0
- package/docs/jam-session.md +12 -3
- package/docs/live-jam.md +3 -0
- package/docs/performance.md +99 -19
- package/docs/publish.md +7 -0
- package/package.json +1 -1
- package/src/client/frame-host/bridge.js +17 -8
- package/src/client/frame-host/inplace.ts +124 -0
- package/src/client/frame-host/inspect.d.ts +1 -0
- package/src/client/frame-host/inspect.js +13 -4
- package/src/client/frame-host/main.tsx +12 -3
- package/src/client/frame-host/messages.ts +85 -0
- package/src/client/frame-host/signals.d.ts +15 -0
- package/src/client/frame-host/signals.js +219 -0
- package/src/client/recorder-level.ts +41 -0
- package/src/client/shell/App.tsx +158 -88
- package/src/client/shell/BoardList.tsx +103 -48
- package/src/client/shell/Comments.tsx +71 -46
- package/src/client/shell/ContextMenu.tsx +8 -6
- package/src/client/shell/JamSurface.tsx +187 -71
- package/src/client/shell/LockedApp.tsx +19 -3
- package/src/client/shell/Play.tsx +110 -62
- package/src/client/shell/StatusPicker.tsx +19 -9
- package/src/client/shell/Toolbar.tsx +15 -7
- package/src/client/shell/api.ts +25 -7
- package/src/client/shell/app-bridge.ts +23 -9
- package/src/client/shell/app-perf.ts +31 -1
- package/src/client/shell/canvas/Canvas.tsx +17 -6
- package/src/client/shell/canvas/FrameNode.tsx +25 -12
- package/src/client/shell/canvas/Sticky.tsx +4 -2
- package/src/client/shell/canvas/ctl.ts +2 -0
- package/src/client/shell/canvas/ready-watch.ts +4 -0
- package/src/client/shell/canvas/sleep.ts +2 -0
- package/src/client/shell/canvas/updates.ts +13 -6
- package/src/client/shell/commands.ts +765 -0
- package/src/client/shell/comments-store.ts +56 -27
- package/src/client/shell/goto.ts +15 -9
- package/src/client/shell/jam-capture.ts +39 -15
- package/src/client/shell/jam-keys.ts +303 -111
- package/src/client/shell/jam-lane.tsx +19 -12
- package/src/client/shell/jam-lines.ts +10 -1
- package/src/client/shell/jam-panel.tsx +68 -53
- package/src/client/shell/jam-queue.ts +6 -1
- package/src/client/shell/jam-session.tsx +41 -37
- package/src/client/shell/jam-state.ts +28 -5
- package/src/client/shell/jam-surface-parts.tsx +8 -6
- package/src/client/shell/jam-ui.tsx +12 -5
- package/src/client/shell/jam-voice.ts +4 -2
- package/src/client/shell/live-picture.ts +134 -0
- package/src/client/shell/main.tsx +7 -1
- package/src/client/shell/marks-ui.tsx +11 -0
- package/src/client/shell/open-item.ts +83 -0
- package/src/client/shell/open-resolve.ts +50 -0
- package/src/client/shell/perf.ts +51 -5
- package/src/client/shell/recorder-core.ts +4 -1
- package/src/client/shell/recorder-hmr.ts +36 -0
- package/src/client/shell/recorder-reloads.ts +264 -0
- package/src/client/shell/recorder-seams.ts +116 -0
- package/src/client/shell/recorder-self.ts +73 -0
- package/src/client/shell/recorder-signals-core.ts +139 -0
- package/src/client/shell/recorder-signals.ts +485 -0
- package/src/client/shell/recorder.ts +115 -41
- package/src/client/shell/store.ts +62 -24
- package/src/client/shell/styles.css +2 -0
- package/src/client/shell/whiteout-probes.ts +3 -1
- package/src/client/stage/main.tsx +39 -12
- package/src/shared/app-api.ts +201 -9
- package/src/shared/app-perf.ts +103 -8
- package/src/shared/app-report.ts +586 -0
- package/src/shared/perf-records.ts +445 -0
- package/src/shared/perf-run.ts +6 -2
- package/templates/instructions/jam.md +4 -0
- package/dist/live-Cgzsicwi.mjs +0 -4
- package/dist/perf-jam-QxD_UnzN.mjs +0 -635
|
@@ -2,20 +2,20 @@ import { l as toFrameId } from "./manifest-DPZ3WNg_.mjs";
|
|
|
2
2
|
import { a as workActivity } from "./work-DJxH7cCX.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-B1FKOM1e.mjs";
|
|
6
6
|
import { i as onPath, t as AGENT_BIN } from "./agent-BsieQGTD.mjs";
|
|
7
7
|
import { r as uncheckedAnchor } from "./anchor-5H1vnoLu.mjs";
|
|
8
8
|
import { S as writeOffers, _ as readPrefs, f as patchConn, g as readOffers, h as readConn, l as listConns, m as pingLine, n as closeConn, o as eligible, p as pidAlive, r as connDir, t as alive } from "./conn-BMiHS42T.mjs";
|
|
9
|
-
import { hookBin } from "./connectors-
|
|
9
|
+
import { hookBin } from "./connectors-DekQvKt9.mjs";
|
|
10
10
|
import { answer, reqDir, sweep, takeRequests, verify } from "./transport-C5FnY9ni.mjs";
|
|
11
11
|
import { i as record, t as has } from "./ledger-D54iROST.mjs";
|
|
12
|
-
import { C as
|
|
13
|
-
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-
|
|
14
|
-
import { act, addCapture, addWrapup, answeredSince, beginStep, captureComment, captureIntact, conflictStep, createQueue, ctxFor, endSession, endStep, fail, form, joinAlone, looksGood, moreWrapup, n as releaseLock, ownerOnly, payloadKey, pending, prune, redelivering, requeue, runsAlone, sameComment, settle, startSession, stillOwned, t as acquireLock, textOf, undelivered, wrapupIntact, wrapupOf } from "./queue-
|
|
15
|
-
import {
|
|
12
|
+
import { C as refusedAsk, S as parseMembers, T as sharedWhy, _ as wordsUntil, a as checkRecord, b as packetPath, c as firstPoint, d as packetPictures, f as picturePath, g as wordsSince, h as storeCapture, m as requestWords, n as captureFrames, o as continues, p as readCapture, r as captureWords, t as CAPTURE_ID, u as madeOf, v as buildPacket, w as sanitize, x as parseAgentText, y as goalText } from "./capture-DEtM4qm5.mjs";
|
|
13
|
+
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-VDJfXEEm.mjs";
|
|
14
|
+
import { act, addCapture, addWrapup, answeredSince, beginStep, captureComment, captureIntact, conflictStep, createQueue, ctxFor, endSession, endStep, fail, failCard, form, joinAlone, looksGood, moreWrapup, n as releaseLock, ownerOnly, payloadKey, pending, prune, redelivering, requeue, runsAlone, sameComment, settle, startSession, stillOwned, t as acquireLock, textOf, undelivered, wrapupIntact, wrapupOf } from "./queue-DeSQm24g.mjs";
|
|
15
|
+
import { d as logJam } from "./perf-BCxAo0IS.mjs";
|
|
16
|
+
import { i as jamLive } from "./plugin-CXRoMA8g.mjs";
|
|
16
17
|
import { t as PROTECTED_GLOBS } from "./permit-DDa6wqOs.mjs";
|
|
17
18
|
import { jamReservations, restoreHolds } from "./reserve-BURNQ2Y3.mjs";
|
|
18
|
-
import { jamLive } from "./live-Cgzsicwi.mjs";
|
|
19
19
|
import { closeSync, existsSync, lstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, readdirSync, realpathSync, rmSync, statSync, watch, writeFileSync } from "node:fs";
|
|
20
20
|
import { basename, dirname, isAbsolute, join, relative, sep } from "node:path";
|
|
21
21
|
import { fileURLToPath } from "node:url";
|
|
@@ -1095,6 +1095,16 @@ function newestAny(root, can, env = process.env) {
|
|
|
1095
1095
|
return all.sort((a, b) => t(b) - t(a))[0] ?? null;
|
|
1096
1096
|
}
|
|
1097
1097
|
const forkable = (s) => !!s && existsSync(s.file) && s.bytes <= 12582912;
|
|
1098
|
+
/** A claimed run with no word from its session in this long is stalled - the owner decides. */
|
|
1099
|
+
const STALL_MS = 9e5;
|
|
1100
|
+
/** STALL_MS, or the suite's MV_JAM_STALL_MS for a dev server a test starts - read in the suite's build only, with
|
|
1101
|
+
* MARVER_SLOT_BASE set (test-build.ts; as perf-run.ts's MV_PERF_RUN_T): a real stall in seconds, so a browser case
|
|
1102
|
+
* drives one through this daemon and the page's own actions. */
|
|
1103
|
+
const stallMs = () => {
|
|
1104
|
+
if (!process.env.MARVER_SLOT_BASE) return STALL_MS;
|
|
1105
|
+
const v = Number(process.env.MV_JAM_STALL_MS);
|
|
1106
|
+
return Number.isFinite(v) && v > 0 ? v : STALL_MS;
|
|
1107
|
+
};
|
|
1098
1108
|
/** How long a request's answer is kept for the same request sent again. */
|
|
1099
1109
|
const RECEIPT_MS = 6e5;
|
|
1100
1110
|
/** The longest final message a session hands back (its replies, not its work). */
|
|
@@ -1903,11 +1913,12 @@ function createRuns(d) {
|
|
|
1903
1913
|
if (writerGone(claim)) await finishStop(b.batchId);
|
|
1904
1914
|
continue;
|
|
1905
1915
|
}
|
|
1906
|
-
const quiet = writerGone(claim) || now - claim.progress >
|
|
1916
|
+
const quiet = writerGone(claim) || now - claim.progress > stallMs();
|
|
1907
1917
|
if (!claim.stalled && quiet) {
|
|
1908
1918
|
await q.lock(() => {
|
|
1909
1919
|
const x = byId(b.batchId)?.claim;
|
|
1910
1920
|
if (x && x.result === void 0 && !x.stopping) {
|
|
1921
|
+
if (!x.stalled) x.stalls = (x.stalls ?? 0) + 1;
|
|
1911
1922
|
x.stalled = true;
|
|
1912
1923
|
q.persist();
|
|
1913
1924
|
}
|
|
@@ -2075,6 +2086,7 @@ function createRuns(d) {
|
|
|
2075
2086
|
agent: b.runner.agent,
|
|
2076
2087
|
batch: b.batchId,
|
|
2077
2088
|
...b.claim ? { gen: b.claim.gen } : {},
|
|
2089
|
+
...b.claim?.stalls ? { stalls: b.claim.stalls } : {},
|
|
2078
2090
|
...state ? { state } : {},
|
|
2079
2091
|
...b.runner.why ? { why: b.runner.why } : {}
|
|
2080
2092
|
};
|
|
@@ -2960,6 +2972,7 @@ function createJam(root, cfg, adapter, log = () => {}, hooks = {}) {
|
|
|
2960
2972
|
m.brief = brief;
|
|
2961
2973
|
}
|
|
2962
2974
|
const t = c.thread ? threadsOf(m.board).find((x) => x.id === c.thread) : void 0;
|
|
2975
|
+
const pictures = packetPictures(root, brief);
|
|
2963
2976
|
members.push({
|
|
2964
2977
|
id: m.id,
|
|
2965
2978
|
card: c.id,
|
|
@@ -2968,19 +2981,15 @@ function createJam(root, cfg, adapter, log = () => {}, hooks = {}) {
|
|
|
2968
2981
|
...c.thread ? { thread: c.thread } : {},
|
|
2969
2982
|
frames: c.frames,
|
|
2970
2983
|
...t?.anchor !== void 0 ? { anchor: t.anchor } : {},
|
|
2971
|
-
brief
|
|
2984
|
+
brief,
|
|
2985
|
+
...pictures.length ? { pictures } : {}
|
|
2972
2986
|
});
|
|
2973
2987
|
}
|
|
2974
2988
|
if (bad.length) {
|
|
2975
2989
|
await q.lock((j) => {
|
|
2976
2990
|
for (const id of bad) {
|
|
2977
2991
|
const c = j.cards.find((x) => x.id === id);
|
|
2978
|
-
if (c && c.state === "working")
|
|
2979
|
-
c.state = "failed";
|
|
2980
|
-
c.note = c.kind === "wrapup" ? "the session record changed after it was written - write it again" : "interrupted - Retry";
|
|
2981
|
-
c.rev += 1;
|
|
2982
|
-
c.at = Date.now();
|
|
2983
|
-
}
|
|
2992
|
+
if (c && c.state === "working") failCard(j, c, c.kind === "wrapup" ? "the session record changed after it was written - write it again" : "interrupted - Retry", Date.now());
|
|
2984
2993
|
}
|
|
2985
2994
|
q.persist();
|
|
2986
2995
|
});
|
|
@@ -3870,17 +3879,11 @@ function createJam(root, cfg, adapter, log = () => {}, hooks = {}) {
|
|
|
3870
3879
|
const c = j.cards.find((x) => x.id === m.card);
|
|
3871
3880
|
if (!c) continue;
|
|
3872
3881
|
if (c.capture && !captureIntact(j, ctx, c.capture)) {
|
|
3873
|
-
c
|
|
3874
|
-
c.note = "the capture changed after it was confirmed - capture it again";
|
|
3875
|
-
c.rev += 1;
|
|
3876
|
-
c.at = Date.now();
|
|
3882
|
+
failCard(j, c, "the capture changed after it was confirmed - capture it again", Date.now());
|
|
3877
3883
|
continue;
|
|
3878
3884
|
}
|
|
3879
3885
|
if (c.kind === "wrapup" && !wrapupIntact(ctx, c)) {
|
|
3880
|
-
c
|
|
3881
|
-
c.note = "the session record changed after it was written - write it again";
|
|
3882
|
-
c.rev += 1;
|
|
3883
|
-
c.at = Date.now();
|
|
3886
|
+
failCard(j, c, "the session record changed after it was written - write it again", Date.now());
|
|
3884
3887
|
continue;
|
|
3885
3888
|
}
|
|
3886
3889
|
const comment = c.kind === "comment";
|
|
@@ -3925,12 +3928,7 @@ function createJam(root, cfg, adapter, log = () => {}, hooks = {}) {
|
|
|
3925
3928
|
b.note = "its packet is gone";
|
|
3926
3929
|
for (const m of b.members) {
|
|
3927
3930
|
const c = j.cards.find((x) => x.id === m.card);
|
|
3928
|
-
if (c)
|
|
3929
|
-
c.state = "failed";
|
|
3930
|
-
c.note = "interrupted - Retry";
|
|
3931
|
-
c.rev += 1;
|
|
3932
|
-
c.at = Date.now();
|
|
3933
|
-
}
|
|
3931
|
+
if (c) failCard(j, c, "interrupted - Retry", Date.now());
|
|
3934
3932
|
}
|
|
3935
3933
|
continue;
|
|
3936
3934
|
}
|
|
@@ -4182,6 +4180,7 @@ function createJam(root, cfg, adapter, log = () => {}, hooks = {}) {
|
|
|
4182
4180
|
} : void 0;
|
|
4183
4181
|
const position = c.state === "queued" && !busy && !full(c) ? queued.indexOf(c) + 1 : void 0;
|
|
4184
4182
|
const waiting = c.state === "queued" && exclusiveAhead === "waiting" && alone(c) ? "alone" : c.state === "queued" && exclusiveAhead ? "behind" : c.state === "queued" && full(c) ? "session" : void 0;
|
|
4183
|
+
const fails = c.batch ? j.batches.find((b) => b.batchId === c.batch)?.failures : void 0;
|
|
4185
4184
|
return {
|
|
4186
4185
|
id: c.id,
|
|
4187
4186
|
kind: c.kind,
|
|
@@ -4195,6 +4194,8 @@ function createJam(root, cfg, adapter, log = () => {}, hooks = {}) {
|
|
|
4195
4194
|
made: c.made,
|
|
4196
4195
|
order: c.order,
|
|
4197
4196
|
at: c.at,
|
|
4197
|
+
...c.att ? { att: c.att } : {},
|
|
4198
|
+
...fails ? { fails } : {},
|
|
4198
4199
|
...c.follows ? { follows: c.follows } : {},
|
|
4199
4200
|
...c.reply ? { reply: c.reply } : {},
|
|
4200
4201
|
...c.batch ? { batch: c.batch } : {},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i as PKG, r as NAME } from "./cli.mjs";
|
|
2
|
-
import { a as notePrefer, c as ranDevBefore, f as startedWhere, i as marverHome,
|
|
2
|
+
import { _ as runIdentity, a as notePrefer, c as ranDevBefore, f as startedWhere, i as marverHome, o as originOf, p as stopPrefer, s as place, t as forgetDevTraces } from "./slots-Dn4Onb0V.mjs";
|
|
3
3
|
import { t as detectHost } from "./detect-C0wpaePX.mjs";
|
|
4
4
|
import { n as loadConfig } from "./config-BezZTiov.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { n as tailwind3Css, o as liveChanged, r as tailwind4Plugin, s as installedVersion, t as marverPlugin } from "./plugin-CXRoMA8g.mjs";
|
|
6
6
|
import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, statSync, watch, writeSync } from "node:fs";
|
|
7
7
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
@@ -1019,7 +1019,7 @@ async function boot(root, opts, instance, t, ctx) {
|
|
|
1019
1019
|
if (fromConfig !== void 0 && !placed.fellBackFrom) console.log(` this canvas keeps its own port (${fromConfig} in design/config.ts); remove it to use the slots\n`);
|
|
1020
1020
|
setTimeout(async () => {
|
|
1021
1021
|
try {
|
|
1022
|
-
await (await import("./shot-
|
|
1022
|
+
await (await import("./shot-CRRGgxru.mjs").then((n) => n.u)).sweepGhosts((m) => console.log(` ${m}`));
|
|
1023
1023
|
} catch {}
|
|
1024
1024
|
}, 0);
|
|
1025
1025
|
try {
|
|
@@ -1037,7 +1037,7 @@ async function boot(root, opts, instance, t, ctx) {
|
|
|
1037
1037
|
if (n) console.log(` ${n} feature/project board${n === 1 ? "" : "s"}, no context/ - every status reads Backlog. To start it, tell your agent: "Set up our context."\n`);
|
|
1038
1038
|
}
|
|
1039
1039
|
} catch {}
|
|
1040
|
-
const { loadCollab, syncOnce } = await import("./sync-
|
|
1040
|
+
const { loadCollab, syncOnce } = await import("./sync-CMozOwZ0.mjs").then((n) => n.o);
|
|
1041
1041
|
if (loadCollab(root)) console.log(` comments: syncing with the published canvas\n`);
|
|
1042
1042
|
let syncing = false;
|
|
1043
1043
|
const tick = async () => {
|
|
@@ -1091,6 +1091,7 @@ async function boot(root, opts, instance, t, ctx) {
|
|
|
1091
1091
|
due.set(m[1], setTimeout(() => {
|
|
1092
1092
|
due.delete(m[1]);
|
|
1093
1093
|
server.ws.send("sh:jam-comment", { board: m[1] });
|
|
1094
|
+
liveChanged();
|
|
1094
1095
|
}, 120));
|
|
1095
1096
|
}));
|
|
1096
1097
|
t.defer(() => {
|
|
@@ -1100,9 +1101,12 @@ async function boot(root, opts, instance, t, ctx) {
|
|
|
1100
1101
|
} catch {}
|
|
1101
1102
|
}
|
|
1102
1103
|
if (config.jam) {
|
|
1103
|
-
const { startJam } = await import("./daemon-
|
|
1104
|
-
const { checkAnchor } = await import("./anchor-check-
|
|
1105
|
-
const jam = startJam(root, config.jam, (m) => console.log(m), (board) =>
|
|
1104
|
+
const { startJam } = await import("./daemon-B0Wi1OQ3.mjs");
|
|
1105
|
+
const { checkAnchor } = await import("./anchor-check-c52IDkiQ.mjs");
|
|
1106
|
+
const jam = startJam(root, config.jam, (m) => console.log(m), (board) => {
|
|
1107
|
+
server.ws.send("sh:jam-comment", { board });
|
|
1108
|
+
liveChanged();
|
|
1109
|
+
}, (frameId, target, others, look) => checkAnchor({
|
|
1106
1110
|
root,
|
|
1107
1111
|
viewports: config.viewports,
|
|
1108
1112
|
origin: `http://localhost:${port}`,
|
|
@@ -1115,12 +1119,13 @@ async function boot(root, opts, instance, t, ctx) {
|
|
|
1115
1119
|
return () => {
|
|
1116
1120
|
due ??= setTimeout(async () => {
|
|
1117
1121
|
due = null;
|
|
1118
|
-
const { jamLive } = await import("./
|
|
1122
|
+
const { jamLive } = await import("./plugin-CXRoMA8g.mjs").then((n) => n.a);
|
|
1119
1123
|
server.ws.send("sh:jam-queue", jamLive.view?.() ?? { cards: [] });
|
|
1124
|
+
liveChanged();
|
|
1120
1125
|
}, 60);
|
|
1121
1126
|
};
|
|
1122
1127
|
})(), async (frameId, theme, entry, size) => {
|
|
1123
|
-
const { shootFrame } = await import("./shot-
|
|
1128
|
+
const { shootFrame } = await import("./shot-CRRGgxru.mjs").then((n) => n.u);
|
|
1124
1129
|
const r = await shootFrame({
|
|
1125
1130
|
root,
|
|
1126
1131
|
viewports: config.viewports,
|
|
@@ -1130,7 +1135,7 @@ async function boot(root, opts, instance, t, ctx) {
|
|
|
1130
1135
|
...size ? { size } : {}
|
|
1131
1136
|
});
|
|
1132
1137
|
if (!r.ok) return null;
|
|
1133
|
-
const { addPicture } = await import("./capture-
|
|
1138
|
+
const { addPicture } = await import("./capture-DEtM4qm5.mjs").then((n) => n.i);
|
|
1134
1139
|
return addPicture(root, r.path, {
|
|
1135
1140
|
frame: frameId,
|
|
1136
1141
|
...entry,
|
|
@@ -1140,8 +1145,8 @@ async function boot(root, opts, instance, t, ctx) {
|
|
|
1140
1145
|
if (jam) {
|
|
1141
1146
|
t.defer(() => jam.stop());
|
|
1142
1147
|
if (config.jam.session !== false) try {
|
|
1143
|
-
const { ensureConnectors, connectorLine } = await import("./connectors-
|
|
1144
|
-
const { jamLive } = await import("./
|
|
1148
|
+
const { ensureConnectors, connectorLine } = await import("./connectors-DekQvKt9.mjs");
|
|
1149
|
+
const { jamLive } = await import("./plugin-CXRoMA8g.mjs").then((n) => n.a);
|
|
1145
1150
|
const results = ensureConnectors(root);
|
|
1146
1151
|
jamLive.connectors = results;
|
|
1147
1152
|
const line = connectorLine(results);
|
|
@@ -1150,8 +1155,8 @@ async function boot(root, opts, instance, t, ctx) {
|
|
|
1150
1155
|
console.log(` jam: could not connect sessions - ${err.message}`);
|
|
1151
1156
|
}
|
|
1152
1157
|
const { createSpeech, speechLive } = await import("./audio-DX4POHAj.mjs");
|
|
1153
|
-
const { appendTalk } = await import("./session-
|
|
1154
|
-
const { logJam } = await import("./perf-
|
|
1158
|
+
const { appendTalk } = await import("./session-VDJfXEEm.mjs").then((n) => n.s);
|
|
1159
|
+
const { logJam } = await import("./perf-BCxAo0IS.mjs").then((n) => n.f);
|
|
1155
1160
|
const speech = createSpeech({
|
|
1156
1161
|
onTalk: (t) => appendTalk(root, t.session, t.words),
|
|
1157
1162
|
onTiming: (t) => logJam(root, {
|
|
@@ -6,7 +6,7 @@ import { r as detectAgent } from "./agent-BsieQGTD.mjs";
|
|
|
6
6
|
import { MANAGED_PREFIX, enumerateInstructionTemplates, hashBody, pkgDir } from "./managed-HwHVNI3h.mjs";
|
|
7
7
|
import { t as writeManaged } from "./managed-write-Bo-oPc-i.mjs";
|
|
8
8
|
import { n as readJson, t as detectHost } from "./detect-C0wpaePX.mjs";
|
|
9
|
-
import { connectorLine, ensureConnectors } from "./connectors-
|
|
9
|
+
import { connectorLine, ensureConnectors } from "./connectors-DekQvKt9.mjs";
|
|
10
10
|
import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
|
|
11
11
|
import { basename, dirname, join, relative } from "node:path";
|
|
12
12
|
//#region src/cli/init.ts
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { a as ROUTE } from "./cli.mjs";
|
|
2
|
+
import { closeSync, constants, fstatSync, lstatSync, mkdirSync, openSync, readSync, realpathSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { join, resolve, sep } from "node:path";
|
|
4
|
+
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
5
|
+
//#region src/server/proof.ts
|
|
6
|
+
/**
|
|
7
|
+
* The document proof (spec 28 A1.4). The Mac app puts a fresh nonce on every main-frame request to a
|
|
8
|
+
* local canvas (`x-mv-nonce`) and checks the answer before the document commits; only the canvas
|
|
9
|
+
* holding the slot file's key can sign it, so the privileges the app grants belong to that exact
|
|
10
|
+
* document. The proof rides the very response the app commits - the check and the load can never
|
|
11
|
+
* reach different listeners.
|
|
12
|
+
*
|
|
13
|
+
* Pinned exactly, so the app (A2.3 `proof.ts`) computes the same: the key is the slot file's 32 bytes
|
|
14
|
+
* (base64url there), HMAC-SHA256 over UTF-8 `doc|<nonce>|<port>` (port in decimal), base64url without
|
|
15
|
+
* padding. Requests from the app itself carry `app|<port>` the same way, and the logo the app fetches
|
|
16
|
+
* (`GET /__mv/logo`, spec 28 A2.4) `logo|<nonce>|<port>`: a listener that took the port after the tab was
|
|
17
|
+
* verified can never hand it a logo. The live stream (`GET /__mv/app/live`, A4.6 #6) is proved both ways: the
|
|
18
|
+
* request carries `x-mv-app` (`appProof`, checked by `appProofOk`), the answer `live|<nonce>|<port>` - a
|
|
19
|
+
* listener that took the port after a canvas stopped can never put words into a notice.
|
|
20
|
+
*/
|
|
21
|
+
/** 16-64 base64url characters - anything else is not a nonce, and is ignored. */
|
|
22
|
+
const NONCE = /^[A-Za-z0-9_-]{16,64}$/;
|
|
23
|
+
const sign$1 = (key, msg) => createHmac("sha256", key).update(msg, "utf8").digest("base64url");
|
|
24
|
+
const docProof = (key, nonce, port) => sign$1(key, `doc|${nonce}|${port}`);
|
|
25
|
+
const appProof = (key, port) => sign$1(key, `app|${port}`);
|
|
26
|
+
const logoProof = (key, nonce, port) => sign$1(key, `logo|${nonce}|${port}`);
|
|
27
|
+
const liveProof = (key, nonce, port) => sign$1(key, `live|${nonce}|${port}`);
|
|
28
|
+
const PROOFS = {
|
|
29
|
+
doc: docProof,
|
|
30
|
+
logo: logoProof,
|
|
31
|
+
live: liveProof
|
|
32
|
+
};
|
|
33
|
+
/** The two headers for a request carrying a well-formed `x-mv-nonce`, else null: over the shell's document
|
|
34
|
+
* (`doc`), the logo (`logo`) or the live stream (`live`). */
|
|
35
|
+
function proofHeaders(p, nonce, kind = "doc") {
|
|
36
|
+
if (!p || typeof nonce !== "string" || !NONCE.test(nonce)) return null;
|
|
37
|
+
return {
|
|
38
|
+
"x-mv-instance": p.instance,
|
|
39
|
+
"x-mv-proof": PROOFS[kind](p.key, nonce, p.port)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** Is this `x-mv-app` header the app's own, `appProof(key, port)`? Compared in constant time over equal lengths;
|
|
43
|
+
* anything but one string is no. The HMAC is never relaxed: no cookie, no token stands in for it (A4.6 #6). */
|
|
44
|
+
function appProofOk(p, header) {
|
|
45
|
+
if (typeof header !== "string") return false;
|
|
46
|
+
const got = Buffer.from(header);
|
|
47
|
+
const want = Buffer.from(appProof(p.key, p.port));
|
|
48
|
+
return got.length === want.length && timingSafeEqual(got, want);
|
|
49
|
+
}
|
|
50
|
+
/** The type each sniffed logo is served with. */
|
|
51
|
+
const LOGO_MIME = {
|
|
52
|
+
png: "image/png",
|
|
53
|
+
ico: "image/x-icon",
|
|
54
|
+
svg: "image/svg+xml"
|
|
55
|
+
};
|
|
56
|
+
const PNG = [
|
|
57
|
+
137,
|
|
58
|
+
80,
|
|
59
|
+
78,
|
|
60
|
+
71,
|
|
61
|
+
13,
|
|
62
|
+
10,
|
|
63
|
+
26,
|
|
64
|
+
10
|
|
65
|
+
];
|
|
66
|
+
/** The logo type these bytes are, or null when they are none of the three. */
|
|
67
|
+
function sniffLogo(b) {
|
|
68
|
+
if (b.length >= PNG.length && PNG.every((x, i) => b[i] === x)) return "png";
|
|
69
|
+
if (b.length >= 4 && b[0] === 0 && b[1] === 0 && b[2] === 1 && b[3] === 0) return "ico";
|
|
70
|
+
return svgRoot(b) ? "svg" : null;
|
|
71
|
+
}
|
|
72
|
+
/** Is this UTF-8 text an SVG document: its root element `<svg`, with only the prolog A2.14 #24 allows before it? */
|
|
73
|
+
function svgRoot(b) {
|
|
74
|
+
let s;
|
|
75
|
+
try {
|
|
76
|
+
s = new TextDecoder("utf-8", { fatal: true }).decode(b);
|
|
77
|
+
} catch {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
let i = s.charCodeAt(0) === 65279 ? 1 : 0;
|
|
81
|
+
const space = () => {
|
|
82
|
+
while (i < s.length && /\s/.test(s[i])) i++;
|
|
83
|
+
};
|
|
84
|
+
space();
|
|
85
|
+
if (s.startsWith("<?xml", i) && /[\s?]/.test(s[i + 5] ?? "")) {
|
|
86
|
+
const end = s.indexOf("?>", i);
|
|
87
|
+
if (end < 0) return false;
|
|
88
|
+
i = end + 2;
|
|
89
|
+
}
|
|
90
|
+
let doctype = false;
|
|
91
|
+
for (;;) {
|
|
92
|
+
space();
|
|
93
|
+
if (s.startsWith("<!--", i)) {
|
|
94
|
+
const end = s.indexOf("-->", i + 4);
|
|
95
|
+
if (end < 0) return false;
|
|
96
|
+
i = end + 3;
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
if (s.startsWith("<!DOCTYPE", i)) {
|
|
100
|
+
if (doctype) return false;
|
|
101
|
+
doctype = true;
|
|
102
|
+
const end = doctypeEnd(s, i + 9);
|
|
103
|
+
if (end < 0) return false;
|
|
104
|
+
i = end;
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
return s.startsWith("<svg", i) && /[\s>/]/.test(s[i + 4] ?? "");
|
|
110
|
+
}
|
|
111
|
+
/** Just past the `>` that closes a `<!DOCTYPE svg ...>` whose body starts at `i`, or -1: another root name, an
|
|
112
|
+
* internal subset (`[` outside quotes) or no end. Quoted public and system ids may hold anything but their quote. */
|
|
113
|
+
function doctypeEnd(s, i) {
|
|
114
|
+
if (!/\s/.test(s[i] ?? "")) return -1;
|
|
115
|
+
while (i < s.length && /\s/.test(s[i])) i++;
|
|
116
|
+
if (!s.startsWith("svg", i) || !/[\s>]/.test(s[i + 3] ?? "")) return -1;
|
|
117
|
+
i += 3;
|
|
118
|
+
while (i < s.length) {
|
|
119
|
+
const c = s[i];
|
|
120
|
+
if (c === ">") return i + 1;
|
|
121
|
+
if (c === "[") return -1;
|
|
122
|
+
if (c === "\"" || c === "'") {
|
|
123
|
+
const close = s.indexOf(c, i + 1);
|
|
124
|
+
if (close < 0) return -1;
|
|
125
|
+
i = close + 1;
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
i++;
|
|
129
|
+
}
|
|
130
|
+
return -1;
|
|
131
|
+
}
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/server/logo.ts
|
|
134
|
+
const LOGO_LADDER = [
|
|
135
|
+
"design/logo.svg",
|
|
136
|
+
"design/logo.png",
|
|
137
|
+
"public/logo.svg",
|
|
138
|
+
"public/logo.png",
|
|
139
|
+
"public/favicon.svg",
|
|
140
|
+
"public/favicon.png",
|
|
141
|
+
"public/favicon.ico"
|
|
142
|
+
];
|
|
143
|
+
/** The first candidate that passes every check, read whole; null when none does. `warn` hears why a `share.logo`
|
|
144
|
+
* was ignored (the ladder's own entries are tried quietly: most repos have none of them). */
|
|
145
|
+
function findLogo(root, shareLogo, warn) {
|
|
146
|
+
let realRoot;
|
|
147
|
+
try {
|
|
148
|
+
realRoot = realpathSync(root);
|
|
149
|
+
} catch {
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
const own = typeof shareLogo === "string" && shareLogo !== "" ? shareLogo : null;
|
|
153
|
+
for (const cand of new Set(own ? [own, ...LOGO_LADDER] : LOGO_LADDER)) {
|
|
154
|
+
const r = readLogo(realRoot, resolve(realRoot, cand));
|
|
155
|
+
if (typeof r !== "string") return {
|
|
156
|
+
...r,
|
|
157
|
+
from: cand
|
|
158
|
+
};
|
|
159
|
+
if (cand === own) warn?.(`share.logo ${own} is ignored: ${r}`);
|
|
160
|
+
}
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
/** One candidate: its bytes and type, or why it does not count. */
|
|
164
|
+
function readLogo(realRoot, file) {
|
|
165
|
+
let st;
|
|
166
|
+
try {
|
|
167
|
+
st = lstatSync(file);
|
|
168
|
+
} catch (e) {
|
|
169
|
+
return e.code === "ENOENT" || e.code === "ENOTDIR" ? "no such file" : "unreadable";
|
|
170
|
+
}
|
|
171
|
+
if (st.isSymbolicLink()) return "a symlink";
|
|
172
|
+
if (!st.isFile()) return "not a file";
|
|
173
|
+
if (!/\.(svg|png|ico)$/i.test(file)) return "not .svg, .png or .ico";
|
|
174
|
+
if (st.size > 262144) return "over 256 KB";
|
|
175
|
+
let real;
|
|
176
|
+
try {
|
|
177
|
+
real = realpathSync(file);
|
|
178
|
+
} catch {
|
|
179
|
+
return "unreadable";
|
|
180
|
+
}
|
|
181
|
+
if (!real.startsWith(realRoot + sep)) return "outside the repo";
|
|
182
|
+
let fd;
|
|
183
|
+
try {
|
|
184
|
+
fd = openSync(real, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
185
|
+
} catch {
|
|
186
|
+
return "unreadable";
|
|
187
|
+
}
|
|
188
|
+
try {
|
|
189
|
+
const f = fstatSync(fd);
|
|
190
|
+
if (!f.isFile() || f.ino !== st.ino || f.dev !== st.dev) return "changed while it was read";
|
|
191
|
+
const buf = Buffer.alloc(262145);
|
|
192
|
+
let n = 0;
|
|
193
|
+
for (let k = 1; k > 0 && n < buf.length; n += k) k = readSync(fd, buf, n, buf.length - n, null);
|
|
194
|
+
if (n > 262144) return "over 256 KB";
|
|
195
|
+
const bytes = Buffer.from(buf.subarray(0, n));
|
|
196
|
+
const type = sniffLogo(bytes);
|
|
197
|
+
return type ? {
|
|
198
|
+
type,
|
|
199
|
+
bytes
|
|
200
|
+
} : "not an image (PNG, ICO or SVG)";
|
|
201
|
+
} catch {
|
|
202
|
+
return "unreadable";
|
|
203
|
+
} finally {
|
|
204
|
+
closeSync(fd);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/** `marver build`: the logo into `<outDir>/__mv/logo.<type>` (an `.ico` as `logo.ico`), by its bytes - never a copy
|
|
208
|
+
* that follows a link. Its published path, or undefined when the repo has none. */
|
|
209
|
+
function publishLogo(root, shareLogo, outDir, warn) {
|
|
210
|
+
const logo = findLogo(root, shareLogo, warn);
|
|
211
|
+
if (!logo) return void 0;
|
|
212
|
+
const dir = join(outDir, ROUTE.slice(1));
|
|
213
|
+
mkdirSync(dir, { recursive: true });
|
|
214
|
+
writeFileSync(join(dir, `logo.${logo.type}`), logo.bytes);
|
|
215
|
+
return `${ROUTE}/logo.${logo.type}`;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* The repo's logo as the `<link rel="icon">` of the published shell and gate (spec 28 A4.6 #46, marver 0.29.0): a
|
|
219
|
+
* browser tab, and the Mac app's tab for a shared canvas, wear the repo's logo. `logo` is `publishLogo`'s answer
|
|
220
|
+
* (`meta.json`'s `logo`); '' for none - or anything else, never written into the page.
|
|
221
|
+
*/
|
|
222
|
+
function logoIconLink(logo) {
|
|
223
|
+
const m = typeof logo === "string" ? new RegExp(`^${ROUTE}/logo\\.(svg|png|ico)$`).exec(logo) : null;
|
|
224
|
+
return m ? `<link rel="icon" type="${LOGO_MIME[m[1]]}" href="${logo}" />` : "";
|
|
225
|
+
}
|
|
226
|
+
/** A tab icon's `<link>`, its line's indent and line end with it: `rel="icon"` or `"shortcut icon"`, in any quotes,
|
|
227
|
+
* padded or not, and attribute order. `apple-touch-icon` and the manifest are no tab icon. */
|
|
228
|
+
const TAB_ICON = /[ \t]*<link\b(?=[^>]*\srel\s*=\s*["']?\s*(?:shortcut\s+)?icon["'\s/>])[^>]*>[ \t]*\r?\n?/gi;
|
|
229
|
+
/**
|
|
230
|
+
* A page's HTML with the logo's icon as its only tab icon (A4.6 #46; release review P2): the logo's line takes the
|
|
231
|
+
* first `<link rel="icon">`'s place and every other one goes - Marver's own set beside it would compete, since a
|
|
232
|
+
* browser picks among icons by type and size, the last declared among equals, never simply the first. The Mac app's
|
|
233
|
+
* shared tab picks the logo by its path from whatever a page lists (app/src/shared/links.ts remoteFaviconPick). No
|
|
234
|
+
* logo: the page as it was, Marver's set its icons. No icon line: the logo's at the head's end.
|
|
235
|
+
*/
|
|
236
|
+
function logoIcons(html, logo) {
|
|
237
|
+
const link = logoIconLink(logo);
|
|
238
|
+
if (!link) return html;
|
|
239
|
+
let placed = false;
|
|
240
|
+
const out = html.replace(TAB_ICON, (line) => {
|
|
241
|
+
if (placed) return "";
|
|
242
|
+
placed = true;
|
|
243
|
+
return line.replace(/<link\b[^>]*>/i, () => link);
|
|
244
|
+
});
|
|
245
|
+
if (placed) return out;
|
|
246
|
+
return html.includes("</head>") ? html.replace("</head>", () => `${link}\n</head>`) : html;
|
|
247
|
+
}
|
|
248
|
+
/** A strong `ETag` for these bytes. */
|
|
249
|
+
const logoTag = (bytes) => `"${createHash("sha256").update(bytes).digest("base64url").slice(0, 22)}"`;
|
|
250
|
+
/** Does an `If-None-Match` name this tag (a list, a weak tag, or `*`)? */
|
|
251
|
+
function matches(header, tag) {
|
|
252
|
+
if (typeof header !== "string") return false;
|
|
253
|
+
return header.split(",").map((t) => t.trim().replace(/^W\//, "")).some((t) => t === "*" || t === tag);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* `marver dev`'s `GET|HEAD /__mv/logo`. Read once per request (256 KB at most), checked, and answered with its sniffed
|
|
257
|
+
* type, an `ETag` and `Cache-Control: no-cache`; `x-content-type-options: nosniff` and a CSP that runs nothing, so an
|
|
258
|
+
* SVG opened as a page is a picture. A request carrying a well-formed `x-mv-nonce` gets the logo proof
|
|
259
|
+
* (`x-mv-instance`, `x-mv-proof` over `logo|<nonce>|<port>`), on a 200 and a 304 alike. 404 when the repo has none.
|
|
260
|
+
*/
|
|
261
|
+
function logoRoute(root, shareLogo, proof) {
|
|
262
|
+
const warned = /* @__PURE__ */ new Set();
|
|
263
|
+
const warn = (m) => {
|
|
264
|
+
if (warned.has(m)) return;
|
|
265
|
+
warned.add(m);
|
|
266
|
+
console.warn(` marver: ${m}`);
|
|
267
|
+
};
|
|
268
|
+
return (req, res, next) => {
|
|
269
|
+
let path;
|
|
270
|
+
try {
|
|
271
|
+
path = new URL(req.url ?? "/", "http://x").pathname;
|
|
272
|
+
} catch {
|
|
273
|
+
return next();
|
|
274
|
+
}
|
|
275
|
+
if (path !== `/__mv/logo`) return next();
|
|
276
|
+
if (req.method !== "GET" && req.method !== "HEAD") {
|
|
277
|
+
res.statusCode = 405;
|
|
278
|
+
res.setHeader("allow", "GET, HEAD");
|
|
279
|
+
return res.end();
|
|
280
|
+
}
|
|
281
|
+
const logo = findLogo(root, shareLogo(), warn);
|
|
282
|
+
if (!logo) {
|
|
283
|
+
res.statusCode = 404;
|
|
284
|
+
res.setHeader("cache-control", "no-store");
|
|
285
|
+
return res.end();
|
|
286
|
+
}
|
|
287
|
+
const tag = logoTag(logo.bytes);
|
|
288
|
+
res.setHeader("content-type", LOGO_MIME[logo.type]);
|
|
289
|
+
res.setHeader("etag", tag);
|
|
290
|
+
res.setHeader("cache-control", "no-cache");
|
|
291
|
+
res.setHeader("vary", "x-mv-nonce");
|
|
292
|
+
res.setHeader("x-content-type-options", "nosniff");
|
|
293
|
+
res.setHeader("content-security-policy", "default-src 'none'; style-src 'unsafe-inline'");
|
|
294
|
+
const signed = proofHeaders(proof, req.headers["x-mv-nonce"], "logo");
|
|
295
|
+
if (signed) for (const [k, v] of Object.entries(signed)) res.setHeader(k, v);
|
|
296
|
+
if (matches(req.headers["if-none-match"], tag)) {
|
|
297
|
+
res.statusCode = 304;
|
|
298
|
+
return res.end();
|
|
299
|
+
}
|
|
300
|
+
res.setHeader("content-length", String(logo.bytes.length));
|
|
301
|
+
res.end(req.method === "HEAD" ? void 0 : logo.bytes);
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
//#endregion
|
|
305
|
+
export { appProofOk as a, publishLogo as i, logoIcons as n, proofHeaders as o, logoRoute as r, logoIconLink as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as NAME } from "./cli.mjs";
|
|
2
|
-
import { l as readRunning, n as formatRunning } from "./slots-
|
|
2
|
+
import { l as readRunning, n as formatRunning } from "./slots-Dn4Onb0V.mjs";
|
|
3
3
|
//#region src/cli/ls.ts
|
|
4
4
|
/**
|
|
5
5
|
* `marver ls` (spec 28 A1.5): the canvases running on this Mac, read from the registry
|
|
@@ -87,6 +87,9 @@ function compare(was, now, deps, ids, boot, only) {
|
|
|
87
87
|
/** App code: outside design/, and code (a component, a helper) - not content like a spec's markdown. */
|
|
88
88
|
const isApp = (rel) => !rel.startsWith("design/") && /\.(tsx?|jsx?|mjs|cjs)$/.test(rel);
|
|
89
89
|
//#endregion
|
|
90
|
+
//#region src/shared/marks.ts
|
|
91
|
+
const isNew = (m, id) => !!m && (m.changed[id] ?? 0) > (m.seen[id] ?? 0);
|
|
92
|
+
//#endregion
|
|
90
93
|
//#region src/server/marks.ts
|
|
91
94
|
/**
|
|
92
95
|
* Sidebar marks, the dev server's half (spec 25, made exact by spec 26): which frames changed, and
|
|
@@ -111,6 +114,7 @@ const isApp = (rel) => !rel.startsWith("design/") && /\.(tsx?|jsx?|mjs|cjs)$/.te
|
|
|
111
114
|
var marks_exports = /* @__PURE__ */ __exportAll({
|
|
112
115
|
docRev: () => docRev,
|
|
113
116
|
docRevs: () => docRevs,
|
|
117
|
+
freshFrames: () => freshFrames,
|
|
114
118
|
initMarks: () => initMarks,
|
|
115
119
|
markSeen: () => markSeen,
|
|
116
120
|
observe: () => observe,
|
|
@@ -375,6 +379,21 @@ function readMarks(root, manifest) {
|
|
|
375
379
|
const st = state(root, manifest.frames);
|
|
376
380
|
return st && snapshot(root, manifest, st);
|
|
377
381
|
}
|
|
382
|
+
/** The frames new to the owner now, for the live stream (spec 28 A4.6 #7): the running server's own state read with
|
|
383
|
+
* the pure `isNew` - never `projectMarks` (the next boot's view, from disk) nor `readMarks` (it reads every board
|
|
384
|
+
* file). Never loads a state: marks off, or not started, is none. */
|
|
385
|
+
function freshFrames(root, frames) {
|
|
386
|
+
const st = states.get(root);
|
|
387
|
+
if (!st || st === "off") return [];
|
|
388
|
+
const m = {
|
|
389
|
+
epoch: st.epoch,
|
|
390
|
+
changed: st.changed,
|
|
391
|
+
doc: st.doc,
|
|
392
|
+
seen: st.seen,
|
|
393
|
+
boards: {}
|
|
394
|
+
};
|
|
395
|
+
return frames.map((f) => f.id).filter((id) => isNew(m, id));
|
|
396
|
+
}
|
|
378
397
|
/** The marks as the next `marver dev` would see them, from the files alone - nothing is written, so
|
|
379
398
|
* looking never starts the clock. `null` before the first `marver dev` on 0.25. */
|
|
380
399
|
function projectMarks(root, manifest) {
|
|
@@ -394,4 +413,4 @@ function projectMarks(root, manifest) {
|
|
|
394
413
|
return snapshot(root, manifest, st);
|
|
395
414
|
}
|
|
396
415
|
//#endregion
|
|
397
|
-
export {
|
|
416
|
+
export { marks_exports as a, recordChanged as c, initMarks as i, isNew as l, docRevs as n, observe as o, freshFrames as r, projectMarks as s, docRev as t };
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { s as scanFrames } from "./manifest-DPZ3WNg_.mjs";
|
|
2
2
|
import { r as replay, t as asks } from "./events-CLH4ijKP.mjs";
|
|
3
3
|
import { a as readLog, i as listBoards } from "./comments-0BSbb04K.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { answers } from "./queue-
|
|
4
|
+
import { l as isNew, s as projectMarks } from "./marks-BnNANic9.mjs";
|
|
5
|
+
import { answers } from "./queue-DeSQm24g.mjs";
|
|
6
6
|
import { join } from "node:path";
|
|
7
|
-
//#region src/shared/marks.ts
|
|
8
|
-
const isNew = (m, id) => !!m && (m.changed[id] ?? 0) > (m.seen[id] ?? 0);
|
|
9
|
-
//#endregion
|
|
10
7
|
//#region src/cli/marks.ts
|
|
11
8
|
/**
|
|
12
9
|
* `marver marks` (spec 26): what the human has not reviewed yet - the frames waiting on them (a
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as avatarSourceFor, n as attachAvatar, p as provisionFromMarverId } from "./auth-Dix8wrXV.mjs";
|
|
2
2
|
import { TransactionStore, browserBinding, verifyAssertion } from "./marver-id-CVCoaMGI.mjs";
|
|
3
|
-
import { t as poweredByUrl } from "./serve-
|
|
3
|
+
import { t as poweredByUrl } from "./serve-DQv3Ti6X.mjs";
|
|
4
4
|
import { randomBytes } from "node:crypto";
|
|
5
5
|
import { isIP } from "node:net";
|
|
6
6
|
import { lookup } from "node:dns/promises";
|