@marver-design/marver 0.22.1 → 0.23.1

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.
Files changed (65) hide show
  1. package/CHANGELOG.md +117 -0
  2. package/README.md +14 -10
  3. package/dist/agent-BsieQGTD.mjs +99 -0
  4. package/dist/{bake-CvY8QR3L.mjs → bake-DQtnDB8-.mjs} +1 -1
  5. package/dist/{board-status-CWGHIdo_.mjs → board-status-BZSzc9Hp.mjs} +69 -610
  6. package/dist/boards-BRLnoTC3.mjs +620 -0
  7. package/dist/{boards-BwKI0qWd.mjs → boards-Dv-Ipd8G.mjs} +13 -5
  8. package/dist/{build-B1kavcpc.mjs → build-_ndp_dXn.mjs} +18 -10
  9. package/dist/cli.mjs +20 -11
  10. package/dist/{comments-ClVgfQib.mjs → comments-BlqyZh3D.mjs} +71 -9
  11. package/dist/{config-DJxMRVD8.mjs → config-BUKprFAp.mjs} +5 -97
  12. package/dist/{context-D4t59wDi.mjs → context-CdkNiKdJ.mjs} +3 -2
  13. package/dist/{daemon-PmNqoOAk.mjs → daemon-BvMPdQ3k.mjs} +78 -19
  14. package/dist/{dev-Cf4wLGe2.mjs → dev-Cf-4eqaC.mjs} +50 -10
  15. package/dist/{init-C_K-cjBQ.mjs → init-hfZV7TwY.mjs} +10 -4
  16. package/dist/{ledger-Bu0BjqIe.mjs → ledger-BNXW14Xw.mjs} +1 -6
  17. package/dist/link-BodAbIQz.mjs +132 -0
  18. package/dist/{manifest-CcdWx7ud.mjs → manifest-TpfDWldB.mjs} +56 -6
  19. package/dist/{plugin-C5u07Yhv.mjs → plugin-DoXql0ZZ.mjs} +400 -48
  20. package/dist/{poster-BduzQBYz.mjs → poster-XBmUvQiL.mjs} +1 -1
  21. package/dist/{profile-BjAPAJSb.mjs → profile-CrZohD6g.mjs} +1 -1
  22. package/dist/{publish-bakes-b0jUwvM_.mjs → publish-bakes-KKTHWqq3.mjs} +2 -2
  23. package/dist/{share--bdSc4G5.mjs → share-BD-wcDQq.mjs} +1 -1
  24. package/dist/{shot-BAR8hmU9.mjs → shot-DOD8v6fJ.mjs} +2 -2
  25. package/dist/{shot-BFEuYbaz.mjs → shot-Dh6fV1Lm.mjs} +1 -1
  26. package/dist/{sync-BZaCWqK-.mjs → sync-DoA1vf4u.mjs} +15 -1
  27. package/dist/{work-0YopuMt9.mjs → work-ClFFq0Qh.mjs} +9 -3
  28. package/dist/{work-CLrmY-vQ.mjs → work-ayuL_9Kk.mjs} +72 -1
  29. package/docs/boards-and-folders.md +60 -7
  30. package/docs/context.md +10 -2
  31. package/docs/live-jam.md +11 -0
  32. package/docs/sticky-notes.md +1 -1
  33. package/package.json +1 -1
  34. package/src/client/content/diagram.tsx +7 -1
  35. package/src/client/content/img-lod.ts +12 -2
  36. package/src/client/content/index.tsx +73 -6
  37. package/src/client/content/md.ts +3 -2
  38. package/src/client/frame-host/inspect.js +23 -0
  39. package/src/client/shell/App.tsx +21 -10
  40. package/src/client/shell/BoardList.tsx +26 -6
  41. package/src/client/shell/LockedApp.tsx +2 -2
  42. package/src/client/shell/Play.tsx +5 -1
  43. package/src/client/shell/StatusPicker.tsx +12 -5
  44. package/src/client/shell/Tip.tsx +25 -5
  45. package/src/client/shell/board-icons.tsx +15 -1
  46. package/src/client/shell/canvas/Canvas.tsx +42 -6
  47. package/src/client/shell/canvas/anchor.ts +41 -0
  48. package/src/client/shell/canvas/ctl.ts +6 -0
  49. package/src/client/shell/comments-store.ts +8 -5
  50. package/src/client/shell/goto.ts +52 -3
  51. package/src/client/shell/hash.ts +24 -3
  52. package/src/client/shell/store.ts +261 -36
  53. package/src/client/shell/styles.css +20 -2
  54. package/src/client/shell/tidy.ts +34 -3
  55. package/src/shared/board-types.ts +10 -6
  56. package/src/shared/frames.ts +3 -0
  57. package/src/shared/status.ts +17 -8
  58. package/templates/AGENTS-embedded.md +43 -8
  59. package/templates/AGENTS-studio.md +43 -8
  60. package/templates/instructions/boards.md +13 -3
  61. package/templates/instructions/context.md +6 -2
  62. package/templates/instructions/iterate.md +29 -16
  63. package/templates/instructions/jam.md +9 -2
  64. package/templates/instructions/reference/deck-layouts.md +2 -1
  65. package/templates/instructions/reference/deck-story.md +2 -1
@@ -1,8 +1,9 @@
1
1
  import { a as ROUTE, r as NAME } from "./cli.mjs";
2
- import { D as boardFields, H as isBoardName, L as buildTree, N as readRegistry, O as checkBoardsDir, R as flatten, Z as PROPOSED_PUBLISH, i as PUBLISHABLE, j as listBoardFiles, o as publishableStatus } from "./board-status-CWGHIdo_.mjs";
3
- import { i as scanFrames } from "./manifest-CcdWx7ud.mjs";
4
- import { i as detectHost, n as loadConfig } from "./config-DJxMRVD8.mjs";
5
- import { n as tailwind3Css, r as tailwind4Plugin, t as marverPlugin } from "./plugin-C5u07Yhv.mjs";
2
+ import { h as flatten, i as checkBoardsDir, k as PROPOSED_PUBLISH, m as buildTree, r as boardFields, s as listBoardFiles, u as readRegistry, y as isBoardName } from "./boards-BRLnoTC3.mjs";
3
+ import { c as publishableStatus, o as PUBLISHABLE } from "./board-status-BZSzc9Hp.mjs";
4
+ import { o as scanFrames } from "./manifest-TpfDWldB.mjs";
5
+ import { n as loadConfig, r as detectHost } from "./config-BUKprFAp.mjs";
6
+ import { a as autoWidthOf, c as readSizes, n as tailwind3Css, o as keptSizes, r as tailwind4Plugin, s as measuringFrames, t as marverPlugin } from "./plugin-DoXql0ZZ.mjs";
6
7
  import { cpSync, existsSync, mkdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
7
8
  import { basename, dirname, join, sep } from "node:path";
8
9
  import { fileURLToPath } from "node:url";
@@ -368,7 +369,7 @@ function publishedTree(published, allBoards, folders) {
368
369
  /** The bundle's manifest: the published frames, and descriptions of published things ONLY -
369
370
  * the project's, the published scenes' (their brief path only when source is revealed),
370
371
  * the published boards' and the folders those sit in. No unpublished name or sentence. */
371
- function publishedManifest(manifest, pubFrames, publishedNames, strip, showStatus = /* @__PURE__ */ new Set()) {
372
+ function publishedManifest(manifest, pubFrames, publishedNames, strip, showStatus = /* @__PURE__ */ new Set(), recipeScenes = /* @__PURE__ */ new Set()) {
372
373
  const pubScenes = new Set(pubFrames.map((f) => f.scene));
373
374
  const pubBoardSet = new Set(publishedNames);
374
375
  const pubBoards = (manifest.boards ?? []).filter((b) => pubBoardSet.has(b.name)).map(({ status, ...b }) => {
@@ -385,14 +386,17 @@ function publishedManifest(manifest, pubFrames, publishedNames, strip, showStatu
385
386
  ...manifest.project ? { project: manifest.project } : {},
386
387
  ...pubFolders.length ? { folders: pubFolders } : {},
387
388
  ...pubBoards.length ? { boards: pubBoards } : {},
388
- scenes: manifest.scenes.filter((s) => pubScenes.has(s.name)).map(({ name, title, description, brief, note }) => ({
389
+ scenes: manifest.scenes.flatMap(({ name, title, description, brief, note }) => pubScenes.has(name) ? [{
389
390
  name,
390
391
  frames: pubFrames.filter((f) => f.scene === name).length,
391
392
  ...title ? { title } : {},
392
393
  ...description ? { description } : {},
393
394
  ...brief && !strip ? { brief } : {},
394
395
  ...note ? { note } : {}
395
- })),
396
+ }] : recipeScenes.has(name) ? [{
397
+ name,
398
+ frames: 0
399
+ }] : []),
396
400
  frames: pubFrames
397
401
  };
398
402
  }
@@ -574,7 +578,8 @@ async function buildSite(root, boardsFlag, allBoardsFlag, embedSeeds, textures =
574
578
  file: opaquePath(f.id, f.kind === "html" ? ".html" : "")
575
579
  })) : frames;
576
580
  const showStatus = new Set(publishedNames.filter((n) => policy.boards[n]?.showStatus));
577
- const pubManifest = publishedManifest(manifest, pubFrames, publishedNames, strip, showStatus);
581
+ const lanes = (x) => Array.isArray(x) ? x : [];
582
+ const pubManifest = publishedManifest(manifest, pubFrames, publishedNames, strip, showStatus, new Set(Object.values(boards).flatMap((b) => [...lanes(b?.layout?.rows), ...lanes(b?.layout?.columns)]).flatMap(lanes).filter((a) => typeof a === "string")));
578
583
  for (const n of publishedNames) {
579
584
  const pb = policy.boards[n];
580
585
  if (pb?.type !== "slides" && pb?.open !== "slides") continue;
@@ -611,6 +616,8 @@ async function buildSite(root, boardsFlag, allBoardsFlag, embedSeeds, textures =
611
616
  ...b.status ? { status: b.status } : {}
612
617
  }]] : []));
613
618
  const bakeGen = textures ? Date.now() : void 0;
619
+ const pubIds = new Set(frames.map((f) => f.id));
620
+ const sizes = Object.fromEntries(Object.entries(keptSizes(readSizes(root), autoWidthOf(manifest.frames, config.viewports), measuringFrames(root, manifest.frames))).filter(([k]) => pubIds.has(k.slice(0, k.lastIndexOf("@")))));
614
621
  const data = {
615
622
  bakes: bakeGen,
616
623
  manifest: pubManifest,
@@ -619,6 +626,7 @@ async function buildSite(root, boardsFlag, allBoardsFlag, embedSeeds, textures =
619
626
  tree,
620
627
  ...Object.keys(titles).length ? { titles } : {},
621
628
  ...Object.keys(meta).length ? { meta } : {},
629
+ ...Object.keys(sizes).length ? { sizes } : {},
622
630
  ...Object.values(meta).some((m) => m.status) ? { statusAsOf: (/* @__PURE__ */ new Date()).toISOString() } : {},
623
631
  default: publishedNames.find((n) => n !== "all-scenes") ?? publishedNames[0],
624
632
  rights,
@@ -754,7 +762,7 @@ async function buildSite(root, boardsFlag, allBoardsFlag, embedSeeds, textures =
754
762
  const realAssets = existsSync(assetsDir) ? realpathSync(assetsDir) : null;
755
763
  for (const r of refs) {
756
764
  if (!isLocalAssetRef(r) || !r.endsWith(".poster.png") || existsSync(join(assetsDir, r))) continue;
757
- const { ensurePoster } = await import("./poster-BduzQBYz.mjs");
765
+ const { ensurePoster } = await import("./poster-XBmUvQiL.mjs");
758
766
  const g = await ensurePoster(assetsDir, r.slice(0, -11));
759
767
  if (!g.ok) throw new Error(`design/assets/${r}: ${g.error}`);
760
768
  console.log(` poster: rendered design/assets/${r} (${g.width}×${g.height})`);
@@ -821,7 +829,7 @@ async function buildSite(root, boardsFlag, allBoardsFlag, embedSeeds, textures =
821
829
  }));
822
830
  let textureLine = " textures: skipped (--no-textures)";
823
831
  if (textures && bakeGen) {
824
- const { bakePublished } = await import("./publish-bakes-b0jUwvM_.mjs");
832
+ const { bakePublished } = await import("./publish-bakes-KKTHWqq3.mjs");
825
833
  const pubFrameFile = new Map(pubFrames.map((f) => [f.id, f]));
826
834
  const r = await bakePublished({
827
835
  root,
package/dist/cli.mjs CHANGED
@@ -82,7 +82,7 @@ cli.command("init", "Scaffold design/ in this repo").option("--mode <mode>", "st
82
82
  console.error(`[${NAME}] --kind ${opts.kind}: use product or knowledge`);
83
83
  process.exit(1);
84
84
  }
85
- const { init } = await import("./init-C_K-cjBQ.mjs");
85
+ const { init } = await import("./init-hfZV7TwY.mjs");
86
86
  init(resolve$1(opts.root), {
87
87
  mode: opts.mode === "embedded" ? "embedded" : "studio",
88
88
  demo: opts.demo !== false,
@@ -90,7 +90,7 @@ cli.command("init", "Scaffold design/ in this repo").option("--mode <mode>", "st
90
90
  });
91
91
  });
92
92
  for (const [name, desc] of [["dev", "Start the local canvas (everything on: hot reload, comments, Live Jam)"], ["canvas", "Start the local canvas - same as dev"]]) cli.command(name, desc).option("--root <dir>", "Host repo root", { default: "." }).option("--port <port>", "Port (default 5199)").action(async (opts) => {
93
- const { dev } = await import("./dev-Cf4wLGe2.mjs");
93
+ const { dev } = await import("./dev-Cf-4eqaC.mjs");
94
94
  let port;
95
95
  if (opts.port !== void 0) {
96
96
  const n = Number(opts.port);
@@ -100,7 +100,7 @@ for (const [name, desc] of [["dev", "Start the local canvas (everything on: hot
100
100
  await dev(resolve$1(opts.root), port);
101
101
  });
102
102
  cli.command("build", "Static export → design/.dist (what ships comes from design/publish.json - publishing is default-closed)").option("--boards <names>", "Publish only these boards (comma-separated); overrides the publish policy").option("--all-boards", "Publish every board - the loud override for the default-closed policy").option("--embed-seeds", "Copy comment history INTO the web root (identifying - every event carries its author's email)").option("--no-textures", "Skip compiling the glass textures the published frames rest under (needs Chrome; a CI without one skips on its own)").option("--root <dir>", "Host repo root", { default: "." }).action(async (opts) => {
103
- const { buildSite } = await import("./build-B1kavcpc.mjs");
103
+ const { buildSite } = await import("./build-_ndp_dXn.mjs");
104
104
  try {
105
105
  const boards = opts.boards === void 0 ? void 0 : typeof opts.boards === "string" ? opts.boards : "";
106
106
  await buildSite(resolve$1(opts.root), boards, opts.allBoards === true, opts.embedSeeds === true, opts.textures !== false && !process.env.MARVER_NO_TEXTURES);
@@ -118,8 +118,8 @@ cli.command("serve", "Serve design/.dist (set MARVER_PASSWORD to gate it)").opti
118
118
  }
119
119
  serve(resolve$1(opts.root), port);
120
120
  });
121
- cli.command("comments <action> [value]", "Comment collaboration: connect <url> · sync · list · reply <thread> · resolve <thread> · invite <email> · revoke <email>").option("--root <dir>", "Host repo root", { default: "." }).option("--token <token>", "connect: the canvas's MARVER_CLI_TOKEN (default $MARVER_CLI_TOKEN) - the identity-mode path").option("--invite <token>", "connect: claim this invite instead of signing in").option("--canvas-password <password>", "connect: the canvas gate password (default $MARVER_PASSWORD or prompt)").option("--email <email>", "connect: account email (skips the prompt)").option("--password <password>", "connect: account password (skips the prompt - mind your shell history)").option("--name <name>", "connect --invite: display name for the new account").option("--open", "list: only unresolved threads").option("--json", "list: machine-readable output").option("--board <board>", "scope to one board").option("--body <text>", "reply: the reply text").option("--addressed-in <frame>", "resolve: the variant frame that answered the feedback").action(async (action, value, opts) => {
122
- const { commentsCommand } = await import("./comments-ClVgfQib.mjs");
121
+ cli.command("comments <action> [value]", "Comment collaboration: connect <url> · sync · list · new <scene/frame> · reply <thread> · resolve <thread> · invite <email> · revoke <email>").option("--root <dir>", "Host repo root", { default: "." }).option("--token <token>", "connect: the canvas's MARVER_CLI_TOKEN (default $MARVER_CLI_TOKEN) - the identity-mode path").option("--invite <token>", "connect: claim this invite instead of signing in").option("--canvas-password <password>", "connect: the canvas gate password (default $MARVER_PASSWORD or prompt)").option("--email <email>", "connect: account email (skips the prompt)").option("--password <password>", "connect: account password (skips the prompt - mind your shell history)").option("--name <name>", "connect --invite: display name for the new account").option("--open", "list: only unresolved threads").option("--json", "list: machine-readable output").option("--board <board>", "list: scope to one board · new: the board to pin on (default: the one its link opens)").option("--body <text>", "new / reply: the text").option("--on <text>", "new: pin on the element showing this text (default: the frame, top right)").option("--addressed-in <frame>", "resolve: the variant frame that answered the feedback").action(async (action, value, opts) => {
122
+ const { commentsCommand } = await import("./comments-BlqyZh3D.mjs");
123
123
  try {
124
124
  await commentsCommand(resolve$1(opts.root), action, value, opts);
125
125
  } catch (err) {
@@ -128,7 +128,7 @@ cli.command("comments <action> [value]", "Comment collaboration: connect <url>
128
128
  }
129
129
  });
130
130
  cli.command("share <action> [value]", "Sharing roster (owner): add <who> · remove <who> · block/unblock <email> · general <mode> · list · requests · explain <who> · who").option("--root <dir>", "Host repo root", { default: "." }).option("--role <role>", "add / requests --approve: view (default) or comment").option("--expires <iso>", "add: expiry timestamp, e.g. 2026-12-31T00:00:00Z").option("--approve <email>", "requests: approve this pending request (canvas-wide in v1)").option("--decline <email>", "requests: decline this pending request (silent to the asker)").option("--json", "list: machine-readable output").action(async (action, value, opts) => {
131
- const { shareCommand } = await import("./share--bdSc4G5.mjs");
131
+ const { shareCommand } = await import("./share-BD-wcDQq.mjs");
132
132
  try {
133
133
  await shareCommand(resolve$1(opts.root), action, value, opts);
134
134
  } catch (err) {
@@ -137,7 +137,7 @@ cli.command("share <action> [value]", "Sharing roster (owner): add <who> · remo
137
137
  }
138
138
  });
139
139
  cli.command("work <action> [...frames]", "Working state on the canvas: start <scene/frame ...> · done <scene/frame ...> | --all · list").option("--root <dir>", "Host repo root", { default: "." }).option("--ttl <minutes>", "start: minutes before the glow self-expires (default 10, max 30)").option("--all", "done: clear every working frame").action(async (action, frames, opts) => {
140
- const { workCommand } = await import("./work-0YopuMt9.mjs");
140
+ const { workCommand } = await import("./work-ClFFq0Qh.mjs");
141
141
  try {
142
142
  await workCommand(resolve$1(opts.root), action, frames ?? [], opts);
143
143
  } catch (err) {
@@ -145,8 +145,17 @@ cli.command("work <action> [...frames]", "Working state on the canvas: start <sc
145
145
  process.exit(1);
146
146
  }
147
147
  });
148
+ cli.command("link [...targets]", "The canvas link that lands on frames: link <scene/frame | scene ...> - their board, in canvas mode, selected and fitted").option("--root <dir>", "Host repo root", { default: "." }).option("--board <board>", "The board to open (default: the first board that shows them all, else all-scenes)").action(async (targets, opts) => {
149
+ const { linkCommand } = await import("./link-BodAbIQz.mjs");
150
+ try {
151
+ await linkCommand(resolve$1(opts.root), targets ?? [], opts);
152
+ } catch (err) {
153
+ console.error(`[${NAME}] ${err.message}`);
154
+ process.exit(1);
155
+ }
156
+ });
148
157
  cli.command("boards [action] [name]", "The sidebar as files: every folder and board in reading order, with types and statuses · new <name>: a board in its type's starting layout").option("--root <dir>", "Host repo root", { default: "." }).option("--json", "The tree as JSON ({ tree, boards, landing, registry })").option("--type <type>", "new: start | feature | surface | project | feedback | context | deck | archive (default: the folder's)").option("--folder <folder>", "new: the folder it sits in").option("--title <title>", "new: what humans see").option("--description <sentence>", "new: what agents read").option("--capability <slug>", "new: the capability it shows, when not its own name").action(async (action, name, opts) => {
149
- const { boardsCommand, boardsNew } = await import("./boards-BwKI0qWd.mjs");
158
+ const { boardsCommand, boardsNew } = await import("./boards-Dv-Ipd8G.mjs");
150
159
  try {
151
160
  if (action === void 0) boardsCommand(resolve$1(opts.root), opts);
152
161
  else if (action === "new") {
@@ -162,7 +171,7 @@ cli.command("boards [action] [name]", "The sidebar as files: every folder and bo
162
171
  }
163
172
  });
164
173
  cli.command("folders <action> [...modules]", "The shared sidebar's typed folders · add <start|features|surfaces|projects|feedback|context|decks|archive ...>").option("--root <dir>", "Host repo root", { default: "." }).action(async (action, modules, opts) => {
165
- const { foldersAdd } = await import("./boards-BwKI0qWd.mjs");
174
+ const { foldersAdd } = await import("./boards-Dv-Ipd8G.mjs");
166
175
  try {
167
176
  if (action !== "add") throw new Error(`unknown action "${action}" - \`folders add <module ...>\``);
168
177
  const { added, existing } = foldersAdd(resolve$1(opts.root), modules);
@@ -174,7 +183,7 @@ cli.command("folders <action> [...modules]", "The shared sidebar's typed folders
174
183
  }
175
184
  });
176
185
  cli.command("context <action>", "The project's context/ (spec 19) · init: create it · check: keep it true (exit 0 pass, 1 fail, 2 cannot determine) · index: regenerate the index's capability table").option("--root <dir>", "Host repo root", { default: "." }).option("--base <ref>", "check: the pull request's base - a change to a contracted capability's code must change its contract or say why (in ci, read from the event)").option("--head <ref>", "check: the pull request's head (default HEAD)").option("--body-file <file>", "check: the pull request's body, for `no-contract-change: <capability> - <why>`").option("--json", "check: the findings as JSON ({ exit, failures, unsure, notes })").option("--kind <kind>", "init: product (a shipped record) or knowledge (a delivered record)", { default: "product" }).action(async (action, opts) => {
177
- const ctx = await import("./context-D4t59wDi.mjs");
186
+ const ctx = await import("./context-CdkNiKdJ.mjs");
178
187
  const root = resolve$1(opts.root);
179
188
  try {
180
189
  if (action === "init") {
@@ -210,7 +219,7 @@ cli.command("context <action>", "The project's context/ (spec 19) · init: creat
210
219
  }
211
220
  });
212
221
  cli.command("shot [...frames]", "Render frames headless and print the PNG paths (needs `dev` running): ids, --scene <name> or --all").option("--root <dir>", "Host repo root", { default: "." }).option("--scene <name>", "Every frame of one scene").option("--all", "Every frame of the canvas").option("--theme <name>", "Theme to render (default: light)").option("--scale <n>", "Device pixels per CSS px, 1-4 (default: 2; 4 for print-quality stills)").option("--json", "Print the results as JSON ({ results: [...] }) instead of paths").action(async (frames, opts) => {
213
- const { shotCommand } = await import("./shot-BFEuYbaz.mjs");
222
+ const { shotCommand } = await import("./shot-Dh6fV1Lm.mjs");
214
223
  try {
215
224
  await shotCommand(resolve$1(opts.root), frames, opts);
216
225
  } catch (err) {
@@ -1,8 +1,9 @@
1
1
  import { r as NAME } from "./cli.mjs";
2
2
  import { n as replay } from "./events-B3LBn74P.mjs";
3
3
  import { i as readLog, r as listBoards, t as appendEvents } from "./comments-DZyobpxG.mjs";
4
- import { a as syncOnce, i as loadCollab, n as connectClaim, r as connectToken, t as connect } from "./sync-BZaCWqK-.mjs";
5
- import { n as localProfile } from "./profile-BjAPAJSb.mjs";
4
+ import { a as syncOnce, i as loadCollab, n as connectClaim, r as connectToken, t as connect } from "./sync-DoA1vf4u.mjs";
5
+ import { n as localProfile } from "./profile-CrZohD6g.mjs";
6
+ import { a as runningAgent } from "./agent-BsieQGTD.mjs";
6
7
  import { join } from "node:path";
7
8
  import { randomUUID } from "node:crypto";
8
9
  import { createInterface } from "node:readline";
@@ -17,7 +18,10 @@ import { createInterface } from "node:readline";
17
18
  * has), --invite <t> to claim an invite, or email + password.
18
19
  * sync one full exchange with the publish target (agent/CI path)
19
20
  * list threads from design/comments/ (--open, --board, --json)
20
- * reply <thread> append a reply (--body) - the agent's voice in the loop
21
+ * new <frame> pin a note on a frame (--body, --on "<text on screen>") - Marver's voice, the
22
+ * owner's pill: what an agent leaves where it needs the human's eyes
23
+ * reply <thread> append a reply (--body) - the agent's voice in the loop: Marver's on a thread
24
+ * started here, the owner's on a collaborator's (the voice that reaches them)
21
25
  * resolve <thread> mark addressed (--addressed-in <frame> records WHICH variant)
22
26
  * invite <email> mint a single-use invite link (owner only, needs connect first)
23
27
  * revoke <email> revoke an account and its sessions (owner only)
@@ -95,7 +99,7 @@ async function commentsCommand(root, action, value, opts) {
95
99
  if (!threads.length) return void console.log(` no ${opts.open ? "open " : ""}comments`);
96
100
  for (const t of threads) {
97
101
  const anchor = t.frame ? ` on ${t.frame}` : "";
98
- console.log(` ${t.resolved ? "✓" : "○"} ${t.id}${anchor} - ${t.author?.name ?? "?"}: ${t.body ?? ""}${t.replies.length ? ` (+${t.replies.length})` : ""}${t.addressedIn ? ` → ${t.addressedIn}` : ""}`);
102
+ console.log(` ${t.resolved ? "✓" : "○"} ${t.id}${anchor} - ${t.agent ? "Marver" : t.author?.name ?? "?"}: ${t.body ?? ""}${t.replies.length ? ` (+${t.replies.length})` : ""}${t.addressedIn ? ` → ${t.addressedIn}` : ""}`);
99
103
  }
100
104
  return;
101
105
  }
@@ -103,17 +107,50 @@ async function commentsCommand(root, action, value, opts) {
103
107
  if (!value || !opts.body) throw new Error("usage: comments reply <thread-id> --body \"...\"");
104
108
  const t = allThreads(root).find((t) => t.id === value);
105
109
  if (!t) throw new Error(`no thread ${value} in design/comments/`);
110
+ const local = ownerThread(root, t);
106
111
  appendEvents(join(root, "design", "comments"), t.board, [{
107
112
  id: randomUUID(),
108
113
  ts: Date.now(),
109
114
  type: "reply",
110
115
  commentId: randomUUID(),
111
116
  parentId: t.id,
112
- author: localAuthor(root),
113
- body: String(opts.body)
117
+ board: t.board,
118
+ ...local ? marverAuthor(root) : { author: localAuthor(root) },
119
+ body: plainDashes(String(opts.body))
114
120
  }]);
115
- await pushIfConnected(root);
116
- console.log(` replied to ${t.id}`);
121
+ if (!local) await pushIfConnected(root);
122
+ console.log(local ? ` replied to ${t.id} as Marver` : ` replied to ${t.id} in your voice - ${t.author?.name ?? "its author"} sees it on the published canvas`);
123
+ return;
124
+ }
125
+ case "new": {
126
+ if (!value || !opts.body) throw new Error("usage: comments new <scene/frame> --body \"...\" [--on \"<text on screen>\"] [--board <board>]");
127
+ const { resolveLink, devOrigin } = await import("./link-BodAbIQz.mjs");
128
+ const r = resolveLink(root, [value], opts.board);
129
+ if (r.exact.length !== 1) throw new Error(`"${value}" is a folder of frames - pin a note on one frame: comments new <scene/frame>`);
130
+ const frame = r.exact[0];
131
+ const nodeKey = r.nodesOf(r.board).find((n) => n.frame === frame && typeof n.key === "string")?.key;
132
+ const on = opts.on === void 0 ? "" : String(opts.on).replace(/\s+/g, " ").trim();
133
+ const threadId = randomUUID();
134
+ appendEvents(join(root, "design", "comments"), r.board, [{
135
+ id: randomUUID(),
136
+ ts: Date.now(),
137
+ type: "create",
138
+ commentId: threadId,
139
+ board: r.board,
140
+ frame,
141
+ ...nodeKey ? { nodeKey } : {},
142
+ ...on ? { anchor: {
143
+ el: { semantics: { quote: on.slice(0, 120) } },
144
+ pos: {
145
+ fx: 1,
146
+ fy: .5
147
+ }
148
+ } } : {},
149
+ ...marverAuthor(root),
150
+ body: plainDashes(String(opts.body))
151
+ }]);
152
+ const origin = await devOrigin(root);
153
+ console.log(` pinned a note on ${frame} (board ${r.board})${origin ? `: ${origin}#/b/${r.board}?c=${threadId}` : ""}`);
117
154
  return;
118
155
  }
119
156
  case "resolve": {
@@ -152,7 +189,7 @@ async function commentsCommand(root, action, value, opts) {
152
189
  await ownerApi(root, "revoke", { email: value });
153
190
  console.log(` revoked ${value} - their sessions are dead`);
154
191
  return;
155
- default: throw new Error(`unknown action "${action}" - connect | sync | list | reply | resolve | invite | revoke`);
192
+ default: throw new Error(`unknown action "${action}" - connect | sync | list | new | reply | resolve | invite | revoke`);
156
193
  }
157
194
  }
158
195
  /** Owner-only account call against the connected canvas, via the device credential. */
@@ -175,6 +212,31 @@ const pushIfConnected = async (root) => {
175
212
  const collab = loadCollab(root);
176
213
  if (collab) await syncOnce(root, collab).catch((e) => console.log(` (push deferred: ${e.message})`));
177
214
  };
215
+ /** Did this thread start on this machine - by the owner, or by Marver? A thread a collaborator
216
+ * started carries their address; one with no address was written here before a profile existed. */
217
+ const ownerThread = (root, t) => {
218
+ if (t.agent) return true;
219
+ const theirs = t.author?.email?.toLowerCase();
220
+ const mine = localProfile(root).email?.toLowerCase();
221
+ return !theirs || !!mine && theirs === mine;
222
+ };
223
+ /** Marver's voice for CLI-born events, the way Live Jam writes it (daemon.ts): the owner's identity
224
+ * (attributable), `agent: true` (renders as Marver, raises the owner's pill, never triggers a jam
225
+ * job, never syncs), and the harness that ran the command when its marker says so. */
226
+ const marverAuthor = (root) => {
227
+ const me = localProfile(root);
228
+ const harness = runningAgent();
229
+ return {
230
+ author: me,
231
+ agent: true,
232
+ agentMeta: {
233
+ devUser: me.name,
234
+ ...harness ? { harness } : {}
235
+ }
236
+ };
237
+ };
238
+ /** House style: never an em/en dash in a reply - a plain dash reads human (as Live Jam). */
239
+ const plainDashes = (s) => s.replace(/\s*[—–]\s*/g, " - ");
178
240
  /** Author snapshot for CLI-born events: the connected account (the server validates
179
241
  * authors against the session - an authorless push would be rejected), else the
180
242
  * local dev profile. */
@@ -1,6 +1,7 @@
1
- import { U as readDescription } from "./board-status-CWGHIdo_.mjs";
2
- import { accessSync, constants, existsSync, readFileSync, statSync } from "node:fs";
3
- import { delimiter, isAbsolute, join } from "node:path";
1
+ import { b as readDescription } from "./boards-BRLnoTC3.mjs";
2
+ import { i as onPath, n as AGENT_NAMES, r as detectAgent, t as AGENT_BIN } from "./agent-BsieQGTD.mjs";
3
+ import { existsSync, readFileSync } from "node:fs";
4
+ import { join } from "node:path";
4
5
  import { pathToFileURL } from "node:url";
5
6
  //#region src/server/detect.ts
6
7
  function readJson(file) {
@@ -124,99 +125,6 @@ function firstExisting(root, candidates) {
124
125
  return null;
125
126
  }
126
127
  //#endregion
127
- //#region src/server/jam/agent.ts
128
- /**
129
- * Which coding agent drives this repo.
130
- *
131
- * Live Jam is ON by default, so this is the answer to "on by default with WHAT" - asked
132
- * once by `init` (which writes the answer into design/config.ts, where it is visible and
133
- * editable) and again at every dev boot, so a workspace that predates the block - or a
134
- * human who switched tools - still jams without editing anything.
135
- *
136
- * The tool RUNNING us wins: `init` is usually run BY the agent, so its env markers are
137
- * evidence rather than a guess. Whatever wins must still be on PATH - the daemon has to
138
- * spawn it.
139
- */
140
- /** Ordered by preference when a machine has several installed and none is running us. */
141
- const AGENTS = [
142
- "claude",
143
- "codex",
144
- "cursor",
145
- "droid",
146
- "opencode",
147
- "grok",
148
- "pi"
149
- ];
150
- /** Env vars each CLI sets in the processes it spawns. Deliberately NOT CODEX_HOME or
151
- * ANTHROPIC_API_KEY: those are configuration a human exports by hand, not evidence that
152
- * the tool is running right now. (opencode's `AGENT=1` and pi's `AI_AGENT` are skipped
153
- * for the same reason in reverse - too generic to prove WHICH tool is running.)
154
- * droid and grok set no marker at all in the shells they spawn (verified against the
155
- * grok-build source and droid 0.200.0), so they are found by PATH order only. */
156
- const MARKERS = {
157
- claude: ["CLAUDECODE", "CLAUDE_CODE_ENTRYPOINT"],
158
- codex: ["CODEX_SANDBOX", "CODEX_THREAD_ID"],
159
- cursor: ["CURSOR_AGENT"],
160
- droid: [],
161
- opencode: ["OPENCODE", "OPENCODE_PID"],
162
- grok: [],
163
- pi: ["PI_CODING_AGENT", "PI_SESSION_ID"]
164
- };
165
- /** The executable each agent name maps to. Only cursor differs: its CLI installs BOTH
166
- * `cursor-agent` and a bare `agent` - and grok's installer symlinks `agent` too, so the
167
- * short name is a coin flip on a machine with both. The long name is unambiguous. */
168
- const AGENT_BIN = {
169
- claude: "claude",
170
- codex: "codex",
171
- cursor: "cursor-agent",
172
- droid: "droid",
173
- opencode: "opencode",
174
- grok: "grok",
175
- pi: "pi"
176
- };
177
- /** The valid `jam.agent` values as an English list - one string, so every surface
178
- * (config warning, init note, dev boot line) names the same set and none goes stale. */
179
- const AGENT_NAMES = `${AGENTS.slice(0, -1).map((a) => `"${a}"`).join(", ")}, or "${AGENTS[AGENTS.length - 1]}"`;
180
- /** Is `cmd` an executable FILE on PATH? A direct stat per PATH entry - no spawn, no shell,
181
- * so this is safe to call on every dev boot. Two deliberate narrowings, both in service of
182
- * "found means spawnable", because arming an agent that cannot run is worse than staying off:
183
- *
184
- * - `isFile`, because a directory carries the execute bit too (it means "traversable"), so an
185
- * access check alone would call a folder named `claude` an agent.
186
- * - the bare name only, no PATHEXT: the daemon spawns without a shell, and Node cannot run a
187
- * Windows `.cmd`/`.bat` shim that way. Finding one would arm a job that fails on every run.
188
- *
189
- * Only ABSOLUTE PATH entries count. An empty entry means the current directory on POSIX, and
190
- * a relative one (`.`, `bin`) resolves against it too - and the current directory is the repo
191
- * that was just opened, so a `claude` binary shipped inside it is precisely what must never
192
- * be found and spawned. */
193
- function onPath(cmd, env = process.env) {
194
- for (const dir of (env.PATH ?? "").split(delimiter)) {
195
- if (!isAbsolute(dir)) continue;
196
- try {
197
- const file = join(dir, cmd);
198
- if (statSync(file).isFile()) {
199
- accessSync(file, constants.X_OK);
200
- return true;
201
- }
202
- } catch {}
203
- }
204
- return false;
205
- }
206
- /** The agent to jam with, or undefined when this machine has none installed.
207
- *
208
- * One knowingly-imperfect case: agents nest, and env is inherited, so a codex run started
209
- * FROM Claude Code carries both marker families and this picks claude. Env has no depth to
210
- * read, and walking the process tree to find the nearest agent ancestor costs more than the
211
- * case is worth - so the answer is made visible instead of clever: `init` prints the agent
212
- * it chose and writes it into design/config.ts, and instructions/jam.md has the agent confirm
213
- * that line names the tool it actually is. One word to correct, once per repo. */
214
- function detectAgent(env = process.env) {
215
- const running = AGENTS.find((a) => MARKERS[a].some((k) => env[k]));
216
- if (running && onPath(AGENT_BIN[running], env)) return running;
217
- return AGENTS.find((a) => onPath(AGENT_BIN[a], env));
218
- }
219
- //#endregion
220
128
  //#region src/server/config.ts
221
129
  const DEFAULTS = {
222
130
  mode: "studio",
@@ -370,4 +278,4 @@ function validViewports(v) {
370
278
  return Object.keys(out).length ? out : null;
371
279
  }
372
280
  //#endregion
373
- export { readJson as a, detectHost as i, loadConfig as n, detectAgent as r, DEFAULTS as t };
281
+ export { readJson as i, loadConfig as n, detectHost as r, DEFAULTS as t };
@@ -1,8 +1,9 @@
1
1
  import { r as NAME } from "./cli.mjs";
2
- import { C as tables, S as proseLines, _ as isRecordTable, b as looseTables, c as CITED_FILE, d as LEVEL, f as availableLevels, g as hasGlob, h as globRe, k as checkRealDirs, l as EVIDENCE_COLUMN, m as frontMatter, p as capabilityTable, s as CITATION, tt as readStatusWord, u as GENERATED, v as levelsIn, w as wordCount, x as parseMap, y as lf } from "./board-status-CWGHIdo_.mjs";
2
+ import { N as readStatusWord, a as checkRealDirs } from "./boards-BRLnoTC3.mjs";
3
+ import { C as parseMap, E as wordCount, S as looseTables, T as tables, _ as globRe, b as levelsIn, d as EVIDENCE_COLUMN, f as GENERATED, g as frontMatter, h as capabilityTable, l as CITATION, m as availableLevels, p as LEVEL, u as CITED_FILE, v as hasGlob, w as proseLines, x as lf, y as isRecordTable } from "./board-status-BZSzc9Hp.mjs";
3
4
  import { pkgDir } from "./managed-HwHVNI3h.mjs";
4
5
  import { t as writeManaged } from "./managed-write-Bo-oPc-i.mjs";
5
- import { i as scanFrames } from "./manifest-CcdWx7ud.mjs";
6
+ import { o as scanFrames } from "./manifest-TpfDWldB.mjs";
6
7
  import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
7
8
  import { basename, dirname, join, normalize, relative, sep } from "node:path";
8
9
  import { execFileSync } from "node:child_process";