@kitn.ai/ui 0.16.0 → 0.18.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 (493) hide show
  1. package/README.md +55 -17
  2. package/dist/components/artifact.d.ts +39 -1
  3. package/dist/components/attachment-types.d.ts +12 -0
  4. package/dist/components/attachments.d.ts +2 -10
  5. package/dist/components/card.d.ts +27 -0
  6. package/dist/components/chain-of-thought.d.ts +78 -2
  7. package/dist/components/chat-scope-picker.d.ts +7 -0
  8. package/dist/components/chat-thread.d.ts +39 -16
  9. package/dist/components/choice-card.d.ts +27 -0
  10. package/dist/components/coachmark.d.ts +49 -0
  11. package/dist/components/composer-dom.d.ts +35 -0
  12. package/dist/components/composer-highlight.d.ts +48 -0
  13. package/dist/components/composer-history.d.ts +34 -0
  14. package/dist/components/composer.d.ts +86 -0
  15. package/dist/components/confirm-card.d.ts +17 -0
  16. package/dist/components/conversation-item.d.ts +9 -0
  17. package/dist/components/conversation-list.d.ts +36 -1
  18. package/dist/components/dismissed-stub.d.ts +22 -0
  19. package/dist/components/file-tree.d.ts +15 -0
  20. package/dist/components/form.d.ts +34 -0
  21. package/dist/components/markdown.d.ts +3 -0
  22. package/dist/components/message.d.ts +71 -2
  23. package/dist/components/model-switcher.d.ts +7 -0
  24. package/dist/components/prompt-input.d.ts +13 -4
  25. package/dist/components/prompt-suggestion.d.ts +9 -1
  26. package/dist/components/reasoning.d.ts +14 -1
  27. package/dist/components/response-compare-types.d.ts +66 -0
  28. package/dist/components/response-compare.d.ts +65 -0
  29. package/dist/components/screen.d.ts +46 -0
  30. package/dist/components/tasks-card.d.ts +50 -1
  31. package/dist/components/toast.d.ts +58 -0
  32. package/dist/components/tool-types.d.ts +10 -0
  33. package/dist/components/tool.d.ts +8 -8
  34. package/dist/components/use-card-resolution.d.ts +10 -6
  35. package/dist/components/voice-input.d.ts +27 -0
  36. package/dist/components/voice-output.d.ts +33 -0
  37. package/dist/core-C8fzo39E.js +12 -0
  38. package/dist/custom-elements.json +8472 -1691
  39. package/dist/elements/agent-card.d.ts +1 -0
  40. package/dist/elements/agent-card.js +1 -0
  41. package/dist/elements/artifact.js +1 -0
  42. package/dist/elements/attachments.js +1 -0
  43. package/dist/elements/autoloader.d.ts +2 -0
  44. package/dist/elements/autoloader.js +1 -0
  45. package/dist/elements/avatar.d.ts +1 -0
  46. package/dist/elements/avatar.js +1 -0
  47. package/dist/elements/badge.d.ts +1 -0
  48. package/dist/elements/badge.js +1 -0
  49. package/dist/elements/button.d.ts +1 -0
  50. package/dist/elements/button.js +1 -0
  51. package/dist/elements/card.js +1 -0
  52. package/dist/elements/cards.d.ts +1 -0
  53. package/dist/elements/cards.js +1 -0
  54. package/dist/elements/chain-of-thought.d.ts +0 -12
  55. package/dist/elements/chain-of-thought.js +1 -0
  56. package/dist/elements/chat-scope-picker.js +1 -0
  57. package/dist/elements/chat-types.d.ts +8 -2
  58. package/dist/elements/chat-workspace.js +1 -0
  59. package/dist/elements/chat.js +1 -0
  60. package/dist/elements/checkpoint.js +1 -0
  61. package/dist/elements/choice.js +1 -0
  62. package/dist/elements/chunks/Icon-DLLBeLG5.js +1 -0
  63. package/dist/elements/chunks/action-icons-UB4V5FNq.js +1 -0
  64. package/dist/elements/chunks/arrow-left-C-gwlUmx.js +1 -0
  65. package/dist/elements/chunks/attachments-CgbErf1r.js +1 -0
  66. package/dist/elements/chunks/badge-DTQpgB6N.js +1 -0
  67. package/dist/elements/chunks/bash-InADTalH.js +1 -0
  68. package/dist/elements/chunks/button-XDUM6lXs.js +1 -0
  69. package/dist/elements/chunks/card-CBlFZ-7I.js +1 -0
  70. package/dist/elements/chunks/card-routing-C986KuUA.js +1 -0
  71. package/dist/elements/chunks/chat-thread-BIhmqwNL.js +1 -0
  72. package/dist/elements/chunks/check-hGUoVIKb.js +1 -0
  73. package/dist/elements/chunks/chevron-down-DDoaSUtO.js +1 -0
  74. package/dist/elements/chunks/chevron-right-CdGEUakB.js +1 -0
  75. package/dist/elements/chunks/circle-BKAZdmzb.js +1 -0
  76. package/dist/elements/chunks/circle-check-CmYG-y3I.js +1 -0
  77. package/dist/elements/chunks/circle-x-DewgAEym.js +1 -0
  78. package/dist/elements/chunks/cn-CU7UAWzk.js +1 -0
  79. package/dist/elements/chunks/code-block-DedwxwFI.js +1 -0
  80. package/dist/elements/chunks/collapsible-FfgmTHtM.js +1 -0
  81. package/dist/elements/chunks/composer-Cfbw5HKT.js +65 -0
  82. package/dist/elements/chunks/context-DwJmxlRE.js +1 -0
  83. package/dist/elements/chunks/conversation-list-DsCQMfPq.js +1 -0
  84. package/dist/elements/chunks/core-AYMC6_lb.js +12 -0
  85. package/dist/elements/chunks/css-M7EaDHN_.js +1 -0
  86. package/dist/elements/chunks/default-input-BuqsoENC.js +1 -0
  87. package/dist/elements/chunks/define-rGsaWsLL.js +1 -0
  88. package/dist/elements/chunks/disclosure-CwoAkpMH.js +1 -0
  89. package/dist/elements/chunks/download-DJ06G3Bz.js +1 -0
  90. package/dist/elements/chunks/dropdown-BFg8ri_R.js +1 -0
  91. package/dist/elements/chunks/ellipsis-dlN6YvGw.js +1 -0
  92. package/dist/elements/chunks/engine-javascript-vq0WuIJl.js +141 -0
  93. package/dist/elements/chunks/external-link-DBX2lc_R.js +1 -0
  94. package/dist/elements/chunks/file-text-HfwUx4F9.js +1 -0
  95. package/dist/elements/chunks/file-tree-C6Toj71u.js +1 -0
  96. package/dist/elements/chunks/folder-MYuqa9Xp.js +1 -0
  97. package/dist/elements/chunks/github-dark-dimmed-DUshB20C.js +1 -0
  98. package/dist/elements/chunks/github-light-JYsPkUQd.js +1 -0
  99. package/dist/elements/chunks/hover-card-gE7iyXdW.js +1 -0
  100. package/dist/elements/chunks/html-CPZ3oZQ7.js +1 -0
  101. package/dist/elements/chunks/icon-Vqz4ivrY.js +1 -0
  102. package/dist/elements/chunks/index-BCRhi84a.js +1 -0
  103. package/dist/elements/chunks/info-B_toFS0l.js +1 -0
  104. package/dist/elements/chunks/input-gzbHYZvQ.js +1 -0
  105. package/dist/elements/chunks/javascript-C25yR2R2.js +1 -0
  106. package/dist/elements/chunks/json-DxJze_jm.js +1 -0
  107. package/dist/elements/chunks/kbd-n49c4KZm.js +1 -0
  108. package/dist/elements/chunks/link-CKPs9yM0.js +1 -0
  109. package/dist/elements/chunks/loader-q6MamGus.js +1 -0
  110. package/dist/elements/chunks/markdown-DBrcqq4S.js +64 -0
  111. package/dist/elements/chunks/message-CTqaYI0s.js +1 -0
  112. package/dist/elements/chunks/message-feedback-Cvzm03w0.js +1 -0
  113. package/dist/elements/chunks/message-square-CUg9eRCi.js +1 -0
  114. package/dist/elements/chunks/minimize-2-l2klxP6K.js +1 -0
  115. package/dist/elements/chunks/model-switcher-CmyjiHO1.js +1 -0
  116. package/dist/elements/chunks/overlay-C8sOYqjT.js +1 -0
  117. package/dist/elements/chunks/paperclip-42Ia7xHD.js +1 -0
  118. package/dist/elements/chunks/progress-bar-tzKMWAwO.js +1 -0
  119. package/dist/elements/chunks/prompt-suggestion-D3F6vP_A.js +1 -0
  120. package/dist/elements/chunks/reasoning-BJNmmyov.js +1 -0
  121. package/dist/elements/chunks/resizable-BRsk19qI.js +1 -0
  122. package/dist/elements/chunks/rotate-cw-BgcggLHC.js +1 -0
  123. package/dist/elements/chunks/scroll-area-CgGbFFbT.js +1 -0
  124. package/dist/elements/chunks/separator-8hM4GdHE.js +1 -0
  125. package/dist/elements/chunks/settings-CaUIYOg-.js +1 -0
  126. package/dist/elements/chunks/settings-group-CYjOVIZQ.js +1 -0
  127. package/dist/elements/chunks/share-BTYM3Ddt.js +1 -0
  128. package/dist/elements/chunks/skeleton-DsTYrPUe.js +1 -0
  129. package/dist/elements/chunks/slots-DkZ-Cmha.js +1 -0
  130. package/dist/elements/chunks/star-9R3LBQ9n.js +1 -0
  131. package/dist/elements/chunks/store-CYl5Y0_u.js +1 -0
  132. package/dist/elements/chunks/svelte--5p79yCD.js +1 -0
  133. package/dist/elements/chunks/text-shimmer-CaYGv8Se.js +1 -0
  134. package/dist/elements/chunks/textarea-NEr2SLcD.js +1 -0
  135. package/dist/elements/chunks/thumbs-up-DZYZkFfc.js +1 -0
  136. package/dist/elements/chunks/toast-store-ClxVZRcc.js +1 -0
  137. package/dist/elements/chunks/tool-CHZOmoe9.js +1 -0
  138. package/dist/elements/chunks/tooltip-WpHElELC.js +1 -0
  139. package/dist/elements/chunks/triangle-alert-BlS80PUg.js +1 -0
  140. package/dist/elements/chunks/tsx-B8rCNbgL.js +1 -0
  141. package/dist/elements/chunks/typescript-RycA9KXf.js +1 -0
  142. package/dist/elements/chunks/use-card-resolution-VSVoxDeJ.js +1 -0
  143. package/dist/elements/chunks/video-DxTPZqT8.js +1 -0
  144. package/dist/elements/chunks/vue-BmIZj4XD.js +1 -0
  145. package/dist/elements/chunks/x-C1qtndxn.js +1 -0
  146. package/dist/elements/coachmark.d.ts +1 -0
  147. package/dist/elements/coachmark.js +1 -0
  148. package/dist/elements/code-block.js +1 -0
  149. package/dist/elements/command.d.ts +1 -0
  150. package/dist/elements/command.js +1 -0
  151. package/dist/elements/compare.d.ts +1 -0
  152. package/dist/elements/compare.js +1 -0
  153. package/dist/elements/composer.d.ts +1 -0
  154. package/dist/elements/composer.js +1 -0
  155. package/dist/elements/confirm-card.js +1 -0
  156. package/dist/elements/context-meter.js +1 -0
  157. package/dist/elements/conversation-list.d.ts +1 -11
  158. package/dist/elements/conversation-list.js +1 -0
  159. package/dist/elements/default-input.d.ts +20 -9
  160. package/dist/elements/define.d.ts +11 -0
  161. package/dist/elements/dialog.d.ts +1 -0
  162. package/dist/elements/dialog.js +1 -0
  163. package/dist/elements/disclosure.d.ts +37 -0
  164. package/dist/elements/editable-label.d.ts +1 -0
  165. package/dist/elements/editable-label.js +1 -0
  166. package/dist/elements/embed.js +1 -0
  167. package/dist/elements/empty.js +1 -0
  168. package/dist/elements/feedback-bar.js +1 -0
  169. package/dist/elements/file-tree.js +1 -0
  170. package/dist/elements/file-upload.js +1 -0
  171. package/dist/elements/form.js +1 -0
  172. package/dist/elements/hover-card.d.ts +1 -0
  173. package/dist/elements/hover-card.js +1 -0
  174. package/dist/elements/icon.d.ts +1 -0
  175. package/dist/elements/icon.js +1 -0
  176. package/dist/elements/image.js +1 -0
  177. package/dist/elements/input.d.ts +1 -0
  178. package/dist/elements/input.js +1 -0
  179. package/dist/elements/kbd.d.ts +1 -0
  180. package/dist/elements/kbd.js +1 -0
  181. package/dist/elements/link-preview.js +1 -0
  182. package/dist/elements/loader.js +1 -0
  183. package/dist/elements/markdown.js +1 -0
  184. package/dist/elements/menu.d.ts +1 -0
  185. package/dist/elements/menu.js +1 -0
  186. package/dist/elements/message-skills.d.ts +0 -16
  187. package/dist/elements/message-skills.js +1 -0
  188. package/dist/elements/message.js +1 -0
  189. package/dist/elements/model-switcher.d.ts +1 -11
  190. package/dist/elements/model-switcher.js +1 -0
  191. package/dist/elements/nav.d.ts +1 -0
  192. package/dist/elements/nav.js +1 -0
  193. package/dist/elements/notice.d.ts +1 -0
  194. package/dist/elements/notice.js +1 -0
  195. package/dist/elements/pane-group.d.ts +1 -0
  196. package/dist/elements/pane-group.js +1 -0
  197. package/dist/elements/pane.d.ts +1 -0
  198. package/dist/elements/pane.js +1 -0
  199. package/dist/elements/popover.js +1 -0
  200. package/dist/elements/progress-bar.d.ts +1 -0
  201. package/dist/elements/progress-bar.js +1 -0
  202. package/dist/elements/prompt-dock.d.ts +1 -0
  203. package/dist/elements/prompt-dock.js +1 -0
  204. package/dist/elements/prompt-input.d.ts +1 -9
  205. package/dist/elements/prompt-input.js +1 -0
  206. package/dist/elements/prompt-suggestions.d.ts +0 -6
  207. package/dist/elements/prompt-suggestions.js +1 -0
  208. package/dist/elements/reasoning.js +1 -0
  209. package/dist/elements/register.d.ts +10 -0
  210. package/dist/elements/remote.js +1 -0
  211. package/dist/elements/resizable.d.ts +1 -17
  212. package/dist/elements/resizable.js +1 -0
  213. package/dist/elements/response-stream.js +14 -0
  214. package/dist/elements/screen.d.ts +1 -0
  215. package/dist/elements/screen.js +1 -0
  216. package/dist/elements/scroll-area.d.ts +1 -0
  217. package/dist/elements/scroll-area.js +1 -0
  218. package/dist/elements/scroll-button.js +1 -0
  219. package/dist/elements/search.d.ts +1 -0
  220. package/dist/elements/search.js +1 -0
  221. package/dist/elements/segmented.d.ts +1 -0
  222. package/dist/elements/segmented.js +1 -0
  223. package/dist/elements/separator.d.ts +1 -0
  224. package/dist/elements/separator.js +1 -0
  225. package/dist/elements/setting-item.d.ts +1 -0
  226. package/dist/elements/setting-item.js +1 -0
  227. package/dist/elements/settings-group.d.ts +1 -0
  228. package/dist/elements/settings-group.js +1 -0
  229. package/dist/elements/skeleton.d.ts +1 -0
  230. package/dist/elements/skeleton.js +1 -0
  231. package/dist/elements/slots.d.ts +176 -0
  232. package/dist/elements/source.d.ts +0 -17
  233. package/dist/elements/source.js +1 -0
  234. package/dist/elements/status.d.ts +1 -0
  235. package/dist/elements/status.js +1 -0
  236. package/dist/elements/switch.js +1 -0
  237. package/dist/elements/tabs.d.ts +1 -0
  238. package/dist/elements/tabs.js +1 -0
  239. package/dist/elements/tasks.js +1 -0
  240. package/dist/elements/text-shimmer.js +1 -0
  241. package/dist/elements/thinking-bar.js +1 -0
  242. package/dist/elements/toast.d.ts +1 -0
  243. package/dist/elements/toast.js +1 -0
  244. package/dist/elements/tool.js +1 -0
  245. package/dist/elements/tooltip.d.ts +1 -0
  246. package/dist/elements/tooltip.js +1 -0
  247. package/dist/elements/voice-input.js +1 -0
  248. package/dist/elements/voice-output.d.ts +1 -0
  249. package/dist/elements/voice-output.js +1 -0
  250. package/dist/elements.d.ts +772 -61
  251. package/dist/engine-javascript-C1x7zo1_.js +141 -0
  252. package/dist/index.d.ts +15 -2
  253. package/dist/index.js +14405 -9810
  254. package/dist/kai.es.js +1 -0
  255. package/dist/llms/llms-full.txt +1234 -107
  256. package/dist/llms/llms.txt +4 -4
  257. package/dist/mcp.es.js +217 -6
  258. package/dist/primitives/card-contract.d.ts +20 -4
  259. package/dist/primitives/card-recovery.d.ts +55 -0
  260. package/dist/primitives/composer-model.d.ts +22 -0
  261. package/dist/primitives/composer-triggers.d.ts +19 -0
  262. package/dist/primitives/create-kai-chat.d.ts +38 -0
  263. package/dist/primitives/message-feedback.d.ts +35 -0
  264. package/dist/primitives/toast-store.d.ts +118 -0
  265. package/dist/primitives/use-speech-recognition.d.ts +26 -0
  266. package/dist/react/index.d.ts +1166 -98
  267. package/dist/react/runtime.d.ts +9 -2
  268. package/dist/react/use-kai-chat.d.ts +41 -0
  269. package/dist/react.js +575 -186
  270. package/dist/register-impl-CYWGkgbI.js +141 -0
  271. package/dist/schemas/choice.schema.json +5 -0
  272. package/dist/schemas/tasks.schema.json +7 -2
  273. package/dist/state/index.d.ts +4 -0
  274. package/dist/state/messages.d.ts +11 -0
  275. package/dist/state/stream.d.ts +22 -0
  276. package/dist/state/suggestions.d.ts +4 -0
  277. package/dist/state.js +117 -0
  278. package/dist/theme.tokens.css +87 -0
  279. package/dist/types.d.ts +4 -0
  280. package/dist/ui/agent-card.d.ts +61 -0
  281. package/dist/ui/button.d.ts +5 -2
  282. package/dist/ui/card.d.ts +61 -0
  283. package/dist/ui/collapsible.d.ts +15 -1
  284. package/dist/ui/command.d.ts +33 -0
  285. package/dist/ui/dialog.d.ts +42 -0
  286. package/dist/ui/dropdown.d.ts +95 -1
  287. package/dist/ui/editable-label.d.ts +26 -0
  288. package/dist/ui/hover-card.d.ts +13 -1
  289. package/dist/ui/icon.d.ts +18 -0
  290. package/dist/ui/input.d.ts +33 -0
  291. package/dist/ui/kbd.d.ts +21 -0
  292. package/dist/ui/nav.d.ts +62 -0
  293. package/dist/ui/notice.d.ts +31 -0
  294. package/dist/ui/overlay.d.ts +12 -0
  295. package/dist/ui/pane-grid.d.ts +58 -0
  296. package/dist/ui/pane-group.d.ts +75 -0
  297. package/dist/ui/pane.d.ts +78 -0
  298. package/dist/ui/popover.d.ts +11 -1
  299. package/dist/ui/progress-bar.d.ts +23 -0
  300. package/dist/ui/prompt-dock.d.ts +96 -0
  301. package/dist/ui/resizable.d.ts +12 -0
  302. package/dist/ui/scroll-area.d.ts +4 -0
  303. package/dist/ui/segmented.d.ts +28 -0
  304. package/dist/ui/settings-group.d.ts +32 -0
  305. package/dist/ui/skeleton.d.ts +12 -0
  306. package/dist/ui/stat.d.ts +16 -0
  307. package/dist/ui/status.d.ts +13 -0
  308. package/dist/ui/switch.d.ts +8 -1
  309. package/dist/ui/tabs.d.ts +35 -0
  310. package/dist/ui/tooltip.d.ts +20 -1
  311. package/frameworks/react/index.tsx +1100 -163
  312. package/frameworks/react/runtime.tsx +30 -1
  313. package/frameworks/react/use-kai-chat.tsx +87 -0
  314. package/llms-full.txt +1234 -107
  315. package/llms.txt +4 -4
  316. package/package.json +36 -12
  317. package/src/agent-tooling/mcp/manifest.ts +14 -0
  318. package/src/agent-tooling/mcp/tools/debug.ts +194 -6
  319. package/src/agent-tooling/mcp/tools/reference.ts +32 -0
  320. package/src/agent-tooling/mcp/tools/scaffold.ts +162 -1
  321. package/src/components/artifact.tsx +98 -13
  322. package/src/components/attachment-types.ts +13 -0
  323. package/src/components/attachments.tsx +4 -14
  324. package/src/components/card.tsx +109 -15
  325. package/src/components/chain-of-thought.tsx +210 -1
  326. package/src/components/chat-scope-picker.tsx +13 -3
  327. package/src/components/chat-thread.tsx +238 -137
  328. package/src/components/choice-card.tsx +136 -15
  329. package/src/components/coachmark.tsx +245 -0
  330. package/src/components/component-meta.json +921 -108
  331. package/src/components/composer-dom.ts +159 -0
  332. package/src/components/composer-highlight.ts +242 -0
  333. package/src/components/composer-history.ts +82 -0
  334. package/src/components/composer.tsx +979 -0
  335. package/src/components/confirm-card.tsx +69 -2
  336. package/src/components/conversation-item.tsx +69 -7
  337. package/src/components/conversation-list.tsx +134 -37
  338. package/src/components/dismissed-stub.tsx +80 -0
  339. package/src/components/file-tree.tsx +197 -47
  340. package/src/components/form-widgets.tsx +9 -7
  341. package/src/components/form.tsx +161 -20
  342. package/src/components/image.tsx +3 -5
  343. package/src/components/link-preview.tsx +5 -4
  344. package/src/components/markdown.tsx +5 -2
  345. package/src/components/message.tsx +174 -14
  346. package/src/components/model-switcher.tsx +19 -4
  347. package/src/components/prompt-input.tsx +46 -75
  348. package/src/components/prompt-suggestion.tsx +48 -16
  349. package/src/components/reasoning.tsx +29 -6
  350. package/src/components/response-compare-types.ts +127 -0
  351. package/src/components/response-compare.tsx +460 -0
  352. package/src/components/screen.tsx +176 -0
  353. package/src/components/tasks-card.tsx +374 -23
  354. package/src/components/toast.tsx +486 -0
  355. package/src/components/tool-types.ts +10 -0
  356. package/src/components/tool.tsx +22 -16
  357. package/src/components/use-card-resolution.ts +24 -8
  358. package/src/components/voice-input.tsx +102 -19
  359. package/src/components/voice-output.tsx +202 -0
  360. package/src/elements/agent-card.tsx +67 -0
  361. package/src/elements/artifact.tsx +53 -4
  362. package/src/elements/attachments.tsx +1 -0
  363. package/src/elements/autoloader.ts +89 -0
  364. package/src/elements/avatar.tsx +33 -0
  365. package/src/elements/badge.tsx +32 -0
  366. package/src/elements/button.tsx +126 -0
  367. package/src/elements/card-media.jpg +0 -0
  368. package/src/elements/card.tsx +124 -31
  369. package/src/elements/cards.tsx +81 -7
  370. package/src/elements/chain-of-thought.tsx +77 -32
  371. package/src/elements/chat-scope-picker.tsx +35 -8
  372. package/src/elements/chat-types.ts +9 -2
  373. package/src/elements/chat-workspace.tsx +157 -43
  374. package/src/elements/chat.tsx +49 -25
  375. package/src/elements/choice.tsx +71 -19
  376. package/src/elements/coachmark.tsx +90 -0
  377. package/src/elements/command.tsx +209 -0
  378. package/src/elements/compare.tsx +110 -0
  379. package/src/elements/compiled.css +1 -1
  380. package/src/elements/composer.tsx +151 -0
  381. package/src/elements/confirm-card.tsx +36 -11
  382. package/src/elements/conversation-list.tsx +80 -11
  383. package/src/elements/default-input.tsx +75 -53
  384. package/src/elements/define.tsx +47 -6
  385. package/src/elements/dialog.tsx +98 -0
  386. package/src/elements/disclosure.ts +73 -0
  387. package/src/elements/editable-label.tsx +125 -0
  388. package/src/elements/element-manifest.json +310 -0
  389. package/src/elements/element-meta.json +5954 -1605
  390. package/src/elements/element-types.d.ts +771 -60
  391. package/src/elements/file-tree.tsx +12 -2
  392. package/src/elements/file-upload.tsx +1 -1
  393. package/src/elements/form.tsx +54 -11
  394. package/src/elements/hover-card.tsx +80 -0
  395. package/src/elements/icon-names.json +48 -0
  396. package/src/elements/icon.tsx +41 -0
  397. package/src/elements/input.tsx +203 -0
  398. package/src/elements/kbd.tsx +45 -0
  399. package/src/elements/menu.tsx +217 -0
  400. package/src/elements/message.tsx +84 -55
  401. package/src/elements/model-switcher.tsx +27 -1
  402. package/src/elements/nav.tsx +87 -0
  403. package/src/elements/notice.tsx +53 -0
  404. package/src/elements/pane-group.tsx +119 -0
  405. package/src/elements/pane.tsx +129 -0
  406. package/src/elements/popover.tsx +39 -17
  407. package/src/elements/progress-bar.tsx +39 -0
  408. package/src/elements/prompt-dock.tsx +81 -0
  409. package/src/elements/prompt-input.tsx +112 -63
  410. package/src/elements/prompt-suggestions.tsx +25 -9
  411. package/src/elements/reasoning.tsx +30 -9
  412. package/src/elements/register-impl.ts +41 -3
  413. package/src/elements/register.ts +20 -3
  414. package/src/elements/remote.tsx +4 -0
  415. package/src/elements/resizable.tsx +48 -11
  416. package/src/elements/screen.tsx +90 -0
  417. package/src/elements/scroll-area.tsx +33 -0
  418. package/src/elements/search.tsx +180 -0
  419. package/src/elements/segmented.tsx +135 -0
  420. package/src/elements/separator.tsx +36 -0
  421. package/src/elements/setting-item.tsx +50 -0
  422. package/src/elements/settings-group.tsx +37 -0
  423. package/src/elements/skeleton.tsx +45 -0
  424. package/src/elements/slots.ts +607 -0
  425. package/src/elements/source.tsx +13 -6
  426. package/src/elements/status.tsx +42 -0
  427. package/src/elements/styles.css +19 -0
  428. package/src/elements/switch.tsx +89 -14
  429. package/src/elements/tabs.tsx +95 -0
  430. package/src/elements/tasks.tsx +70 -14
  431. package/src/elements/toast.tsx +89 -0
  432. package/src/elements/tool.tsx +43 -9
  433. package/src/elements/tooltip.tsx +85 -0
  434. package/src/elements/video-poster.jpg +0 -0
  435. package/src/elements/voice-input.tsx +66 -16
  436. package/src/elements/voice-output.tsx +69 -0
  437. package/src/index.ts +35 -2
  438. package/src/primitives/card-contract.ts +14 -5
  439. package/src/primitives/card-recovery.ts +149 -0
  440. package/src/primitives/card-routing.ts +3 -0
  441. package/src/primitives/card-schemas/choice.schema.json +5 -0
  442. package/src/primitives/card-schemas/tasks.schema.json +7 -2
  443. package/src/primitives/composer-model.ts +49 -0
  444. package/src/primitives/composer-triggers.ts +35 -0
  445. package/src/primitives/create-kai-chat.ts +66 -0
  446. package/src/primitives/message-feedback.ts +123 -0
  447. package/src/primitives/toast-store.ts +276 -0
  448. package/src/primitives/use-speech-recognition.ts +135 -0
  449. package/src/state/index.ts +6 -0
  450. package/src/state/messages.ts +36 -0
  451. package/src/state/stream.ts +92 -0
  452. package/src/state/suggestions.ts +9 -0
  453. package/src/types.ts +4 -0
  454. package/src/ui/agent-card.tsx +212 -0
  455. package/src/ui/button.tsx +16 -5
  456. package/src/ui/card.tsx +245 -0
  457. package/src/ui/collapsible.tsx +30 -4
  458. package/src/ui/command.tsx +99 -0
  459. package/src/ui/dialog.tsx +217 -0
  460. package/src/ui/dropdown.tsx +375 -13
  461. package/src/ui/editable-label.tsx +112 -0
  462. package/src/ui/hover-card.tsx +28 -5
  463. package/src/ui/icon.tsx +110 -0
  464. package/src/ui/input.tsx +132 -0
  465. package/src/ui/kbd.tsx +118 -0
  466. package/src/ui/nav.tsx +282 -0
  467. package/src/ui/notice.tsx +84 -0
  468. package/src/ui/overlay.tsx +108 -2
  469. package/src/ui/pane-grid.tsx +116 -0
  470. package/src/ui/pane-group.tsx +280 -0
  471. package/src/ui/pane.tsx +193 -0
  472. package/src/ui/popover.tsx +16 -2
  473. package/src/ui/progress-bar.tsx +83 -0
  474. package/src/ui/prompt-dock.tsx +145 -0
  475. package/src/ui/resizable.tsx +69 -1
  476. package/src/ui/scroll-area.tsx +14 -3
  477. package/src/ui/segmented.tsx +109 -0
  478. package/src/ui/settings-group.tsx +67 -0
  479. package/src/ui/skeleton.tsx +62 -5
  480. package/src/ui/stat.tsx +41 -0
  481. package/src/ui/status.tsx +48 -0
  482. package/src/ui/switch.tsx +49 -23
  483. package/src/ui/tabs.tsx +168 -0
  484. package/src/ui/tooltip.tsx +57 -7
  485. package/theme.css +113 -0
  486. package/dist/components/slash-command.d.ts +0 -15
  487. package/dist/kitn-chat.es.js +0 -1
  488. package/dist/register-impl-wCsFPoh9.js +0 -77
  489. package/dist/register-ujhr1nBS.js +0 -1
  490. package/src/components/slash-command.tsx +0 -232
  491. package/src/elements/framework-usage.json +0 -563
  492. /package/dist/{kitn-chat-provider.d.ts → kai-provider.d.ts} +0 -0
  493. /package/dist/{kitn-chat-provider.es.js → kai-provider.es.js} +0 -0
@@ -0,0 +1 @@
1
+ import{f as n,x as i,c as t,C as g}from"./chunks/define-rGsaWsLL.js";import{M as a}from"./chunks/markdown-DBrcqq4S.js";n("kai-markdown",{content:"",proseSize:"sm",codeTheme:"github-dark-dimmed",codeHighlight:!0},(e,{flag:r})=>{const o=i();return t(g,{get proseSize(){return e.proseSize},get codeTheme(){return e.codeTheme},get codeHighlight(){return r("codeHighlight")},get portalMount(){return o.portalMount()},get children(){return t(a,{get content(){return e.content}})}})});
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f,c as r,q as p,i as l,S as n,n as a,F as b,t as m}from"./chunks/define-rGsaWsLL.js";import{D as k,a as v,c as w,d as x,e as y,f as z,g as C,h as I,i as j,j as L,b as O}from"./chunks/dropdown-BFg8ri_R.js";import{r as s}from"./chunks/icon-Vqz4ivrY.js";import{K as S}from"./chunks/kbd-n49c4KZm.js";import{c as G}from"./chunks/cn-CU7UAWzk.js";import{w as T}from"./chunks/disclosure-CwoAkpMH.js";import{e as D}from"./chunks/ellipsis-dlN6YvGw.js";var _=m('<span part=shortcut class="ml-auto pl-4 text-muted-foreground">'),$=m("<slot name=trigger>");f("kai-menu",{items:void 0,placement:void 0,triggerIcon:void 0,triggerLabel:void 0,triggerIconTrailing:void 0,label:void 0,open:void 0,defaultOpen:void 0,disabled:void 0},(t,g)=>{const{dispatch:c,flag:o}=g;let d;T(g,()=>d,()=>t.open);function u(i){return r(b,{each:i,children:e=>e.separator?r(x,{}):e.heading?r(y,{get children(){return e.label}}):e.items&&e.items.length>0?r(z,{get children(){return[r(C,{get children(){return[r(n,{get when(){return e.icon},get children(){return s(e.icon,{imgClass:"mr-2 size-4 shrink-0",spanClass:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center text-sm"})}}),a(()=>e.label)]}}),r(I,{get children(){return u(e.items)}})]}}):e.radioGroup!==void 0?r(j,{get checked(){return e.checked},get disabled(){return e.disabled},onSelect:()=>{e.id&&c("kai-select",{id:e.id,radioGroup:e.radioGroup})},get children(){return[r(n,{get when(){return e.icon},get children(){return s(e.icon,{imgClass:"mr-2 size-4 shrink-0",spanClass:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center text-sm"})}}),a(()=>e.label)]}}):e.checked!==void 0?r(L,{get checked(){return e.checked},get disabled(){return e.disabled},onSelect:()=>{e.id&&c("kai-select",{id:e.id,checked:!e.checked})},get children(){return[r(n,{get when(){return e.icon},get children(){return s(e.icon,{imgClass:"mr-2 size-4 shrink-0",spanClass:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center text-sm"})}}),a(()=>e.label)]}}):r(O,{get disabled(){return e.disabled},onSelect:()=>{e.id&&c("kai-select",{id:e.id})},get children(){return[r(n,{get when(){return e.icon},get children(){return s(e.icon,{imgClass:"mr-2 size-4 shrink-0",spanClass:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center text-sm"})}}),a(()=>e.label),r(n,{get when(){return e.shortcut},get children(){var h=_();return l(h,r(S,{get keys(){return e.shortcut},platform:"auto",size:"sm"})),h}})]}})})}return r(w,{get defaultOpen(){return o("defaultOpen")},get disabled(){return o("disabled")},controllerRef:i=>d=i,get children(){return[r(k,{get class(){return G("inline-flex items-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",t.triggerLabel?"gap-1.5 px-2 py-1.5 text-sm font-medium text-muted-foreground hover:bg-accent hover:text-foreground":"justify-center p-1.5 text-foreground hover:bg-muted")},get"aria-label"(){return t.label??(t.triggerLabel?void 0:"Open menu")},get children(){var i=$();return i._$owner=p(),l(i,r(n,{get when(){return t.triggerIcon},get children(){return s(t.triggerIcon,{class:"size-4 shrink-0"})}}),null),l(i,r(n,{get when(){return t.triggerLabel},get children(){return t.triggerLabel}}),null),l(i,r(n,{get when(){return t.triggerIconTrailing},get children(){return s(t.triggerIconTrailing,{class:"size-3.5 shrink-0 opacity-60"})}}),null),l(i,r(n,{get when(){return a(()=>!t.triggerIcon)()&&!t.triggerLabel},get children(){return r(D,{class:"size-4"})}}),null),i}}),r(v,{class:"min-w-[15rem]",get children(){return u(t.items??[])}})]}})});
@@ -1,17 +1 @@
1
- interface Skill {
2
- /** Stable identifier for the skill. */
3
- id: string;
4
- /** Human-readable skill name shown on the badge. */
5
- name: string;
6
- }
7
- /**
8
- * Parse a single light-DOM `<kai-skill>` element into a `Skill` descriptor.
9
- *
10
- * Attribute / content mapping:
11
- * - `id` → Skill.id (falls back to `name` when absent)
12
- * - `textContent` → Skill.name (the human-readable badge label)
13
- *
14
- * Example: `<kai-skill id="web-search">Web Search</kai-skill>`
15
- */
16
- export declare function parseKaiSkillElement(n: Element): Skill;
17
1
  export {};
@@ -0,0 +1 @@
1
+ import{c as n,i as a,F as d,a as p,b as k,S as v,t as o,f as x,g as f,o as g,p as b}from"./chunks/define-rGsaWsLL.js";import{c as h}from"./chunks/cn-CU7UAWzk.js";var w=o("<div>"),S=o('<span class="inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-violet-400/10 text-violet-600 dark:text-violet-400">');function y(t){return n(v,{get when(){return t.skills.length>0},get children(){var e=w();return a(e,n(d,{get each(){return t.skills},children:s=>(()=>{var r=S();return a(r,()=>s.name),r})()})),p(()=>k(e,h("flex items-center gap-1 flex-wrap",t.class))),e}})}function c(t){var e;const s=((e=t.textContent)==null?void 0:e.trim())??"";return{id:t.getAttribute("id")??s,name:s}}x("kai-skills",{skills:[]},(t,{element:e})=>{const[s,r]=f([]);g(()=>{const i=()=>{const m=[...e.querySelectorAll("kai-skill")];r(m.map(c))};i();const l=new MutationObserver(i);l.observe(e,{childList:!0,attributes:!0,subtree:!0}),b(()=>l.disconnect())});const u=()=>[...t.skills??[],...s()];return n(y,{get skills(){return u()}})});export{c as parseKaiSkillElement};
@@ -0,0 +1 @@
1
+ import{f as L,x as O,g as y,o as U,c as a,S as g,n as u,i as j,a as D,b as E,C as G,q as v,t as l,p as I}from"./chunks/define-rGsaWsLL.js";import{r as J,M as K}from"./chunks/slots-DkZ-Cmha.js";import{a as A,M as N,b as P}from"./chunks/message-CTqaYI0s.js";import{c as Q}from"./chunks/message-feedback-Cvzm03w0.js";var V=l("<slot name=before-body>"),W=l("<slot name=after-body>"),X=l("<div part=avatar class=shrink-0><slot name=avatar>"),Y=l("<div>");L("kai-message",{message:void 0,role:"assistant",content:void 0,markdown:void 0,proseSize:"sm",codeTheme:"github-dark-dimmed",codeHighlight:!0,actionsReveal:"always",avatarSrc:void 0,avatarFallback:void 0,avatar:void 0},(t,{dispatch:x,flag:m,element:o,expose:S})=>{const $=O(),r=()=>t.message??{id:"message",role:t.role??"assistant",content:t.content??""},s=Q({emit:e=>x("kai-message-action",e)});S({copy:()=>s.handleAction(r(),"copy")});const[F,M]=y([]),[d,C]=y({});U(()=>{const e=()=>{const _=[...o.querySelectorAll("kai-action")];M(_.map(n=>{var w;return{id:n.id||n.getAttribute("action")||"",label:((w=n.textContent)==null?void 0:w.trim())||n.getAttribute("label")||n.id||"",icon:n.getAttribute("icon")??void 0,tooltip:n.getAttribute("tooltip")??void 0}})),C(J(o,K))};e();const c=new MutationObserver(e);c.observe(o,{childList:!0,attributes:!0,subtree:!0}),I(()=>c.disconnect())});const i=()=>r().role==="user",b=()=>r().avatar??(t.avatarSrc||t.avatarFallback?{src:t.avatarSrc,fallback:t.avatarFallback}:void 0),z=()=>t.avatar==="none",h=()=>!!d().avatar,H=()=>!z()&&(h()||!!b()),f=()=>t.actionsReveal==="hover"?"hover":"always",R=()=>o.hasAttribute("markdown")||t.markdown===!0||t.markdown===!1,T=()=>R()?m("markdown"):!i(),q=()=>[...r().actions??[],...F()],k=()=>a(N,{get content(){return r().content},get reasoning(){return r().reasoning},get tools(){return r().tools},get attachments(){return r().attachments},get isUser(){return i()},get markdown(){return T()},get actions(){return q()},get actionsReveal(){return f()},get activeFeedback(){return s.resolveFeedback(r())},get copied(){return s.isCopied(r().id)},onAction:e=>s.handleAction(r(),e),get beforeBody(){return u(()=>!!d()["before-body"])()?(()=>{var e=V();return e._$owner=v(),e})():void 0},get afterBody(){return u(()=>!!d()["after-body"])()?(()=>{var e=W();return e._$owner=v(),e})():void 0}}),p=()=>f()==="hover"?"group ":"",B=()=>a(g,{get when(){return h()},get fallback(){return a(g,{get when(){return b()},children:e=>a(P,{get src(){return e().src??""},get alt(){return e().alt??""},get fallback(){return e().fallback}})})},get children(){var e=X(),c=e.firstChild;return c._$owner=v(),e}});return a(G,{get proseSize(){return t.proseSize},get codeTheme(){return t.codeTheme},get codeHighlight(){return m("codeHighlight")},get portalMount(){return $.portalMount()},get children(){return a(g,{get when(){return H()},get fallback(){return a(A,{get class(){return`${p()}${i()?"flex-col items-end":"flex-col items-start"}`},get children(){return k()}})},get children(){return a(A,{get class(){return p()},get children(){return[u(()=>B()),(()=>{var e=Y();return j(e,k),D(()=>E(e,`flex min-w-0 flex-1 flex-col ${i()?"items-end":"items-start"}`)),e})()]}})}})}})});
@@ -1,11 +1 @@
1
- import { ModelOption } from '../types';
2
- /**
3
- * Parse a single light-DOM `<kai-model>` element into a `ModelOption` descriptor.
4
- * Attribute mapping:
5
- * - `id` → ModelOption.id
6
- * - textContent → ModelOption.name
7
- * - `provider` → ModelOption.provider (optional)
8
- * - `description` → ModelOption.description (optional subtitle)
9
- * - `group` → ModelOption.group (optional collapsible section)
10
- */
11
- export declare function parseKaiModelElement(n: Element): ModelOption;
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f as m,g as v,o as g,c as b,p as f}from"./chunks/define-rGsaWsLL.js";import{M}from"./chunks/model-switcher-CmyjiHO1.js";import{w as h}from"./chunks/disclosure-CwoAkpMH.js";function s(e){var o;return{id:e.getAttribute("id")??"",name:((o=e.textContent)==null?void 0:o.trim())??"",provider:e.getAttribute("provider")??void 0,description:e.getAttribute("description")??void 0,group:e.getAttribute("group")??void 0}}m("kai-model-switcher",{models:[],currentModel:void 0,open:void 0,defaultOpen:void 0,disabled:void 0},(e,o)=>{const{dispatch:a,element:r,flag:d}=o;let i;h(o,()=>i,()=>e.open);const[u,c]=v([]);g(()=>{const t=()=>{const p=[...r.querySelectorAll("kai-model")];c(p.map(s))};t();const l=new MutationObserver(t);l.observe(r,{childList:!0,attributes:!0,subtree:!0}),f(()=>l.disconnect())});const n=()=>[...e.models??[],...u()];return b(M,{get models(){return n()},get currentModelId(){var t;return e.currentModel??((t=n()[0])==null?void 0:t.id)??""},onModelChange:t=>a("kai-model-change",{modelId:t}),get defaultOpen(){return d("defaultOpen")},get disabled(){return d("disabled")},controllerRef:t=>i=t})});export{s as parseKaiModelElement};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{s as q,g as E,k as D,m as G,i as l,c as s,t as v,S as m,a as y,b as x,n as j,d as I,G as L,F,e as H,f as J}from"./chunks/define-rGsaWsLL.js";import{c as f}from"./chunks/cn-CU7UAWzk.js";import{r as C}from"./chunks/icon-Vqz4ivrY.js";import{B as K}from"./chunks/badge-DTQpgB6N.js";import{c as M}from"./chunks/chevron-right-CdGEUakB.js";var N=v("<nav>"),O=v("<span part=chevron aria-hidden=true>"),P=v("<span>"),Q=v('<span class="text-xs text-muted-foreground">'),T=v('<span part=status class="flex shrink-0 items-center gap-1.5"aria-hidden=true><span class="relative inline-flex"><span>'),U=v('<span part=meta class="shrink-0 text-xs tabular-nums text-muted-foreground"aria-hidden=true>'),W=v("<button part=item-action data-nav-action=action type=button>"),X=v("<button part=item-action data-nav-action=close type=button>"),Y=v('<div><button part=item type=button><span class="min-w-0 flex-1 truncate">'),Z=v("<div part=group role=group>"),_=v('<span class="size-4 shrink-0"aria-hidden=true>');const R={primary:"bg-primary",info:"bg-tool-blue",success:"bg-tool-green",warning:"bg-tool-amber",error:"bg-tool-red",neutral:"bg-muted-foreground"};function ee(r){const[d,e]=q(r,["items","value","onItemSelect","onItemAction","onItemClose","defaultCollapsed","class"]),[c,p]=E(new Set(d.defaultCollapsed??[]),{equals:!1}),h=a=>!c().has(a),b=a=>p(w=>{const k=new Set(w);return k.has(a)?k.delete(a):k.add(a),k});return(()=>{var a=N();return D(a,G(e,{get class(){return f("flex flex-col gap-0.5",d.class)}}),!1,!0),l(a,s(B,{get items(){return d.items??[]},depth:0,get value(){return d.value},get onItemSelect(){return d.onItemSelect},get onItemAction(){return d.onItemAction},get onItemClose(){return d.onItemClose},isExpanded:h,toggle:b})),a})()}function B(r){const d=()=>r.items.some(e=>{var c;return(((c=e.children)==null?void 0:c.length)??0)>0});return s(F,{get each(){return r.items},children:e=>{const c=()=>{var n;return(((n=e.children)==null?void 0:n.length)??0)>0},p=()=>r.isExpanded(e.id),h=()=>r.value===e.id,b=()=>{var n;return((n=e.status)==null?void 0:n.tone)??"neutral"},a=()=>{var n,o;if(!(!((n=e.status)!=null&&n.label)&&!e.meta))return[e.label,(o=e.status)==null?void 0:o.label,e.meta].filter(Boolean).join(", ")},w=()=>{var n;e.disabled||(c()?r.toggle(e.id):(n=r.onItemSelect)==null||n.call(r,e.id))},k=n=>{!c()||e.disabled||(n.key==="ArrowRight"&&!p()||n.key==="ArrowLeft"&&p())&&(n.preventDefault(),r.toggle(e.id))};return[(()=>{var n=Y(),o=n.firstChild,S=o.firstChild;return o.$$keydown=k,o.$$click=w,l(o,s(m,{get when(){return c()},get fallback(){return j(()=>!!d())()?_():null},get children(){var t=O();return l(t,s(M,{size:16})),y(()=>x(t,f("flex shrink-0 items-center opacity-60 transition-transform",p()&&"rotate-90"))),t}}),S),l(o,s(m,{get when(){return e.icon},get children(){return C(e.icon,{class:"size-4 shrink-0"})}}),S),l(S,()=>e.label),l(o,s(m,{get when(){return e.status},get children(){var t=T(),i=t.firstChild,g=i.firstChild;return l(i,s(m,{get when(){return e.status.pulse},get children(){var u=P();return y(()=>x(u,f("absolute inline-flex h-full w-full animate-ping rounded-full opacity-75 motion-reduce:hidden",R[b()]))),u}}),g),l(t,s(m,{get when(){return e.status.label},get children(){var u=Q();return l(u,()=>e.status.label),u}}),null),y(()=>x(g,f("relative inline-block size-2 rounded-full",R[b()]))),t}}),null),l(o,s(m,{get when(){return e.meta},get children(){var t=U();return l(t,()=>e.meta),t}}),null),l(o,s(m,{get when(){return e.badge},get children(){return s(K,{variant:"default",class:"px-1.5 py-0 text-[0.625rem] font-medium uppercase tracking-wide",get children(){return e.badge}})}}),null),l(o,s(m,{get when(){return e.trailing},get children(){return C(e.trailing,{class:"size-4 shrink-0 opacity-0 transition-opacity group-hover:opacity-60"})}}),null),l(n,s(m,{get when(){return e.action},get children(){var t=W();return t.$$click=()=>{var i;return(i=r.onItemAction)==null?void 0:i.call(r,e.id,e.action)},l(t,()=>C(e.action.icon,{class:"size-4"})),y(i=>{var g=e.action.label,u=f("mr-1 flex size-6 shrink-0 items-center justify-center rounded text-muted-foreground","opacity-0 transition-opacity hover:bg-background/70 hover:text-foreground","focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","group-hover:opacity-100");return g!==i.e&&I(t,"aria-label",i.e=g),u!==i.t&&x(t,i.t=u),i},{e:void 0,t:void 0}),t}}),null),l(n,s(m,{get when(){return e.closable},get children(){var t=X();return t.$$click=()=>{var i;return(i=r.onItemClose)==null?void 0:i.call(r,e.id)},l(t,()=>C("x",{class:"size-4"})),y(i=>{var g=e.label?`Remove ${e.label}`:"Remove",u=f("mr-1 flex size-6 shrink-0 items-center justify-center rounded text-muted-foreground","opacity-0 transition-opacity hover:bg-background/70 hover:text-foreground","focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","group-hover:opacity-100");return g!==i.e&&I(t,"aria-label",i.e=g),u!==i.t&&x(t,i.t=u),i},{e:void 0,t:void 0}),t}}),null),y(t=>{var i=f("group relative flex items-center rounded-md transition-colors","hover:bg-accent",h()&&"bg-accent",e.disabled&&"pointer-events-none opacity-50"),g=e.disabled,u=h()?"page":void 0,$=c()?p():void 0,z=a(),V=r.depth>0?{"padding-left":`${10+r.depth*16}px`}:void 0,A=f("flex min-w-0 flex-1 items-center gap-2.5 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors","text-muted-foreground group-hover:text-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none",h()&&"font-medium text-foreground");return i!==t.e&&x(n,t.e=i),g!==t.t&&(o.disabled=t.t=g),u!==t.a&&I(o,"aria-current",t.a=u),$!==t.o&&I(o,"aria-expanded",t.o=$),z!==t.i&&I(o,"aria-label",t.i=z),t.n=L(o,V,t.n),A!==t.s&&x(o,t.s=A),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),n})(),s(m,{get when(){return j(()=>!!c())()&&p()},get children(){var n=Z();return l(n,s(B,{get items(){return e.children},get depth(){return r.depth+1},get value(){return r.value},get onItemSelect(){return r.onItemSelect},get onItemAction(){return r.onItemAction},get onItemClose(){return r.onItemClose},get isExpanded(){return r.isExpanded},get toggle(){return r.toggle}})),n}})]}})}H(["click","keydown"]),J("kai-nav",{items:void 0,value:void 0,defaultValue:void 0,defaultCollapsed:void 0},(r,{dispatch:d,expose:e})=>{const[c,p]=E(r.defaultValue),h=()=>r.value??c(),b=a=>{p(a),d("kai-nav-select",{id:a})};return e({select:a=>b(a)}),s(ee,{get items(){return r.items},get value(){return h()},get defaultCollapsed(){return r.defaultCollapsed},onItemSelect:b,onItemAction:(a,w)=>d("kai-nav-item-action",{value:a,action:w}),onItemClose:a=>d("kai-nav-item-close",{value:a}),part:"nav"})});
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{c as i,m as p,g as b,i as o,S as c,a as k,d as w,b as $,t as l,e as S,f as z,q as u}from"./chunks/define-rGsaWsLL.js";import{c as d}from"./chunks/cn-CU7UAWzk.js";import{r as D}from"./chunks/icon-Vqz4ivrY.js";import{c as _}from"./chunks/circle-check-CmYG-y3I.js";import{I as q}from"./chunks/Icon-DLLBeLG5.js";import{i as v}from"./chunks/info-B_toFS0l.js";import{t as C}from"./chunks/triangle-alert-BlS80PUg.js";import{x as A}from"./chunks/x-C1qtndxn.js";var I=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],N=r=>i(q,p(r,{name:"CircleAlert",iconNode:I})),j=N,E=l('<button type=button aria-label=Dismiss class="-my-1 -mr-1.5 shrink-0 rounded p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground">'),O=l('<div><div class="flex-1 leading-snug text-muted-foreground">');const P={neutral:v,info:v,warning:C,error:j,success:_},h={neutral:"text-muted-foreground",info:"text-tool-blue",warning:"text-tool-amber",error:"text-tool-red",success:"text-tool-green"};function x(r,s){if(s==="none")return null;if(s)return D(s,{class:d("size-4 shrink-0",h[r])});const a=P[r];return i(a,{get class(){return d("size-4 shrink-0",h[r])},"aria-hidden":"true"})}function R(r){const[s,a]=b(!0),e=()=>r.severity??"neutral",y=()=>{var t;a(!1),(t=r.onDismiss)==null||t.call(r)};return i(c,{get when(){return s()},get children(){var t=O(),m=t.firstChild;return o(t,i(c,{get when(){return r.iconSlot},get fallback(){return x(e(),r.icon)},get children(){return r.iconSlot}}),m),o(m,()=>r.children),o(t,i(c,{get when(){return r.action},get children(){return r.action}}),null),o(t,i(c,{get when(){return r.dismissible},get children(){var n=E();return n.$$click=y,o(n,i(A,{class:"size-3.5","aria-hidden":"true"})),n}}),null),k(n=>{var g=e()==="error"?"alert":"status",f=d("flex items-center gap-2.5 rounded-lg bg-surface px-3.5 py-2.5 text-sm",r.class);return g!==n.e&&w(t,"role",n.e=g),f!==n.t&&$(t,n.t=f),n},{e:void 0,t:void 0}),t}})}S(["click"]);var T=l("<slot>"),V=l("<slot name=icon>"),W=l("<slot name=action>");z("kai-notice",{severity:"neutral",icon:void 0,dismissible:!1},(r,{dispatch:s,flag:a})=>i(R,{get severity(){return r.severity??"neutral"},get iconSlot(){return(()=>{var e=V();return e._$owner=u(),o(e,()=>x(r.severity??"neutral",r.icon)),e})()},get dismissible(){return a("dismissible")},onDismiss:()=>s("kai-dismiss"),get action(){return(()=>{var e=W();return e._$owner=u(),e})()},get children(){var e=T();return e._$owner=u(),e}}));
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{i as d,c as u,F as H,a as f,b as p,t as w,u as I,S as y,d as h,e as L,f as U,g as B,h as G,q as E}from"./chunks/define-rGsaWsLL.js";import{c as x}from"./chunks/cn-CU7UAWzk.js";import{e as J}from"./chunks/ellipsis-dlN6YvGw.js";import{x as K}from"./chunks/x-C1qtndxn.js";var P=w("<span>"),N=w("<button type=button part=menu aria-haspopup=menu>"),O=w("<button type=button part=close>"),Q=w('<div part=tab role=tab><span class="relative flex size-[18px] shrink-0"aria-hidden=true><span></span></span><span class="max-w-[8rem] truncate font-medium"></span><span class="ml-0.5 flex shrink-0 items-center">'),V=w('<div data-pane-group><div part=tabs role=tablist class="flex shrink-0 items-center gap-1 overflow-x-auto border-b border-border px-1.5 py-1"></div><div part=body role=tabpanel class="min-h-0 flex-1 overflow-y-auto">');const R={working:"bg-tool-blue",idle:"bg-muted-foreground",done:"bg-tool-green",error:"bg-tool-red",blocked:"bg-tool-amber"},W={working:"text-white",idle:"text-background",done:"text-white",error:"text-white",blocked:"text-white"},X={working:"text-tool-blue",idle:"text-muted-foreground",done:"text-tool-green",error:"text-tool-red",blocked:"text-tool-amber"};function Y(a){const g=()=>a.tabs??[],m=()=>{var i;return a.active??((i=g()[0])==null?void 0:i.id)},C=()=>{var i;const t=m();return t!==void 0&&g().some(r=>r.id===t)?t:(i=g()[0])==null?void 0:i.id},$={},v=i=>{var t;return(t=a.onTabChange)==null?void 0:t.call(a,i)},A=(i,t)=>{var r;if(i.currentTarget!==i.target)return;const n=g();if(n.length===0)return;const k=n.findIndex(s=>s.id===t.id);let c;switch(i.key){case"ArrowRight":case"ArrowDown":c=n[(k+1)%n.length];break;case"ArrowLeft":case"ArrowUp":c=n[(k-1+n.length)%n.length];break;case"Home":c=n[0];break;case"End":c=n[n.length-1];break;case"Enter":case" ":i.preventDefault(),v(t.id);return;default:return}c&&(i.preventDefault(),v(c.id),(r=$[c.id])==null||r.focus())},T=i=>{const t=()=>i.tab,r=()=>{var s;return((s=t().status)==null?void 0:s.tone)??"idle"},n=()=>t().id===m(),k=()=>t().number??i.index+1,c=()=>n()||!!t().needsAttention||r()==="error";return(()=>{var s=Q(),z=s.firstChild,S=z.firstChild,D=z.nextSibling,j=D.nextSibling;return s.$$keydown=e=>A(e,t()),s.$$click=()=>v(t().id),I(e=>{$[t().id]=e},s),d(z,u(y,{get when(){var e;return(e=t().status)==null?void 0:e.pulse},get children(){var e=P();return f(()=>p(e,x("absolute inset-0 animate-ping rounded opacity-60 motion-reduce:hidden",R[r()]))),e}}),S),d(S,k),d(D,()=>t().name),d(s,u(y,{get when(){var e;return(e=t().status)==null?void 0:e.label},get children(){var e=P();return d(e,()=>t().status.label),f(()=>p(e,x("truncate text-[10px] font-medium",X[r()],c()?"inline":"hidden group-hover/tab:inline"))),e}}),j),d(j,u(y,{get when(){return a.onTabMenu},get children(){var e=N();return e.$$click=o=>{var l;o.stopPropagation(),(l=a.onTabMenu)==null||l.call(a,t().id)},d(e,u(J,{class:"size-3.5","aria-hidden":"true"})),f(o=>{var l=`${t().name} tab actions`,b=x("flex size-5 items-center justify-center rounded text-muted-foreground transition-colors","hover:bg-surface-sunken hover:text-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",n()?"opacity-100":"opacity-0 group-hover/tab:opacity-100");return l!==o.e&&h(e,"aria-label",o.e=l),b!==o.t&&p(e,o.t=b),o},{e:void 0,t:void 0}),e}}),null),d(j,u(y,{get when(){return a.onTabClose},get children(){var e=O();return e.$$click=o=>{var l;o.stopPropagation(),(l=a.onTabClose)==null||l.call(a,t().id)},d(e,u(K,{class:"size-3.5","aria-hidden":"true"})),f(o=>{var l=`Close ${t().name}`,b=x("flex size-5 items-center justify-center rounded text-muted-foreground transition-colors","hover:bg-surface-sunken hover:text-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",n()?"opacity-100":"opacity-0 group-hover/tab:opacity-100");return l!==o.e&&h(e,"aria-label",o.e=l),b!==o.t&&p(e,o.t=b),o},{e:void 0,t:void 0}),e}}),null),f(e=>{var o=t().id===C()?0:-1,l=n()?"true":"false",b=n()?"":void 0,M=t().needsAttention?"":void 0,_=x("group/tab relative flex shrink-0 cursor-pointer items-center gap-1.5 rounded-md py-1 pl-1.5 pr-1 text-xs","outline-none transition-colors focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",n()?"bg-background text-foreground shadow-sm ring-1 ring-border":"text-muted-foreground hover:bg-hover hover:text-foreground",t().needsAttention&&!n()&&"ring-1 ring-tool-amber/50"),q=x("relative flex size-[18px] items-center justify-center rounded text-[11px] font-bold leading-none tabular-nums",R[r()],W[r()]);return o!==e.e&&h(s,"tabindex",e.e=o),l!==e.t&&h(s,"aria-selected",e.t=l),b!==e.a&&h(s,"data-active",e.a=b),M!==e.o&&h(s,"data-needs-attention",e.o=M),_!==e.i&&p(s,e.i=_),q!==e.n&&p(S,e.n=q),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),s})()};return(()=>{var i=V(),t=i.firstChild,r=t.nextSibling;return d(t,u(H,{get each(){return g()},children:(n,k)=>u(T,{tab:n,get index(){return k()}})})),d(r,()=>a.children),f(()=>p(i,x("flex h-full min-h-0 flex-col overflow-hidden rounded-xl border bg-surface",a.focused?"border-ring ring-2 ring-inset ring-ring/35":"border-border",a.class))),i})()}L(["click","keydown"]);var F=w("<slot>");U("kai-pane-group",{tabs:void 0,active:void 0,focused:!1},(a,{element:g,dispatch:m,flag:C,expose:$})=>{const v=()=>a.tabs??[],[A,T]=B(a.active),i=()=>{var r;return a.active??A()??((r=v()[0])==null?void 0:r.id)},t=r=>{T(r),m("kai-tab-change",{id:r})};return G(()=>{const r=i();r!=null&&g.setAttribute("active",r)}),$({select:r=>{v().some(n=>n.id===r)&&t(r)},focus:()=>{var r,n;(n=(r=g.shadowRoot)==null?void 0:r.querySelector('[part="tab"][tabindex="0"]'))==null||n.focus()}}),u(Y,{get tabs(){return v()},get active(){return i()},get focused(){return C("focused")},onTabChange:t,onTabClose:r=>m("kai-tab-close",{id:r}),onTabMenu:r=>m("kai-tab-menu",{id:r}),get children(){return[u(y,{get when(){return i()},children:r=>(()=>{var n=F();return n._$owner=E(),f(()=>h(n,"name",r())),n})()}),(()=>{var r=F();return r._$owner=E(),r})()]}})});
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{c as t,m as C,i as n,S as d,a as m,b as x,d as b,t as u,e as q,f as N,g as R,o as _,q as S,p as j}from"./chunks/define-rGsaWsLL.js";import{c as k}from"./chunks/cn-CU7UAWzk.js";import{I as D}from"./chunks/Icon-DLLBeLG5.js";import{m as F,a as I}from"./chunks/minimize-2-l2klxP6K.js";import{x as L}from"./chunks/x-C1qtndxn.js";var O=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],P=e=>t(D,C(e,{name:"Columns2",iconNode:O})),A=P,B=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],E=e=>t(D,C(e,{name:"PanelRight",iconNode:B})),G=E,H=u('<button type=button class="flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-80 transition-colors hover:bg-hover hover:text-foreground hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">'),J=u('<span class="flex shrink-0 items-center text-muted-foreground">'),K=u('<span class="truncate text-xs leading-tight text-muted-foreground">'),Q=u('<div part=footer class="shrink-0 border-t border-border">'),T=u('<div data-pane><div part=header class="flex shrink-0 items-center gap-2.5 border-b border-border px-3 py-2"><div class="flex min-w-0 flex-col"><span class="truncate text-sm font-medium leading-tight text-foreground"></span></div><div part=controls class="ml-auto flex shrink-0 items-center gap-0.5"></div></div><div part=body class="min-h-0 flex-1 overflow-y-auto">'),U=u("<span aria-hidden=true>"),V=u("<span class=truncate>"),W=u('<span class="flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground"><span class="relative flex size-2"><span aria-hidden=true>');const M={working:"bg-tool-blue",idle:"bg-muted-foreground",done:"bg-tool-green",error:"bg-tool-red",blocked:"bg-tool-amber"};function v(e){return(()=>{var l=H();return l.$$click=()=>{var o;return(o=e.onClick)==null?void 0:o.call(e)},n(l,()=>e.children),m(()=>b(l,"aria-label",e.label)),l})()}function X(e){return(()=>{var l=T(),o=l.firstChild,s=o.firstChild,p=s.firstChild,c=s.nextSibling,g=o.nextSibling;return n(o,t(d,{get when(){return e.leading},get children(){var r=J();return n(r,()=>e.leading),r}}),s),n(p,()=>e.title),n(s,t(d,{get when(){return e.subtitle},get children(){var r=K();return n(r,()=>e.subtitle),r}}),null),n(o,t(d,{get when(){return e.status},children:r=>(()=>{var a=W(),h=a.firstChild,f=h.firstChild;return n(h,t(d,{get when(){return r().pulse},get children(){var i=U();return m(()=>x(i,k("absolute inline-flex h-full w-full animate-ping rounded-full opacity-75 motion-reduce:hidden",M[r().tone]))),i}}),f),n(a,t(d,{get when(){return r().label},get children(){var i=V();return n(i,()=>r().label),i}}),null),m(i=>{var w=r().label?"status":void 0,z=r().label,y=k("relative inline-flex size-2 rounded-full",M[r().tone]);return w!==i.e&&b(a,"role",i.e=w),z!==i.t&&b(a,"aria-label",i.t=z),y!==i.a&&x(f,i.a=y),i},{e:void 0,t:void 0,a:void 0}),a})()}),c),n(c,()=>e.actions,null),n(c,t(d,{get when(){return e.onSplit},get children(){return t(v,{label:"Split pane",get onClick(){return e.onSplit},get children(){return t(A,{class:"size-4","aria-hidden":"true"})}})}}),null),n(c,t(d,{get when(){return e.onDock},get children(){return t(v,{label:"Dock pane",get onClick(){return e.onDock},get children(){return t(G,{class:"size-4","aria-hidden":"true"})}})}}),null),n(c,t(v,{get label(){return e.maximized?"Restore pane":"Maximize pane"},get onClick(){return e.onMaximize},get children(){return t(d,{get when(){return e.maximized},get fallback(){return t(I,{class:"size-4","aria-hidden":"true"})},get children(){return t(F,{class:"size-4","aria-hidden":"true"})}})}}),null),n(c,t(v,{label:"Close pane",get onClick(){return e.onClose},get children(){return t(L,{class:"size-4","aria-hidden":"true"})}}),null),n(g,()=>e.children),n(l,t(d,{get when(){return e.footer},get children(){var r=Q();return n(r,()=>e.footer),r}}),null),m(()=>x(l,k("flex h-full min-h-0 flex-col overflow-hidden rounded-xl border bg-surface",e.focused?"border-ring ring-2 ring-inset ring-ring/35":"border-border",e.class))),l})()}q(["click"]);var $=u("<slot>");const Y=["leading","actions","footer"];N("kai-pane",{headline:"",subtitle:void 0,maximized:!1,focused:!1,showSplit:!1,showDock:!1,status:void 0},(e,{element:l,dispatch:o,flag:s})=>{const[p,c]=R({leading:!1,actions:!1,footer:!1});_(()=>{const r=()=>{const h={};for(const f of Y)h[f]=!!l.querySelector(`:scope > [slot="${f}"]`);c(h)};r();const a=new MutationObserver(r);a.observe(l,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot"]}),j(()=>a.disconnect())});const g=r=>p()[r]?(()=>{var a=$();return b(a,"name",r),a._$owner=S(),a})():void 0;return t(X,{get title(){return e.headline},get subtitle(){return e.subtitle},get status(){return e.status},get focused(){return s("focused")},get maximized(){return s("maximized")},get leading(){return g("leading")},get actions(){return g("actions")},get footer(){return g("footer")},onMaximize:()=>o("kai-maximize",{maximized:!s("maximized")}),onClose:()=>o("kai-close"),get onSplit(){return s("showSplit")?()=>o("kai-split"):void 0},get onDock(){return s("showDock")?()=>o("kai-dock"):void 0},get children(){var r=$();return r._$owner=S(),r}})});
@@ -0,0 +1 @@
1
+ import{g as m,u as k,i as z,c as R,a as C,d as D,z as p,b as S,S as j,t as c,e as A,f as B,q as _}from"./chunks/define-rGsaWsLL.js";import{c as E}from"./chunks/cn-CU7UAWzk.js";import{c as F,u as G,a as H}from"./chunks/overlay-C8sOYqjT.js";import{w as I}from"./chunks/disclosure-CwoAkpMH.js";var J=c("<span style=display:inline-flex>"),K=c("<div role=dialog style=position:fixed>");function N(a){var r;const[i,v]=m(a.defaultOpen??!1),[n,o]=m(),[g,q]=m(),f=()=>a.open!==void 0,d=()=>f()?!!a.open:i(),l=e=>{var t;f()||v(e),(t=a.onOpenChange)==null||t.call(a,e)};(r=a.controllerRef)==null||r.call(a,{open:d,setOpen:l});const s=F(d),u=G(n,g,{placement:a.placement??"bottom-start",gutter:a.gutter??6,onDisconnect:()=>l(!1)});return H({enabled:d,onDismiss:()=>l(!1),refs:()=>{var e;return[n(),g(),(e=a.boundary)==null?void 0:e.call(a)]}}),[(()=>{var e=J();return e.$$click=()=>{a.disabled||l(!d())},k(o,e),z(e,()=>a.trigger),e})(),R(j,{get when(){return s.present()},get children(){var e=K();return k(t=>{q(t),s.setRef(t)},e),z(e,()=>a.children),C(t=>{var b=s.state()==="open"?"":void 0,h=s.state()==="closed"?"":void 0,x=`${u.pos().x}px`,y=`${u.pos().y}px`,O=u.hidden()?"hidden":"visible",$=u.hidden()?"none":void 0,w=E("z-50 min-w-[12rem] rounded-lg bg-card p-1 text-sm kai-elevation","animate-in fade-in-0 zoom-in-95 data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95",a.class);return b!==t.e&&D(e,"data-expanded",t.e=b),h!==t.t&&D(e,"data-closed",t.t=h),x!==t.a&&p(e,"left",t.a=x),y!==t.o&&p(e,"top",t.o=y),O!==t.i&&p(e,"visibility",t.i=O),$!==t.n&&p(e,"pointer-events",t.n=$),w!==t.s&&S(e,t.s=w),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),e}})]}A(["click"]);var P=c("<slot>"),T=c("<slot name=trigger>");B("kai-popover",{placement:"bottom-start",gutter:6,open:void 0,defaultOpen:void 0,disabled:void 0},(a,r)=>{const{flag:i,element:v}=r;let n;return I(r,()=>n,()=>a.open),R(N,{get trigger(){return(()=>{var o=T();return o._$owner=_(),o})()},get placement(){return a.placement},get gutter(){return a.gutter},get defaultOpen(){return i("defaultOpen")},get disabled(){return i("disabled")},controllerRef:o=>n=o,boundary:()=>v,get children(){var o=P();return o._$owner=_(),o}})});
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f as e,c as l,n as a}from"./chunks/define-rGsaWsLL.js";import{P as t}from"./chunks/progress-bar-tzKMWAwO.js";e("kai-progress-bar",{value:void 0,max:void 0,label:void 0,tone:"primary"},r=>l(t,{get value(){return a(()=>r.value!=null)()?Number(r.value):0},get max(){return a(()=>r.max!=null)()?Number(r.max):void 0},get label(){return r.label},get tone(){return r.tone}}));
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{i as p,c as u,a as l,b as v,S as h,z as d,t as c,f as $,g as C,o as S,q as x,d as _,p as q}from"./chunks/define-rGsaWsLL.js";import{c as f}from"./chunks/cn-CU7UAWzk.js";var L=c("<div part=top>"),M=c("<div part=bottom>"),O=c("<div data-prompt-dock part=tray>");const w="px-3 py-2 text-sm leading-snug text-muted-foreground";function z(r){const a=()=>r.frame??"inset",e=()=>r.appearance??"soft",m=()=>e()==="soft"||e()==="filled",i=()=>e()==="soft"||e()==="outlined";return(()=>{var o=O();return p(o,u(h,{get when(){return r.top},get children(){var t=L();return p(t,()=>r.top),l(()=>v(t,f(w,r.topClass))),t}}),null),p(o,()=>r.children,null),p(o,u(h,{get when(){return r.bottom},get children(){var t=M();return p(t,()=>r.bottom),l(()=>v(t,f(w,r.bottomClass))),t}}),null),l(t=>{var n=f("flex flex-col gap-1.5",r.class),s=m()?"var(--kai-prompt-dock-surface, var(--color-surface-sunken))":"transparent",g=i()?"1px solid var(--kai-prompt-dock-border, var(--color-border))":"0",b=e()==="plain"?"0":"var(--kai-prompt-dock-radius, 1.25rem)",k=a()==="none"?"0":a()==="edge"?"var(--kai-prompt-dock-inset, 0.375rem) 0":"var(--kai-prompt-dock-inset, 0.375rem)";return n!==t.e&&v(o,t.e=n),s!==t.t&&d(o,"background",t.t=s),g!==t.a&&d(o,"border",t.a=g),b!==t.o&&d(o,"border-radius",t.o=b),k!==t.i&&d(o,"padding",t.i=k),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),o})()}var y=c("<slot>");const A=["top","bottom"];$("kai-prompt-dock",{frame:"inset",appearance:"soft"},(r,{element:a})=>{const[e,m]=C({top:!1,bottom:!1});S(()=>{const o=()=>{const n={};for(const s of A)n[s]=!!a.querySelector(`:scope > [slot="${s}"]`);m(n)};o();const t=new MutationObserver(o);t.observe(a,{childList:!0}),q(()=>t.disconnect())});const i=o=>e()[o]?(()=>{var t=y();return _(t,"name",o),t._$owner=x(),t})():void 0;return u(z,{get frame(){return r.frame},get appearance(){return r.appearance},get top(){return i("top")},get bottom(){return i("bottom")},get children(){var o=y();return o._$owner=x(),o}})});
@@ -1,9 +1 @@
1
- import { SlashCommandItem } from '../components/slash-command';
2
- /** Parse a single light-DOM `<kai-slash-command>` element into a SlashCommandItem.
3
- * Attribute mapping:
4
- * - `command` → SlashCommandItem.id (required; empty string fallback)
5
- * - textContent → SlashCommandItem.label (primary); `label` attr as fallback
6
- * - `description` → SlashCommandItem.description
7
- * - `category` → SlashCommandItem.category
8
- */
9
- export declare function parseKaiSlashCommandElement(n: Element): SlashCommandItem;
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f as w,g as h,h as k,o as q,c as I,p as M}from"./chunks/define-rGsaWsLL.js";import{D as V}from"./chunks/default-input-BuqsoENC.js";import{n as g,e as R,s as f}from"./chunks/composer-Cfbw5HKT.js";w("kai-prompt-input",{value:void 0,placeholder:"Send a message...",disabled:!1,loading:!1,suggestions:void 0,suggestionMode:"submit",search:!1,voice:!1,stoppable:!1,submit:"always",attach:!0,attachments:void 0,triggers:void 0,kindIcons:void 0},(o,{dispatch:a,flag:s,element:c,expose:A})=>{const[S,m]=h(o.value??""),[l,r]=h(o.attachments??[]);k(()=>{o.attachments&&r(o.attachments)});const[x,y]=h([]);q(()=>{const t=()=>{const u=[...c.querySelectorAll("kai-action")];y(u.map(n=>{var p;return{id:n.id||n.getAttribute("action")||"",label:((p=n.textContent)==null?void 0:p.trim())||n.getAttribute("label")||n.id||"",icon:n.getAttribute("icon")??void 0,tooltip:n.getAttribute("tooltip")??void 0}}))};t();const e=new MutationObserver(t);e.observe(c,{childList:!0,attributes:!0,subtree:!0}),M(()=>e.disconnect())});const v=()=>typeof o.value=="string"?o.value:S();let i={doc:[],text:"",entities:[]};k(()=>{const t=o.value;if(t!=null&&typeof t!="string"){const e=g(t);m(e),i={doc:e,text:f(e),entities:R(e)}}});const d=t=>{m(t),t!==i.text&&(i={doc:g(t),text:t,entities:[]}),a("kai-value-change",{value:t,doc:i.doc,entities:i.entities})},b=()=>{a("kai-submit",{value:f(g(v())),doc:i.doc,entities:i.entities,attachments:l()}),r([])},C=t=>{(o.suggestionMode??"submit")==="fill"?(d(t),a("kai-suggestion-click",{value:t})):(a("kai-submit",{value:t,doc:g(t),entities:[],attachments:l()}),r([]))};return A({focus:t=>{const e=c.shadowRoot,u=e?.querySelector('[contenteditable]:not([contenteditable="false"]), textarea')??e?.querySelector('input:not([type="file"])');u?.focus(t)},blur:()=>{var t,e;return(e=(t=c.shadowRoot)==null?void 0:t.activeElement)==null?void 0:e.blur()},clear:()=>{d(""),l().length&&(r([]),a("kai-attachments-change",{attachments:[]}))},send:()=>b()}),I(V,{get value(){return v()},get placeholder(){return o.placeholder},get disabled(){return s("disabled")},get loading(){return s("loading")},get stoppable(){return s("stoppable")},get submit(){return o.submit},get attach(){return s("attach")},get suggestions(){return o.suggestions},get attachments(){return l()},get search(){return s("search")},get voice(){return s("voice")},get toolbarActions(){return x()},get triggers(){return o.triggers},get kindIcons(){return o.kindIcons},onComposerChange:t=>{i=t},onValueChange:d,onSubmit:b,onSuggestionClick:C,onAttachmentsChange:t=>{r(t),a("kai-attachments-change",{attachments:t})},onSearch:()=>a("kai-search"),onVoice:()=>a("kai-voice"),onStop:()=>a("kai-stop"),onAction:t=>a("kai-toolbar-action",{action:t})})});
@@ -1,7 +1 @@
1
- type Item = string | {
2
- label: string;
3
- value?: string;
4
- };
5
- /** Parse a single `<kai-suggestion>` node into an `Item` descriptor. */
6
- export declare function parseSuggestionNode(n: Element): Item;
7
1
  export {};
@@ -0,0 +1 @@
1
+ import{f as p,g as b,o as f,i as d,c as o,F as k,a as m,b as x,t as y,p as z}from"./chunks/define-rGsaWsLL.js";import{P as A}from"./chunks/prompt-suggestion-D3F6vP_A.js";var w=y("<div>");const C=e=>typeof e=="string"?e:e.label,S=e=>typeof e=="string"?e:e.value??e.label,O=e=>typeof e=="string"?void 0:e.icon;function l(e){var s;const r=((s=e.textContent)==null?void 0:s.trim())??"",a=e.getAttribute("value")??r;return{label:r,value:a,icon:e.getAttribute("icon")??void 0}}p("kai-suggestions",{suggestions:[],variant:"outline",size:"md",layout:"chips",block:!1,highlight:void 0},(e,{dispatch:s,flag:r,element:a})=>{const[g,u]=b([]);f(()=>{const t=()=>{const h=[...a.querySelectorAll("kai-suggestion")];u(h.map(l))};t();const i=new MutationObserver(t);i.observe(a,{childList:!0,attributes:!0,subtree:!0}),z(()=>i.disconnect())});const c=()=>[...e.suggestions??[],...g()],n=()=>e.layout==="list",v=()=>n()?"flex flex-col gap-0.5":r("block")?"flex flex-col gap-2":"flex flex-wrap gap-2";return(()=>{var t=w();return d(t,o(k,{get each(){return c()},children:i=>o(A,{get variant(){return e.variant},get size(){return e.size},get icon(){return O(i)},get block(){return r("block")},get list(){return n()},get highlight(){return e.highlight},onClick:()=>s("kai-select",{value:S(i)}),get children(){return C(i)}})})),m(()=>x(t,v())),t})()});export{l as parseSuggestionNode};
@@ -0,0 +1 @@
1
+ import{f as d,x as i,c as r,C as s}from"./chunks/define-rGsaWsLL.js";import{R as g,a as u,b as m}from"./chunks/reasoning-BJNmmyov.js";import{w as f}from"./chunks/disclosure-CwoAkpMH.js";d("kai-reasoning",{text:"",label:"Reasoning",open:void 0,defaultOpen:void 0,streaming:!1,markdown:!0,disabled:void 0},(t,n)=>{const{flag:e}=n,o=i();let a;return f(n,()=>a,()=>t.open),r(s,{get portalMount(){return o.portalMount()},get children(){return r(g,{get defaultOpen(){return e("defaultOpen")},get isStreaming(){return e("streaming")},get disabled(){return e("disabled")},controllerRef:l=>a=l,get children(){return[r(u,{get children(){return t.label}}),r(m,{get markdown(){return e("markdown")},get children(){return t.text}})]}})}})});
@@ -1,3 +1,13 @@
1
+ /** Resolves once the kai-* elements are registered (browser); inert on the server.
2
+ * Await this instead of customElements.whenDefined for a single ready signal.
3
+ *
4
+ * NOTE: this MUST stay an exported binding. A bare `void import('./register-impl')`
5
+ * is a result-unused dynamic import that the single-entry register-all build
6
+ * (vite.config.ts → dist/kai.es.js) tree-shakes away as dead code, leaving the
7
+ * bundle with NOTHING registered. Exporting the promise keeps the import live. */
8
+ export declare const elementsReady: Promise<unknown>;
1
9
  export type { ChatMessage, ChatMessageAction } from './chat-types';
2
10
  export { configureCodeHighlighting, isCodeHighlightingEnabled } from '../primitives/highlighter';
3
11
  export type { CodeHighlightingOptions } from '../primitives/highlighter';
12
+ export { toast, configureToasts } from '../primitives/toast-store';
13
+ export type { ToastConfig, ToastItem, ToastVariant, ToastAction, ToastOptions, ToastHandle, } from '../primitives/toast-store';
@@ -0,0 +1 @@
1
+ import{f as J,g as K,p as T,o as Q,h as X}from"./chunks/define-rGsaWsLL.js";import{r as Y,e as Z}from"./chunks/card-routing-C986KuUA.js";const q="kitn-card";function M(n,e){return function(o){return{protocol:q,version:n,nonce:e,message:o}}}function ee(n,e){if(typeof n!="object"||n===null)return!1;const o=n,t=o.message;return o.protocol===q&&typeof o.version=="string"&&typeof o.nonce=="string"&&typeof t=="object"&&t!==null&&t.dir===e}function ne(n,e,o){const t=new URL(n).origin;if(e===o)throw new Error("[kai-remote] providerOrigin must be cross-origin to the host");if(t===o)throw new Error("[kai-remote] src must not be same-origin as the host");if(t!==e)throw new Error("[kai-remote] src origin must equal providerOrigin")}const te=new Set(["protocol","version","dir","kind","mode","locale","edge","code","acceptedVersion","supportedVersions","cardId","type","id","height","target"]),oe=new Set(["authToken","nonce"]);function O(n){if(Array.isArray(n))return n.map(O);if(n&&typeof n=="object"){const e={};for(const[o,t]of Object.entries(n))oe.has(o)?e[o]="[redacted]":typeof t=="object"&&t!==null?e[o]=O(t):e[o]=te.has(o)?t:"[redacted]";return e}return n}function re(n){return/^[0-9]+$/.test(n)}const ie=new Set(["__proto__","constructor","prototype"]);function R(n){if(Array.isArray(n))return n.some(R);if(n&&typeof n=="object"){for(const e of Object.keys(n))if(ie.has(e)||R(n[e]))return!0}return!1}const ce=new Set(["ready","submit","action","send-prompt","open","resize","state","dismiss","error"]);function ae(n){return typeof n=="string"&&ce.has(n)}const V=["1"],le="allow-scripts allow-forms allow-same-origin",de=5e3;function se(n){try{return new URL(n).host}catch{return n}}function ue(n){const{container:e,providerOrigin:o,src:t,policy:r,maxHeight:d}=n,s=typeof window<"u"?window.location.origin:"";ne(t,o,s);const g=n.handshakeTimeoutMs??de;let m=0,w=P(),k=M("1",w),l="connecting",b=pe(n.context),v=n.envelope,p=null,u=null,c=null,I,y=null;function $(i){try{console.warn("[kai-remote]",O(i))}catch{}}function x(i){const a=c?.contentWindow;if(a)try{a.postMessage(k(i),o)}catch{}}function S(){I!==void 0&&(clearTimeout(I),I=void 0)}function U(i){l==="open"?x({dir:"down",kind:"context",context:i}):l==="connecting"&&(p=i)}function _(i){l==="open"?x({dir:"down",kind:"render",envelope:i}):l==="connecting"&&(u=i)}function z(){p&&(x({dir:"down",kind:"context",context:p}),p=null),u&&(x({dir:"down",kind:"render",envelope:u}),u=null)}function D(i){const a=document.createElement("div");a.setAttribute("role","alert"),a.dataset.kaiRemoteFallback="";const E=document.createElement("p");E.textContent=i,a.appendChild(E);const h=document.createElement("button");h.type="button",h.textContent="Retry",h.addEventListener("click",()=>W()),a.appendChild(h),c&&c.parentNode===e?e.replaceChild(a,c):e.appendChild(a),c=null}function L(i){l!=="closed"&&(S(),l="error",p=null,u=null,D(i))}function j(){const i=m,a=document.createElement("iframe");a.setAttribute("sandbox",n.sandbox??le),a.setAttribute("referrerpolicy","no-referrer"),a.setAttribute("allow","");const E=v.title??v.type;a.setAttribute("title",`${E} \u2014 provided by ${se(o)}`),a.style.border="0",a.style.width="100%",a.addEventListener("load",()=>{m!==i||l!=="connecting"||(k=M("1",w),x({dir:"down",kind:"hello",supportedVersions:V}),S(),I=setTimeout(()=>{var h;m!==i||l!=="connecting"||(L("[timeout] The card took too long to load."),(h=r?.onError)==null||h.call(r,v.id,"[timeout] handshake timed out"))},g))}),y=h=>N(h,i),window.addEventListener("message",y),c=a,e.appendChild(a),a.setAttribute("src",t)}function W(){l==="error"&&(m+=1,w=P(),k=M("1",w),l="connecting",p=null,u=null,S(),y&&(window.removeEventListener("message",y),y=null),c&&(c.remove(),c=null),p=b,u=v,e.querySelectorAll("[data-kai-remote-fallback]").forEach(i=>i.remove()),j())}function F(i){if(!c)return;const a=Math.min(i,d??1/0);c.style.height=`${a}px`}function H(){if(c)try{c.blur()}catch{}}function N(i,a){var E,h;if(a!==m||l==="closed"||l==="error")return;const A=i.data;if(i.origin===o&&i.source===c?.contentWindow&&ee(A,"up")&&A.nonce===w)try{const C=A.message;switch(C.kind){case"ready":{if(l!=="connecting")return;const f=C.acceptedVersion;if(!re(f)||!V.includes(f)){L("[version-unsupported] This card needs a different host version."),(E=r?.onError)==null||E.call(r,v.id,"[version-unsupported] no compatible protocol version");return}k=M(f,w),S(),l="open",p||(p=b),u||(u=v),z();return}case"event":{if(l!=="open")return;const f=C.event;if(f.cardId!==v.id)return;if(f.kind==="resize"){F(f.height);return}if(!ae(f.kind)||R(f)){$(A);return}Y(r??{},f);return}case"focus-edge":{H();return}case"fault":{const f=C.code,G=C.message;L(`[${f}] The card reported a problem.`),(h=r?.onError)==null||h.call(r,v.id,`[${f}] ${G}`);return}default:return}}catch{$(A)}}const B={updateContext(i){l!=="closed"&&(b=fe(b,i),U(b))},update(i){l!=="closed"&&(v=i,_(i))},destroy(){l!=="closed"&&(m+=1,l==="open"&&x({dir:"down",kind:"teardown"}),l="closed",S(),y&&(window.removeEventListener("message",y),y=null),c&&(c.remove(),c=null),e.querySelectorAll("[data-kai-remote-fallback]").forEach(i=>i.remove()))},state(){return l}};return j(),B}function P(){const n=new Uint8Array(16);crypto.getRandomValues(n);let e="";for(const o of n)e+=o.toString(16).padStart(2,"0");return e}function pe(n){return{...n}}function fe(n,e){return{...n,...e}}function me(n){if(!n||n==="*"||n.includes(","))return!1;let e;try{e=new URL(n)}catch{return!1}return e.pathname!=="/"||e.search!==""||e.hash!==""?!1:e.protocol==="https:"?!0:e.protocol==="http:"?e.hostname==="localhost"||e.hostname==="127.0.0.1":!1}function he(n,e){function o(t){Z(n,t)}return{onSubmit(t,r){var d;o({kind:"submit",cardId:t,data:r}),(d=e?.onSubmit)==null||d.call(e,t,r)},onAction(t,r,d){var s;o({kind:"action",cardId:t,action:r,payload:d}),(s=e?.onAction)==null||s.call(e,t,r,d)},onSendPrompt(t,r){var d;o({kind:"send-prompt",cardId:"",text:t,mode:r.mode,context:r.context}),(d=e?.onSendPrompt)==null||d.call(e,t,r)},onOpen(t,r){var d;o({kind:"open",cardId:"",url:t,target:r}),(d=e?.onOpen)==null||d.call(e,t,r)},onState(t,r){var d;o({kind:"state",cardId:t,patch:r}),(d=e?.onState)==null||d.call(e,t,r)},onDismiss(t){var r;o({kind:"dismiss",cardId:t}),(r=e?.onDismiss)==null||r.call(e,t)},onReopen(t){var r;o({kind:"reopen",cardId:t}),(r=e?.onReopen)==null||r.call(e,t)},onError(t,r){var d;o({kind:"error",cardId:t,message:r}),(d=e?.onError)==null||d.call(e,t,r)},maxSendPromptMode:e?.maxSendPromptMode}}J("kai-remote",{src:void 0,providerOrigin:void 0,envelope:void 0,policy:void 0},(n,{element:e})=>{let o;const[t,r]=K(!1);if(typeof window<"u"&&typeof window.matchMedia=="function"){const s=window.matchMedia("(prefers-color-scheme: dark)");r(s.matches);const g=m=>r(m.matches);s.addEventListener("change",g),T(()=>s.removeEventListener("change",g))}const d=()=>{const s=n.theme??"auto";return s==="dark"||s==="auto"&&t()};return Q(()=>{const s=e.shadowRoot;if(!s)return;function g(u){const c=document.createElement("div");c.setAttribute("role","alert"),c.textContent=u,s.appendChild(c)}const m=n.providerOrigin;if(!me(m)){g(`[kai-remote] Invalid provider-origin "${m??""}". Must be an absolute https: origin, or http://localhost / http://127.0.0.1 for local dev.`);return}const w=n.src;if(!w){g('[kai-remote] Missing required "src" attribute.');return}const k=n.envelope;if(!k){g('[kai-remote] Missing required "envelope" property.');return}const l={theme:{mode:d()?"dark":"light"},locale:typeof navigator<"u"&&navigator.language||"en"},b=n.policy,v=he(e,b),p=document.createElement("div");s.appendChild(p);try{o=ue({container:p,providerOrigin:m,src:w,envelope:k,context:l,policy:v})}catch(u){const c=u instanceof Error?u.message:String(u);g(`[kai-remote] Mount failed: ${c}`),p.remove();return}T(()=>{o?.destroy(),o=void 0})}),X(()=>{const s=d()?"dark":"light";o?.updateContext({theme:{mode:s}})}),[]});
@@ -1,17 +1 @@
1
- /** Bubbling, composed intent: a descendant asks the nearest enclosing
2
- * <kai-resizable> to maximize the item containing it (filling, hiding siblings)
3
- * or to restore. Any panel content may emit it — the protocol is zero-config. */
4
- export interface KaiMaximizeIntentDetail {
5
- /** true = maximize the item containing me; false = restore. */
6
- requested: boolean;
7
- }
8
- /** Composed, non-bubbling notification the group dispatches DOWN onto the
9
- * affected <kai-resizable-item> (on maximize) or the group host + the formerly
10
- * maximized item (on restore) so descendant content can sync its affordance. */
11
- export interface KaiMaximizeStateDetail {
12
- /** Whether THIS subtree's item is the maximized one. */
13
- maximized: boolean;
14
- }
15
- /** Event type names for the cross-element maximize protocol. */
16
- export declare const KAI_MAXIMIZE_INTENT: "kai-maximize-intent";
17
- export declare const KAI_MAXIMIZE_STATE: "kai-maximize-state";
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f as X,g as Z,o as ee,i as te,c as $,S as ie,q as G,a as O,d as m,G as ne,F as ae,z as oe,h as j,t as b,p as se,l as re}from"./chunks/define-rGsaWsLL.js";import{c as de,n as q,b as le}from"./chunks/resizable-BRsk19qI.js";var ce=b("<style>:host{display:block;height:100%}"),ue=b("<div data-resizable-root style=display:flex;width:100%;height:100%>"),me=b('<div data-panel style="display:grid;grid-template-rows:minmax(0, 1fr);grid-template-columns:minmax(0, 1fr);min-width:0;min-height:0;overflow:hidden"><slot>'),he=b("<style>:host{display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:auto}"),fe=b('<div style="display:grid;grid-template-rows:minmax(0, 1fr);grid-template-columns:minmax(0, 1fr);width:100%;height:100%;min-width:0;min-height:0"><slot>');const ve="kai-maximize-intent",pe="kai-maximize-state",y=3;function F(h){if(h===void 0||h==="")return{};const s=h.trim();return s.endsWith("px")?{pxAttr:String(parseFloat(s))}:s.endsWith("%")?{pctAttr:String(parseFloat(s))}:Number.isFinite(Number(s))?{pctAttr:s}:{}}X("kai-resizable",{orientation:"horizontal",maximizedIndex:null},(h,{element:s,dispatch:p})=>{const[u,M]=Z([]),g=()=>h.orientation==="vertical"?"vertical":"horizontal";function A(){const t=Array.from(s.children).filter(e=>e.tagName.toLowerCase()==="kai-resizable-item");t.length>y&&console.warn(`<kai-resizable>: only the first ${y} <kai-resizable-item> children are laid out (got ${t.length}). Nest <kai-resizable> for more.`);const i=t.slice(0,y).map(e=>{e.hasAttribute("data-kai-default-size")||e.setAttribute("data-kai-default-size",e.getAttribute("size")??"");const a=e.getAttribute("data-kai-default-size")||void 0,o=e.hasAttribute("collapsed")&&e.getAttribute("collapsed")!=="false";return{el:e,size:e.getAttribute("size")??void 0,defaultSize:a,min:e.getAttribute("min")??void 0,max:e.getAttribute("max")??void 0,locked:e.hasAttribute("locked")&&e.getAttribute("locked")!=="false",hidden:e.hidden||e.hasAttribute("hidden")&&e.getAttribute("hidden")!=="false",collapsed:o}});let n=0;for(const e of i)e.hidden||e.collapsed?e.el.removeAttribute("slot"):(e.el.setAttribute("slot",`p${n}`),n++);for(const e of t.slice(y))e.removeAttribute("slot");D(u(),i)&&M(i)}function D(t,i){if(t.length!==i.length)return!0;for(let n=0;n<t.length;n++){const e=t[n],a=i[n];if(e.el!==a.el||e.size!==a.size||e.min!==a.min||e.max!==a.max||e.locked!==a.locked||e.hidden!==a.hidden||e.collapsed!==a.collapsed)return!0}return!1}const x=()=>u().filter(t=>!t.hidden&&!t.collapsed);function C(){return x().map(t=>{var i;const n=((i=t.el.assignedSlot)==null?void 0:i.closest("[data-panel]"))??t.el,e=n.parentElement,a=g()==="horizontal"?"width":"height",o=e?e.getBoundingClientRect()[a]:0,d=n.getBoundingClientRect()[a];return o>0?Math.round(d/o*100):0})}function k(){p("kai-change",{sizes:C()})}let I=!1;function J(){const t=x(),i=C();t.length===i.length&&(I=!0,t.forEach((n,e)=>{const a=i[e];Number.isFinite(a)&&a>0&&n.el.setAttribute("size",`${a}%`)}),queueMicrotask(()=>{I=!1}))}const[w,L]=Z(null);let z=!1;function Q(t){let i=t instanceof Element?t:t?.parentElement??null;const n=u().map(e=>e.el);for(;i;){if(i instanceof HTMLElement&&n.includes(i))return i;i=i.parentElement??i.getRootNode().host??null}return null}function U(t){return{size:t.getAttribute("size"),hidden:t.hidden||t.hasAttribute("hidden")&&t.getAttribute("hidden")!=="false",locked:t.hasAttribute("locked")&&t.getAttribute("locked")!=="false"}}function E(t,i,n){n?t.setAttribute(i,""):t.removeAttribute(i)}function N(t){const i=u(),n=i.findIndex(c=>c.el===t);if(n<0)return;const e=w();if(e){if(e.item===t)return;v()}z=!0;const a=C();let o=0;const d=i.map(c=>{const f=U(c.el);if(!f.hidden){const l=a[o++];Number.isFinite(l)&&l>0&&c.el.setAttribute("size",`${l}%`)}return{el:c.el,size:c.el.getAttribute("size"),hidden:f.hidden,locked:f.locked}});i.forEach((c,f)=>{f===n?(c.el.removeAttribute("size"),c.el.removeAttribute("locked"),E(c.el,"hidden",!1)):E(c.el,"hidden",!0)}),L({item:t,saved:d}),s.setAttribute("data-maximized",""),t.setAttribute("data-maximized-panel",""),A(),k(),queueMicrotask(()=>{z=!1}),t.dispatchEvent(new CustomEvent("kai-maximize-state",{detail:{maximized:!0},bubbles:!1,composed:!0})),p("kai-maximize-change",{maximized:!0,index:n})}function v(){const t=w();if(!t)return;z=!0;for(const n of t.saved)n.el.isConnected&&(n.size===null?n.el.removeAttribute("size"):n.el.setAttribute("size",n.size),E(n.el,"hidden",n.hidden),E(n.el,"locked",n.locked),n.el.removeAttribute("data-maximized-panel"));const i=t.item;L(null),s.removeAttribute("data-maximized"),A(),k(),queueMicrotask(()=>{z=!1}),s.dispatchEvent(new CustomEvent("kai-maximize-state",{detail:{maximized:!1},bubbles:!1,composed:!0})),i?.dispatchEvent(new CustomEvent("kai-maximize-state",{detail:{maximized:!1},bubbles:!1,composed:!0})),p("kai-maximize-change",{maximized:!1,index:null})}ee(()=>{A();const t=a=>{const o=a;a.stopPropagation();const d=Q(o.target);d&&(o.detail.requested?N(d):v())};s.addEventListener("kai-maximize-intent",t);const i=a=>{a.key!=="Escape"||!w()||(a.stopPropagation(),v())};s.addEventListener("keydown",i,!0);const n=new MutationObserver(()=>{if(I)return;A();const a=w();if(a){const o=a.item,d=o.isConnected&&s.contains(o),c=d&&!(o.hidden||o.hasAttribute("hidden"))&&!(o.hasAttribute("collapsed")&&o.getAttribute("collapsed")!=="false");if(!d||!c){v();return}}z||queueMicrotask(k)});n.observe(s,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["size","locked","min","max","hidden","collapsed"]}),se(()=>{n.disconnect(),s.removeEventListener("kai-maximize-intent",t),s.removeEventListener("keydown",i,!0)});const e=s;e.maximize=a=>{var o;const d=(o=u()[a])==null?void 0:o.el;d&&N(d)},e.restore=()=>v(),j(re(()=>h.maximizedIndex,a=>{var o;if(a==null)v();else{const d=(o=u()[a])==null?void 0:o.el;d&&N(d)}},{defer:!0}))});const V=()=>g()==="horizontal";return[ce(),(()=>{var t=ue();return te(t,$(ae,{get each(){return x()},children:(i,n)=>{const e=F(i.min),a=F(i.max),o=F(i.defaultSize),d=de(q(i.size),q(i.min),q(i.max)),c=()=>x()[n()-1],f=()=>{var l;return!!(i.locked||(l=c())!=null&&l.locked)};return[$(ie,{get when(){return n()>0},get children(){return $(le,{withHandle:!0,get orientation(){return g()},get static(){return f()},onPanelResize:()=>{J(),queueMicrotask(k)}})}}),(()=>{var l=me(),S=l.firstChild;return S._$owner=G(),O(r=>{var _=i.locked?"":void 0,T=e.pxAttr,R=e.pctAttr,P=a.pxAttr,B=a.pctAttr,H=o.pxAttr,K=o.pctAttr,Y={...d!==void 0?{"flex-basis":d,"flex-grow":"0","flex-shrink":"0"}:{flex:"1 1 0%"}},W=`p${n()}`;return _!==r.e&&m(l,"data-locked",r.e=_),T!==r.t&&m(l,"data-min-size",r.t=T),R!==r.a&&m(l,"data-min-size-pct",r.a=R),P!==r.o&&m(l,"data-max-size",r.o=P),B!==r.i&&m(l,"data-max-size-pct",r.i=B),H!==r.n&&m(l,"data-default-size",r.n=H),K!==r.s&&m(l,"data-default-size-pct",r.s=K),r.h=ne(l,Y,r.h),W!==r.r&&m(S,"name",r.r=W),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),l})()]}})),O(i=>{var n=g(),e=V()?"row":"column";return n!==i.e&&m(t,"data-orientation",i.e=n),e!==i.t&&oe(t,"flex-direction",i.t=e),i},{e:void 0,t:void 0}),t})()]}),X("kai-resizable-item",{size:void 0,min:void 0,max:void 0,locked:!1,hidden:!1,collapsed:!1},(h,{element:s,flag:p})=>(j(()=>{s.toggleAttribute("collapsed",p("collapsed"))}),[he(),(()=>{var u=fe(),M=u.firstChild;return M._$owner=G(),u})()]));export{ve as KAI_MAXIMIZE_INTENT,pe as KAI_MAXIMIZE_STATE};
@@ -0,0 +1,14 @@
1
+ import{g as k,p as j,s as A,h as b,l as D,i as v,c as C,F as E,a as I,b as z,z as F,n as G,S as H,t as x,f as J}from"./chunks/define-rGsaWsLL.js";import{c as K}from"./chunks/cn-CU7UAWzk.js";function L(t){const e=t.speed??20,y=t.characterChunkSize??3,[f,i]=k(""),[S,u]=k(!0),[a,n]=k([]);let s="",d=0,m,o=!1,r;function l(){m!==void 0&&(clearInterval(m),m=void 0)}function p(){if(!o){if(d>=s.length){r||(l(),u(!0));return}d=Math.min(d+y,s.length),i(s.slice(0,d))}}async function $(c){r=c[Symbol.asyncIterator]();try{for(;;){const{value:h,done:M}=await r.next();if(M)break;h&&(s+=h,n(g=>[...g,{text:h,index:g.length}]))}}finally{r=void 0}}function q(c){if(w(),u(!1),typeof c=="string")if(s=c,t.mode==="typewriter")m=setInterval(p,e);else{const h=c.split(/(\s+)/).filter(Boolean);n(h.map((M,g)=>({text:M,index:g}))),i(c)}else t.mode==="typewriter"&&(m=setInterval(p,e)),$(c).then(()=>{t.mode==="fade"&&(i(s),u(!0))})}function T(){o=!0}function B(){o=!1}function w(){l(),s="",d=0,o=!1,r=void 0,i(""),u(!0),n([])}return j(()=>l()),{displayedText:f,isComplete:S,segments:a,startStreaming:q,pause:T,resume:B,reset:w}}var N=x("<style>"),P=x("<div class=relative>"),R=x("<div>"),W=x("<span>");function _(t){const[e]=A(t,["textStream","mode","speed","class","onComplete","as","fadeDuration","segmentDelay","characterChunkSize"]),y=()=>e.mode??"typewriter",f=()=>e.speed??20,i=L({mode:y(),speed:f(),characterChunkSize:e.characterChunkSize,fadeDuration:e.fadeDuration});b(D(()=>e.textStream,a=>{a&&i.startStreaming(a)})),b(D(()=>i.isComplete(),a=>{var n;a&&((n=e.onComplete)==null||n.call(e))}));const S=()=>`
2
+ @keyframes fadeIn {
3
+ from { opacity: 0; }
4
+ to { opacity: 1; }
5
+ }
6
+ .fade-segment {
7
+ display: inline-block;
8
+ opacity: 0;
9
+ animation: fadeIn ${e.fadeDuration??Math.round(1e3/Math.sqrt(Math.min(100,Math.max(1,f()))))}ms ease-out forwards;
10
+ }
11
+ .fade-segment-space {
12
+ white-space: pre;
13
+ }
14
+ `,u=()=>{if(typeof e.segmentDelay=="number")return Math.max(0,e.segmentDelay);const a=Math.min(100,Math.max(1,f()));return Math.max(1,Math.round(100/Math.sqrt(a)))};return(()=>{var a=R();return v(a,C(H,{get when(){return y()==="fade"},get fallback(){return G(()=>i.displayedText())},get children(){return[(()=>{var n=N();return v(n,S),n})(),(()=>{var n=P();return v(n,C(E,{get each(){return i.segments()},children:(s,d)=>{const m=()=>/^\s+$/.test(s.text);return(()=>{var o=W();return v(o,()=>s.text),I(r=>{var l=K("fade-segment",m()&&"fade-segment-space"),p=`${d()*u()}ms`;return l!==r.e&&z(o,r.e=l),p!==r.t&&F(o,"animation-delay",r.t=p),r},{e:void 0,t:void 0}),o})()}})),n})()]}})),I(()=>z(a,e.class)),a})()}J("kai-response-stream",{text:"",mode:"typewriter",speed:20,as:void 0},(t,{dispatch:e})=>C(_,{get textStream(){return t.text??""},get mode(){return t.mode},get speed(){return t.speed},get as(){return t.as},class:"text-body",onComplete:()=>e("kai-complete")}));
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{g as B,h as E,p as _,c as g,u as H,d as k,i as s,S,a as M,b as j,t as f,e as P,f as D,q as y}from"./chunks/define-rGsaWsLL.js";import{c as F}from"./chunks/cn-CU7UAWzk.js";import{c as G}from"./chunks/overlay-C8sOYqjT.js";import{a as J}from"./chunks/arrow-left-C-gwlUmx.js";import{w as K}from"./chunks/disclosure-CwoAkpMH.js";var L=f('<button part=back type=button aria-label=Back class="inline-flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">'),N=f('<div part=body role=dialog aria-modal=true tabindex=-1><header part=header class="flex shrink-0 items-center gap-2 border-b border-border px-3 py-2"><h2 part=title class="min-w-0 flex-1 truncate text-sm font-semibold text-foreground"></h2><div class="flex shrink-0 items-center gap-1"></div></header><div class="min-h-0 flex-1 overflow-auto">');let Q=0;function T(t){var d;const[v,b]=B(t.defaultOpen??!1),h=`kai-screen-title-${++Q}`,m=()=>t.open!==void 0,l=()=>m()?!!t.open:v(),u=e=>{var r;m()||b(e),(r=t.onOpenChange)==null||r.call(t,e)};(d=t.controllerRef)==null||d.call(t,{open:l,setOpen:u});const n=G(l);let x,A=null,w=[];const C=()=>t.back!==!1,$=()=>{var e;return(e=t.onBack)==null?void 0:e.call(t)},q=()=>{var e;if(t.noInert)return;const r=(e=t.host)==null?void 0:e.call(t),o=r?.parentElement;if(!(!r||!o))for(const p of Array.from(o.children)){if(p===r)continue;const i=p;w.push({el:i,hadInert:i.hasAttribute("inert"),hadAriaHidden:i.getAttribute("aria-hidden")}),i.setAttribute("inert",""),i.setAttribute("aria-hidden","true")}},I=()=>{for(const{el:e,hadInert:r,hadAriaHidden:o}of w)r||e.removeAttribute("inert"),o===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",o);w=[]};E(e=>{const r=l();if(r&&!e)A=document.activeElement??null,q(),queueMicrotask(()=>x?.focus());else if(!r&&e){I();const o=A;A=null,o&&o.isConnected&&queueMicrotask(()=>o.focus())}return r},!1),_(I);const z=e=>{e.key==="Escape"&&(e.stopPropagation(),$())};return g(S,{get when(){return n.present()},get children(){var e=N(),r=e.firstChild,o=r.firstChild,p=o.nextSibling,i=r.nextSibling;return e.$$keydown=z,H(a=>{var c;x=a,n.setRef(a),(c=t.surfaceRef)==null||c.call(t,a)},e),k(e,"aria-labelledby",h),s(r,g(S,{get when(){return C()},get children(){var a=L();return a.$$click=$,s(a,g(J,{size:16,"aria-hidden":"true"})),a}}),o),k(o,"id",h),s(o,()=>t.titleSlot??t.title),s(p,()=>t.actions),s(i,()=>t.children),M(a=>{var c=n.state()==="open"?"":void 0,O=n.state()==="closed"?"":void 0,R=F("absolute inset-0 z-40 flex flex-col bg-background text-foreground outline-none","animate-in fade-in-0 slide-in-from-bottom-2 motion-reduce:animate-none","data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:slide-out-to-bottom-2");return c!==a.e&&k(e,"data-expanded",a.e=c),O!==a.t&&k(e,"data-closed",a.t=O),R!==a.a&&j(e,a.a=R),a},{e:void 0,t:void 0,a:void 0}),e}})}P(["keydown","click"]);var U=f("<slot>"),V=f("<slot name=title>"),W=f("<slot name=actions>");D("kai-screen",{open:void 0,defaultOpen:void 0,headline:void 0,back:void 0,noInert:void 0},(t,d)=>{const{flag:v,element:b,dispatch:h,expose:m}=d;let l,u;return K(d,()=>l,()=>t.open),m({focus:n=>u?.focus(n)}),g(T,{get defaultOpen(){return v("defaultOpen")},get back(){return!(t.back===!1||b.getAttribute("back")==="false")},get noInert(){return v("noInert")},host:()=>b,get titleSlot(){return(()=>{var n=V();return n._$owner=y(),s(n,()=>t.headline),n})()},get actions(){return(()=>{var n=W();return n._$owner=y(),n})()},onBack:()=>{h("kai-back",{})},controllerRef:n=>l=n,surfaceRef:n=>u=n,get children(){var n=U();return n._$owner=y(),n}})});
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f as l,c as o,q as i,t as a}from"./chunks/define-rGsaWsLL.js";import{S as e}from"./chunks/scroll-area-CgGbFFbT.js";var n=a("<style>:host{display:block;min-height:0}"),s=a("<slot>");l("kai-scroll-area",{orientation:"vertical"},r=>[n(),o(e,{class:"h-full max-h-full w-full max-w-full",part:"viewport",get orientation(){return r.orientation},get children(){var t=s();return t._$owner=i(),t}})]);
@@ -0,0 +1 @@
1
+ import{f as g,g as h,o as v,p as E,c as a}from"./chunks/define-rGsaWsLL.js";import{c as y}from"./chunks/cn-CU7UAWzk.js";import{B as H}from"./chunks/button-XDUM6lXs.js";import{c as b}from"./chunks/chevron-down-DDoaSUtO.js";const w=50;function k(r){let t=r.parentElement;for(;t&&t!==document.documentElement;){const n=getComputedStyle(t),l=n.overflow+n.overflowY;if(/auto|scroll/.test(l)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}g("kai-scroll-button",{for:void 0,variant:"outline",size:"icon"},(r,{element:t,dispatch:n})=>{const[l,c]=h(!0);let o=null,i=[];function s(){if(!o)return;const{scrollTop:e,scrollHeight:p,clientHeight:d}=o;c(p-e-d<w)}function u(){o&&(o.scrollTo({top:o.scrollHeight,behavior:"smooth"}),c(!0))}function f(e){o=e,e.addEventListener("scroll",s,{passive:!0}),s(),i.push(()=>e.removeEventListener("scroll",s))}function m(){i.forEach(e=>e()),i=[],o=null}return v(()=>{const e=r.for?document.getElementById(r.for):k(t);e&&f(e)}),E(m),a(H,{get variant(){return r.variant??"outline"},get size(){return r.size??"icon"},"aria-label":"Scroll to bottom",get class(){return y("rounded-full transition-all duration-150 ease-out",l()?"pointer-events-none translate-y-4 scale-95 opacity-0":"translate-y-0 scale-100 opacity-100")},onClick:()=>{u(),n("kai-scroll")},get children(){return a(b,{class:"h-5 w-5"})}})});
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f as C,e as S,g as j,A as g,h as T,c as i,S as u,i as I,n as K,t as v}from"./chunks/define-rGsaWsLL.js";import{I as V}from"./chunks/input-gzbHYZvQ.js";import{K as $}from"./chunks/kbd-n49c4KZm.js";import{L as E}from"./chunks/loader-q6MamGus.js";import{r as m}from"./chunks/icon-Vqz4ivrY.js";var L=v('<button type=button part=clear aria-label=Clear class="inline-flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">'),N=v("<style>:host{display:block}");C("kai-search",{value:void 0,placeholder:"Search\u2026",icon:"search",debounce:200,loading:!1,shortcut:void 0},(a,d)=>{const{element:t,dispatch:n,flag:b,expose:f}=d,[r,l]=j(a.value??t.getAttribute("value")??""),p=e=>e==null?t.getAttribute("value")??"":String(e);Object.defineProperty(t,"value",{get:()=>r(),set:e=>{const h=p(e);g(r)!==h&&l(h)},configurable:!0,enumerable:!0}),T(()=>{const e=r();e?t.getAttribute("value")!==e&&t.setAttribute("value",e):t.hasAttribute("value")&&t.removeAttribute("value")});let s;const k=()=>{const e=Number(a.debounce??200);return Number.isFinite(e)&&e>=0?e:200},y=e=>{s&&clearTimeout(s),s=setTimeout(()=>n("kai-search",{value:e}),k())},o=()=>{var e;return((e=t.shadowRoot)==null?void 0:e.querySelector("input"))??null},z=e=>{l(e),y(e)},c=()=>{var e;s&&clearTimeout(s),l(""),n("kai-search",{value:""}),(e=o())==null||e.focus()},A=e=>{e.key==="Enter"&&n("kai-submit",{value:g(r)})};f({focus:()=>{var e;return(e=o())==null?void 0:e.focus()},clear:c});const x=i(u,{get when(){return b("loading")},get fallback(){return m(a.icon??"search",{class:"size-4 shrink-0",imgClass:"size-4 shrink-0",spanClass:"inline-flex size-4 shrink-0 items-center justify-center",ariaHidden:!0})},get children(){return i(E,{variant:"circular",size:"sm"})}}),w=[i(u,{get when(){return r()},get children(){var e=L();return e.$$click=c,I(e,()=>m("x",{class:"size-4",imgClass:"size-4"})),e}}),i(u,{get when(){return K(()=>!r())()&&a.shortcut},get children(){return i($,{get keys(){return a.shortcut},size:"sm",class:"opacity-80"})}})];return[N(),i(V,{type:"search",get value(){return r()},get placeholder(){return a.placeholder??"Search\u2026"},leading:x,trailing:w,onValueInput:z,onValueChange:e=>n("kai-change",{value:e}),onKeyDown:A})]}),S(["click"]);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{m as C,i as g,c as m,u as D,S as $,a as x,d as y,b as A,F as j,t as f,e as H,f as M,g as S,A as w,h as E}from"./chunks/define-rGsaWsLL.js";import{c as z}from"./chunks/cn-CU7UAWzk.js";import{r as F}from"./chunks/icon-Vqz4ivrY.js";var I=f("<div role=group part=track>"),L=f('<span class="inline-flex shrink-0 items-center"aria-hidden=true>'),P=f("<button type=button part=segment><span>");const R={sm:"h-7 px-2 text-xs",md:"h-8 px-3 text-sm"};function K(u){const r=C({size:"md"},u),i=[],c=()=>r.options.findIndex(t=>t.value===r.value),s=t=>{var n;const o=r.options[t];o&&(r.onChange(o.value),(n=i[t])==null||n.focus())},d=t=>{const n=r.options.length;if(n===0)return;const o=c();t.key==="ArrowRight"||t.key==="ArrowDown"?(t.preventDefault(),s((Math.max(o,0)+1)%n)):t.key==="ArrowLeft"||t.key==="ArrowUp"?(t.preventDefault(),s((Math.max(o,0)-1+n)%n)):t.key==="Home"?(t.preventDefault(),s(0)):t.key==="End"&&(t.preventDefault(),s(n-1))};return(()=>{var t=I();return t.$$keydown=d,g(t,m(j,{get each(){return r.options},children:(n,o)=>{const e=()=>n.value===r.value,v=()=>e()||c()===-1&&o()===0;return(()=>{var l=P(),p=l.firstChild;return l.$$click=()=>r.onChange(n.value),D(a=>{i[o()]=a},l),g(l,m($,{get when(){return n.icon},get children(){var a=L();return g(a,()=>n.icon),a}}),p),g(p,()=>n.label),x(a=>{var h=e(),b=v()?0:-1,k=z("inline-flex items-center justify-center gap-1.5 rounded-md font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",R[r.size],e()?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground");return h!==a.e&&y(l,"aria-pressed",a.e=h),b!==a.t&&y(l,"tabindex",a.t=b),k!==a.a&&A(l,a.a=k),a},{e:void 0,t:void 0,a:void 0}),l})()}})),x(()=>A(t,z("inline-flex items-center gap-0.5 rounded-lg bg-surface-sunken p-0.5",r.class))),t})()}H(["keydown","click"]);var O=f("<style>:host{display:inline-flex}");M("kai-segmented",{options:[],value:void 0,size:"md"},(u,r)=>{const{element:i,dispatch:c}=r,[s,d]=S(u.value??i.getAttribute("value")??""),t=e=>e==null?i.getAttribute("value")??"":String(e),n=e=>{w(s)!==e&&(d(e),c("kai-change",{value:e}))};Object.defineProperty(i,"value",{get:()=>s(),set:e=>{const v=t(e);w(s)!==v&&d(v)},configurable:!0,enumerable:!0}),E(()=>{const e=s();e?i.getAttribute("value")!==e&&i.setAttribute("value",e):i.hasAttribute("value")&&i.removeAttribute("value")});const o=()=>(u.options??[]).map(e=>({value:e.value,label:e.label,icon:e.icon?F(e.icon,{class:"size-4 shrink-0",imgClass:"size-4 shrink-0",spanClass:"inline-flex size-4 shrink-0 items-center justify-center",ariaHidden:!0}):void 0}));return[O(),m(K,{get options(){return o()},get value(){return s()},get size(){return u.size??"md"},onChange:e=>n(e)})]});
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f as o,i,c as e,t as n}from"./chunks/define-rGsaWsLL.js";import{S as s}from"./chunks/separator-8hM4GdHE.js";var l=n("<style>");o("kai-separator",{orientation:"horizontal"},a=>{const t=()=>a.orientation==="vertical";return[(()=>{var r=l();return i(r,()=>t()?":host{display:inline-block;align-self:stretch}":":host{display:block}"),r})(),e(s,{get orientation(){return t()?"vertical":"horizontal"},part:"separator"})]});
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f as i,g as a,o as c,c as l,n as u,q as b,t as d,p as m}from"./chunks/define-rGsaWsLL.js";import{S as p}from"./chunks/settings-group-CYjOVIZQ.js";var g=d("<slot name=control>");i("kai-setting-item",{label:"",description:void 0},(t,{element:r})=>{const[s,n]=a(!1);return c(()=>{const e=()=>n(!!r.querySelector(':scope > [slot="control"]'));e();const o=new MutationObserver(e);o.observe(r,{childList:!0,attributes:!0,subtree:!0}),m(()=>o.disconnect())}),l(p,{get label(){return t.label??""},get description(){return t.description},get control(){return u(()=>!!s())()?(()=>{var e=g();return e._$owner=b(),e})():void 0}})});
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f as t,c as e,q as n,t as o}from"./chunks/define-rGsaWsLL.js";import{a}from"./chunks/settings-group-CYjOVIZQ.js";var s=o("<slot>");t("kai-settings-group",{heading:"",description:void 0},r=>e(a,{get heading(){return r.heading??""},get description(){return r.description},get children(){var i=s();return i._$owner=n(),i}}));
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import{f as e,c as i,n as r,t as a}from"./chunks/define-rGsaWsLL.js";import{S as n}from"./chunks/skeleton-DsTYrPUe.js";var s=a("<style>:host{display:block}");e("kai-skeleton",{variant:"text",width:void 0,height:void 0,lines:void 0},t=>[s(),i(n,{get variant(){return t.variant??"text"},get width(){return t.width},get height(){return t.height},get lines(){return r(()=>t.lines!=null)()?Number(t.lines):void 0}})]);
@@ -0,0 +1,176 @@
1
+ /**
2
+ * Composition slots for `kai-*` elements. A slot is a named region a consumer
3
+ * fills with their own markup. This registry is the SINGLE SOURCE OF TRUTH:
4
+ * the facade derives its detection from it (and, later, docs are generated
5
+ * from it). See docs/superpowers/specs/2026-06-23-kai-chat-composition-seams-design.md.
6
+ */
7
+ /** `inject` = additive (the built-in region still renders, your markup is added
8
+ * in). `replace` = your markup stands in for the whole region — you own that
9
+ * region's data + events (a slotted light-DOM node can't read the component's
10
+ * reactive state). */
11
+ export type SlotMode = 'inject' | 'replace';
12
+ export interface SlotDef {
13
+ /** Slot name (kebab-case). Also the `::part` name when `part` is true. */
14
+ name: string;
15
+ mode: SlotMode;
16
+ /** Expose `::part(name)` on the region wrapper for consumer styling. */
17
+ part?: boolean;
18
+ /** One-line contract: what the consumer projects / owns. Feeds the docs. */
19
+ doc: string;
20
+ }
21
+ /** Slots of `<kai-chat>`, in render order. */
22
+ export declare const CHAT_SLOTS: SlotDef[];
23
+ /** Slots of `<kai-prompt-input>` (and the default composer inside `<kai-chat>`). Native
24
+ * shadow slots — an empty slot renders nothing, so no facade flag-gating is required.
25
+ *
26
+ * These are ONLY positions inside the card's shadow boundary — places a consumer
27
+ * cannot reach from their own DOM. Content ABOVE/BELOW the whole card is the
28
+ * consumer's own light-DOM layout (a sibling element), so there is intentionally
29
+ * no outer block slot here. (When the input is nested inside `<kai-chat>`'s shadow,
30
+ * that surrounding hole belongs to `kai-chat` — see `composer-actions`/`footer`.) */
31
+ export declare const PROMPT_INPUT_SLOTS: SlotDef[];
32
+ /** Slots of `<kai-conversations>` (also used inside `<kai-chat>`'s `sidebar`).
33
+ * Names mirror `<kai-chat>`'s so the two compose with one vocabulary. */
34
+ export declare const CONVERSATIONS_SLOTS: SlotDef[];
35
+ /** Styleable `::part`s of `<kai-conversations>`. */
36
+ export declare const CONVERSATIONS_PARTS: PartDef[];
37
+ /** Slots of `<kai-message>` — per-message composition seams. `before-body` and
38
+ * `after-body` are INJECT regions inside the message's body column; `avatar`
39
+ * REPLACES the built-in avatar rail (pair it with `avatar="none"` to omit the
40
+ * rail entirely). These are the keystone of compose-your-own message lists. */
41
+ export declare const MESSAGE_SLOTS: SlotDef[];
42
+ /** Slots of `<kai-notice>`. The message is the default slot; these are the named seams. */
43
+ export declare const NOTICE_SLOTS: SlotDef[];
44
+ /** Slots of `<kai-button>` (the label is the default slot). */
45
+ export declare const BUTTON_SLOTS: SlotDef[];
46
+ /** Slots of `<kai-hover-card>` (the trigger is the default slot). */
47
+ export declare const HOVER_CARD_SLOTS: SlotDef[];
48
+ /** Slots of `<kai-menu>` (the menu items come from the `items` prop). */
49
+ export declare const MENU_SLOTS: SlotDef[];
50
+ /** A styleable `::part` the kit renders (NOT a slot — you don't project into it;
51
+ * you restyle it from outside via `::part(name)`). This registry is the source
52
+ * of truth so the styling surface is discoverable: docs + the `kai` MCP
53
+ * component reference are generated from it, the same way slots are. The
54
+ * `recipe` is a copy-pasteable example — including the "just hide it" case that
55
+ * is pure CSS and therefore intentionally NOT a prop. */
56
+ export interface PartDef {
57
+ /** `::part(name)` exposed for consumer styling. */
58
+ name: string;
59
+ /** One-line contract: what the part is. */
60
+ doc: string;
61
+ /** A copy-pasteable styling example for docs / the MCP reference. */
62
+ recipe?: string;
63
+ }
64
+ /** Styleable `::part`s of `<kai-chat>` (beyond the slot-backed `header`/`sidebar`/
65
+ * `footer` parts). */
66
+ export declare const CHAT_PARTS: PartDef[];
67
+ /** Styleable `::part`s of `<kai-prompt-input>`. */
68
+ export declare const PROMPT_INPUT_PARTS: PartDef[];
69
+ /** Styleable `::part`s of `<kai-button>`. */
70
+ export declare const BUTTON_PARTS: PartDef[];
71
+ /** Styleable `::part`s of `<kai-badge>`. */
72
+ export declare const BADGE_PARTS: PartDef[];
73
+ /** Styleable `::part`s of `<kai-icon>`. */
74
+ export declare const ICON_PARTS: PartDef[];
75
+ /** Styleable `::part`s of `<kai-separator>`. */
76
+ export declare const SEPARATOR_PARTS: PartDef[];
77
+ /** Styleable `::part`s of `<kai-scroll-area>`. */
78
+ export declare const SCROLL_AREA_PARTS: PartDef[];
79
+ /** Styleable `::part`s of `<kai-skeleton>`. */
80
+ export declare const SKELETON_PARTS: PartDef[];
81
+ /** Styleable `::part`s of `<kai-message>`. (The `avatar` part is contributed by
82
+ * the `avatar` slot's `part: true` flag, so it is not repeated here.) */
83
+ export declare const MESSAGE_PARTS: PartDef[];
84
+ /** Styleable `::part`s of `<kai-attachments>`. */
85
+ export declare const ATTACHMENTS_PARTS: PartDef[];
86
+ /** Styleable `::part`s of `<kai-status>`. */
87
+ export declare const STATUS_PARTS: PartDef[];
88
+ /** Styleable `::part`s of `<kai-tabs>`. */
89
+ export declare const TABS_PARTS: PartDef[];
90
+ /** Styleable `::part`s of `<kai-voice-output>`. */
91
+ export declare const VOICE_OUTPUT_PARTS: PartDef[];
92
+ /** Slots of `<kai-screen>` (the default slot is the screen body). */
93
+ export declare const SCREEN_SLOTS: SlotDef[];
94
+ /** Styleable `::part`s of `<kai-screen>`. */
95
+ export declare const SCREEN_PARTS: PartDef[];
96
+ /** Slots of `<kai-card>` — structural regions only (the title/description are body
97
+ * or `slot="header"` content you mark up). The body is the default slot. */
98
+ export declare const CARD_SLOTS: SlotDef[];
99
+ /** Styleable `::part`s of `<kai-card>`. */
100
+ export declare const CARD_PARTS: PartDef[];
101
+ /** Injection slots of `<kai-workspace>` (the carrier regions the consumer drops
102
+ * content into: brand/tabs, the upgrade/Design/user-menu cluster, a top banner). */
103
+ export declare const WORKSPACE_SLOTS: SlotDef[];
104
+ /** Styleable `::part`s of `<kai-workspace>`. */
105
+ export declare const WORKSPACE_PARTS: PartDef[];
106
+ /** Styleable `::part`s of `<kai-nav>`. */
107
+ export declare const NAV_PARTS: PartDef[];
108
+ /** Slots of `<kai-coachmark>` (the anchor/trigger is the default slot). */
109
+ export declare const COACHMARK_SLOTS: SlotDef[];
110
+ /** Styleable `::part`s of `<kai-coachmark>`. */
111
+ export declare const COACHMARK_PARTS: PartDef[];
112
+ /** Styleable `::part`s of `<kai-progress-bar>`. */
113
+ export declare const PROGRESS_BAR_PARTS: PartDef[];
114
+ /** Styleable `::part`s of `<kai-file-tree>` — the changed-files / diff bits, shown
115
+ * only when a file carries diff metadata (or the `summary` attribute is set). */
116
+ export declare const FILE_TREE_PARTS: PartDef[];
117
+ /**
118
+ * Per-element composition surface — the SINGLE registry the build extracts
119
+ * (`scripts/gen-element-api.mjs`) into `element-meta.json`, the Custom Elements
120
+ * Manifest (`cssParts`/`slots`), `docs/web-components.md`, and the `kai` MCP
121
+ * `component_reference`. Each entry maps a `kai-*` tag to the slots it projects
122
+ * and the `::part`s it exposes for styling. Slots flagged `part: true` are ALSO
123
+ * styleable parts, so they surface in both places.
124
+ *
125
+ * Adding a `part="…"` in a facade/component without registering it here fails the
126
+ * `slots.test.ts` drift guard — keep this in sync with the source.
127
+ */
128
+ export interface ElementComposition {
129
+ slots?: SlotDef[];
130
+ parts?: PartDef[];
131
+ }
132
+ /** Slots + styleable `::part`s of `<kai-prompt-dock>`. */
133
+ export declare const PROMPT_DOCK_SLOTS: SlotDef[];
134
+ export declare const PROMPT_DOCK_PARTS: PartDef[];
135
+ /** Styleable `::part`s of `<kai-segmented>`. */
136
+ export declare const SEGMENTED_PARTS: PartDef[];
137
+ /** Styleable `::part`s of `<kai-settings-group>`. */
138
+ export declare const SETTINGS_GROUP_PARTS: PartDef[];
139
+ /** Slots + styleable `::part`s of `<kai-setting-item>`. */
140
+ export declare const SETTING_ITEM_SLOTS: SlotDef[];
141
+ export declare const SETTING_ITEM_PARTS: PartDef[];
142
+ /** Slots + styleable `::part`s of `<kai-pane>` (the editor-group pane frame). */
143
+ export declare const PANE_SLOTS: SlotDef[];
144
+ export declare const PANE_PARTS: PartDef[];
145
+ /** Styleable `::part`s of `<kai-agent-card>`. */
146
+ export declare const AGENT_CARD_PARTS: PartDef[];
147
+ /** Slots + styleable `::part`s of `<kai-dialog>` (the centered modal). */
148
+ export declare const DIALOG_SLOTS: SlotDef[];
149
+ export declare const DIALOG_PARTS: PartDef[];
150
+ /** Styleable `::part`s of `<kai-pane-group>` (the editor group: a tab strip over
151
+ * the active tab's pane). The per-tab content slots are NAMED DYNAMICALLY by tab
152
+ * id (`slot="<tab id>"`) plus a default slot, so they are not enumerable here —
153
+ * only the styleable parts are registered. */
154
+ export declare const PANE_GROUP_PARTS: PartDef[];
155
+ /** Affix slots + styleable `::part`s of `<kai-input>` (the field shell). */
156
+ export declare const INPUT_SLOTS: SlotDef[];
157
+ export declare const INPUT_PARTS: PartDef[];
158
+ /** Styleable `::part`s of `<kai-search>` (the debounced filter field; composes the
159
+ * kai-input field plus a clear button). */
160
+ export declare const SEARCH_PARTS: PartDef[];
161
+ /** Styleable `::part`s of `<kai-editable-label>` (inline rename; the edit field is the kai-input field). */
162
+ export declare const EDITABLE_LABEL_PARTS: PartDef[];
163
+ /** Styleable `::part`s of `<kai-kbd>` (the keyboard-shortcut display). */
164
+ export declare const KBD_PARTS: PartDef[];
165
+ /** Styleable `::part`s of `<kai-command>` (the command palette). */
166
+ export declare const COMMAND_PARTS: PartDef[];
167
+ /** Styleable `::part`s of `<kai-menu>` (the actions dropdown). */
168
+ export declare const MENU_PARTS: PartDef[];
169
+ export declare const ELEMENT_COMPOSITION: Record<string, ElementComposition>;
170
+ /**
171
+ * Which slots have projected light-DOM content — a DIRECT child of `host`
172
+ * carrying the matching `slot` attribute. Pure and synchronous; safe in jsdom
173
+ * and SSR (returns all-false when `host` has no matching children). The facade
174
+ * calls this on mount and on every childList mutation.
175
+ */
176
+ export declare function readSlots(host: Element, defs?: SlotDef[]): Record<string, boolean>;