@1agh/maude 0.28.0 → 0.28.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 (131) hide show
  1. package/cli/commands/design.mjs +69 -3
  2. package/cli/commands/design.test.mjs +97 -1
  3. package/cli/lib/cache.mjs +1 -1
  4. package/cli/lib/config-lint.mjs +1 -1
  5. package/cli/lib/copy-tree.mjs +1 -1
  6. package/cli/lib/design-link.mjs +1 -1
  7. package/cli/lib/flow-design-integration.test.mjs +1 -1
  8. package/cli/lib/gitignore-block.test.mjs +2 -2
  9. package/cli/lib/stack-detect.mjs +1 -1
  10. package/package.json +9 -9
  11. package/plugins/design/dev-server/annotations-context-toolbar.tsx +1 -1
  12. package/plugins/design/dev-server/annotations-layer.tsx +3 -3
  13. package/plugins/design/dev-server/api.ts +1 -1
  14. package/plugins/design/dev-server/bin/scenario-report.mjs +1 -1
  15. package/plugins/design/dev-server/bin/server-up.sh +102 -9
  16. package/plugins/design/dev-server/bin/visual-sanity.sh +19 -3
  17. package/plugins/design/dev-server/canvas-comment-mount.tsx +1 -1
  18. package/plugins/design/dev-server/canvas-cursors.ts +1 -1
  19. package/plugins/design/dev-server/canvas-lib.tsx +10 -21
  20. package/plugins/design/dev-server/canvas-shell.tsx +1 -1
  21. package/plugins/design/dev-server/collab/awareness-bridge.ts +1 -1
  22. package/plugins/design/dev-server/collab/index.ts +4 -4
  23. package/plugins/design/dev-server/collab/persistence.ts +1 -1
  24. package/plugins/design/dev-server/context-menu.tsx +1 -1
  25. package/plugins/design/dev-server/dist/client.bundle.js +4 -4
  26. package/plugins/design/dev-server/dist/comment-mount.js +5 -5
  27. package/plugins/design/dev-server/dist/runtime/lib0_decoding.js +1 -620
  28. package/plugins/design/dev-server/dist/runtime/lib0_encoding.js +1 -604
  29. package/plugins/design/dev-server/dist/runtime/motion.js +4 -4944
  30. package/plugins/design/dev-server/dist/runtime/motion_react.js +10 -10054
  31. package/plugins/design/dev-server/dist/runtime/pixi-js.js +2775 -52482
  32. package/plugins/design/dev-server/dist/runtime/react-dom.js +1 -231
  33. package/plugins/design/dev-server/dist/runtime/react-dom_client.js +9 -10357
  34. package/plugins/design/dev-server/dist/runtime/react.js +1 -535
  35. package/plugins/design/dev-server/dist/runtime/react_jsx-dev-runtime.js +1 -60
  36. package/plugins/design/dev-server/dist/runtime/react_jsx-runtime.js +1 -85
  37. package/plugins/design/dev-server/dist/runtime/y-protocols_awareness.js +1 -376
  38. package/plugins/design/dev-server/dist/runtime/y-protocols_sync.js +1 -100
  39. package/plugins/design/dev-server/dist/runtime/yjs.js +5 -6687
  40. package/plugins/design/dev-server/draw/brush.ts +3 -3
  41. package/plugins/design/dev-server/draw/index.ts +5 -5
  42. package/plugins/design/dev-server/draw/layout.ts +1 -1
  43. package/plugins/design/dev-server/draw/test/geometry.test.ts +1 -1
  44. package/plugins/design/dev-server/draw/test/layout.test.ts +1 -1
  45. package/plugins/design/dev-server/draw/test/primitives.test.ts +1 -1
  46. package/plugins/design/dev-server/draw/test/serialize.test.ts +1 -1
  47. package/plugins/design/dev-server/equal-spacing-handles.tsx +1 -1
  48. package/plugins/design/dev-server/examples/perf-100-artboards.tsx +1 -2
  49. package/plugins/design/dev-server/export-dialog.tsx +1 -1
  50. package/plugins/design/dev-server/exporters/html.ts +1 -1
  51. package/plugins/design/dev-server/exporters/index.ts +2 -2
  52. package/plugins/design/dev-server/exporters/pdf.ts +1 -1
  53. package/plugins/design/dev-server/exporters/png.ts +1 -1
  54. package/plugins/design/dev-server/exporters/pptx.ts +1 -1
  55. package/plugins/design/dev-server/exporters/svg.ts +1 -1
  56. package/plugins/design/dev-server/http.ts +1 -1
  57. package/plugins/design/dev-server/marquee-overlay.tsx +1 -1
  58. package/plugins/design/dev-server/server.ts +1 -1
  59. package/plugins/design/dev-server/sync/agent.ts +1 -1
  60. package/plugins/design/dev-server/sync/index.ts +5 -5
  61. package/plugins/design/dev-server/sync/materialize.ts +2 -2
  62. package/plugins/design/dev-server/sync/migrate-seed.ts +1 -1
  63. package/plugins/design/dev-server/sync/projection.ts +3 -3
  64. package/plugins/design/dev-server/test/ai-activity.test.ts +1 -1
  65. package/plugins/design/dev-server/test/annotations-api.test.ts +1 -2
  66. package/plugins/design/dev-server/test/annotations-draw-modifiers.test.ts +2 -2
  67. package/plugins/design/dev-server/test/annotations-layer.test.ts +6 -6
  68. package/plugins/design/dev-server/test/annotations-roundtrip.test.ts +1 -1
  69. package/plugins/design/dev-server/test/boot-self-heal.test.ts +1 -1
  70. package/plugins/design/dev-server/test/canvas-cursors.test.ts +1 -1
  71. package/plugins/design/dev-server/test/canvas-edit.test.ts +1 -1
  72. package/plugins/design/dev-server/test/canvas-header.test.ts +1 -1
  73. package/plugins/design/dev-server/test/canvas-hmr-runtime.test.tsx +1 -1
  74. package/plugins/design/dev-server/test/canvas-lib-inline.test.ts +1 -1
  75. package/plugins/design/dev-server/test/canvas-lib-resolver.test.ts +1 -2
  76. package/plugins/design/dev-server/test/canvas-meta-api.test.ts +1 -2
  77. package/plugins/design/dev-server/test/canvas-origin-gate.test.ts +1 -2
  78. package/plugins/design/dev-server/test/collab-annotations-bridge.test.ts +1 -1
  79. package/plugins/design/dev-server/test/collab-bridge.test.ts +1 -1
  80. package/plugins/design/dev-server/test/collab-protocol.test.ts +2 -2
  81. package/plugins/design/dev-server/test/collab-room.test.ts +1 -1
  82. package/plugins/design/dev-server/test/collab-stress.test.ts +1 -1
  83. package/plugins/design/dev-server/test/comments-api.test.ts +1 -2
  84. package/plugins/design/dev-server/test/compile-entry.test.ts +1 -2
  85. package/plugins/design/dev-server/test/exporters/canva.test.ts +1 -2
  86. package/plugins/design/dev-server/test/exporters/history.test.ts +1 -2
  87. package/plugins/design/dev-server/test/exporters/pw-launch.test.ts +1 -1
  88. package/plugins/design/dev-server/test/exporters/scope.test.ts +1 -2
  89. package/plugins/design/dev-server/test/exporters/zip.test.ts +1 -2
  90. package/plugins/design/dev-server/test/git-lifecycle.test.ts +1 -2
  91. package/plugins/design/dev-server/test/handoff-static-frames.test.ts +1 -1
  92. package/plugins/design/dev-server/test/handoff.test.ts +1 -1
  93. package/plugins/design/dev-server/test/hmr-broadcast.test.ts +1 -1
  94. package/plugins/design/dev-server/test/input-router.test.ts +2 -2
  95. package/plugins/design/dev-server/test/locator.test.ts +1 -1
  96. package/plugins/design/dev-server/test/runtime-bundle.test.ts +1 -1
  97. package/plugins/design/dev-server/test/shared-doc-convergence.test.ts +1 -1
  98. package/plugins/design/dev-server/test/shared-doc-migrate.test.ts +2 -3
  99. package/plugins/design/dev-server/test/shared-doc-projection.test.ts +1 -1
  100. package/plugins/design/dev-server/test/snap-distance-pill.test.ts +1 -1
  101. package/plugins/design/dev-server/test/sync-agent.test.ts +2 -3
  102. package/plugins/design/dev-server/test/sync-atomic-write.test.ts +2 -3
  103. package/plugins/design/dev-server/test/sync-codec.test.ts +1 -1
  104. package/plugins/design/dev-server/test/sync-connection-state.test.ts +1 -1
  105. package/plugins/design/dev-server/test/sync-echo-guard.test.ts +1 -1
  106. package/plugins/design/dev-server/test/sync-fs-mirror.test.ts +1 -2
  107. package/plugins/design/dev-server/test/sync-hardening.test.ts +4 -5
  108. package/plugins/design/dev-server/test/sync-hubs-config.test.ts +1 -2
  109. package/plugins/design/dev-server/test/sync-meta-codec.test.ts +1 -1
  110. package/plugins/design/dev-server/test/sync-runtime.test.ts +3 -8
  111. package/plugins/design/dev-server/test/sync-status.test.ts +1 -1
  112. package/plugins/design/dev-server/test/sync-untrusted.test.ts +1 -2
  113. package/plugins/design/dev-server/test/undo-stack.test.ts +2 -2
  114. package/plugins/design/dev-server/test/use-agent-presence.test.tsx +4 -1
  115. package/plugins/design/dev-server/test/use-artboard-drag.test.ts +3 -3
  116. package/plugins/design/dev-server/test/use-canvas-activity.test.tsx +2 -2
  117. package/plugins/design/dev-server/test/use-selection-set.test.tsx +1 -1
  118. package/plugins/design/dev-server/test/use-snap-guides.test.ts +1 -1
  119. package/plugins/design/dev-server/test/use-undo-stack.test.tsx +2 -2
  120. package/plugins/design/dev-server/use-agent-presence.tsx +1 -1
  121. package/plugins/design/dev-server/use-annotation-resize.tsx +1 -5
  122. package/plugins/design/dev-server/use-annotation-selection.tsx +2 -6
  123. package/plugins/design/dev-server/use-annotations-visibility.tsx +1 -1
  124. package/plugins/design/dev-server/use-artboard-drag.tsx +1 -1
  125. package/plugins/design/dev-server/use-canvas-activity.tsx +1 -1
  126. package/plugins/design/dev-server/use-collab.tsx +3 -4
  127. package/plugins/design/dev-server/use-selection-set.tsx +1 -1
  128. package/plugins/design/dev-server/use-tool-mode.tsx +1 -1
  129. package/plugins/design/dev-server/use-undo-stack.tsx +4 -5
  130. package/plugins/design/templates/_shell.html +3 -3
  131. package/plugins/design/templates/design-system-inspiration/SUB-AGENT-PROMPTS.md +18 -3
@@ -177,7 +177,7 @@
177
177
  // ai-activity via postMessage when embedded; the own-WS path (standalone /
178
178
  // same-origin inspector socket) is handled in connectHmr below.
179
179
  let agentEditing = false;
180
- window.addEventListener('message', function (e) {
180
+ window.addEventListener('message', (e) => {
181
181
  // DDR-078 security follow-up: only the trusted embedding parent relays
182
182
  // ai-activity. Reject canvas self-posts (which could flip the HMR gate)
183
183
  // and any non-parent source. Standalone gets it via its own WS below.
@@ -196,7 +196,7 @@
196
196
  const rt = window.__maudeCanvasRuntime;
197
197
  if (!rt || !rt.remount) { location.reload(); return; }
198
198
  import(canvasUrl + '?v=' + (version || Date.now()))
199
- .then(function (mod) {
199
+ .then((mod) => {
200
200
  if (mod && typeof mod.default === 'function') {
201
201
  rt.remount(mod.default);
202
202
  if (rt.setHolding) rt.setHolding(false);
@@ -205,7 +205,7 @@
205
205
  location.reload();
206
206
  }
207
207
  })
208
- .catch(function (err) {
208
+ .catch((err) => {
209
209
  // Build/transpile/import error → keep the current render, surface a
210
210
  // non-destructive "holding" toast. Next good build swaps it in.
211
211
  if (rt.setHolding) rt.setHolding(true, (err && (err.message || String(err))) || 'build error');
@@ -1,12 +1,12 @@
1
1
  # Sub-agent prompt templates — `/design:setup-ds` Batch B + C
2
2
 
3
- > **Why this file exists.** Per Phase 3.7 Task 4 (and DDR-049), the sub-agent prompt templates that drive Batch B + C fan-out used to live inline in `plugins/design/skills/design-system/SKILL.md` (lines 662-797 pre-extraction). SKILL.md is 1000+ LOC; the prompts were buried. Extracting them here lets us audit + extend the prompts (and especially the three MANDATORY safety blocks below) without scrolling through unrelated bootstrap logic. The skill's "Batches B + C" step loads + interpolates from this file instead of inlining the template.
3
+ > **Why this file exists.** Per Phase 3.7 Task 4 (and DDR-049), the sub-agent prompt templates that drive Batch B + C fan-out used to live inline in `plugins/design/skills/design-system/SKILL.md` (lines 662-797 pre-extraction). SKILL.md is 1000+ LOC; the prompts were buried. Extracting them here lets us audit + extend the prompts (and especially the four MANDATORY safety blocks below) without scrolling through unrelated bootstrap logic. The skill's "Batches B + C" step loads + interpolates from this file instead of inlining the template.
4
4
  >
5
5
  > **Sync rule** — when this file changes, the SKILL.md reference must still resolve. The Phase 3.7 risk register mandates a CI grep check: `SKILL.md` must literally contain the string `SUB-AGENT-PROMPTS.md`. Don't rename the file without updating the skill.
6
6
 
7
7
  The prompts are grouped by **slice** (matches the roster's `fanout:` block). Each section is a self-contained sub-agent brief — copy verbatim, substitute placeholders.
8
8
 
9
- The three MANDATORY safety blocks (ANIMATION SAFETY, RELATIVE-URL SAFETY, PLACEHOLDER POLICY) appear once at the top because they apply to every slice; sub-agent prompts reference them by name (`Apply ANIMATION SAFETY below`) instead of inlining.
9
+ The four MANDATORY safety blocks (ANIMATION SAFETY, RELATIVE-URL SAFETY, PLACEHOLDER POLICY, CODE HYGIENE) appear once at the top because they apply to every slice; sub-agent prompts reference them by name (`Apply ANIMATION SAFETY below`) instead of inlining.
10
10
 
11
11
  ---
12
12
 
@@ -36,6 +36,15 @@ The three MANDATORY safety blocks (ANIMATION SAFETY, RELATIVE-URL SAFETY, PLACEH
36
36
  - **Never assume your own placeholder path is authoritative downstream.** When the roster row's `source:` is empty AND you wrote a placeholder, set `source: placeholder` in your roster update (not `source: written`). The brand-critic and the next bootstrap pass both look for `source: placeholder` rows as "consider revisiting later".
37
37
  - **Forbidden:** authoring an `S`-shaped wordmark for a product whose first letter isn't S, authoring a "hedgehog mascot" SVG because the README copy mentioned hedgehog energy. The studyfi imprint retro D-2 caught both patterns. If the production-asset sweep returned nothing AND the discovery brief didn't explicitly request a mascot, **rewrite the copy** instead of inventing the artifact.
38
38
 
39
+ ### CODE HYGIENE (mandatory — applies to EVERY TSX + CSS file in every slice)
40
+
41
+ > **Why this block exists (setup-ds Round-2 / DDR-082).** These four defects all *pass a parse / transpile-only check but break at render or assert something false* — exactly the class the structural critic can't see. Each was caught by a user mid-flow, never by the loop. The reconcile-time scaffold-integrity gates in `_bootstrap.md` grep for all four; **prevent them here so the grep finds nothing.**
42
+
43
+ - **No empty / stub files.** Every file you claim as `written` in the roster MUST carry real content — the JSDoc header, the `import "./<slug>.css"`, and a non-trivial default export. **Never** flip a roster row to `status: written` for a file you created empty or as a placeholder-to-fill-later. A 0-byte (or near-empty, < 20 B) specimen is a reconciliation **hard-fail**, the same severity as a `pending` row. The roster's `loc:` field is a claim that is verified against disk — report the *real* line count, never an aspirational one.
44
+ - **CSS comment hygiene — never write `*/` inside a `/* … */` block.** A stray `*/` (e.g. inside an example selector string, a URL, or a nested-comment attempt) closes the comment early and the trailing text becomes invalid CSS → the dev-server bundle fails with "Bundle failed" and the specimen renders unstyled. CSS has **no nested comments.** If you must show a `*/` literally in demo copy, escape it in JSX text (`{'*/'}`) — never inside a `/* */` CSS comment.
45
+ - **`React.*` requires a BINDING import.** Any use of `React.useState`, `React.useId`, `React.Fragment`, `React.useEffect`, `React.CSSProperties`, etc. MUST be backed by `import React from "react"` (default) or `import * as React from "react"` (namespace) — those are the only forms that bind the `React` identifier. A NAMED import (`import { useState } from "react"`) or a type-only import (`import type { CSSProperties } from "react"`) does **not** bind `React`, so `React.foo` still throws `ReferenceError: React is not defined` at module-eval in the browser even though it transpiles clean — a runtime crash the structural critic never sees. **Prefer named imports and call them unqualified** (`import { useId, useState } from "react"` → `useState(…)`, not `React.useState(…)`); reach for the `React.` namespace only with the default/namespace import in place. The reconcile gate flags any `React.*` whose file lacks a default/namespace React import.
46
+ - **Contrast-claim discipline — never assert a ratio you didn't compute.** Do NOT write `✓ 4.5:1`, `✓ AAA`, `passes AA`, `7:1`, etc. in a specimen, a CSS comment, or copy **unless you actually computed it** from the real token pair (WCAG relative-luminance or APCA). A hardcoded-but-wrong ratio claim is worse than no claim — it tells the reader a failing pair is safe. If you want to *demonstrate* contrast without computing, label the swatch with the token names and the OKLCH values, not a fabricated ratio. The reconcile grep flags ratio-claim substrings for verification — an unverified claim is a gate failure.
47
+
39
48
  ---
40
49
 
41
50
  ## Sub-agent prompt template (slice-agnostic — used by every Batch B + C slice)
@@ -128,6 +137,10 @@ YOUR SLICE — write these {{N}} files (absolute paths):
128
137
  … (etc.)
129
138
 
130
139
  SAFETY BLOCKS — apply to every file in your slice:
140
+ - **CODE HYGIENE** (see SUB-AGENT-PROMPTS.md). ALWAYS — applies to every TSX +
141
+ CSS file. No empty / stub files (report real `loc:`), no `*/` inside a CSS
142
+ `/* */` block, every `React.*` needs an explicit `import`, never assert a
143
+ contrast ratio you didn't compute. The reconcile gate greps for all four.
131
144
  - **ANIMATION SAFETY** (see SUB-AGENT-PROMPTS.md). Mandatory if your slice
132
145
  includes the `motion` specimen OR any file that uses `@keyframes` /
133
146
  `transition` / `animate`. Bounded geometry + sparkle-≤56px + infinite-alternate
@@ -189,7 +202,9 @@ ANTI-PATTERNS (graphic-design-critic blockers — guaranteed rejection)
189
202
  WHEN DONE
190
203
  After writing all {{N}} files:
191
204
  1. Update each row in {{absolute path to _scaffold-roster.yaml}}: change
192
- `status: pending` → `status: written, loc: <line-count>`.
205
+ `status: pending` → `status: written, loc: <line-count>`. The `loc:` is the
206
+ REAL on-disk line count — never aspirational. An empty / stub / 0-byte file
207
+ flipped to `written` is a reconciliation hard-fail (see CODE HYGIENE).
193
208
  2. **Do NOT add new rows.** If you discover a missing claim (e.g. wordmark
194
209
  referenced but no logo.tsx in roster), include "ROSTER GAP: <description>"
195
210
  in your completion message. The main agent reconciles new rows.