@marver-design/marver 0.30.1 → 0.32.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 +70 -0
- package/README.md +12 -8
- package/dist/{anchor-check-Bv4o-R2T.mjs → anchor-check-DZtX13ly.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-jHmEPLV7.mjs} +7 -7
- package/dist/{build-zWGXSzly.mjs → build-D2dHEWX-.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-ocvsnt2j.mjs} +85 -10
- package/dist/config-B0YcFtqS.mjs +510 -0
- package/dist/{context-BUnFiyA3.mjs → context-Cj2TcC0H.mjs} +3 -3
- package/dist/{daemon-CChgWJNq.mjs → daemon-D6TrdgMi.mjs} +268 -28
- package/dist/deep-link-DYtuT740.mjs +163 -0
- package/dist/{dev-DOgIITpT.mjs → dev-DMQYbw-2.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-aZq5cExV.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-Cf9GIoIM.mjs +2299 -0
- package/dist/pdf-HB0prF75.mjs +117 -0
- package/dist/{perf-6MOTHxay.mjs → perf-9ZEF5KLO.mjs} +5 -5
- package/dist/{perf-BCxAo0IS.mjs → perf-BA_NDarr.mjs} +2 -1
- package/dist/{plugin-CFWBcAba.mjs → plugin-DesQP9L5.mjs} +565 -107
- package/dist/{poster-DPPpQiva.mjs → poster-Bb6WraCA.mjs} +1 -1
- package/dist/{profile-B1FKOM1e.mjs → profile-cdmSer1k.mjs} +1 -1
- package/dist/{publish-bakes-_Zx8crP3.mjs → publish-bakes-EjMmukJB.mjs} +3 -3
- package/dist/{queue-DeSQm24g.mjs → queue-BLLfdlDw.mjs} +156 -11
- package/dist/{recover-mDUVsnPd.mjs → recover-B3dmatx4.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-d4h_hJi9.mjs → shot-Bjt2MQe3.mjs} +4 -4
- package/dist/{shot-DBWN8hPP.mjs → shot-BuUCG46-.mjs} +1 -1
- package/dist/show-DhmiUu01.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-DJxH7cCX.mjs → work-B4tydWnf.mjs} +38 -2
- package/dist/{work-BYWD_1Zf.mjs → work-CzIXp7n1.mjs} +3 -3
- package/docs/app.md +143 -6
- package/docs/boards-and-folders.md +41 -7
- package/docs/jam-session.md +5 -0
- package/docs/live-jam.md +9 -0
- package/docs/pdf.md +108 -0
- package/docs/publish.md +9 -9
- package/docs/sharing.md +11 -0
- package/docs/slides.md +11 -1
- 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 +104 -27
- package/src/client/shell/Toolbar.tsx +4 -3
- package/src/client/shell/app-bridge.ts +40 -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/immersive.ts +123 -0
- package/src/client/shell/inset.ts +29 -3
- 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-signals.ts +5 -2
- package/src/client/shell/show.ts +250 -0
- package/src/client/shell/store.ts +23 -38
- package/src/client/shell/styles.css +68 -6
- package/src/shared/app-api.ts +90 -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/src/shared/immersive.ts +13 -0
- package/src/shared/perf-records.ts +1 -1
- 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
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
//#region src/shared/deep-link.ts
|
|
2
|
+
/**
|
|
3
|
+
* Spec 31 Part D: the one contract for showing the human a place on a canvas - pure, no DOM, no Node, so the CLI,
|
|
4
|
+
* the dev server, the shell and the Mac app read it with one rule.
|
|
5
|
+
*
|
|
6
|
+
* - **A show target** (`ShowTarget`) is the hash's own targets on one board: `n` node keys, `f` frame ids, `s` scenes,
|
|
7
|
+
* `c` one comment thread. Node keys stay node keys (selecting one copy of a frame never selects every copy), and
|
|
8
|
+
* every value is checked against the hash grammar's characters - never a raw hash, never a URL, never script.
|
|
9
|
+
* - **The link hash** a target travels as: `#/b/<board>` and only the `f`, `s`, `n`, `c` query keys, each once, each
|
|
10
|
+
* value of the allowed characters (`targetFromHash` refuses anything else whole; `hashOfTarget` writes it back).
|
|
11
|
+
* - **A deep link** into the Mac app: `marver://open?ws=<folder>&to=<hash>[&port=<p>]`, both values written with
|
|
12
|
+
* `URLSearchParams` (so the hash's own `#`, `?` and `&` are percent-encoded inside `to`), 2 KB at most. `ws` is the
|
|
13
|
+
* canvas's folder (the app realpaths it and binds it to a running canvas); `port` is a hint the app uses only when
|
|
14
|
+
* that port's canvas has the same folder; a `to` that is not the grammar is dropped (the canvas opens on its default
|
|
15
|
+
* board), never the link.
|
|
16
|
+
*/
|
|
17
|
+
const DEEP_LINK_SCHEME = "marver";
|
|
18
|
+
/** The board-name grammar (shared/board-tree.ts BOARD_NAME, bounded) and the Not on a board view. */
|
|
19
|
+
const BOARD = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
20
|
+
const UNPLACED_BOARD = "~unplaced";
|
|
21
|
+
const FRAME = /^[\w./-]{1,200}$/;
|
|
22
|
+
const SCENE = /^[\w.-]{1,120}$/;
|
|
23
|
+
/** a node key is the shell's: `<frame id>@<width>`, or a board file's own (`n-one`) */
|
|
24
|
+
const NODE = /^[\w./@:-]{1,200}$/;
|
|
25
|
+
const THREAD = /^[\w-]{1,128}$/;
|
|
26
|
+
const okBoard = (b) => typeof b === "string" && (BOARD.test(b) || b === "~unplaced");
|
|
27
|
+
const okIn = (re) => (v) => typeof v === "string" && re.test(v) && !v.includes("..");
|
|
28
|
+
const okFrame = okIn(FRAME);
|
|
29
|
+
const okScene = okIn(SCENE);
|
|
30
|
+
const okNode = okIn(NODE);
|
|
31
|
+
const okThread = okIn(THREAD);
|
|
32
|
+
const KEYS = {
|
|
33
|
+
n: okNode,
|
|
34
|
+
f: okFrame,
|
|
35
|
+
s: okScene
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* A show target off the wire (pure): `board` a board name, `n`/`f`/`s` arrays of their grammar's values (at most
|
|
39
|
+
* `TARGET_LIST_MAX`, de-duplicated, empty ones left out), `c` a thread id. Unknown fields are stripped; a known one of
|
|
40
|
+
* the wrong type or any value off its grammar refuses the whole (null).
|
|
41
|
+
*/
|
|
42
|
+
function checkShowTarget(v) {
|
|
43
|
+
if (!v || typeof v !== "object" || Array.isArray(v)) return null;
|
|
44
|
+
const r = v;
|
|
45
|
+
if (!okBoard(r.board)) return null;
|
|
46
|
+
const out = { board: r.board };
|
|
47
|
+
for (const k of [
|
|
48
|
+
"n",
|
|
49
|
+
"f",
|
|
50
|
+
"s"
|
|
51
|
+
]) {
|
|
52
|
+
if (r[k] === void 0) continue;
|
|
53
|
+
const list = r[k];
|
|
54
|
+
if (!Array.isArray(list) || list.length > 64 || !list.every(KEYS[k])) return null;
|
|
55
|
+
const uniq = [...new Set(list)];
|
|
56
|
+
if (uniq.length) out[k] = uniq;
|
|
57
|
+
}
|
|
58
|
+
if (r.c !== void 0) {
|
|
59
|
+
if (!okThread(r.c)) return null;
|
|
60
|
+
out.c = r.c;
|
|
61
|
+
}
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The link hash's target (pure): `#/b/<board>` with only `f`, `s`, `n`, `c`, each at most once, every value of its
|
|
66
|
+
* grammar; anything else - another route, another key, a repeated key, a bad value, more than 2 KB - is null.
|
|
67
|
+
*/
|
|
68
|
+
function targetFromHash(hash) {
|
|
69
|
+
if (typeof hash !== "string" || hash.length > 2048) return null;
|
|
70
|
+
const m = /^#\/b\/([^?#/]+)(?:\?([^#]*))?$/.exec(hash);
|
|
71
|
+
if (!m) return null;
|
|
72
|
+
let board;
|
|
73
|
+
try {
|
|
74
|
+
board = decodeURIComponent(m[1]);
|
|
75
|
+
} catch {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
if (!okBoard(board)) return null;
|
|
79
|
+
const raw = { board };
|
|
80
|
+
if (m[2] !== void 0 && m[2] !== "") {
|
|
81
|
+
let params;
|
|
82
|
+
try {
|
|
83
|
+
params = new URLSearchParams(m[2]);
|
|
84
|
+
} catch {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
const seen = /* @__PURE__ */ new Set();
|
|
88
|
+
for (const [k, v] of params) {
|
|
89
|
+
if (seen.has(k) || ![
|
|
90
|
+
"n",
|
|
91
|
+
"f",
|
|
92
|
+
"s",
|
|
93
|
+
"c"
|
|
94
|
+
].includes(k)) return null;
|
|
95
|
+
seen.add(k);
|
|
96
|
+
if (k === "c") raw.c = v;
|
|
97
|
+
else raw[k] = v.split(",").map((x) => x.trim()).filter(Boolean);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return checkShowTarget(raw);
|
|
101
|
+
}
|
|
102
|
+
/** The target as the link hash (pure): the board, then `n`, `f`, `s`, `c` - every value already of URL-safe characters. */
|
|
103
|
+
function hashOfTarget(t) {
|
|
104
|
+
const q = [
|
|
105
|
+
t.n?.length ? `n=${t.n.join(",")}` : "",
|
|
106
|
+
t.f?.length ? `f=${t.f.join(",")}` : "",
|
|
107
|
+
t.s?.length ? `s=${t.s.join(",")}` : "",
|
|
108
|
+
t.c ? `c=${t.c}` : ""
|
|
109
|
+
].filter(Boolean).join("&");
|
|
110
|
+
return `#/b/${t.board}${q ? `?${q}` : ""}`;
|
|
111
|
+
}
|
|
112
|
+
const CONTROL = /[\u0000-\u001f\u007f]/;
|
|
113
|
+
/** `marver://open?ws=<folder>&to=<hash>[&port=<p>]`, written with URLSearchParams; null past 2 KB or with a bad folder. */
|
|
114
|
+
function buildDeepLink(o) {
|
|
115
|
+
if (!o.ws.startsWith("/") || CONTROL.test(o.ws)) return null;
|
|
116
|
+
const p = new URLSearchParams({ ws: o.ws });
|
|
117
|
+
if (o.to) p.set("to", o.to);
|
|
118
|
+
if (o.port !== void 0 && Number.isInteger(o.port) && o.port > 0 && o.port < 65536) p.set("port", String(o.port));
|
|
119
|
+
const link = `${DEEP_LINK_SCHEME}://open?${p}`;
|
|
120
|
+
return link.length <= 2048 ? link : null;
|
|
121
|
+
}
|
|
122
|
+
/** Strictly newer x.y.z (pure): anything not three numbers compares false. */
|
|
123
|
+
function newerVersion(a, b) {
|
|
124
|
+
if (typeof a !== "string" || typeof b !== "string") return false;
|
|
125
|
+
const pa = /^(\d+)\.(\d+)\.(\d+)$/.exec(a), pb = /^(\d+)\.(\d+)\.(\d+)$/.exec(b);
|
|
126
|
+
if (!pa || !pb) return false;
|
|
127
|
+
for (let i = 1; i <= 3; i++) {
|
|
128
|
+
const x = Number(pa[i]), y = Number(pb[i]);
|
|
129
|
+
if (x !== y) return x > y;
|
|
130
|
+
}
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
/** `<MARVER_HOME>/state/app-live.json`: the Mac app's word that it runs, rewritten every `APP_LIVE_EVERY_MS`. */
|
|
134
|
+
const APP_LIVE_FILE = "app-live.json";
|
|
135
|
+
/** The file's shape (pure), or null. */
|
|
136
|
+
function checkAppLive(v) {
|
|
137
|
+
const r = v;
|
|
138
|
+
if (!r || typeof r !== "object" || r.v !== 1) return null;
|
|
139
|
+
if (!Number.isInteger(r.pid) || r.pid < 1 || typeof r.version !== "string" || r.version.length > 32) return null;
|
|
140
|
+
if (typeof r.at !== "number" || !Number.isFinite(r.at)) return null;
|
|
141
|
+
if (!Array.isArray(r.workspaces) || r.workspaces.length > 256 || !r.workspaces.every((w) => typeof w === "string" && w.startsWith("/") && w.length <= 4096)) return null;
|
|
142
|
+
return {
|
|
143
|
+
v: 1,
|
|
144
|
+
pid: r.pid,
|
|
145
|
+
version: r.version,
|
|
146
|
+
at: r.at,
|
|
147
|
+
workspaces: [...r.workspaces],
|
|
148
|
+
...r.scheme === 1 ? { scheme: 1 } : {}
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Whether `marver link` gives the app's link for the canvas in `root` (pure): the file names a pid that runs, was
|
|
153
|
+
* written under 90 s ago (a stamp from the future is stale too), takes the scheme, and has this canvas's folder open.
|
|
154
|
+
* Anything else - no file, an older app, a stale file, the canvas not open in a tab - is the localhost link.
|
|
155
|
+
*/
|
|
156
|
+
function appTakesLink(file, root, now, alive) {
|
|
157
|
+
if (!file || file.scheme !== 1) return false;
|
|
158
|
+
if (file.at > now + 5e3 || now - file.at > 9e4) return false;
|
|
159
|
+
if (!file.workspaces.includes(root)) return false;
|
|
160
|
+
return alive(file.pid);
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
163
|
+
export { checkAppLive as a, newerVersion as c, buildDeepLink as i, targetFromHash as l, UNPLACED_BOARD as n, checkShowTarget as o, appTakesLink as r, hashOfTarget as s, APP_LIVE_FILE as t };
|
|
@@ -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-DesQP9L5.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-B4tydWnf.mjs").then((n) => n.c);
|
|
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-Bjt2MQe3.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-D6TrdgMi.mjs");
|
|
1112
|
+
const { checkAnchor } = await import("./anchor-check-DZtX13ly.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-DesQP9L5.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-Bjt2MQe3.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-DesQP9L5.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-BA_NDarr.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 {
|