@marver-design/marver 0.30.0 → 0.31.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 +74 -0
- package/README.md +11 -7
- package/dist/{anchor-check-c52IDkiQ.mjs → anchor-check-B92s9tVv.mjs} +1 -1
- package/dist/{board-tree-BXR8dw4b.mjs → board-tree-DGj0HhEE.mjs} +6 -2
- package/dist/{boards-EH2onUXM.mjs → boards-Cim1GTKc.mjs} +32 -2
- package/dist/{boards-BeWtjGUM.mjs → boards-OlAhZ87x.mjs} +7 -7
- package/dist/{build-C3mUtjEn.mjs → build-BNssmbqd.mjs} +14 -17
- package/dist/{capture-DEtM4qm5.mjs → capture-HaS-1or8.mjs} +1 -1
- package/dist/cli.mjs +38 -20
- package/dist/{collab-BEAcXrBb.mjs → collab-D2NcrOB8.mjs} +53 -14
- package/dist/comment-actions-Bxf9Ld4g.mjs +351 -0
- package/dist/{comments-XNhMmSSu.mjs → comments-BakJQwaf.mjs} +85 -10
- package/dist/config-B0YcFtqS.mjs +510 -0
- package/dist/{context-BUnFiyA3.mjs → context-Cj2TcC0H.mjs} +3 -3
- package/dist/{daemon-B0Wi1OQ3.mjs → daemon-MxoEQajX.mjs} +223 -26
- package/dist/deep-link-DYtuT740.mjs +163 -0
- package/dist/{dev-5dlxoW28.mjs → dev-BBZe_brH.mjs} +23 -16
- package/dist/devices-uJZ2inMq.mjs +155 -0
- package/dist/{events-CLH4ijKP.mjs → events-Dieo1482.mjs} +49 -4
- package/dist/{init-CYlFaRzG.mjs → init-BgusplYn.mjs} +40 -10
- package/dist/{jam-Cj5gBvwD.mjs → jam-CkuLL8A8.mjs} +1 -1
- package/dist/{link-BFFRgrMt.mjs → link-Cmt9Xy4X.mjs} +54 -7
- package/dist/{logo-CXY-1yrn.mjs → logo-C9s7-Cy9.mjs} +89 -66
- package/dist/{ls-NqmePKOf.mjs → ls-DGVIW-Io.mjs} +1 -1
- package/dist/{manifest-DPZ3WNg_.mjs → manifest-CK8Qh4Nq.mjs} +255 -13
- package/dist/{marks-BnNANic9.mjs → marks-C8oX8kbE.mjs} +3 -3
- package/dist/{marks-DBp3h1Mc.mjs → marks-Dt-5JXCp.mjs} +18 -5
- package/dist/{marver-id-gate-vBLb_Icb.mjs → marver-id-gate-BAeuMeaU.mjs} +11 -7
- package/dist/md-B9_13Q0R.mjs +105 -0
- package/dist/notes-CRAX4wgk.mjs +148 -0
- package/dist/own-C8Mq0Hnf.mjs +128 -0
- package/dist/pdf-0m721FFn.mjs +117 -0
- package/dist/pdf-CZENT6t3.mjs +2299 -0
- package/dist/{perf-BCxAo0IS.mjs → perf-BB0XNt1M.mjs} +1 -1
- package/dist/{perf-6MOTHxay.mjs → perf-CIMijND6.mjs} +5 -5
- package/dist/{plugin-CXRoMA8g.mjs → plugin-CL8_wL7a.mjs} +519 -112
- package/dist/{poster-CYmCa00B.mjs → poster-B7uSjlEP.mjs} +1 -1
- package/dist/{profile-B1FKOM1e.mjs → profile-cdmSer1k.mjs} +1 -1
- package/dist/{publish-bakes-C_2ZtHou.mjs → publish-bakes-BjgDNeyS.mjs} +3 -3
- package/dist/{queue-DeSQm24g.mjs → queue-BLLfdlDw.mjs} +156 -11
- package/dist/{recover-XD8iXJOj.mjs → recover-ByuFQOF9.mjs} +2 -2
- package/dist/{serve-DQv3Ti6X.mjs → serve-kcF6-H8V.mjs} +4 -4
- package/dist/{session-VDJfXEEm.mjs → session-DBF-nQvq.mjs} +29 -3
- package/dist/{share-Bu_kuOKL.mjs → share-CS2mg27O.mjs} +1 -1
- package/dist/{shot-CRRGgxru.mjs → shot-BqwkdtKn.mjs} +4 -4
- package/dist/{shot-DBWN8hPP.mjs → shot-D2TQGo2V.mjs} +1 -1
- package/dist/show-B1u3DiJw.mjs +101 -0
- package/dist/{sizes-wjXDev3b.mjs → sizes-BckcL4Zz.mjs} +1 -1
- package/dist/{slots-Dn4Onb0V.mjs → slots-BOcfIqxy.mjs} +15 -3
- package/dist/{summary-Y8MY1Wuc.mjs → summary-cPmRDGpX.mjs} +1 -1
- package/dist/{sync-CMozOwZ0.mjs → sync-BNWwh8OF.mjs} +205 -7
- package/dist/{work-BYWD_1Zf.mjs → work-DRdzXPvg.mjs} +3 -3
- package/dist/{work-DJxH7cCX.mjs → work-Nv-n2_Un.mjs} +1 -1
- package/docs/app.md +49 -0
- package/docs/boards-and-folders.md +37 -6
- package/docs/jam-session.md +5 -0
- package/docs/live-jam.md +9 -0
- package/docs/pdf.md +108 -0
- package/docs/performance.md +2 -1
- package/docs/publish.md +9 -9
- package/docs/sharing.md +11 -0
- package/docs/slides.md +9 -0
- package/package.json +3 -1
- package/src/client/content/index.tsx +4 -2
- package/src/client/frame-host/main.tsx +3 -0
- package/src/client/shell/App.tsx +71 -24
- package/src/client/shell/BoardList.tsx +16 -7
- package/src/client/shell/Comments.tsx +77 -16
- package/src/client/shell/Play.tsx +24 -22
- package/src/client/shell/Toolbar.tsx +4 -3
- package/src/client/shell/app-bridge.ts +32 -5
- package/src/client/shell/canvas/Canvas.tsx +30 -8
- package/src/client/shell/canvas/FrameNode.tsx +3 -1
- package/src/client/shell/canvas/ctl.ts +16 -0
- package/src/client/shell/commands.ts +20 -0
- package/src/client/shell/comments-store.ts +81 -2
- package/src/client/shell/devices.tsx +42 -0
- package/src/client/shell/goto.ts +56 -9
- package/src/client/shell/icons.tsx +11 -4
- package/src/client/shell/jam-lines.ts +5 -3
- package/src/client/shell/jam-panel.tsx +17 -5
- package/src/client/shell/marks-ui.tsx +54 -0
- package/src/client/shell/notes.ts +21 -0
- package/src/client/shell/pdf-export.tsx +154 -0
- package/src/client/shell/pdf-notes.ts +20 -0
- package/src/client/shell/recorder.ts +3 -2
- package/src/client/shell/show.ts +250 -0
- package/src/client/shell/store.ts +79 -48
- package/src/client/shell/styles.css +43 -0
- package/src/shared/app-api.ts +49 -4
- package/src/shared/auto-place.ts +32 -0
- package/src/shared/board-tree.ts +3 -0
- package/src/shared/board-types.ts +6 -2
- package/src/shared/deep-link.ts +212 -0
- package/src/shared/devices.ts +89 -0
- package/src/shared/events.ts +48 -5
- package/src/shared/export-plan.ts +98 -0
- package/templates/AGENTS-embedded.md +76 -12
- package/templates/AGENTS-studio.md +76 -12
- package/templates/instructions/boards.md +6 -5
- package/templates/instructions/configure.md +32 -2
- package/templates/instructions/iterate.md +8 -0
- package/templates/instructions/jam.md +9 -0
- package/templates/instructions/publish.md +14 -4
- package/templates/instructions/review.md +4 -0
- package/templates/instructions/slides.md +67 -1
- package/templates/instructions/welcome.md +9 -5
- package/templates/playbooks/publish-canvas/PLAYBOOK.md +1 -1
- package/dist/config-BezZTiov.mjs +0 -182
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i as PKG, r as NAME } from "./cli.mjs";
|
|
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-
|
|
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-BOcfIqxy.mjs";
|
|
3
3
|
import { t as detectHost } from "./detect-C0wpaePX.mjs";
|
|
4
|
-
import { n as loadConfig } from "./config-
|
|
5
|
-
import { n as tailwind3Css, o as liveChanged, r as tailwind4Plugin,
|
|
4
|
+
import { n as loadConfig } from "./config-B0YcFtqS.mjs";
|
|
5
|
+
import { c as installedVersion, d as canvasIdentity, f as identityNudge, n as tailwind3Css, o as liveChanged, r as tailwind4Plugin, t as marverPlugin } from "./plugin-CL8_wL7a.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";
|
|
@@ -709,7 +709,7 @@ async function boot(root, opts, instance, t, ctx) {
|
|
|
709
709
|
const explicitPort = opts.port ?? fromConfig;
|
|
710
710
|
const placed = await place({
|
|
711
711
|
root: run.root,
|
|
712
|
-
name:
|
|
712
|
+
name: canvasIdentity(run.root, config).local,
|
|
713
713
|
version: installedVersion() ?? "0.0.0",
|
|
714
714
|
id: run.id,
|
|
715
715
|
ws: run.ws,
|
|
@@ -987,13 +987,15 @@ async function boot(root, opts, instance, t, ctx) {
|
|
|
987
987
|
const port = claim.port;
|
|
988
988
|
const origin = originOf(server.httpServer?.address()) ?? `http://localhost:${port}`;
|
|
989
989
|
claim.ready(origin);
|
|
990
|
-
const { workActivity, writeDevInfo, removeDevInfo, boardsShowing, onBoardsChanged, nextActivitySeq } = await import("./work-
|
|
990
|
+
const { workActivity, writeDevInfo, removeDevInfo, boardsShowing, onBoardsChanged, nextActivitySeq } = await import("./work-Nv-n2_Un.mjs").then((n) => n.o);
|
|
991
991
|
t.claim(() => removeDevInfo(root, instance));
|
|
992
992
|
writeDevInfo(root, port, instance);
|
|
993
993
|
await opts.at?.("published");
|
|
994
994
|
watch$1.check();
|
|
995
995
|
if (placed.fellBackFrom) console.log(`\n port ${placed.fellBackFrom} is in use - serving "${projectName}" on slot ${claim.slot} instead`);
|
|
996
996
|
console.log(`\n ${NAME} · ${projectName} → http://localhost:${port}/\n`);
|
|
997
|
+
const nudge = identityNudge(root, config);
|
|
998
|
+
if (nudge) console.log(` ${nudge}\n`);
|
|
997
999
|
const address = {
|
|
998
1000
|
slot: claim.slot,
|
|
999
1001
|
url: claim.url,
|
|
@@ -1019,7 +1021,7 @@ async function boot(root, opts, instance, t, ctx) {
|
|
|
1019
1021
|
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
1022
|
setTimeout(async () => {
|
|
1021
1023
|
try {
|
|
1022
|
-
await (await import("./shot-
|
|
1024
|
+
await (await import("./shot-BqwkdtKn.mjs").then((n) => n.u)).sweepGhosts((m) => console.log(` ${m}`));
|
|
1023
1025
|
} catch {}
|
|
1024
1026
|
}, 0);
|
|
1025
1027
|
try {
|
|
@@ -1033,11 +1035,11 @@ async function boot(root, opts, instance, t, ctx) {
|
|
|
1033
1035
|
} catch {}
|
|
1034
1036
|
try {
|
|
1035
1037
|
if (!existsSync(join(root, "context"))) {
|
|
1036
|
-
const n = (await import("./manifest-
|
|
1038
|
+
const n = (await import("./manifest-CK8Qh4Nq.mjs").then((n) => n.i)).statusBoards(root).length;
|
|
1037
1039
|
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
1040
|
}
|
|
1039
1041
|
} catch {}
|
|
1040
|
-
const { loadCollab, syncOnce } = await import("./sync-
|
|
1042
|
+
const { loadCollab, syncOnce } = await import("./sync-BNWwh8OF.mjs").then((n) => n.o);
|
|
1041
1043
|
if (loadCollab(root)) console.log(` comments: syncing with the published canvas\n`);
|
|
1042
1044
|
let syncing = false;
|
|
1043
1045
|
const tick = async () => {
|
|
@@ -1100,9 +1102,14 @@ async function boot(root, opts, instance, t, ctx) {
|
|
|
1100
1102
|
});
|
|
1101
1103
|
} catch {}
|
|
1102
1104
|
}
|
|
1105
|
+
try {
|
|
1106
|
+
(await import("./own-C8Mq0Hnf.mjs")).migrateOwnership(root);
|
|
1107
|
+
} catch (err) {
|
|
1108
|
+
console.log(` comments: could not record who wrote what here - ${err.message}`);
|
|
1109
|
+
}
|
|
1103
1110
|
if (config.jam) {
|
|
1104
|
-
const { startJam } = await import("./daemon-
|
|
1105
|
-
const { checkAnchor } = await import("./anchor-check-
|
|
1111
|
+
const { startJam } = await import("./daemon-MxoEQajX.mjs");
|
|
1112
|
+
const { checkAnchor } = await import("./anchor-check-B92s9tVv.mjs");
|
|
1106
1113
|
const jam = startJam(root, config.jam, (m) => console.log(m), (board) => {
|
|
1107
1114
|
server.ws.send("sh:jam-comment", { board });
|
|
1108
1115
|
liveChanged();
|
|
@@ -1119,13 +1126,13 @@ async function boot(root, opts, instance, t, ctx) {
|
|
|
1119
1126
|
return () => {
|
|
1120
1127
|
due ??= setTimeout(async () => {
|
|
1121
1128
|
due = null;
|
|
1122
|
-
const { jamLive } = await import("./plugin-
|
|
1129
|
+
const { jamLive } = await import("./plugin-CL8_wL7a.mjs").then((n) => n.a);
|
|
1123
1130
|
server.ws.send("sh:jam-queue", jamLive.view?.() ?? { cards: [] });
|
|
1124
1131
|
liveChanged();
|
|
1125
1132
|
}, 60);
|
|
1126
1133
|
};
|
|
1127
1134
|
})(), async (frameId, theme, entry, size) => {
|
|
1128
|
-
const { shootFrame } = await import("./shot-
|
|
1135
|
+
const { shootFrame } = await import("./shot-BqwkdtKn.mjs").then((n) => n.u);
|
|
1129
1136
|
const r = await shootFrame({
|
|
1130
1137
|
root,
|
|
1131
1138
|
viewports: config.viewports,
|
|
@@ -1135,7 +1142,7 @@ async function boot(root, opts, instance, t, ctx) {
|
|
|
1135
1142
|
...size ? { size } : {}
|
|
1136
1143
|
});
|
|
1137
1144
|
if (!r.ok) return null;
|
|
1138
|
-
const { addPicture } = await import("./capture-
|
|
1145
|
+
const { addPicture } = await import("./capture-HaS-1or8.mjs").then((n) => n.i);
|
|
1139
1146
|
return addPicture(root, r.path, {
|
|
1140
1147
|
frame: frameId,
|
|
1141
1148
|
...entry,
|
|
@@ -1146,7 +1153,7 @@ async function boot(root, opts, instance, t, ctx) {
|
|
|
1146
1153
|
t.defer(() => jam.stop());
|
|
1147
1154
|
if (config.jam.session !== false) try {
|
|
1148
1155
|
const { ensureConnectors, connectorLine } = await import("./connectors-DekQvKt9.mjs");
|
|
1149
|
-
const { jamLive } = await import("./plugin-
|
|
1156
|
+
const { jamLive } = await import("./plugin-CL8_wL7a.mjs").then((n) => n.a);
|
|
1150
1157
|
const results = ensureConnectors(root);
|
|
1151
1158
|
jamLive.connectors = results;
|
|
1152
1159
|
const line = connectorLine(results);
|
|
@@ -1155,8 +1162,8 @@ async function boot(root, opts, instance, t, ctx) {
|
|
|
1155
1162
|
console.log(` jam: could not connect sessions - ${err.message}`);
|
|
1156
1163
|
}
|
|
1157
1164
|
const { createSpeech, speechLive } = await import("./audio-DX4POHAj.mjs");
|
|
1158
|
-
const { appendTalk } = await import("./session-
|
|
1159
|
-
const { logJam } = await import("./perf-
|
|
1165
|
+
const { appendTalk } = await import("./session-DBF-nQvq.mjs").then((n) => n.s);
|
|
1166
|
+
const { logJam } = await import("./perf-BB0XNt1M.mjs").then((n) => n.f);
|
|
1160
1167
|
const speech = createSpeech({
|
|
1161
1168
|
onTalk: (t) => appendTalk(root, t.session, t.words),
|
|
1162
1169
|
onTiming: (t) => logJam(root, {
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
//#region src/shared/devices.ts
|
|
2
|
+
/**
|
|
3
|
+
* Your own breakpoints (spec 31 Part F): what a device shows as - its glyph and its label. Pure, shared by the
|
|
4
|
+
* server (which resolves design/config.ts's `viewports.<name>.icon` and `.label` once, at load) and the shell (which
|
|
5
|
+
* falls back to the same rules for a device name it has no resolved look for, e.g. a Jam step recorded earlier).
|
|
6
|
+
*/
|
|
7
|
+
/** The built-in device glyphs, as `viewports.<name>.icon` may name them (a `-landscape` suffix rotates one). */
|
|
8
|
+
const DEVICE_GLYPHS = [
|
|
9
|
+
"mobile",
|
|
10
|
+
"tablet",
|
|
11
|
+
"laptop",
|
|
12
|
+
"monitor",
|
|
13
|
+
"tv",
|
|
14
|
+
"watch",
|
|
15
|
+
"desktop",
|
|
16
|
+
"ereader"
|
|
17
|
+
];
|
|
18
|
+
const words = (name) => name.split(/[^A-Za-z0-9]+/).filter(Boolean);
|
|
19
|
+
const tokens = (name) => words(name).map((w) => w.toLowerCase());
|
|
20
|
+
/** A `-landscape` device: the name says so (a word of its own). */
|
|
21
|
+
const isLandscape = (name) => tokens(name).includes("landscape");
|
|
22
|
+
/** The glyph a device's NAME suggests, or null (the generic devices glyph). Class words first (`pixel-tablet` is a
|
|
23
|
+
* tablet), then the brands. */
|
|
24
|
+
function glyphFromName(name) {
|
|
25
|
+
const t = tokens(name);
|
|
26
|
+
const has = (...w) => t.some((x) => w.includes(x));
|
|
27
|
+
const starts = (p) => t.some((x) => x.startsWith(p));
|
|
28
|
+
if (has("tablet")) return "tablet";
|
|
29
|
+
if (has("laptop")) return "laptop";
|
|
30
|
+
if (has("phone", "mobile", "smartphone")) return "mobile";
|
|
31
|
+
if (has("monitor", "desktop")) return "monitor";
|
|
32
|
+
if (has("tv")) return "tv";
|
|
33
|
+
if (has("watch")) return "watch";
|
|
34
|
+
if (has("ereader")) return "ereader";
|
|
35
|
+
if (starts("iphone") || has("android", "pixel")) return "mobile";
|
|
36
|
+
if (starts("ipad") || has("boox", "kindle")) return "tablet";
|
|
37
|
+
if (starts("macbook")) return "laptop";
|
|
38
|
+
if (has("imac", "studio")) return "monitor";
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
/** Brand casing, by word: "ipad" -> "iPad", "tv" -> "TV". */
|
|
42
|
+
const BRAND = {
|
|
43
|
+
iphone: "iPhone",
|
|
44
|
+
ipad: "iPad",
|
|
45
|
+
imac: "iMac",
|
|
46
|
+
ipod: "iPod",
|
|
47
|
+
macbook: "MacBook",
|
|
48
|
+
mac: "Mac",
|
|
49
|
+
ios: "iOS",
|
|
50
|
+
ipados: "iPadOS",
|
|
51
|
+
macos: "macOS",
|
|
52
|
+
watchos: "watchOS",
|
|
53
|
+
tvos: "tvOS",
|
|
54
|
+
visionos: "visionOS",
|
|
55
|
+
tv: "TV",
|
|
56
|
+
appletv: "Apple TV",
|
|
57
|
+
android: "Android",
|
|
58
|
+
pixel: "Pixel",
|
|
59
|
+
galaxy: "Galaxy",
|
|
60
|
+
samsung: "Samsung",
|
|
61
|
+
kindle: "Kindle",
|
|
62
|
+
boox: "Boox",
|
|
63
|
+
kobo: "Kobo",
|
|
64
|
+
remarkable: "reMarkable",
|
|
65
|
+
surface: "Surface",
|
|
66
|
+
chromebook: "Chromebook",
|
|
67
|
+
apple: "Apple",
|
|
68
|
+
google: "Google",
|
|
69
|
+
oneplus: "OnePlus",
|
|
70
|
+
xl: "XL",
|
|
71
|
+
hd: "HD",
|
|
72
|
+
uhd: "UHD",
|
|
73
|
+
fhd: "FHD",
|
|
74
|
+
qhd: "QHD",
|
|
75
|
+
"4k": "4K",
|
|
76
|
+
"5k": "5K",
|
|
77
|
+
"6k": "6K",
|
|
78
|
+
"8k": "8K",
|
|
79
|
+
xdr: "XDR",
|
|
80
|
+
oled: "OLED",
|
|
81
|
+
se: "SE",
|
|
82
|
+
xr: "XR",
|
|
83
|
+
xs: "XS",
|
|
84
|
+
ui: "UI"
|
|
85
|
+
};
|
|
86
|
+
/** A model's suffix words, capitalised after a brand: "iphone-15-pro-max" -> "iPhone 15 Pro Max". */
|
|
87
|
+
const MODEL = /* @__PURE__ */ new Set([
|
|
88
|
+
"pro",
|
|
89
|
+
"max",
|
|
90
|
+
"plus",
|
|
91
|
+
"mini",
|
|
92
|
+
"air",
|
|
93
|
+
"ultra",
|
|
94
|
+
"fold",
|
|
95
|
+
"flip",
|
|
96
|
+
"lite",
|
|
97
|
+
"studio",
|
|
98
|
+
"display",
|
|
99
|
+
"note"
|
|
100
|
+
]);
|
|
101
|
+
/** Brands that start a model name, so the words after them are its model words. */
|
|
102
|
+
const BRANDED = /* @__PURE__ */ new Set([
|
|
103
|
+
"iphone",
|
|
104
|
+
"ipad",
|
|
105
|
+
"imac",
|
|
106
|
+
"ipod",
|
|
107
|
+
"macbook",
|
|
108
|
+
"mac",
|
|
109
|
+
"pixel",
|
|
110
|
+
"galaxy",
|
|
111
|
+
"kindle",
|
|
112
|
+
"boox",
|
|
113
|
+
"kobo",
|
|
114
|
+
"remarkable",
|
|
115
|
+
"surface",
|
|
116
|
+
"chromebook",
|
|
117
|
+
"apple",
|
|
118
|
+
"google",
|
|
119
|
+
"samsung",
|
|
120
|
+
"oneplus",
|
|
121
|
+
"studio"
|
|
122
|
+
]);
|
|
123
|
+
/** A device's label from its NAME: the words humanized, brand casing kept ("ipad-landscape" -> "iPad landscape",
|
|
124
|
+
* "boox-full" -> "Boox full", "iphone-15-pro" -> "iPhone 15 Pro"). The first word starts capitalised, the rest stay
|
|
125
|
+
* as written; a word already carrying capitals keeps them ("myDevice" stays "myDevice"). */
|
|
126
|
+
function labelFromName(name) {
|
|
127
|
+
const ws = words(name);
|
|
128
|
+
if (!ws.length) return name;
|
|
129
|
+
let branded = false;
|
|
130
|
+
return ws.map((w, i) => {
|
|
131
|
+
const low = w.toLowerCase();
|
|
132
|
+
const glued = /^([a-z]+)(\d+)$/.exec(low);
|
|
133
|
+
const brand = BRAND[low] ?? (glued && BRANDED.has(glued[1]) && BRAND[glued[1]] ? BRAND[glued[1]] + glued[2] : void 0);
|
|
134
|
+
const isBrand = BRANDED.has(low) || !!glued && BRANDED.has(glued[1]);
|
|
135
|
+
const out = brand ?? (/[A-Z]/.test(w) ? w : branded && MODEL.has(low) ? low[0].toUpperCase() + low.slice(1) : i === 0 ? low[0].toUpperCase() + low.slice(1) : low);
|
|
136
|
+
if (isBrand) branded = true;
|
|
137
|
+
return out;
|
|
138
|
+
}).join(" ");
|
|
139
|
+
}
|
|
140
|
+
/** A built-in glyph as `viewports.<name>.icon` names it, with its rotation - or null when the value is no glyph. */
|
|
141
|
+
function parseGlyph(v) {
|
|
142
|
+
const m = /^([a-z]+)(-landscape)?$/.exec(v);
|
|
143
|
+
return m && DEVICE_GLYPHS.includes(m[1]) ? {
|
|
144
|
+
glyph: m[1],
|
|
145
|
+
rotate: !!m[2]
|
|
146
|
+
} : null;
|
|
147
|
+
}
|
|
148
|
+
/** A device's look from its name alone - the shell's fallback, and the server's for a device with no `icon`/`label`. */
|
|
149
|
+
const lookFromName = (name) => ({
|
|
150
|
+
label: labelFromName(name),
|
|
151
|
+
glyph: glyphFromName(name),
|
|
152
|
+
rotate: isLandscape(name)
|
|
153
|
+
});
|
|
154
|
+
//#endregion
|
|
155
|
+
export { lookFromName as n, parseGlyph as r, labelFromName as t };
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
1
2
|
//#region src/shared/events.ts
|
|
3
|
+
var events_exports = /* @__PURE__ */ __exportAll({
|
|
4
|
+
asks: () => asks,
|
|
5
|
+
deletedMessages: () => deletedMessages,
|
|
6
|
+
diffEvents: () => diffEvents,
|
|
7
|
+
replay: () => replay,
|
|
8
|
+
withoutDeletedWords: () => withoutDeletedWords
|
|
9
|
+
});
|
|
2
10
|
/** Does this message ask the human something? The writer says so (`asks`); a message written
|
|
3
11
|
* before 0.25 says nothing, and the old rule reads it: a note asks, a reply asks when it ends
|
|
4
12
|
* in "?". `note` = the thread's root (a create event). */
|
|
@@ -8,10 +16,26 @@ function diffEvents(mine, theirIds) {
|
|
|
8
16
|
const have = new Set(theirIds);
|
|
9
17
|
return mine.filter((e) => !have.has(e.id));
|
|
10
18
|
}
|
|
19
|
+
/** The messages (create or reply comment ids) a log's tombstones name (spec 31 C.4): terminal, whatever came
|
|
20
|
+
* before or after them. Every reader that turns a request into agent input filters by it, per message. */
|
|
21
|
+
function deletedMessages(events) {
|
|
22
|
+
const out = /* @__PURE__ */ new Set();
|
|
23
|
+
for (const e of events) if (e.type === "delete" && typeof e.commentId === "string" && e.commentId) out.add(e.commentId);
|
|
24
|
+
return out;
|
|
25
|
+
}
|
|
26
|
+
/** An event as a browser may see it (spec 31 C.4): a create, reply or edit of a deleted message carries no words or
|
|
27
|
+
* mentions - the log keeps them (sync is by id), no transport to a page does. `gone`: deletedMessages of the log. */
|
|
28
|
+
const withoutDeletedWords = (e, gone) => gone.size && (e.type === "create" || e.type === "reply" || e.type === "edit") && !!e.commentId && gone.has(e.commentId) ? {
|
|
29
|
+
...e,
|
|
30
|
+
body: "",
|
|
31
|
+
mentions: void 0
|
|
32
|
+
} : e;
|
|
11
33
|
/** Replay a board's events into current thread state. Deterministic: replay order is
|
|
12
34
|
* (ts, id) so two stores holding the same event SET always derive the same state.
|
|
13
35
|
* TWO passes - creates first, then everything else - so a reply whose author's clock
|
|
14
|
-
* ran ahead of the creator's still lands instead of being dropped forever.
|
|
36
|
+
* ran ahead of the creator's still lands instead of being dropped forever. Deletes (0.31)
|
|
37
|
+
* apply after both, whatever their time: a deleted reply is gone; a deleted first comment
|
|
38
|
+
* keeps its surviving replies under a placeholder, and with none the thread is gone. */
|
|
15
39
|
function replay(events) {
|
|
16
40
|
const ordered = [...events].sort((a, b) => a.ts - b.ts || (a.id < b.id ? -1 : 1));
|
|
17
41
|
const threads = /* @__PURE__ */ new Map();
|
|
@@ -61,7 +85,10 @@ function replay(events) {
|
|
|
61
85
|
if (!ev.commentId || ev.body === void 0 && ev.asks === void 0 && ev.alsoChanged === void 0) break;
|
|
62
86
|
const m = threads.get(ev.commentId) ?? [...threads.values()].flatMap((th) => th.replies).find((r) => r.id === ev.commentId);
|
|
63
87
|
if (!m) break;
|
|
64
|
-
if (ev.body !== void 0)
|
|
88
|
+
if (ev.body !== void 0) {
|
|
89
|
+
if (ev.body !== m.body) m.edited = ev.ts;
|
|
90
|
+
m.body = ev.body;
|
|
91
|
+
}
|
|
65
92
|
if (ev.asks !== void 0) m.asks = ev.asks;
|
|
66
93
|
if (ev.alsoChanged !== void 0 && !("replies" in m)) m.alsoChanged = ev.alsoChanged;
|
|
67
94
|
break;
|
|
@@ -105,7 +132,25 @@ function replay(events) {
|
|
|
105
132
|
break;
|
|
106
133
|
}
|
|
107
134
|
}
|
|
108
|
-
|
|
135
|
+
const gone = deletedMessages(ordered);
|
|
136
|
+
if (!gone.size) return [...threads.values()];
|
|
137
|
+
const out = [];
|
|
138
|
+
for (const t of threads.values()) {
|
|
139
|
+
t.replies = t.replies.filter((r) => !gone.has(r.id));
|
|
140
|
+
if (gone.has(t.id)) {
|
|
141
|
+
if (!t.replies.length) continue;
|
|
142
|
+
t.deleted = true;
|
|
143
|
+
t.body = void 0;
|
|
144
|
+
t.author = void 0;
|
|
145
|
+
t.mentions = void 0;
|
|
146
|
+
t.asks = void 0;
|
|
147
|
+
t.edited = void 0;
|
|
148
|
+
delete t.capture;
|
|
149
|
+
delete t.facts;
|
|
150
|
+
}
|
|
151
|
+
out.push(t);
|
|
152
|
+
}
|
|
153
|
+
return out;
|
|
109
154
|
}
|
|
110
155
|
//#endregion
|
|
111
|
-
export {
|
|
156
|
+
export { replay as a, events_exports as i, deletedMessages as n, withoutDeletedWords as o, diffEvents as r, asks as t };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { r as NAME } from "./cli.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { C as KIND_FOLDERS, x as FOLDER_MODULES } from "./board-tree-
|
|
4
|
-
import { s as scanFrames, u as writeManifest } from "./manifest-
|
|
2
|
+
import { l as listBoardFiles, n as addFolders } from "./boards-Cim1GTKc.mjs";
|
|
3
|
+
import { C as KIND_FOLDERS, x as FOLDER_MODULES } from "./board-tree-DGj0HhEE.mjs";
|
|
4
|
+
import { s as scanFrames, u as writeManifest } from "./manifest-CK8Qh4Nq.mjs";
|
|
5
5
|
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
|
+
import { t as labelFromName } from "./devices-uJZ2inMq.mjs";
|
|
8
9
|
import { n as readJson, t as detectHost } from "./detect-C0wpaePX.mjs";
|
|
9
10
|
import { connectorLine, ensureConnectors } from "./connectors-DekQvKt9.mjs";
|
|
10
11
|
import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
|
|
@@ -52,7 +53,7 @@ function init(root, opts) {
|
|
|
52
53
|
rerun: `\`npx ${NAME} init\``
|
|
53
54
|
});
|
|
54
55
|
const jamAgent = detectAgent();
|
|
55
|
-
write("config.ts", configTemplate(opts.mode, jamAgent));
|
|
56
|
+
write("config.ts", configTemplate(opts.mode, jamAgent, initialName(root)));
|
|
56
57
|
if (host.themeCss) {
|
|
57
58
|
const relCss = relative(design, join(root, host.themeCss)).split("\\").join("/");
|
|
58
59
|
write("theme.css", themeWrapper(relCss, host.tailwind === 4));
|
|
@@ -121,7 +122,7 @@ function init(root, opts) {
|
|
|
121
122
|
refresh("providers.tsx", [providersTemplate(null, null), providersTemplate(null, host.toaster, host.routerPkg)], providersTemplate(host.router, host.toaster, host.routerPkg));
|
|
122
123
|
refresh("tsconfig.json", [STANDALONE_TSCONFIG], tsconfigNow());
|
|
123
124
|
}
|
|
124
|
-
write(".gitignore", ".local/\n.dist/\n.dist-seeds/\nslides-inspiration/\nboards/.folders.lock\n");
|
|
125
|
+
write(".gitignore", ".local/\n.dist/\n.dist-seeds/\nslides-inspiration/\nboards/.folders.lock\nexports/\n");
|
|
125
126
|
{
|
|
126
127
|
const gi = join(design, ".gitignore");
|
|
127
128
|
const cur = readFileSync(gi, "utf8");
|
|
@@ -138,6 +139,14 @@ function init(root, opts) {
|
|
|
138
139
|
created.push("design/.gitignore (+ boards/.folders.lock)");
|
|
139
140
|
}
|
|
140
141
|
}
|
|
142
|
+
{
|
|
143
|
+
const gi = join(design, ".gitignore");
|
|
144
|
+
const cur = readFileSync(gi, "utf8");
|
|
145
|
+
if (!cur.split("\n").some((l) => l.trim() === "exports/" || l.trim() === "exports")) {
|
|
146
|
+
writeFileSync(gi, cur + (cur.endsWith("\n") || cur === "" ? "" : "\n") + "exports/\n");
|
|
147
|
+
created.push("design/.gitignore (+ exports/)");
|
|
148
|
+
}
|
|
149
|
+
}
|
|
141
150
|
write("slides.md", [
|
|
142
151
|
"# This project's deck look and house habits",
|
|
143
152
|
"",
|
|
@@ -469,8 +478,9 @@ This first draft skips the written-brief ceremony (the human just told you what
|
|
|
469
478
|
they are building) but never the quality bar. Then THE REVEAL: start
|
|
470
479
|
\`npx ${NAME} dev\` and give the guided tour from instructions/welcome.md -
|
|
471
480
|
by now the human has played with the hosted tour, so keep it short and let
|
|
472
|
-
their own product carry it. End with
|
|
473
|
-
|
|
481
|
+
their own product carry it. End with what \`npx ${NAME} link <scene ...>\` prints
|
|
482
|
+
for the board's scenes, as printed (a marver:// link when the Mac app has the
|
|
483
|
+
canvas open, else localhost) - never a link you wrote, never the bare root URL.
|
|
474
484
|
`;
|
|
475
485
|
/** Next.js frames render OUTSIDE Next - say concretely what that means (friction log #10/#11). */
|
|
476
486
|
const NEXT_NOTES = `- Next.js caveats (frames render in Vite, outside Next):
|
|
@@ -564,22 +574,42 @@ const jamBlock = (agent) => agent ? ` // Live Jam - tag @${NAME} in a canvas co
|
|
|
564
574
|
// install an agent CLI (claude, codex, cursor, droid, opencode, grok, or pi) and it arms
|
|
565
575
|
// itself, or name one here. \`jam: false\` turns it off.
|
|
566
576
|
// jam: { agent: "claude", concurrency: 6 },`;
|
|
567
|
-
|
|
577
|
+
/** The name a new config starts with (spec 31 G.2): the package's (its scope dropped), else the folder's, written
|
|
578
|
+
* for people - "tms-broker" -> "Tms broker". A starting point the agent's identity step makes real. */
|
|
579
|
+
function initialName(root) {
|
|
580
|
+
let raw = basename(root);
|
|
581
|
+
try {
|
|
582
|
+
const n = JSON.parse(readFileSync(join(root, "package.json"), "utf8")).name;
|
|
583
|
+
if (typeof n === "string" && n.trim()) raw = n.trim().replace(/^@[^/]+\//, "");
|
|
584
|
+
} catch {}
|
|
585
|
+
return labelFromName(raw).slice(0, 80) || raw;
|
|
586
|
+
}
|
|
587
|
+
const configTemplate = (mode, jamAgent, name) => `// ${NAME} config - OPTIONAL. Delete this file and everything still works on defaults.
|
|
568
588
|
// Theme lives in design/theme.css (it imports your app's real stylesheet) - not here.
|
|
569
589
|
// Sharp edges (native Node TS import): erasable syntax only (no enums/namespaces),
|
|
570
590
|
// relative imports need extensions, tsconfig paths are ignored here.
|
|
571
591
|
export default {
|
|
592
|
+
// The canvas's name for people - the app's tab and Home card, the sidebar, the published
|
|
593
|
+
// gate. Write the product's real name ("TMS Broker", not "tms-broker").
|
|
594
|
+
name: ${JSON.stringify(name ?? "My Product")},
|
|
595
|
+
// Its logo: the product's real mark, a repo-relative SVG, PNG or ICO. Unset, the first of
|
|
596
|
+
// design/logo.svg|png, public/logo.svg|png, public/favicon.svg|png|ico; else Marver's mark.
|
|
597
|
+
// logo: "design/logo.svg",
|
|
572
598
|
mode: ${JSON.stringify(mode)},
|
|
573
599
|
// One sentence on what this product is and for whom. It lands in design/manifest.json
|
|
574
600
|
// as the project's description - the first thing a new agent session reads.
|
|
575
601
|
// description: "Analytics for indie SaaS - the founder's Monday-morning read",
|
|
576
|
-
// Device widths for frames and the Devices view. Rename, retune, or uncomment tv.
|
|
602
|
+
// Device widths for frames and the Devices view. Rename, retune, add your own, or uncomment tv.
|
|
603
|
+
// Each may carry a label (40 characters) and an icon: a glyph - mobile, tablet, laptop, monitor,
|
|
604
|
+
// tv, watch, desktop, ereader; "-landscape" turns it - or a repo-relative .svg (paths and shapes
|
|
605
|
+
// only, 32 KB). Without them both come from the name: "ipad-landscape" shows as "iPad landscape".
|
|
577
606
|
viewports: {
|
|
578
607
|
mobile: { width: 390, height: 844 },
|
|
579
608
|
tablet: { width: 768, height: 1024 },
|
|
580
609
|
laptop: { width: 1280, height: 800 },
|
|
581
610
|
monitor: { width: 1920, height: 1080 },
|
|
582
611
|
// tv: { width: 3840, height: 2160 },
|
|
612
|
+
// "ipad-landscape": { width: 1180, height: 820, label: "iPad landscape", icon: "tablet-landscape" },
|
|
583
613
|
},
|
|
584
614
|
themes: ["light", "dark"],
|
|
585
615
|
// A port of its own. Without one, \`${NAME} dev\` takes a free slot (localhost:4805-4824),
|
|
@@ -589,7 +619,7 @@ export default {
|
|
|
589
619
|
// zoomSpeed: 1,
|
|
590
620
|
${jamBlock(jamAgent)}
|
|
591
621
|
// Publishing (\`${NAME} build\` + \`${NAME} serve\`): gate identity + branding footer.
|
|
592
|
-
// name
|
|
622
|
+
// The gate wears name and logo above; share.name / share.logo still work beneath them.
|
|
593
623
|
// branding is the small "Powered by Marver.design" line under the gate. Marver is
|
|
594
624
|
// free, and that line is how it spreads - we'd love it if you leave it on, but it
|
|
595
625
|
// is yours to remove, no strings: share: { branding: false }.
|
|
@@ -40,7 +40,7 @@ function marverRoot(from) {
|
|
|
40
40
|
async function sessionsOff(root, env) {
|
|
41
41
|
if (env.MARVER_JAM_BACKGROUND === "1" || env.MARVER_JAM === "off") return true;
|
|
42
42
|
try {
|
|
43
|
-
const { loadConfig } = await import("./config-
|
|
43
|
+
const { loadConfig } = await import("./config-B0YcFtqS.mjs").then((n) => n.t);
|
|
44
44
|
const cfg = await loadConfig(root);
|
|
45
45
|
return !cfg.jam || cfg.jam.session === false;
|
|
46
46
|
} catch {
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { r as NAME } from "./cli.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { f as isBoardName } from "./board-tree-
|
|
4
|
-
import { s as scanFrames } from "./manifest-
|
|
5
|
-
import { i as
|
|
2
|
+
import { l as listBoardFiles, m as readMembership, o as checkBoardsDir, v as unplacedHint } from "./boards-Cim1GTKc.mjs";
|
|
3
|
+
import { f as isBoardName } from "./board-tree-DGj0HhEE.mjs";
|
|
4
|
+
import { s as scanFrames } from "./manifest-CK8Qh4Nq.mjs";
|
|
5
|
+
import { a as checkAppLive, i as buildDeepLink, l as targetFromHash, r as appTakesLink, t as APP_LIVE_FILE } from "./deep-link-DYtuT740.mjs";
|
|
6
|
+
import { r as pidRuns } from "./exclusive-B1RtpeeP.mjs";
|
|
7
|
+
import { i as marverHome } from "./slots-BOcfIqxy.mjs";
|
|
8
|
+
import { i as readDevInfo } from "./work-Nv-n2_Un.mjs";
|
|
9
|
+
import { readFileSync, realpathSync } from "node:fs";
|
|
6
10
|
import { join } from "node:path";
|
|
7
11
|
//#region src/cli/link.ts
|
|
8
12
|
/**
|
|
@@ -135,13 +139,55 @@ async function devOrigin(root) {
|
|
|
135
139
|
* the first one's lock. */
|
|
136
140
|
const unreachable = (pid) => `\`${NAME} dev\` runs (pid ${pid}) but cannot be reached from here - a sandbox?`;
|
|
137
141
|
const NOT_RUNNING = `\`${NAME} dev\` is not running in this repo - start it (\`npx ${NAME} dev\`), then run this again: the link carries its port`;
|
|
142
|
+
/**
|
|
143
|
+
* Whether the Mac app takes this canvas's links now (spec 31 D2): `~/.marver/state/app-live.json` (MARVER_HOME
|
|
144
|
+
* honoured) names a pid that runs, is under 90 s old, says `scheme: 1`, and lists this canvas's real folder among its
|
|
145
|
+
* open tabs. Anything else - an older app, a stale file, the canvas not open there - is the localhost link.
|
|
146
|
+
*/
|
|
147
|
+
function appLive(root, now = Date.now()) {
|
|
148
|
+
let file;
|
|
149
|
+
try {
|
|
150
|
+
file = checkAppLive(JSON.parse(readFileSync(join(marverHome(), "state", APP_LIVE_FILE), "utf8")));
|
|
151
|
+
} catch {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
let real = root;
|
|
155
|
+
try {
|
|
156
|
+
real = realpathSync(root);
|
|
157
|
+
} catch {}
|
|
158
|
+
return appTakesLink(file, real, now, pidRuns);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* The link for one hash (spec 31 D1, D2): the app's `marver://open?ws=<folder>&to=<hash>&port=<p>` when the app is in
|
|
162
|
+
* use with this canvas open (and `web` is not asked), else `<origin><hash>`.
|
|
163
|
+
*/
|
|
164
|
+
function linkFor(root, origin, hash, o = {}) {
|
|
165
|
+
if (!o.web && targetFromHash(hash) && (o.app ?? appLive(root))) {
|
|
166
|
+
let real = root;
|
|
167
|
+
try {
|
|
168
|
+
real = realpathSync(root);
|
|
169
|
+
} catch {}
|
|
170
|
+
const port = Number(new URL(origin).port) || void 0;
|
|
171
|
+
const deep = buildDeepLink({
|
|
172
|
+
ws: real,
|
|
173
|
+
to: hash,
|
|
174
|
+
port
|
|
175
|
+
});
|
|
176
|
+
if (deep) return deep;
|
|
177
|
+
}
|
|
178
|
+
return `${origin}${hash}`;
|
|
179
|
+
}
|
|
138
180
|
async function linkCommand(root, targets, opts) {
|
|
139
181
|
const r = resolveLink(root, targets, opts.board);
|
|
140
182
|
if (!r.links.length) throw new Error(r.hints.join("\n"));
|
|
141
183
|
const found = await findDev(root);
|
|
142
184
|
if (!found) throw new Error(NOT_RUNNING);
|
|
143
185
|
const origin = "origin" in found ? found.origin : `http://localhost:${found.unreachable.port}/`;
|
|
144
|
-
|
|
186
|
+
const app = !opts.web && appLive(root);
|
|
187
|
+
for (const l of r.links) console.log(linkFor(root, origin, l.hash, {
|
|
188
|
+
web: opts.web,
|
|
189
|
+
app
|
|
190
|
+
}));
|
|
145
191
|
if ("unreachable" in found) console.error(` ${unreachable(found.unreachable.pid)} The link is its port, from design/.local/dev.json - the person's browser reaches it`);
|
|
146
192
|
for (const h of r.hints) console.error(` ${h}`);
|
|
147
193
|
}
|
|
@@ -157,8 +203,9 @@ async function handBack(root, targets) {
|
|
|
157
203
|
try {
|
|
158
204
|
const r = resolveLink(root, targets);
|
|
159
205
|
const origin = await devOrigin(root);
|
|
206
|
+
const app = !!origin && appLive(root);
|
|
160
207
|
return {
|
|
161
|
-
links: origin ? r.links.map((l) =>
|
|
208
|
+
links: origin ? r.links.map((l) => linkFor(root, origin, l.hash, { app })) : [],
|
|
162
209
|
hints: r.hints
|
|
163
210
|
};
|
|
164
211
|
} catch {
|
|
@@ -169,4 +216,4 @@ async function handBack(root, targets) {
|
|
|
169
216
|
}
|
|
170
217
|
}
|
|
171
218
|
//#endregion
|
|
172
|
-
export { devOrigin, handBack, linkCommand, resolveLink, resolveTargets, unreachable };
|
|
219
|
+
export { NOT_RUNNING, devOrigin, findDev, handBack, linkCommand, linkFor, resolveLink, resolveTargets, unreachable };
|