visualproof 0.1.0 → 0.3.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.
Files changed (94) hide show
  1. package/README.md +40 -26
  2. package/dist/assets/webfonts/LICENSE-Jost.txt +93 -0
  3. package/dist/assets/webfonts/LICENSE-Noto.txt +95 -0
  4. package/dist/assets/webfonts/LICENSE-SourceSans3.txt +93 -0
  5. package/dist/assets/webfonts/LICENSE-SourceSerif4.txt +93 -0
  6. package/dist/assets/webfonts/jost-latin-ext-wght-normal.woff2 +0 -0
  7. package/dist/assets/webfonts/jost-latin-wght-normal.woff2 +0 -0
  8. package/dist/assets/webfonts/metrics.json +1 -0
  9. package/dist/assets/webfonts/source-sans-3-greek-wght-italic.woff2 +0 -0
  10. package/dist/assets/webfonts/source-sans-3-greek-wght-normal.woff2 +0 -0
  11. package/dist/assets/webfonts/source-sans-3-latin-ext-wght-italic.woff2 +0 -0
  12. package/dist/assets/webfonts/source-sans-3-latin-ext-wght-normal.woff2 +0 -0
  13. package/dist/assets/webfonts/source-sans-3-latin-wght-italic.woff2 +0 -0
  14. package/dist/assets/webfonts/source-sans-3-latin-wght-normal.woff2 +0 -0
  15. package/dist/assets/webfonts/source-serif-4-greek-wght-italic.woff2 +0 -0
  16. package/dist/assets/webfonts/source-serif-4-greek-wght-normal.woff2 +0 -0
  17. package/dist/assets/webfonts/source-serif-4-latin-ext-wght-italic.woff2 +0 -0
  18. package/dist/assets/webfonts/source-serif-4-latin-ext-wght-normal.woff2 +0 -0
  19. package/dist/assets/webfonts/source-serif-4-latin-wght-italic.woff2 +0 -0
  20. package/dist/assets/webfonts/source-serif-4-latin-wght-normal.woff2 +0 -0
  21. package/dist/assets/webfonts/ttf/jost-400-normal.ttf +0 -0
  22. package/dist/assets/webfonts/ttf/jost-500-normal.ttf +0 -0
  23. package/dist/assets/webfonts/ttf/noto-sans-math.ttf +0 -0
  24. package/dist/assets/webfonts/ttf/noto-sans.ttf +0 -0
  25. package/dist/assets/webfonts/ttf/source-sans-3-400-italic.ttf +0 -0
  26. package/dist/assets/webfonts/ttf/source-sans-3-400-normal.ttf +0 -0
  27. package/dist/assets/webfonts/ttf/source-sans-3-500-normal.ttf +0 -0
  28. package/dist/assets/webfonts/ttf/source-sans-3-600-normal.ttf +0 -0
  29. package/dist/assets/webfonts/ttf/source-sans-3-700-normal.ttf +0 -0
  30. package/dist/assets/webfonts/ttf/source-serif-4-400-italic.ttf +0 -0
  31. package/dist/assets/webfonts/ttf/source-serif-4-600-italic.ttf +0 -0
  32. package/dist/server/agent.js +125 -92
  33. package/dist/server/agentdocs.js +1 -1
  34. package/dist/server/artcmd.js +335 -0
  35. package/dist/server/history.js +39 -0
  36. package/dist/server/historyapi.js +2 -2
  37. package/dist/server/hover.js +3 -3
  38. package/dist/server/layoutthread.js +1 -1
  39. package/dist/server/live.js +6 -0
  40. package/dist/server/main.js +151 -11
  41. package/dist/server/mcptools.js +6 -4
  42. package/dist/server/pastdoc.js +1 -1
  43. package/dist/server/pipeline.js +18 -9
  44. package/dist/server/readonlygate.js +2 -2
  45. package/dist/server/review.js +4 -1
  46. package/dist/server/reviewapi.js +35 -1
  47. package/dist/server/snapshot.js +13 -3
  48. package/dist/server/usage.js +2 -2
  49. package/dist/server/views.js +25 -1
  50. package/dist/shared/artfonts.js +81 -0
  51. package/dist/shared/artrecipe.js +316 -0
  52. package/dist/shared/collab.js +99 -1
  53. package/dist/shared/declfind.js +95 -0
  54. package/dist/shared/doc/order.js +17 -0
  55. package/dist/shared/doc/outline.js +45 -0
  56. package/dist/shared/keys.js +1 -1
  57. package/dist/shared/lostfound.js +1 -0
  58. package/dist/shared/moves.js +2 -1
  59. package/dist/shared/pastgraph.js +9 -1
  60. package/dist/shared/query.js +21 -13
  61. package/dist/shared/review.js +62 -5
  62. package/dist/shared/sharesnap.js +2 -1
  63. package/dist/shared/titles.js +2 -0
  64. package/dist/shared/viewgraph.js +18 -0
  65. package/dist/web/bundle/app.js +7709 -3222
  66. package/dist/web/bundle/edges.js +4 -6
  67. package/dist/web/index.html +24 -6
  68. package/dist/web/src/agentmark.js +14 -0
  69. package/dist/web/src/artwork.js +1000 -0
  70. package/dist/web/src/bundles.js +151 -0
  71. package/dist/web/src/canvas.js +3694 -0
  72. package/dist/web/src/drag.js +61 -0
  73. package/dist/web/src/edgequeue.js +204 -0
  74. package/dist/web/src/gl/gl.js +123 -0
  75. package/dist/web/src/gl/renderer.js +451 -0
  76. package/dist/web/src/halo.js +95 -0
  77. package/dist/web/src/highlight.js +108 -0
  78. package/dist/web/src/overview.js +393 -0
  79. package/dist/web/src/reviewqueue.js +250 -0
  80. package/dist/web/src/scene.js +17 -0
  81. package/dist/web/src/selection.js +272 -0
  82. package/dist/web/src/status.js +80 -0
  83. package/dist/web/src/visitors.js +318 -0
  84. package/dist/web/src/visits.js +174 -0
  85. package/dist/web/style.css +255 -12
  86. package/docs/agent-api/README.md +1 -1
  87. package/docs/agent-api/export.md +41 -2
  88. package/docs/agent-api/following.md +2 -2
  89. package/docs/agent-api/history.md +2 -1
  90. package/docs/agent-api/mcp.md +1 -1
  91. package/docs/agent-api/reading.md +2 -1
  92. package/docs/agent-api/views.md +3 -2
  93. package/package.json +3 -1
  94. package/test/toolchains.json +2 -2
@@ -1,8 +1,6 @@
1
1
  // src/shared/graph.ts
2
2
  var SITE_STMT = 1;
3
3
  var SITE_BODY = 2;
4
- var SITE_PROOF = 4;
5
- var SITE_GRAMMAR = 8;
6
4
  var SITE_TCB = SITE_STMT | SITE_BODY;
7
5
 
8
6
  // src/web/src/bundles.ts
@@ -166,7 +164,7 @@ var LEVELS_KEPT = 6;
166
164
  var OverviewModel = class {
167
165
  g = null;
168
166
  tree = null;
169
- toggles = { externals: true, proofs: false };
167
+ toggles = { externals: true };
170
168
  levels = /* @__PURE__ */ new Map();
171
169
  setGraph(g) {
172
170
  this.g = g;
@@ -210,7 +208,7 @@ var OverviewModel = class {
210
208
  aggregateLevel(level, places) {
211
209
  const g = this.g;
212
210
  const unit = units({ ...this.tree, curR: places.curR }, Math.pow(2, level / 2), 45);
213
- const sites = SITE_STMT | SITE_BODY | (this.toggles.proofs ? SITE_PROOF | SITE_GRAMMAR : 0);
211
+ const sites = SITE_STMT | SITE_BODY;
214
212
  const ext = this.toggles.externals;
215
213
  const pairs = aggregate(g, unit, sites, (i) => i < g.projectCount || ext);
216
214
  return { pairs, units: Int32Array.from(new Set(unit)) };
@@ -315,7 +313,7 @@ var OverviewModel = class {
315
313
  return looks;
316
314
  }
317
315
  };
318
- var DIM = 0.12;
316
+ var DIM = 0.3;
319
317
 
320
318
  // src/web/src/edgeworker.ts
321
319
  var EdgeWorkerCore = class {
@@ -334,7 +332,7 @@ var EdgeWorkerCore = class {
334
332
  this.base = m.base;
335
333
  this.model.setTree(
336
334
  { nc: m.nc, n: m.n, parent: m.parent, nodeCluster: m.nodeCluster, rep: m.rep },
337
- { externals: m.externals, proofs: m.proofs }
335
+ { externals: m.externals }
338
336
  );
339
337
  this.prune(post);
340
338
  break;
@@ -2,26 +2,36 @@
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
6
6
  <title>VisualProof</title>
7
7
  <link rel="icon" href="data:,">
8
8
  <script>
9
- // the theme before the first paint (web/src/theme.ts keeps it after): light, dark, or the system's
9
+ // the theme before the first paint (web/src/theme.ts keeps it after): light unless the reader
10
+ // chose dark, or the system's
10
11
  try {
11
12
  var t = localStorage.getItem("visualproof:theme");
12
- document.documentElement.dataset.theme = t === "light" || t === "dark" ? t : matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
13
+ document.documentElement.dataset.theme = t === "dark" ? "dark" : t === "system" && matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
13
14
  } catch (e) {
14
- document.documentElement.dataset.theme = matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
15
+ document.documentElement.dataset.theme = "light";
15
16
  }
16
17
  </script>
17
18
  <link rel="stylesheet" href="/style.css">
18
19
  </head>
19
20
  <body data-mode="tcb">
21
+ <!-- an artwork style's ground, under the board within the frame (web/src/artframe.ts) -->
22
+ <canvas id="art-sky" hidden></canvas>
20
23
  <canvas id="canvas"></canvas>
21
24
  <canvas id="labels"></canvas>
22
25
  <div id="cards"></div>
23
26
  <!-- the notes on the board, over the canvas at a fixed size (web/src/sticky.ts) -->
24
27
  <div id="stickies"></div>
28
+ <!-- the linear form: the board drawn as its document's outline (web/src/linear.ts, ExportSpec
29
+ decision 18) -->
30
+ <canvas id="linear" hidden></canvas>
31
+ <!-- the artwork mode: the frame over the board and the shade around it, and its panel
32
+ (web/src/artframe.ts, ExportSpec decision 19) -->
33
+ <div id="art" hidden></div>
34
+ <div id="art-panel" class="modal-box glass" hidden></div>
25
35
 
26
36
  <header id="bar" class="glass">
27
37
  <div class="brand"><span class="nav"><button id="nav-back" title="Back (Alt ←)" aria-label="Back" disabled><svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M10 3.5 5.5 8l4.5 4.5"/></svg></button><button id="nav-fwd" title="Forward (Alt →)" aria-label="Forward" disabled><svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M6 3.5 10.5 8 6 12.5"/></svg></button></span><span class="logo">VisualProof</span><span id="project" class="project"></span><span id="snapshot" class="snapshot" hidden></span><button id="build" class="build-pill" hidden title="Build status (b)"><span class="b-dot"></span><span class="b-text"></span></button></div>
@@ -46,7 +56,7 @@
46
56
  <div id="library-pop" class="glass" role="dialog" aria-label="The library" hidden></div>
47
57
  </div>
48
58
  <!-- a document of targets, typeset with LaTeX (web/src/exportmodal.ts) -->
49
- <button id="export-btn" class="act-btn" title="Export: this view as a document, typeset with LaTeX">
59
+ <button id="export-btn" class="act-btn" title="Export: this view as a document, typeset with LaTeX; or the board as a picture (Artwork)">
50
60
  <svg viewBox="0 0 16 16" width="15" height="15" aria-hidden="true"><path d="M8 2.5v7.5M5 7l3 3 3-3M3 11.5v1.8h10v-1.8"/></svg>
51
61
  <span>Export</span>
52
62
  </button>
@@ -68,11 +78,18 @@
68
78
  <div id="who-menu" class="glass" role="menu" aria-label="Your name and visibility" hidden></div>
69
79
  </div>
70
80
  <button id="help-btn" class="help-btn" title="Keys and gestures, and the tour (?)" aria-label="Help">?</button>
81
+ <!-- on a phone the bar's buttons are in one menu (web/src/phone.ts) -->
82
+ <div class="more-wrap">
83
+ <button id="more-btn" class="act-btn act-icon" aria-label="More" aria-haspopup="menu" aria-expanded="false" title="Share, the library, export, activity, your name, help"><svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><circle cx="3.5" cy="8" r="1.3"/><circle cx="8" cy="8" r="1.3"/><circle cx="12.5" cy="8" r="1.3"/></svg><span id="more-badge" class="act-badge" hidden></span></button>
84
+ <div id="more-pop" class="glass" role="menu" aria-label="More" hidden></div>
85
+ </div>
71
86
  </div>
72
87
  <div id="progress"><div></div></div>
73
88
  </header>
74
89
  <!-- the top: your tabs (the views you have open) and your mode, how a click selects — yours alone -->
75
90
  <div id="viewbar">
91
+ <!-- on a phone, the side panel opens as a drawer from here (web/src/phone.ts) -->
92
+ <button id="side-btn" class="views-btn side-btn" aria-label="The board: targets and clusters" aria-expanded="false" title="The board: targets and clusters"><svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M2.5 4h11M2.5 8h11M2.5 12h11"/></svg></button>
76
93
  <div id="tabs" class="tabs" role="tablist" aria-label="Your views"></div>
77
94
  <div class="views-wrap">
78
95
  <button id="views-btn" class="views-btn" aria-haspopup="menu" title="Views: a new one, a copy of this one, its name; every view kept on this server">Views<svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true"><path d="M4 6l4 4 4-4"/></svg></button>
@@ -98,6 +115,7 @@
98
115
  <button data-mode="deps" aria-describedby="mode-tip">Uses</button>
99
116
  <button data-mode="tcb" aria-describedby="mode-tip">TCB</button>
100
117
  <button data-mode="keys" aria-describedby="mode-tip">Keys</button>
118
+ <button data-mode="refs" aria-describedby="mode-tip">Direct</button>
101
119
  </span>
102
120
  </span>
103
121
  <button data-mode="apps" aria-describedby="mode-tip">Used by</button>
@@ -179,7 +197,7 @@
179
197
  <div id="eyes-pop" class="glass" role="dialog" aria-label="How you see the board" hidden>
180
198
  <button id="lock-btn" class="eye" title="The lock, on by default: a drag pans the view, never a declaration, a circle or a note; clicks still select. Let it go and a drag moves them, for everyone on this board (l). Hold Ctrl (⌘ on a Mac) for the other way while held." aria-pressed="true"><svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path class="lk-body" d="M4 7.5h8v5.5H4z"/><path class="lk-shackle" d="M5.6 7.5V5.4a2.4 2.4 0 0 1 4.8 0v2.1"/></svg><span class="eye-l">Layout locked</span><kbd>l</kbd></button>
181
199
  <button id="edges-btn" class="eye" title="Edges: the bundled overview of the dependencies, faint under a selection, whose own edges always show (g)" aria-pressed="true"><svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M3.5 12.5C7 12.5 9 3.5 12.5 3.5"/><circle cx="3.5" cy="12.5" r="1.4"/><circle cx="12.5" cy="3.5" r="1.4"/></svg><span class="eye-l">Edges</span><kbd>g</kbd></button>
182
- <button id="proofs-btn" class="eye" title="Proof edges: also the dependencies that occur only inside proofs" aria-pressed="false"><svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M3.5 12.5C7 12.5 9 3.5 12.5 3.5" stroke-dasharray="1.6 2.2"/><rect x="10.5" y="10.5" width="3.5" height="3.5" rx="0.5"/></svg><span class="eye-l">Proof edges</span></button>
200
+ <button id="linear-btn" class="eye" title="Linear form: the board drawn as its document's outline, on one line, the first at the top; drag along it to reorder the document (o)" aria-pressed="false"><svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M8 2v12"/><circle cx="8" cy="4" r="1.4"/><circle cx="8" cy="8" r="1.4"/><circle cx="8" cy="12" r="1.4"/><path d="M10.5 4h3M10.5 8h3M10.5 12h3"/></svg><span class="eye-l">Linear form</span><kbd>o</kbd></button>
183
201
  <div class="eye-theme"><span class="eye-l">Theme</span><div id="theme-seg" class="seg mini" role="radiogroup" aria-label="Theme"></div></div>
184
202
  </div>
185
203
  </div>
@@ -0,0 +1,14 @@
1
+ // The mark of an agent (AgentSpec decision 1): a small robot wherever the page names one — its
2
+ // initials among the others, its advice in the review, what it did in Activity — so that nothing
3
+ // an agent said or did reads as a person's.
4
+ /** A robot's head, drawn in the colour of the text around it. */
5
+ export const BOT = `<svg class="bot" viewBox="0 0 16 16" aria-hidden="true">` +
6
+ `<path d="M8 4.2V2.4" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>` +
7
+ `<circle cx="8" cy="1.9" r="1.1" fill="currentColor"/>` +
8
+ `<rect x="2.2" y="4.4" width="11.6" height="9.2" rx="2.6" fill="none" stroke="currentColor" stroke-width="1.4"/>` +
9
+ `<circle cx="5.9" cy="8.8" r="1.25" fill="currentColor"/><circle cx="10.1" cy="8.8" r="1.25" fill="currentColor"/>` +
10
+ `</svg>`;
11
+ /** How an agent is named in words: "Claude (agent)". */
12
+ export function agentName(name) {
13
+ return `${name} (agent)`;
14
+ }