@kitn.ai/ui 0.28.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (615) hide show
  1. package/README.md +11 -7
  2. package/dist/{Icon-DObhsRtm.js → Icon-BzBET3E-.js} +1 -1
  3. package/dist/{action-icons-CcgNN2oT.js → action-icons-DaW2pU6m.js} +1 -1
  4. package/dist/agent-tooling/construct/public.d.ts +15 -0
  5. package/dist/agent-tooling/construct/schema.d.ts +111 -0
  6. package/dist/arrow-down-D783iMJj.js +1 -0
  7. package/dist/arrow-left-0VLM5kyg.js +1 -0
  8. package/dist/artifact-DGjzHYUT.js +1 -0
  9. package/dist/{attachments-Qr4kg-2b.js → attachments-YvXHlg88.js} +1 -1
  10. package/dist/{audio-visualizer-DToYdfSc.js → audio-visualizer-9lz5IHsL.js} +1 -1
  11. package/dist/{badge-CdEu_jn2.js → badge-Dh_vp8A5.js} +1 -1
  12. package/dist/{bell-DQAAOpDz.js → bell-CT7_WUwS.js} +1 -1
  13. package/dist/{button-DkuOnGLy.js → button-C_3te6fm.js} +1 -1
  14. package/dist/{card-renderer-Jx70m6_l.js → card-renderer-DZVaGH2e.js} +1 -1
  15. package/dist/check-CiEOVnEN.js +1 -0
  16. package/dist/{checkbox-D7iRB3nL.js → checkbox-Bu2T2e0U.js} +1 -1
  17. package/dist/{checkbox-group-B2_rpoPM.js → checkbox-group-BiryEXPQ.js} +1 -1
  18. package/dist/chevron-down-CSobuZRG.js +1 -0
  19. package/dist/chevron-right-DR9ZAP-2.js +1 -0
  20. package/dist/{choice-card-m0BYqqOK.js → choice-card-CM6IjkmL.js} +1 -1
  21. package/dist/circle-BC66EYF7.js +1 -0
  22. package/dist/circle-check-BqmahW0O.js +1 -0
  23. package/dist/{circle-x-BPG0iPst.js → circle-x-Bk-dA5Wf.js} +1 -1
  24. package/dist/{code-block-ClMLKb7C.js → code-block-B26t-Q7q.js} +1 -1
  25. package/dist/{collapsible-B4DlWicL.js → collapsible-Bhc636Cf.js} +1 -1
  26. package/dist/components/builder-composer-triggers.d.ts +62 -0
  27. package/dist/components/builder-layout.d.ts +54 -0
  28. package/dist/components/builder-message-actions.d.ts +72 -0
  29. package/dist/components/builder-panel.d.ts +189 -0
  30. package/dist/components/builder-preview.d.ts +11 -0
  31. package/dist/components/builder-shell-controls.d.ts +69 -0
  32. package/dist/components/builder-skeleton.d.ts +58 -0
  33. package/dist/components/builder-start.d.ts +75 -0
  34. package/dist/components/builder-workspace-variants.d.ts +23 -0
  35. package/dist/components/captions.d.ts +66 -0
  36. package/dist/{composer-sQ0HcvyG.js → composer-DMI85B6j.js} +1 -1
  37. package/dist/{confirm-card-rQWDQsnC.js → confirm-card-B0YIAwXp.js} +1 -1
  38. package/dist/construct-cli.es.js +3 -3
  39. package/dist/construct.d.ts +5 -0
  40. package/dist/construct.js +327 -0
  41. package/dist/{context-0kg4ZX1J.js → context-DWgfhqWp.js} +1 -1
  42. package/dist/controllable-BagRpyHv.js +1 -0
  43. package/dist/{conversation-item-BxwQLaFJ.js → conversation-item-BsOsVGmT.js} +1 -1
  44. package/dist/{conversation-list-BCfGN1JU.js → conversation-list-aX3Vtc7L.js} +1 -1
  45. package/dist/{copy-n9u9rqpi.js → copy-BmEwsNhJ.js} +1 -1
  46. package/dist/core-C8fzo39E.js +1 -12
  47. package/dist/{create-tween-uPkArjIG.js → create-tween-CNOAU3Fx.js} +1 -1
  48. package/dist/{create-tween-C-q-JCM-.js → create-tween-WfqiENls.js} +1 -1
  49. package/dist/{create-tween-CRrJXxBd.js → create-tween-wlFtW9Kh.js} +1 -1
  50. package/dist/{create-tween-DZ3RRDHD.js → create-tween-zt79ba32.js} +1 -1
  51. package/dist/{default-input-CaMrJkgH.js → default-input-DMV5Eaze.js} +1 -1
  52. package/dist/define-CI0y3eE4.js +1 -0
  53. package/dist/define.js +40 -40
  54. package/dist/define.server.js +45 -45
  55. package/dist/{disclosure-WUImBbDv.js → disclosure-NnACBxsC.js} +1 -1
  56. package/dist/{dropdown-wZVeJOMd.js → dropdown-DT7G0RGR.js} +1 -1
  57. package/dist/elements/agent-card.js +1 -1
  58. package/dist/elements/artifact.js +1 -1
  59. package/dist/elements/attachments.js +1 -1
  60. package/dist/elements/audio-visualizer.js +1 -1
  61. package/dist/elements/avatar.js +1 -1
  62. package/dist/elements/badge.js +1 -1
  63. package/dist/elements/button.js +1 -1
  64. package/dist/elements/card.js +1 -1
  65. package/dist/elements/cards.js +1 -1
  66. package/dist/elements/chain-of-thought.js +1 -1
  67. package/dist/elements/chat-scope-picker.js +1 -1
  68. package/dist/elements/chat-workspace.js +1 -1
  69. package/dist/elements/chat.js +1 -1
  70. package/dist/elements/checkbox-group.js +1 -1
  71. package/dist/elements/checkbox.js +1 -1
  72. package/dist/elements/checkpoint.js +1 -1
  73. package/dist/elements/choice.js +1 -1
  74. package/dist/elements/coachmark.js +1 -1
  75. package/dist/elements/code-block.js +1 -1
  76. package/dist/elements/command.js +1 -1
  77. package/dist/elements/compare.js +1 -1
  78. package/dist/elements/composer.js +1 -1
  79. package/dist/elements/confirm-card.js +1 -1
  80. package/dist/elements/context-meter.js +1 -1
  81. package/dist/elements/conversation-item.js +1 -1
  82. package/dist/elements/conversation-list.js +1 -1
  83. package/dist/elements/dialog.js +1 -1
  84. package/dist/elements/dock.js +1 -1
  85. package/dist/elements/dropdown.js +1 -1
  86. package/dist/elements/editable-label.js +1 -1
  87. package/dist/elements/embed.js +1 -1
  88. package/dist/elements/empty.js +1 -1
  89. package/dist/elements/feedback-bar.js +1 -1
  90. package/dist/elements/file-tree.js +1 -1
  91. package/dist/elements/file-upload.js +1 -1
  92. package/dist/elements/form.js +1 -1
  93. package/dist/elements/hover-card.js +1 -1
  94. package/dist/elements/icon.js +1 -1
  95. package/dist/elements/image.js +1 -1
  96. package/dist/elements/input.js +1 -1
  97. package/dist/elements/kbd.js +1 -1
  98. package/dist/elements/link-preview.js +1 -1
  99. package/dist/elements/loader.js +1 -1
  100. package/dist/elements/markdown.js +1 -1
  101. package/dist/elements/menu.js +1 -1
  102. package/dist/elements/message-skills.js +1 -1
  103. package/dist/elements/message.js +1 -1
  104. package/dist/elements/model-switcher.js +1 -1
  105. package/dist/elements/nav.js +1 -1
  106. package/dist/elements/notice.js +1 -1
  107. package/dist/elements/pane-grid.js +1 -1
  108. package/dist/elements/pane-group.js +1 -1
  109. package/dist/elements/pane.js +1 -1
  110. package/dist/elements/popover.js +1 -1
  111. package/dist/elements/progress-bar.js +1 -1
  112. package/dist/elements/prompt-dock.js +1 -1
  113. package/dist/elements/prompt-input.js +1 -1
  114. package/dist/elements/prompt-suggestions.js +1 -1
  115. package/dist/elements/radio-group.js +1 -1
  116. package/dist/elements/reasoning.js +1 -1
  117. package/dist/elements/remote.js +1 -1
  118. package/dist/elements/resizable.js +1 -1
  119. package/dist/elements/response-stream.js +1 -1
  120. package/dist/elements/screen.js +1 -1
  121. package/dist/elements/scroll-area.js +1 -1
  122. package/dist/elements/scroll-button.js +1 -1
  123. package/dist/elements/search.js +1 -1
  124. package/dist/elements/segmented.js +1 -1
  125. package/dist/elements/select.js +1 -1
  126. package/dist/elements/separator.js +1 -1
  127. package/dist/elements/setting-item.js +1 -1
  128. package/dist/elements/settings-group.js +1 -1
  129. package/dist/elements/skeleton.js +1 -1
  130. package/dist/elements/slider.js +1 -1
  131. package/dist/elements/source.js +1 -1
  132. package/dist/elements/status.js +1 -1
  133. package/dist/elements/switch.js +1 -1
  134. package/dist/elements/tabs.js +1 -1
  135. package/dist/elements/tasks.js +1 -1
  136. package/dist/elements/text-shimmer.js +1 -1
  137. package/dist/elements/thinking-bar.js +1 -1
  138. package/dist/elements/thread.js +1 -1
  139. package/dist/elements/toast.js +1 -1
  140. package/dist/elements/tool.js +1 -1
  141. package/dist/elements/tooltip.js +1 -1
  142. package/dist/elements/voice-input.js +1 -1
  143. package/dist/elements/voice-output.js +1 -1
  144. package/dist/{ellipsis-CbOpJnU3.js → ellipsis-6pJ7SxYT.js} +1 -1
  145. package/dist/{embed-CrfjkbUG.js → embed-BMje-nxj.js} +1 -1
  146. package/dist/engine-javascript-C1x7zo1_.js +1 -141
  147. package/dist/{external-link-ByXAwBBQ.js → external-link-Beh9DKeR.js} +1 -1
  148. package/dist/{file-text-DMib2qwt.js → file-text-D1GPfZ8Q.js} +1 -1
  149. package/dist/{file-tree-CJqM2aP7.js → file-tree-Dwj2lqg-.js} +1 -1
  150. package/dist/{folder-_BAb929C.js → folder-b6D8x1DY.js} +1 -1
  151. package/dist/{form-DSZgZQZk.js → form-DWgdxDXu.js} +1 -1
  152. package/dist/{hover-card-BQbul9eq.js → hover-card-CWRkqm40.js} +1 -1
  153. package/dist/{icon-CdcfRhYI.js → icon-CL0jdhsf.js} +1 -1
  154. package/dist/index.js +1741 -1725
  155. package/dist/index.server.js +1582 -1566
  156. package/dist/{info-DsFjGuI_.js → info-0cOUherQ.js} +1 -1
  157. package/dist/{input-DKbmkMos.js → input-BH6Ru91Q.js} +1 -1
  158. package/dist/kai.es.js +1 -1
  159. package/dist/{kbd-PvdGhX4s.js → kbd-DRAnVtNX.js} +1 -1
  160. package/dist/{link-zF8PzWfF.js → link-Dlr0vssB.js} +1 -1
  161. package/dist/{link-preview-DbM1866N.js → link-preview-DODgRyV9.js} +1 -1
  162. package/dist/loader-KvJB6NrT.js +1 -0
  163. package/dist/{markdown-LMvmAyBk.js → markdown-DX9tuJVj.js} +1 -1
  164. package/dist/mcp.es.js +9 -5
  165. package/dist/{message-BYZECyek.js → message-BqQ7Ot5q.js} +1 -1
  166. package/dist/{message-BSsgvHvf.js → message-DkaGfBd8.js} +1 -1
  167. package/dist/message-circle-BPpp5QKv.js +1 -0
  168. package/dist/message-square-BLbsd9BJ.js +1 -0
  169. package/dist/{minimize-2-BQRoBV1V.js → minimize-2-CyOHJwcN.js} +1 -1
  170. package/dist/{model-switcher-CMpCOYcB.js → model-switcher-0hrKDiK2.js} +1 -1
  171. package/dist/{overlay-Cb-MkyDa.js → overlay-DBMFXie6.js} +1 -1
  172. package/dist/{panel-right-i8warFxT.js → panel-right-t8SWJL6e.js} +1 -1
  173. package/dist/{paperclip-ByY3UVO6.js → paperclip-CdzuOjbU.js} +1 -1
  174. package/dist/play-BXy1u7rW.js +1 -0
  175. package/dist/primitives/use-auto-resize.d.ts +11 -0
  176. package/dist/{progress-bar-jVAHvMUf.js → progress-bar-CiBtxMWT.js} +1 -1
  177. package/dist/{prompt-suggestion-CD-qtNgC.js → prompt-suggestion-I_DHP21i.js} +1 -1
  178. package/dist/{radio-BsoBMhkF.js → radio-C_p3n39l.js} +1 -1
  179. package/dist/{reasoning-4kBPtlTx.js → reasoning-BDwy_tIe.js} +1 -1
  180. package/dist/register-impl-DvEnhIxx.js +424 -0
  181. package/dist/{resizable-uPmY9VY-.js → resizable-SYC-fStM.js} +1 -1
  182. package/dist/{rotate-ccw-B2xn93py.js → rotate-ccw-B1nwmwuY.js} +1 -1
  183. package/dist/{rotate-cw-CMVLoCyH.js → rotate-cw-CLAnBcm1.js} +1 -1
  184. package/dist/{scroll-area-BqLUo8ZZ.js → scroll-area-zRyXoLhI.js} +1 -1
  185. package/dist/{scroll-button-DslXiJyL.js → scroll-button-jzrbYCG9.js} +1 -1
  186. package/dist/{select-2cLRtPGT.js → select-DM-0nEe0.js} +1 -1
  187. package/dist/{separator-BWQtNJcM.js → separator-BToOOoOt.js} +1 -1
  188. package/dist/{settings-BBR63jLg.js → settings-PaGo_S4U.js} +1 -1
  189. package/dist/{settings-group-B2ciy-Iw.js → settings-group-BFXGIfXq.js} +1 -1
  190. package/dist/{skeleton-CkHI-HgC.js → skeleton-DYpmFnnm.js} +1 -1
  191. package/dist/{slider-DDR9U-i0.js → slider-ebutAmkQ.js} +1 -1
  192. package/dist/{solid-DruVOXnf.js → solid-15v_3WVL.js} +3563 -3412
  193. package/dist/{solid-BzCFdL25.js → solid-5P-otgdi.js} +4502 -4296
  194. package/dist/solid.d.ts +6 -0
  195. package/dist/solid.js +259 -254
  196. package/dist/solid.server.js +259 -254
  197. package/dist/{source-GEnFF528.js → source-c1gpRl9h.js} +1 -1
  198. package/dist/{star-CilHq8GP.js → star-pcV_3LqF.js} +1 -1
  199. package/dist/{store-Ciyk6eZG.js → store-CSgbFFCg.js} +1 -1
  200. package/dist/{switch-KkeQIbuH.js → switch-Bh2OdLV2.js} +1 -1
  201. package/dist/{tasks-card-BrN4bggJ.js → tasks-card-CbqQAn2S.js} +1 -1
  202. package/dist/text-shimmer-BSzgEnDH.js +1 -0
  203. package/dist/textarea-DrYNt_0z.js +1 -0
  204. package/dist/theme.tokens.css +22 -21
  205. package/dist/{thumbs-up-CsT9Wzb9.js → thumbs-up-BL3-NenK.js} +1 -1
  206. package/dist/{toast-store-tgK6MuMv.js → toast-store-DkOlYczt.js} +1 -1
  207. package/dist/{tool-DzUjIBT8.js → tool-CeIWUVUe.js} +1 -1
  208. package/dist/{tooltip-Bkkg_4t0.js → tooltip-GA-nmg06.js} +1 -1
  209. package/dist/{trash-2-jBKxjGGQ.js → trash-2-CT66QWlm.js} +1 -1
  210. package/dist/{triangle-alert-DlQ68ppf.js → triangle-alert-CeHLWxhD.js} +1 -1
  211. package/dist/ui/color-field.d.ts +48 -0
  212. package/dist/ui/textarea.d.ts +4 -0
  213. package/dist/ui/toggle-chip.d.ts +40 -0
  214. package/dist/{upload-TcAHXv9W.js → upload-9Csb0F0J.js} +1 -1
  215. package/dist/{use-card-resolution-DaZqAdWf.js → use-card-resolution-Zg0a08Z-.js} +1 -1
  216. package/dist/{variant-aurora-DbW_OWL2.js → variant-aurora-4VBQHIKV.js} +1 -1
  217. package/dist/{variant-aurora-CNmfHhcx.js → variant-aurora-DBeCAQNk.js} +2 -2
  218. package/dist/{variant-aurora-D6GsdTPA.js → variant-aurora-FzHVXHby.js} +2 -2
  219. package/dist/{variant-aurora-BhLuYxJR.js → variant-aurora-LE3fqxgw.js} +1 -1
  220. package/dist/{variant-custom-BvYHR62b.js → variant-custom-AFRGcOBS.js} +1 -1
  221. package/dist/{variant-custom-DV2x254s.js → variant-custom-BQkNuPpE.js} +2 -2
  222. package/dist/{variant-custom-BRvaNHSi.js → variant-custom-DI5R0rln.js} +1 -1
  223. package/dist/{variant-custom-DMTrEO5w.js → variant-custom-WWnrrRHS.js} +2 -2
  224. package/dist/{variant-wave-CyBueXj9.js → variant-wave-DUCbH5oI.js} +2 -2
  225. package/dist/{variant-wave-BNMGrDfj.js → variant-wave-DuQV7DhQ.js} +2 -2
  226. package/dist/{variant-wave-BpDd8t3Z.js → variant-wave-nSI2sfII.js} +1 -1
  227. package/dist/{variant-wave-sp-qwsdI.js → variant-wave-wTP5v_jU.js} +1 -1
  228. package/dist/x-eiO9V6J6.js +1 -0
  229. package/{src/elements/styles.css → kit-base.css} +27 -44
  230. package/package.json +32 -17
  231. package/solid.css +33 -0
  232. package/theme.css +39 -23
  233. package/bin/route.test.js +0 -58
  234. package/dist/arrow-down-CjRU3JgV.js +0 -1
  235. package/dist/arrow-left-Bnpb1UEW.js +0 -1
  236. package/dist/artifact-Bwt7OgcR.js +0 -1
  237. package/dist/check-njkVdZu2.js +0 -1
  238. package/dist/chevron-down-B72s6PXR.js +0 -1
  239. package/dist/chevron-right-BatuHzUm.js +0 -1
  240. package/dist/circle-check-B62pODB3.js +0 -1
  241. package/dist/circle-zx0ByzY9.js +0 -1
  242. package/dist/controllable-CnGpMF6r.js +0 -1
  243. package/dist/define-By-uL588.js +0 -1
  244. package/dist/loader-BM4CEz4G.js +0 -1
  245. package/dist/message-circle-DruwObfX.js +0 -1
  246. package/dist/message-square-BG6q6mlm.js +0 -1
  247. package/dist/play-BvKKq3fX.js +0 -1
  248. package/dist/register-impl-B1hLkrI8.js +0 -424
  249. package/dist/text-shimmer-Dcj1MHuq.js +0 -1
  250. package/dist/textarea-Dpvbngbg.js +0 -1
  251. package/dist/x-Z5UntkIJ.js +0 -1
  252. package/src/agent-tooling/README.md +0 -192
  253. package/src/agent-tooling/archetypes.ts +0 -205
  254. package/src/agent-tooling/catalog/README.md +0 -676
  255. package/src/agent-tooling/catalog/catalog-types.ts +0 -231
  256. package/src/agent-tooling/catalog/fabrications.ts +0 -96
  257. package/src/agent-tooling/catalog/invariants.ts +0 -284
  258. package/src/agent-tooling/catalog/labs-titles.ts +0 -114
  259. package/src/agent-tooling/catalog/scenarios.ts +0 -87
  260. package/src/agent-tooling/catalog/surfaces.ts +0 -347
  261. package/src/agent-tooling/construct/cli-entry.ts +0 -8
  262. package/src/agent-tooling/construct/cli.ts +0 -147
  263. package/src/agent-tooling/construct/codegen.ts +0 -1635
  264. package/src/agent-tooling/construct/construct.v1.schema.json +0 -319
  265. package/src/agent-tooling/construct/dev.ts +0 -148
  266. package/src/agent-tooling/construct/fixtures/demo-widget.construct.json +0 -7
  267. package/src/agent-tooling/construct/fixtures/ops-console.construct.json +0 -44
  268. package/src/agent-tooling/construct/fixtures/owner-widget.construct.json +0 -32
  269. package/src/agent-tooling/construct/schema.ts +0 -452
  270. package/src/agent-tooling/integrations/anthropic.ts +0 -442
  271. package/src/agent-tooling/integrations/cloudflare.ts +0 -218
  272. package/src/agent-tooling/integrations/langgraph.ts +0 -133
  273. package/src/agent-tooling/integrations/mastra.ts +0 -182
  274. package/src/agent-tooling/integrations/mock.ts +0 -148
  275. package/src/agent-tooling/integrations/ollama.ts +0 -97
  276. package/src/agent-tooling/integrations/openai.ts +0 -95
  277. package/src/agent-tooling/integrations/openrouter.ts +0 -82
  278. package/src/agent-tooling/integrations/pi.ts +0 -176
  279. package/src/agent-tooling/integrations/pydantic-ai.ts +0 -108
  280. package/src/agent-tooling/integrations/vercel-ai-sdk.ts +0 -398
  281. package/src/agent-tooling/mcp/css-raw.d.ts +0 -12
  282. package/src/agent-tooling/mcp/manifest.ts +0 -422
  283. package/src/agent-tooling/mcp/server.ts +0 -116
  284. package/src/agent-tooling/mcp/stdio.ts +0 -18
  285. package/src/agent-tooling/mcp/tools/construct.ts +0 -130
  286. package/src/agent-tooling/mcp/tools/debug.ts +0 -621
  287. package/src/agent-tooling/mcp/tools/reference.ts +0 -980
  288. package/src/agent-tooling/mcp/tools/scaffold.ts +0 -6708
  289. package/src/agent-tooling/mcp/tools/theme.ts +0 -456
  290. package/src/agent-tooling/mcp/tools/types.ts +0 -14
  291. package/src/agent-tooling/mcp/validate-args.ts +0 -141
  292. package/src/agent-tooling/recipes/composed-thread.ts +0 -714
  293. package/src/agent-tooling/recipes/index.ts +0 -22
  294. package/src/agent-tooling/recipes/types.ts +0 -32
  295. package/src/agent-tooling/registry.ts +0 -132
  296. package/src/agent-tooling/route-emit.ts +0 -305
  297. package/src/agent-tooling/types.ts +0 -390
  298. package/src/components/artifact-card.tsx +0 -120
  299. package/src/components/artifact.tsx +0 -914
  300. package/src/components/attachment-types.ts +0 -66
  301. package/src/components/attachments.tsx +0 -536
  302. package/src/components/audio-visualizer/audio-visualizer.voice-fixture.ts +0 -257
  303. package/src/components/audio-visualizer/aurora.glsl.ts +0 -330
  304. package/src/components/audio-visualizer/fit-scale.ts +0 -112
  305. package/src/components/audio-visualizer/index.tsx +0 -528
  306. package/src/components/audio-visualizer/labs/lab-choreography.ts +0 -187
  307. package/src/components/audio-visualizer/labs/lab-shaders.ts +0 -363
  308. package/src/components/audio-visualizer/labs/lab-visualizer.tsx +0 -102
  309. package/src/components/audio-visualizer/shader-canvas.tsx +0 -876
  310. package/src/components/audio-visualizer/sizes.ts +0 -54
  311. package/src/components/audio-visualizer/variant-aurora.tsx +0 -305
  312. package/src/components/audio-visualizer/variant-bar.tsx +0 -175
  313. package/src/components/audio-visualizer/variant-custom.tsx +0 -344
  314. package/src/components/audio-visualizer/variant-grid.tsx +0 -175
  315. package/src/components/audio-visualizer/variant-radial.tsx +0 -163
  316. package/src/components/audio-visualizer/variant-wave.tsx +0 -130
  317. package/src/components/audio-visualizer/wave.glsl.ts +0 -130
  318. package/src/components/card-fallback.tsx +0 -60
  319. package/src/components/card-renderer.tsx +0 -220
  320. package/src/components/card.tsx +0 -212
  321. package/src/components/chain-of-thought.tsx +0 -348
  322. package/src/components/chat-container.tsx +0 -89
  323. package/src/components/chat-scope-picker.tsx +0 -57
  324. package/src/components/chat-thread.tsx +0 -1014
  325. package/src/components/checkpoint.tsx +0 -88
  326. package/src/components/choice-card.tsx +0 -743
  327. package/src/components/coachmark.tsx +0 -249
  328. package/src/components/code-block.tsx +0 -181
  329. package/src/components/composer-dom.ts +0 -159
  330. package/src/components/composer-highlight.ts +0 -242
  331. package/src/components/composer-history.ts +0 -82
  332. package/src/components/composer.tsx +0 -1075
  333. package/src/components/confirm-card.tsx +0 -402
  334. package/src/components/context.tsx +0 -377
  335. package/src/components/conversation-item.tsx +0 -241
  336. package/src/components/conversation-list.tsx +0 -429
  337. package/src/components/conversation-panel.tsx +0 -118
  338. package/src/components/dismissed-stub.tsx +0 -80
  339. package/src/components/embed.tsx +0 -200
  340. package/src/components/empty.tsx +0 -177
  341. package/src/components/feedback-bar.tsx +0 -166
  342. package/src/components/file-tree.tsx +0 -530
  343. package/src/components/file-upload.tsx +0 -167
  344. package/src/components/form-widgets.tsx +0 -525
  345. package/src/components/form.tsx +0 -1296
  346. package/src/components/home-panel.tsx +0 -159
  347. package/src/components/image.tsx +0 -65
  348. package/src/components/link-preview.tsx +0 -195
  349. package/src/components/loader.tsx +0 -367
  350. package/src/components/markdown.tsx +0 -162
  351. package/src/components/message-skills.tsx +0 -40
  352. package/src/components/message.tsx +0 -765
  353. package/src/components/model-switcher.tsx +0 -132
  354. package/src/components/prompt-input.tsx +0 -188
  355. package/src/components/prompt-suggestion.tsx +0 -150
  356. package/src/components/reasoning.tsx +0 -293
  357. package/src/components/response-compare-types.ts +0 -152
  358. package/src/components/response-compare.tsx +0 -455
  359. package/src/components/response-stream.tsx +0 -109
  360. package/src/components/screen.tsx +0 -181
  361. package/src/components/scroll-button.tsx +0 -93
  362. package/src/components/source.tsx +0 -192
  363. package/src/components/tasks-card.tsx +0 -801
  364. package/src/components/text-shimmer.tsx +0 -37
  365. package/src/components/thinking-bar.tsx +0 -50
  366. package/src/components/thread.tsx +0 -228
  367. package/src/components/toast.tsx +0 -503
  368. package/src/components/tool-classify.ts +0 -26
  369. package/src/components/tool-types.ts +0 -49
  370. package/src/components/tool.tsx +0 -190
  371. package/src/components/use-card-resolution.ts +0 -44
  372. package/src/components/voice-input.tsx +0 -222
  373. package/src/components/voice-output.tsx +0 -242
  374. package/src/components/widget-tab-bar.tsx +0 -73
  375. package/src/components/workspace-shell.tsx +0 -285
  376. package/src/diagnostics/hook.ts +0 -352
  377. package/src/diagnostics/index.ts +0 -82
  378. package/src/diagnostics/report-request.ts +0 -296
  379. package/src/elements/agent-card.tsx +0 -67
  380. package/src/elements/artifact.tsx +0 -194
  381. package/src/elements/attachments.tsx +0 -140
  382. package/src/elements/audio-visualizer.tsx +0 -227
  383. package/src/elements/autoloader.ts +0 -89
  384. package/src/elements/avatar.tsx +0 -33
  385. package/src/elements/badge.tsx +0 -32
  386. package/src/elements/button.tsx +0 -149
  387. package/src/elements/card.tsx +0 -133
  388. package/src/elements/cards.tsx +0 -266
  389. package/src/elements/chain-of-thought.tsx +0 -141
  390. package/src/elements/chat-scope-picker.tsx +0 -65
  391. package/src/elements/chat-types.ts +0 -102
  392. package/src/elements/chat-workspace.tsx +0 -188
  393. package/src/elements/chat.tsx +0 -304
  394. package/src/elements/checkbox-group.tsx +0 -164
  395. package/src/elements/checkbox.tsx +0 -134
  396. package/src/elements/checkpoint.tsx +0 -47
  397. package/src/elements/choice.tsx +0 -100
  398. package/src/elements/coachmark.tsx +0 -90
  399. package/src/elements/code-block.tsx +0 -60
  400. package/src/elements/command.tsx +0 -197
  401. package/src/elements/compare.tsx +0 -111
  402. package/src/elements/compiled.css +0 -2
  403. package/src/elements/composer.tsx +0 -162
  404. package/src/elements/confirm-card.tsx +0 -76
  405. package/src/elements/context-meter.tsx +0 -107
  406. package/src/elements/conversation-item.tsx +0 -120
  407. package/src/elements/conversation-list.tsx +0 -203
  408. package/src/elements/css.ts +0 -5
  409. package/src/elements/default-input.tsx +0 -392
  410. package/src/elements/define-entry.ts +0 -12
  411. package/src/elements/define.tsx +0 -563
  412. package/src/elements/diagnostic-events.ts +0 -114
  413. package/src/elements/dialog.tsx +0 -145
  414. package/src/elements/disclosure.ts +0 -95
  415. package/src/elements/dock.tsx +0 -215
  416. package/src/elements/dropdown.tsx +0 -123
  417. package/src/elements/editable-label.tsx +0 -140
  418. package/src/elements/element-data-types.ts +0 -152
  419. package/src/elements/element-diagnostics.ts +0 -392
  420. package/src/elements/element-manifest.json +0 -354
  421. package/src/elements/element-nonscalar.json +0 -187
  422. package/src/elements/element-types.d.ts +0 -4353
  423. package/src/elements/embed.tsx +0 -35
  424. package/src/elements/empty.tsx +0 -29
  425. package/src/elements/feedback-bar.tsx +0 -66
  426. package/src/elements/file-tree.tsx +0 -62
  427. package/src/elements/file-upload.tsx +0 -44
  428. package/src/elements/form.tsx +0 -94
  429. package/src/elements/hover-card.tsx +0 -80
  430. package/src/elements/icon.tsx +0 -41
  431. package/src/elements/image.tsx +0 -32
  432. package/src/elements/input.tsx +0 -492
  433. package/src/elements/kbd.tsx +0 -45
  434. package/src/elements/link-preview.tsx +0 -34
  435. package/src/elements/loader.tsx +0 -25
  436. package/src/elements/markdown.tsx +0 -38
  437. package/src/elements/menu.tsx +0 -241
  438. package/src/elements/message-skills.tsx +0 -83
  439. package/src/elements/message.tsx +0 -361
  440. package/src/elements/model-switcher.tsx +0 -121
  441. package/src/elements/nav.tsx +0 -87
  442. package/src/elements/notice.tsx +0 -53
  443. package/src/elements/pane-grid.tsx +0 -111
  444. package/src/elements/pane-group.tsx +0 -119
  445. package/src/elements/pane.tsx +0 -129
  446. package/src/elements/popover.tsx +0 -81
  447. package/src/elements/progress-bar.tsx +0 -39
  448. package/src/elements/prompt-dock.tsx +0 -82
  449. package/src/elements/prompt-input.tsx +0 -240
  450. package/src/elements/prompt-suggestions.tsx +0 -113
  451. package/src/elements/radio-group.tsx +0 -129
  452. package/src/elements/reasoning.tsx +0 -71
  453. package/src/elements/register-impl.ts +0 -148
  454. package/src/elements/register.ts +0 -76
  455. package/src/elements/remote.tsx +0 -225
  456. package/src/elements/resizable.globals.d.ts +0 -36
  457. package/src/elements/resizable.tsx +0 -704
  458. package/src/elements/response-stream.tsx +0 -40
  459. package/src/elements/screen.tsx +0 -90
  460. package/src/elements/scroll-area.tsx +0 -33
  461. package/src/elements/scroll-button.tsx +0 -179
  462. package/src/elements/search.tsx +0 -185
  463. package/src/elements/segmented.tsx +0 -129
  464. package/src/elements/select.tsx +0 -165
  465. package/src/elements/separator.tsx +0 -36
  466. package/src/elements/setting-item.tsx +0 -50
  467. package/src/elements/settings-group.tsx +0 -37
  468. package/src/elements/skeleton.tsx +0 -45
  469. package/src/elements/slider.tsx +0 -171
  470. package/src/elements/slot-text.ts +0 -73
  471. package/src/elements/slots.ts +0 -787
  472. package/src/elements/source.tsx +0 -126
  473. package/src/elements/status.tsx +0 -42
  474. package/src/elements/switch.tsx +0 -118
  475. package/src/elements/tabs.tsx +0 -95
  476. package/src/elements/tasks.tsx +0 -103
  477. package/src/elements/text-shimmer.tsx +0 -28
  478. package/src/elements/thinking-bar.tsx +0 -43
  479. package/src/elements/thread.tsx +0 -139
  480. package/src/elements/toast.tsx +0 -106
  481. package/src/elements/tool.tsx +0 -78
  482. package/src/elements/tooltip.tsx +0 -85
  483. package/src/elements/validate-messages.ts +0 -76
  484. package/src/elements/voice-input.tsx +0 -100
  485. package/src/elements/voice-output.tsx +0 -82
  486. package/src/index.ts +0 -430
  487. package/src/primitives/audio-bands.ts +0 -174
  488. package/src/primitives/card-component-types.ts +0 -63
  489. package/src/primitives/card-contract.ts +0 -80
  490. package/src/primitives/card-data-types.ts +0 -361
  491. package/src/primitives/card-host.tsx +0 -37
  492. package/src/primitives/card-recovery.ts +0 -160
  493. package/src/primitives/card-registry.tsx +0 -78
  494. package/src/primitives/card-resolution.ts +0 -36
  495. package/src/primitives/card-routing.ts +0 -85
  496. package/src/primitives/card-schemas/artifact.schema.json +0 -92
  497. package/src/primitives/card-schemas/card-envelope.schema.json +0 -14
  498. package/src/primitives/card-schemas/card-event.schema.json +0 -12
  499. package/src/primitives/card-schemas/choice.schema.json +0 -75
  500. package/src/primitives/card-schemas/confirm.schema.json +0 -65
  501. package/src/primitives/card-schemas/embed.schema.json +0 -63
  502. package/src/primitives/card-schemas/form.result.schema.json +0 -7
  503. package/src/primitives/card-schemas/form.schema.json +0 -53
  504. package/src/primitives/card-schemas/link.schema.json +0 -54
  505. package/src/primitives/card-schemas/tasks.result.schema.json +0 -16
  506. package/src/primitives/card-schemas/tasks.schema.json +0 -83
  507. package/src/primitives/card-tags.ts +0 -61
  508. package/src/primitives/card-validate-cards.ts +0 -255
  509. package/src/primitives/card-validate-schemas.ts +0 -58
  510. package/src/primitives/card-validate.ts +0 -131
  511. package/src/primitives/chat-config.tsx +0 -103
  512. package/src/primitives/composer-model.ts +0 -49
  513. package/src/primitives/composer-triggers.ts +0 -35
  514. package/src/primitives/controllable.ts +0 -21
  515. package/src/primitives/conversation-store.ts +0 -248
  516. package/src/primitives/create-kai-chat.ts +0 -66
  517. package/src/primitives/create-tween.ts +0 -266
  518. package/src/primitives/embed-providers.ts +0 -254
  519. package/src/primitives/field-mask.ts +0 -256
  520. package/src/primitives/field-semantics.ts +0 -115
  521. package/src/primitives/highlighter.ts +0 -157
  522. package/src/primitives/input-mask.ts +0 -853
  523. package/src/primitives/link-preview.ts +0 -87
  524. package/src/primitives/message-feedback.ts +0 -124
  525. package/src/primitives/pdf-preview.ts +0 -121
  526. package/src/primitives/toast-store.ts +0 -338
  527. package/src/primitives/url-scheme-policy.ts +0 -70
  528. package/src/primitives/use-audio-analysis.ts +0 -340
  529. package/src/primitives/use-auto-resize.ts +0 -31
  530. package/src/primitives/use-resize-observer.ts +0 -45
  531. package/src/primitives/use-sequencer.ts +0 -72
  532. package/src/primitives/use-speech-recognition.ts +0 -146
  533. package/src/primitives/use-stick-to-bottom.ts +0 -75
  534. package/src/primitives/use-text-stream.ts +0 -143
  535. package/src/primitives/use-voice-recorder.ts +0 -62
  536. package/src/primitives/visualizer-sequences.ts +0 -350
  537. package/src/remote/host-embed.ts +0 -345
  538. package/src/remote/index.ts +0 -2
  539. package/src/remote/origin.ts +0 -30
  540. package/src/remote/provider-runtime.ts +0 -262
  541. package/src/remote/provider.ts +0 -2
  542. package/src/remote/validate.ts +0 -22
  543. package/src/remote/version.ts +0 -12
  544. package/src/remote/wire.ts +0 -48
  545. package/src/schemas/from-tool-call.ts +0 -151
  546. package/src/schemas/index.ts +0 -341
  547. package/src/schemas/provider-subsets.ts +0 -538
  548. package/src/schemas/registry.ts +0 -355
  549. package/src/schemas/tool-defs.ts +0 -793
  550. package/src/solid.ts +0 -173
  551. package/src/state/index.ts +0 -44
  552. package/src/state/messages.ts +0 -53
  553. package/src/state/mock.ts +0 -297
  554. package/src/state/parts.ts +0 -295
  555. package/src/state/persistence.ts +0 -180
  556. package/src/state/stream.ts +0 -246
  557. package/src/state/suggestions.ts +0 -9
  558. package/src/state/threads.ts +0 -142
  559. package/src/test-utils/fake-clock.ts +0 -88
  560. package/src/types.ts +0 -95
  561. package/src/ui/action-icons.ts +0 -53
  562. package/src/ui/agent-card.tsx +0 -218
  563. package/src/ui/avatar.tsx +0 -23
  564. package/src/ui/badge.tsx +0 -21
  565. package/src/ui/button.tsx +0 -49
  566. package/src/ui/card.tsx +0 -245
  567. package/src/ui/checkbox-group.tsx +0 -153
  568. package/src/ui/checkbox.tsx +0 -63
  569. package/src/ui/collapsible.tsx +0 -163
  570. package/src/ui/command.tsx +0 -103
  571. package/src/ui/dialog.tsx +0 -223
  572. package/src/ui/dock.tsx +0 -630
  573. package/src/ui/dropdown.tsx +0 -636
  574. package/src/ui/editable-label.tsx +0 -112
  575. package/src/ui/hover-card.tsx +0 -345
  576. package/src/ui/icon.tsx +0 -167
  577. package/src/ui/input.tsx +0 -391
  578. package/src/ui/kbd.tsx +0 -118
  579. package/src/ui/nav.tsx +0 -282
  580. package/src/ui/notice.tsx +0 -84
  581. package/src/ui/overlay.tsx +0 -277
  582. package/src/ui/pane-grid.tsx +0 -117
  583. package/src/ui/pane-group.tsx +0 -291
  584. package/src/ui/pane.tsx +0 -193
  585. package/src/ui/popover.tsx +0 -106
  586. package/src/ui/progress-bar.tsx +0 -83
  587. package/src/ui/prompt-dock.tsx +0 -145
  588. package/src/ui/radio.tsx +0 -150
  589. package/src/ui/resizable.tsx +0 -693
  590. package/src/ui/scroll-area.tsx +0 -26
  591. package/src/ui/segmented.tsx +0 -109
  592. package/src/ui/select.tsx +0 -168
  593. package/src/ui/separator.tsx +0 -10
  594. package/src/ui/settings-group.tsx +0 -67
  595. package/src/ui/skeleton.tsx +0 -73
  596. package/src/ui/slider.tsx +0 -178
  597. package/src/ui/status.tsx +0 -48
  598. package/src/ui/switch.tsx +0 -119
  599. package/src/ui/tabs.tsx +0 -168
  600. package/src/ui/textarea.tsx +0 -21
  601. package/src/ui/tooltip.tsx +0 -118
  602. package/src/utils/cn.ts +0 -30
  603. package/src/wire/chunk.ts +0 -248
  604. package/src/wire/consume.ts +0 -599
  605. package/src/wire/diagnostics.ts +0 -727
  606. package/src/wire/encode-probe.ts +0 -214
  607. package/src/wire/encode.ts +0 -947
  608. package/src/wire/files.ts +0 -342
  609. package/src/wire/formats/anthropic.ts +0 -274
  610. package/src/wire/formats/openai.ts +0 -228
  611. package/src/wire/index.ts +0 -95
  612. package/src/wire/media-types.ts +0 -344
  613. package/src/wire/read.ts +0 -396
  614. package/src/wire/sink-helpers.ts +0 -50
  615. package/src/wire/sse.ts +0 -153
@@ -1,49 +1,30 @@
1
- /* Element-bundle stylesheet, and the SOURCE OF TRUTH for element CSS. Compiled to
2
- compiled.css and injected into each custom element's shadow root;
3
- .storybook/styles.css @imports this file rather than restating it, so a rule
4
- added here reaches the shadow roots AND the light-DOM Solid stories at once.
1
+ /* Shared kit base + component rules. ONE source, TWO consumers, and the
2
+ consumers are different style paths, which is the whole reason this file
3
+ exists:
5
4
 
6
- It used to be the other way round — Storybook hand-copied a few of these rules
7
- under "Mirror the shipped ..." comments. Nothing enforced the copy, so
8
- .kai-radio, .kai-checkbox, .kai-range and .kai-focus-inset were simply missing
9
- there: three form controls rendered as raw OS chrome in every story while the
10
- shipped element rendered them fully designed, and an agent and the owner each
11
- concluded the kit had unstyled controls. Never copy a rule from here into the
12
- Storybook sheet; add it here.
5
+ src/elements/styles.css compiled to compiled.css and adopted into every
6
+ kai-* shadow root (the ./elements and ./define
7
+ entries). It also sets the :host rules.
8
+ solid.css Tailwind SOURCE that a light-DOM SolidJS consumer
9
+ @imports into their own Tailwind build (the . and
10
+ ./solid entries ship class names and no CSS).
13
11
 
14
- The one thing that cannot cross is :host, which selects nothing in the light
15
- DOM. Its defaults are re-stated on `body` in the Storybook sheet's shim. */
16
- @import "tailwindcss";
17
- /* tw-animate-css supplies the animate-in/animate-out + slide/fade/zoom utilities
18
- the kit uses for every overlay enter/exit (toast, popover, tooltip, dropdown,
19
- hover-card, the message action-row hide). Without this @import those classes
20
- compile to nothing and all the animations are silently dead. Compiled into
21
- compiled.css at build time, so it's a build-time dep only (no consumer import). */
22
- @import "tw-animate-css";
23
- @import "../../theme.css";
24
- @plugin "@tailwindcss/typography";
12
+ Before this file, everything below lived only in the elements sheet, so the
13
+ Solid path silently shipped without it: .kai-radio / .kai-checkbox / .kai-range
14
+ rendered as raw OS chrome, no inset focus ring, no token-driven focus outline,
15
+ no scrollbars, no ::selection. Nothing in CI rendered that path, so nothing
16
+ noticed. The same defect had already happened once before, one layer up, when
17
+ the Storybook sheet hand-copied a few of these rules and omitted the rest.
25
18
 
26
- @source "../";
19
+ NEVER copy a rule from here into either consumer, and never add a rule to one
20
+ consumer that both need. Add it here. The one thing that cannot live here is
21
+ :host, which selects nothing in a light DOM; those rules stay in
22
+ src/elements/styles.css, and .storybook/styles.css re-states them on body.
27
23
 
28
- @layer base {
29
- /* Base typography is token-driven so a theme can restyle it. --kai-font-base is
30
- the family for ALL text/UI (named "base", not "sans", so a serif body works);
31
- --kai-tracking is global letter-spacing. Both pierce the Shadow DOM via the
32
- var() fallback, exactly like the --kai-color-* tokens.
24
+ This file relies on the --color-* tokens from theme.css and on the classes
25
+ tw-animate-css emits; both consumers import those alongside it. */
33
26
 
34
- font-size is the third: without it every shadow root inherited the DOCUMENT's
35
- size (16px in a stock page), so any surface that never set an explicit text-*
36
- class rendered a step larger than the rest of the kit and looked like a bug in
37
- that one component. --text-body is the scale's primary reading size and itself
38
- resolves through --kai-text-body, so overriding that one token still moves the
39
- default. The literal fallback matches theme.css's --text-body so the rule is
40
- still correct if this sheet is ever used without the @theme block. */
41
- :host {
42
- display: block;
43
- font-family: var(--kai-font-base, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
44
- font-size: var(--text-body, var(--kai-text-body, 0.875rem));
45
- letter-spacing: var(--kai-tracking, normal);
46
- }
27
+ @layer base {
47
28
  /* Code/monospace surfaces use --kai-font-code (named for its ROLE — code — not
48
29
  "mono", so any family works). Covers inline code, <pre>, and code blocks. */
49
30
  code, kbd, samp, pre {
@@ -56,7 +37,6 @@
56
37
  mode — NOT the OS — so e.g. the native calendar icon never renders black
57
38
  on a dark surface. `color-scheme` drives that native rendering; we set it
58
39
  from the resolved mode (the `.dark` scope the element factory toggles). */
59
- :host { color-scheme: light; }
60
40
  .dark { color-scheme: dark; }
61
41
 
62
42
  /* One token-driven focus ring for EVERY focusable element in the shadow root.
@@ -121,8 +101,10 @@
121
101
  decide. The shadow root IS the kit's DOM, so the same rule is unambiguous
122
102
  here. Identical reasoning to the scrollbar and :focus-visible rules above,
123
103
  which are scoped the same way and for the same reason. theme.css therefore
124
- carries the TOKENS only, and a Solid-layer consumer rendering our components
125
- into their own light DOM opts in with one rule of their own:
104
+ carries the TOKENS only. A Solid-layer consumer rendering our components
105
+ into their own light DOM opts in by importing solid.css, which brings this
106
+ whole file and says so in its header; a consumer who wants the tokens alone
107
+ imports theme.css and writes their own scoped rule:
126
108
  `.my-chat ::selection { background-color: var(--color-selection); … }`.
127
109
 
128
110
  WHY THE RULE MUST BE IN THIS SHEET AND NOT INHERITED: ::selection does NOT
@@ -153,6 +135,7 @@
153
135
  }
154
136
  }
155
137
 
138
+
156
139
  @layer components {
157
140
  /* Focus ring drawn INSIDE the element's border box, for focusable regions
158
141
  that sit flush against a clipping ancestor. The scrollable code-block body
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitn.ai/ui",
3
- "version": "0.28.0",
3
+ "version": "0.30.0",
4
4
  "nx": {
5
5
  "name": "ui",
6
6
  "targets": {
@@ -68,7 +68,8 @@
68
68
  "jsdelivr": "./dist/kai.es.js",
69
69
  "customElements": "dist/custom-elements.json",
70
70
  "bin": {
71
- "kai-mcp": "./bin/mcp.js"
71
+ "kai-mcp": "./bin/mcp.js",
72
+ "kai": "./bin/mcp.js"
72
73
  },
73
74
  "exports": {
74
75
  ".": {
@@ -92,6 +93,7 @@
92
93
  "default": "./dist/elements/autoloader.js"
93
94
  },
94
95
  "./theme.css": "./theme.css",
96
+ "./solid.css": "./solid.css",
95
97
  "./theme.tokens.css": "./dist/theme.tokens.css",
96
98
  "./element-meta.json": "./src/elements/element-meta.json",
97
99
  "./icon-names.json": "./src/elements/icon-names.json",
@@ -133,6 +135,10 @@
133
135
  "default": "./dist/schemas.js"
134
136
  },
135
137
  "./schemas/*": "./dist/schemas/*",
138
+ "./construct": {
139
+ "types": "./dist/agent-tooling/construct/public.d.ts",
140
+ "default": "./dist/construct.js"
141
+ },
136
142
  "./provider": {
137
143
  "types": "./dist/remote/provider.d.ts",
138
144
  "default": "./dist/kai-provider.es.js"
@@ -142,27 +148,23 @@
142
148
  "*": {
143
149
  "schemas": [
144
150
  "./dist/schemas/index.d.ts"
151
+ ],
152
+ "construct": [
153
+ "./dist/agent-tooling/construct/public.d.ts"
145
154
  ]
146
155
  }
147
156
  },
148
157
  "files": [
149
158
  "dist",
150
- "src",
159
+ "src/elements/element-meta.json",
160
+ "src/elements/icon-names.json",
151
161
  "bin",
152
- "!src/**/*.stories.tsx",
153
- "!src/**/*.test.ts",
154
- "!src/**/*.test.tsx",
155
- "!src/**/*.testlib.ts",
162
+ "!bin/**/*.test.js",
156
163
  "!dist/**/*.testlib.*",
157
- "!src/**/*.mdx",
158
- "!src/stories",
159
- "!src/wire/fixtures",
160
- "!src/agent-tooling/catalog/derived.json",
161
- "!src/elements/logos",
162
- "!src/elements/card-media.jpg",
163
- "!src/elements/video-poster.jpg",
164
164
  "frameworks",
165
165
  "theme.css",
166
+ "solid.css",
167
+ "kit-base.css",
166
168
  "llms.txt",
167
169
  "llms-full.txt",
168
170
  "NOTICE"
@@ -170,7 +172,7 @@
170
172
  "scripts": {
171
173
  "prepublishOnly": "npm run build",
172
174
  "prebuild": "npm run build:css && npm run build:card-validation",
173
- "build": "vite build --config vite.config.ts && vite build --config vite.config.provider.ts && vite build --config vite.config.react.ts && vite build --config vite.config.barrel.ts && vite build --config vite.config.barrel.server.ts && vite build --config vite.config.solid.ts && vite build --config vite.config.solid.server.ts && vite build --config vite.config.state.ts && vite build --config vite.config.wire.ts && vite build --config vite.config.define.ts && vite build --config vite.config.define.server.ts && vite build --config vite.config.diagnostics.ts && vite build --config vite.config.schemas.ts && vite build --config vite.config.mcp.ts && vite build --config vite.config.construct-cli.ts && npm run build:elements && npm run verify:elements-bundle && npm run verify:react-wrappers && npm run verify:shader-lazy",
175
+ "build": "vite build --config vite.config.ts && vite build --config vite.config.provider.ts && vite build --config vite.config.react.ts && vite build --config vite.config.barrel.ts && vite build --config vite.config.barrel.server.ts && vite build --config vite.config.solid.ts && vite build --config vite.config.solid.server.ts && vite build --config vite.config.state.ts && vite build --config vite.config.wire.ts && vite build --config vite.config.define.ts && vite build --config vite.config.define.server.ts && vite build --config vite.config.diagnostics.ts && vite build --config vite.config.schemas.ts && vite build --config vite.config.mcp.ts && vite build --config vite.config.construct-cli.ts && vite build --config vite.config.construct.ts && npm run build:elements && npm run dedupe:shiki && npm run verify:elements-bundle && npm run verify:react-wrappers && npm run verify:shader-lazy",
174
176
  "build:elements": "node scripts/gen-elements-manifest.mjs && vite build --config vite.config.elements.ts && node scripts/gen-element-dts.mjs",
175
177
  "postbuild": "npm run build:theme && npm run build:api && npm run build:schemas && npm run build:subpath-dts && npm run verify:dts",
176
178
  "build:theme": "node scripts/build-theme-tokens.mjs",
@@ -193,13 +195,14 @@
193
195
  "gate:compiles:self-test": "node scripts/acceptance-gate-compiles.mjs --self-test",
194
196
  "verify:schemas": "node scripts/verify-schemas-exported.mjs --self-test && node scripts/verify-schemas-exported.mjs",
195
197
  "verify:shader-lazy": "node scripts/verify-shader-lazy.mjs --self-test && node scripts/verify-shader-lazy.mjs",
198
+ "dedupe:shiki": "node scripts/dedupe-shiki-chunks.mjs --self-test && node scripts/dedupe-shiki-chunks.mjs",
196
199
  "verify:solid-coverage": "node scripts/verify-solid-coverage.mjs --self-test && node scripts/verify-solid-coverage.mjs",
197
200
  "verify:tool-schemas": "node scripts/verify-tool-schemas.mjs",
198
201
  "verify:ssr": "node scripts/verify-ssr-imports.mjs && node scripts/verify-ssr-render.mjs",
199
202
  "verify:diagnostics-wiring": "node scripts/verify-diagnostics-wiring.mjs",
200
203
  "verify:ssr:imports": "node scripts/verify-ssr-imports.mjs",
201
204
  "verify:ssr:render": "node scripts/verify-ssr-render.mjs",
202
- "verify:pack": "node scripts/verify-pack-weight.mjs",
205
+ "verify:pack": "node scripts/verify-pack-weight.mjs --self-test && node scripts/verify-pack-weight.mjs",
203
206
  "verify:starters": "node scripts/verify-starters.mjs",
204
207
  "lint:attachment-object-urls": "node scripts/lint-attachment-object-urls.mjs --self-test && node scripts/lint-attachment-object-urls.mjs",
205
208
  "lint:cdn-pins": "node scripts/lint-cdn-pins.mjs --self-test && node scripts/lint-cdn-pins.mjs --check-release-wiring && node scripts/lint-cdn-pins.mjs",
@@ -303,11 +306,23 @@
303
306
  "vitest": "^4.1.0"
304
307
  },
305
308
  "peerDependencies": {
306
- "react": ">=18"
309
+ "@tailwindcss/typography": "^0.5.19",
310
+ "react": ">=18",
311
+ "tailwindcss": "^4.2.2",
312
+ "tw-animate-css": "^1.4.0"
307
313
  },
308
314
  "peerDependenciesMeta": {
315
+ "@tailwindcss/typography": {
316
+ "optional": true
317
+ },
309
318
  "react": {
310
319
  "optional": true
320
+ },
321
+ "tailwindcss": {
322
+ "optional": true
323
+ },
324
+ "tw-animate-css": {
325
+ "optional": true
311
326
  }
312
327
  }
313
328
  }
package/solid.css ADDED
@@ -0,0 +1,33 @@
1
+ /* @kitn.ai/ui for light-DOM SolidJS apps. Tailwind v4 SOURCE: import it from a
2
+ stylesheet that Tailwind processes, after `@import "tailwindcss"`, and keep
3
+ your `@source` line pointing at the kit so its class names survive:
4
+
5
+ @import "tailwindcss";
6
+ @import "@kitn.ai/ui/solid.css";
7
+ @source "../node_modules/@kitn.ai/ui";
8
+
9
+ Why this file and not theme.css alone: the Solid entry (`.` / `./solid`) ships
10
+ class-name strings and NO CSS, so everything the kai-* elements get from their
11
+ compiled shadow-root sheet has to reach your Tailwind build some other way.
12
+ theme.css carries only the tokens. This file adds the rest:
13
+
14
+ tw-animate-css the animate-in/out, fade-*, zoom-*, slide-* classes
15
+ every overlay uses; without it they compile to
16
+ nothing and the animations are silently dead
17
+ @tailwindcss/typography the prose-sm / prose-lg classes proseClass() emits
18
+ kit-base.css the focus ring, scrollbars, ::selection, and the
19
+ .kai-radio / .kai-checkbox / .kai-range /
20
+ .kai-focus-inset component rules
21
+
22
+ tw-animate-css, @tailwindcss/typography and tailwindcss are optional peer
23
+ dependencies: install them next to the kit.
24
+
25
+ The base rules here are global by design: they style your whole page the way
26
+ the kit styles its own shadow roots. If you only want the tokens, import
27
+ theme.css instead and opt into the rest yourself.
28
+
29
+ Guarded by tests/styles/solid-css-contract.test.ts. */
30
+ @import "tw-animate-css";
31
+ @plugin "@tailwindcss/typography";
32
+ @import "./theme.css";
33
+ @import "./kit-base.css";
package/theme.css CHANGED
@@ -1,12 +1,27 @@
1
1
  /* @kitn.ai/ui design system — import after `@import "tailwindcss"`.
2
- Defines ONLY namespaced (--color-*) tokens, component keyframes, animation
2
+ Defines the shadcn-style (--color-*) tokens, component keyframes, animation
3
3
  utilities, and the .chat-markdown styles. Contains NO global base/reset rules,
4
4
  so importing it restyles nothing on its own — a host opts in via the kit's
5
5
  components + classes. Rebrand by overriding the --color-* values (optionally
6
6
  scoped to a subtree).
7
7
  NOTE: This file is Tailwind-v4 source (requires tailwindcss as a peer). For
8
8
  bundler-based apps that don't use Tailwind, import @kitn.ai/ui/theme.tokens.css
9
- instead — it is plain compiled CSS with no toolchain requirements. */
9
+ instead — it is plain compiled CSS with no toolchain requirements.
10
+
11
+ THIS FILE IS MERGED INTO THE CONSUMER'S TAILWIND BUILD when they @import it,
12
+ so everything at global scope here lands in THEIR namespace. What it changes
13
+ for them (documented in apps/docs/.../guides/theming.mdx, keep the two in sync):
14
+ - `@custom-variant dark` below switches their `dark:` utilities from
15
+ prefers-color-scheme to the `.dark` class.
16
+ - the `--color-*` names merge into their @theme (last import wins).
17
+ - `--radius-sm/md/lg/xl` re-point Tailwind's stock radius scale at --radius.
18
+ - `--text-xs/sm/base/lg` are aliased onto the kit's type scale (defaults
19
+ equal stock Tailwind, so nothing moves until a --kai-text-* token is set).
20
+ Everything else global carries a `kai-` prefix so it cannot clash by name:
21
+ every @keyframes is `kai-<name>`, the scrollbar utility is `.kai-scrollbar-thin`.
22
+ The one unprefixed global class is `.chat-markdown` (public; renaming it is a
23
+ breaking change). tests/elements/theme-globals.test.ts pins the prefix rule
24
+ and that every animation reference in src/ resolves to a keyframe here. */
10
25
 
11
26
  @custom-variant dark (&:is(.dark *));
12
27
 
@@ -205,20 +220,18 @@
205
220
  --text-base: var(--kai-text-title, 1rem); --text-base--line-height: calc(1.5 / 1); /* ≡ text-title */
206
221
  --text-lg: var(--kai-text-lg, 1.125rem); --text-lg--line-height: calc(1.75 / 1.125); /* 18px — section headings, lg prose */
207
222
 
208
- @keyframes typing { 0%,100% { transform: translateY(0); opacity: .5 } 50% { transform: translateY(-2px); opacity: 1 } }
209
- @keyframes loading-dots { 0%,100% { opacity: 0 } 50% { opacity: 1 } }
210
- @keyframes wave { 0%,100% { transform: scaleY(1) } 50% { transform: scaleY(.6) } }
211
- @keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: 0 } }
212
- @keyframes text-blink { 0%,100% { color: var(--color-primary) } 50% { color: var(--color-muted-foreground) } }
213
- @keyframes bounce-dots { 0%,100% { transform: scale(.8); opacity: .5 } 50% { transform: scale(1.2); opacity: 1 } }
214
- @keyframes thin-pulse { 0%,100% { transform: scale(.95); opacity: .8 } 50% { transform: scale(1.05); opacity: .4 } }
215
- @keyframes pulse-dot { 0%,100% { transform: scale(1); opacity: .8 } 50% { transform: scale(1.5); opacity: 1 } }
216
- @keyframes shimmer-text { 0% { background-position: 150% center } 100% { background-position: -150% center } }
217
- @keyframes wave-bars { 0%,100% { transform: scaleY(1); opacity: .5 } 50% { transform: scaleY(.6); opacity: 1 } }
218
- @keyframes shimmer { 0% { background-position: 200% 50% } 100% { background-position: -200% 50% } }
219
- @keyframes spinner-fade { 0% { opacity: 0 } 100% { opacity: 1 } }
220
- @keyframes collapsible-down { from { height: 0; opacity: 0 } to { height: var(--kb-collapsible-content-height); opacity: 1 } }
221
- @keyframes collapsible-up { from { height: var(--kb-collapsible-content-height); opacity: 1 } to { height: 0; opacity: 0 } }
223
+ @keyframes kai-typing { 0%,100% { transform: translateY(0); opacity: .5 } 50% { transform: translateY(-2px); opacity: 1 } }
224
+ @keyframes kai-loading-dots { 0%,100% { opacity: 0 } 50% { opacity: 1 } }
225
+ @keyframes kai-wave { 0%,100% { transform: scaleY(1) } 50% { transform: scaleY(.6) } }
226
+ @keyframes kai-blink { 0%,100% { opacity: 1 } 50% { opacity: 0 } }
227
+ @keyframes kai-text-blink { 0%,100% { color: var(--color-primary) } 50% { color: var(--color-muted-foreground) } }
228
+ @keyframes kai-bounce-dots { 0%,100% { transform: scale(.8); opacity: .5 } 50% { transform: scale(1.2); opacity: 1 } }
229
+ @keyframes kai-thin-pulse { 0%,100% { transform: scale(.95); opacity: .8 } 50% { transform: scale(1.05); opacity: .4 } }
230
+ @keyframes kai-pulse-dot { 0%,100% { transform: scale(1); opacity: .8 } 50% { transform: scale(1.5); opacity: 1 } }
231
+ @keyframes kai-shimmer-text { 0% { background-position: 150% center } 100% { background-position: -150% center } }
232
+ @keyframes kai-wave-bars { 0%,100% { transform: scaleY(1); opacity: .5 } 50% { transform: scaleY(.6); opacity: 1 } }
233
+ @keyframes kai-shimmer { 0% { background-position: 200% 50% } 100% { background-position: -200% 50% } }
234
+ @keyframes kai-spinner-fade { 0% { opacity: 0 } 100% { opacity: 1 } }
222
235
  }
223
236
 
224
237
  .dark {
@@ -344,21 +357,24 @@
344
357
 
345
358
  /* Cross-platform thin scrollbar utility (Firefox + WebKit). Used by ScrollArea
346
359
  and any scroll region in the SolidJS-component build (web components also get
347
- this globally inside their shadow root — see src/elements/styles.css). */
348
- .scrollbar-thin {
360
+ this globally inside their shadow root — see src/elements/styles.css).
361
+ `kai-` prefixed because this file is merged into a consumer's Tailwind build
362
+ and `.scrollbar-thin` is a name they may well own (no consumer-facing doc ever
363
+ named the old unprefixed class, so no alias is kept). */
364
+ .kai-scrollbar-thin {
349
365
  scrollbar-width: thin;
350
366
  scrollbar-color: var(--color-scrollbar-thumb) transparent;
351
367
  }
352
- .scrollbar-thin::-webkit-scrollbar { width: 8px; height: 8px; }
353
- .scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
354
- .scrollbar-thin::-webkit-scrollbar-thumb {
368
+ .kai-scrollbar-thin::-webkit-scrollbar { width: 8px; height: 8px; }
369
+ .kai-scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
370
+ .kai-scrollbar-thin::-webkit-scrollbar-thumb {
355
371
  background-color: var(--color-scrollbar-thumb);
356
372
  border-radius: 9999px;
357
373
  border: 2px solid transparent;
358
374
  background-clip: padding-box;
359
375
  }
360
- .scrollbar-thin::-webkit-scrollbar-thumb:hover { background-color: var(--color-scrollbar-thumb-hover); }
361
- .scrollbar-thin::-webkit-scrollbar-corner { background: transparent; }
376
+ .kai-scrollbar-thin::-webkit-scrollbar-thumb:hover { background-color: var(--color-scrollbar-thumb-hover); }
377
+ .kai-scrollbar-thin::-webkit-scrollbar-corner { background: transparent; }
362
378
 
363
379
  /* Surface utilities — `bg-surface` / `bg-surface-strong` paint the opaque,
364
380
  theme-derived surface tokens (see --color-surface above). Defined explicitly
package/bin/route.test.js DELETED
@@ -1,58 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { execFileSync } from 'node:child_process';
3
- import { fileURLToPath } from 'node:url';
4
- import { dirname, join } from 'node:path';
5
- import { decideEntry, CONSTRUCT_COMMANDS, KNOWN_COMMANDS } from './route.js';
6
-
7
- const __dirname = dirname(fileURLToPath(import.meta.url));
8
- const binPath = join(__dirname, 'mcp.js');
9
-
10
- describe('decideEntry (pure routing decision)', () => {
11
- it('no args -> mcp (byte-compatible historical behavior)', () => {
12
- expect(decideEntry(undefined)).toEqual({ kind: 'mcp' });
13
- });
14
-
15
- it('"mcp" -> mcp (byte-compatible historical behavior)', () => {
16
- expect(decideEntry('mcp')).toEqual({ kind: 'mcp' });
17
- });
18
-
19
- it.each(CONSTRUCT_COMMANDS)('%s -> construct', (cmd) => {
20
- expect(decideEntry(cmd)).toEqual({ kind: 'construct' });
21
- });
22
-
23
- it('unknown/typo\'d command -> error naming the valid commands', () => {
24
- const decision = decideEntry('frobnicate');
25
- expect(decision.kind).toBe('error');
26
- for (const known of KNOWN_COMMANDS) {
27
- expect(decision.message).toContain(known);
28
- }
29
- });
30
- });
31
-
32
- describe('bin/mcp.js dispatcher (spawned, real process)', () => {
33
- it('unknown subcommand exits 2 with stderr naming valid commands, never falling through to the server', () => {
34
- let status = 0;
35
- let stderr = '';
36
- try {
37
- execFileSync('node', [binPath, 'frobnicate'], { timeout: 5000, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });
38
- } catch (err) {
39
- status = err.status;
40
- stderr = err.stderr;
41
- }
42
- expect(status).toBe(2);
43
- expect(stderr).toMatch(/valid commands/i);
44
- });
45
-
46
- it('a typo\'d valid-ish command (validat) also exits 2, not a hang', () => {
47
- let status = 0;
48
- let stderr = '';
49
- try {
50
- execFileSync('node', [binPath, 'validat'], { timeout: 5000, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });
51
- } catch (err) {
52
- status = err.status;
53
- stderr = err.stderr;
54
- }
55
- expect(status).toBe(2);
56
- expect(stderr).toMatch(/valid commands/i);
57
- });
58
- });
@@ -1 +0,0 @@
1
- import{I as o}from"./Icon-DObhsRtm.js";import{c as r,q as e}from"./define-By-uL588.js";var m=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],p=a=>r(o,e(a,{name:"ArrowDown",iconNode:m})),t=p;export{t as a};
@@ -1 +0,0 @@
1
- import{I as o}from"./Icon-DObhsRtm.js";import{c as r,q as e}from"./define-By-uL588.js";var m=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],t=a=>r(o,e(a,{name:"ArrowLeft",iconNode:m})),p=t;export{p as a};
@@ -1 +0,0 @@
1
- import{q as J,s as he,g as k,k as y,j as F,x as Q,o as X,p as fe,i as c,c as a,S as g,t as v,d as p,a as z,b as Y,u as Z,m as ge,h as be,e as ve}from"./define-By-uL588.js";import{c as H}from"./cn-DN5AWfiS.js";import{B as C}from"./button-DkuOnGLy.js";import{C as me,a as pe}from"./code-block-ClMLKb7C.js";import{F as we}from"./file-tree-CJqM2aP7.js";import{L as xe}from"./loader-BM4CEz4G.js";import{a as ke,i as ee}from"./url-scheme-policy-DR5DgvkM.js";import{a as ye}from"./arrow-left-Bnpb1UEW.js";import{a as ze,r as Ce,h as Te,e as Fe,c as Pe,d as Se}from"./rotate-cw-CMVLoCyH.js";import{e as re}from"./external-link-ByXAwBBQ.js";import{f as Oe}from"./file-text-DMib2qwt.js";import{m as Re,a as je}from"./minimize-2-BQRoBV1V.js";const Ie="6.0.227",ne=`https://cdn.jsdelivr.net/npm/pdfjs-dist@${Ie}/build`,He=()=>import(/*@vite-ignore*/`${ne}/pdf.min.mjs`),Ne=`${ne}/pdf.worker.min.mjs`;let Ee=He,Me=Ne,N=null;function $e(){if(!N){const r=Ee;N=(async()=>{const t=await r(),e=t.default??t;return e.GlobalWorkerOptions.workerSrc=Me,e})()}return N}async function Be(r,t,e){const i=await(await $e()).getDocument({url:r}).promise;t.replaceChildren();const o=typeof window<"u"&&window.devicePixelRatio?window.devicePixelRatio:1;for(let s=1;s<=i.numPages;s++){const d=await i.getPage(s),u=d.getViewport({scale:1}),h=u.width>0?e/u.width:1,f=d.getViewport({scale:h*o}),b=document.createElement("canvas");b.width=Math.max(1,Math.floor(f.width)),b.height=Math.max(1,Math.floor(f.height)),b.setAttribute("role","img"),b.setAttribute("aria-label",`Page ${s}`),b.style.width="100%",b.style.height="auto",b.style.display="block";const w=b.getContext("2d");t.appendChild(b),await d.render({canvasContext:w,viewport:f}).promise}return{pages:i.numPages}}var Le=v('<div><div class="relative min-h-0 flex-1">'),Ue=v('<form class="min-w-0 flex-1"><label class=sr-only for=kai-artifact-path>Address</label><input id=kai-artifact-path name=kai-artifact-path type=text autocomplete=off placeholder="Enter a path or URL\u2026">'),De=v("<div class=flex-1 aria-hidden=true>"),Ae=v('<div role=tablist aria-label=View class="flex shrink-0 items-center gap-0.5 rounded-md bg-muted p-0.5">'),Ve=v('<div data-artifact-toolbar class="flex shrink-0 items-center gap-1.5 border-b border-border bg-surface px-2 py-1.5">'),We=v("<button type=button role=tab>"),Ke=v('<iframe class="absolute inset-0 h-full w-full border-0 bg-white">'),_e=v('<div class="absolute inset-0 flex"><div class="w-56 shrink-0 overflow-auto border-r border-border bg-surface-sunken py-1.5 scrollbar-thin"></div><div class="min-w-0 flex-1 overflow-auto scrollbar-thin">'),qe=v('<div class="flex h-full items-center justify-center p-6 text-sm text-muted-foreground">Select a file to view its source.'),Ge=v('<div class="flex h-full items-center justify-center p-6 text-sm text-muted-foreground">No source \u2014 this file (<!>) has no code view.'),Je=v('<div class="flex flex-wrap items-center justify-center gap-2"><a class="inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"target=_blank rel="noopener noreferrer">Open in new tab</a><a class="inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"download>Download'),Qe=v(`<div role=region aria-label="PDF preview unavailable"class="absolute inset-0 flex flex-col items-center justify-center gap-3 bg-card p-6 text-center"><div class="text-sm font-medium text-foreground"></div><div class="text-xs text-muted-foreground">Can't preview this PDF inline.`),Xe=v(`<div class="text-xs text-muted-foreground">Blocked: that address uses a scheme this viewer won't open.`),Ye=v('<div class="pointer-events-none absolute inset-0 flex items-center justify-center">'),Ze=v('<div class="absolute inset-0"><div role=region aria-label="PDF preview"tabindex=0 class="absolute inset-0 flex flex-col items-center gap-3 overflow-auto bg-surface-sunken p-3 scrollbar-thin focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset">');const er="allow-scripts allow-forms";function E(r,t){console.warn(`[kai-artifact] blocked unsafe url in ${r}: ${t}`)}function rr(r,t){if(r.url)return r.url;if(!t)return r.path;try{return new URL(r.path,t).href}catch{return r.path}}function nr(r,t){if(!r)return!1;const e=t.find(o=>o.url===r||o.path===r);if(e?.type==="pdf")return!0;const i=r.split(/[?#]/)[0];return/\.pdf$/i.test(i)}function tr(r){const t=J({files:[],defaultTab:"preview",sandbox:er,showNav:!0,showReload:!0,showHome:!0,showPathField:!0,showTabs:!0,expandable:!1,openInTab:!1,standalone:!1,readonlyPath:!1,maximized:!1},r),[e,i]=he(t,["src","files","tab","defaultTab","activeFile","sandbox","iframeTitle","onNavigate","onTabChange","onFileSelect","maximized","onMaximizeChange","showNav","showReload","showHome","showPathField","showTabs","expandable","openInTab","standalone","readonlyPath","displayUrl","controllerRef","class"]),[o,s]=k(e.src?[e.src]:[]),[d,u]=k(e.src?0:-1),h=()=>o()[d()]??"",f=()=>d()>0,b=()=>d()<o().length-1,w=y(()=>{const n=h();return n&&ke(n)?(E("preview",n),""):n}),[P,M]=k(e.tab??e.defaultTab),[$,B]=k(e.activeFile),[ae,ie]=k(0),[S,O]=k(e.maximized??!1);F(()=>O(e.maximized??!1));const le=()=>{var n;const l=!S();O(l),(n=e.onMaximizeChange)==null||n.call(e,l)},L=y(()=>{const n=h();return!!n&&n!=="about:blank"&&ee(n)}),U=()=>{const n=h();if(!L()){n&&n!=="about:blank"&&E("openExternal",n);return}window.open(n,"_blank","noopener,noreferrer")},D=y(()=>e.expandable&&!e.standalone),oe=y(()=>e.showNav||e.showReload||e.showHome||e.showPathField||e.showTabs||D()||e.openInTab);let x;F(()=>{e.tab!==void 0&&M(e.tab)}),F(()=>B(e.activeFile)),F(Q(()=>e.src,n=>{n&&n!==h()&&T(n)},{defer:!0}));const A=n=>n===void 0?void 0:e.files.find(l=>l.path===n),V=y(()=>A($())),se=y(()=>{const n=V();return!!n&&n.type!=="image"&&n.type!=="pdf"&&typeof n.code=="string"});function T(n){if(n===h()){j();return}s(l=>[...l.slice(0,d()+1),n]),u(l=>l+1),R()}function R(){var n;x&&(x.src=w()||"about:blank"),(n=e.onNavigate)==null||n.call(e,h())}function de(n){var l;n!==P()&&(M(n),(l=e.onTabChange)==null||l.call(e,n))}function W(n,l){var m;B(n),(m=e.onFileSelect)==null||m.call(e,n),T(rr(l,e.src))}const K=()=>{f()&&(u(n=>n-1),R())},_=()=>{b()&&(u(n=>n+1),R())};function j(){var n;x&&(x.src="about:blank",x.src=w()||"about:blank"),ie(l=>l+1),(n=e.onNavigate)==null||n.call(e,h())}const q=()=>{e.src&&T(e.src)},G=n=>{var l;S()!==n&&(O(n),(l=e.onMaximizeChange)==null||l.call(e,n))};X(()=>{var n;(n=e.controllerRef)==null||n.call(e,{back:()=>K(),forward:()=>_(),reload:()=>j(),home:()=>q(),navigate:l=>T(l),selectFile:l=>{const m=A(l);m&&W(l,m)},openExternal:()=>U(),maximize:()=>G(!0),restore:()=>G(!1)})});const ue=()=>{var n,l;try{const m=(n=x?.contentWindow)==null?void 0:n.location.href;m&&m!=="about:blank"&&m!==h()&&(s(I=>[...I.slice(0,d()+1),m]),u(I=>I+1),(l=e.onNavigate)==null||l.call(e,m))}catch{}},ce=n=>{n.preventDefault();const l=n.currentTarget.elements.namedItem("kai-artifact-path");if(e.readonlyPath||e.displayUrl!=null){l&&(l.value=e.displayUrl??h());return}l&&l.value&&T(l.value)};return(()=>{var n=Le(),l=n.firstChild;return fe(n,J({get class(){return H("flex h-full w-full flex-col overflow-hidden bg-card text-card-foreground",e.standalone&&"rounded-xl border border-border",e.class)}},i),!1,!0),c(n,a(g,{get when(){return oe()},get children(){return a(ar,{url:()=>e.displayUrl??h(),tab:P,canBack:f,canForward:b,canHome:()=>!!e.src,onBack:K,onForward:_,onReload:j,onHome:q,onSubmitPath:ce,onTab:de,showNav:()=>e.showNav,showReload:()=>e.showReload,showHome:()=>e.showHome,showPathField:()=>e.showPathField,showTabs:()=>e.showTabs,showExpand:D,showOpenInTab:()=>e.openInTab,maximized:S,onToggleMaximize:le,canOpenInTab:L,onOpenInTab:U,readonlyPath:()=>e.readonlyPath||e.displayUrl!=null})}}),l),c(l,a(g,{get when(){return P()==="preview"},get fallback(){return a(lr,{get files(){return e.files},activeFile:$,activeFileObj:V,hasSource:se,onSelect:W})},get children(){return a(g,{get when(){return nr(h(),e.files)},get fallback(){return a(ir,{ref:m=>x=m,src:w,get sandbox(){return e.sandbox},get title(){return e.iframeTitle??"Artifact preview"},onLoad:ue})},get children(){return a(sr,{get url(){return h()},get reloadKey(){return ae()}})}})}})),n})()}function ar(r){return(()=>{var t=Ve();return c(t,a(g,{get when(){return r.showNav()},get children(){return[a(C,{variant:"ghost",size:"icon-sm","aria-label":"Back",get disabled(){return!r.canBack()},onClick:()=>r.onBack(),get children(){return a(ye,{size:16,"aria-hidden":"true"})}}),a(C,{variant:"ghost",size:"icon-sm","aria-label":"Forward",get disabled(){return!r.canForward()},onClick:()=>r.onForward(),get children(){return a(ze,{size:16,"aria-hidden":"true"})}})]}}),null),c(t,a(g,{get when(){return r.showReload()},get children(){return a(C,{variant:"ghost",size:"icon-sm","aria-label":"Reload",onClick:()=>r.onReload(),get children(){return a(Ce,{size:15,"aria-hidden":"true"})}})}}),null),c(t,a(g,{get when(){return r.showHome()},get children(){return a(C,{variant:"ghost",size:"icon-sm","aria-label":"Home",get disabled(){return!r.canHome()},onClick:()=>r.onHome(),get children(){return a(Te,{size:15,"aria-hidden":"true"})}})}}),null),c(t,a(g,{get when(){return r.showPathField()},get children(){var e=Ue(),i=e.firstChild,o=i.nextSibling;return e.addEventListener("submit",s=>r.onSubmitPath(s)),p(o,"spellcheck",!1),z(s=>{var d=r.readonlyPath()||void 0,u=r.readonlyPath()?"true":void 0,h=H("h-7 w-full rounded-md border border-border px-2.5 text-xs text-foreground font-mono outline-none",r.readonlyPath()?"bg-muted/40 cursor-default":"bg-background focus-visible:ring-2 focus-visible:ring-ring");return d!==s.e&&(o.readOnly=s.e=d),u!==s.t&&p(o,"aria-readonly",s.t=u),h!==s.a&&Y(o,s.a=h),s},{e:void 0,t:void 0,a:void 0}),z(()=>o.value=r.url()),e}}),null),c(t,a(g,{get when(){return!r.showPathField()},get children(){return De()}}),null),c(t,a(g,{get when(){return r.showExpand()},get children(){return a(C,{variant:"ghost",size:"icon-sm",get"aria-label"(){return r.maximized()?"Collapse":"Expand"},get"aria-expanded"(){return r.maximized()},onClick:()=>r.onToggleMaximize(),get children(){return a(g,{get when(){return r.maximized()},get fallback(){return a(je,{size:15,"aria-hidden":"true"})},get children(){return a(Re,{size:15,"aria-hidden":"true"})}})}})}}),null),c(t,a(g,{get when(){return r.showOpenInTab()},get children(){return a(C,{variant:"ghost",size:"icon-sm","aria-label":"Open in new tab",get disabled(){return!r.canOpenInTab()},onClick:()=>r.onOpenInTab(),get children(){return a(re,{size:15,"aria-hidden":"true"})}})}}),null),c(t,a(g,{get when(){return r.showTabs()},get children(){var e=Ae();return c(e,a(te,{label:"Preview",get icon(){return a(Fe,{size:14,"aria-hidden":"true"})},get selected(){return r.tab()==="preview"},onClick:()=>r.onTab("preview")}),null),c(e,a(te,{label:"Code",get icon(){return a(Pe,{size:14,"aria-hidden":"true"})},get selected(){return r.tab()==="code"},onClick:()=>r.onTab("code")}),null),e}}),null),t})()}function te(r){return(()=>{var t=We();return t.$$click=()=>r.onClick(),c(t,()=>r.icon,null),c(t,()=>r.label,null),z(e=>{var i=r.selected,o=H("inline-flex h-6 items-center gap-1.5 rounded px-2 text-xs font-medium transition-colors outline-none","focus-visible:ring-2 focus-visible:ring-ring",r.selected?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground");return i!==e.e&&p(t,"aria-selected",e.e=i),o!==e.t&&Y(t,e.t=o),e},{e:void 0,t:void 0}),t})()}function ir(r){return(()=>{var t=Ke();t.addEventListener("load",()=>r.onLoad());var e=r.ref;return typeof e=="function"?Z(e,t):r.ref=t,z(i=>{var o=r.src()||"about:blank",s=r.sandbox,d=r.title;return o!==i.e&&p(t,"src",i.e=o),s!==i.t&&p(t,"sandbox",i.t=s),d!==i.a&&p(t,"title",i.a=d),i},{e:void 0,t:void 0,a:void 0}),t})()}function lr(r){return(()=>{var t=_e(),e=t.firstChild,i=e.nextSibling;return c(e,a(we,{get files(){return r.files},get activeFile(){return r.activeFile()},onSelect:(o,s)=>r.onSelect(o,s)})),c(i,a(g,{get when(){return r.activeFileObj()},get fallback(){return qe()},get children(){return a(g,{get when(){return r.hasSource()},get fallback(){return(()=>{var o=Ge(),s=o.firstChild,d=s.nextSibling;return d.nextSibling,c(o,()=>r.activeFileObj().type??"binary",d),o})()},get children(){return a(me,{class:"h-full rounded-none border-0",get children(){return a(pe,{get code(){return r.activeFileObj().code??""},get language(){return r.activeFileObj().language}})}})}})}})),t})()}function or(r){const t=()=>{const i=r.url.split(/[?#]/)[0];return i.slice(i.lastIndexOf("/")+1)||"document.pdf"},e=y(()=>{if(r.url){if(ee(r.url))return r.url;E("pdf fallback",r.url)}});return(()=>{var i=Qe(),o=i.firstChild;return o.nextSibling,c(i,a(Oe,{size:40,class:"text-muted-foreground","aria-hidden":"true"}),o),c(o,t),c(i,a(g,{get when(){return e()},get fallback(){return Xe()},get children(){var s=Je(),d=s.firstChild;d.firstChild;var u=d.nextSibling,h=u.firstChild;return c(d,a(re,{size:13,"aria-hidden":"true"}),null),c(u,a(Se,{size:13,"aria-hidden":"true"}),h),z(f=>{var b=e(),w=e();return b!==f.e&&p(d,"href",f.e=b),w!==f.t&&p(u,"href",f.t=w),f},{e:void 0,t:void 0}),s}}),null),i})()}function sr(r){const[t,e]=k("loading");let i,o=0,s;const d=async()=>{if(!i){e("error");return}const u=++o;e("loading");try{const h=i.clientWidth||600;await Be(r.url,i,h),u===o&&e("success")}catch{u===o&&e("error")}};return F(Q(()=>[r.url,r.reloadKey],()=>{d()})),X(()=>{if(!i||typeof ResizeObserver>"u")return;const u=new ResizeObserver(()=>{t()==="success"&&(clearTimeout(s),s=setTimeout(()=>{d()},200))});u.observe(i),be(()=>{u.disconnect(),clearTimeout(s),o++})}),(()=>{var u=Ze(),h=u.firstChild;return Z(f=>i=f,h),c(u,a(g,{get when(){return ge(()=>!0)()&&t()==="loading"},get children(){var f=Ye();return c(f,a(xe,{variant:"circular",size:"md"})),f}}),null),c(u,a(g,{get when(){return t()==="error"},get children(){return a(or,{get url(){return r.url}})}}),null),z(()=>p(h,"aria-busy",t()==="loading")),u})()}ve(["click"]);export{tr as A};
@@ -1 +0,0 @@
1
- import{I as o}from"./Icon-DObhsRtm.js";import{c as m,q as r}from"./define-By-uL588.js";var c=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],e=a=>m(o,r(a,{name:"Check",iconNode:c})),f=e;export{f as c};
@@ -1 +0,0 @@
1
- import{I as r}from"./Icon-DObhsRtm.js";import{c as a,q as m}from"./define-By-uL588.js";var e=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],n=o=>a(r,m(o,{name:"ChevronDown",iconNode:e})),p=n;export{p as c};
@@ -1 +0,0 @@
1
- import{I as a}from"./Icon-DObhsRtm.js";import{c as m,q as r}from"./define-By-uL588.js";var t=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],e=o=>m(a,r(o,{name:"ChevronRight",iconNode:t})),h=e;export{h as c};
@@ -1 +0,0 @@
1
- import{I as m}from"./Icon-DObhsRtm.js";import{c as r,q as a}from"./define-By-uL588.js";var e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],o=c=>r(m,a(c,{name:"CircleCheck",iconNode:e})),i=o;export{i as c};
@@ -1 +0,0 @@
1
- import{I as c}from"./Icon-DObhsRtm.js";import{c as o,q as a}from"./define-By-uL588.js";var e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],m=r=>o(c,a(r,{name:"Circle",iconNode:e})),i=m;export{i as c};
@@ -1 +0,0 @@
1
- import{g as c}from"./define-By-uL588.js";function i(t,o){const[r,n]=c(o);return[()=>t()??r(),a=>n(a)]}export{i as c};