@1agh/maude 1.4.5 → 1.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 (106) hide show
  1. package/apps/studio/annotations/ai-read.ts +288 -0
  2. package/apps/studio/annotations/ai-write.ts +533 -0
  3. package/apps/studio/annotations/board-io.ts +94 -0
  4. package/apps/studio/annotations/board-text.ts +45 -0
  5. package/apps/studio/annotations/constants.ts +58 -0
  6. package/apps/studio/annotations/elements/_shared.ts +125 -0
  7. package/apps/studio/annotations/elements/arrow.model.ts +196 -0
  8. package/apps/studio/annotations/elements/media.model.ts +79 -0
  9. package/apps/studio/annotations/elements/pen.model.ts +82 -0
  10. package/apps/studio/annotations/elements/section.model.ts +70 -0
  11. package/apps/studio/annotations/elements/shape.model.ts +141 -0
  12. package/apps/studio/annotations/elements/sticky.model.ts +48 -0
  13. package/apps/studio/annotations/elements/text.model.ts +52 -0
  14. package/apps/studio/annotations/fields.ts +347 -0
  15. package/apps/studio/annotations/fractional-index.ts +234 -0
  16. package/apps/studio/annotations/legacy/mini-dom.ts +207 -0
  17. package/apps/studio/annotations/migrate-boot.ts +172 -0
  18. package/apps/studio/annotations/migrate-cli.ts +37 -0
  19. package/apps/studio/annotations/migrate-v1.ts +383 -0
  20. package/apps/studio/annotations/ops.ts +474 -0
  21. package/apps/studio/annotations/registry.ts +159 -0
  22. package/apps/studio/annotations/replica.ts +264 -0
  23. package/apps/studio/annotations/scene.ts +235 -0
  24. package/apps/studio/annotations/schema.ts +188 -0
  25. package/apps/studio/annotations/types.ts +77 -0
  26. package/apps/studio/annotations/ui/board.ts +126 -0
  27. package/apps/studio/annotations/ui/containment.ts +118 -0
  28. package/apps/studio/annotations/ui/edit-actions.ts +551 -0
  29. package/apps/studio/annotations/ui/editor-channel.ts +62 -0
  30. package/apps/studio/annotations/ui/element-node.tsx +993 -0
  31. package/apps/studio/annotations/ui/pipeline-context.ts +17 -0
  32. package/apps/studio/annotations/ui/pointer-pipeline.ts +150 -0
  33. package/apps/studio/annotations/ui/render-model.ts +264 -0
  34. package/apps/studio/annotations/ui/scene.tsx +63 -0
  35. package/apps/studio/annotations/ui/text-editor.tsx +420 -0
  36. package/apps/studio/annotations/ui/text-session.ts +140 -0
  37. package/apps/studio/annotations/ui/text-style.ts +111 -0
  38. package/apps/studio/annotations/ui/world.ts +47 -0
  39. package/apps/studio/annotations/v1-adapter.ts +428 -0
  40. package/apps/studio/annotations-align.ts +21 -6
  41. package/apps/studio/annotations-bindings.ts +2 -0
  42. package/apps/studio/annotations-context-toolbar.tsx +9 -13
  43. package/apps/studio/annotations-groups.ts +3 -0
  44. package/apps/studio/annotations-layer.tsx +923 -1925
  45. package/apps/studio/annotations-model.ts +97 -4
  46. package/apps/studio/annotations-sync.ts +4 -47
  47. package/apps/studio/api.ts +262 -68
  48. package/apps/studio/bin/_import-figma.mjs +22 -12
  49. package/apps/studio/bin/annotate.mjs +331 -838
  50. package/apps/studio/bin/annotate.sh +4 -4
  51. package/apps/studio/bin/perf.sh +21 -7
  52. package/apps/studio/bin/read-annotations.mjs +184 -666
  53. package/apps/studio/bin/read-annotations.sh +9 -5
  54. package/apps/studio/canvas-artifacts.ts +9 -0
  55. package/apps/studio/canvas-comment-mount.tsx +35 -2
  56. package/apps/studio/canvas-lib.tsx +18 -1
  57. package/apps/studio/canvas-shell.tsx +54 -1
  58. package/apps/studio/client/app.jsx +101 -35
  59. package/apps/studio/client/comments-overlay.css +10 -0
  60. package/apps/studio/client/hmr.mjs +1 -1
  61. package/apps/studio/client/panels/git-grouping.js +2 -2
  62. package/apps/studio/client/tree-expansion.js +217 -0
  63. package/apps/studio/collab/index.ts +58 -5
  64. package/apps/studio/collab/persistence.ts +80 -11
  65. package/apps/studio/collab/registry.ts +63 -26
  66. package/apps/studio/commands/annotation-ops-command.ts +72 -0
  67. package/apps/studio/comment-anchor.ts +116 -0
  68. package/apps/studio/comments-overlay.tsx +78 -35
  69. package/apps/studio/context.ts +1 -0
  70. package/apps/studio/cursors-overlay.tsx +337 -109
  71. package/apps/studio/dist/client.bundle.js +850 -850
  72. package/apps/studio/dist/comment-mount.js +2 -2
  73. package/apps/studio/figma/to-strokes.ts +31 -10
  74. package/apps/studio/git/endpoints.ts +1 -1
  75. package/apps/studio/git/service.ts +1 -1
  76. package/apps/studio/git/watch.ts +1 -1
  77. package/apps/studio/http.ts +90 -15
  78. package/apps/studio/server.ts +16 -0
  79. package/apps/studio/sync/accepted-cold-start.ts +72 -8
  80. package/apps/studio/sync/agent.ts +36 -6
  81. package/apps/studio/sync/codec.ts +95 -40
  82. package/apps/studio/sync/comment-ledger.ts +229 -0
  83. package/apps/studio/sync/file-membership.ts +12 -2
  84. package/apps/studio/sync/file-plane.ts +78 -2
  85. package/apps/studio/sync/index.ts +75 -16
  86. package/apps/studio/sync/journal-client.ts +5 -0
  87. package/apps/studio/sync/limits.ts +7 -2
  88. package/apps/studio/sync/migrate-seed.ts +17 -7
  89. package/apps/studio/sync/projection.ts +7 -2
  90. package/apps/studio/sync/remote-docs.ts +34 -0
  91. package/apps/studio/sync/writer-registry.ts +10 -0
  92. package/apps/studio/text-caret.ts +11 -2
  93. package/apps/studio/tree-state.ts +45 -0
  94. package/apps/studio/undo-stack.ts +2 -2
  95. package/apps/studio/use-annotation-resize.tsx +48 -23
  96. package/apps/studio/use-annotation-selection.tsx +9 -2
  97. package/apps/studio/use-collab.tsx +104 -1
  98. package/apps/studio/use-selection-set.tsx +4 -0
  99. package/apps/studio/whats-new.json +63 -0
  100. package/cli/lib/design-link.mjs +5 -1
  101. package/cli/lib/gitignore-block.mjs +1 -1
  102. package/cli/lib/gitignore-drift.mjs +2 -1
  103. package/package.json +9 -8
  104. package/plugins/design/templates/brief-board.tsx.template +1 -1
  105. package/apps/studio/annotation-edit-base.ts +0 -36
  106. package/apps/studio/commands/annotation-strokes-command.ts +0 -137
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env bash
2
2
  # annotate.sh — thin wrapper around annotate.mjs (the AI annotation WRITE
3
- # verb). Runs under Bun, not node: the verb imports the CANONICAL TypeScript
4
- # annotation model (annotations-model.ts — serializer + sanitizer) so it can
5
- # never emit a shape the canvas wouldn't, and node can't import TS.
3
+ # verb). Runs under Bun, not node: the verb imports the TypeScript element
4
+ # registry (annotations/ai-write.ts — DDR-242) so it can never write an
5
+ # element the canvas would not accept.
6
6
  # Reached via `maude design annotate` (DDR-062), never a raw bin path.
7
7
  #
8
8
  # Usage:
9
- # annotate.sh <rel-path> [--ops <file|->] [--flow <file|->] [--near <id>]
9
+ # annotate.sh <rel-path> [--ops <file|->] [--flow <file|->] [--board <file|->]
10
10
  # [--canvas-state <path>] [--root <repo>] [--dry-run]
11
11
  # (see annotate.mjs --help for the full contract)
12
12
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
@@ -14,7 +14,7 @@
14
14
  #
15
15
  # Usage:
16
16
  # perf.sh [--root <repo>] [--canvas <rel-path>] [--fixture]
17
- # [--boards N] [--strokes N]
17
+ # [--boards N] [--strokes N | --annotations N] [--mix]
18
18
  # [--pan N] [--zoom N] [--timeout S] [--repeat N]
19
19
  # [--engine chromium|safari]
20
20
  # [--history <path>] [--json]
@@ -27,6 +27,12 @@
27
27
  #
28
28
  # --canvas Canvas to measure, relative to <designRoot> (default: _active.json).
29
29
  # --fixture Generate + measure the synthetic fixture instead (--boards/--strokes).
30
+ # --annotations N Alias of --strokes: annotation element count (<= 5000).
31
+ # --mix With --fixture: a MIXED legacy-v1 board (sections incl. nested,
32
+ # stickies, rect/ellipse/polygon with anchored labels, bound arrows,
33
+ # text, pen, groups) beside the artboards, instead of the
34
+ # sticky-only field. Serialized via strokesToSvg (needs bun). Warns
35
+ # when the v2 board exceeds the 4 MB cap (DDR-242; the v1 1 MB cap bit at ~3750 mixed elements).
30
36
  # --json Raw JSON (current + previous run) instead of the human report.
31
37
  #
32
38
  # Reads: $DESIGN_ROOT/_server.json (must exist — run `maude design server-up` first)
@@ -40,6 +46,7 @@ CANVAS=""
40
46
  FIXTURE=0
41
47
  BOARDS=128
42
48
  STROKES=150
49
+ MIX=0
43
50
  PAN=60
44
51
  ZOOM=40
45
52
  REPEAT=3
@@ -56,7 +63,8 @@ while [ $# -gt 0 ]; do
56
63
  --canvas) CANVAS="$2"; shift 2 ;;
57
64
  --fixture) FIXTURE=1; shift ;;
58
65
  --boards) BOARDS="$2"; shift 2 ;;
59
- --strokes) STROKES="$2"; shift 2 ;;
66
+ --strokes|--annotations) STROKES="$2"; shift 2 ;;
67
+ --mix) MIX=1; shift ;;
60
68
  --pan) PAN="$2"; shift 2 ;;
61
69
  --zoom) ZOOM="$2"; shift 2 ;;
62
70
  --timeout) TIMEOUT="$2"; shift 2 ;;
@@ -67,7 +75,7 @@ while [ $# -gt 0 ]; do
67
75
  --history) HISTORY="$2"; shift 2 ;;
68
76
  --json) JSON=1; shift ;;
69
77
  --help|-h)
70
- sed -n '2,30p' "$0" | sed 's/^# \?//'
78
+ sed -n '2,42p' "$0" | sed 's/^# \?//'
71
79
  exit 0
72
80
  ;;
73
81
  *)
@@ -115,19 +123,25 @@ if [ "$FIXTURE" = "1" ]; then
115
123
  [ "$BOARDS" -le 2000 ] || { echo "perf.sh: --boards must be <= 2000" >&2; exit 2; }
116
124
  [ "$STROKES" -le 5000 ] || { echo "perf.sh: --strokes must be <= 5000" >&2; exit 2; }
117
125
  "$JS_RUNTIME" -e '
118
- const [modPath, designRoot, boards, strokes] = process.argv.slice(1);
119
- import(modPath).then((m) => {
120
- const r = m.writePerfCanvas({
126
+ const [modPath, designRoot, boards, strokes, mix] = process.argv.slice(1);
127
+ import(modPath).then(async (m) => {
128
+ const r = await m.writePerfCanvas({
121
129
  designRoot,
122
130
  boards: Number(boards),
123
131
  strokes: Number(strokes),
132
+ mix: mix === "1",
124
133
  });
125
134
  console.error("→ fixture written: " + r.canvasPath);
135
+ if (r.annotationsPath) {
136
+ console.error("→ annotations: " + r.annotationsPath + " (" + r.annotationsBytes + " bytes)");
137
+ if (r.annotationsBytes > 4 * 1024 * 1024)
138
+ console.error("perf.sh: WARNING annotations exceed the 4 MB board cap (DDR-242) — saves/sync of this board will be refused");
139
+ }
126
140
  }).catch((e) => {
127
141
  console.error("perf.sh: fixture generation failed: " + e.message);
128
142
  process.exit(1);
129
143
  });
130
- ' "$SCRIPT_DIR/../test/fixtures/perf-canvas.mjs" "$DESIGN_ROOT" "$BOARDS" "$STROKES" || exit 1
144
+ ' "$SCRIPT_DIR/../test/fixtures/perf-canvas.mjs" "$DESIGN_ROOT" "$BOARDS" "$STROKES" "$MIX" || exit 1
131
145
  CANVAS="ui/perf-fixture.tsx"
132
146
  fi
133
147