@monoes/monomindcli 2.15.6 → 2.15.7

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 (180) hide show
  1. package/dist/src/orgrt/completion-gate.d.ts +15 -0
  2. package/dist/src/orgrt/completion-gate.d.ts.map +1 -1
  3. package/dist/src/orgrt/completion-gate.js +59 -3
  4. package/dist/src/orgrt/completion-gate.js.map +1 -1
  5. package/dist/src/orgrt/daemon.d.ts +4 -0
  6. package/dist/src/orgrt/daemon.d.ts.map +1 -1
  7. package/dist/src/orgrt/daemon.js +1 -0
  8. package/dist/src/orgrt/daemon.js.map +1 -1
  9. package/dist/src/orgrt/decisions.d.ts +17 -0
  10. package/dist/src/orgrt/decisions.d.ts.map +1 -1
  11. package/dist/src/orgrt/decisions.js +104 -4
  12. package/dist/src/orgrt/decisions.js.map +1 -1
  13. package/dist/src/orgrt/review-packet.d.ts +1 -1
  14. package/dist/src/orgrt/review-packet.d.ts.map +1 -1
  15. package/dist/src/orgrt/review-packet.js +2 -2
  16. package/dist/src/orgrt/review-packet.js.map +1 -1
  17. package/dist/src/orgrt/session.d.ts +3 -0
  18. package/dist/src/orgrt/session.d.ts.map +1 -1
  19. package/dist/src/orgrt/session.js +6 -1
  20. package/dist/src/orgrt/session.js.map +1 -1
  21. package/dist/src/orgrt/task-dag.d.ts +3 -0
  22. package/dist/src/orgrt/task-dag.d.ts.map +1 -1
  23. package/dist/src/orgrt/task-dag.js +6 -0
  24. package/dist/src/orgrt/task-dag.js.map +1 -1
  25. package/dist/tsconfig.tsbuildinfo +1 -1
  26. package/package.json +4 -4
  27. package/.claude/skills/monodesign/SKILL.md +0 -257
  28. package/.claude/skills/monodesign/adapt.md +0 -53
  29. package/.claude/skills/monodesign/agents/monodesign-asset-producer.md +0 -100
  30. package/.claude/skills/monodesign/agents/monodesign-manual-edit-applier.md +0 -103
  31. package/.claude/skills/monodesign/animate.md +0 -65
  32. package/.claude/skills/monodesign/audit.md +0 -89
  33. package/.claude/skills/monodesign/bolder.md +0 -50
  34. package/.claude/skills/monodesign/clarify.md +0 -64
  35. package/.claude/skills/monodesign/colorize.md +0 -68
  36. package/.claude/skills/monodesign/craft.md +0 -51
  37. package/.claude/skills/monodesign/critique.md +0 -66
  38. package/.claude/skills/monodesign/delight.md +0 -47
  39. package/.claude/skills/monodesign/distill.md +0 -56
  40. package/.claude/skills/monodesign/document.md +0 -83
  41. package/.claude/skills/monodesign/extract.md +0 -74
  42. package/.claude/skills/monodesign/harden.md +0 -65
  43. package/.claude/skills/monodesign/init.md +0 -30
  44. package/.claude/skills/monodesign/layout.md +0 -36
  45. package/.claude/skills/monodesign/live.md +0 -34
  46. package/.claude/skills/monodesign/onboard.md +0 -50
  47. package/.claude/skills/monodesign/optimize.md +0 -64
  48. package/.claude/skills/monodesign/overdrive.md +0 -56
  49. package/.claude/skills/monodesign/polish.md +0 -68
  50. package/.claude/skills/monodesign/quieter.md +0 -57
  51. package/.claude/skills/monodesign/reference/adapt.md +0 -312
  52. package/.claude/skills/monodesign/reference/adapt.native.md +0 -58
  53. package/.claude/skills/monodesign/reference/android.md +0 -40
  54. package/.claude/skills/monodesign/reference/animate.md +0 -203
  55. package/.claude/skills/monodesign/reference/antipatterns-catalog.md +0 -410
  56. package/.claude/skills/monodesign/reference/audit.md +0 -135
  57. package/.claude/skills/monodesign/reference/audit.native.md +0 -139
  58. package/.claude/skills/monodesign/reference/bolder.md +0 -120
  59. package/.claude/skills/monodesign/reference/brand-workflow.md +0 -180
  60. package/.claude/skills/monodesign/reference/brand.md +0 -108
  61. package/.claude/skills/monodesign/reference/clarify.md +0 -288
  62. package/.claude/skills/monodesign/reference/codex.md +0 -105
  63. package/.claude/skills/monodesign/reference/cognitive-load.md +0 -106
  64. package/.claude/skills/monodesign/reference/color-and-contrast.md +0 -105
  65. package/.claude/skills/monodesign/reference/colorize.md +0 -257
  66. package/.claude/skills/monodesign/reference/component-specs.md +0 -260
  67. package/.claude/skills/monodesign/reference/component-states.md +0 -274
  68. package/.claude/skills/monodesign/reference/component-system.md +0 -358
  69. package/.claude/skills/monodesign/reference/copy-formulas.md +0 -160
  70. package/.claude/skills/monodesign/reference/craft.md +0 -123
  71. package/.claude/skills/monodesign/reference/critique.md +0 -780
  72. package/.claude/skills/monodesign/reference/delight.md +0 -302
  73. package/.claude/skills/monodesign/reference/design-principles.md +0 -246
  74. package/.claude/skills/monodesign/reference/distill.md +0 -111
  75. package/.claude/skills/monodesign/reference/document.md +0 -429
  76. package/.claude/skills/monodesign/reference/extract.md +0 -69
  77. package/.claude/skills/monodesign/reference/harden.md +0 -347
  78. package/.claude/skills/monodesign/reference/heuristics-scoring.md +0 -234
  79. package/.claude/skills/monodesign/reference/hooks.md +0 -92
  80. package/.claude/skills/monodesign/reference/image-prompts.md +0 -130
  81. package/.claude/skills/monodesign/reference/init.md +0 -221
  82. package/.claude/skills/monodesign/reference/interaction-design.md +0 -189
  83. package/.claude/skills/monodesign/reference/ios.md +0 -45
  84. package/.claude/skills/monodesign/reference/layout.md +0 -185
  85. package/.claude/skills/monodesign/reference/live.md +0 -710
  86. package/.claude/skills/monodesign/reference/motion-design.md +0 -109
  87. package/.claude/skills/monodesign/reference/onboard.md +0 -234
  88. package/.claude/skills/monodesign/reference/optimize.md +0 -258
  89. package/.claude/skills/monodesign/reference/overdrive.md +0 -130
  90. package/.claude/skills/monodesign/reference/personas.md +0 -179
  91. package/.claude/skills/monodesign/reference/polish.md +0 -241
  92. package/.claude/skills/monodesign/reference/pre-delivery-checklist.md +0 -108
  93. package/.claude/skills/monodesign/reference/product.md +0 -60
  94. package/.claude/skills/monodesign/reference/quieter.md +0 -99
  95. package/.claude/skills/monodesign/reference/responsive-design.md +0 -114
  96. package/.claude/skills/monodesign/reference/shape.md +0 -165
  97. package/.claude/skills/monodesign/reference/spatial-design.md +0 -100
  98. package/.claude/skills/monodesign/reference/teach.md +0 -10
  99. package/.claude/skills/monodesign/reference/token-architecture.md +0 -222
  100. package/.claude/skills/monodesign/reference/typeset.md +0 -301
  101. package/.claude/skills/monodesign/reference/typography.md +0 -159
  102. package/.claude/skills/monodesign/reference/ux-research.md +0 -143
  103. package/.claude/skills/monodesign/reference/ux-rules.md +0 -211
  104. package/.claude/skills/monodesign/reference/ux-writing.md +0 -107
  105. package/.claude/skills/monodesign/scripts/command-metadata.json +0 -94
  106. package/.claude/skills/monodesign/scripts/context-signals.mjs +0 -260
  107. package/.claude/skills/monodesign/scripts/context.mjs +0 -1065
  108. package/.claude/skills/monodesign/scripts/critique-storage.mjs +0 -416
  109. package/.claude/skills/monodesign/scripts/detect-csp.mjs +0 -193
  110. package/.claude/skills/monodesign/scripts/detect.mjs +0 -33
  111. package/.claude/skills/monodesign/scripts/detector/browser/injected/index.mjs +0 -1960
  112. package/.claude/skills/monodesign/scripts/detector/cli/main.mjs +0 -321
  113. package/.claude/skills/monodesign/scripts/detector/design-system.mjs +0 -814
  114. package/.claude/skills/monodesign/scripts/detector/detect-antipatterns-browser.js +0 -5628
  115. package/.claude/skills/monodesign/scripts/detector/detect-antipatterns.mjs +0 -50
  116. package/.claude/skills/monodesign/scripts/detector/engines/browser/detect-url.mjs +0 -259
  117. package/.claude/skills/monodesign/scripts/detector/engines/browser/drivers.mjs +0 -339
  118. package/.claude/skills/monodesign/scripts/detector/engines/regex/detect-text.mjs +0 -636
  119. package/.claude/skills/monodesign/scripts/detector/engines/static-html/css-cascade.mjs +0 -1016
  120. package/.claude/skills/monodesign/scripts/detector/engines/static-html/detect-html.mjs +0 -253
  121. package/.claude/skills/monodesign/scripts/detector/engines/visual/screenshot-contrast.mjs +0 -198
  122. package/.claude/skills/monodesign/scripts/detector/findings.mjs +0 -12
  123. package/.claude/skills/monodesign/scripts/detector/fix/css-regions.mjs +0 -181
  124. package/.claude/skills/monodesign/scripts/detector/fix/fixers.mjs +0 -373
  125. package/.claude/skills/monodesign/scripts/detector/fix/index.mjs +0 -426
  126. package/.claude/skills/monodesign/scripts/detector/node/file-system.mjs +0 -198
  127. package/.claude/skills/monodesign/scripts/detector/profile/profiler.mjs +0 -166
  128. package/.claude/skills/monodesign/scripts/detector/registry/antipatterns.mjs +0 -563
  129. package/.claude/skills/monodesign/scripts/detector/rules/checks.mjs +0 -3024
  130. package/.claude/skills/monodesign/scripts/detector/shared/color.mjs +0 -124
  131. package/.claude/skills/monodesign/scripts/detector/shared/constants.mjs +0 -101
  132. package/.claude/skills/monodesign/scripts/detector/shared/fonts.mjs +0 -30
  133. package/.claude/skills/monodesign/scripts/detector/shared/inline-ignores.mjs +0 -148
  134. package/.claude/skills/monodesign/scripts/detector/shared/page.mjs +0 -7
  135. package/.claude/skills/monodesign/scripts/hook-admin.mjs +0 -694
  136. package/.claude/skills/monodesign/scripts/hook-before-edit.mjs +0 -516
  137. package/.claude/skills/monodesign/scripts/hook-lib.mjs +0 -1785
  138. package/.claude/skills/monodesign/scripts/hook.mjs +0 -61
  139. package/.claude/skills/monodesign/scripts/lib/design-parser.mjs +0 -809
  140. package/.claude/skills/monodesign/scripts/lib/is-generated.mjs +0 -69
  141. package/.claude/skills/monodesign/scripts/lib/monodesign-config.mjs +0 -640
  142. package/.claude/skills/monodesign/scripts/lib/monodesign-paths.mjs +0 -129
  143. package/.claude/skills/monodesign/scripts/lib/provider.mjs +0 -4
  144. package/.claude/skills/monodesign/scripts/lib/target-args.mjs +0 -42
  145. package/.claude/skills/monodesign/scripts/live/browser-script-parts.mjs +0 -50
  146. package/.claude/skills/monodesign/scripts/live/completion.mjs +0 -19
  147. package/.claude/skills/monodesign/scripts/live/event-validation.mjs +0 -137
  148. package/.claude/skills/monodesign/scripts/live/insert-ui.mjs +0 -458
  149. package/.claude/skills/monodesign/scripts/live/manual-apply.mjs +0 -939
  150. package/.claude/skills/monodesign/scripts/live/manual-edit-routes.mjs +0 -357
  151. package/.claude/skills/monodesign/scripts/live/manual-edits-buffer.mjs +0 -152
  152. package/.claude/skills/monodesign/scripts/live/session-store.mjs +0 -293
  153. package/.claude/skills/monodesign/scripts/live/svelte-component.mjs +0 -826
  154. package/.claude/skills/monodesign/scripts/live/sveltekit-adapter.mjs +0 -279
  155. package/.claude/skills/monodesign/scripts/live/ui-core.mjs +0 -180
  156. package/.claude/skills/monodesign/scripts/live/vocabulary.mjs +0 -36
  157. package/.claude/skills/monodesign/scripts/live-accept.mjs +0 -812
  158. package/.claude/skills/monodesign/scripts/live-browser-dom.js +0 -147
  159. package/.claude/skills/monodesign/scripts/live-browser-session.js +0 -124
  160. package/.claude/skills/monodesign/scripts/live-browser.js +0 -11213
  161. package/.claude/skills/monodesign/scripts/live-commit-manual-edits.mjs +0 -1241
  162. package/.claude/skills/monodesign/scripts/live-complete.mjs +0 -75
  163. package/.claude/skills/monodesign/scripts/live-copy-edit-agent.mjs +0 -683
  164. package/.claude/skills/monodesign/scripts/live-discard-manual-edits.mjs +0 -51
  165. package/.claude/skills/monodesign/scripts/live-inject.mjs +0 -596
  166. package/.claude/skills/monodesign/scripts/live-insert.mjs +0 -272
  167. package/.claude/skills/monodesign/scripts/live-manual-edit-evidence.mjs +0 -363
  168. package/.claude/skills/monodesign/scripts/live-poll.mjs +0 -384
  169. package/.claude/skills/monodesign/scripts/live-resume.mjs +0 -94
  170. package/.claude/skills/monodesign/scripts/live-server.mjs +0 -1210
  171. package/.claude/skills/monodesign/scripts/live-status.mjs +0 -61
  172. package/.claude/skills/monodesign/scripts/live-target.mjs +0 -30
  173. package/.claude/skills/monodesign/scripts/live-wrap.mjs +0 -884
  174. package/.claude/skills/monodesign/scripts/live.mjs +0 -297
  175. package/.claude/skills/monodesign/scripts/modern-screenshot.umd.js +0 -14
  176. package/.claude/skills/monodesign/scripts/palette.mjs +0 -635
  177. package/.claude/skills/monodesign/scripts/pin.mjs +0 -221
  178. package/.claude/skills/monodesign/shape.md +0 -71
  179. package/.claude/skills/monodesign/teach.md +0 -18
  180. package/.claude/skills/monodesign/typeset.md +0 -59
@@ -1,279 +0,0 @@
1
- /**
2
- * SvelteKit live-mode adapter.
3
- *
4
- * SvelteKit must not be patched through src/app.html. That file is a document
5
- * template, not framework-owned component chrome. The adapter keeps SvelteKit
6
- * work limited to mounting a dev-only shadow host from +layout.svelte; the
7
- * actual live UI remains the shared plain-DOM browser chrome.
8
- */
9
-
10
- import fs from 'node:fs';
11
- import path from 'node:path';
12
-
13
- export const SVELTE_LIVE_ROOT_COMPONENT = 'src/lib/monodesign/MonodesignLiveRoot.svelte';
14
- export const SVELTE_LAYOUT_MARKER_OPEN = '<!-- monodesign-live-svelte-start -->';
15
- export const SVELTE_LAYOUT_MARKER_CLOSE = '<!-- monodesign-live-svelte-end -->';
16
- export const SVELTE_ROOT_IMPORT = "import MonodesignLiveRoot from '$lib/monodesign/MonodesignLiveRoot.svelte';";
17
-
18
- export function detectSvelteKitProject(cwd = process.cwd(), config = null) {
19
- const appHtml = findSvelteKitAppHtml(cwd, config);
20
- if (!appHtml) return null;
21
- const hasTemplateMarkers = fileIncludes(path.join(cwd, appHtml), '%sveltekit.body%')
22
- && fileIncludes(path.join(cwd, appHtml), '%sveltekit.head%');
23
- if (!hasTemplateMarkers) return null;
24
-
25
- const hasSvelteConfig = fs.existsSync(path.join(cwd, 'svelte.config.js'))
26
- || fs.existsSync(path.join(cwd, 'svelte.config.mjs'))
27
- || fs.existsSync(path.join(cwd, 'svelte.config.cjs'))
28
- || fs.existsSync(path.join(cwd, 'svelte.config.ts'));
29
- const hasKitPackage = packageHasSvelteKit(cwd);
30
- if (!hasSvelteConfig && !hasKitPackage) return null;
31
-
32
- return {
33
- appHtml,
34
- layoutFile: findSvelteKitLayout(cwd),
35
- rootComponent: SVELTE_LIVE_ROOT_COMPONENT,
36
- };
37
- }
38
-
39
- export function applySvelteKitLiveAdapter({ cwd = process.cwd(), port, authCred, config = null } = {}) {
40
- if (!Number.isFinite(Number(port))) {
41
- throw new Error('SvelteKit live adapter requires a numeric port');
42
- }
43
- if (!authCred) {
44
- throw new Error('SvelteKit live adapter requires an auth credential');
45
- }
46
- const detected = detectSvelteKitProject(cwd, config);
47
- if (!detected) return null;
48
-
49
- ensureSvelteLiveRootComponent(cwd, Number(port), authCred);
50
-
51
- const layoutRel = detected.layoutFile;
52
- const layoutAbs = path.join(cwd, layoutRel);
53
- fs.mkdirSync(path.dirname(layoutAbs), { recursive: true });
54
- const layoutExisted = fs.existsSync(layoutAbs);
55
- const before = layoutExisted ? fs.readFileSync(layoutAbs, 'utf-8') : defaultSvelteLayout();
56
- const after = patchSvelteLayout(before);
57
- fs.writeFileSync(layoutAbs, after, 'utf-8');
58
-
59
- return {
60
- file: layoutRel,
61
- adapter: 'sveltekit',
62
- inserted: after !== before || !layoutExisted,
63
- appHtmlUntouched: true,
64
- rootComponent: SVELTE_LIVE_ROOT_COMPONENT,
65
- };
66
- }
67
-
68
- export function removeSvelteKitLiveAdapter({ cwd = process.cwd(), config = null } = {}) {
69
- const detected = detectSvelteKitProject(cwd, config);
70
- if (!detected) return null;
71
-
72
- const layoutAbs = path.join(cwd, detected.layoutFile);
73
- let removed = false;
74
- if (fs.existsSync(layoutAbs)) {
75
- const before = fs.readFileSync(layoutAbs, 'utf-8');
76
- const after = unpatchSvelteLayout(before);
77
- if (after !== before) {
78
- fs.writeFileSync(layoutAbs, after, 'utf-8');
79
- removed = true;
80
- }
81
- }
82
-
83
- const rootAbs = path.join(cwd, SVELTE_LIVE_ROOT_COMPONENT);
84
- if (fs.existsSync(rootAbs)) {
85
- fs.rmSync(rootAbs, { force: true });
86
- removed = true;
87
- }
88
-
89
- pruneEmptyDir(path.dirname(rootAbs), path.join(cwd, 'src'));
90
-
91
- return {
92
- file: detected.layoutFile,
93
- adapter: 'sveltekit',
94
- removed,
95
- appHtmlUntouched: true,
96
- rootComponent: SVELTE_LIVE_ROOT_COMPONENT,
97
- };
98
- }
99
-
100
- export function patchSvelteLayout(content) {
101
- let out = String(content || '');
102
- if (!out.includes(SVELTE_ROOT_IMPORT)) {
103
- const scriptMatch = out.match(/<script(?:\s[^>]*)?>/i);
104
- if (scriptMatch) {
105
- const insertAt = scriptMatch.index + scriptMatch[0].length;
106
- out = `${out.slice(0, insertAt)}\n ${SVELTE_ROOT_IMPORT}${out.slice(insertAt)}`;
107
- } else {
108
- out = `<script>\n ${SVELTE_ROOT_IMPORT}\n</script>\n\n${out}`;
109
- }
110
- }
111
-
112
- if (!out.includes(SVELTE_LAYOUT_MARKER_OPEN)) {
113
- const block = `${SVELTE_LAYOUT_MARKER_OPEN}\n<MonodesignLiveRoot />\n${SVELTE_LAYOUT_MARKER_CLOSE}\n`;
114
- const renderMatch = out.match(/\{@render\s+children(?:\?\.)?\(\)\s*\}/);
115
- const slotMatch = out.match(/<slot\s*\/?>/);
116
- const match = renderMatch || slotMatch;
117
- if (match) {
118
- out = out.slice(0, match.index) + block + out.slice(match.index);
119
- } else {
120
- out = out.replace(/\s*$/, `\n\n${block}`);
121
- }
122
- }
123
-
124
- return out;
125
- }
126
-
127
- export function unpatchSvelteLayout(content) {
128
- let out = String(content || '');
129
- const blockRe = new RegExp(
130
- '([ \\t]*)' + escapeRegExp(SVELTE_LAYOUT_MARKER_OPEN)
131
- + '\\n<MonodesignLiveRoot\\s*/>\\n'
132
- + escapeRegExp(SVELTE_LAYOUT_MARKER_CLOSE)
133
- + '\\n?',
134
- 'g',
135
- );
136
- out = out.replace(blockRe, '$1');
137
- out = out.replace(new RegExp(`^\\s*${escapeRegExp(SVELTE_ROOT_IMPORT)}\\s*\\n?`, 'gm'), '');
138
- out = out.replace(/<script>\s*<\/script>\s*\n?/g, '');
139
- return out.replace(/\n{3,}/g, '\n\n');
140
- }
141
-
142
- export function ensureSvelteLiveRootComponent(cwd, port, authCred) {
143
- const file = path.join(cwd, SVELTE_LIVE_ROOT_COMPONENT);
144
- fs.mkdirSync(path.dirname(file), { recursive: true });
145
- fs.writeFileSync(file, buildSvelteLiveRootComponent(port, authCred), 'utf-8');
146
- return file;
147
- }
148
-
149
- export function buildSvelteLiveRootComponent(port, authCred) {
150
- const authQuery = new URLSearchParams();
151
- authQuery.set('token', String(authCred ?? ''));
152
- return `<script>
153
- import { onMount } from 'svelte';
154
-
155
- const LIVE_URL = 'http://localhost:${Number(port)}/live.js?${authQuery.toString()}';
156
- const HOST_ID = 'monodesign-live-root';
157
-
158
- onMount(() => {
159
- let host = document.querySelector('monodesign-live-root#' + HOST_ID) || document.getElementById(HOST_ID);
160
- if (!host) {
161
- host = document.createElement('monodesign-live-root');
162
- host.id = HOST_ID;
163
- document.body.appendChild(host);
164
- }
165
-
166
- host.dataset.monodesignLiveAdapter = 'sveltekit';
167
- host.style.setProperty('all', 'initial', 'important');
168
- host.style.setProperty('display', 'block', 'important');
169
- host.style.setProperty('position', 'fixed', 'important');
170
- host.style.setProperty('top', '0', 'important');
171
- host.style.setProperty('left', '0', 'important');
172
- host.style.setProperty('width', '0', 'important');
173
- host.style.setProperty('height', '0', 'important');
174
- host.style.setProperty('overflow', 'visible', 'important');
175
- host.style.setProperty('z-index', '2147483000', 'important');
176
- host.style.setProperty('pointer-events', 'none', 'important');
177
-
178
- const root = host.shadowRoot || host.attachShadow({ mode: 'open' });
179
- if (!root.querySelector('style[data-monodesign-live-reset]')) {
180
- const reset = document.createElement('style');
181
- reset.dataset.monodesignLiveReset = 'true';
182
- reset.textContent = ':host, :host *, * { box-sizing: border-box; }';
183
- root.appendChild(reset);
184
- }
185
-
186
- window.__MONODESIGN_LIVE_ADAPTER__ = 'sveltekit';
187
- window.__MONODESIGN_LIVE_UI_ROOT__ = root;
188
- window.__MONODESIGN_LIVE_CHROME_MOUNT__ = {
189
- adapter: 'sveltekit',
190
- version: 1,
191
- host,
192
- root,
193
- };
194
-
195
- const script = document.createElement('script');
196
- script.src = LIVE_URL;
197
- script.async = true;
198
- script.dataset.monodesignLiveScript = 'true';
199
- document.head.appendChild(script);
200
-
201
- return () => {
202
- script.remove();
203
- if (window.__MONODESIGN_LIVE_UI_ROOT__ === root) delete window.__MONODESIGN_LIVE_UI_ROOT__;
204
- if (window.__MONODESIGN_LIVE_CHROME_MOUNT__?.root === root) delete window.__MONODESIGN_LIVE_CHROME_MOUNT__;
205
- if (window.__MONODESIGN_LIVE_ADAPTER__ === 'sveltekit') delete window.__MONODESIGN_LIVE_ADAPTER__;
206
- };
207
- });
208
- </script>
209
- `;
210
- }
211
-
212
- function findSvelteKitAppHtml(cwd, config) {
213
- const files = Array.isArray(config?.files) ? config.files : ['src/app.html'];
214
- for (const rel of files) {
215
- if (rel.includes('*')) continue;
216
- const normalized = rel.split(path.sep).join('/');
217
- if (!normalized.endsWith('app.html')) continue;
218
- const abs = path.join(cwd, normalized);
219
- if (fs.existsSync(abs)) return normalized;
220
- }
221
- const fallback = 'src/app.html';
222
- return fs.existsSync(path.join(cwd, fallback)) ? fallback : null;
223
- }
224
-
225
- function findSvelteKitLayout(cwd) {
226
- const candidates = [
227
- 'src/routes/+layout.svelte',
228
- 'src/routes/(app)/+layout.svelte',
229
- ];
230
- for (const rel of candidates) {
231
- if (fs.existsSync(path.join(cwd, rel))) return rel;
232
- }
233
- return 'src/routes/+layout.svelte';
234
- }
235
-
236
- function defaultSvelteLayout() {
237
- return `<script>\n let { children } = $props();\n</script>\n\n{@render children?.()}\n`;
238
- }
239
-
240
- function packageHasSvelteKit(cwd) {
241
- const file = path.join(cwd, 'package.json');
242
- if (!fs.existsSync(file)) return false;
243
- try {
244
- const pkg = JSON.parse(fs.readFileSync(file, 'utf-8'));
245
- const deps = {
246
- ...(pkg.dependencies || {}),
247
- ...(pkg.devDependencies || {}),
248
- ...(pkg.peerDependencies || {}),
249
- };
250
- return Boolean(deps['@sveltejs/kit'] || deps['@sveltejs/vite-plugin-svelte'] || deps.svelte);
251
- } catch {
252
- return false;
253
- }
254
- }
255
-
256
- function fileIncludes(file, text) {
257
- try {
258
- return fs.readFileSync(file, 'utf-8').includes(text);
259
- } catch {
260
- return false;
261
- }
262
- }
263
-
264
- function pruneEmptyDir(dir, stopDir) {
265
- let current = dir;
266
- while (current.startsWith(stopDir) && current !== stopDir) {
267
- try {
268
- if (fs.readdirSync(current).length > 0) return;
269
- fs.rmdirSync(current);
270
- current = path.dirname(current);
271
- } catch {
272
- return;
273
- }
274
- }
275
- }
276
-
277
- function escapeRegExp(value) {
278
- return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
279
- }
@@ -1,180 +0,0 @@
1
- /**
2
- * Framework-neutral Monodesign live chrome contract.
3
- *
4
- * The production browser bundle is intentionally plain DOM so Svelte, React,
5
- * Vue, and static adapters can all mount the same chrome. This module is the
6
- * testable contract/inventory for that bundle; live-browser.js mirrors these
7
- * values at runtime because it is served as a standalone script.
8
- */
9
-
10
- export const LIVE_CHROME_MOUNT_CONTRACT = Object.freeze([
11
- 'root',
12
- 'transport',
13
- 'state',
14
- 'actions',
15
- ]);
16
-
17
- export const LIVE_UI_SURFACES = Object.freeze([
18
- {
19
- key: 'global-bottom-bar',
20
- ids: [
21
- 'monodesign-live-global-bar',
22
- 'monodesign-live-global-bar-brand',
23
- 'monodesign-live-pick-toggle',
24
- 'monodesign-live-insert-toggle',
25
- 'monodesign-live-detect-toggle',
26
- 'monodesign-live-detect-badge',
27
- 'monodesign-live-design-toggle',
28
- 'monodesign-live-page-chat',
29
- 'monodesign-live-page-chat-input',
30
- 'monodesign-live-page-chat-voice',
31
- ],
32
- states: ['rest', 'hover', 'focus-visible', 'pressed', 'active', 'tooltip'],
33
- },
34
- {
35
- key: 'pending-copy-edit-dock',
36
- ids: ['monodesign-live-pending-dock'],
37
- states: ['closed', 'open', 'hover', 'pressed', 'loading', 'rollback', 'keep-fixing'],
38
- },
39
- {
40
- key: 'element-selection-chrome',
41
- ids: [
42
- 'monodesign-live-highlight',
43
- 'monodesign-live-tooltip',
44
- 'monodesign-live-bar',
45
- 'monodesign-live-selection-pill',
46
- 'monodesign-live-input',
47
- 'monodesign-live-configure-voice',
48
- 'monodesign-live-configure-bar-tooltip',
49
- ],
50
- states: ['rest', 'hover', 'focus-visible', 'pressed', 'disabled'],
51
- },
52
- {
53
- key: 'action-picker',
54
- ids: ['monodesign-live-picker'],
55
- states: ['closed', 'open', 'option-hover', 'option-focus'],
56
- },
57
- {
58
- key: 'edit-chrome',
59
- ids: ['monodesign-live-edit-badge'],
60
- states: ['enabled', 'disabled', 'editing', 'cancel', 'save', 'edited-content'],
61
- },
62
- {
63
- key: 'generating-row',
64
- ids: ['monodesign-live-bar', 'monodesign-live-shader'],
65
- states: ['action-label', 'animated-dots', 'generating', 'done'],
66
- },
67
- {
68
- key: 'variant-cycling-row',
69
- ids: ['monodesign-live-bar', 'monodesign-live-params-panel'],
70
- states: ['variant-1', 'variant-2', 'variant-3', 'left-disabled', 'right-disabled', 'dot-click', 'accept', 'discard'],
71
- },
72
- {
73
- key: 'variant-params-panel',
74
- ids: ['monodesign-live-params-panel'],
75
- states: ['closed', 'open-above', 'open-below', 'range', 'steps', 'toggle'],
76
- },
77
- {
78
- key: 'saving-confirmed-rows',
79
- ids: ['monodesign-live-bar'],
80
- states: ['saving', 'applying-variant', 'confirmed'],
81
- },
82
- {
83
- key: 'insert-mode-chrome',
84
- ids: [
85
- 'monodesign-live-insert-line',
86
- 'monodesign-live-insert-placeholder',
87
- 'monodesign-live-placeholder-resize',
88
- 'monodesign-live-insert-input',
89
- 'monodesign-live-insert-voice',
90
- 'monodesign-live-insert-create',
91
- 'monodesign-live-insert-create-tooltip',
92
- ],
93
- states: ['toggle-active', 'line', 'placeholder', 'resize', 'enabled', 'disabled', 'tooltip'],
94
- },
95
- {
96
- key: 'annotation-chrome',
97
- ids: [
98
- 'monodesign-live-annot',
99
- 'monodesign-live-annot-svg',
100
- 'monodesign-live-annot-pins',
101
- 'monodesign-live-annot-clear',
102
- ],
103
- states: ['overlay', 'drawing', 'pin', 'pin-edit', 'clear'],
104
- },
105
- {
106
- key: 'design-system-panel',
107
- ids: ['monodesign-live-design-host'],
108
- states: ['closed', 'open', 'tabs', 'token-tiles', 'copy'],
109
- },
110
- {
111
- key: 'toasts-and-errors',
112
- ids: ['monodesign-live-toast'],
113
- states: ['normal', 'error', 'no-variants-mounted'],
114
- },
115
- {
116
- key: 'css-isolation-boundary',
117
- ids: ['monodesign-live-root'],
118
- states: ['shadow-root', 'style-tags', 'hostile-css'],
119
- },
120
- ]);
121
-
122
- export const LIVE_UI_COMPONENT_IDS = Object.freeze([
123
- ...new Set(LIVE_UI_SURFACES.flatMap((surface) => surface.ids)),
124
- ]);
125
-
126
- export function resolveLiveUiRoot(env = globalThis) {
127
- const doc = env?.document;
128
- const explicit = env?.__MONODESIGN_LIVE_UI_ROOT__
129
- || env?.window?.__MONODESIGN_LIVE_UI_ROOT__;
130
- if (explicit && typeof explicit.appendChild === 'function') return explicit;
131
- return doc?.body || null;
132
- }
133
-
134
- export function getLiveUiElementById(id, env = globalThis) {
135
- const doc = env?.document;
136
- const root = resolveLiveUiRoot(env);
137
- if (!id) return null;
138
- if (root?.getElementById) {
139
- const found = root.getElementById(id);
140
- if (found) return found;
141
- }
142
- if (root?.querySelector) {
143
- const found = root.querySelector(`#${escapeCssIdent(id)}`);
144
- if (found) return found;
145
- }
146
- return doc?.getElementById?.(id) || null;
147
- }
148
-
149
- export function appendToLiveUiRoot(el, env = globalThis) {
150
- const root = resolveLiveUiRoot(env);
151
- if (!root) throw new Error('Monodesign live UI root is not available');
152
- root.appendChild(el);
153
- return el;
154
- }
155
-
156
- export function appendStyleToLiveUiRoot(styleEl, env = globalThis) {
157
- const doc = env?.document;
158
- const root = resolveLiveUiRoot(env);
159
- if (root && root !== doc?.body) {
160
- root.appendChild(styleEl);
161
- } else {
162
- (doc?.head || doc?.body || root).appendChild(styleEl);
163
- }
164
- return styleEl;
165
- }
166
-
167
- export function activeElementDeep(doc = globalThis.document) {
168
- let active = doc?.activeElement || null;
169
- while (active?.shadowRoot?.activeElement) {
170
- active = active.shadowRoot.activeElement;
171
- }
172
- return active;
173
- }
174
-
175
- function escapeCssIdent(value) {
176
- if (typeof CSS !== 'undefined' && typeof CSS.escape === 'function') {
177
- return CSS.escape(String(value));
178
- }
179
- return String(value).replace(/([ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, '\\$1');
180
- }
@@ -1,36 +0,0 @@
1
- /**
2
- * Canonical design-command vocabulary for Live Mode: each command's value, human
3
- * label, and SVG icon. Icons stack above the chip label; strokes use currentColor
4
- * so the icon recolors when its chip is selected.
5
- *
6
- * Single source of truth, consumed by:
7
- * - skill/scripts/live/event-validation.mjs — re-exports VISUAL_ACTIONS.
8
- * - skill/scripts/live-browser.js — the real picker. It is served raw and
9
- * injected as an IIFE, so it cannot import this at runtime; live-server.mjs
10
- * serializes LIVE_COMMANDS into window.__MONODESIGN_VOCAB__ alongside the
11
- * token/port, and live-browser.js builds its ICONS + ACTIONS from that.
12
- * - site/components/LiveDemoPalette.astro — the marketing demo palette (imported
13
- * at build time).
14
- *
15
- * Add, rename, or reorder a verb here and all three follow.
16
- */
17
-
18
- const ICON_ATTRS = 'width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" style="display:block"';
19
-
20
- export const LIVE_COMMANDS = [
21
- { value: 'monodesign', label: 'Freeform', icon: `<svg ${ICON_ATTRS}><path d="M4 20l4-1L18 9l-3-3L5 16z"/><path d="M14 7l3 3"/></svg>` },
22
- { value: 'bolder', label: 'Bolder', icon: `<svg ${ICON_ATTRS}><rect x="6" y="12" width="4" height="7" rx="0.5"/><rect x="14" y="5" width="4" height="14" rx="0.5"/></svg>` },
23
- { value: 'quieter', label: 'Quieter', icon: `<svg ${ICON_ATTRS}><rect x="6" y="5" width="4" height="14" rx="0.5"/><rect x="14" y="12" width="4" height="7" rx="0.5"/></svg>` },
24
- { value: 'distill', label: 'Distill', icon: `<svg ${ICON_ATTRS}><path d="M4 5h16l-6 8v7l-4-2v-5z"/></svg>` },
25
- { value: 'polish', label: 'Polish', icon: `<svg ${ICON_ATTRS}><path d="M15 3l1 3 3 1-3 1-1 3-1-3-3-1 3-1z"/><path d="M7 13l0.6 1.8 1.8 0.6-1.8 0.6-0.6 1.8-0.6-1.8-1.8-0.6 1.8-0.6z"/></svg>` },
26
- { value: 'typeset', label: 'Typeset', icon: `<svg ${ICON_ATTRS}><path d="M5 6h14" stroke-width="2.6"/><path d="M5 12h9" stroke-width="1.9"/><path d="M5 18h5" stroke-width="1.3"/></svg>` },
27
- { value: 'colorize', label: 'Colorize', icon: `<svg ${ICON_ATTRS}><circle cx="9" cy="10" r="5"/><circle cx="15" cy="10" r="5"/><circle cx="12" cy="15" r="5"/></svg>` },
28
- { value: 'layout', label: 'Layout', icon: `<svg ${ICON_ATTRS}><rect x="3" y="4" width="8" height="16" rx="0.5"/><rect x="13" y="4" width="8" height="7" rx="0.5"/><rect x="13" y="13" width="8" height="7" rx="0.5"/></svg>` },
29
- { value: 'adapt', label: 'Adapt', icon: `<svg ${ICON_ATTRS}><rect x="2.5" y="5" width="12" height="11" rx="1"/><line x1="2.5" y1="19" x2="14.5" y2="19"/><rect x="16.5" y="8" width="5" height="11" rx="1"/></svg>` },
30
- { value: 'animate', label: 'Animate', icon: `<svg ${ICON_ATTRS}><path d="M3 18c4-4 6-10 10-10"/><path d="M13 8c3 0 5 5 8 10"/><circle cx="13" cy="8" r="1.6" fill="currentColor" stroke="none"/></svg>` },
31
- { value: 'delight', label: 'Delight', icon: `<svg ${ICON_ATTRS}><path d="M12 3l2 6 6 2-6 2-2 6-2-6-6-2 6-2z"/></svg>` },
32
- { value: 'overdrive', label: 'Overdrive', icon: `<svg ${ICON_ATTRS}><path d="M13 3L5 13h5l-1 8 9-12h-6z"/></svg>` },
33
- ];
34
-
35
- // Action values accepted by the live event protocol, in palette order.
36
- export const VISUAL_ACTIONS = LIVE_COMMANDS.map((c) => c.value);