@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
@@ -7,6 +7,9 @@
7
7
  * #/ default board, fit all
8
8
  * #/b/<board> board, fit all
9
9
  * #/b/<board>?n=k1,k2 board with nodes selected, camera fit to selection
10
+ * #/b/<board>?f=<scene/frame>,... the same, by FRAME id - the link an agent can write
11
+ * (node keys are the shell's; `marver link` prints these)
12
+ * #/b/<board>?s=<scene>,... the same for every frame of a scene
10
13
  * #/b/<board>?c=<id> board with a comment thread open
11
14
  * #/i/<token> invite link - opens the claim dialog with the token
12
15
  * #/p/<board>?at=<frame-id>&device=<viewport>&theme=<theme> play mode
@@ -18,6 +21,10 @@
18
21
  export interface HashState {
19
22
  board?: string
20
23
  n?: string[]
24
+ /** Frame ids to select + fit - resolved to node keys once the board is loaded. */
25
+ f?: string[]
26
+ /** Scenes whose frames to select + fit. */
27
+ s?: string[]
21
28
  c?: string
22
29
  invite?: string
23
30
  play?: { at?: string; device?: string; theme?: string; slides?: boolean }
@@ -26,6 +33,17 @@ export interface HashState {
26
33
  }
27
34
 
28
35
  const BOARD_RE = /^[a-z0-9][a-z0-9-]*$/
36
+ const isFrameId = (at: string) => /^[\w./-]{1,200}$/.test(at) && !at.includes('..')
37
+
38
+ /** The node keys a link names on the loaded board: its keys (`n`), the nodes showing its frames
39
+ * (`f`) and every node of its scenes (`s`) - in board order, each once. A name the board does not
40
+ * show resolves to nothing (the caller decides what an empty answer means). */
41
+ export function linkTargets(h: Pick<HashState, 'n' | 'f' | 's'>, nodes: readonly { key: string; frame: string; missing?: boolean }[]): string[] {
42
+ const keys = new Set(h.n ?? [])
43
+ const frames = new Set(h.f ?? [])
44
+ const scenes = h.s ?? []
45
+ return nodes.filter((n) => keys.has(n.key) || (!n.missing && (frames.has(n.frame) || scenes.some((sc) => n.frame.startsWith(`${sc}/`))))).map((n) => n.key)
46
+ }
29
47
 
30
48
  export function parseHash(hash: string = location.hash): HashState {
31
49
  try {
@@ -40,7 +58,7 @@ export function parseHash(hash: string = location.hash): HashState {
40
58
  const mf = path.match(/^\/f\/(.+)$/)
41
59
  if (mf) {
42
60
  const at = decodeURIComponent(mf[1])
43
- if (!/^[\w./-]{1,200}$/.test(at) || at.includes('..')) return {}
61
+ if (!isFrameId(at)) return {}
44
62
  return { focus: { at, device: params.get('device') ?? undefined, theme: params.get('theme') ?? undefined } }
45
63
  }
46
64
  const m = path.match(/^\/(b|p)\/([^/?]+)$/)
@@ -48,9 +66,12 @@ export function parseHash(hash: string = location.hash): HashState {
48
66
  const board = decodeURIComponent(m[2])
49
67
  if (!BOARD_RE.test(board)) return {}
50
68
  if (m[1] === 'b') {
51
- const n = (params.get('n') ?? '').split(',').map((s) => s.trim()).filter(Boolean)
69
+ const list = (k: string) => (params.get(k) ?? '').split(',').map((s) => s.trim()).filter(Boolean)
70
+ const n = list('n')
71
+ const f = list('f').filter(isFrameId)
72
+ const sc = list('s').filter((x) => /^[\w.-]{1,120}$/.test(x) && !x.includes('..'))
52
73
  const c = params.get('c') ?? undefined
53
- return { board, ...(n.length ? { n } : {}), ...(c && /^[\w-]+$/.test(c) ? { c } : {}) }
74
+ return { board, ...(n.length ? { n } : {}), ...(f.length ? { f } : {}), ...(sc.length ? { s: sc } : {}), ...(c && /^[\w-]+$/.test(c) ? { c } : {}) }
54
75
  }
55
76
  return {
56
77
  board,