@12ui/design 0.2.75 → 0.2.77

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 (447) hide show
  1. package/README.md +126 -116
  2. package/SKILL.md +33 -28
  3. package/dist/cli-arguments.d.ts.map +1 -1
  4. package/dist/cli-arguments.js +21 -7
  5. package/dist/cli-arguments.js.map +1 -1
  6. package/dist/cli-capabilities.d.ts +3 -2
  7. package/dist/cli-capabilities.d.ts.map +1 -1
  8. package/dist/cli-capabilities.js +2 -1
  9. package/dist/cli-capabilities.js.map +1 -1
  10. package/dist/cli-codex-readiness.d.ts +6 -0
  11. package/dist/cli-codex-readiness.d.ts.map +1 -1
  12. package/dist/cli-codex-readiness.js +12 -12
  13. package/dist/cli-codex-readiness.js.map +1 -1
  14. package/dist/cli-help/design.d.ts +2 -2
  15. package/dist/cli-help/design.d.ts.map +1 -1
  16. package/dist/cli-help/design.js +3 -1
  17. package/dist/cli-help/design.js.map +1 -1
  18. package/dist/cli-help/index.d.ts +19 -9
  19. package/dist/cli-help/index.d.ts.map +1 -1
  20. package/dist/cli-help/scene.d.ts +15 -5
  21. package/dist/cli-help/scene.d.ts.map +1 -1
  22. package/dist/cli-help/scene.js +44 -0
  23. package/dist/cli-help/scene.js.map +1 -1
  24. package/dist/cli-help/workflow.d.ts +2 -2
  25. package/dist/cli-help/workflow.d.ts.map +1 -1
  26. package/dist/cli-help/workflow.js +4 -3
  27. package/dist/cli-help/workflow.js.map +1 -1
  28. package/dist/cli-review-command.d.ts.map +1 -1
  29. package/dist/cli-review-command.js +2 -0
  30. package/dist/cli-review-command.js.map +1 -1
  31. package/dist/cli-run.d.ts.map +1 -1
  32. package/dist/cli-run.js +6 -0
  33. package/dist/cli-run.js.map +1 -1
  34. package/dist/cli-scene-command.d.ts.map +1 -1
  35. package/dist/cli-scene-command.js +39 -6
  36. package/dist/cli-scene-command.js.map +1 -1
  37. package/dist/cli-usage.d.ts.map +1 -1
  38. package/dist/cli-usage.js +8 -6
  39. package/dist/cli-usage.js.map +1 -1
  40. package/dist/cli-workspace-draw.d.ts +1 -11
  41. package/dist/cli-workspace-draw.d.ts.map +1 -1
  42. package/dist/cli-workspace-draw.js +17 -18
  43. package/dist/cli-workspace-draw.js.map +1 -1
  44. package/dist/cli-workspace-runner.d.ts +30 -0
  45. package/dist/cli-workspace-runner.d.ts.map +1 -0
  46. package/dist/cli-workspace-runner.js +105 -0
  47. package/dist/cli-workspace-runner.js.map +1 -0
  48. package/dist/legacy-skill-catalog.d.ts.map +1 -1
  49. package/dist/legacy-skill-catalog.js +26 -2
  50. package/dist/legacy-skill-catalog.js.map +1 -1
  51. package/dist/mcp-slate-command.d.ts +9 -0
  52. package/dist/mcp-slate-command.d.ts.map +1 -1
  53. package/dist/mcp-slate-command.js +19 -5
  54. package/dist/mcp-slate-command.js.map +1 -1
  55. package/dist/mcp-slate-image.js +1 -1
  56. package/dist/mcp-slate-image.js.map +1 -1
  57. package/dist/mcp-slate-tool-defs.js +1 -1
  58. package/dist/mcp-slate-tool-defs.js.map +1 -1
  59. package/dist/mcp-slate-ui-copy.d.ts +403 -33
  60. package/dist/mcp-slate-ui-copy.d.ts.map +1 -1
  61. package/dist/mcp-slate-ui-copy.js +247 -57
  62. package/dist/mcp-slate-ui-copy.js.map +1 -1
  63. package/dist/mcp-slate-ui-icu.d.ts +47 -0
  64. package/dist/mcp-slate-ui-icu.d.ts.map +1 -0
  65. package/dist/mcp-slate-ui-icu.js +229 -0
  66. package/dist/mcp-slate-ui-icu.js.map +1 -0
  67. package/dist/mcp-slate-ui-locale-match.d.ts +12 -0
  68. package/dist/mcp-slate-ui-locale-match.d.ts.map +1 -0
  69. package/dist/mcp-slate-ui-locale-match.js +34 -0
  70. package/dist/mcp-slate-ui-locale-match.js.map +1 -0
  71. package/dist/mcp-slate-ui-locales/de-DE.d.ts +9 -0
  72. package/dist/mcp-slate-ui-locales/de-DE.d.ts.map +1 -0
  73. package/dist/mcp-slate-ui-locales/de-DE.js +217 -0
  74. package/dist/mcp-slate-ui-locales/de-DE.js.map +1 -0
  75. package/dist/mcp-slate-ui-locales/es-419.d.ts +9 -0
  76. package/dist/mcp-slate-ui-locales/es-419.d.ts.map +1 -0
  77. package/dist/mcp-slate-ui-locales/es-419.js +217 -0
  78. package/dist/mcp-slate-ui-locales/es-419.js.map +1 -0
  79. package/dist/mcp-slate-ui-locales/es-ES.d.ts +9 -0
  80. package/dist/mcp-slate-ui-locales/es-ES.d.ts.map +1 -0
  81. package/dist/mcp-slate-ui-locales/es-ES.js +217 -0
  82. package/dist/mcp-slate-ui-locales/es-ES.js.map +1 -0
  83. package/dist/mcp-slate-ui-locales/fr-FR.d.ts +9 -0
  84. package/dist/mcp-slate-ui-locales/fr-FR.d.ts.map +1 -0
  85. package/dist/mcp-slate-ui-locales/fr-FR.js +217 -0
  86. package/dist/mcp-slate-ui-locales/fr-FR.js.map +1 -0
  87. package/dist/mcp-slate-ui-locales/hi-IN.d.ts +9 -0
  88. package/dist/mcp-slate-ui-locales/hi-IN.d.ts.map +1 -0
  89. package/dist/mcp-slate-ui-locales/hi-IN.js +217 -0
  90. package/dist/mcp-slate-ui-locales/hi-IN.js.map +1 -0
  91. package/dist/mcp-slate-ui-locales/index.d.ts +11 -0
  92. package/dist/mcp-slate-ui-locales/index.d.ts.map +1 -0
  93. package/dist/mcp-slate-ui-locales/index.js +34 -0
  94. package/dist/mcp-slate-ui-locales/index.js.map +1 -0
  95. package/dist/mcp-slate-ui-locales/it-IT.d.ts +9 -0
  96. package/dist/mcp-slate-ui-locales/it-IT.d.ts.map +1 -0
  97. package/dist/mcp-slate-ui-locales/it-IT.js +217 -0
  98. package/dist/mcp-slate-ui-locales/it-IT.js.map +1 -0
  99. package/dist/mcp-slate-ui-locales/ja-JP.d.ts +9 -0
  100. package/dist/mcp-slate-ui-locales/ja-JP.d.ts.map +1 -0
  101. package/dist/mcp-slate-ui-locales/ja-JP.js +217 -0
  102. package/dist/mcp-slate-ui-locales/ja-JP.js.map +1 -0
  103. package/dist/mcp-slate-ui-locales/ko-KR.d.ts +9 -0
  104. package/dist/mcp-slate-ui-locales/ko-KR.d.ts.map +1 -0
  105. package/dist/mcp-slate-ui-locales/ko-KR.js +217 -0
  106. package/dist/mcp-slate-ui-locales/ko-KR.js.map +1 -0
  107. package/dist/mcp-slate-ui-locales/pt-BR.d.ts +9 -0
  108. package/dist/mcp-slate-ui-locales/pt-BR.d.ts.map +1 -0
  109. package/dist/mcp-slate-ui-locales/pt-BR.js +217 -0
  110. package/dist/mcp-slate-ui-locales/pt-BR.js.map +1 -0
  111. package/dist/mcp-slate-ui-locales/zh-CN.d.ts +9 -0
  112. package/dist/mcp-slate-ui-locales/zh-CN.d.ts.map +1 -0
  113. package/dist/mcp-slate-ui-locales/zh-CN.js +217 -0
  114. package/dist/mcp-slate-ui-locales/zh-CN.js.map +1 -0
  115. package/dist/mcp-slate-ui-locales/zh-TW.d.ts +9 -0
  116. package/dist/mcp-slate-ui-locales/zh-TW.d.ts.map +1 -0
  117. package/dist/mcp-slate-ui-locales/zh-TW.js +217 -0
  118. package/dist/mcp-slate-ui-locales/zh-TW.js.map +1 -0
  119. package/dist/mcp-slate-ui-script-bridge.d.ts.map +1 -1
  120. package/dist/mcp-slate-ui-script-bridge.js +8 -9
  121. package/dist/mcp-slate-ui-script-bridge.js.map +1 -1
  122. package/dist/mcp-slate-ui-script-dialog.d.ts.map +1 -1
  123. package/dist/mcp-slate-ui-script-dialog.js +60 -30
  124. package/dist/mcp-slate-ui-script-dialog.js.map +1 -1
  125. package/dist/mcp-slate-ui-script-inline.d.ts +9 -6
  126. package/dist/mcp-slate-ui-script-inline.d.ts.map +1 -1
  127. package/dist/mcp-slate-ui-script-inline.js +91 -46
  128. package/dist/mcp-slate-ui-script-inline.js.map +1 -1
  129. package/dist/mcp-slate-ui-script-inspiration-collage.d.ts +20 -0
  130. package/dist/mcp-slate-ui-script-inspiration-collage.d.ts.map +1 -0
  131. package/dist/mcp-slate-ui-script-inspiration-collage.js +68 -0
  132. package/dist/mcp-slate-ui-script-inspiration-collage.js.map +1 -0
  133. package/dist/mcp-slate-ui-script-inspiration-grid.d.ts +26 -0
  134. package/dist/mcp-slate-ui-script-inspiration-grid.d.ts.map +1 -0
  135. package/dist/mcp-slate-ui-script-inspiration-grid.js +246 -0
  136. package/dist/mcp-slate-ui-script-inspiration-grid.js.map +1 -0
  137. package/dist/mcp-slate-ui-script-inspiration.d.ts +10 -9
  138. package/dist/mcp-slate-ui-script-inspiration.d.ts.map +1 -1
  139. package/dist/mcp-slate-ui-script-inspiration.js +161 -120
  140. package/dist/mcp-slate-ui-script-inspiration.js.map +1 -1
  141. package/dist/mcp-slate-ui-script-l10n.d.ts +29 -0
  142. package/dist/mcp-slate-ui-script-l10n.d.ts.map +1 -0
  143. package/dist/mcp-slate-ui-script-l10n.js +135 -0
  144. package/dist/mcp-slate-ui-script-l10n.js.map +1 -0
  145. package/dist/mcp-slate-ui-script-more.d.ts +3 -2
  146. package/dist/mcp-slate-ui-script-more.d.ts.map +1 -1
  147. package/dist/mcp-slate-ui-script-more.js +19 -18
  148. package/dist/mcp-slate-ui-script-more.js.map +1 -1
  149. package/dist/mcp-slate-ui-script-pause.d.ts +33 -0
  150. package/dist/mcp-slate-ui-script-pause.d.ts.map +1 -0
  151. package/dist/mcp-slate-ui-script-pause.js +217 -0
  152. package/dist/mcp-slate-ui-script-pause.js.map +1 -0
  153. package/dist/mcp-slate-ui-script-remote.d.ts +2 -0
  154. package/dist/mcp-slate-ui-script-remote.d.ts.map +1 -1
  155. package/dist/mcp-slate-ui-script-remote.js +39 -6
  156. package/dist/mcp-slate-ui-script-remote.js.map +1 -1
  157. package/dist/mcp-slate-ui-script-scribble.js +1 -1
  158. package/dist/mcp-slate-ui-script-select.js +6 -6
  159. package/dist/mcp-slate-ui-script-stage.d.ts +3 -2
  160. package/dist/mcp-slate-ui-script-stage.d.ts.map +1 -1
  161. package/dist/mcp-slate-ui-script-stage.js +31 -19
  162. package/dist/mcp-slate-ui-script-stage.js.map +1 -1
  163. package/dist/mcp-slate-ui-script-state.d.ts.map +1 -1
  164. package/dist/mcp-slate-ui-script-state.js +77 -57
  165. package/dist/mcp-slate-ui-script-state.js.map +1 -1
  166. package/dist/mcp-slate-ui-script.d.ts +2 -2
  167. package/dist/mcp-slate-ui-script.d.ts.map +1 -1
  168. package/dist/mcp-slate-ui-script.js +21 -7
  169. package/dist/mcp-slate-ui-script.js.map +1 -1
  170. package/dist/mcp-slate-ui-styles-dialog.d.ts +6 -7
  171. package/dist/mcp-slate-ui-styles-dialog.d.ts.map +1 -1
  172. package/dist/mcp-slate-ui-styles-dialog.js +13 -29
  173. package/dist/mcp-slate-ui-styles-dialog.js.map +1 -1
  174. package/dist/mcp-slate-ui-styles-inspiration.d.ts +18 -0
  175. package/dist/mcp-slate-ui-styles-inspiration.d.ts.map +1 -0
  176. package/dist/mcp-slate-ui-styles-inspiration.js +43 -0
  177. package/dist/mcp-slate-ui-styles-inspiration.js.map +1 -0
  178. package/dist/mcp-slate-ui-styles-pause.d.ts +10 -0
  179. package/dist/mcp-slate-ui-styles-pause.d.ts.map +1 -0
  180. package/dist/mcp-slate-ui-styles-pause.js +25 -0
  181. package/dist/mcp-slate-ui-styles-pause.js.map +1 -0
  182. package/dist/mcp-slate-ui-styles-stage.d.ts +10 -6
  183. package/dist/mcp-slate-ui-styles-stage.d.ts.map +1 -1
  184. package/dist/mcp-slate-ui-styles-stage.js +24 -16
  185. package/dist/mcp-slate-ui-styles-stage.js.map +1 -1
  186. package/dist/mcp-slate-ui-styles.d.ts +12 -5
  187. package/dist/mcp-slate-ui-styles.d.ts.map +1 -1
  188. package/dist/mcp-slate-ui-styles.js +38 -21
  189. package/dist/mcp-slate-ui-styles.js.map +1 -1
  190. package/dist/mcp-slate-ui.d.ts +11 -3
  191. package/dist/mcp-slate-ui.d.ts.map +1 -1
  192. package/dist/mcp-slate-ui.js +24 -16
  193. package/dist/mcp-slate-ui.js.map +1 -1
  194. package/dist/mcp-workflow-tools.js +3 -3
  195. package/dist/mcp-workflow-tools.js.map +1 -1
  196. package/dist/mosaic-bands.d.ts +44 -0
  197. package/dist/mosaic-bands.d.ts.map +1 -0
  198. package/dist/mosaic-bands.js +153 -0
  199. package/dist/mosaic-bands.js.map +1 -0
  200. package/dist/review-discovery.d.ts.map +1 -1
  201. package/dist/review-discovery.js +36 -54
  202. package/dist/review-discovery.js.map +1 -1
  203. package/dist/review-page.d.ts.map +1 -1
  204. package/dist/review-page.js +2 -1
  205. package/dist/review-page.js.map +1 -1
  206. package/dist/review-run-roots.d.ts +40 -0
  207. package/dist/review-run-roots.d.ts.map +1 -0
  208. package/dist/review-run-roots.js +94 -0
  209. package/dist/review-run-roots.js.map +1 -0
  210. package/dist/review-server.d.ts +2 -0
  211. package/dist/review-server.d.ts.map +1 -1
  212. package/dist/review-server.js +2 -0
  213. package/dist/review-server.js.map +1 -1
  214. package/dist/review-types.d.ts +10 -0
  215. package/dist/review-types.d.ts.map +1 -1
  216. package/dist/scene/camera-diagnostics.d.ts +61 -0
  217. package/dist/scene/camera-diagnostics.d.ts.map +1 -0
  218. package/dist/scene/camera-diagnostics.js +166 -0
  219. package/dist/scene/camera-diagnostics.js.map +1 -0
  220. package/dist/scene/camera-solve.d.ts +2 -0
  221. package/dist/scene/camera-solve.d.ts.map +1 -1
  222. package/dist/scene/camera-solve.js +59 -42
  223. package/dist/scene/camera-solve.js.map +1 -1
  224. package/dist/scene/capture.d.ts +24 -0
  225. package/dist/scene/capture.d.ts.map +1 -1
  226. package/dist/scene/capture.js +53 -2
  227. package/dist/scene/capture.js.map +1 -1
  228. package/dist/scene/convert-run.d.ts +30 -0
  229. package/dist/scene/convert-run.d.ts.map +1 -0
  230. package/dist/scene/convert-run.js +135 -0
  231. package/dist/scene/convert-run.js.map +1 -0
  232. package/dist/scene/media-query.d.ts +21 -0
  233. package/dist/scene/media-query.d.ts.map +1 -0
  234. package/dist/scene/media-query.js +208 -0
  235. package/dist/scene/media-query.js.map +1 -0
  236. package/dist/scene/page-css.d.ts +38 -0
  237. package/dist/scene/page-css.d.ts.map +1 -0
  238. package/dist/scene/page-css.js +210 -0
  239. package/dist/scene/page-css.js.map +1 -0
  240. package/dist/scene/page-images.d.ts +33 -0
  241. package/dist/scene/page-images.d.ts.map +1 -0
  242. package/dist/scene/page-images.js +53 -0
  243. package/dist/scene/page-images.js.map +1 -0
  244. package/dist/scene/page-merge.d.ts +41 -0
  245. package/dist/scene/page-merge.d.ts.map +1 -0
  246. package/dist/scene/page-merge.js +197 -0
  247. package/dist/scene/page-merge.js.map +1 -0
  248. package/dist/scene/responsive-bands.d.ts +19 -0
  249. package/dist/scene/responsive-bands.d.ts.map +1 -0
  250. package/dist/scene/responsive-bands.js +25 -0
  251. package/dist/scene/responsive-bands.js.map +1 -0
  252. package/dist/scene/scene-index.d.ts +10 -0
  253. package/dist/scene/scene-index.d.ts.map +1 -0
  254. package/dist/scene/scene-index.js +43 -0
  255. package/dist/scene/scene-index.js.map +1 -0
  256. package/dist/scene/scene-merge.d.ts +29 -0
  257. package/dist/scene/scene-merge.d.ts.map +1 -0
  258. package/dist/scene/scene-merge.js +130 -0
  259. package/dist/scene/scene-merge.js.map +1 -0
  260. package/dist/scene/scene-verbs.d.ts +1 -1
  261. package/dist/scene/scene-verbs.d.ts.map +1 -1
  262. package/dist/scene/scene-verbs.js +1 -1
  263. package/dist/scene/scene-verbs.js.map +1 -1
  264. package/dist/scene/serve-detach.d.ts +23 -0
  265. package/dist/scene/serve-detach.d.ts.map +1 -0
  266. package/dist/scene/serve-detach.js +92 -0
  267. package/dist/scene/serve-detach.js.map +1 -0
  268. package/dist/scene/static-server.d.ts +2 -0
  269. package/dist/scene/static-server.d.ts.map +1 -1
  270. package/dist/scene/static-server.js +3 -0
  271. package/dist/scene/static-server.js.map +1 -1
  272. package/dist/scene/symmetric-eigen.d.ts +12 -0
  273. package/dist/scene/symmetric-eigen.d.ts.map +1 -0
  274. package/dist/scene/symmetric-eigen.js +43 -0
  275. package/dist/scene/symmetric-eigen.js.map +1 -0
  276. package/dist/slate-actions.d.ts +3 -3
  277. package/dist/slate-actions.d.ts.map +1 -1
  278. package/dist/slate-actions.js +9 -8
  279. package/dist/slate-actions.js.map +1 -1
  280. package/dist/slate-browser-host-script.d.ts +4 -0
  281. package/dist/slate-browser-host-script.d.ts.map +1 -1
  282. package/dist/slate-browser-host-script.js +25 -6
  283. package/dist/slate-browser-host-script.js.map +1 -1
  284. package/dist/slate-browser-host.d.ts +2 -1
  285. package/dist/slate-browser-host.d.ts.map +1 -1
  286. package/dist/slate-browser-host.js +18 -5
  287. package/dist/slate-browser-host.js.map +1 -1
  288. package/dist/slate-commit.js +7 -7
  289. package/dist/slate-commit.js.map +1 -1
  290. package/dist/slate-corpus.d.ts.map +1 -1
  291. package/dist/slate-corpus.js +3 -2
  292. package/dist/slate-corpus.js.map +1 -1
  293. package/dist/slate-edit-runner.d.ts.map +1 -1
  294. package/dist/slate-edit-runner.js +5 -4
  295. package/dist/slate-edit-runner.js.map +1 -1
  296. package/dist/slate-editability.d.ts +2 -0
  297. package/dist/slate-editability.d.ts.map +1 -1
  298. package/dist/slate-editability.js +1 -1
  299. package/dist/slate-editability.js.map +1 -1
  300. package/dist/slate-errors.d.ts +7 -1
  301. package/dist/slate-errors.d.ts.map +1 -1
  302. package/dist/slate-errors.js +3 -2
  303. package/dist/slate-errors.js.map +1 -1
  304. package/dist/slate-handoff-options.d.ts +2 -1
  305. package/dist/slate-handoff-options.d.ts.map +1 -1
  306. package/dist/slate-handoff-options.js +2 -2
  307. package/dist/slate-handoff-options.js.map +1 -1
  308. package/dist/slate-handoff.js +1 -1
  309. package/dist/slate-handoff.js.map +1 -1
  310. package/dist/slate-image-executor.d.ts +18 -1
  311. package/dist/slate-image-executor.d.ts.map +1 -1
  312. package/dist/slate-image-executor.js +1 -0
  313. package/dist/slate-image-executor.js.map +1 -1
  314. package/dist/slate-inspiration.js +2 -2
  315. package/dist/slate-inspiration.js.map +1 -1
  316. package/dist/slate-local-image.d.ts.map +1 -1
  317. package/dist/slate-local-image.js +4 -1
  318. package/dist/slate-local-image.js.map +1 -1
  319. package/dist/slate-lock.js +1 -1
  320. package/dist/slate-lock.js.map +1 -1
  321. package/dist/slate-resume.js +6 -6
  322. package/dist/slate-resume.js.map +1 -1
  323. package/dist/slate-round-params.d.ts +3 -0
  324. package/dist/slate-round-params.d.ts.map +1 -1
  325. package/dist/slate-round-params.js +5 -0
  326. package/dist/slate-round-params.js.map +1 -1
  327. package/dist/slate-round-queries.d.ts +18 -0
  328. package/dist/slate-round-queries.d.ts.map +1 -0
  329. package/dist/slate-round-queries.js +29 -0
  330. package/dist/slate-round-queries.js.map +1 -0
  331. package/dist/slate-round-runner.d.ts.map +1 -1
  332. package/dist/slate-round-runner.js +12 -9
  333. package/dist/slate-round-runner.js.map +1 -1
  334. package/dist/slate-round-search.js +5 -5
  335. package/dist/slate-round-search.js.map +1 -1
  336. package/dist/slate-run-action.d.ts.map +1 -1
  337. package/dist/slate-run-action.js +2 -1
  338. package/dist/slate-run-action.js.map +1 -1
  339. package/dist/slate-runner-context.d.ts +3 -1
  340. package/dist/slate-runner-context.d.ts.map +1 -1
  341. package/dist/slate-runner-context.js +4 -3
  342. package/dist/slate-runner-context.js.map +1 -1
  343. package/dist/slate-runner-failure.d.ts +7 -1
  344. package/dist/slate-runner-failure.d.ts.map +1 -1
  345. package/dist/slate-runner-failure.js +6 -5
  346. package/dist/slate-runner-failure.js.map +1 -1
  347. package/dist/slate-runtime.d.ts.map +1 -1
  348. package/dist/slate-runtime.js +1 -0
  349. package/dist/slate-runtime.js.map +1 -1
  350. package/dist/slate-versions.js +3 -3
  351. package/dist/slate-versions.js.map +1 -1
  352. package/dist/slate-view-contract.d.ts +62 -1
  353. package/dist/slate-view-contract.d.ts.map +1 -1
  354. package/dist/slate-view-contract.js +30 -0
  355. package/dist/slate-view-contract.js.map +1 -1
  356. package/dist/slate-view.d.ts.map +1 -1
  357. package/dist/slate-view.js +19 -3
  358. package/dist/slate-view.js.map +1 -1
  359. package/dist/slate-workspace-parse.d.ts.map +1 -1
  360. package/dist/slate-workspace-parse.js +22 -0
  361. package/dist/slate-workspace-parse.js.map +1 -1
  362. package/dist/slate-workspace-types.d.ts +2 -0
  363. package/dist/slate-workspace-types.d.ts.map +1 -1
  364. package/dist/workflow/adapter-12ui.d.ts.map +1 -1
  365. package/dist/workflow/adapter-12ui.js +3 -5
  366. package/dist/workflow/adapter-12ui.js.map +1 -1
  367. package/dist/workflow/providers.d.ts.map +1 -1
  368. package/dist/workflow/providers.js +5 -2
  369. package/dist/workflow/providers.js.map +1 -1
  370. package/dist/workflow/recipes.d.ts +1 -2
  371. package/dist/workflow/recipes.d.ts.map +1 -1
  372. package/dist/workflow/recipes.js +6 -18
  373. package/dist/workflow/recipes.js.map +1 -1
  374. package/dist/workflow/routing.d.ts.map +1 -1
  375. package/dist/workflow/routing.js +3 -1
  376. package/dist/workflow/routing.js.map +1 -1
  377. package/dist/workflow/types.d.ts +7 -0
  378. package/dist/workflow/types.d.ts.map +1 -1
  379. package/dist/workflow/types.js +7 -0
  380. package/dist/workflow/types.js.map +1 -1
  381. package/dist/workspace-draw-client.d.ts +42 -1
  382. package/dist/workspace-draw-client.d.ts.map +1 -1
  383. package/dist/workspace-draw-client.js +56 -7
  384. package/dist/workspace-draw-client.js.map +1 -1
  385. package/dist/workspace-draw-codex.d.ts +9 -4
  386. package/dist/workspace-draw-codex.d.ts.map +1 -1
  387. package/dist/workspace-draw-codex.js +17 -3
  388. package/dist/workspace-draw-codex.js.map +1 -1
  389. package/dist/workspace-draw-messages.d.ts +24 -0
  390. package/dist/workspace-draw-messages.d.ts.map +1 -1
  391. package/dist/workspace-draw-messages.js +26 -2
  392. package/dist/workspace-draw-messages.js.map +1 -1
  393. package/dist/workspace-draw-run.d.ts +19 -1
  394. package/dist/workspace-draw-run.d.ts.map +1 -1
  395. package/dist/workspace-draw-run.js +76 -3
  396. package/dist/workspace-draw-run.js.map +1 -1
  397. package/dist/workspace-draw-store.d.ts +2 -0
  398. package/dist/workspace-draw-store.d.ts.map +1 -1
  399. package/dist/workspace-draw-store.js +3 -1
  400. package/dist/workspace-draw-store.js.map +1 -1
  401. package/dist/workspace-draw-types.d.ts +1 -0
  402. package/dist/workspace-draw-types.d.ts.map +1 -1
  403. package/dist/workspace-draw-types.js +1 -0
  404. package/dist/workspace-draw-types.js.map +1 -1
  405. package/dist/workspace-origin.d.ts +15 -0
  406. package/dist/workspace-origin.d.ts.map +1 -0
  407. package/dist/workspace-origin.js +36 -0
  408. package/dist/workspace-origin.js.map +1 -0
  409. package/dist/workspace-runner-children.d.ts +28 -0
  410. package/dist/workspace-runner-children.d.ts.map +1 -0
  411. package/dist/workspace-runner-children.js +112 -0
  412. package/dist/workspace-runner-children.js.map +1 -0
  413. package/dist/workspace-runner-client.d.ts +41 -0
  414. package/dist/workspace-runner-client.d.ts.map +1 -0
  415. package/dist/workspace-runner-client.js +63 -0
  416. package/dist/workspace-runner-client.js.map +1 -0
  417. package/dist/workspace-runner-main.d.ts +56 -0
  418. package/dist/workspace-runner-main.d.ts.map +1 -0
  419. package/dist/workspace-runner-main.js +350 -0
  420. package/dist/workspace-runner-main.js.map +1 -0
  421. package/dist/workspace-runner-policy.d.ts +40 -0
  422. package/dist/workspace-runner-policy.d.ts.map +1 -0
  423. package/dist/workspace-runner-policy.js +47 -0
  424. package/dist/workspace-runner-policy.js.map +1 -0
  425. package/dist/workspace-runner-spawn.d.ts +42 -0
  426. package/dist/workspace-runner-spawn.d.ts.map +1 -0
  427. package/dist/workspace-runner-spawn.js +60 -0
  428. package/dist/workspace-runner-spawn.js.map +1 -0
  429. package/dist/workspace-runner-stop.d.ts +25 -0
  430. package/dist/workspace-runner-stop.d.ts.map +1 -0
  431. package/dist/workspace-runner-stop.js +44 -0
  432. package/dist/workspace-runner-stop.js.map +1 -0
  433. package/dist/workspace-runner-store.d.ts +26 -0
  434. package/dist/workspace-runner-store.d.ts.map +1 -0
  435. package/dist/workspace-runner-store.js +114 -0
  436. package/dist/workspace-runner-store.js.map +1 -0
  437. package/open-design.json +2 -2
  438. package/package.json +2 -2
  439. package/runtime/codex-conversion/src/images/native-invoke.mjs +24 -5
  440. package/runtime/codex-conversion/src/images/native.mjs +3 -2
  441. package/skills/12ui-design/SKILL.md +79 -19
  442. package/skills/12ui-design/agents/openai.yaml +2 -0
  443. package/skills/12ui-design/improve.md +1 -5
  444. package/skills/12ui-design/inspire.md +5 -8
  445. package/skills/12ui-design/outputs.md +2 -23
  446. package/skills/12ui-design/scene.md +27 -156
  447. package/skills/12ui-design/session.md +0 -161
@@ -0,0 +1,246 @@
1
+ /**
2
+ * The Inspiration tab's page, the same in the card and the workspace: the
3
+ * search row, a line that says whose words are in the box, the status line,
4
+ * a line that says how many results the grid shows and why no more, the grid,
5
+ * and, while references are selected, Generate.
6
+ *
7
+ * - The grid: the search of the words in the box at the top (skeleton tiles
8
+ * while it runs, a line when it found nothing), then one section per round,
9
+ * newest first, with the references that produced its options. Every grid is
10
+ * a collage (`mcp-slate-ui-script-inspiration-collage.ts`): each picture at
11
+ * its own aspect ratio, every band as wide as the grid.
12
+ * - Every reference a round used carries a badge that says where, from the
13
+ * round records only: a reference is used when the round lists it
14
+ * (`rounds[].referenceIds`), and the options are those whose `referenceId`
15
+ * is it, e.g. "Used in round 1, option B". Nothing is inferred.
16
+ * - Generate asks for one new round drawn from exactly the selected
17
+ * references: it is Generate more's own request (`startRound`, which first
18
+ * waits for the selection write, then `design.slate.run` with a new round),
19
+ * so the server freezes the selection into the round and the person's agent
20
+ * or the local runner is told the same way. It draws the panel's default
21
+ * count, or the next count up when more references are selected, so every
22
+ * selected reference is drawn from at least once. While a round runs it is
23
+ * off and says why.
24
+ */
25
+ export const SLATE_UI_INSPIRATION_GRID = String.raw `
26
+ // ---- where a reference was used, from the round records ----
27
+ function labelOrder(a, b) { return a.length - b.length || (a < b ? -1 : a > b ? 1 : 0); }
28
+ function usedText(id) {
29
+ var v = state.view;
30
+ // A round that still waits for the person has used nothing yet: its references are only chosen (the pause).
31
+ var places = v.rounds.slice().sort(function (a, b) { return b.index - a.index; }).filter(function (r) {
32
+ return r.referenceIds.indexOf(id) >= 0 && !(pauseActive() && r.roundId === pause.roundId);
33
+ }).map(function (r) {
34
+ var labels = v.candidates.filter(function (c) { return c.roundId === r.roundId && c.referenceId === id; }).map(function (c) { return c.label; }).sort(labelOrder);
35
+ return t("usedPlace", { options: labels.length, round: r.index, labels: labels.length ? listOf(labels) : "" });
36
+ });
37
+ return places.length ? t("usedIn", { places: places.join(t("usedSeparator")) }) : "";
38
+ }
39
+
40
+ // ---- the tiles ----
41
+ function refButton(id) {
42
+ var b = button("", "refbtn");
43
+ b.setAttribute("aria-label", refName(id));
44
+ b.setAttribute("data-ref", id);
45
+ collageShape(b, id);
46
+ // The picture's own skeleton shows until it lands, so a tile that has arrived never flashes a grey square.
47
+ var img = el("img", "thumb empty shimmer");
48
+ img.alt = "";
49
+ b.appendChild(img);
50
+ bindReference(img, id, "thumb");
51
+ var check = el("span", "check");
52
+ check.innerHTML = '<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg>';
53
+ b.appendChild(check);
54
+ var used = usedText(id);
55
+ if (used) {
56
+ b.classList.add("used");
57
+ b.title = used;
58
+ b.appendChild(el("span", "usedbadge", used));
59
+ }
60
+ b.addEventListener("click", function () { toggleRef(id); });
61
+ return b;
62
+ }
63
+ function refSection(heading, title, ids) {
64
+ var sec = el("section", "refsec");
65
+ if (heading) {
66
+ var h = el("h2", "refhead", heading);
67
+ if (title) h.title = title;
68
+ sec.appendChild(h);
69
+ }
70
+ var grid = el("div", "refgrid");
71
+ ids.forEach(function (id) { grid.appendChild(refButton(id)); });
72
+ sec.appendChild(grid);
73
+ return sec;
74
+ }
75
+ // Tiles where the results will land, packed by the same collage, each a 16:10 landscape until the pictures are known.
76
+ var SKELETON_TILES = 12;
77
+ function skeletonSection() {
78
+ var sec = el("section", "refsec");
79
+ var grid = el("div", "refgrid");
80
+ for (var i = 0; i < SKELETON_TILES; i++) {
81
+ var tile = el("div", "skeleton shimmer");
82
+ collageShape(tile, null);
83
+ grid.appendChild(tile);
84
+ }
85
+ sec.appendChild(grid);
86
+ return sec;
87
+ }
88
+ function buildResults(box) {
89
+ var v = state.view;
90
+ var any = false;
91
+ var search = shownSearch();
92
+ // The search's slot: skeleton tiles while it runs, else its references, or the line that it found none.
93
+ // A round that waits for the person comes first, with the references it will be drawn from as they stand now.
94
+ var waiting = pauseRound();
95
+ if (waiting) { box.appendChild(refSection(t("roundHeading", { n: waiting.index }), roundTitle(waiting), pauseChosen())); any = true; }
96
+ if (state.insp.searching) { box.appendChild(skeletonSection()); any = true; }
97
+ else if (search && search.referenceIds.length === 0 && state.insp.noMatch === search.searchId) { box.appendChild(el("div", "placeholder", t("inspirationNoMatches"))); any = true; }
98
+ else if (search && search.referenceIds.length > 0) { box.appendChild(refSection("", "", search.referenceIds)); any = true; }
99
+ v.rounds.slice().sort(function (a, b) { return b.index - a.index; }).forEach(function (round) {
100
+ if (round.referenceIds.length === 0 || (waiting && round.roundId === waiting.roundId)) return;
101
+ box.appendChild(refSection(t("roundHeading", { n: round.index }), roundTitle(round), round.referenceIds));
102
+ any = true;
103
+ });
104
+ if (!any) box.appendChild(el("div", "placeholder", t("inspirationEmpty")));
105
+ }
106
+ // How many the search shows, and, at the cap, that one search returns no more.
107
+ function resultsText() {
108
+ var search = shownSearch();
109
+ if (state.insp.searching || !search || search.referenceIds.length === 0) return "";
110
+ var n = search.referenceIds.length;
111
+ return t(n >= SEARCH_COUNT ? "resultsMax" : "resultsCount", { n: n });
112
+ }
113
+
114
+ // ---- Generate: one new round from exactly the selected references ----
115
+ function generateCount(selected) {
116
+ var want = Math.max(selected, MORE.initial);
117
+ var fit = MORE.choices.filter(function (n) { return n >= want; })[0];
118
+ return fit || MORE.choices[MORE.choices.length - 1];
119
+ }
120
+ function generateFromSelection() {
121
+ var chosen = currentSelected();
122
+ if (chosen.length === 0 || state.insp.generating || moreBusy() || !localImage().ready) return;
123
+ state.insp.generating = true;
124
+ setInspStatus("", "");
125
+ renderAll();
126
+ startRound(uuid4(), { mode: "new", note: "", count: generateCount(chosen.length) }).then(function () {
127
+ state.insp.generating = false;
128
+ // The new round's options are pending in the designs: show them.
129
+ if (state.tab === "inspiration") setTab("designs"); else renderAll();
130
+ }, function (err) {
131
+ state.insp.generating = false;
132
+ setInspStatus(errText(err), "err");
133
+ renderAll();
134
+ });
135
+ }
136
+ function syncGenerate(pane) {
137
+ var chosen = currentSelected();
138
+ pane.__bar.classList.toggle("hidden", chosen.length === 0);
139
+ if (chosen.length === 0) return;
140
+ var running = moreBusy() && !state.insp.generating;
141
+ var local = localImage();
142
+ var line = t("selectionDraws", { m: chosen.length, n: generateCount(chosen.length) });
143
+ if (running) line = t("roundRunning");
144
+ else if (!local.ready && localReason()) line = localReason();
145
+ pane.__barText.textContent = line;
146
+ pane.__generate.disabled = state.insp.generating || running || !local.ready;
147
+ }
148
+
149
+ // ---- the tab ----
150
+ function buildInspirationShell(pane, where) {
151
+ pane.__built = true;
152
+ pane.__where = where;
153
+ pane.classList.add("insp", where);
154
+ var row = el("div", "searchrow");
155
+ var input = el("input");
156
+ input.type = "text";
157
+ input.className = "query";
158
+ input.autocomplete = "off";
159
+ input.placeholder = t("inspirationPlaceholder");
160
+ input.setAttribute("aria-label", t("inspirationLabel"));
161
+ input.value = state.query;
162
+ input.addEventListener("input", function () {
163
+ state.query = input.value;
164
+ state.insp.typed = true;
165
+ var panes = document.querySelectorAll(".insp");
166
+ for (var i = 0; i < panes.length; i++) { syncSearchButton(panes[i]); syncHow(panes[i]); }
167
+ });
168
+ input.addEventListener("keydown", function (e) { if (e.key === "Enter") doSearch(); });
169
+ var search = button(t("search"), "primary", doSearch);
170
+ row.appendChild(input);
171
+ row.appendChild(search);
172
+ var how = el("p", "insphow");
173
+ var status = el("div", "status");
174
+ status.setAttribute("data-istatus", "");
175
+ status.setAttribute("role", "status");
176
+ status.setAttribute("aria-live", "polite");
177
+ if (state.inspMsg) { status.textContent = state.inspMsg.text; if (state.inspMsg.kind) status.className = "status " + state.inspMsg.kind; }
178
+ var count = el("p", "insphow inspcount");
179
+ var pauseHost = el("div", "pausebar hidden");
180
+ var pauseChoice = el("p", "help pausechoice");
181
+ pauseChoice.setAttribute("aria-live", "polite");
182
+ var bar = el("div", "inspbar hidden");
183
+ var barText = el("p", "help");
184
+ barText.setAttribute("aria-live", "polite");
185
+ var generate = button(t("generate"), "primary", generateFromSelection);
186
+ bar.appendChild(barText);
187
+ bar.appendChild(generate);
188
+ pane.__input = input;
189
+ pane.__search = search;
190
+ pane.__how = how;
191
+ pane.__count = count;
192
+ pane.__results = el("div", "results");
193
+ pane.__bar = bar;
194
+ pane.__barText = barText;
195
+ pane.__generate = generate;
196
+ pane.__pause = pauseHost;
197
+ pane.__pauseChoice = pauseChoice;
198
+ pane.appendChild(row);
199
+ pane.appendChild(how);
200
+ pane.appendChild(status);
201
+ pane.appendChild(count);
202
+ pane.appendChild(pane.__results);
203
+ pane.appendChild(bar);
204
+ pane.appendChild(pauseChoice);
205
+ pane.appendChild(pauseHost);
206
+ // The collage is measured: a new width (a resize, a scroll bar, the tab shown again) lays it out again.
207
+ new ResizeObserver(function () { layoutResults(pane); }).observe(pane.__results);
208
+ }
209
+ function syncHow(pane) {
210
+ var text = howText();
211
+ pane.__how.textContent = text;
212
+ pane.__how.classList.toggle("hidden", !text);
213
+ }
214
+ function renderInspiration(pane, where) {
215
+ if (!state.view) return;
216
+ if (!pane.__built) buildInspirationShell(pane, where);
217
+ syncQuery();
218
+ // The box shows the words, except while the person is in it: their caret and typing are never disturbed.
219
+ if (pane.__input.value !== state.query && document.activeElement !== pane.__input) pane.__input.value = state.query;
220
+ // Words longer than the field are all in its tooltip.
221
+ if (pane.__input.scrollWidth > pane.__input.clientWidth) pane.__input.title = state.query; else pane.__input.removeAttribute("title");
222
+ syncSearchButton(pane);
223
+ syncHow(pane);
224
+ var v = state.view;
225
+ var search = shownSearch();
226
+ pane.__results.setAttribute("aria-busy", state.insp.searching ? "true" : "false");
227
+ var count = resultsText();
228
+ pane.__count.textContent = count;
229
+ pane.__count.classList.toggle("hidden", !count);
230
+ var sig = JSON.stringify([pause.roundId, pauseActive() ? pauseChosen() : null, state.insp.searching, state.insp.noMatch, search && [search.searchId, search.referenceIds],
231
+ v.rounds.map(function (r) { return [r.index, r.kind, r.fromVersionId, r.referenceIds]; }),
232
+ v.candidates.map(function (c) { return [c.roundId, c.label, c.referenceId]; }), v.references]);
233
+ setIfChanged(pane.__results, sig, buildResults);
234
+ layoutResults(pane);
235
+ var chosen = pauseActive() ? pauseChosen() : currentSelected();
236
+ var buttons = pane.__results.querySelectorAll(".refbtn");
237
+ for (var i = 0; i < buttons.length; i++) buttons[i].setAttribute("aria-pressed", chosen.indexOf(buttons[i].getAttribute("data-ref")) >= 0 ? "true" : "false");
238
+ // While a round waits for the person, the tab's bar is the pause's: how the options take the references, and Continue.
239
+ syncPauseHost(pane.__pause, false);
240
+ pane.__pauseChoice.textContent = pauseActive() ? pauseChoiceText() : "";
241
+ pane.__pauseChoice.classList.toggle("hidden", !pauseActive());
242
+ if (pauseActive()) pane.__bar.classList.add("hidden"); else syncGenerate(pane);
243
+ autoSearch();
244
+ }
245
+ `;
246
+ //# sourceMappingURL=mcp-slate-ui-script-inspiration-grid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-slate-ui-script-inspiration-grid.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inspiration-grid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4NlD,CAAC"}
@@ -1,13 +1,14 @@
1
1
  /**
2
- * The tabs (Designs and Inspiration, in the card and the workspace) and the
3
- * Inspiration tab, which is the same in both places: a search row, the newest
4
- * search's results, and one section per round with the references that
5
- * produced its options. Every reference is a toggle. The selection lives in
6
- * the view (`inspiration.selected`, at most eight, in click order) and is
7
- * written whole through the inspiration tool, one write in flight at a time,
8
- * last click wins locally; the next round reads it at commit. Nothing in this
9
- * tab starts work. While a search runs the newest-search slot is skeleton
10
- * tiles; a search with no results says so.
2
+ * How many references the Inspiration tab asks one search for: the most the free corpus returns for one query (the
3
+ * public tier's cap, which both servers' inspire tools also cap at). The corpus has no paging, so this is all one search
4
+ * can show; the tab says so next to the results.
11
5
  */
6
+ export declare const SLATE_INSPIRATION_SEARCH_COUNT = 24;
7
+ /**
8
+ * The longest words one search takes, in characters (code points): both servers' inspire tools refuse longer. A round
9
+ * searches with the whole brief and its note, which can be longer, so the box shows the round's words in full and the
10
+ * search takes their first 500 characters, cut at a space, and the tab says so.
11
+ */
12
+ export declare const SLATE_INSPIRATION_QUERY_CHARS = 500;
12
13
  export declare const SLATE_UI_INSPIRATION: string;
13
14
  //# sourceMappingURL=mcp-slate-ui-script-inspiration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-slate-ui-script-inspiration.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inspiration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,QA+NhC,CAAC"}
1
+ {"version":3,"file":"mcp-slate-ui-script-inspiration.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inspiration.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,KAA0B,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAuQjD,eAAO,MAAM,oBAAoB,QAA2F,CAAC"}
@@ -1,23 +1,59 @@
1
+ import { PUBLIC_CORPUS_MAX_COUNT } from './corpus-access.js';
2
+ import { SLATE_UI_INSPIRATION_COLLAGE } from './mcp-slate-ui-script-inspiration-collage.js';
3
+ import { SLATE_UI_INSPIRATION_GRID } from './mcp-slate-ui-script-inspiration-grid.js';
4
+ /**
5
+ * How many references the Inspiration tab asks one search for: the most the free corpus returns for one query (the
6
+ * public tier's cap, which both servers' inspire tools also cap at). The corpus has no paging, so this is all one search
7
+ * can show; the tab says so next to the results.
8
+ */
9
+ export const SLATE_INSPIRATION_SEARCH_COUNT = PUBLIC_CORPUS_MAX_COUNT;
10
+ /**
11
+ * The longest words one search takes, in characters (code points): both servers' inspire tools refuse longer. A round
12
+ * searches with the whole brief and its note, which can be longer, so the box shows the round's words in full and the
13
+ * search takes their first 500 characters, cut at a space, and the tab says so.
14
+ */
15
+ export const SLATE_INSPIRATION_QUERY_CHARS = 500;
1
16
  /**
2
17
  * The tabs (Designs and Inspiration, in the card and the workspace) and the
3
- * Inspiration tab, which is the same in both places: a search row, the newest
4
- * search's results, and one section per round with the references that
5
- * produced its options. Every reference is a toggle. The selection lives in
6
- * the view (`inspiration.selected`, at most eight, in click order) and is
7
- * written whole through the inspiration tool, one write in flight at a time,
8
- * last click wins locally; the next round reads it at commit. Nothing in this
9
- * tab starts work. While a search runs the newest-search slot is skeleton
10
- * tiles; a search with no results says so.
18
+ * Inspiration tab's words and work, which are the same in both places: the
19
+ * search box, the search, and the selection. The tab's grid, its badges and
20
+ * Generate are in mcp-slate-ui-script-inspiration-grid.ts.
21
+ *
22
+ * - The search box opens with the words that produced this workspace's
23
+ * references: the newest round's own search words, which the server states
24
+ * in `inspiration.roundQueries` (stored or derived, never searched again),
25
+ * else the newest recorded search. A line under it says whose words they are,
26
+ * and when rounds searched different words, that these are the newest. Once
27
+ * the person types, the box is theirs.
28
+ * - The grid shows the search of the words in the box. When the record has no
29
+ * search of the newest round's words, opening the tab runs that one search
30
+ * (free, at most once per workspace and words; an identical search is
31
+ * answered from the record by both servers). Every search asks for the most
32
+ * one search returns.
33
+ * - Every reference is a toggle. The selection lives in the view
34
+ * (`inspiration.selected`, at most eight, in click order) and is written
35
+ * whole through the inspiration tool, one write in flight at a time, last
36
+ * click wins locally; the next round reads it at commit. Nothing here starts
37
+ * a round: Generate does, through the same request as Generate more.
11
38
  */
12
- export const SLATE_UI_INSPIRATION = String.raw `
39
+ const SEARCH_AND_SELECTION = String.raw `
13
40
  var MAX_SELECTED = 8;
41
+ var SEARCH_COUNT = ${JSON.stringify(SLATE_INSPIRATION_SEARCH_COUNT)};
42
+ var QUERY_CHARS = ${JSON.stringify(SLATE_INSPIRATION_QUERY_CHARS)};
43
+ // Per workspace: whether the person typed in the box, the search the grid shows, the automatic searches already asked.
44
+ state.insp.runDir = null;
45
+ state.insp.typed = false;
46
+ state.insp.shownQuery = null;
47
+ state.insp.searchId = "";
48
+ state.insp.auto = {};
49
+ state.insp.generating = false;
14
50
 
15
51
  // A tab strip for the workspace header. The card's own strip is static markup; both carry data-tab.
16
52
  function buildTabs() {
17
53
  var tabs = el("div", "tabs");
18
54
  tabs.setAttribute("role", "tablist");
19
- tabs.setAttribute("aria-label", COPY.title);
20
- [["designs", COPY.tabDesigns], ["inspiration", COPY.tabInspiration]].forEach(function (t) {
55
+ tabs.setAttribute("aria-label", t("title"));
56
+ [["designs", t("tabDesigns")], ["inspiration", t("tabInspiration")]].forEach(function (t) {
21
57
  var b = button(t[1], "tab");
22
58
  b.setAttribute("role", "tab");
23
59
  b.setAttribute("data-tab", t[0]);
@@ -49,9 +85,10 @@ export const SLATE_UI_INSPIRATION = String.raw `
49
85
  var m = refMeta(id);
50
86
  return String((m && m.description) || id).slice(0, 40);
51
87
  }
52
- function refName(id) { return COPY.referencePrefix + refDescription(id); }
88
+ function refName(id) { return t("referenceName", { description: refDescription(id) }); }
89
+ function searchList() { return (state.view.inspiration && state.view.inspiration.searches) || []; }
53
90
  function newestSearch() {
54
- var searches = (state.view.inspiration && state.view.inspiration.searches) || [];
91
+ var searches = searchList();
55
92
  var best = null;
56
93
  // The hosted server sends no time, only the order: the last search is the newest.
57
94
  if (TARGET === "remote") return searches.length ? searches[searches.length - 1] : null;
@@ -59,11 +96,91 @@ export const SLATE_UI_INSPIRATION = String.raw `
59
96
  return best;
60
97
  }
61
98
  function roundTitle(round) {
62
- if (round.kind === "new") return COPY.newOptionsTitle;
63
- if (round.kind === "like") { var from = ver(round.fromVersionId); return COPY.likePrefix + (from ? from.label : ""); }
99
+ if (round.kind === "new") return t("newOptionsTitle");
100
+ if (round.kind === "like") { var from = ver(round.fromVersionId); return t("likeTitle", { label: from ? from.label : "" }); }
64
101
  return "";
65
102
  }
66
103
 
104
+ // ---- whose words are in the box ----
105
+ // Two sets of words are the same search when both servers would key them alike: whitespace collapsed, case ignored.
106
+ function norm(text) { return String(text || "").replace(/\s+/g, " ").trim().toLowerCase(); }
107
+ function collapsed(text) { return String(text || "").replace(/\s+/g, " ").trim(); }
108
+ // What one search can take of these words: all of them, or the first QUERY_CHARS characters, cut at the last space.
109
+ function searchable(text) {
110
+ var chars = Array.from(collapsed(text));
111
+ if (chars.length <= QUERY_CHARS) return chars.join("");
112
+ var cut = chars.slice(0, QUERY_CHARS).join("");
113
+ var space = cut.lastIndexOf(" ");
114
+ return (chars[QUERY_CHARS] === " " || space < 0 ? cut : cut.slice(0, space)).trim();
115
+ }
116
+ function tooLong(text) { return Array.from(collapsed(text)).length > QUERY_CHARS; }
117
+ // The newest round's search words, the rounds that searched them, and the rounds that searched other words.
118
+ function roundWords() {
119
+ var queries = (state.view.inspiration && state.view.inspiration.roundQueries) || [];
120
+ if (queries.length === 0) return null;
121
+ var latest = queries.reduce(function (a, b) { return b.roundIndex > a.roundIndex ? b : a; });
122
+ var key = norm(latest.query);
123
+ var byIndex = function (a, b) { return a - b; };
124
+ return {
125
+ query: latest.query,
126
+ same: queries.filter(function (q) { return norm(q.query) === key; }).map(function (q) { return q.roundIndex; }).sort(byIndex),
127
+ other: queries.filter(function (q) { return norm(q.query) !== key; }).map(function (q) { return q.roundIndex; }).sort(byIndex)
128
+ };
129
+ }
130
+ function defaultQuery() {
131
+ var words = roundWords();
132
+ if (words) return words.query;
133
+ var newest = newestSearch();
134
+ return newest ? newest.query : "";
135
+ }
136
+ function howText() {
137
+ var shown = norm(state.query);
138
+ if (!shown) return "";
139
+ var words = roundWords();
140
+ var line = "";
141
+ if (words && norm(words.query) === shown) {
142
+ line = words.other.length === 0
143
+ ? t("queryFrom", { count: words.same.length, rounds: listOf(words.same) })
144
+ : t("queryNewestOthers", { count: words.same.length, rounds: listOf(words.same), otherCount: words.other.length, others: listOf(words.other) });
145
+ } else {
146
+ var newest = newestSearch();
147
+ if (!state.insp.typed && newest && norm(newest.query) === shown) line = t("queryLastSearch");
148
+ }
149
+ if (tooLong(state.query)) line = sentences(line, t("queryCut", { n: QUERY_CHARS }));
150
+ return line;
151
+ }
152
+ // A new workspace starts clean; until the person types, the box follows the workspace's own words, and the grid with it.
153
+ function syncQuery() {
154
+ var v = state.view;
155
+ var i = state.insp;
156
+ if (i.runDir !== v.runDir) {
157
+ i.runDir = v.runDir;
158
+ i.typed = false;
159
+ i.shownQuery = null;
160
+ i.searchId = "";
161
+ i.noMatch = "";
162
+ }
163
+ if (i.typed) return;
164
+ var words = defaultQuery();
165
+ if (norm(words) !== norm(state.query)) { i.shownQuery = null; i.searchId = ""; }
166
+ state.query = words;
167
+ }
168
+
169
+ // ---- the search the grid shows: the one the person ran, else the record's search of the words in the box ----
170
+ function findSearch(words) {
171
+ var key = norm(words);
172
+ var hit = null;
173
+ searchList().forEach(function (s) { if (norm(s.query) === key) hit = s; });
174
+ return hit;
175
+ }
176
+ function shownSearch() {
177
+ var i = state.insp;
178
+ var ran = i.searchId ? searchList().filter(function (s) { return s.searchId === i.searchId; })[0] : null;
179
+ if (ran) return ran;
180
+ var words = i.shownQuery !== null ? i.shownQuery : defaultQuery();
181
+ return words ? findSearch(searchable(words)) : newestSearch();
182
+ }
183
+
67
184
  // ---- the status line of this tab ----
68
185
  function setInspStatus(text, kind) {
69
186
  var nodes = document.querySelectorAll("[data-istatus]");
@@ -73,11 +190,13 @@ export const SLATE_UI_INSPIRATION = String.raw `
73
190
 
74
191
  // ---- selection: optimistic, serialized, last write wins ----
75
192
  function toggleRef(id) {
193
+ // While a round waits for the person, a tile is a reference for that round, not the selection for a later one.
194
+ if (pauseActive()) { togglePauseRef(id); return; }
76
195
  var cur = currentSelected().slice();
77
196
  var at = cur.indexOf(id);
78
197
  if (at >= 0) cur.splice(at, 1);
79
198
  else {
80
- if (cur.length >= MAX_SELECTED) { setInspStatus(COPY.eightAtMost, ""); return; }
199
+ if (cur.length >= MAX_SELECTED) { setInspStatus(t("eightAtMost"), ""); return; }
81
200
  cur.push(id);
82
201
  }
83
202
  setInspStatus("", "");
@@ -118,119 +237,41 @@ export const SLATE_UI_INSPIRATION = String.raw `
118
237
  if (pane.__search) pane.__search.disabled = !state.query.trim() || state.insp.searching;
119
238
  }
120
239
  function doSearch() {
121
- var q = state.query.trim();
240
+ var q = searchable(state.query);
122
241
  if (!q || state.insp.searching || !state.view) return;
123
- state.insp.searching = true;
124
- state.insp.noMatch = "";
125
- setInspStatus(COPY.searching, "");
242
+ runSearch(q);
243
+ }
244
+ function runSearch(q) {
245
+ var i = state.insp;
246
+ i.searching = true;
247
+ i.noMatch = "";
248
+ setInspStatus(t("searching"), "");
126
249
  renderAll();
127
- callTool(TOOLS.inspire, { runDir: state.view.runDir, query: q }).then(function (result) {
250
+ callTool(TOOLS.inspire, { runDir: state.view.runDir, query: q, count: SEARCH_COUNT }).then(function (result) {
128
251
  var sc = result.structuredContent || {};
252
+ // The grid shows what this search found from now on, even when the view's newest search is another one.
253
+ if (sc.search) { i.searchId = sc.search.searchId; i.shownQuery = sc.search.query; }
129
254
  if (sc.view) applyView(sc.view, true);
130
255
  setInspStatus("", "");
131
256
  var found = sc.search || newestSearch();
132
- if (found && found.referenceIds.length === 0) state.insp.noMatch = found.searchId;
257
+ if (found && found.referenceIds.length === 0) i.noMatch = found.searchId;
133
258
  }, function (err) {
134
- setInspStatus(err.code === "rate_limited" && err.retryAfterSeconds !== undefined ? tpl(COPY.tryAgain, { n: err.retryAfterSeconds }) : tpl(COPY.searchFailed, { message: errText(err) }), "err");
135
- }).then(function () { state.insp.searching = false; renderAll(); });
259
+ setInspStatus(err.code === "rate_limited" && err.retryAfterSeconds !== undefined ? t("tryAgain", { n: err.retryAfterSeconds }) : t("searchFailed", { message: errText(err) }), "err");
260
+ }).then(function () { i.searching = false; renderAll(); });
136
261
  }
137
-
138
- // ---- the tab ----
139
- function refButton(id) {
140
- var b = button("", "refbtn");
141
- b.setAttribute("aria-label", refName(id));
142
- b.setAttribute("data-ref", id);
143
- // The picture's own skeleton shows until it lands, so a tile that has arrived never flashes a grey square.
144
- var img = el("img", "thumb empty shimmer");
145
- img.alt = "";
146
- b.appendChild(img);
147
- bindReference(img, id, "thumb");
148
- var check = el("span", "check");
149
- check.innerHTML = '<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg>';
150
- b.appendChild(check);
151
- b.addEventListener("click", function () { toggleRef(id); });
152
- return b;
153
- }
154
- function refSection(heading, title, ids) {
155
- var sec = el("section", "refsec");
156
- if (heading) {
157
- var h = el("h2", "refhead", heading);
158
- if (title) h.title = title;
159
- sec.appendChild(h);
160
- }
161
- var grid = el("div", "refgrid");
162
- ids.forEach(function (id) { grid.appendChild(refButton(id)); });
163
- sec.appendChild(grid);
164
- return sec;
165
- }
166
- // The same tiles as the results, at the same size, where the results will land.
167
- var SKELETON_TILES = 12;
168
- function skeletonSection() {
169
- var sec = el("section", "refsec");
170
- var grid = el("div", "refgrid");
171
- for (var i = 0; i < SKELETON_TILES; i++) grid.appendChild(el("div", "skeleton shimmer"));
172
- sec.appendChild(grid);
173
- return sec;
174
- }
175
- function buildResults(box) {
176
- var v = state.view;
177
- var any = false;
178
- var search = newestSearch();
179
- // The newest search's slot: skeleton tiles while it runs, else its references, or the line that it found none.
180
- if (state.insp.searching) { box.appendChild(skeletonSection()); any = true; }
181
- else if (search && search.referenceIds.length === 0 && state.insp.noMatch === search.searchId) { box.appendChild(el("div", "placeholder", COPY.inspirationNoMatches)); any = true; }
182
- else if (search && search.referenceIds.length > 0) { box.appendChild(refSection("", "", search.referenceIds)); any = true; }
183
- v.rounds.slice().sort(function (a, b) { return b.index - a.index; }).forEach(function (round) {
184
- if (round.referenceIds.length === 0) return;
185
- box.appendChild(refSection(COPY.roundPrefix + round.index, roundTitle(round), round.referenceIds));
186
- any = true;
187
- });
188
- if (!any) box.appendChild(el("div", "placeholder", COPY.inspirationEmpty));
189
- }
190
- function buildInspirationShell(pane, where) {
191
- pane.__built = true;
192
- pane.classList.add("insp", where);
193
- var row = el("div", "searchrow");
194
- var input = el("input");
195
- input.type = "text";
196
- input.className = "query";
197
- input.autocomplete = "off";
198
- input.placeholder = COPY.inspirationPlaceholder;
199
- input.setAttribute("aria-label", COPY.inspirationLabel);
200
- input.value = state.query;
201
- input.addEventListener("input", function () {
202
- state.query = input.value;
203
- var panes = document.querySelectorAll(".insp");
204
- for (var i = 0; i < panes.length; i++) syncSearchButton(panes[i]);
205
- });
206
- input.addEventListener("keydown", function (e) { if (e.key === "Enter") doSearch(); });
207
- var search = button(COPY.search, "primary", doSearch);
208
- row.appendChild(input);
209
- row.appendChild(search);
210
- var status = el("div", "status");
211
- status.setAttribute("data-istatus", "");
212
- status.setAttribute("role", "status");
213
- status.setAttribute("aria-live", "polite");
214
- if (state.inspMsg) { status.textContent = state.inspMsg.text; if (state.inspMsg.kind) status.className = "status " + state.inspMsg.kind; }
215
- pane.__input = input;
216
- pane.__search = search;
217
- pane.__results = el("div", "results");
218
- pane.appendChild(row);
219
- pane.appendChild(status);
220
- pane.appendChild(pane.__results);
221
- }
222
- function renderInspiration(pane, where) {
223
- if (!state.view) return;
224
- if (!pane.__built) buildInspirationShell(pane, where);
225
- syncSearchButton(pane);
262
+ // Opening the tab shows the newest round's words with their results: when the record has none, it asks once.
263
+ function autoSearch() {
226
264
  var v = state.view;
227
- var search = newestSearch();
228
- pane.__results.setAttribute("aria-busy", state.insp.searching ? "true" : "false");
229
- var sig = JSON.stringify([state.insp.searching, state.insp.noMatch, search && [search.searchId, search.referenceIds], v.rounds.map(function (r) { return [r.index, r.kind, r.fromVersionId, r.referenceIds]; }), v.references]);
230
- setIfChanged(pane.__results, sig, buildResults);
231
- var chosen = currentSelected();
232
- var buttons = pane.__results.querySelectorAll(".refbtn");
233
- for (var i = 0; i < buttons.length; i++) buttons[i].setAttribute("aria-pressed", chosen.indexOf(buttons[i].getAttribute("data-ref")) >= 0 ? "true" : "false");
265
+ var i = state.insp;
266
+ if (!v || !v.runDir || i.searching || i.typed || !visible()) return;
267
+ var words = roundWords();
268
+ var q = words ? searchable(words.query) : "";
269
+ if (!q || findSearch(q)) return;
270
+ var key = v.runDir + "\n" + norm(q);
271
+ if (i.auto[key]) return;
272
+ i.auto[key] = true;
273
+ runSearch(q);
234
274
  }
235
275
  `;
276
+ export const SLATE_UI_INSPIRATION = `${SEARCH_AND_SELECTION}\n${SLATE_UI_INSPIRATION_COLLAGE}\n${SLATE_UI_INSPIRATION_GRID}`;
236
277
  //# sourceMappingURL=mcp-slate-ui-script-inspiration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-slate-ui-script-inspiration.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inspiration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+N7C,CAAC"}
1
+ {"version":3,"file":"mcp-slate-ui-script-inspiration.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inspiration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAEtF;;;;GAIG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,uBAAuB,CAAC;AAEtE;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAA;;uBAEhB,IAAI,CAAC,SAAS,CAAC,8BAA8B,CAAC;sBAC/C,IAAI,CAAC,SAAS,CAAC,6BAA6B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyOlE,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,oBAAoB,KAAK,4BAA4B,KAAK,yBAAyB,EAAE,CAAC"}