@12ui/design 0.2.76 → 0.2.78

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 (337) hide show
  1. package/SKILL.md +1 -1
  2. package/dist/cli-codex-readiness.d.ts +6 -0
  3. package/dist/cli-codex-readiness.d.ts.map +1 -1
  4. package/dist/cli-codex-readiness.js +12 -12
  5. package/dist/cli-codex-readiness.js.map +1 -1
  6. package/dist/cli-help/design.d.ts +2 -2
  7. package/dist/cli-help/design.d.ts.map +1 -1
  8. package/dist/cli-help/design.js +2 -0
  9. package/dist/cli-help/design.js.map +1 -1
  10. package/dist/cli-help/index.d.ts +2 -2
  11. package/dist/cli-review-command.d.ts.map +1 -1
  12. package/dist/cli-review-command.js +2 -0
  13. package/dist/cli-review-command.js.map +1 -1
  14. package/dist/cli-run.d.ts.map +1 -1
  15. package/dist/cli-run.js +6 -0
  16. package/dist/cli-run.js.map +1 -1
  17. package/dist/cli-workspace-draw.d.ts +1 -11
  18. package/dist/cli-workspace-draw.d.ts.map +1 -1
  19. package/dist/cli-workspace-draw.js +18 -18
  20. package/dist/cli-workspace-draw.js.map +1 -1
  21. package/dist/cli-workspace-runner.d.ts +30 -0
  22. package/dist/cli-workspace-runner.d.ts.map +1 -0
  23. package/dist/cli-workspace-runner.js +105 -0
  24. package/dist/cli-workspace-runner.js.map +1 -0
  25. package/dist/mcp-slate-image.js +1 -1
  26. package/dist/mcp-slate-image.js.map +1 -1
  27. package/dist/mcp-slate-tool-defs.js +1 -1
  28. package/dist/mcp-slate-tool-defs.js.map +1 -1
  29. package/dist/mcp-slate-ui-copy.d.ts +403 -33
  30. package/dist/mcp-slate-ui-copy.d.ts.map +1 -1
  31. package/dist/mcp-slate-ui-copy.js +247 -57
  32. package/dist/mcp-slate-ui-copy.js.map +1 -1
  33. package/dist/mcp-slate-ui-icu.d.ts +47 -0
  34. package/dist/mcp-slate-ui-icu.d.ts.map +1 -0
  35. package/dist/mcp-slate-ui-icu.js +229 -0
  36. package/dist/mcp-slate-ui-icu.js.map +1 -0
  37. package/dist/mcp-slate-ui-locale-match.d.ts +12 -0
  38. package/dist/mcp-slate-ui-locale-match.d.ts.map +1 -0
  39. package/dist/mcp-slate-ui-locale-match.js +34 -0
  40. package/dist/mcp-slate-ui-locale-match.js.map +1 -0
  41. package/dist/mcp-slate-ui-locales/de-DE.d.ts +9 -0
  42. package/dist/mcp-slate-ui-locales/de-DE.d.ts.map +1 -0
  43. package/dist/mcp-slate-ui-locales/de-DE.js +217 -0
  44. package/dist/mcp-slate-ui-locales/de-DE.js.map +1 -0
  45. package/dist/mcp-slate-ui-locales/es-419.d.ts +9 -0
  46. package/dist/mcp-slate-ui-locales/es-419.d.ts.map +1 -0
  47. package/dist/mcp-slate-ui-locales/es-419.js +217 -0
  48. package/dist/mcp-slate-ui-locales/es-419.js.map +1 -0
  49. package/dist/mcp-slate-ui-locales/es-ES.d.ts +9 -0
  50. package/dist/mcp-slate-ui-locales/es-ES.d.ts.map +1 -0
  51. package/dist/mcp-slate-ui-locales/es-ES.js +217 -0
  52. package/dist/mcp-slate-ui-locales/es-ES.js.map +1 -0
  53. package/dist/mcp-slate-ui-locales/fr-FR.d.ts +9 -0
  54. package/dist/mcp-slate-ui-locales/fr-FR.d.ts.map +1 -0
  55. package/dist/mcp-slate-ui-locales/fr-FR.js +217 -0
  56. package/dist/mcp-slate-ui-locales/fr-FR.js.map +1 -0
  57. package/dist/mcp-slate-ui-locales/hi-IN.d.ts +9 -0
  58. package/dist/mcp-slate-ui-locales/hi-IN.d.ts.map +1 -0
  59. package/dist/mcp-slate-ui-locales/hi-IN.js +217 -0
  60. package/dist/mcp-slate-ui-locales/hi-IN.js.map +1 -0
  61. package/dist/mcp-slate-ui-locales/index.d.ts +11 -0
  62. package/dist/mcp-slate-ui-locales/index.d.ts.map +1 -0
  63. package/dist/mcp-slate-ui-locales/index.js +34 -0
  64. package/dist/mcp-slate-ui-locales/index.js.map +1 -0
  65. package/dist/mcp-slate-ui-locales/it-IT.d.ts +9 -0
  66. package/dist/mcp-slate-ui-locales/it-IT.d.ts.map +1 -0
  67. package/dist/mcp-slate-ui-locales/it-IT.js +217 -0
  68. package/dist/mcp-slate-ui-locales/it-IT.js.map +1 -0
  69. package/dist/mcp-slate-ui-locales/ja-JP.d.ts +9 -0
  70. package/dist/mcp-slate-ui-locales/ja-JP.d.ts.map +1 -0
  71. package/dist/mcp-slate-ui-locales/ja-JP.js +217 -0
  72. package/dist/mcp-slate-ui-locales/ja-JP.js.map +1 -0
  73. package/dist/mcp-slate-ui-locales/ko-KR.d.ts +9 -0
  74. package/dist/mcp-slate-ui-locales/ko-KR.d.ts.map +1 -0
  75. package/dist/mcp-slate-ui-locales/ko-KR.js +217 -0
  76. package/dist/mcp-slate-ui-locales/ko-KR.js.map +1 -0
  77. package/dist/mcp-slate-ui-locales/pt-BR.d.ts +9 -0
  78. package/dist/mcp-slate-ui-locales/pt-BR.d.ts.map +1 -0
  79. package/dist/mcp-slate-ui-locales/pt-BR.js +217 -0
  80. package/dist/mcp-slate-ui-locales/pt-BR.js.map +1 -0
  81. package/dist/mcp-slate-ui-locales/zh-CN.d.ts +9 -0
  82. package/dist/mcp-slate-ui-locales/zh-CN.d.ts.map +1 -0
  83. package/dist/mcp-slate-ui-locales/zh-CN.js +217 -0
  84. package/dist/mcp-slate-ui-locales/zh-CN.js.map +1 -0
  85. package/dist/mcp-slate-ui-locales/zh-TW.d.ts +9 -0
  86. package/dist/mcp-slate-ui-locales/zh-TW.d.ts.map +1 -0
  87. package/dist/mcp-slate-ui-locales/zh-TW.js +217 -0
  88. package/dist/mcp-slate-ui-locales/zh-TW.js.map +1 -0
  89. package/dist/mcp-slate-ui-script-bridge.d.ts.map +1 -1
  90. package/dist/mcp-slate-ui-script-bridge.js +8 -9
  91. package/dist/mcp-slate-ui-script-bridge.js.map +1 -1
  92. package/dist/mcp-slate-ui-script-dialog.d.ts.map +1 -1
  93. package/dist/mcp-slate-ui-script-dialog.js +60 -30
  94. package/dist/mcp-slate-ui-script-dialog.js.map +1 -1
  95. package/dist/mcp-slate-ui-script-inline.d.ts +9 -6
  96. package/dist/mcp-slate-ui-script-inline.d.ts.map +1 -1
  97. package/dist/mcp-slate-ui-script-inline.js +91 -46
  98. package/dist/mcp-slate-ui-script-inline.js.map +1 -1
  99. package/dist/mcp-slate-ui-script-inspiration-collage.d.ts +20 -0
  100. package/dist/mcp-slate-ui-script-inspiration-collage.d.ts.map +1 -0
  101. package/dist/mcp-slate-ui-script-inspiration-collage.js +68 -0
  102. package/dist/mcp-slate-ui-script-inspiration-collage.js.map +1 -0
  103. package/dist/mcp-slate-ui-script-inspiration-grid.d.ts +26 -0
  104. package/dist/mcp-slate-ui-script-inspiration-grid.d.ts.map +1 -0
  105. package/dist/mcp-slate-ui-script-inspiration-grid.js +246 -0
  106. package/dist/mcp-slate-ui-script-inspiration-grid.js.map +1 -0
  107. package/dist/mcp-slate-ui-script-inspiration.d.ts +10 -9
  108. package/dist/mcp-slate-ui-script-inspiration.d.ts.map +1 -1
  109. package/dist/mcp-slate-ui-script-inspiration.js +161 -120
  110. package/dist/mcp-slate-ui-script-inspiration.js.map +1 -1
  111. package/dist/mcp-slate-ui-script-l10n.d.ts +29 -0
  112. package/dist/mcp-slate-ui-script-l10n.d.ts.map +1 -0
  113. package/dist/mcp-slate-ui-script-l10n.js +135 -0
  114. package/dist/mcp-slate-ui-script-l10n.js.map +1 -0
  115. package/dist/mcp-slate-ui-script-more.d.ts +3 -2
  116. package/dist/mcp-slate-ui-script-more.d.ts.map +1 -1
  117. package/dist/mcp-slate-ui-script-more.js +19 -18
  118. package/dist/mcp-slate-ui-script-more.js.map +1 -1
  119. package/dist/mcp-slate-ui-script-pause.d.ts +33 -0
  120. package/dist/mcp-slate-ui-script-pause.d.ts.map +1 -0
  121. package/dist/mcp-slate-ui-script-pause.js +217 -0
  122. package/dist/mcp-slate-ui-script-pause.js.map +1 -0
  123. package/dist/mcp-slate-ui-script-remote.d.ts +2 -0
  124. package/dist/mcp-slate-ui-script-remote.d.ts.map +1 -1
  125. package/dist/mcp-slate-ui-script-remote.js +47 -6
  126. package/dist/mcp-slate-ui-script-remote.js.map +1 -1
  127. package/dist/mcp-slate-ui-script-scribble.js +1 -1
  128. package/dist/mcp-slate-ui-script-select.js +6 -6
  129. package/dist/mcp-slate-ui-script-stage.d.ts +3 -2
  130. package/dist/mcp-slate-ui-script-stage.d.ts.map +1 -1
  131. package/dist/mcp-slate-ui-script-stage.js +31 -19
  132. package/dist/mcp-slate-ui-script-stage.js.map +1 -1
  133. package/dist/mcp-slate-ui-script-state.d.ts.map +1 -1
  134. package/dist/mcp-slate-ui-script-state.js +77 -57
  135. package/dist/mcp-slate-ui-script-state.js.map +1 -1
  136. package/dist/mcp-slate-ui-script.d.ts +2 -2
  137. package/dist/mcp-slate-ui-script.d.ts.map +1 -1
  138. package/dist/mcp-slate-ui-script.js +21 -7
  139. package/dist/mcp-slate-ui-script.js.map +1 -1
  140. package/dist/mcp-slate-ui-styles-dialog.d.ts +6 -7
  141. package/dist/mcp-slate-ui-styles-dialog.d.ts.map +1 -1
  142. package/dist/mcp-slate-ui-styles-dialog.js +13 -29
  143. package/dist/mcp-slate-ui-styles-dialog.js.map +1 -1
  144. package/dist/mcp-slate-ui-styles-inspiration.d.ts +18 -0
  145. package/dist/mcp-slate-ui-styles-inspiration.d.ts.map +1 -0
  146. package/dist/mcp-slate-ui-styles-inspiration.js +43 -0
  147. package/dist/mcp-slate-ui-styles-inspiration.js.map +1 -0
  148. package/dist/mcp-slate-ui-styles-pause.d.ts +10 -0
  149. package/dist/mcp-slate-ui-styles-pause.d.ts.map +1 -0
  150. package/dist/mcp-slate-ui-styles-pause.js +25 -0
  151. package/dist/mcp-slate-ui-styles-pause.js.map +1 -0
  152. package/dist/mcp-slate-ui-styles-stage.d.ts +10 -6
  153. package/dist/mcp-slate-ui-styles-stage.d.ts.map +1 -1
  154. package/dist/mcp-slate-ui-styles-stage.js +24 -16
  155. package/dist/mcp-slate-ui-styles-stage.js.map +1 -1
  156. package/dist/mcp-slate-ui-styles.d.ts +12 -5
  157. package/dist/mcp-slate-ui-styles.d.ts.map +1 -1
  158. package/dist/mcp-slate-ui-styles.js +38 -21
  159. package/dist/mcp-slate-ui-styles.js.map +1 -1
  160. package/dist/mcp-slate-ui.d.ts +11 -3
  161. package/dist/mcp-slate-ui.d.ts.map +1 -1
  162. package/dist/mcp-slate-ui.js +24 -16
  163. package/dist/mcp-slate-ui.js.map +1 -1
  164. package/dist/mosaic-bands.d.ts +44 -0
  165. package/dist/mosaic-bands.d.ts.map +1 -0
  166. package/dist/mosaic-bands.js +153 -0
  167. package/dist/mosaic-bands.js.map +1 -0
  168. package/dist/review-discovery.d.ts.map +1 -1
  169. package/dist/review-discovery.js +36 -54
  170. package/dist/review-discovery.js.map +1 -1
  171. package/dist/review-page.d.ts.map +1 -1
  172. package/dist/review-page.js +2 -1
  173. package/dist/review-page.js.map +1 -1
  174. package/dist/review-run-roots.d.ts +40 -0
  175. package/dist/review-run-roots.d.ts.map +1 -0
  176. package/dist/review-run-roots.js +94 -0
  177. package/dist/review-run-roots.js.map +1 -0
  178. package/dist/review-server.d.ts +2 -0
  179. package/dist/review-server.d.ts.map +1 -1
  180. package/dist/review-server.js +2 -0
  181. package/dist/review-server.js.map +1 -1
  182. package/dist/review-types.d.ts +10 -0
  183. package/dist/review-types.d.ts.map +1 -1
  184. package/dist/slate-actions.d.ts +3 -3
  185. package/dist/slate-actions.d.ts.map +1 -1
  186. package/dist/slate-actions.js +9 -8
  187. package/dist/slate-actions.js.map +1 -1
  188. package/dist/slate-browser-host-script.d.ts +4 -0
  189. package/dist/slate-browser-host-script.d.ts.map +1 -1
  190. package/dist/slate-browser-host-script.js +25 -6
  191. package/dist/slate-browser-host-script.js.map +1 -1
  192. package/dist/slate-browser-host.d.ts +2 -1
  193. package/dist/slate-browser-host.d.ts.map +1 -1
  194. package/dist/slate-browser-host.js +18 -5
  195. package/dist/slate-browser-host.js.map +1 -1
  196. package/dist/slate-commit.js +7 -7
  197. package/dist/slate-commit.js.map +1 -1
  198. package/dist/slate-corpus.d.ts.map +1 -1
  199. package/dist/slate-corpus.js +3 -2
  200. package/dist/slate-corpus.js.map +1 -1
  201. package/dist/slate-edit-runner.d.ts.map +1 -1
  202. package/dist/slate-edit-runner.js +5 -4
  203. package/dist/slate-edit-runner.js.map +1 -1
  204. package/dist/slate-editability.d.ts +2 -0
  205. package/dist/slate-editability.d.ts.map +1 -1
  206. package/dist/slate-editability.js +1 -1
  207. package/dist/slate-editability.js.map +1 -1
  208. package/dist/slate-errors.d.ts +7 -1
  209. package/dist/slate-errors.d.ts.map +1 -1
  210. package/dist/slate-errors.js +3 -2
  211. package/dist/slate-errors.js.map +1 -1
  212. package/dist/slate-handoff-options.d.ts +2 -1
  213. package/dist/slate-handoff-options.d.ts.map +1 -1
  214. package/dist/slate-handoff-options.js +2 -2
  215. package/dist/slate-handoff-options.js.map +1 -1
  216. package/dist/slate-handoff.js +1 -1
  217. package/dist/slate-handoff.js.map +1 -1
  218. package/dist/slate-image-executor.d.ts +28 -3
  219. package/dist/slate-image-executor.d.ts.map +1 -1
  220. package/dist/slate-image-executor.js +55 -11
  221. package/dist/slate-image-executor.js.map +1 -1
  222. package/dist/slate-inspiration.js +2 -2
  223. package/dist/slate-inspiration.js.map +1 -1
  224. package/dist/slate-local-image.d.ts.map +1 -1
  225. package/dist/slate-local-image.js +4 -1
  226. package/dist/slate-local-image.js.map +1 -1
  227. package/dist/slate-lock.js +1 -1
  228. package/dist/slate-lock.js.map +1 -1
  229. package/dist/slate-resume.js +6 -6
  230. package/dist/slate-resume.js.map +1 -1
  231. package/dist/slate-round-params.d.ts +3 -0
  232. package/dist/slate-round-params.d.ts.map +1 -1
  233. package/dist/slate-round-params.js +5 -0
  234. package/dist/slate-round-params.js.map +1 -1
  235. package/dist/slate-round-prompt.d.ts +15 -3
  236. package/dist/slate-round-prompt.d.ts.map +1 -1
  237. package/dist/slate-round-prompt.js +14 -5
  238. package/dist/slate-round-prompt.js.map +1 -1
  239. package/dist/slate-round-queries.d.ts +18 -0
  240. package/dist/slate-round-queries.d.ts.map +1 -0
  241. package/dist/slate-round-queries.js +29 -0
  242. package/dist/slate-round-queries.js.map +1 -0
  243. package/dist/slate-round-runner.d.ts.map +1 -1
  244. package/dist/slate-round-runner.js +12 -9
  245. package/dist/slate-round-runner.js.map +1 -1
  246. package/dist/slate-round-search.js +5 -5
  247. package/dist/slate-round-search.js.map +1 -1
  248. package/dist/slate-run-action.d.ts.map +1 -1
  249. package/dist/slate-run-action.js +2 -1
  250. package/dist/slate-run-action.js.map +1 -1
  251. package/dist/slate-runner-context.d.ts +3 -1
  252. package/dist/slate-runner-context.d.ts.map +1 -1
  253. package/dist/slate-runner-context.js +4 -3
  254. package/dist/slate-runner-context.js.map +1 -1
  255. package/dist/slate-runner-failure.d.ts +7 -1
  256. package/dist/slate-runner-failure.d.ts.map +1 -1
  257. package/dist/slate-runner-failure.js +6 -5
  258. package/dist/slate-runner-failure.js.map +1 -1
  259. package/dist/slate-runtime.d.ts.map +1 -1
  260. package/dist/slate-runtime.js +1 -0
  261. package/dist/slate-runtime.js.map +1 -1
  262. package/dist/slate-versions.js +3 -3
  263. package/dist/slate-versions.js.map +1 -1
  264. package/dist/slate-view-contract.d.ts +62 -1
  265. package/dist/slate-view-contract.d.ts.map +1 -1
  266. package/dist/slate-view-contract.js +30 -0
  267. package/dist/slate-view-contract.js.map +1 -1
  268. package/dist/slate-view.d.ts.map +1 -1
  269. package/dist/slate-view.js +19 -3
  270. package/dist/slate-view.js.map +1 -1
  271. package/dist/slate-workspace-parse.d.ts.map +1 -1
  272. package/dist/slate-workspace-parse.js +22 -0
  273. package/dist/slate-workspace-parse.js.map +1 -1
  274. package/dist/slate-workspace-types.d.ts +3 -1
  275. package/dist/slate-workspace-types.d.ts.map +1 -1
  276. package/dist/workspace-draw-client.d.ts +58 -5
  277. package/dist/workspace-draw-client.d.ts.map +1 -1
  278. package/dist/workspace-draw-client.js +82 -9
  279. package/dist/workspace-draw-client.js.map +1 -1
  280. package/dist/workspace-draw-codex.d.ts +9 -4
  281. package/dist/workspace-draw-codex.d.ts.map +1 -1
  282. package/dist/workspace-draw-codex.js +17 -3
  283. package/dist/workspace-draw-codex.js.map +1 -1
  284. package/dist/workspace-draw-messages.d.ts +31 -0
  285. package/dist/workspace-draw-messages.d.ts.map +1 -1
  286. package/dist/workspace-draw-messages.js +30 -0
  287. package/dist/workspace-draw-messages.js.map +1 -1
  288. package/dist/workspace-draw-run.d.ts +19 -1
  289. package/dist/workspace-draw-run.d.ts.map +1 -1
  290. package/dist/workspace-draw-run.js +98 -5
  291. package/dist/workspace-draw-run.js.map +1 -1
  292. package/dist/workspace-draw-store.d.ts +2 -0
  293. package/dist/workspace-draw-store.d.ts.map +1 -1
  294. package/dist/workspace-draw-store.js +3 -1
  295. package/dist/workspace-draw-store.js.map +1 -1
  296. package/dist/workspace-draw-types.d.ts +2 -0
  297. package/dist/workspace-draw-types.d.ts.map +1 -1
  298. package/dist/workspace-draw-types.js +2 -0
  299. package/dist/workspace-draw-types.js.map +1 -1
  300. package/dist/workspace-origin.d.ts +15 -0
  301. package/dist/workspace-origin.d.ts.map +1 -0
  302. package/dist/workspace-origin.js +36 -0
  303. package/dist/workspace-origin.js.map +1 -0
  304. package/dist/workspace-runner-children.d.ts +39 -0
  305. package/dist/workspace-runner-children.d.ts.map +1 -0
  306. package/dist/workspace-runner-children.js +139 -0
  307. package/dist/workspace-runner-children.js.map +1 -0
  308. package/dist/workspace-runner-client.d.ts +43 -0
  309. package/dist/workspace-runner-client.d.ts.map +1 -0
  310. package/dist/workspace-runner-client.js +72 -0
  311. package/dist/workspace-runner-client.js.map +1 -0
  312. package/dist/workspace-runner-main.d.ts +56 -0
  313. package/dist/workspace-runner-main.d.ts.map +1 -0
  314. package/dist/workspace-runner-main.js +378 -0
  315. package/dist/workspace-runner-main.js.map +1 -0
  316. package/dist/workspace-runner-policy.d.ts +40 -0
  317. package/dist/workspace-runner-policy.d.ts.map +1 -0
  318. package/dist/workspace-runner-policy.js +47 -0
  319. package/dist/workspace-runner-policy.js.map +1 -0
  320. package/dist/workspace-runner-spawn.d.ts +42 -0
  321. package/dist/workspace-runner-spawn.d.ts.map +1 -0
  322. package/dist/workspace-runner-spawn.js +60 -0
  323. package/dist/workspace-runner-spawn.js.map +1 -0
  324. package/dist/workspace-runner-stop.d.ts +25 -0
  325. package/dist/workspace-runner-stop.d.ts.map +1 -0
  326. package/dist/workspace-runner-stop.js +44 -0
  327. package/dist/workspace-runner-stop.js.map +1 -0
  328. package/dist/workspace-runner-store.d.ts +26 -0
  329. package/dist/workspace-runner-store.d.ts.map +1 -0
  330. package/dist/workspace-runner-store.js +114 -0
  331. package/dist/workspace-runner-store.js.map +1 -0
  332. package/open-design.json +2 -2
  333. package/package.json +1 -1
  334. package/runtime/codex-conversion/src/images/native-frame.mjs +103 -0
  335. package/runtime/codex-conversion/src/images/native-invoke.mjs +24 -5
  336. package/runtime/codex-conversion/src/images/native.mjs +14 -5
  337. package/runtime/codex-conversion/src/run-store.mjs +21 -1
@@ -18,8 +18,9 @@
18
18
  * Nothing here shows or asks for money.
19
19
  */
20
20
  export const SLATE_UI_DIALOG = String.raw `
21
- var DIALOG_TITLES = { edit: COPY.edit, branch: COPY.branch, convert: COPY.convert };
22
- var DIALOG_VERBS = { edit: COPY.apply, branch: COPY.send, convert: COPY.send };
21
+ // Catalogue keys: the dialog's title is its button's verb, and its primary says what confirming does.
22
+ var DIALOG_TITLES = { edit: "edit", branch: "branch", convert: "convert" };
23
+ var DIALOG_VERBS = { edit: "apply", branch: "send", convert: "send" };
23
24
 
24
25
  function field(labelText, control, id) {
25
26
  var wrap = el("div", "field");
@@ -66,8 +67,35 @@ export const SLATE_UI_DIALOG = String.raw `
66
67
  return row;
67
68
  }
68
69
 
70
+ // ---- the edit instruction, counted as the servers count it: UTF-8 bytes of the words, control characters stripped ----
71
+ var EDIT_PROMPT_MAX_BYTES = __EDIT_PROMPT_MAX_BYTES__;
72
+ function editWords(text) { return String(text || "").replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g, "").trim(); }
73
+ function utf8Bytes(text) {
74
+ var n = 0;
75
+ for (var i = 0; i < text.length; i++) {
76
+ var c = text.charCodeAt(i);
77
+ if (c < 0x80) n += 1;
78
+ else if (c < 0x800) n += 2;
79
+ else if (c >= 0xd800 && c <= 0xdbff && i + 1 < text.length && text.charCodeAt(i + 1) >= 0xdc00 && text.charCodeAt(i + 1) <= 0xdfff) { n += 4; i++; }
80
+ else n += 3;
81
+ }
82
+ return n;
83
+ }
84
+ // How many characters must go from the end of the instruction for it to fit; 0 when it fits.
85
+ function editOverBy(text) {
86
+ var words = editWords(text);
87
+ var over = utf8Bytes(words) - EDIT_PROMPT_MAX_BYTES;
88
+ if (over <= 0) return 0;
89
+ var chars = Array.from(words);
90
+ var cut = 0;
91
+ while (over > 0 && chars.length > 0) { over -= utf8Bytes(chars.pop()); cut++; }
92
+ return cut;
93
+ }
94
+
69
95
  // ---- what this Mac can do now ----
70
96
  function localImage() { return (state.view && state.view.local && state.view.local.image) || { ready: false, reason: null }; }
97
+ // Why this Mac cannot draw, in the person's language when the server named it by code.
98
+ function localReason() { var local = localImage(); return serverText(local.reasonL10n, local.reason); }
71
99
 
72
100
  // ---- open and close ----
73
101
  function openDialog(kind, opener) {
@@ -108,7 +136,7 @@ export const SLATE_UI_DIALOG = String.raw `
108
136
  return compositeMarked(version, d.strokes).then(function (marked) {
109
137
  action.annotated = marked;
110
138
  return action;
111
- }, function (err) { throw new Error(tpl(COPY.markFailed, { detail: errText(err) })); });
139
+ }, function (err) { throw new Error(t("markFailed", { detail: errText(err) })); });
112
140
  }
113
141
  function convertChoice(d) { return CONVERT.choices.filter(function (c) { return c.value === d.format; })[0]; }
114
142
  // An empty width is fine (the service picks); anything else must be a whole number the CLI accepts.
@@ -133,7 +161,7 @@ export const SLATE_UI_DIALOG = String.raw `
133
161
  function dialogReady(d) {
134
162
  var v = ver(d.versionId);
135
163
  // An edit needs a drawing, words or both; Branch has no required field.
136
- if (d.kind === "edit") return localImage().ready && !!v && v.editable && (d.strokes.length > 0 || !!d.prompt.trim());
164
+ if (d.kind === "edit") return localImage().ready && !!v && v.editable && (d.strokes.length > 0 || !!d.prompt.trim()) && editOverBy(d.prompt) === 0;
137
165
  if (d.kind === "branch") return true;
138
166
  return !!convertChoice(d) && widthOf(d).ok;
139
167
  }
@@ -143,8 +171,9 @@ export const SLATE_UI_DIALOG = String.raw `
143
171
  return callTool(TOOLS.run, { runDir: state.view.runDir, opId: opId, action: action }).then(function (result) {
144
172
  var sc = result.structuredContent || {};
145
173
  if (sc.view) applyView(sc.view, true);
146
- // The hosted server has no runner: the person's agent does the work, and is told here (best effort, like Select).
147
- if (TARGET === "remote") remoteTellRun(action, opId);
174
+ // The hosted server draws nothing: the workspace runner on the person's Mac does, or else the person's agent,
175
+ // which is told here (best effort, like Select) only when no runner holds the workspace.
176
+ if (TARGET === "remote") remoteAfterRun(action, opId, sc.runner);
148
177
  return sc;
149
178
  });
150
179
  }
@@ -181,7 +210,7 @@ export const SLATE_UI_DIALOG = String.raw `
181
210
  var wrap = el("div", "imgwrap");
182
211
  wrap.style.setProperty("--ar", String(v.width / v.height));
183
212
  var img = el("img", "stageimg empty");
184
- img.alt = COPY.versionPrefix + v.label;
213
+ img.alt = t("versionName", { label: v.label });
185
214
  img.setAttribute("draggable", "false");
186
215
  wrap.appendChild(img);
187
216
  bindImage(img, v, "full", true);
@@ -191,54 +220,54 @@ export const SLATE_UI_DIALOG = String.raw `
191
220
  box.appendChild(wrap);
192
221
  // Under the image: the hint that it can be drawn on, and the two drawing controls.
193
222
  var tools = el("div", "dialogtools");
194
- tools.appendChild(el("p", "hint", COPY.scribbleHint));
195
- d.els.undo = button(COPY.undo, "", function () { scribbleUndo(d); });
196
- d.els.clear = button(COPY.clear, "", function () { scribbleClear(d); });
223
+ tools.appendChild(el("p", "hint", t("scribbleHint")));
224
+ d.els.undo = button(t("undo"), "", function () { scribbleUndo(d); });
225
+ d.els.clear = button(t("clear"), "", function () { scribbleClear(d); });
197
226
  tools.appendChild(d.els.undo);
198
227
  tools.appendChild(d.els.clear);
199
228
  box.appendChild(tools);
200
- box.appendChild(textarea("dialogedit", 3, COPY.editPlaceholder, 6000, function (value) { d.prompt = value; }, COPY.editAria));
229
+ box.appendChild(textarea("dialogedit", 3, t("editPlaceholder"), 6000, function (value) { d.prompt = value; }, t("editAria")));
201
230
  d.els.help = helpLine("");
202
231
  box.appendChild(d.els.help);
203
232
  }
204
233
  function branchBody(d, box) {
205
- box.appendChild(textarea("dialogbranch", 4, COPY.branchPlaceholder, 2000, function (value) { d.explanation = value; }, COPY.branchAria));
206
- box.appendChild(helpLine(COPY.branchHelp));
234
+ box.appendChild(textarea("dialogbranch", 4, t("branchPlaceholder"), 2000, function (value) { d.explanation = value; }, t("branchAria")));
235
+ box.appendChild(helpLine(t("branchHelp")));
207
236
  }
208
237
  function convertBody(d, box) {
209
238
  var select = el("select");
210
239
  select.id = "dialogformat";
211
240
  var service = el("optgroup");
212
- service.setAttribute("label", COPY.serviceGroup);
241
+ service.setAttribute("label", t("serviceGroup"));
213
242
  CONVERT.choices.forEach(function (choice) {
214
- var option = el("option", "", choice.label);
243
+ var option = el("option", "", choice.labelKey ? t(choice.labelKey) : choice.label);
215
244
  option.setAttribute("value", choice.value);
216
245
  if (choice.value === d.format) option.setAttribute("selected", "");
217
246
  (choice.engine === "local" ? select : service).appendChild(option);
218
247
  });
219
248
  if (service.childNodes.length > 0) select.appendChild(service);
220
249
  select.addEventListener("change", function () { d.format = select.value; updateDialogUi(); });
221
- box.appendChild(field(COPY.convertLabel, select, "dialogformat"));
250
+ box.appendChild(field(t("convertLabel"), select, "dialogformat"));
222
251
  // One line that follows the choice: what the person gets.
223
252
  d.els.formatHelp = helpLine("");
224
253
  box.appendChild(d.els.formatHelp);
225
254
  // The hosted server builds from the image and has nothing else to ask: no quality, width or layouts.
226
255
  if (TARGET === "remote") return;
227
256
  // Only the options the chosen format has are shown; the rest are hidden, not disabled. Each says what it does in one line.
228
- d.els.quality = group(COPY.qualityLabel, radioRow("quality", [{ value: "fast", label: COPY.fast }, { value: "standard", label: COPY.standard }, { value: "pro", label: COPY.pro }], d.quality, function (value) { d.quality = value; }));
229
- d.els.quality.appendChild(helpLine(COPY.qualityHelp));
257
+ d.els.quality = group(t("qualityLabel"), radioRow("quality", [{ value: "fast", label: t("fast") }, { value: "standard", label: t("standard") }, { value: "pro", label: t("pro") }], d.quality, function (value) { d.quality = value; }));
258
+ d.els.quality.appendChild(helpLine(t("qualityHelp")));
230
259
  var width = el("input");
231
260
  width.type = "number";
232
261
  width.id = "dialogwidth";
233
262
  width.setAttribute("min", "1");
234
263
  width.setAttribute("max", String(CONVERT.maxWidth));
235
- width.setAttribute("placeholder", COPY.widthPlaceholder);
264
+ width.setAttribute("placeholder", t("widthPlaceholder"));
236
265
  width.setAttribute("inputmode", "numeric");
237
266
  width.addEventListener("input", function () { d.width = width.value; updateDialogUi(); });
238
- d.els.width = field(COPY.widthLabel, width, "dialogwidth");
239
- d.els.width.appendChild(helpLine(COPY.widthHelp));
240
- d.els.layouts = group(COPY.layoutsLabel, radioRow("layouts", [{ value: "standard", label: COPY.standard }, { value: "pro", label: COPY.pro }], d.layouts, function (value) { d.layouts = value; }));
241
- d.els.layouts.appendChild(helpLine(COPY.layoutsHelp));
267
+ d.els.width = field(t("widthLabel"), width, "dialogwidth");
268
+ d.els.width.appendChild(helpLine(t("widthHelp")));
269
+ d.els.layouts = group(t("layoutsLabel"), radioRow("layouts", [{ value: "standard", label: t("standard") }, { value: "pro", label: t("pro") }], d.layouts, function (value) { d.layouts = value; }));
270
+ d.els.layouts.appendChild(helpLine(t("layoutsHelp")));
242
271
  [d.els.quality, d.els.width, d.els.layouts].forEach(function (node) { box.appendChild(node); });
243
272
  }
244
273
 
@@ -251,8 +280,8 @@ export const SLATE_UI_DIALOG = String.raw `
251
280
  var box = el("div", "modalbox" + (d.kind === "edit" ? " wide" : ""));
252
281
  box.setAttribute("role", "dialog");
253
282
  box.setAttribute("aria-modal", "true");
254
- box.setAttribute("aria-label", DIALOG_TITLES[d.kind]);
255
- box.appendChild(el("h2", "", DIALOG_TITLES[d.kind]));
283
+ box.setAttribute("aria-label", t(DIALOG_TITLES[d.kind]));
284
+ box.appendChild(el("h2", "", t(DIALOG_TITLES[d.kind])));
256
285
  if (d.kind === "edit") editBody(d, box);
257
286
  else if (d.kind === "branch") branchBody(d, box);
258
287
  else convertBody(d, box);
@@ -261,8 +290,8 @@ export const SLATE_UI_DIALOG = String.raw `
261
290
  box.appendChild(d.els.alert);
262
291
  var buttons = el("div", "dialogbtns");
263
292
  buttons.appendChild(el("span", "spacer"));
264
- buttons.appendChild(button(COPY.cancel, "", closeDialog));
265
- d.els.primary = button(DIALOG_VERBS[d.kind], "primary", commitDialog);
293
+ buttons.appendChild(button(t("cancel"), "", closeDialog));
294
+ d.els.primary = button(t(DIALOG_VERBS[d.kind]), "primary", commitDialog);
266
295
  buttons.appendChild(d.els.primary);
267
296
  box.appendChild(buttons);
268
297
  backdrop.appendChild(box);
@@ -280,17 +309,18 @@ export const SLATE_UI_DIALOG = String.raw `
280
309
  // A dialog that cannot run on this Mac says why, in the same line an error would use.
281
310
  var local = localImage();
282
311
  var blockedByLocal = d.kind === "edit" && !local.ready;
283
- d.els.alert.textContent = d.error || (blockedByLocal && local.reason ? local.reason : "");
312
+ var tooLong = d.kind === "edit" ? editOverBy(d.prompt) : 0;
313
+ d.els.alert.textContent = d.error || (blockedByLocal ? localReason() : "") || (tooLong > 0 ? t("editTooLong", { n: tooLong }) : "");
284
314
  d.els.alert.classList.toggle("hidden", !d.els.alert.textContent);
285
315
  if (d.els.undo) d.els.undo.disabled = d.strokes.length === 0 || d.committing;
286
316
  if (d.els.clear) d.els.clear.disabled = d.strokes.length === 0 || d.committing;
287
317
  if (d.els.help) {
288
318
  var marksOnly = d.strokes.length > 0 && !d.prompt.trim();
289
- d.els.help.textContent = marksOnly ? COPY.editHelpMarks : tpl(COPY.editHelp, { label: (ver(d.versionId) || {}).label || "" });
319
+ d.els.help.textContent = marksOnly ? t("editHelpMarks") : t("editHelp", { label: (ver(d.versionId) || {}).label || "" });
290
320
  }
291
321
  if (d.kind === "convert") {
292
322
  var choice = convertChoice(d);
293
- d.els.formatHelp.textContent = (choice && CONVERT.descriptions[choice.value]) || "";
323
+ d.els.formatHelp.textContent = choice && CONVERT.descriptionKeys[choice.value] ? t(CONVERT.descriptionKeys[choice.value]) : "";
294
324
  }
295
325
  if (d.kind === "convert" && TARGET !== "remote") {
296
326
  var isLocal = !!choice && choice.engine === "local";
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-slate-ui-script-dialog.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script-dialog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4SxC,CAAC"}
1
+ {"version":3,"file":"mcp-slate-ui-script-dialog.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script-dialog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0UxC,CAAC"}
@@ -1,10 +1,13 @@
1
1
  /**
2
- * The inline card: one large image of the selected option with a badge, one
3
- * row under it with the strip of thumbnails (the newest round, plus the picked
4
- * or viewed option of an older round) and Select, and one status line;
5
- * an icon-only control opens the workspace. Also the view application, the
6
- * large image and the thumbnail buttons shared with the workspace, and the
7
- * tool-result entry point.
2
+ * The inline card: one large image of the selected option with a badge,
3
+ * Select under it, and the strip of thumbnails (the newest round, plus the
4
+ * picked or viewed option of an older round) on as many rows as it takes,
5
+ * ending with the Generate more tile; an icon-only control opens the
6
+ * workspace. There is no status line: an option being drawn shimmers, one
7
+ * that failed or stopped says why on its tile, and an error about a click
8
+ * shows beside Select. Also the view application, the large image and the
9
+ * thumbnail buttons shared with the workspace, and the tool-result entry
10
+ * point.
8
11
  */
9
12
  export declare const SLATE_UI_INLINE: string;
10
13
  //# sourceMappingURL=mcp-slate-ui-script-inline.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-slate-ui-script-inline.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inline.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,QAsN3B,CAAC"}
1
+ {"version":3,"file":"mcp-slate-ui-script-inline.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,QAgQ3B,CAAC"}
@@ -1,10 +1,13 @@
1
1
  /**
2
- * The inline card: one large image of the selected option with a badge, one
3
- * row under it with the strip of thumbnails (the newest round, plus the picked
4
- * or viewed option of an older round) and Select, and one status line;
5
- * an icon-only control opens the workspace. Also the view application, the
6
- * large image and the thumbnail buttons shared with the workspace, and the
7
- * tool-result entry point.
2
+ * The inline card: one large image of the selected option with a badge,
3
+ * Select under it, and the strip of thumbnails (the newest round, plus the
4
+ * picked or viewed option of an older round) on as many rows as it takes,
5
+ * ending with the Generate more tile; an icon-only control opens the
6
+ * workspace. There is no status line: an option being drawn shimmers, one
7
+ * that failed or stopped says why on its tile, and an error about a click
8
+ * shows beside Select. Also the view application, the large image and the
9
+ * thumbnail buttons shared with the workspace, and the tool-result entry
10
+ * point.
8
11
  */
9
12
  export const SLATE_UI_INLINE = String.raw `
10
13
  // ---- apply a view: selection, announcements, polling, render ----
@@ -32,13 +35,14 @@ export const SLATE_UI_INLINE = String.raw `
32
35
  state.awaitEdit = null;
33
36
  }
34
37
  }
35
- syncOpStatus(prev, view);
38
+ syncStaleLine(view);
39
+ syncPause();
36
40
  if (view.pick && pickRestored !== view.runDir) {
37
41
  pickRestored = view.runDir;
38
42
  var earlier = ver(view.pick.versionId);
39
43
  if (earlier) state.sel = { candidateId: earlier.candidateId, versionId: earlier.versionId, followLatest: false };
40
- if (!fromPoll && view.pick.fileState === "missing") setStatus(COPY.pickMissing, "err");
41
- else if (!fromPoll && view.pick.fileState === "changed") setStatus(COPY.pickChanged, "err");
44
+ if (!fromPoll && view.pick.fileState === "missing") setStatus(t("pickMissing"), "err");
45
+ else if (!fromPoll && view.pick.fileState === "changed") setStatus(t("pickChanged"), "err");
42
46
  }
43
47
  ensureSelection();
44
48
  renderAll();
@@ -55,9 +59,24 @@ export const SLATE_UI_INLINE = String.raw `
55
59
  // A dialog that is open follows the view: what this Mac can do now, for one.
56
60
  if (state.dialog) updateDialogUi();
57
61
  syncMore();
62
+ if (pause.opId) syncPauseBars();
58
63
  reportSize();
59
64
  }
60
65
 
66
+ // A new language: every container is built again in it on the next render. An open dialog and the Generate more panel
67
+ // close, because they were built in the old words; what the person typed in the search box stays (state.query).
68
+ function relocalizeView() {
69
+ if (state.dialog) { state.dialog = null; if (stageEls.dialog) stageEls.dialog.textContent = ""; }
70
+ if (state.more) resetMore();
71
+ $("hero").__sig = null;
72
+ $("strip").__sig = null;
73
+ $("pausebar").__pause = null;
74
+ var pane = $("pane-inspiration");
75
+ pane.__built = false;
76
+ pane.textContent = "";
77
+ stageBuilt = false;
78
+ }
79
+
61
80
  // Rebuild a container only when what it shows changed, so polling never steals focus or discards typing.
62
81
  function setIfChanged(node, signature, build) {
63
82
  if (node.__sig === signature) return false;
@@ -69,13 +88,14 @@ export const SLATE_UI_INLINE = String.raw `
69
88
 
70
89
  // ---- the large image, shared by the card and the workspace ----
71
90
  function pickable(version) { return !!version && version.fileState === "ok"; }
72
- // Why an option has no picture to show, or "" when it has one.
91
+ // Why an option has no picture to show, or "" when it has one. One being drawn is named; the shimmer says the rest.
73
92
  function optionNote(c) {
74
93
  var v = latestVersion(c);
75
- if (c.state === "failed") return c.error || optionName(c);
76
- if (c.state === "pending") return optionName(c);
77
- if (v && v.fileState === "missing") return COPY.fileMissing;
78
- if (v && v.fileState === "changed") return COPY.fileChanged;
94
+ if (c.state === "failed") return serverText(c.errorL10n, c.error) || optionName(c);
95
+ if (pausedFor(c)) return pausedRef(c) ? t("pauseDrawsFrom", { label: c.label }) : t("pauseNoReference");
96
+ if (c.state === "pending") return drawing(c) ? optionName(c) : stoppedReason(c);
97
+ if (v && v.fileState === "missing") return t("fileMissing");
98
+ if (v && v.fileState === "changed") return t("fileChanged");
79
99
  return "";
80
100
  }
81
101
  // The full picture jumps the queue; while it loads, the thumbnail (already fetched) stands in.
@@ -87,16 +107,18 @@ export const SLATE_UI_INLINE = String.raw `
87
107
  var shared = wrap.parentElement;
88
108
  if (shared) shared.style.removeProperty("--ar");
89
109
  if (!c) return;
110
+ var waitingRef = !v ? pausedRef(c) : null;
111
+ if (waitingRef) { pausedHeroInto(wrap, shared, c, waitingRef); return; }
90
112
  if (!v || v.fileState !== "ok") {
91
113
  wrap.classList.add("note");
92
- var reason = !v ? optionNote(c) : v.fileState === "changed" ? COPY.fileChanged : COPY.fileMissing;
93
- wrap.appendChild(el("div", "heronote" + (c.state === "pending" ? " shimmer" : ""), reason));
114
+ var reason = !v ? optionNote(c) : v.fileState === "changed" ? t("fileChanged") : t("fileMissing");
115
+ wrap.appendChild(el("div", "heronote" + (drawing(c) ? " shimmer" : ""), reason));
94
116
  return;
95
117
  }
96
118
  wrap.style.setProperty("--ar", String(v.width / v.height));
97
119
  if (shared) shared.style.setProperty("--ar", String(v.width / v.height));
98
120
  var img = el("img", "heroimg empty");
99
- img.alt = COPY.versionPrefix + v.label;
121
+ img.alt = t("versionName", { label: v.label });
100
122
  img.setAttribute("draggable", "false");
101
123
  wrap.appendChild(img);
102
124
  bindImage(img, v, "full", true);
@@ -105,11 +127,26 @@ export const SLATE_UI_INLINE = String.raw `
105
127
  wrap.appendChild(el("span", "badge", v.label));
106
128
  if (c.busy) wrap.appendChild(progressBar());
107
129
  }
130
+ // An option of a round that waits for the person: the reference it will be drawn from, at that picture's ratio, named.
131
+ function pausedHeroInto(wrap, shared, c, referenceId) {
132
+ var meta = refMeta(referenceId);
133
+ var ratio = meta && meta.width > 0 && meta.height > 0 ? meta.width / meta.height : ratioOf(c);
134
+ wrap.style.setProperty("--ar", String(ratio));
135
+ if (shared) shared.style.setProperty("--ar", String(ratio));
136
+ var img = el("img", "heroimg empty");
137
+ img.alt = t("pauseDrawsFrom", { label: c.label });
138
+ img.setAttribute("draggable", "false");
139
+ wrap.appendChild(img);
140
+ fillImage(img, wantReference(referenceId, "thumb", true));
141
+ wrap.appendChild(el("span", "badge", t("pauseReferenceFor", { label: c.label })));
142
+ }
108
143
  function heroSignature(c, v) {
109
- return JSON.stringify([state.sel, v && [v.sha256, v.fileState, v.label], c && [c.state, c.error, c.busy]]);
144
+ return JSON.stringify([state.sel, v && [v.sha256, v.fileState, v.label], c && [c.state, c.error, c.busy, drawing(c), optionNote(c), pausedRef(c)]]);
110
145
  }
111
146
 
112
- // ---- a small thumbnail button for an option: the strip in the card, the selection in the workspace ----
147
+ // ---- a thumbnail button for an option: the strip in the card, the selection in the workspace ----
148
+ // The tile has the option's own ratio. With a picture it holds the picture (an <img> only once there is a file to
149
+ // show); being drawn it shimmers; without a picture otherwise it says why on the tile. Its code is always on it.
113
150
  function thumbButton(c, cls) {
114
151
  var b = button("", cls);
115
152
  var selected = state.sel.candidateId === c.candidateId;
@@ -117,75 +154,83 @@ export const SLATE_UI_INLINE = String.raw `
117
154
  b.setAttribute("aria-pressed", selected ? "true" : "false");
118
155
  if (selected) b.classList.add("selected");
119
156
  b.setAttribute("data-option", c.label);
157
+ b.style.setProperty("--ar", String(ratioOf(c)));
120
158
  var v = latestVersion(c);
121
- var note = optionNote(c);
122
- if (note && c.state !== "pending") b.title = note;
123
- if (c.state === "failed" || (v && v.fileState !== "ok")) b.classList.add("failed");
124
- if (c.state === "pending") b.classList.add("shimmer");
125
- var img = el("img", "thumb empty");
126
- img.alt = "";
127
- if (v && v.fileState === "ok" && c.state === "ready") bindImage(img, v, "thumb", false);
128
- else img.setAttribute("data-nofile", "");
129
- b.appendChild(img);
159
+ var waitingRef = pausedRef(c);
160
+ if (drawing(c)) b.classList.add("shimmer");
161
+ else if (waitingRef) {
162
+ // Not drawn yet: the tile shows the reference this option will be drawn from.
163
+ b.classList.add("paused");
164
+ b.title = t("pauseDrawsFrom", { label: c.label });
165
+ var ref = el("img", "thumb empty");
166
+ ref.alt = "";
167
+ b.appendChild(ref);
168
+ bindReference(ref, waitingRef, "thumb");
169
+ } else if (c.state === "ready" && v && v.fileState === "ok") {
170
+ var img = el("img", "thumb empty");
171
+ img.alt = "";
172
+ b.appendChild(img);
173
+ bindImage(img, v, "thumb", false);
174
+ } else {
175
+ var note = optionNote(c);
176
+ b.title = note;
177
+ b.classList.add(c.state === "pending" ? "stopped" : "failed");
178
+ var words = el("span", "tilenote");
179
+ words.appendChild(el("span", "", note));
180
+ b.appendChild(words);
181
+ }
130
182
  b.appendChild(el("b", "code", c.label));
131
183
  b.addEventListener("click", function () { selectCandidate(c.candidateId); });
132
184
  return b;
133
185
  }
134
186
  function thumbSignature(c) {
135
187
  var lv = latestVersion(c);
136
- return [c.candidateId, c.state, c.error, c.latestVersionId, c.versionIds.length, lv ? lv.fileState : ""];
188
+ return [c.candidateId, c.state, c.error, c.latestVersionId, c.versionIds.length, lv ? lv.fileState : "", drawing(c), optionNote(c), ratioOf(c), pausedRef(c)];
137
189
  }
138
190
 
139
191
  function renderInline() {
140
192
  var v = state.view;
141
193
  var empty = v.candidates.length === 0;
142
194
  $("empty").classList.toggle("hidden", !empty);
143
- $("empty").textContent = COPY.empty;
195
+ $("empty").textContent = t("empty");
144
196
  $("card").classList.toggle("hidden", empty);
145
197
  if (empty) { reportSize(); return; }
146
198
  syncTabs();
147
199
  var onDesigns = state.tab === "designs";
148
200
  $("pane-designs").classList.toggle("hidden", !onDesigns);
149
201
  $("pane-inspiration").classList.toggle("hidden", onDesigns);
202
+ syncPauseHost($("pausebar"), true);
150
203
  if (!onDesigns) {
151
204
  renderInspiration($("pane-inspiration"), "card");
152
205
  syncControls();
153
206
  reportSize();
154
207
  return;
155
208
  }
156
- syncProgressLine(v);
157
209
  var c = selectedCandidate();
158
210
  var sel = selectedVersion();
159
211
  setIfChanged($("hero"), heroSignature(c, sel), function (node) { heroInto(node, c, sel); });
160
212
  var strip = $("strip");
161
- // Where keyboard focus sits among the strip's buttons (the thumbnails), so a rebuild can put it back.
213
+ // Where keyboard focus sits among the strip's buttons (the thumbnails and the tile), so a rebuild can put it back.
162
214
  var focusAt = strip.contains(document.activeElement) ? Array.prototype.indexOf.call(strip.querySelectorAll("button"), document.activeElement) : -1;
163
215
  var options = inlineCandidates();
164
216
  var rebuilt = setIfChanged(strip, JSON.stringify([state.sel.candidateId, options.map(thumbSignature)]), function (node) {
165
217
  options.forEach(function (x) { node.appendChild(thumbButton(x, "thumbbtn")); });
218
+ // The strip wraps onto as many rows as it needs, so the Generate more tile, last, is always in view after the options.
219
+ node.appendChild(moreTile());
220
+ setShape(node, ratioOf(options[0]));
166
221
  });
167
- // The Generate more tile is pinned beside the strip, outside its scroll, so it is never pushed out of view; built once.
168
- var wrap = $("stripwrap");
169
- if (!wrap.querySelector(".moretile")) wrap.appendChild(moreTile());
170
222
  // Choosing a thumbnail rebuilds the strip: keep keyboard focus at the same place in it.
171
223
  var stripButtons = strip.querySelectorAll("button");
172
224
  if (rebuilt && focusAt >= 0 && stripButtons[focusAt]) stripButtons[focusAt].focus();
173
- var shown = Array.prototype.filter.call(strip.children, function (b) { return b.classList.contains("selected"); })[0];
174
- if (rebuilt && shown && shown.scrollIntoView && strip.scrollWidth > strip.clientWidth) { try { shown.scrollIntoView({ inline: "nearest", block: "nearest" }); } catch (e) { /* best effort */ } }
175
- strip.classList.toggle("fade", strip.scrollWidth > strip.clientWidth + 1);
176
225
  syncControls();
177
226
  reportSize();
178
227
  }
179
- window.addEventListener("resize", function () {
180
- var strip = $("strip");
181
- if (strip) strip.classList.toggle("fade", strip.scrollWidth > strip.clientWidth + 1);
182
- });
183
228
 
184
229
  function syncControls() {
185
230
  if (!state.view) return;
186
231
  var v = selectedVersion();
187
232
  var same = samePick(v);
188
- var label = same ? COPY.selected : COPY.select;
233
+ var label = same ? t("selected") : t("select");
189
234
  var disabled = !(pickable(v) && !state.busy && !same);
190
235
  if (!isFullscreen()) {
191
236
  var expand = $("expand");
@@ -211,12 +256,12 @@ export const SLATE_UI_INLINE = String.raw `
211
256
  // ---- tool result: the workspace ----
212
257
  function onToolResult(result) {
213
258
  if (!result || result.isError) {
214
- var t = result && result.content && result.content[0] && result.content[0].text;
215
- fatal(COPY.toolError + (t ? ": " + t : "."));
259
+ var said = result && result.content && result.content[0] && result.content[0].text;
260
+ fatal(said ? t("toolErrorDetail", { detail: said }) : t("toolError"));
216
261
  return;
217
262
  }
218
263
  var data = result.structuredContent;
219
- if (!data || !Array.isArray(data.candidates)) { fatal(COPY.noView); return; }
264
+ if (!data || !Array.isArray(data.candidates)) { fatal(t("noView")); return; }
220
265
  applyView(data, false);
221
266
  }
222
267
 
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-slate-ui-script-inline.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inline.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsNxC,CAAC"}
1
+ {"version":3,"file":"mcp-slate-ui-script-inline.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgQxC,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The Inspiration tab's collage: every grid of reference tiles (and the skeleton tiles of a search in flight) is laid
3
+ * out by the 12ui web gallery's own mosaic band solver, `packMosaicBands` from `mosaic-bands.ts`, whose source is
4
+ * embedded here as is. Each picture keeps its aspect ratio (from the reference's recorded width and height, else its
5
+ * recorded aspect, by the solver's own rule) and every band is exactly as wide as the grid.
6
+ *
7
+ * Only the packing is the screen's (the gallery's is sized for cards with an action strip on a whole page):
8
+ *
9
+ * - a band plans its pictures at least 192 px across in the card and 256 px in the workspace (the old square tiles'
10
+ * minimums), two across at the least, and holds at most four columns; the gap is 8 px, room for a selected tile's
11
+ * ring;
12
+ * - a section with fewer pictures than a row holds is as wide as those pictures would be in a full row, so a round
13
+ * with one reference shows one tile, not one picture as wide as the pane.
14
+ *
15
+ * The grid is measured, so it is laid out after it is built and again whenever the pane's width changes (a window
16
+ * resize, the card's scroll bar, the tab shown again). Tiles stay in result order in the document, so the keyboard
17
+ * walks them in the order the search ranked them.
18
+ */
19
+ export declare const SLATE_UI_INSPIRATION_COLLAGE: string;
20
+ //# sourceMappingURL=mcp-slate-ui-script-inspiration-collage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-slate-ui-script-inspiration-collage.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inspiration-collage.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,4BAA4B,QA+CxC,CAAC"}
@@ -0,0 +1,68 @@
1
+ import { packMosaicBands } from './mosaic-bands.js';
2
+ /**
3
+ * The Inspiration tab's collage: every grid of reference tiles (and the skeleton tiles of a search in flight) is laid
4
+ * out by the 12ui web gallery's own mosaic band solver, `packMosaicBands` from `mosaic-bands.ts`, whose source is
5
+ * embedded here as is. Each picture keeps its aspect ratio (from the reference's recorded width and height, else its
6
+ * recorded aspect, by the solver's own rule) and every band is exactly as wide as the grid.
7
+ *
8
+ * Only the packing is the screen's (the gallery's is sized for cards with an action strip on a whole page):
9
+ *
10
+ * - a band plans its pictures at least 192 px across in the card and 256 px in the workspace (the old square tiles'
11
+ * minimums), two across at the least, and holds at most four columns; the gap is 8 px, room for a selected tile's
12
+ * ring;
13
+ * - a section with fewer pictures than a row holds is as wide as those pictures would be in a full row, so a round
14
+ * with one reference shows one tile, not one picture as wide as the pane.
15
+ *
16
+ * The grid is measured, so it is laid out after it is built and again whenever the pane's width changes (a window
17
+ * resize, the card's scroll bar, the tab shown again). Tiles stay in result order in the document, so the keyboard
18
+ * walks them in the order the search ranked them.
19
+ */
20
+ export const SLATE_UI_INSPIRATION_COLLAGE = String.raw `
21
+ // ---- the collage: the web gallery's mosaic bands (packages/12ui/src/mosaic-bands.ts) ----
22
+ var packMosaicBands = (${packMosaicBands.toString()});
23
+ var COLLAGE = { min: { card: 192, stage: 256 }, gap: 8, columns: 4 };
24
+ // How a grid of this many pictures packs at this width: the width it takes and the band packing.
25
+ function collagePacking(count, width, where) {
26
+ var gap = COLLAGE.gap;
27
+ var across = Math.max(2, Math.floor((width + gap) / (COLLAGE.min[where] + gap)));
28
+ if (count < across) {
29
+ var tile = (width - (across - 1) * gap) / across;
30
+ width = count * tile + (count - 1) * gap;
31
+ across = count;
32
+ }
33
+ return { width: width, packing: { columns: Math.min(across, COLLAGE.columns), across: across, gap: gap } };
34
+ }
35
+ // A tile's shape: the reference's recorded aspect and size, or a 16:10 landscape for a skeleton tile.
36
+ function collageShape(node, referenceId) {
37
+ var meta = referenceId && state.view.references ? state.view.references[referenceId] : null;
38
+ node.__shape = meta ? { aspect: meta.aspect, width: meta.width, height: meta.height } : { aspect: "landscape", width: null, height: null };
39
+ }
40
+ function layoutGrid(grid, where, width) {
41
+ var tiles = grid.children;
42
+ var items = [];
43
+ for (var i = 0; i < tiles.length; i++) {
44
+ var shape = tiles[i].__shape;
45
+ items.push({ id: String(i), aspect: shape.aspect, width: shape.width, height: shape.height });
46
+ }
47
+ var plan = collagePacking(items.length, width, where);
48
+ var layout = packMosaicBands(items, plan.width, plan.packing, 0);
49
+ layout.placements.forEach(function (p) {
50
+ var s = tiles[Number(p.id)].style;
51
+ s.left = p.left + "px";
52
+ s.top = p.top + "px";
53
+ s.width = p.width + "px";
54
+ s.height = p.height + "px";
55
+ });
56
+ grid.style.height = layout.height + "px";
57
+ grid.__laidAt = width;
58
+ }
59
+ // Lays out every grid in the pane that has a width and was not laid out at it (a hidden pane has none: it is laid out when shown).
60
+ function layoutResults(pane) {
61
+ var grids = pane.__results.querySelectorAll(".refgrid");
62
+ for (var i = 0; i < grids.length; i++) {
63
+ var width = grids[i].getBoundingClientRect().width;
64
+ if (width > 0 && grids[i].__laidAt !== width) layoutGrid(grids[i], pane.__where, width);
65
+ }
66
+ }
67
+ `;
68
+ //# sourceMappingURL=mcp-slate-ui-script-inspiration-collage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-slate-ui-script-inspiration-collage.js","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inspiration-collage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,GAAG,CAAA;;2BAE3B,eAAe,CAAC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CpD,CAAC"}
@@ -0,0 +1,26 @@
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 declare const SLATE_UI_INSPIRATION_GRID: string;
26
+ //# sourceMappingURL=mcp-slate-ui-script-inspiration-grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-slate-ui-script-inspiration-grid.d.ts","sourceRoot":"","sources":["../src/mcp-slate-ui-script-inspiration-grid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,yBAAyB,QA4NrC,CAAC"}