@marver-design/marver 0.28.0 → 0.29.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 +59 -0
- package/README.md +2 -2
- package/dist/{anchor-check-PHUOFj1N.mjs → anchor-check-DhlpKl2K.mjs} +1 -1
- package/dist/{build-BsAyLMT1.mjs → build-CWbrb2bl.mjs} +5 -3
- package/dist/{capture-DdZ6xgoz.mjs → capture-DEtM4qm5.mjs} +168 -5
- package/dist/cli.mjs +10 -10
- 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-Sc_z8gT6.mjs} +28 -29
- package/dist/{dev-D7YS7iT2.mjs → dev-DWBKQhxf.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-Denssrko.mjs} +43 -25
- package/dist/{perf-jam-QxD_UnzN.mjs → perf-jam-CLkERSHo.mjs} +8 -1
- package/dist/{plugin-C_0yb-Fq.mjs → plugin-DqoZB-D6.mjs} +511 -298
- package/dist/{poster-DHi6I1fO.mjs → poster-CrsjqhY4.mjs} +1 -1
- package/dist/{profile-jIS6BcAs.mjs → profile-B1FKOM1e.mjs} +1 -1
- package/dist/{publish-bakes-r4PEZuPl.mjs → publish-bakes-DW-NDgU2.mjs} +3 -3
- package/dist/{queue-c-6aTHEz.mjs → queue-DeSQm24g.mjs} +29 -14
- package/dist/{recover-nrLEVLyJ.mjs → recover-GtJ9UDAB.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-T04Ixrvq.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/boards-and-folders.md +11 -0
- package/docs/jam-session.md +12 -3
- package/docs/live-jam.md +3 -0
- package/docs/performance.md +1 -1
- package/docs/publish.md +7 -0
- package/package.json +1 -1
- package/src/client/shell/Comments.tsx +5 -4
- package/src/client/shell/ContextMenu.tsx +5 -4
- package/src/client/shell/JamSurface.tsx +80 -9
- package/src/client/shell/Play.tsx +16 -4
- package/src/client/shell/api.ts +7 -3
- package/src/client/shell/app-bridge.ts +11 -3
- package/src/client/shell/comments-store.ts +14 -0
- package/src/client/shell/goto.ts +4 -3
- package/src/client/shell/jam-capture.ts +39 -15
- package/src/client/shell/jam-keys.ts +166 -40
- package/src/client/shell/jam-lines.ts +10 -1
- package/src/client/shell/jam-panel.tsx +8 -6
- package/src/client/shell/jam-queue.ts +6 -1
- package/src/client/shell/jam-session.tsx +2 -2
- package/src/client/shell/jam-state.ts +19 -4
- package/src/client/shell/jam-ui.tsx +4 -0
- package/src/client/shell/live-picture.ts +134 -0
- package/src/client/shell/open-item.ts +83 -0
- package/src/client/shell/open-resolve.ts +50 -0
- package/src/client/shell/store.ts +6 -2
- package/src/client/shell/styles.css +2 -0
- package/src/client/stage/main.tsx +30 -8
- package/src/shared/app-api.ts +173 -3
- package/src/shared/app-perf.ts +4 -2
- package/templates/instructions/jam.md +4 -0
- package/dist/live-Cgzsicwi.mjs +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as capture, p as findChrome } from "./shot-
|
|
1
|
+
import { i as capture, p as findChrome } from "./shot-T04Ixrvq.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 { p as findChrome, s as planShot } from "./shot-
|
|
4
|
-
import { MIME } from "./serve-
|
|
2
|
+
import { c as ASK_MAX, l as bakeBatch } from "./plugin-DqoZB-D6.mjs";
|
|
3
|
+
import { p as findChrome, s as planShot } from "./shot-T04Ixrvq.mjs";
|
|
4
|
+
import { MIME } from "./serve-DQv3Ti6X.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,10 +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-
|
|
4
|
+
import { n as localProfile } from "./profile-B1FKOM1e.mjs";
|
|
5
5
|
import { a as deviceId, r as owned } from "./ledger-D54iROST.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import { i as readWrapup, o as recordPathProblem } from "./session-
|
|
6
|
+
import { E as threadId, b as packetPath, g as wordsSince, l as hashOf, m as requestWords, n as captureFrames, p as readCapture, s as factsOf, u as madeOf, v as buildPacket, w as sanitize } from "./capture-DEtM4qm5.mjs";
|
|
7
|
+
import { i as readWrapup, o as recordPathProblem } from "./session-VDJfXEEm.mjs";
|
|
8
8
|
import { closeSync, existsSync, fsyncSync, mkdirSync, openSync, readFileSync, readdirSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
|
|
9
9
|
import { join } from "node:path";
|
|
10
10
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
@@ -186,12 +186,23 @@ const ctxFor = (root) => ({
|
|
|
186
186
|
});
|
|
187
187
|
const isOwned = (ctx, board, id) => ctx.owned.has(`${board}\t${id}`);
|
|
188
188
|
const seenKey = (board, id) => `${board}|${id}`;
|
|
189
|
+
/** Every move of a card's state but a requeue's. Entering review or failed from another state begins an episode: one
|
|
190
|
+
* more `att` (spec 28 A4.6 #9), what a live item's id hashes - a heartbeat, a rename or a re-read never changes it. */
|
|
189
191
|
const set = (c, state, now, note) => {
|
|
192
|
+
if ((state === "review" || state === "failed") && c.state !== state) c.att = (c.att ?? 0) + 1;
|
|
190
193
|
c.state = state;
|
|
191
194
|
c.rev += 1;
|
|
192
195
|
c.at = now;
|
|
193
196
|
if (note !== void 0) c.note = note;
|
|
194
197
|
};
|
|
198
|
+
/** The one way a card turns failed (A4.6 #9, r1 #1): `set` it, and when the journal holds its batch, that batch's
|
|
199
|
+
* `failures` one more - so a redelivery that fails again is a new occurrence of the same run. Several cards failing
|
|
200
|
+
* in one write add several: an id is compared, never counted. daemon.ts calls it too, never writing `failed` itself. */
|
|
201
|
+
function failCard(j, c, note, now) {
|
|
202
|
+
set(c, "failed", now, note);
|
|
203
|
+
const b = c.batch ? j.batches.find((x) => x.batchId === c.batch) : void 0;
|
|
204
|
+
if (b) b.failures = (b.failures ?? 0) + 1;
|
|
205
|
+
}
|
|
195
206
|
const onThread = (j, board, thread) => j.cards.filter((c) => c.board === board && c.thread === thread);
|
|
196
207
|
/** The frame each thread sits on (a reply names only its thread). */
|
|
197
208
|
const framesOf = (events) => {
|
|
@@ -662,24 +673,24 @@ function wrapupIntact(ctx, c) {
|
|
|
662
673
|
/** The wrap-up content a card writes from (a More work card writes from the same, its note added). */
|
|
663
674
|
const wrapupOf = (c) => c.id;
|
|
664
675
|
function validate(ctx, c, events, now, j) {
|
|
665
|
-
if (c.capture &&
|
|
666
|
-
|
|
676
|
+
if (c.capture && !captureIntact(j, ctx, c.capture)) {
|
|
677
|
+
failCard(j, c, "the capture changed after it was confirmed - capture it again", now);
|
|
667
678
|
return false;
|
|
668
679
|
}
|
|
669
680
|
if (c.kind === "capture") {
|
|
670
681
|
const ok = c.events.every((id) => isOwned(ctx, c.board, id) && events.some((e) => e.id === id));
|
|
671
|
-
if (!ok)
|
|
682
|
+
if (!ok) failCard(j, c, "an ask on this capture is no longer the owner's", now);
|
|
672
683
|
return ok;
|
|
673
684
|
}
|
|
674
685
|
if (c.kind === "wrapup") {
|
|
675
686
|
if (!wrapupIntact(ctx, c)) {
|
|
676
|
-
|
|
687
|
+
failCard(j, c, "the session record changed after it was written - write it again", now);
|
|
677
688
|
return false;
|
|
678
689
|
}
|
|
679
690
|
const w = readWrapup(ctx.root, c.id);
|
|
680
691
|
const unsafe = w && recordPathProblem(ctx.root, w.wrapup.file);
|
|
681
692
|
if (unsafe) {
|
|
682
|
-
|
|
693
|
+
failCard(j, c, `the record's file is not safe to write: ${unsafe}`, now);
|
|
683
694
|
return false;
|
|
684
695
|
}
|
|
685
696
|
return true;
|
|
@@ -956,13 +967,13 @@ function settleOne(j, b, m, p, now, out) {
|
|
|
956
967
|
set(c, "done", now, "resolved");
|
|
957
968
|
out.push({ card: c });
|
|
958
969
|
} else if ("missing" in r) {
|
|
959
|
-
|
|
970
|
+
failCard(j, c, "the agent did not answer this one", now);
|
|
960
971
|
out.push({
|
|
961
972
|
card: c,
|
|
962
973
|
notice: "failed"
|
|
963
974
|
});
|
|
964
975
|
} else if (c.exclusive || (c.shared ?? 0) >= 1) {
|
|
965
|
-
|
|
976
|
+
failCard(j, c, "needed more shared files than it was given", now);
|
|
966
977
|
out.push({
|
|
967
978
|
card: c,
|
|
968
979
|
notice: "failed"
|
|
@@ -981,7 +992,7 @@ function fail(j, b, note, now = Date.now()) {
|
|
|
981
992
|
if (!c || c.state !== "working" || c.batch !== b.batchId) continue;
|
|
982
993
|
if (c.resolved) set(c, "done", now, "resolved");
|
|
983
994
|
else {
|
|
984
|
-
|
|
995
|
+
failCard(j, c, note, now);
|
|
985
996
|
out.push({
|
|
986
997
|
card: c,
|
|
987
998
|
notice: "failed"
|
|
@@ -1003,7 +1014,7 @@ function undelivered(j, b, note, now = Date.now()) {
|
|
|
1003
1014
|
const r = b.results?.[m.id];
|
|
1004
1015
|
if (r && !("body" in r)) settleOne(j, b, m, {}, now, out);
|
|
1005
1016
|
else {
|
|
1006
|
-
|
|
1017
|
+
failCard(j, c, note, now);
|
|
1007
1018
|
out.push({
|
|
1008
1019
|
card: c,
|
|
1009
1020
|
notice: "failed"
|
|
@@ -1116,7 +1127,10 @@ function upgrade(v1, ctx, now = Date.now()) {
|
|
|
1116
1127
|
if (b.state === "done") continue;
|
|
1117
1128
|
if (b.state === "claimed" && b.pgid) fence.push(b.pgid);
|
|
1118
1129
|
if (!tag) continue;
|
|
1119
|
-
j.cards.push(
|
|
1130
|
+
j.cards.push({
|
|
1131
|
+
...card("failed", b.state === "failed" ? "the agent could not finish - Retry" : "interrupted by the upgrade - Retry"),
|
|
1132
|
+
att: 1
|
|
1133
|
+
});
|
|
1120
1134
|
j.batches.push({
|
|
1121
1135
|
batchId: b.batchId,
|
|
1122
1136
|
members: [{
|
|
@@ -1129,6 +1143,7 @@ function upgrade(v1, ctx, now = Date.now()) {
|
|
|
1129
1143
|
leaseUntil: 0,
|
|
1130
1144
|
attempts: b.attempts,
|
|
1131
1145
|
...b.pgid ? { pgid: b.pgid } : {},
|
|
1146
|
+
failures: 1,
|
|
1132
1147
|
at: now
|
|
1133
1148
|
});
|
|
1134
1149
|
}
|
|
@@ -1455,4 +1470,4 @@ function createQueue(root, onUpgrade, alive = () => true) {
|
|
|
1455
1470
|
};
|
|
1456
1471
|
}
|
|
1457
1472
|
//#endregion
|
|
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 };
|
|
1473
|
+
export { ACTIONS, act, addCapture, addWrapup, answeredSince, answers, beginStep, captureComment, captureIntact, conflictStep, createQueue, ctxFor, endSession, endStep, fail, failCard, 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,
|
|
3
|
-
import { DevStartError, dev } from "./dev-
|
|
2
|
+
import { d as recoverTarget, r as legacyEntry, u as recoverEntries, v as workspaceId } from "./slots-Dn4Onb0V.mjs";
|
|
3
|
+
import { DevStartError, dev } from "./dev-DWBKQhxf.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
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { r as NAME } from "./cli.mjs";
|
|
2
|
+
import { t as logoIconLink } from "./logo-CXY-1yrn.mjs";
|
|
2
3
|
import { t as secureSuffix } from "./secure-cookie-_K1Hsx8H.mjs";
|
|
3
4
|
import { existsSync, readFileSync, readdirSync, realpathSync } from "node:fs";
|
|
4
5
|
import { extname, isAbsolute, join, relative, resolve } from "node:path";
|
|
@@ -147,7 +148,7 @@ async function serve(root, portFlag) {
|
|
|
147
148
|
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
149
|
process.exit(1);
|
|
149
150
|
}
|
|
150
|
-
const { marverIdHandler } = await import("./marver-id-gate-
|
|
151
|
+
const { marverIdHandler } = await import("./marver-id-gate-vBLb_Icb.mjs");
|
|
151
152
|
const { dataDir } = await import("./comments-0BSbb04K.mjs").then((n) => n.n);
|
|
152
153
|
const canvasName = humanName(meta.name);
|
|
153
154
|
const { ceilingsFromRights } = await import("./auth-Dix8wrXV.mjs").then((n) => n.R);
|
|
@@ -322,6 +323,11 @@ function isCosmetic(pathname) {
|
|
|
322
323
|
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>`;
|
|
323
324
|
const MARK = MARK_AT(17);
|
|
324
325
|
const MARK_LG = MARK_AT(24);
|
|
326
|
+
/** Marver's own tab icons: the gate's only when the build found no repo logo, whose icon is then the one there is
|
|
327
|
+
* (spec 28 A4.6 #46; release review P2 - beside it, a browser could still pick one of these). */
|
|
328
|
+
const MARVER_ICONS = `<link rel="icon" href="/__mv/favicon/favicon.ico" sizes="48x48" />
|
|
329
|
+
<link rel="icon" type="image/png" sizes="32x32" href="/__mv/favicon/favicon-32x32.png" />
|
|
330
|
+
<link rel="icon" type="image/png" sizes="16x16" href="/__mv/favicon/favicon-16x16.png" />`;
|
|
325
331
|
/** The gate: the canvas's own antechamber - light ground, dot grid, glass card in the
|
|
326
332
|
* shell's exact token language. Three doors, one credential each:
|
|
327
333
|
* guests pay the canvas password, members sign in with their OWN password, and an
|
|
@@ -413,9 +419,7 @@ function gate(res, meta, collabOn, error, idOn = false) {
|
|
|
413
419
|
${meta.branding ? "<meta property=\"og:site_name\" content=\"Marver\" />" : ""}
|
|
414
420
|
<meta property="og:type" content="website" />
|
|
415
421
|
<meta name="twitter:card" content="summary" />
|
|
416
|
-
|
|
417
|
-
<link rel="icon" type="image/png" sizes="32x32" href="/__mv/favicon/favicon-32x32.png" />
|
|
418
|
-
<link rel="icon" type="image/png" sizes="16x16" href="/__mv/favicon/favicon-16x16.png" />
|
|
422
|
+
${logoIconLink(meta.logo) || MARVER_ICONS}
|
|
419
423
|
<link rel="apple-touch-icon" href="/__mv/favicon/apple-touch-icon.png" />
|
|
420
424
|
<style>
|
|
421
425
|
* { box-sizing: border-box; margin: 0 }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { p as readCapture } from "./capture-DEtM4qm5.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-CMozOwZ0.mjs";
|
|
4
4
|
//#region src/cli/share.ts
|
|
5
5
|
/**
|
|
6
6
|
* `marver share <action>` - the roster from the terminal (01-sharing §9).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
2
|
import { a as ROUTE, o as slideSize } from "./cli.mjs";
|
|
3
|
-
import { t as logJam } from "./perf-jam-
|
|
3
|
+
import { t as logJam } from "./perf-jam-CLkERSHo.mjs";
|
|
4
4
|
import { copyFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { randomBytes } from "node:crypto";
|
|
@@ -524,8 +524,8 @@ async function shootFrame(opts) {
|
|
|
524
524
|
};
|
|
525
525
|
const plan = planShot(frame, viewports, size);
|
|
526
526
|
if (frame.kind !== "html") try {
|
|
527
|
-
const { scanAssetRefs } = await import("./build-
|
|
528
|
-
const { ensurePoster } = await import("./poster-
|
|
527
|
+
const { scanAssetRefs } = await import("./build-CWbrb2bl.mjs");
|
|
528
|
+
const { ensurePoster } = await import("./poster-CrsjqhY4.mjs");
|
|
529
529
|
const refs = scanAssetRefs(readFileSync(join(root, frame.file), "utf8"), frame.file);
|
|
530
530
|
for (const r of refs) if (r.endsWith(".poster.png")) await ensurePoster(join(root, "design", "assets"), r.slice(0, -11));
|
|
531
531
|
} catch {}
|
|
@@ -40,6 +40,92 @@ const runIdentity = (root, recoverWs) => {
|
|
|
40
40
|
ws: recoverWs ?? id
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/shared/app-api.ts
|
|
45
|
+
/** Reasons a page is busy (A2.14 #18). The first five are unsaved work; the last three are busy, not unsaved. */
|
|
46
|
+
const UNSAVED_WHY = [
|
|
47
|
+
"capture-recording",
|
|
48
|
+
"capture-unsent",
|
|
49
|
+
"board-unsaved",
|
|
50
|
+
"heights",
|
|
51
|
+
"typing"
|
|
52
|
+
];
|
|
53
|
+
const BUSY_ONLY_WHY = [
|
|
54
|
+
"jam-session",
|
|
55
|
+
"microphone",
|
|
56
|
+
"agent"
|
|
57
|
+
];
|
|
58
|
+
[...UNSAVED_WHY, ...BUSY_ONLY_WHY];
|
|
59
|
+
/** Bounds main checks again (A2.14 #19): unknown fields are stripped, a known one of the wrong type or past its bound refuses the message. */
|
|
60
|
+
const BOUNDS = {
|
|
61
|
+
version: 32,
|
|
62
|
+
versionChars: /^[0-9A-Za-z.+-]+$/,
|
|
63
|
+
board: 128,
|
|
64
|
+
page: /^[A-Za-z0-9_-]{8,64}$/,
|
|
65
|
+
doc: /^[A-Za-z0-9_-]{16,64}$/,
|
|
66
|
+
menuItems: 40,
|
|
67
|
+
menuId: /^[a-z][a-z0-9-]{0,31}$/,
|
|
68
|
+
label: 48,
|
|
69
|
+
hint: 8,
|
|
70
|
+
/** A3.8 #27: an epoch is an integer 0..epoch; a presentation viewport's sides are 0..viewport CSS px; `frames` 1..frames */
|
|
71
|
+
epoch: 2 ** 31 - 1,
|
|
72
|
+
viewport: 2e4,
|
|
73
|
+
frames: 8,
|
|
74
|
+
/** A4.6 #35, #37: a live picture's long side at most (main scales down to it; the server refuses past it), and
|
|
75
|
+
* main's deadline for one capture */
|
|
76
|
+
captureLong: 4096,
|
|
77
|
+
captureMs: 1500
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* What a slot file's `features` say a canvas offers the Mac app (src/server/slots.ts `FEATURES`; the app reads each
|
|
81
|
+
* registry entry's). A name is a version (A4.6 #2): a breaking change to its contract takes a new name (`live2`),
|
|
82
|
+
* never a new meaning for this one, and `bridge` and `inset` imply none of the others. An app ignores a name it does
|
|
83
|
+
* not know (A1.3), and asks nothing of a canvas that does not list one (A4.6 #3).
|
|
84
|
+
*/
|
|
85
|
+
const FEATURE = {
|
|
86
|
+
/** 0.27.1 (A2.9, A2.14 #15): the shell says hello, theme, menu and `mv:busy` with `unsaved` */
|
|
87
|
+
bridge: "bridge",
|
|
88
|
+
/** 0.27.2 (A3.8 #31): the shell takes the top inset under the strip and answers presentation requests */
|
|
89
|
+
inset: "inset",
|
|
90
|
+
/** 0.29.0 (A4.6 #5, #6, #11): the server answers `GET /__mv/app/live` (`LIVE_WIRE`) with `LiveEvent` v1 */
|
|
91
|
+
live: "live",
|
|
92
|
+
/** 0.29.0 (A4.6 #29, #30): the shell handles `mv:open` and answers `mv:opened` */
|
|
93
|
+
open: "open",
|
|
94
|
+
/** 0.29.0 (A4.6 #33-#37): the shell asks `mv:capture` for live pictures and the server takes `POST /api/jam/picture/live` */
|
|
95
|
+
capture: "capture"
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* The bounds both sides keep (A4.6 #11, #16): the server's selector and encoder write within them, and main checks
|
|
99
|
+
* every field again, stripping unknown ones and dropping an item of an unknown kind (not the event). `eventBytes`:
|
|
100
|
+
* the event as written (`event: live`, its `data:` line, the blank line) in UTF-8 bytes - the encoder drops the
|
|
101
|
+
* oldest whole items until it fits, and main drops a connection whose event is longer.
|
|
102
|
+
*/
|
|
103
|
+
const LIVE_BOUNDS = {
|
|
104
|
+
items: 100,
|
|
105
|
+
title: 140,
|
|
106
|
+
note: 140,
|
|
107
|
+
ref: 128,
|
|
108
|
+
cards: 8,
|
|
109
|
+
eventBytes: 65536,
|
|
110
|
+
id: /^(ask|review|failed|stalled):[0-9a-f]{20}$/
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* The live stream's wire (A4.6 #5, #6, #14). `GET <origin><path>` with `x-mv-ws`, a fresh `x-mv-nonce` and
|
|
114
|
+
* `x-mv-app` = `appProof(key, port)`; the 200 is `text/event-stream` carrying `x-mv-instance` and `x-mv-proof` =
|
|
115
|
+
* `liveProof(key, nonce, port)` (src/server/proof.ts). Each snapshot is `event: <event>`, one `data:` line of
|
|
116
|
+
* `LiveEvent` JSON, then a blank line; `<heartbeat>` is a comment line every `heartbeatMs`. No `Last-Event-ID`, no
|
|
117
|
+
* `retry:`. At most `clients` at once (one more ends the oldest); a client with more than `slowBytes` unsent is
|
|
118
|
+
* dropped and reconnects.
|
|
119
|
+
*/
|
|
120
|
+
const LIVE_WIRE = {
|
|
121
|
+
path: "/__mv/app/live",
|
|
122
|
+
type: "text/event-stream",
|
|
123
|
+
event: "live",
|
|
124
|
+
heartbeat: ": hb",
|
|
125
|
+
heartbeatMs: 3e4,
|
|
126
|
+
clients: 4,
|
|
127
|
+
slowBytes: 65536
|
|
128
|
+
};
|
|
43
129
|
const marverHome = () => process.env.MARVER_HOME || join(homedir(), ".marver");
|
|
44
130
|
/** The port before slot 1 - slot n listens on base + n (localhost:4805-4824). MARVER_SLOT_BASE moves
|
|
45
131
|
* the range for the test suite alone: the port check sees every program on this Mac, so a suite on
|
|
@@ -119,8 +205,20 @@ function asRecord(v) {
|
|
|
119
205
|
* reports. A canvas without it (0.27.0) gets the app's degraded guard, which asks first. `inset` (0.27.2, A3.8 #31):
|
|
120
206
|
* its shell takes the top inset under the app's transparent strip, keeps what it means to be read or clicked below
|
|
121
207
|
* it and its scroll edge, and answers the app's presentation requests - so app 0.2 may run it at the window's full
|
|
122
|
-
* height. A canvas without it stays below the strip.
|
|
123
|
-
|
|
208
|
+
* height. A canvas without it stays below the strip. The names are app-api.ts's `FEATURE`, read by the app too.
|
|
209
|
+
*
|
|
210
|
+
* A4 (0.29.0, A4.6 #2) adds `live`, `open` and `capture` - each a frozen contract, described at `FEATURE`. A name here
|
|
211
|
+
* is a promise the app acts on (it opens a stream, sends `mv:open`, answers `mv:capture`), so each A4 stream adds its
|
|
212
|
+
* own name here once its half works, never before: `live` (app-live.ts), `open` (the shell's open-item.ts) and
|
|
213
|
+
* `capture` (the shell asks for live pictures in play and the server takes `POST /api/jam/picture/live`:
|
|
214
|
+
* live-picture.ts, api.ts). */
|
|
215
|
+
const FEATURES = [
|
|
216
|
+
FEATURE.bridge,
|
|
217
|
+
FEATURE.inset,
|
|
218
|
+
FEATURE.live,
|
|
219
|
+
FEATURE.open,
|
|
220
|
+
FEATURE.capture
|
|
221
|
+
];
|
|
124
222
|
/** Take one candidate: the file, then - holding it - the port check. */
|
|
125
223
|
async function take(i, slot, port) {
|
|
126
224
|
const file = slot ? slotFileOf(slot) : portFileOf(port);
|
|
@@ -475,4 +573,4 @@ function formatRunning(list, now = Date.now()) {
|
|
|
475
573
|
return rows.map((r) => r.map((cell, c) => c === 0 ? cell.padStart(widths[c]) : cell.padEnd(widths[c])).join(" ").trimEnd());
|
|
476
574
|
}
|
|
477
575
|
//#endregion
|
|
478
|
-
export { notePrefer as a, ranDevBefore as c, recoverTarget as d, startedWhere as f,
|
|
576
|
+
export { runIdentity as _, notePrefer as a, ranDevBefore as c, recoverTarget as d, startedWhere as f, LIVE_WIRE as g, LIVE_BOUNDS as h, marverHome as i, readRunning as l, BOUNDS as m, formatRunning as n, originOf as o, stopPrefer as p, legacyEntry as r, place as s, forgetDevTraces as t, recoverEntries as u, workspaceId as v };
|
|
@@ -2,7 +2,7 @@ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
|
2
2
|
import { n as diffEvents } from "./events-CLH4ijKP.mjs";
|
|
3
3
|
import { a as readLog, i as listBoards, t as appendEvents } from "./comments-0BSbb04K.mjs";
|
|
4
4
|
import { t as CLI_TOKEN_CHARS } from "./auth-Dix8wrXV.mjs";
|
|
5
|
-
import { i as marverHome } from "./slots-
|
|
5
|
+
import { i as marverHome } from "./slots-Dn4Onb0V.mjs";
|
|
6
6
|
import { chmodSync, closeSync, existsSync, mkdirSync, openSync, readFileSync, realpathSync, renameSync, unlinkSync, writeSync } from "node:fs";
|
|
7
7
|
import { join } from "node:path";
|
|
8
8
|
import { createHash, randomBytes } from "node:crypto";
|
|
@@ -99,6 +99,17 @@ new when you do; everything already there the first time counts as seen. They li
|
|
|
99
99
|
`design/.local/`, on this machine only, and a published canvas shows none. `npx marver marks` prints
|
|
100
100
|
them - for you, or for your agent at the start of a session.
|
|
101
101
|
|
|
102
|
+
**In the Mac app** (0.3, with Marver 0.29), each canvas's tab sums this up, even while it is hidden: an
|
|
103
|
+
orange count of what needs you - Marver's questions, captures to review, runs that failed or stalled -
|
|
104
|
+
else a blue count of new frames, else a shimmer while an agent works, and a teal dot while a Jam session
|
|
105
|
+
runs. Turn notices on and a canvas you are not looking at sends one when something new needs you, and the
|
|
106
|
+
Dock counts them all. Clicking a notice opens what it names where you can see it, on its board: a question
|
|
107
|
+
in its thread on the frame (Play left and hidden pins shown for it), or in a panel with a field to answer
|
|
108
|
+
when no frame on the board holds it; a review in its review; a failed run with Retry in view, a stalled
|
|
109
|
+
one with its three choices (a stalled capture's or Jam session's on its tile in the lane, on the board you are on). On a
|
|
110
|
+
board locked to play, Play stays and the thread opens over it; a resolved thread opens read-only. It moves
|
|
111
|
+
nothing while you are capturing or have typed words not yet sent.
|
|
112
|
+
|
|
102
113
|
## Edits land calmly
|
|
103
114
|
|
|
104
115
|
When a file changes, the canvas reloads only the frames that read it, a few at a time, the ones on
|
package/docs/jam-session.md
CHANGED
|
@@ -24,6 +24,12 @@ dot. While it records, everything you do is part of it:
|
|
|
24
24
|
- **pictures**: `I` takes one of the frame under the pointer, and the frames you touched are
|
|
25
25
|
pictured as the capture ends - three at most - at the size you were looking at them (a
|
|
26
26
|
device, a width you dragged, the play stage). A capture holds twelve pictures in all.
|
|
27
|
+
In the Mac app (0.3, with Marver 0.29), a picture in play is **live**: the stage as you saw
|
|
28
|
+
it - a menu you opened, text you typed - captioned "as you saw it". It is taken when the
|
|
29
|
+
whole stage is in view with nothing over it and has shown its screen for a second (a device
|
|
30
|
+
preset, a slide fitted to the window); otherwise, in a browser, and whenever the app cannot
|
|
31
|
+
take it, the picture is a fresh render of the frame. A live picture is not filtered: it shows
|
|
32
|
+
whatever was on the stage, comment pins and anyone's words in them included.
|
|
27
33
|
|
|
28
34
|
Two ways to end it (0.28): `E` **stops and queues it** - the agent starts on it, nothing to confirm - and `⇧E`
|
|
29
35
|
**stops to review**: its read-back opens so you can check it and add to it first. Both are on the capture bar. `Esc`
|
|
@@ -89,7 +95,9 @@ your own session's run is working goes to that session at once, which decides ho
|
|
|
89
95
|
## Review
|
|
90
96
|
|
|
91
97
|
When a run finishes, its tile turns to **Ready to review**, with a soft chime (`jam: { chime:
|
|
92
|
-
false }` silences it).
|
|
98
|
+
false }` silences it). In the Mac app, with notices on, a canvas you are not looking at sends a
|
|
99
|
+
notice too, and clicking it opens the review ([what needs you](boards-and-folders.md#what-is-new-what-needs-you)).
|
|
100
|
+
`V` opens the next one to review:
|
|
93
101
|
|
|
94
102
|
- **Review** shows the agent's reply beside each frame it changed, **before and after at
|
|
95
103
|
once**: side by side for a tall frame (a phone), one above the other for a wide one (a
|
|
@@ -167,8 +175,9 @@ words. Other agents do not name captures.
|
|
|
167
175
|
## What your agent receives
|
|
168
176
|
|
|
169
177
|
Each capture reaches your agent as one job: its words with their times, your notes, every UI
|
|
170
|
-
step, the pictures, and the element under each
|
|
171
|
-
(`data-mv-loc`, the file and line it was written at, so the agent
|
|
178
|
+
step, the pictures (files it opens, since 0.29 - a live one marked), and the element under each
|
|
179
|
+
point with its source location (`data-mv-loc`, the file and line it was written at, so the agent
|
|
180
|
+
goes straight there). It
|
|
172
181
|
reads each distinct ask, acts on the reserved frames only, and replies per ask; the reply
|
|
173
182
|
shows in the review, beside the before and after pictures. The managed instructions
|
|
174
183
|
(`design/instructions/jam.md`, refreshed by `npx marver init`) spell this out for the agent.
|
package/docs/live-jam.md
CHANGED
|
@@ -72,6 +72,9 @@ never changed; one you removed by hand is not written back until you turn that t
|
|
|
72
72
|
<f>` hands back the replies, and the canvas posts them and frees the frames. `jam release` gives a run back,
|
|
73
73
|
`jam status` and `jam mute` are there too. The commands travel through files under `design/.local/jam/`, signed
|
|
74
74
|
with the session's own key, so a sandbox that blocks localhost cannot stop them.
|
|
75
|
+
- **A capture's pictures are files** (0.29). Each request lists its pictures - the frame each shows and the file to
|
|
76
|
+
open, `design/.local/jam/pictures/<id>.png` - for whoever runs it: your session, a copy, a fresh agent. A `live` one,
|
|
77
|
+
from the Mac app, is your screen in play as you saw it; the others are fresh renders ([Jam sessions](jam-session.md)).
|
|
75
78
|
- **Claude Code dispatches, so it multitasks.** Its brief opens with a few lines for the session - start ONE
|
|
76
79
|
background subagent (the Agent tool, `run_in_background: true`) with the part of the brief below its `----` line and
|
|
77
80
|
what the conversation knows that matters, then `jam next` until nothing waits, and end the turn; every run, however
|
package/docs/performance.md
CHANGED
|
@@ -357,7 +357,7 @@ their reason. `--days <n>` (14 by default) and `--json` as elsewhere.
|
|
|
357
357
|
| Option | |
|
|
358
358
|
|---|---|
|
|
359
359
|
| `--loads` | each board load in full |
|
|
360
|
-
| `--jam` | Jam's timings |
|
|
360
|
+
| `--jam` | Jam's timings; with the Mac app, its live pictures kept, failed and rendered instead |
|
|
361
361
|
| `run <board>` | a headless run of the board ([Headless runs](#headless-runs)); with `--slow` and `--repeat <n>` (1-5) |
|
|
362
362
|
| `--runs` | the headless runs, compared inside their cohorts; with `--against <run>` and `--days <n>` (14) |
|
|
363
363
|
| `--crashes` | the Mac app's crashes and hangs of this repo's canvases (below) |
|
package/docs/publish.md
CHANGED
|
@@ -258,6 +258,13 @@ falls back to your `package.json` name and the canvas shell to the root
|
|
|
258
258
|
directory name - which inside a container is usually `app`, so every unnamed
|
|
259
259
|
containerised canvas reports as one campaign.
|
|
260
260
|
|
|
261
|
+
Your logo - `share.logo`, else the first of `design/logo.svg|png`, `public/logo.svg|png`
|
|
262
|
+
and `public/favicon.svg|png|ico` - ships with the build. The gate shows it, and since
|
|
263
|
+
0.29 it is the only tab icon of the canvas and the gate, so a browser tab (and the Mac
|
|
264
|
+
app's tab for a shared canvas) wears it rather than Marver's mark. With no logo, the tab
|
|
265
|
+
wears Marver's mark. A canvas built before 0.29 keeps Marver's mark until you build and
|
|
266
|
+
deploy it again.
|
|
267
|
+
|
|
261
268
|
## Railway (the one-pager)
|
|
262
269
|
|
|
263
270
|
1. Push your repo to GitHub with the Dockerfile below at its root, and create a Railway
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marver-design/marver",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "The agent-native design canvas. A design/ folder, one command, a canvas of live frames built from your repo's real components - comment @marver and your own coding agent does the work. The tool ships no AI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -779,7 +779,7 @@ export function ThreadCard({ thread, at, bounds, nodeKey, side = 'r', flank, sta
|
|
|
779
779
|
if (sent.trim() && await useComments.getState().replyOk(thread.id, sent)) setText((cur) => (cur === sent ? '' : cur))
|
|
780
780
|
}
|
|
781
781
|
const card = (
|
|
782
|
-
<div ref={cardRef} data-sh-wheel-local className={`cm-card sh-no-pan${flip ? ' flip' : ''}${float ? ` parked dock-${side}` : ''}${float && flank ? ` flank-${flank}` : ''}${stage ? ' stage-dock' : ''}`} style={{ ...pos, ...hueVars(anchorHue(thread.anchor)) }}
|
|
782
|
+
<div ref={cardRef} data-sh-wheel-local data-thread={thread.id} className={`cm-card sh-no-pan${flip ? ' flip' : ''}${float ? ` parked dock-${side}` : ''}${float && flank ? ` flank-${flank}` : ''}${stage ? ' stage-dock' : ''}`} style={{ ...pos, ...hueVars(anchorHue(thread.anchor)) }}
|
|
783
783
|
onPointerDown={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()} onWheel={(e) => e.stopPropagation()}>
|
|
784
784
|
{/* thread-level actions pin to the card corner, out of the header's flow -
|
|
785
785
|
the name row never has to share its line with them */}
|
|
@@ -986,8 +986,9 @@ export function IdentityDialog() {
|
|
|
986
986
|
)
|
|
987
987
|
}
|
|
988
988
|
|
|
989
|
-
/** Open a thread by id: activate, select its node, fit the camera. True on success.
|
|
990
|
-
|
|
989
|
+
/** Open a thread by id: activate, select its node, fit the camera. True on success. `alive` (a notice's request, A4.6
|
|
990
|
+
* #30) is read again when the camera moves: a request that ended meanwhile moves nothing. */
|
|
991
|
+
export function revealThread(c: string, alive: () => boolean = () => true): boolean {
|
|
991
992
|
const t = useComments.getState().threads.find((t) => t.id === c)
|
|
992
993
|
if (!t) return false
|
|
993
994
|
// resolve the host BEFORE activating: a thread whose frame is not on this board
|
|
@@ -996,7 +997,7 @@ export function revealThread(c: string): boolean {
|
|
|
996
997
|
if (!key) return false
|
|
997
998
|
useComments.getState().setActive(c)
|
|
998
999
|
useStore.getState().select(key)
|
|
999
|
-
setTimeout(() => canvasCtl.fitNode(key), 80)
|
|
1000
|
+
setTimeout(() => { if (alive()) canvasCtl.fitNode(key) }, 80)
|
|
1000
1001
|
return true
|
|
1001
1002
|
}
|
|
1002
1003
|
|
|
@@ -23,7 +23,8 @@ export const framePath = (board: string, f: { id: string; file: string }) => {
|
|
|
23
23
|
/** A menu row. `panel` makes it open a panel IN PLACE of the menu (a picker - the board's status),
|
|
24
24
|
* drawn by the caller and handed `close`; `onClick` then is not called. */
|
|
25
25
|
export type MenuItem = { label: string; icon: ReactNode; onClick?: () => void; panel?: (close: () => void) => ReactNode }
|
|
26
|
-
|
|
26
|
+
/** `id`: what the menu is for, on its element (`data-menu`) - a tile's menu opened by a notice's click is waited for by it */
|
|
27
|
+
export type MenuState = { x: number; y: number; items: MenuItem[]; id?: string }
|
|
27
28
|
export type MenuOpener = (e: { preventDefault(): void; clientX: number; clientY: number }, items: MenuItem[]) => void
|
|
28
29
|
|
|
29
30
|
/** A right-click menu for the sidebar. One instance lives in App; `open(e, items)` positions
|
|
@@ -32,13 +33,13 @@ export type MenuOpener = (e: { preventDefault(): void; clientX: number; clientY:
|
|
|
32
33
|
* keydown (which would clear the selection/laser underneath the menu). */
|
|
33
34
|
export function useContextMenu() {
|
|
34
35
|
const [menu, setMenu] = useState<MenuState | null>(null)
|
|
35
|
-
const open
|
|
36
|
+
const open = (e: Parameters<MenuOpener>[0], items: MenuItem[], id?: string) => {
|
|
36
37
|
e.preventDefault()
|
|
37
38
|
const MENU_W = 240 // the CSS max-width; labels ellipsize inside it
|
|
38
39
|
// a menu taller than the window (many "Move to …" folders) pins to the top edge and scrolls
|
|
39
40
|
// ...and never under the Mac app's strip (TOP 44 when the shell took the inset)
|
|
40
41
|
const h = Math.min(items.length * 32 + 12, window.innerHeight - 16 - TOP)
|
|
41
|
-
setMenu({ x: Math.max(8, Math.min(e.clientX, window.innerWidth - MENU_W - 8)), y: Math.max(TOP + 8, Math.min(e.clientY, window.innerHeight - h - 8)), items })
|
|
42
|
+
setMenu({ x: Math.max(8, Math.min(e.clientX, window.innerWidth - MENU_W - 8)), y: Math.max(TOP + 8, Math.min(e.clientY, window.innerHeight - h - 8)), items, ...(id ? { id } : {}) })
|
|
42
43
|
}
|
|
43
44
|
return { menu, open, close: () => setMenu(null) }
|
|
44
45
|
}
|
|
@@ -65,7 +66,7 @@ export function ContextMenu({ menu, close }: { menu: MenuState | null; close: ()
|
|
|
65
66
|
const app = document.querySelector('.sh-app')
|
|
66
67
|
if (!menu || !app) return null
|
|
67
68
|
return createPortal(
|
|
68
|
-
<div className={`sh-menu sh-ctxmenu${panel ? ' sh-ctxpanel' : ''}`} ref={ref} style={{ left: menu.x, top: top ?? menu.y }}>
|
|
69
|
+
<div className={`sh-menu sh-ctxmenu${panel ? ' sh-ctxpanel' : ''}`} ref={ref} data-menu={menu.id} style={{ left: menu.x, top: top ?? menu.y }}>
|
|
69
70
|
{panel ? panel(close) : menu.items.map((it) => (
|
|
70
71
|
<button key={it.label} onClick={() => { if (it.panel) { setPanel(() => it.panel!); return } it.onClick?.(); close() }}>{it.icon}<span>{it.label}</span></button>
|
|
71
72
|
))}
|