visualproof 0.4.3 → 0.5.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 (82) hide show
  1. package/README.md +16 -7
  2. package/dist/assets/latex/visualproof.sty +19 -9
  3. package/dist/assets/tips/tour-agent.webp +0 -0
  4. package/dist/assets/tips/tour-arrange.webp +0 -0
  5. package/dist/assets/tips/tour-artwork.webp +0 -0
  6. package/dist/assets/tips/tour-checks.webp +0 -0
  7. package/dist/assets/tips/tour-keys.webp +0 -0
  8. package/dist/assets/tips/tour-library.webp +0 -0
  9. package/dist/assets/tips/tour-project.webp +0 -0
  10. package/dist/assets/tips/tour-review.webp +0 -0
  11. package/dist/assets/tips/tour-share.webp +0 -0
  12. package/dist/assets/tips/tour-source.webp +0 -0
  13. package/dist/assets/tips/tour-target.webp +0 -0
  14. package/dist/assets/tips/tour-view.webp +0 -0
  15. package/dist/assets/tips/tour.json +117 -112
  16. package/dist/assets/tips/tour.webp +0 -0
  17. package/dist/mcp/visualproof-mcp.mjs +7 -3
  18. package/dist/server/access.js +37 -1
  19. package/dist/server/accesspage.js +130 -0
  20. package/dist/server/agent.js +11 -5
  21. package/dist/server/agentlibrary.js +1 -1
  22. package/dist/server/agentviews.js +1 -1
  23. package/dist/server/artcmd.js +1 -1
  24. package/dist/server/askfollow.js +1 -4
  25. package/dist/server/buildwatch.js +133 -0
  26. package/dist/server/deploy.js +844 -0
  27. package/dist/server/doctor.js +15 -3
  28. package/dist/server/events.js +20 -5
  29. package/dist/server/export.js +17 -4
  30. package/dist/server/fetchurl.js +30 -13
  31. package/dist/server/film.js +1 -1
  32. package/dist/server/history.js +3 -1
  33. package/dist/server/historyapi.js +100 -50
  34. package/dist/server/historythread.js +206 -0
  35. package/dist/server/hover.js +8 -0
  36. package/dist/server/identity.js +25 -1
  37. package/dist/server/library.js +10 -3
  38. package/dist/server/live.js +206 -28
  39. package/dist/server/lostfound.js +3 -2
  40. package/dist/server/main.js +361 -50
  41. package/dist/server/poppler.js +48 -10
  42. package/dist/server/renames.js +10 -5
  43. package/dist/server/review.js +32 -2
  44. package/dist/server/reviewapi.js +1 -1
  45. package/dist/server/status.js +144 -50
  46. package/dist/server/talk.js +7 -2
  47. package/dist/server/usage.js +51 -0
  48. package/dist/server/views.js +21 -7
  49. package/dist/shared/board.js +2 -1
  50. package/dist/shared/collab.js +14 -8
  51. package/dist/shared/deploy.js +35 -0
  52. package/dist/shared/doc/latex.js +5 -3
  53. package/dist/shared/doc/outline.js +6 -3
  54. package/dist/shared/layout.js +297 -70
  55. package/dist/shared/libm.js +366 -0
  56. package/dist/shared/library.js +11 -6
  57. package/dist/shared/palette.js +1 -1
  58. package/dist/shared/review.js +7 -5
  59. package/dist/shared/search.js +7 -3
  60. package/dist/shared/separate.js +556 -32
  61. package/dist/shared/views.js +8 -1
  62. package/dist/web/bundle/app.js +3595 -1520
  63. package/dist/web/bundle/edges.js +44 -16
  64. package/dist/web/bundle/layout.js +1026 -80
  65. package/dist/web/index.html +2 -2
  66. package/dist/web/src/artwork.js +25 -4
  67. package/dist/web/src/axiomring.js +42 -0
  68. package/dist/web/src/bundles.js +52 -16
  69. package/dist/web/src/canvas.js +109 -54
  70. package/dist/web/src/overview.js +4 -1
  71. package/dist/web/src/past.js +28 -0
  72. package/dist/web/src/scene.js +13 -12
  73. package/dist/web/src/selection.js +47 -4
  74. package/dist/web/src/status.js +32 -2
  75. package/dist/web/src/theme.js +108 -0
  76. package/dist/web/style.css +181 -45
  77. package/docs/agent-api/following.md +1 -1
  78. package/docs/agent-api/history.md +3 -0
  79. package/docs/agent-api/library.md +1 -1
  80. package/docs/agent-api/requests.md +4 -1
  81. package/docs/agent-api/views.md +1 -1
  82. package/package.json +1 -1
@@ -20,8 +20,15 @@ function units(S, k, minPx) {
20
20
  return out;
21
21
  }
22
22
  function aggregate(g, unit, sites, keep) {
23
- const counts = /* @__PURE__ */ new Map();
24
- const W = 1 << 22;
23
+ let size = 1024;
24
+ let slot = new Int32Array(size).fill(-1);
25
+ let A = new Int32Array(256), B = new Int32Array(256), w = new Int32Array(256);
26
+ let n = 0;
27
+ const at = (a, b) => {
28
+ let h = Math.imul(a, 2654435761) ^ Math.imul(b, 2246822519);
29
+ h = Math.imul(h ^ h >>> 16, 2146121005);
30
+ return (h ^ h >>> 15) & size - 1;
31
+ };
25
32
  for (let u = 0; u < g.n; u++) {
26
33
  if (!keep(u)) continue;
27
34
  const a = unit[u];
@@ -31,21 +38,41 @@ function aggregate(g, unit, sites, keep) {
31
38
  if (!keep(v)) continue;
32
39
  const b = unit[v];
33
40
  if (a === b) continue;
34
- const key = a * W + b;
35
- counts.set(key, (counts.get(key) ?? 0) + 1);
41
+ let h = at(a, b);
42
+ for (; ; ) {
43
+ const k = slot[h];
44
+ if (k < 0) break;
45
+ if (A[k] === a && B[k] === b) break;
46
+ h = h + 1 & size - 1;
47
+ }
48
+ if (slot[h] >= 0) {
49
+ w[slot[h]]++;
50
+ continue;
51
+ }
52
+ if (n === A.length) {
53
+ const grow = (x) => {
54
+ const y = new Int32Array(2 * x.length);
55
+ y.set(x);
56
+ return y;
57
+ };
58
+ [A, B, w] = [grow(A), grow(B), grow(w)];
59
+ }
60
+ A[n] = a;
61
+ B[n] = b;
62
+ w[n] = 1;
63
+ slot[h] = n++;
64
+ if (2 * n > size) {
65
+ size *= 2;
66
+ slot = new Int32Array(size).fill(-1);
67
+ for (let k = 0; k < n; k++) {
68
+ let j = at(A[k], B[k]);
69
+ while (slot[j] >= 0) j = j + 1 & size - 1;
70
+ slot[j] = k;
71
+ }
72
+ }
36
73
  }
37
74
  }
38
- const n = counts.size;
39
- const out = { n, a: new Int32Array(n), b: new Int32Array(n), w: new Int32Array(n) };
40
- let k = 0;
41
- for (const [key, w] of counts) {
42
- const a = Math.floor(key / W);
43
- out.a[k] = a;
44
- out.b[k] = key - a * W;
45
- out.w[k] = w;
46
- k++;
47
- }
48
- return out;
75
+ return { n, a: A.slice(0, n), b: B.slice(0, n), w: w.slice(0, n) };
49
76
  }
50
77
  function topK(idx, score, cap) {
51
78
  const n = idx.length;
@@ -292,7 +319,7 @@ var OverviewModel = class {
292
319
  const nc = T.nc;
293
320
  const X = (id) => id < nc ? S.cwx[id] : S.nwx[id - nc];
294
321
  const Y = (id) => id < nc ? S.cwy[id] : S.nwy[id - nc];
295
- const crowd = Math.min(1, Math.sqrt(400 / Math.max(1, n)));
322
+ const crowd = Math.min(1, Math.sqrt(OVERVIEW_CROWD / Math.max(1, n)));
296
323
  const fade = (ask.dim ? DIM : 1) * crowd;
297
324
  const floor = 0.05 + 0.3 * Math.min(1, Math.max(0, (1200 - nIn) / 900));
298
325
  const looks = /* @__PURE__ */ new Map();
@@ -313,6 +340,7 @@ var OverviewModel = class {
313
340
  return looks;
314
341
  }
315
342
  };
343
+ var OVERVIEW_CROWD = 400;
316
344
  var DIM = 0.3;
317
345
 
318
346
  // src/web/src/edgeworker.ts