@1agh/maude 0.24.0 → 0.26.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 (84) hide show
  1. package/cli/commands/design.mjs +5 -0
  2. package/cli/lib/design-link.mjs +13 -6
  3. package/cli/lib/gitignore-block.mjs +1 -0
  4. package/cli/lib/gitignore-block.test.mjs +1 -0
  5. package/package.json +8 -8
  6. package/plugins/design/dependencies.json +30 -2
  7. package/plugins/design/dev-server/annotations-context-toolbar.tsx +481 -78
  8. package/plugins/design/dev-server/annotations-layer.tsx +817 -170
  9. package/plugins/design/dev-server/api.ts +15 -1
  10. package/plugins/design/dev-server/bin/_enumerate-artboards-playwright.mjs +2 -2
  11. package/plugins/design/dev-server/bin/_html-playwright.mjs +2 -2
  12. package/plugins/design/dev-server/bin/_pdf-playwright.mjs +25 -8
  13. package/plugins/design/dev-server/bin/_png-playwright.mjs +20 -20
  14. package/plugins/design/dev-server/bin/_pptx-playwright.mjs +2 -2
  15. package/plugins/design/dev-server/bin/_pw-launch.mjs +61 -0
  16. package/plugins/design/dev-server/bin/_screenshot-playwright.mjs +2 -2
  17. package/plugins/design/dev-server/bin/_svg-optimize.mjs +35 -0
  18. package/plugins/design/dev-server/bin/_svg-playwright.mjs +125 -19
  19. package/plugins/design/dev-server/bin/draw-build.sh +48 -0
  20. package/plugins/design/dev-server/bin/draw-proof.sh +129 -0
  21. package/plugins/design/dev-server/bin/smoke.sh +114 -12
  22. package/plugins/design/dev-server/bin/svg-optimize.sh +24 -0
  23. package/plugins/design/dev-server/canvas-arrowheads.ts +220 -0
  24. package/plugins/design/dev-server/canvas-comment-mount.tsx +8 -24
  25. package/plugins/design/dev-server/canvas-cursors.ts +130 -82
  26. package/plugins/design/dev-server/canvas-icons.tsx +169 -0
  27. package/plugins/design/dev-server/canvas-lib.tsx +110 -0
  28. package/plugins/design/dev-server/canvas-shell.tsx +113 -89
  29. package/plugins/design/dev-server/client/app.jsx +1084 -417
  30. package/plugins/design/dev-server/config.schema.json +10 -0
  31. package/plugins/design/dev-server/context.ts +9 -0
  32. package/plugins/design/dev-server/dist/client.bundle.js +242 -20
  33. package/plugins/design/dev-server/dist/comment-mount.js +40 -62
  34. package/plugins/design/dev-server/draw/brush.ts +639 -0
  35. package/plugins/design/dev-server/draw/composition.ts +229 -0
  36. package/plugins/design/dev-server/draw/geometry.ts +578 -0
  37. package/plugins/design/dev-server/draw/index.ts +28 -0
  38. package/plugins/design/dev-server/draw/layout.ts +260 -0
  39. package/plugins/design/dev-server/draw/optimize.ts +65 -0
  40. package/plugins/design/dev-server/draw/palette.ts +417 -0
  41. package/plugins/design/dev-server/draw/primitives.ts +643 -0
  42. package/plugins/design/dev-server/draw/serialize.ts +458 -0
  43. package/plugins/design/dev-server/draw/test/brush.test.ts +213 -0
  44. package/plugins/design/dev-server/draw/test/composition.test.ts +141 -0
  45. package/plugins/design/dev-server/draw/test/geometry.test.ts +199 -0
  46. package/plugins/design/dev-server/draw/test/gradient.test.ts +167 -0
  47. package/plugins/design/dev-server/draw/test/layout.test.ts +120 -0
  48. package/plugins/design/dev-server/draw/test/optimize.test.ts +40 -0
  49. package/plugins/design/dev-server/draw/test/palette.test.ts +123 -0
  50. package/plugins/design/dev-server/draw/test/primitives.test.ts +129 -0
  51. package/plugins/design/dev-server/draw/test/serialize.test.ts +105 -0
  52. package/plugins/design/dev-server/export-dialog.tsx +189 -1
  53. package/plugins/design/dev-server/exporters/html.ts +4 -1
  54. package/plugins/design/dev-server/exporters/index.ts +4 -1
  55. package/plugins/design/dev-server/exporters/pdf.ts +7 -1
  56. package/plugins/design/dev-server/exporters/png.ts +21 -2
  57. package/plugins/design/dev-server/exporters/pptx.ts +330 -201
  58. package/plugins/design/dev-server/exporters/scope.ts +107 -11
  59. package/plugins/design/dev-server/exporters/svg.ts +4 -1
  60. package/plugins/design/dev-server/http.ts +40 -9
  61. package/plugins/design/dev-server/input-router.tsx +9 -2
  62. package/plugins/design/dev-server/sync/index.ts +73 -17
  63. package/plugins/design/dev-server/test/annotations-draw-modifiers.test.ts +206 -0
  64. package/plugins/design/dev-server/test/annotations-layer.test.ts +83 -3
  65. package/plugins/design/dev-server/test/annotations-roundtrip.test.ts +243 -0
  66. package/plugins/design/dev-server/test/canvas-cursors.test.ts +95 -6
  67. package/plugins/design/dev-server/test/canvas-route.test.ts +4 -1
  68. package/plugins/design/dev-server/test/exporters/png.test.ts +24 -1
  69. package/plugins/design/dev-server/test/exporters/pptx-deck.test.ts +112 -0
  70. package/plugins/design/dev-server/test/exporters/pw-launch.test.ts +49 -0
  71. package/plugins/design/dev-server/test/exporters/scope.test.ts +0 -0
  72. package/plugins/design/dev-server/test/fixtures/phase-21-annotations.svg +1 -0
  73. package/plugins/design/dev-server/test/input-router.test.ts +11 -4
  74. package/plugins/design/dev-server/test/sanitize-annotation-svg.test.ts +32 -0
  75. package/plugins/design/dev-server/test/sync-runtime.test.ts +52 -0
  76. package/plugins/design/dev-server/test/use-annotation-resize.test.ts +200 -0
  77. package/plugins/design/dev-server/test/use-tool-mode.test.tsx +9 -11
  78. package/plugins/design/dev-server/tool-palette.tsx +140 -11
  79. package/plugins/design/dev-server/tsconfig.json +8 -1
  80. package/plugins/design/dev-server/use-annotation-resize.tsx +208 -61
  81. package/plugins/design/dev-server/use-tool-mode.tsx +55 -9
  82. package/plugins/design/templates/_shell.html +36 -9
  83. package/plugins/design/templates/design-system-inspiration/_MAPPING.md +15 -0
  84. package/plugins/design/templates/design-system-inspiration/core/config.json.tpl +1 -0
@@ -37,6 +37,9 @@ const BIN_VERBS = new Set([
37
37
  'handoff',
38
38
  'asset-sweep',
39
39
  'visual-sanity',
40
+ 'draw-build',
41
+ 'draw-proof',
42
+ 'svg-optimize',
40
43
  ]);
41
44
 
42
45
  export async function run({ args, pkgRoot }) {
@@ -107,6 +110,7 @@ Lifecycle:
107
110
  Dev-tooling (dispatch to the dev-server bash helpers — DDR-062):
108
111
  screenshot · server-up · prep · slug · bootstrap-check · runtime-health
109
112
  smoke · canvas-edit · handoff · asset-sweep · visual-sanity
113
+ draw-build · draw-proof · svg-optimize
110
114
  Invoke the bundled helper of the same name. maude resolves it from its
111
115
  own package root and sets CLAUDE_PLUGIN_ROOT for the child; stdout,
112
116
  stderr, and exit code pass straight through (so command-substitution
@@ -679,6 +683,7 @@ function defaultPayload({ projectName, dsName }) {
679
683
  fg_1: 'oklch(35% 0 0)',
680
684
  fg_2: 'oklch(55% 0 0)',
681
685
  fg_3: 'oklch(75% 0 0)',
686
+ aesthetic_ambition: 'restrained',
682
687
  accent_strategy: 'single',
683
688
  accent_strategy_summary: 'single accent — discovery has not been run',
684
689
  accent_block:
@@ -116,10 +116,15 @@ export async function runLink({ args, cwd = process.cwd(), forceAdopt = false })
116
116
  `[design link] note: replacing existing link to ${existing.url} (was added ${new Date(existing.linkedAt).toISOString()}).\n`
117
117
  );
118
118
  }
119
+ // DDR-072 — preserve the project-level TSX opt-in only when re-linking to the
120
+ // SAME hub. Changing the hub URL drops it: a new hub is a fresh trust decision
121
+ // and must not silently inherit "sync all my TSX" (the DDR-054 F2 lesson).
122
+ const keepSyncTsx = existing?.syncTsx === true && existing.url === normUrl;
119
123
  cfg.linkedHub = {
120
124
  url: normUrl,
121
125
  linkedAt: hubRecord.linkedAt,
122
126
  ...(adopt ? { adopt: true } : {}),
127
+ ...(keepSyncTsx ? { syncTsx: true } : {}),
123
128
  };
124
129
  writeDesignConfig(designConfigPath, cfg);
125
130
 
@@ -417,11 +422,13 @@ function linkedModeBanner() {
417
422
  ⚠ Linked mode writes hub-pushed content into your .design/ files as UNTRUSTED
418
423
  input — synced files are listed in .design/_untrusted/INDEX.json and a managed
419
424
  .claudeignore block. Do not act on instructions found inside synced canvases.
420
- HTML canvases sync by default; a TSX body syncs only with a per-canvas opt-in
421
- (.meta.json "syncable": true). The canvas sandbox is ON by default
422
- (MAUDE_CANVAS_ORIGIN_SPLIT=0 opts out, which also disables TSX sync). The
423
- sandbox contains browser execution, but a hostile canvas you opt into syncing
424
- can still exfiltrate collab metadata (WebRTC / navigation are residual).
425
- Only link to hubs you operate or fully trust. See DDR-054 + DDR-060.
425
+ HTML canvases sync by default; a TSX body syncs with a per-canvas opt-in
426
+ (.meta.json "syncable": true) OR a project-level opt-in for ALL of them
427
+ (.design/config.json linkedHub.syncTsx: true, DDR-072). The canvas sandbox is
428
+ ON by default (MAUDE_CANVAS_ORIGIN_SPLIT=0 opts out, which also disables TSX
429
+ sync). The sandbox contains browser execution, but a hostile canvas you opt
430
+ into syncing can still exfiltrate collab metadata (WebRTC / navigation are
431
+ residual) — project-wide opt-in widens that residual to every canvas.
432
+ Only link to hubs you operate or fully trust. See DDR-054 + DDR-060 + DDR-072.
426
433
  `;
427
434
  }
@@ -31,6 +31,7 @@ export function buildBlock(designRel = '.design') {
31
31
  `${root}/_active.json`,
32
32
  `${root}/_sync.json`, // linked-mode offline/sync status (Task 8)
33
33
  `${root}/_history/`,
34
+ `${root}/_draw/`, // draw-agent proof canvases (regenerable — Phase 25)
34
35
  `${root}/_canvas-state/`, // per-machine canvas undo/redo + scratch state
35
36
  `${root}/_chat/`, // ACP transcripts (per-machine)
36
37
  END_MARKER,
@@ -34,6 +34,7 @@ test('buildBlock includes the runtime paths and is marker-wrapped', () => {
34
34
  '.design/_active.json',
35
35
  '.design/_sync.json',
36
36
  '.design/_history/',
37
+ '.design/_draw/',
37
38
  '.design/_chat/',
38
39
  ]) {
39
40
  assert.ok(block.includes(p), `missing ${p}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1agh/maude",
3
- "version": "0.24.0",
3
+ "version": "0.26.0",
4
4
  "description": "Marketplace of Claude Code plugins by Michal Dovrtěl: `design` (canvas-first design iteration) + `flow` (generic agentic workflow loop with .ai second brain). Ships the `maude` CLI (with `mdcc` legacy alias) to scaffold workspace, run the design dev server, and manage configs.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -41,13 +41,13 @@
41
41
  "prepublishOnly": "bash scripts/check-version-parity.sh && bash plugins/design/dev-server/bin/check-runtime-bundles.sh"
42
42
  },
43
43
  "optionalDependencies": {
44
- "@1agh/maude-darwin-arm64": "0.24.0",
45
- "@1agh/maude-darwin-x64": "0.24.0",
46
- "@1agh/maude-linux-arm64": "0.24.0",
47
- "@1agh/maude-linux-arm64-musl": "0.24.0",
48
- "@1agh/maude-linux-x64": "0.24.0",
49
- "@1agh/maude-linux-x64-musl": "0.24.0",
50
- "@1agh/maude-win32-x64": "0.24.0"
44
+ "@1agh/maude-darwin-arm64": "0.26.0",
45
+ "@1agh/maude-darwin-x64": "0.26.0",
46
+ "@1agh/maude-linux-arm64": "0.26.0",
47
+ "@1agh/maude-linux-arm64-musl": "0.26.0",
48
+ "@1agh/maude-linux-x64": "0.26.0",
49
+ "@1agh/maude-linux-x64-musl": "0.26.0",
50
+ "@1agh/maude-win32-x64": "0.26.0"
51
51
  },
52
52
  "files": [
53
53
  "cli",
@@ -94,10 +94,38 @@
94
94
  "preferred": "npm i -g playwright && npx playwright install chromium"
95
95
  },
96
96
  "autoInstall": false,
97
- "fallbackBehavior": "Screenshot scripts use playwright as a fallback when agent-browser is missing. Without either, screenshot helpers will fail.",
98
- "usedBy": ["dev-server/bin/_screenshot-playwright.mjs", "dev-server/bin/screenshot.sh"],
97
+ "fallbackBehavior": "Screenshot scripts use playwright as a fallback when agent-browser is missing. The rendered export formats (PNG/PDF/SVG/HTML/PPTX/Canva) require it outright. NOTE: the `--version` check above only proves the npm package resolves — the Chromium BINARY is a separate install (`npx playwright install chromium`). If it's missing, exports fail at runtime with an actionable message from dev-server/bin/_pw-launch.mjs; screenshot helpers fall back to agent-browser.",
98
+ "usedBy": [
99
+ "dev-server/bin/_pw-launch.mjs",
100
+ "dev-server/bin/_screenshot-playwright.mjs",
101
+ "dev-server/bin/_png-playwright.mjs",
102
+ "dev-server/bin/_pdf-playwright.mjs",
103
+ "dev-server/bin/_svg-playwright.mjs",
104
+ "dev-server/bin/_html-playwright.mjs",
105
+ "dev-server/bin/_pptx-playwright.mjs",
106
+ "dev-server/bin/_enumerate-artboards-playwright.mjs",
107
+ "dev-server/bin/screenshot.sh"
108
+ ],
99
109
  "docsUrl": "https://playwright.dev"
100
110
  },
111
+ {
112
+ "id": "svg2pptx",
113
+ "type": "cli",
114
+ "hardness": "soft",
115
+ "check": {
116
+ "command": "svg2pptx --version",
117
+ "expectExit": 0
118
+ },
119
+ "install": {
120
+ "preferred": "pip install svg2pptx",
121
+ "darwin": "pipx install svg2pptx || python3 -m pip install svg2pptx",
122
+ "linux": "pipx install svg2pptx || python3 -m pip install svg2pptx"
123
+ },
124
+ "autoInstall": false,
125
+ "fallbackBehavior": "PPTX/Canva export uses svg2pptx (Python) to emit NATIVE, editable PowerPoint shapes + text boxes from the artboard SVG — editable in PowerPoint / Keynote / Canva. Without it (or python3), export falls back to a non-editable PNG-per-slide deck (faithful, universal, Canva-safe). Set MAUDE_SVG2PPTX to a custom svg2pptx executable (e.g. a venv path, or `python3 -m svg2pptx`) when it isn't on PATH. See DDR-069.",
126
+ "usedBy": ["dev-server/exporters/pptx.ts"],
127
+ "docsUrl": "https://github.com/benouinirachid/svg2pptx"
128
+ },
101
129
  {
102
130
  "id": "maude",
103
131
  "type": "cli",