@1agh/maude 0.43.0 → 0.44.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 (122) hide show
  1. package/apps/studio/acp/bridge.ts +44 -10
  2. package/apps/studio/acp/env.ts +23 -0
  3. package/apps/studio/acp/login-state.ts +263 -0
  4. package/apps/studio/acp/plugin-bootstrap.ts +31 -25
  5. package/apps/studio/acp/probe.ts +152 -1
  6. package/apps/studio/annotations-layer.tsx +396 -46
  7. package/apps/studio/api.ts +395 -2
  8. package/apps/studio/bin/_audio-search.mjs +140 -0
  9. package/apps/studio/bin/_import-asset-pdf-worker.mjs +34 -0
  10. package/apps/studio/bin/_import-asset.mjs +815 -0
  11. package/apps/studio/bin/_import-brand.mjs +635 -0
  12. package/apps/studio/bin/_import-tokens-alias-resolver.mjs +95 -0
  13. package/apps/studio/bin/_import-tokens.mjs +1201 -0
  14. package/apps/studio/bin/_transcribe.mjs +419 -0
  15. package/apps/studio/bin/_transcribe.test.mjs +80 -0
  16. package/apps/studio/bin/audio-search.sh +28 -0
  17. package/apps/studio/bin/generate.sh +154 -0
  18. package/apps/studio/bin/import-asset.sh +34 -0
  19. package/apps/studio/bin/import-brand.sh +29 -0
  20. package/apps/studio/bin/import-tokens.sh +33 -0
  21. package/apps/studio/bin/photo-bg-remove.sh +119 -21
  22. package/apps/studio/bin/transcribe.sh +39 -0
  23. package/apps/studio/canvas-edit.ts +197 -2
  24. package/apps/studio/canvas-lib.tsx +115 -6
  25. package/apps/studio/client/app.jsx +1954 -685
  26. package/apps/studio/client/generate-dialog.jsx +352 -0
  27. package/apps/studio/client/github.js +14 -0
  28. package/apps/studio/client/inspector-controls.jsx +781 -0
  29. package/apps/studio/client/panels/BrandUploadPanel.jsx +233 -0
  30. package/apps/studio/client/panels/ChatPanel.jsx +15 -33
  31. package/apps/studio/client/panels/IntroVideoDialog.jsx +44 -0
  32. package/apps/studio/client/panels/OnboardingWizard.jsx +12 -0
  33. package/apps/studio/client/panels/ReadinessList.jsx +227 -7
  34. package/apps/studio/client/panels/SettingsPanel.jsx +828 -0
  35. package/apps/studio/client/panels/SetupChecklist.jsx +223 -0
  36. package/apps/studio/client/photo-knobs.jsx +167 -172
  37. package/apps/studio/client/styles/3-shell-maude.css +334 -28
  38. package/apps/studio/client/styles/4-components.css +223 -0
  39. package/apps/studio/client/styles/6-acp-chat.css +86 -0
  40. package/apps/studio/client/tour/quick-setup-tour.js +39 -0
  41. package/apps/studio/commands/annotation-strokes-command.ts +13 -3
  42. package/apps/studio/config.schema.json +70 -0
  43. package/apps/studio/context-menu.tsx +11 -2
  44. package/apps/studio/context.ts +16 -0
  45. package/apps/studio/design-setup-readiness.ts +115 -0
  46. package/apps/studio/dist/client.bundle.js +2097 -2088
  47. package/apps/studio/dist/styles.css +1 -1
  48. package/apps/studio/draw/palette.ts +34 -0
  49. package/apps/studio/footage/schema.test.ts +92 -0
  50. package/apps/studio/footage/schema.ts +179 -1
  51. package/apps/studio/generation/adapters/elevenlabs.ts +370 -0
  52. package/apps/studio/generation/adapters/gemini.ts +542 -0
  53. package/apps/studio/generation/adapters/groq.test.ts +80 -0
  54. package/apps/studio/generation/adapters/groq.ts +247 -0
  55. package/apps/studio/generation/audio-library.test.ts +95 -0
  56. package/apps/studio/generation/audio-library.ts +156 -0
  57. package/apps/studio/generation/captions.test.ts +78 -0
  58. package/apps/studio/generation/captions.ts +132 -0
  59. package/apps/studio/generation/download.ts +76 -0
  60. package/apps/studio/generation/elevenlabs.test.ts +223 -0
  61. package/apps/studio/generation/gemini.test.ts +350 -0
  62. package/apps/studio/generation/jobs.test.ts +128 -0
  63. package/apps/studio/generation/jobs.ts +243 -0
  64. package/apps/studio/generation/keys.test.ts +75 -0
  65. package/apps/studio/generation/keys.ts +162 -0
  66. package/apps/studio/generation/prefs.test.ts +95 -0
  67. package/apps/studio/generation/prefs.ts +82 -0
  68. package/apps/studio/generation/registry.ts +88 -0
  69. package/apps/studio/generation/types.test.ts +123 -0
  70. package/apps/studio/generation/types.ts +266 -0
  71. package/apps/studio/generation/whisper-models.test.ts +152 -0
  72. package/apps/studio/generation/whisper-models.ts +257 -0
  73. package/apps/studio/generation/whisper-spike-results.md +61 -0
  74. package/apps/studio/git/service.ts +3 -1
  75. package/apps/studio/http.ts +867 -9
  76. package/apps/studio/media/intro.mp4 +0 -0
  77. package/apps/studio/media-commit-chain.ts +119 -0
  78. package/apps/studio/paths.ts +10 -0
  79. package/apps/studio/readiness.ts +108 -20
  80. package/apps/studio/scaffold-design.ts +1145 -0
  81. package/apps/studio/server.ts +13 -1
  82. package/apps/studio/test/_helpers.ts +15 -2
  83. package/apps/studio/test/acp-bridge.test.ts +34 -1
  84. package/apps/studio/test/acp-env.test.ts +30 -0
  85. package/apps/studio/test/acp-plugin-bootstrap.test.ts +23 -57
  86. package/apps/studio/test/acp-session-plugins.test.ts +72 -1
  87. package/apps/studio/test/annotation-strokes-command.test.ts +17 -0
  88. package/apps/studio/test/annotations-layer.test.ts +174 -0
  89. package/apps/studio/test/canvas-origin-gate.test.ts +37 -0
  90. package/apps/studio/test/csp-canvas-shell.test.ts +11 -0
  91. package/apps/studio/test/csrf-write-guard.test.ts +23 -1
  92. package/apps/studio/test/design-setup-readiness.test.ts +155 -0
  93. package/apps/studio/test/element-structural-edit.test.ts +108 -0
  94. package/apps/studio/test/fixtures/fake-claude-auth.mjs +13 -0
  95. package/apps/studio/test/generate-route.test.ts +106 -0
  96. package/apps/studio/test/import-asset-browser.test.ts +64 -0
  97. package/apps/studio/test/import-asset-route.test.ts +71 -0
  98. package/apps/studio/test/import-asset.test.ts +399 -0
  99. package/apps/studio/test/import-brand-browser.test.ts +88 -0
  100. package/apps/studio/test/import-brand-route.test.ts +120 -0
  101. package/apps/studio/test/import-brand.test.ts +206 -0
  102. package/apps/studio/test/import-tokens.test.ts +722 -0
  103. package/apps/studio/test/media-commit-chain.test.ts +210 -0
  104. package/apps/studio/test/photo-bg-remove-validation.test.ts +71 -0
  105. package/apps/studio/test/readiness.test.ts +13 -11
  106. package/apps/studio/test/scaffold-design.test.ts +122 -0
  107. package/apps/studio/test/tour-overlay.test.tsx +16 -0
  108. package/apps/studio/tool-palette.tsx +11 -6
  109. package/apps/studio/ui-prefs.ts +130 -0
  110. package/apps/studio/use-canvas-media-drop.tsx +4 -2
  111. package/apps/studio/use-chrome-visibility.tsx +8 -2
  112. package/apps/studio/whats-new.json +96 -0
  113. package/apps/studio/ws.ts +5 -0
  114. package/cli/bin/maude.mjs +6 -6
  115. package/cli/commands/design.mjs +33 -0
  116. package/cli/lib/gitignore-block.mjs +1 -0
  117. package/cli/lib/pkg-root.mjs +107 -0
  118. package/cli/lib/pkg-root.test.mjs +79 -0
  119. package/cli/lib/reconstruct-toolset.test.mjs +194 -0
  120. package/cli/lib/update-check.mjs +8 -0
  121. package/package.json +12 -10
  122. package/plugins/design/dependencies.json +18 -0
@@ -0,0 +1,223 @@
1
+ // SetupChecklist — DDR-166 plan, Phase 2 (T7/T8). Design-setup progress surface
2
+ // (project / design system / first canvas / brand assets), mirroring
3
+ // ReadinessList.jsx's shape but backed by GET /_api/setup-readiness instead of
4
+ // /_api/preflight. Pure detect-and-guide: never installs or mutates anything.
5
+ //
6
+ // "Bring my existing brand" (T8) now opens the real in-app ingestion panel
7
+ // (T12, DDR-173) — `onBringBrand` is threaded down the same way `onStartTour`
8
+ // already is; when absent (an older mount site not yet updated), falls back
9
+ // to the public docs link this used to be a stub for.
10
+
11
+ import { useCallback, useEffect, useState } from 'react';
12
+
13
+ /** Fetch + cache the design-setup readiness report. `refresh()` re-probes. */
14
+ export function useSetupReadiness(enabled = true) {
15
+ const [report, setReport] = useState(null); // { ready, items } | null
16
+ const [loading, setLoading] = useState(enabled);
17
+
18
+ const refresh = useCallback(() => {
19
+ setLoading(true);
20
+ return fetch('/_api/setup-readiness')
21
+ .then((r) => r.json())
22
+ .then((d) => {
23
+ setReport(d && Array.isArray(d.items) ? d : null);
24
+ setLoading(false);
25
+ return d;
26
+ })
27
+ .catch(() => {
28
+ setReport(null);
29
+ setLoading(false);
30
+ return null;
31
+ });
32
+ }, []);
33
+
34
+ useEffect(() => {
35
+ if (!enabled) return undefined;
36
+ let alive = true;
37
+ fetch('/_api/setup-readiness')
38
+ .then((r) => r.json())
39
+ .then((d) => alive && (setReport(d && Array.isArray(d.items) ? d : null), setLoading(false)))
40
+ .catch(() => alive && (setReport(null), setLoading(false)));
41
+ return () => {
42
+ alive = false;
43
+ };
44
+ }, [enabled]);
45
+
46
+ return { report, loading, refresh };
47
+ }
48
+
49
+ function StatusIcon({ present }) {
50
+ if (present)
51
+ return (
52
+ <svg
53
+ width="14"
54
+ height="14"
55
+ viewBox="0 0 16 16"
56
+ fill="none"
57
+ stroke="currentColor"
58
+ strokeWidth="1.6"
59
+ strokeLinecap="round"
60
+ strokeLinejoin="round"
61
+ aria-hidden="true"
62
+ >
63
+ <polyline points="3 8.4 6.4 11.8 13 4.4" />
64
+ </svg>
65
+ );
66
+ return (
67
+ <svg
68
+ width="14"
69
+ height="14"
70
+ viewBox="0 0 16 16"
71
+ fill="none"
72
+ stroke="currentColor"
73
+ strokeWidth="1.6"
74
+ strokeLinecap="round"
75
+ strokeLinejoin="round"
76
+ aria-hidden="true"
77
+ >
78
+ <circle cx="8" cy="8" r="5.5" />
79
+ </svg>
80
+ );
81
+ }
82
+
83
+ export function SetupChecklist({ report, loading, refresh, onStartTour, onBringBrand }) {
84
+ return (
85
+ <div className="setup-cl">
86
+ <ul className="setup-cl-list">
87
+ {report?.items?.map((it) => (
88
+ <li
89
+ key={it.id}
90
+ className={`setup-cl-row setup-cl-row--${it.status}`}
91
+ data-testid={`setup-cl-row-${it.id}`}
92
+ >
93
+ <span className="setup-cl-ic" aria-hidden="true">
94
+ <StatusIcon present={it.status === 'present'} />
95
+ </span>
96
+ <span className="setup-cl-tx">
97
+ <span className="setup-cl-label">{it.label}</span>
98
+ <span className="setup-cl-detail">{it.detail}</span>
99
+ </span>
100
+ </li>
101
+ ))}
102
+ </ul>
103
+ <div className="setup-cl-foot">
104
+ {onStartTour && (
105
+ <button
106
+ type="button"
107
+ data-testid="setup-cl-start-tour"
108
+ className="btn btn--primary btn--sm"
109
+ onClick={onStartTour}
110
+ >
111
+ Start guided setup
112
+ </button>
113
+ )}
114
+ {onBringBrand ? (
115
+ <button
116
+ type="button"
117
+ data-testid="onboarding-bring-brand"
118
+ className="btn btn--ghost btn--sm setup-cl-brand"
119
+ onClick={onBringBrand}
120
+ >
121
+ Bring my existing brand
122
+ </button>
123
+ ) : (
124
+ <a
125
+ href="https://maude.sh/docs/getting-started"
126
+ target="_blank"
127
+ rel="noreferrer noopener"
128
+ data-testid="onboarding-bring-brand"
129
+ className="btn btn--ghost btn--sm setup-cl-brand"
130
+ >
131
+ Bring my existing brand
132
+ </a>
133
+ )}
134
+ {refresh && (
135
+ <button
136
+ type="button"
137
+ className="btn btn--ghost btn--sm setup-cl-recheck"
138
+ onClick={refresh}
139
+ disabled={loading}
140
+ >
141
+ {loading ? 'Checking…' : 'Re-check'}
142
+ </button>
143
+ )}
144
+ </div>
145
+ </div>
146
+ );
147
+ }
148
+
149
+ // Standalone modal, reachable from Help ▸ Quick setup… — reuses the shared
150
+ // help-modal chrome (backdrop + header + body), same shape as ReadinessDialog.
151
+ export default function SetupChecklistDialog({ open, onClose, onStartTour, onBringBrand }) {
152
+ const { report, loading, refresh } = useSetupReadiness(open);
153
+ useEffect(() => {
154
+ if (!open) return undefined;
155
+ const onKey = (e) => e.key === 'Escape' && onClose();
156
+ window.addEventListener('keydown', onKey);
157
+ return () => window.removeEventListener('keydown', onKey);
158
+ }, [open, onClose]);
159
+ if (!open) return null;
160
+ return (
161
+ <div
162
+ className="help-modal-backdrop"
163
+ role="presentation"
164
+ onMouseDown={(e) => {
165
+ if (e.target === e.currentTarget) onClose();
166
+ }}
167
+ >
168
+ <div
169
+ className="help-modal setup-cl-modal"
170
+ role="dialog"
171
+ aria-modal="true"
172
+ aria-labelledby="setup-cl-modal-title"
173
+ >
174
+ <header className="help-modal-hd">
175
+ <span className="title" id="setup-cl-modal-title">
176
+ Quick setup
177
+ </span>
178
+ <button
179
+ type="button"
180
+ className="help-modal-close"
181
+ aria-label="Close (Esc)"
182
+ onClick={onClose}
183
+ >
184
+ ×
185
+ </button>
186
+ </header>
187
+ <div className="help-modal-body">
188
+ <p className="setup-cl-note">
189
+ Empty → design system → first canvas → your first AI edit. Ask the Assistant to build
190
+ each step, or take the guided tour to see where everything lives.
191
+ </p>
192
+ {report ? (
193
+ <SetupChecklist
194
+ report={report}
195
+ loading={loading}
196
+ refresh={refresh}
197
+ onStartTour={
198
+ onStartTour
199
+ ? () => {
200
+ onClose();
201
+ onStartTour();
202
+ }
203
+ : undefined
204
+ }
205
+ onBringBrand={
206
+ onBringBrand
207
+ ? () => {
208
+ onClose();
209
+ onBringBrand();
210
+ }
211
+ : undefined
212
+ }
213
+ />
214
+ ) : (
215
+ <p className="setup-cl-note">
216
+ {loading ? 'Checking…' : "Couldn't reach the setup probe."}
217
+ </p>
218
+ )}
219
+ </div>
220
+ </div>
221
+ </div>
222
+ );
223
+ }