@kitn.ai/ui 0.30.0 → 0.31.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 (261) hide show
  1. package/README.md +1 -1
  2. package/dist/{Icon-BzBET3E-.js → Icon-DJDuE_-x.js} +1 -1
  3. package/dist/action-icons-xkBBVKkF.js +1 -0
  4. package/dist/agent-tooling/construct/schema-url.d.ts +9 -0
  5. package/dist/agent-tooling/construct/schema.d.ts +76 -1
  6. package/dist/agent-tooling/construct/templates.d.ts +45 -0
  7. package/dist/arrow-down-DU6wOl-h.js +1 -0
  8. package/dist/arrow-left-DD46kN17.js +1 -0
  9. package/dist/{artifact-DGjzHYUT.js → artifact-DoUAr1Fd.js} +1 -1
  10. package/dist/assets/dev-DwzHsqYD.js +553 -0
  11. package/dist/{attachments-YvXHlg88.js → attachments-BLWPDiLH.js} +1 -1
  12. package/dist/{audio-visualizer-9lz5IHsL.js → audio-visualizer-DhHicYvV.js} +1 -1
  13. package/dist/{badge-Dh_vp8A5.js → badge-BGm7pcwi.js} +1 -1
  14. package/dist/{bell-CT7_WUwS.js → bell-CMEdSo7A.js} +1 -1
  15. package/dist/builder-app/App.d.ts +1 -0
  16. package/dist/builder-app/edit-guard.d.ts +8 -0
  17. package/dist/builder-app/main.d.ts +0 -0
  18. package/dist/builder-page/assets/index-C10OF-ur.js +72 -0
  19. package/dist/builder-page/assets/index-CFyKLBlu.css +1 -0
  20. package/dist/builder-page/index.html +20 -0
  21. package/dist/button-BM0YTTDQ.js +1 -0
  22. package/dist/{card-renderer-DZVaGH2e.js → card-renderer-Ds-wXc6_.js} +1 -1
  23. package/dist/check-BG1VfYjm.js +1 -0
  24. package/dist/{checkbox-group-BiryEXPQ.js → checkbox-group-CqXj8ehz.js} +1 -1
  25. package/dist/{checkbox-Bu2T2e0U.js → checkbox-np_5mKxM.js} +1 -1
  26. package/dist/chevron-down-CZ4W0hy6.js +1 -0
  27. package/dist/chevron-right-5gdxkCTF.js +1 -0
  28. package/dist/{choice-card-CM6IjkmL.js → choice-card-BYBmPAT5.js} +1 -1
  29. package/dist/circle-C0lwjD2A.js +1 -0
  30. package/dist/circle-check-BfT1cxQU.js +1 -0
  31. package/dist/{circle-x-Bk-dA5Wf.js → circle-x-DzUfvRqr.js} +1 -1
  32. package/dist/{code-block-B26t-Q7q.js → code-block-H6E5Eurc.js} +1 -1
  33. package/dist/{collapsible-Bhc636Cf.js → collapsible-CBq1Tj6y.js} +1 -1
  34. package/dist/components/builder-message-actions.d.ts +9 -18
  35. package/dist/components/builder-panel-derived.d.ts +18 -0
  36. package/dist/components/builder-panel.d.ts +51 -0
  37. package/dist/components/builder-start.d.ts +14 -10
  38. package/dist/components/chat-thread.d.ts +27 -1
  39. package/dist/components/construct-form-paths.d.ts +54 -0
  40. package/dist/components/message.d.ts +5 -0
  41. package/dist/{composer-DMI85B6j.js → composer-B5IvgxAF.js} +1 -1
  42. package/dist/{confirm-card-B0YIAwXp.js → confirm-card-B63pZIfG.js} +1 -1
  43. package/dist/construct-cli.es.js +469 -125
  44. package/dist/construct-templates.d.ts +5 -0
  45. package/dist/construct-templates.js +266 -0
  46. package/dist/construct.js +269 -86
  47. package/dist/{context-DWgfhqWp.js → context-Byqor78j.js} +1 -1
  48. package/dist/controllable-C4BSt73s.js +1 -0
  49. package/dist/{conversation-item-BsOsVGmT.js → conversation-item-piXZFRWa.js} +1 -1
  50. package/dist/{conversation-list-aX3Vtc7L.js → conversation-list-B5yu9cPg.js} +1 -1
  51. package/dist/{copy-BmEwsNhJ.js → copy-DfI2NYEX.js} +1 -1
  52. package/dist/{create-tween-CNOAU3Fx.js → create-tween-C4j96_Aj.js} +1 -1
  53. package/dist/{create-tween-WfqiENls.js → create-tween-CHleHI8m.js} +1 -1
  54. package/dist/{create-tween-wlFtW9Kh.js → create-tween-DQ6lOhdl.js} +1 -1
  55. package/dist/{create-tween-zt79ba32.js → create-tween-DyjTgkJi.js} +1 -1
  56. package/dist/custom-elements.json +40 -5
  57. package/dist/{default-input-DMV5Eaze.js → default-input-Bwmt8Lai.js} +1 -1
  58. package/dist/define-B3OpsIDE.js +1 -0
  59. package/dist/define.js +2 -2
  60. package/dist/define.server.js +2 -2
  61. package/dist/{disclosure-NnACBxsC.js → disclosure-ZSAlD4wg.js} +1 -1
  62. package/dist/{dropdown-DT7G0RGR.js → dropdown-CSRhiMN2.js} +1 -1
  63. package/dist/elements/agent-card.js +1 -1
  64. package/dist/elements/artifact.js +1 -1
  65. package/dist/elements/attachments.js +1 -1
  66. package/dist/elements/audio-visualizer.js +1 -1
  67. package/dist/elements/avatar.js +1 -1
  68. package/dist/elements/badge.js +1 -1
  69. package/dist/elements/button.js +1 -1
  70. package/dist/elements/card.js +1 -1
  71. package/dist/elements/cards.js +1 -1
  72. package/dist/elements/chain-of-thought.js +1 -1
  73. package/dist/elements/chat-actions.d.ts +12 -0
  74. package/dist/elements/chat-scope-picker.js +1 -1
  75. package/dist/elements/chat-types.d.ts +7 -2
  76. package/dist/elements/chat-workspace.js +1 -1
  77. package/dist/elements/chat.js +1 -1
  78. package/dist/elements/checkbox-group.js +1 -1
  79. package/dist/elements/checkbox.js +1 -1
  80. package/dist/elements/checkpoint.js +1 -1
  81. package/dist/elements/choice.js +1 -1
  82. package/dist/elements/coachmark.js +1 -1
  83. package/dist/elements/code-block.js +1 -1
  84. package/dist/elements/command.js +1 -1
  85. package/dist/elements/compare.js +1 -1
  86. package/dist/elements/composer.js +1 -1
  87. package/dist/elements/confirm-card.js +1 -1
  88. package/dist/elements/context-meter.js +1 -1
  89. package/dist/elements/conversation-item.js +1 -1
  90. package/dist/elements/conversation-list.js +1 -1
  91. package/dist/elements/dialog.js +1 -1
  92. package/dist/elements/dock.js +1 -1
  93. package/dist/elements/dropdown.js +1 -1
  94. package/dist/elements/editable-label.js +1 -1
  95. package/dist/elements/embed.js +1 -1
  96. package/dist/elements/empty.js +1 -1
  97. package/dist/elements/feedback-bar.js +1 -1
  98. package/dist/elements/file-tree.js +1 -1
  99. package/dist/elements/file-upload.js +1 -1
  100. package/dist/elements/form.js +1 -1
  101. package/dist/elements/hover-card.js +1 -1
  102. package/dist/elements/icon.js +1 -1
  103. package/dist/elements/image.js +1 -1
  104. package/dist/elements/input.js +1 -1
  105. package/dist/elements/kbd.js +1 -1
  106. package/dist/elements/link-preview.js +1 -1
  107. package/dist/elements/loader.js +1 -1
  108. package/dist/elements/markdown.js +1 -1
  109. package/dist/elements/menu.js +1 -1
  110. package/dist/elements/message-skills.js +1 -1
  111. package/dist/elements/message.js +1 -1
  112. package/dist/elements/model-switcher.js +1 -1
  113. package/dist/elements/nav.js +1 -1
  114. package/dist/elements/notice.js +1 -1
  115. package/dist/elements/pane-grid.js +1 -1
  116. package/dist/elements/pane-group.js +1 -1
  117. package/dist/elements/pane.js +1 -1
  118. package/dist/elements/popover.js +1 -1
  119. package/dist/elements/progress-bar.js +1 -1
  120. package/dist/elements/prompt-dock.js +1 -1
  121. package/dist/elements/prompt-input.js +1 -1
  122. package/dist/elements/prompt-suggestions.js +1 -1
  123. package/dist/elements/radio-group.js +1 -1
  124. package/dist/elements/reasoning.js +1 -1
  125. package/dist/elements/remote.js +1 -1
  126. package/dist/elements/resizable.js +1 -1
  127. package/dist/elements/response-stream.js +1 -1
  128. package/dist/elements/screen.js +1 -1
  129. package/dist/elements/scroll-area.js +1 -1
  130. package/dist/elements/scroll-button.js +1 -1
  131. package/dist/elements/search.js +1 -1
  132. package/dist/elements/segmented.js +1 -1
  133. package/dist/elements/select.js +1 -1
  134. package/dist/elements/separator.js +1 -1
  135. package/dist/elements/setting-item.js +1 -1
  136. package/dist/elements/settings-group.js +1 -1
  137. package/dist/elements/skeleton.js +1 -1
  138. package/dist/elements/slider.js +1 -1
  139. package/dist/elements/source.js +1 -1
  140. package/dist/elements/status.js +1 -1
  141. package/dist/elements/switch.js +1 -1
  142. package/dist/elements/tabs.js +1 -1
  143. package/dist/elements/tasks.js +1 -1
  144. package/dist/elements/text-shimmer.js +1 -1
  145. package/dist/elements/thinking-bar.js +1 -1
  146. package/dist/elements/thread.js +1 -1
  147. package/dist/elements/toast.js +1 -1
  148. package/dist/elements/tool.js +1 -1
  149. package/dist/elements/tooltip.js +1 -1
  150. package/dist/elements/voice-input.js +1 -1
  151. package/dist/elements/voice-output.js +1 -1
  152. package/dist/elements.d.ts +22 -10
  153. package/dist/{ellipsis-6pJ7SxYT.js → ellipsis-CJ5QIjWo.js} +1 -1
  154. package/dist/{embed-BMje-nxj.js → embed-6Vji0PfS.js} +1 -1
  155. package/dist/{external-link-Beh9DKeR.js → external-link-BPTtTdet.js} +1 -1
  156. package/dist/{file-text-D1GPfZ8Q.js → file-text-eVjcFDrK.js} +1 -1
  157. package/dist/{file-tree-Dwj2lqg-.js → file-tree-a9tfWYmg.js} +1 -1
  158. package/dist/{folder-b6D8x1DY.js → folder-DN6Ilq6d.js} +1 -1
  159. package/dist/{form-DWgdxDXu.js → form-U1cwhcQx.js} +1 -1
  160. package/dist/{hover-card-CWRkqm40.js → hover-card-C5ptzZOZ.js} +1 -1
  161. package/dist/{icon-CL0jdhsf.js → icon-BOMrFp0D.js} +1 -1
  162. package/dist/index.js +1991 -1989
  163. package/dist/index.server.js +1886 -1884
  164. package/dist/{info-0cOUherQ.js → info-DxzKsIHn.js} +1 -1
  165. package/dist/{input-BH6Ru91Q.js → input-aW72PACH.js} +1 -1
  166. package/dist/kai.es.js +1 -1
  167. package/dist/{kbd-DRAnVtNX.js → kbd-BP-6MwUs.js} +1 -1
  168. package/dist/{link-preview-DODgRyV9.js → link-preview-CZaDilMG.js} +1 -1
  169. package/dist/{link-Dlr0vssB.js → link-rlN11N0B.js} +1 -1
  170. package/dist/{loader-KvJB6NrT.js → loader-BdFK70fF.js} +1 -1
  171. package/dist/{markdown-DX9tuJVj.js → markdown-DjEaoNz-.js} +1 -1
  172. package/dist/mcp.es.js +579 -107
  173. package/dist/message--Nlbemtp.js +1 -0
  174. package/dist/message-C88yTu2A.js +1 -0
  175. package/dist/message-circle-CZeVDN1f.js +1 -0
  176. package/dist/message-square-BXNBKC6i.js +1 -0
  177. package/dist/{minimize-2-CyOHJwcN.js → minimize-2-BxLOOSEf.js} +1 -1
  178. package/dist/{model-switcher-0hrKDiK2.js → model-switcher-BxRvub2A.js} +1 -1
  179. package/dist/{overlay-DBMFXie6.js → overlay-CDwKJtHN.js} +1 -1
  180. package/dist/{panel-right-t8SWJL6e.js → panel-right-BovedCwW.js} +1 -1
  181. package/dist/{paperclip-CdzuOjbU.js → paperclip-D0Xyjja2.js} +1 -1
  182. package/dist/play-DGJ4MgB2.js +1 -0
  183. package/dist/primitives/speech.d.ts +35 -0
  184. package/dist/{progress-bar-CiBtxMWT.js → progress-bar-D-aQfy5h.js} +1 -1
  185. package/dist/{prompt-suggestion-I_DHP21i.js → prompt-suggestion-C6qLjMEQ.js} +1 -1
  186. package/dist/{radio-C_p3n39l.js → radio-D1CkXISc.js} +1 -1
  187. package/dist/react/index.d.ts +22 -6
  188. package/dist/react.js +13 -13
  189. package/dist/{reasoning-BDwy_tIe.js → reasoning-DARmbgmE.js} +1 -1
  190. package/dist/register-impl-WcrdIihK.js +424 -0
  191. package/dist/{resizable-SYC-fStM.js → resizable-Da6oSO2z.js} +1 -1
  192. package/dist/{rotate-ccw-B1nwmwuY.js → rotate-ccw-31ed1xK_.js} +1 -1
  193. package/dist/{rotate-cw-CLAnBcm1.js → rotate-cw-qkl39dw3.js} +1 -1
  194. package/dist/{scroll-area-zRyXoLhI.js → scroll-area-RrKnLYlA.js} +1 -1
  195. package/dist/{scroll-button-jzrbYCG9.js → scroll-button--QeNjobK.js} +1 -1
  196. package/dist/{select-DM-0nEe0.js → select-CS_0mWW3.js} +1 -1
  197. package/dist/{separator-BToOOoOt.js → separator-fT-zBypW.js} +1 -1
  198. package/dist/{settings-PaGo_S4U.js → settings-dfkV_WDm.js} +1 -1
  199. package/dist/{settings-group-BFXGIfXq.js → settings-group-CX694npG.js} +1 -1
  200. package/dist/{skeleton-DYpmFnnm.js → skeleton-BsqKD9TV.js} +1 -1
  201. package/dist/{slider-ebutAmkQ.js → slider-_EWfTH9H.js} +1 -1
  202. package/dist/{solid-15v_3WVL.js → solid-BITWG_VE.js} +3073 -3006
  203. package/dist/{solid-5P-otgdi.js → solid-CRFYWlBw.js} +3865 -3797
  204. package/dist/solid.js +1 -1
  205. package/dist/solid.server.js +1 -1
  206. package/dist/{source-c1gpRl9h.js → source-Da1TFiuj.js} +1 -1
  207. package/dist/speech-CjbWuqG2.js +1 -0
  208. package/dist/{star-pcV_3LqF.js → star-ZvSbbXS6.js} +1 -1
  209. package/dist/{store-CSgbFFCg.js → store-DE5lcr9q.js} +1 -1
  210. package/dist/{switch-Bh2OdLV2.js → switch-P_fsHqv3.js} +1 -1
  211. package/dist/{tasks-card-CbqQAn2S.js → tasks-card-B86qqyZm.js} +1 -1
  212. package/dist/{text-shimmer-BSzgEnDH.js → text-shimmer-BAkw_65G.js} +1 -1
  213. package/dist/{textarea-DrYNt_0z.js → textarea-Bkinatpi.js} +1 -1
  214. package/dist/{thumbs-up-BL3-NenK.js → thumbs-up-CDGW7a4o.js} +1 -1
  215. package/dist/{toast-store-DkOlYczt.js → toast-store-B94I50AO.js} +1 -1
  216. package/dist/{tool-CeIWUVUe.js → tool-CUiCeyi1.js} +1 -1
  217. package/dist/{tooltip-GA-nmg06.js → tooltip-B3wlQSPh.js} +1 -1
  218. package/dist/{trash-2-CT66QWlm.js → trash-2-Cu8yZmFQ.js} +1 -1
  219. package/dist/{triangle-alert-CeHLWxhD.js → triangle-alert-CCtDUUmn.js} +1 -1
  220. package/dist/ui/button-variant-names.d.ts +12 -0
  221. package/dist/ui/button.d.ts +6 -0
  222. package/dist/{upload-9Csb0F0J.js → upload-CxotJlLv.js} +1 -1
  223. package/dist/{use-card-resolution-Zg0a08Z-.js → use-card-resolution-DILUvNyj.js} +1 -1
  224. package/dist/{variant-aurora-4VBQHIKV.js → variant-aurora-BGaXBBGf.js} +1 -1
  225. package/dist/{variant-aurora-LE3fqxgw.js → variant-aurora-BLcQmvkd.js} +1 -1
  226. package/dist/{variant-aurora-DBeCAQNk.js → variant-aurora-DZIfAtx1.js} +2 -2
  227. package/dist/{variant-aurora-FzHVXHby.js → variant-aurora-DpoIW4ZX.js} +2 -2
  228. package/dist/{variant-custom-DI5R0rln.js → variant-custom-BhtWdAxE.js} +1 -1
  229. package/dist/{variant-custom-WWnrrRHS.js → variant-custom-BtApuSyr.js} +2 -2
  230. package/dist/{variant-custom-BQkNuPpE.js → variant-custom-C-zS4ZtE.js} +2 -2
  231. package/dist/{variant-custom-AFRGcOBS.js → variant-custom-swi9PXxU.js} +1 -1
  232. package/dist/{variant-wave-wTP5v_jU.js → variant-wave-7JCIwhpb.js} +1 -1
  233. package/dist/{variant-wave-nSI2sfII.js → variant-wave-BG4nGr6x.js} +1 -1
  234. package/dist/{variant-wave-DuQV7DhQ.js → variant-wave-C32lM9G2.js} +2 -2
  235. package/dist/{variant-wave-DUCbH5oI.js → variant-wave-Dl6jOiK3.js} +2 -2
  236. package/dist/x-C4niw05N.js +1 -0
  237. package/frameworks/react/index.tsx +12 -6
  238. package/llms-full.txt +9 -6
  239. package/llms.txt +1 -1
  240. package/package.json +7 -3
  241. package/solid.css +17 -2
  242. package/src/elements/element-meta.json +39 -14
  243. package/dist/action-icons-DaW2pU6m.js +0 -1
  244. package/dist/arrow-down-D783iMJj.js +0 -1
  245. package/dist/arrow-left-0VLM5kyg.js +0 -1
  246. package/dist/assets/dev-5XzXYR21.js +0 -91
  247. package/dist/button-C_3te6fm.js +0 -1
  248. package/dist/check-CiEOVnEN.js +0 -1
  249. package/dist/chevron-down-CSobuZRG.js +0 -1
  250. package/dist/chevron-right-DR9ZAP-2.js +0 -1
  251. package/dist/circle-BC66EYF7.js +0 -1
  252. package/dist/circle-check-BqmahW0O.js +0 -1
  253. package/dist/controllable-BagRpyHv.js +0 -1
  254. package/dist/define-CI0y3eE4.js +0 -1
  255. package/dist/message-BqQ7Ot5q.js +0 -1
  256. package/dist/message-DkaGfBd8.js +0 -1
  257. package/dist/message-circle-BPpp5QKv.js +0 -1
  258. package/dist/message-square-BLbsd9BJ.js +0 -1
  259. package/dist/play-BXy1u7rW.js +0 -1
  260. package/dist/register-impl-DvEnhIxx.js +0 -424
  261. package/dist/x-eiO9V6J6.js +0 -1
package/dist/construct.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z as e } from "zod";
2
- const I = ["http:", "https:", "mailto:"];
3
- function v(t) {
2
+ const u = ["http:", "https:", "mailto:"];
3
+ function h(t) {
4
4
  try {
5
5
  return new URL(t, "http://_invalid_base").protocol;
6
6
  } catch {
@@ -8,10 +8,14 @@ function v(t) {
8
8
  }
9
9
  }
10
10
  function r(t) {
11
- const o = v(t);
12
- return o !== void 0 && I.includes(o);
11
+ const o = h(t);
12
+ return o !== void 0 && u.includes(o);
13
13
  }
14
- const k = "https://ui.kitn.ai/schemas/construct/v1.json", y = /^[a-z][a-z0-9]*-[a-z0-9-]+$/, w = e.discriminatedUnion("mode", [
14
+ const p = ["copy", "like", "dislike", "regenerate", "edit", "speak"], g = ["default", "ghost", "subtle", "outline", "destructive"], k = "https://ui.kitn.ai/schemas/construct/v1.json", b = /^[a-z][a-z0-9]*-[a-z0-9-]+$/, d = e.object({
15
+ id: e.string().min(1),
16
+ label: e.string().min(1),
17
+ description: e.string().min(1).optional()
18
+ }).strict(), f = e.discriminatedUnion("mode", [
15
19
  e.object({ mode: e.literal("mock") }).strict(),
16
20
  e.object({
17
21
  mode: e.literal("endpoint"),
@@ -19,13 +23,13 @@ const k = "https://ui.kitn.ai/schemas/construct/v1.json", y = /^[a-z][a-z0-9]*-[
19
23
  url: e.string().min(1),
20
24
  wire: e.enum(["openai", "anthropic"])
21
25
  }).strict()
22
- ]), j = e.object({
26
+ ]), y = e.object({
23
27
  $schema: e.string().optional(),
24
28
  /** The emitted tag: <acme-support>. Must satisfy customElements.define. */
25
- name: e.string().regex(y, 'must be a valid custom-element tag: lowercase, with a hyphen (e.g. "acme-support")'),
29
+ name: e.string().regex(b, 'must be a valid custom-element tag: lowercase, with a hyphen (e.g. "acme-support")'),
26
30
  // Widened progressively: fullscreen/aside/split landed in Task 12, custom in Task 13.
27
31
  layout: e.enum(["widget", "fullscreen", "aside", "split", "custom"]),
28
- provider: w,
32
+ provider: f,
29
33
  /** Plain (unsigned) identity passthrough — no signing/auth infra (owner
30
34
  * ruling, 2026-08-26: signed JWT/HMAC identity is later additive
31
35
  * vocabulary, not this field). TOP-LEVEL, not nested under `provider`:
@@ -78,7 +82,26 @@ const k = "https://ui.kitn.ai/schemas/construct/v1.json", y = /^[a-z][a-z0-9]*-[
78
82
  /** Rendered in ChatThread's built-in header bar (left side). Construct-
79
83
  * authored/untrusted text, like theme.accent/provider.url — JSON.stringify'd
80
84
  * at its one emit site, never a raw JSX attribute string. */
81
- title: e.string().min(1).optional()
85
+ title: e.string().min(1).optional(),
86
+ /** Renders a theme-toggle Button in ChatThread's header-end region,
87
+ * flipping the host's `theme` attribute (the attribute
88
+ * defineWebComponent already owns) via the facade's ctx.element —
89
+ * codegen work, no new kit surface (B-10). */
90
+ themeToggle: e.boolean().optional(),
91
+ /** Header action buttons (label + kit Button variant), rendered in
92
+ * the header-end region. Vocabulary-never-logic: the construct
93
+ * cannot say what an action DOES, so each click dispatches a
94
+ * non-bubbling `kai-header-action` CustomEvent on the host with
95
+ * `detail: { label }` — the consumer's listening seam (B-10).
96
+ * `variant` derives from the kit Button's own list
97
+ * (BUTTON_VARIANT_NAMES — B-6a), never restated. `label` is
98
+ * construct-authored untrusted text, JSON.stringify'd at emit. */
99
+ actions: e.array(
100
+ e.object({
101
+ label: e.string().min(1),
102
+ variant: e.enum(g).optional()
103
+ }).strict()
104
+ ).min(1).optional()
82
105
  }).strict().optional(),
83
106
  /** Greeting shown while the thread is empty (no messages yet) — the
84
107
  * proven "welcome screen" pattern (Intercom-class): title + optional
@@ -187,7 +210,28 @@ const k = "https://ui.kitn.ai/schemas/construct/v1.json", y = /^[a-z][a-z0-9]*-[
187
210
  * vocabulary; HOW it persists (the ConversationStore adapter,
188
211
  * localStorage vs. a fetch endpoint) is codegen's call, never
189
212
  * vocabulary here (C-3 — no transport-layer vocabulary). */
190
- conversations: e.literal(!0).optional()
213
+ conversations: e.literal(!0).optional(),
214
+ /** Role-scoped default action bars, threaded onto ChatThread's
215
+ * `userActions`/`assistantActions` props (B-3/B-7b). Ordered
216
+ * arrays; enum ids ONLY, read off the ONE const
217
+ * (CHAT_MESSAGE_ACTIONS — B-6): a CustomAction is an id the APP
218
+ * must handle, a construct has no app code, so emitting one is a
219
+ * dead affordance. Duplicates within one array rejected below
220
+ * (superRefine, the slots pattern). min(1): an empty list IS the
221
+ * absent key. */
222
+ messageActions: e.object({
223
+ user: e.array(e.enum(p)).min(1).optional(),
224
+ assistant: e.array(e.enum(p)).min(1).optional()
225
+ }).strict().optional(),
226
+ /** The citations STRIP (the `part="citations"` row consecutive
227
+ * `source` parts already collapse into — message.tsx). `strip:
228
+ * false` hides it (emits ChatThread's `hideSources`); `strip:
229
+ * true` or the key absent emits NOTHING — the row already renders,
230
+ * the kit default IS the on state, the same anchored-on-the-
231
+ * default convention as `reasoning: 'full'` (B-4). */
232
+ sources: e.object({
233
+ strip: e.boolean().optional()
234
+ }).strict().optional()
191
235
  }).strict().optional(),
192
236
  /** Named generative-UI card definitions the model can emit as tool calls,
193
237
  * rendered in the thread. Top-level (not a capability): a card is
@@ -234,94 +278,233 @@ const k = "https://ui.kitn.ai/schemas/construct/v1.json", y = /^[a-z][a-z0-9]*-[
234
278
  /** Seed Dock's open state at mount. Uncontrolled — never steals focus (Dock's
235
279
  * own focus contract, dock.tsx). Omitted keeps Dock's own default (closed). */
236
280
  defaultOpen: e.boolean().optional()
281
+ }).strict().optional(),
282
+ /** Layout-scoped aside geometry, `layout: 'aside'` only (superRefine
283
+ * below, mirroring `widget`'s scoping exactly). `position` picks the
284
+ * docked inline edge (default 'end', today's hardcoded behavior);
285
+ * `width` overrides codegen's 380px default. `width` is construct-
286
+ * authored untrusted text: it lands as a JSON.stringify'd VALUE inside
287
+ * the emitted Solid `style={{ }}` object — property assignment, the
288
+ * same no-CSS-text-interpolation guarantee as setProperty — never
289
+ * concatenated into a CSS string (B-2). */
290
+ aside: e.object({
291
+ position: e.enum(["start", "end"]).optional(),
292
+ width: e.string().min(1).optional()
293
+ }).strict().optional(),
294
+ /** Construct-wide shell chrome (10a): both members reuse REAL kit
295
+ * pieces — command.tsx's CommandList behind a codegen-emitted overlay
296
+ * (opened on Mod+K; entries DERIVE from what this construct enables —
297
+ * menu-honesty against dead entries), and the documented Dropdown+
298
+ * Avatar user-menu recipe. `name`/`plan` are construct-authored
299
+ * untrusted text, JSON.stringify'd at emit like every sibling.
300
+ * `commandPalette` is presence-only `z.literal(true)`, matching
301
+ * `conversations`' pattern. */
302
+ shell: e.object({
303
+ commandPalette: e.literal(!0).optional(),
304
+ userMenu: e.object({
305
+ name: e.string().min(1),
306
+ plan: e.string().min(1).optional()
307
+ }).strict().optional()
308
+ }).strict().optional(),
309
+ /** Composer chrome — NOT a capability: chrome on the medium, like
310
+ * `header` (B-5). `triggers` maps onto ChatThread's real, shipped
311
+ * `triggers` prop: `slash` → `{ char: '/', kind: 'command', items }`,
312
+ * `mention` → `{ char: '@', kind: 'mention', items }` at emit. */
313
+ composer: e.object({
314
+ triggers: e.object({
315
+ slash: e.array(d).min(1).optional(),
316
+ mention: e.array(d).min(1).optional()
317
+ }).strict().optional()
237
318
  }).strict().optional()
238
319
  }).strict().superRefine((t, o) => {
239
- var c, p, d, m, u, h, g;
240
- if (t.slots) {
241
- const a = /* @__PURE__ */ new Set();
242
- t.slots.forEach((s, b) => {
243
- a.has(s) && o.addIssue({
320
+ for (const s of I) s.check(t, o);
321
+ }), I = [
322
+ {
323
+ id: "slots-unique",
324
+ paths: ["slots"],
325
+ check: (t, o) => {
326
+ if (!t.slots) return;
327
+ const s = /* @__PURE__ */ new Set();
328
+ t.slots.forEach((i, a) => {
329
+ s.has(i) && o.addIssue({
330
+ code: e.ZodIssueCode.custom,
331
+ path: ["slots", a],
332
+ message: `duplicate slot name "${i}"`
333
+ }), s.add(i);
334
+ });
335
+ }
336
+ },
337
+ {
338
+ id: "custom-layout-needs-slots",
339
+ paths: ["layout", "slots"],
340
+ check: (t, o) => {
341
+ t.layout === "custom" && (!t.slots || t.slots.length === 0) && o.addIssue({
244
342
  code: e.ZodIssueCode.custom,
245
- path: ["slots", b],
246
- message: `duplicate slot name "${s}"`
247
- }), a.add(s);
248
- });
249
- }
250
- if (t.layout === "custom" && (!t.slots || t.slots.length === 0) && o.addIssue({
251
- code: e.ZodIssueCode.custom,
252
- path: ["slots"],
253
- message: '"custom" layout requires at least one declared slot — custom IS the slots grain'
254
- }), t.layout === "split" && t.slots) {
255
- const a = t.slots.indexOf("pane");
256
- a !== -1 && o.addIssue({
257
- code: e.ZodIssueCode.custom,
258
- path: ["slots", a],
259
- message: `"pane" collides with the "split" layout's own fixed <slot name="pane"> — choose a different slot name`
260
- });
343
+ path: ["slots"],
344
+ message: '"custom" layout requires at least one declared slot custom IS the slots grain'
345
+ });
346
+ }
347
+ },
348
+ {
349
+ id: "split-pane-slot-collision",
350
+ paths: ["layout", "slots"],
351
+ check: (t, o) => {
352
+ if (t.layout === "split" && t.slots) {
353
+ const s = t.slots.indexOf("pane");
354
+ s !== -1 && o.addIssue({
355
+ code: e.ZodIssueCode.custom,
356
+ path: ["slots", s],
357
+ message: `"pane" collides with the "split" layout's own fixed <slot name="pane"> — choose a different slot name`
358
+ });
359
+ }
360
+ }
361
+ },
362
+ {
363
+ id: "widget-layout-scope",
364
+ paths: ["layout", "widget"],
365
+ check: (t, o) => {
366
+ t.widget && t.layout !== "widget" && o.addIssue({
367
+ code: e.ZodIssueCode.custom,
368
+ path: ["widget"],
369
+ message: '"widget" is only valid on layout: "widget"'
370
+ });
371
+ }
372
+ },
373
+ {
374
+ id: "aside-layout-scope",
375
+ paths: ["layout", "aside"],
376
+ check: (t, o) => {
377
+ t.aside && t.layout !== "aside" && o.addIssue({
378
+ code: e.ZodIssueCode.custom,
379
+ path: ["aside"],
380
+ message: '"aside" is only valid on layout: "aside"'
381
+ });
382
+ }
383
+ },
384
+ {
385
+ id: "message-actions-unique",
386
+ paths: ["capabilities.messageActions.user", "capabilities.messageActions.assistant"],
387
+ check: (t, o) => {
388
+ var i;
389
+ const s = (i = t.capabilities) == null ? void 0 : i.messageActions;
390
+ if (s)
391
+ for (const a of ["user", "assistant"]) {
392
+ const n = s[a];
393
+ if (!n) continue;
394
+ const l = /* @__PURE__ */ new Set();
395
+ n.forEach((c, m) => {
396
+ l.has(c) && o.addIssue({
397
+ code: e.ZodIssueCode.custom,
398
+ path: ["capabilities", "messageActions", a, m],
399
+ message: `duplicate action id "${c}"`
400
+ }), l.add(c);
401
+ });
402
+ }
403
+ }
404
+ },
405
+ {
406
+ id: "launcher-icon-url",
407
+ paths: ["widget.launcherIcon"],
408
+ check: (t, o) => {
409
+ var s;
410
+ (s = t.widget) != null && s.launcherIcon && !r(t.widget.launcherIcon) && o.addIssue({
411
+ code: e.ZodIssueCode.custom,
412
+ path: ["widget", "launcherIcon"],
413
+ message: "launcherIcon must be an http(s)/mailto or relative URL — no javascript:/data: schemes"
414
+ });
415
+ }
416
+ },
417
+ {
418
+ id: "empty-icon-url",
419
+ paths: ["empty.icon"],
420
+ check: (t, o) => {
421
+ var s;
422
+ (s = t.empty) != null && s.icon && !r(t.empty.icon) && o.addIssue({
423
+ code: e.ZodIssueCode.custom,
424
+ path: ["empty", "icon"],
425
+ message: "icon must be an http(s)/mailto or relative URL — no javascript:/data: schemes"
426
+ });
427
+ }
428
+ },
429
+ {
430
+ id: "reasoning-open-scope",
431
+ paths: ["capabilities.reasoning", "capabilities.reasoningOpen"],
432
+ check: (t, o) => {
433
+ var a, n;
434
+ const s = (a = t.capabilities) == null ? void 0 : a.reasoning;
435
+ ((n = t.capabilities) == null ? void 0 : n.reasoningOpen) !== void 0 && (s === "compact" || s === "off") && o.addIssue({
436
+ code: e.ZodIssueCode.custom,
437
+ path: ["capabilities", "reasoningOpen"],
438
+ message: '"reasoningOpen" only applies when reasoning is "full" or omitted — "compact"/"off" have no disclosure to open'
439
+ });
440
+ }
441
+ },
442
+ {
443
+ id: "conversations-need-history",
444
+ paths: ["capabilities.conversations", "capabilities.history"],
445
+ check: (t, o) => {
446
+ var i, a;
447
+ const s = (i = t.capabilities) == null ? void 0 : i.history;
448
+ (a = t.capabilities) != null && a.conversations && (!s || s.persistence === "none") && o.addIssue({
449
+ code: e.ZodIssueCode.custom,
450
+ path: ["capabilities", "conversations"],
451
+ message: '"conversations" requires capabilities.history.persistence to be "local" or "endpoint" — a conversation list needs somewhere to persist conversations'
452
+ });
453
+ }
454
+ },
455
+ {
456
+ id: "home-link-urls",
457
+ paths: ["home.links"],
458
+ check: (t, o) => {
459
+ var i;
460
+ const s = /^[a-zA-Z][a-zA-Z0-9+.-]*:|^\/\//;
461
+ for (const [a, n] of (((i = t.home) == null ? void 0 : i.links) ?? []).entries())
462
+ n.href && !r(n.href) && o.addIssue({
463
+ code: e.ZodIssueCode.custom,
464
+ path: ["home", "links", a, "href"],
465
+ message: "href must be an http(s)/mailto or relative URL — no javascript:/data: schemes"
466
+ }), n.icon && s.test(n.icon) && !r(n.icon) && o.addIssue({
467
+ code: e.ZodIssueCode.custom,
468
+ path: ["home", "links", a, "icon"],
469
+ message: "icon must be a kit icon name or an http(s)/relative URL — no javascript:/data: schemes"
470
+ });
471
+ }
472
+ },
473
+ {
474
+ id: "history-endpoint-url",
475
+ paths: ["capabilities.history.persistence", "capabilities.history.url"],
476
+ check: (t, o) => {
477
+ var i;
478
+ const s = (i = t.capabilities) == null ? void 0 : i.history;
479
+ s && (s.persistence === "endpoint" && !s.url && o.addIssue({
480
+ code: e.ZodIssueCode.custom,
481
+ path: ["capabilities", "history", "url"],
482
+ message: '"endpoint" persistence requires a url'
483
+ }), s.persistence !== "endpoint" && s.url !== void 0 && o.addIssue({
484
+ code: e.ZodIssueCode.custom,
485
+ path: ["capabilities", "history", "url"],
486
+ message: 'url is only valid with "endpoint" persistence'
487
+ }));
488
+ }
261
489
  }
262
- t.widget && t.layout !== "widget" && o.addIssue({
263
- code: e.ZodIssueCode.custom,
264
- path: ["widget"],
265
- message: '"widget" is only valid on layout: "widget"'
266
- }), (c = t.widget) != null && c.launcherIcon && !r(t.widget.launcherIcon) && o.addIssue({
267
- code: e.ZodIssueCode.custom,
268
- path: ["widget", "launcherIcon"],
269
- message: "launcherIcon must be an http(s)/mailto or relative URL — no javascript:/data: schemes"
270
- }), (p = t.empty) != null && p.icon && !r(t.empty.icon) && o.addIssue({
271
- code: e.ZodIssueCode.custom,
272
- path: ["empty", "icon"],
273
- message: "icon must be an http(s)/mailto or relative URL — no javascript:/data: schemes"
274
- });
275
- const i = (d = t.capabilities) == null ? void 0 : d.reasoning;
276
- ((m = t.capabilities) == null ? void 0 : m.reasoningOpen) !== void 0 && (i === "compact" || i === "off") && o.addIssue({
277
- code: e.ZodIssueCode.custom,
278
- path: ["capabilities", "reasoningOpen"],
279
- message: '"reasoningOpen" only applies when reasoning is "full" or omitted — "compact"/"off" have no disclosure to open'
280
- });
281
- const n = (u = t.capabilities) == null ? void 0 : u.history;
282
- (h = t.capabilities) != null && h.conversations && (!n || n.persistence === "none") && o.addIssue({
283
- code: e.ZodIssueCode.custom,
284
- path: ["capabilities", "conversations"],
285
- message: '"conversations" requires capabilities.history.persistence to be "local" or "endpoint" — a conversation list needs somewhere to persist conversations'
286
- });
287
- const f = /^[a-zA-Z][a-zA-Z0-9+.-]*:|^\/\//;
288
- for (const [a, s] of (((g = t.home) == null ? void 0 : g.links) ?? []).entries())
289
- s.href && !r(s.href) && o.addIssue({
290
- code: e.ZodIssueCode.custom,
291
- path: ["home", "links", a, "href"],
292
- message: "href must be an http(s)/mailto or relative URL — no javascript:/data: schemes"
293
- }), s.icon && f.test(s.icon) && !r(s.icon) && o.addIssue({
294
- code: e.ZodIssueCode.custom,
295
- path: ["home", "links", a, "icon"],
296
- message: "icon must be a kit icon name or an http(s)/relative URL — no javascript:/data: schemes"
297
- });
298
- n && (n.persistence === "endpoint" && !n.url && o.addIssue({
299
- code: e.ZodIssueCode.custom,
300
- path: ["capabilities", "history", "url"],
301
- message: '"endpoint" persistence requires a url'
302
- }), n.persistence !== "endpoint" && n.url !== void 0 && o.addIssue({
303
- code: e.ZodIssueCode.custom,
304
- path: ["capabilities", "history", "url"],
305
- message: 'url is only valid with "endpoint" persistence'
306
- }));
307
- });
308
- function S(t) {
309
- const o = j.safeParse(t);
490
+ ];
491
+ function j(t) {
492
+ const o = y.safeParse(t);
310
493
  return o.success ? { ok: !0, construct: o.data } : {
311
494
  ok: !1,
312
- problems: o.error.issues.flatMap((i) => i.code === "unrecognized_keys" ? i.keys.map((l) => ({
313
- path: [...i.path.map(String), l].join("."),
314
- message: `"${l}" is not construct vocabulary`
495
+ problems: o.error.issues.flatMap((s) => s.code === "unrecognized_keys" ? s.keys.map((i) => ({
496
+ path: [...s.path.map(String), i].join("."),
497
+ message: `"${i}" is not construct vocabulary`
315
498
  })) : [
316
499
  {
317
- path: i.path.map(String).join("."),
318
- message: i.message
500
+ path: s.path.map(String).join("."),
501
+ message: s.message
319
502
  }
320
503
  ])
321
504
  };
322
505
  }
323
506
  export {
324
507
  k as CONSTRUCT_SCHEMA_URL,
325
- j as ConstructSchema,
326
- S as validateConstruct
508
+ y as ConstructSchema,
509
+ j as validateConstruct
327
510
  };
@@ -1 +1 @@
1
- import{k as o,c as n,S as a,i as s,a as d,b as f,G as N,H as P,t as u,d as j,m as B}from"./define-CI0y3eE4.js";import{H,a as M,b as $}from"./hover-card-CWRkqm40.js";import{c as h}from"./cn-DN5AWfiS.js";import{B as E}from"./button-C_3te6fm.js";import{P as G}from"./progress-bar-CiBtxMWT.js";var O=u('<svg aria-label="Model context usage"height=20 role=img viewBox="0 0 24 24"width=20 style=color:currentcolor><circle cx=12 cy=12 fill=none opacity=0.25 r=10 stroke=currentColor stroke-width=2></circle><circle cx=12 cy=12 fill=none opacity=0.7 r=10 stroke=currentColor stroke-linecap=round stroke-width=2 style=transform:rotate(-90deg);transform-origin:center>'),R=u('<span class="font-medium text-muted-foreground">'),q=u('<div class="flex items-center justify-between gap-3 text-xs"><p></p><p class="font-mono text-muted-foreground"> / '),z=u("<div class=space-y-2>"),T=u("<div>"),A=u("<span class=text-muted-foreground>Total cost"),S=u("<span>"),J=u("<div><span class=text-muted-foreground>Input"),K=u("<div><span class=text-muted-foreground>Output"),L=u("<div><span class=text-muted-foreground>Reasoning"),Q=u("<div><span class=text-muted-foreground>Cache");const V=10,v=.7,b=.9;function W(e,t=v,r=b){return e>r?"danger":e>t?"warn":"ok"}const I=N();function g(){const e=P(I);if(!e)throw new Error("Context components must be used within Context");return e}const y=new Intl.NumberFormat("en-US",{notation:"compact"}),D=new Intl.NumberFormat("en-US",{maximumFractionDigits:1,style:"percent"}),_=new Intl.NumberFormat("en-US",{currency:"USD",style:"currency"});function X(e){const t=o(()=>({usedTokens:e.usedTokens,maxTokens:e.maxTokens,inputTokens:e.inputTokens,outputTokens:e.outputTokens,reasoningTokens:e.reasoningTokens,cacheTokens:e.cacheTokens,estimatedCost:e.estimatedCost,warnThreshold:e.warnThreshold??v,dangerThreshold:e.dangerThreshold??b}));return n(I.Provider,{get value(){return t()},get children(){return n(H,{openDelay:0,get children(){return e.children}})}})}function Y(){const e=g(),t=2*Math.PI*V,r=o(()=>e.usedTokens/e.maxTokens),c=o(()=>t*(1-r()));return(()=>{var i=O(),p=i.firstChild,k=p.nextSibling;return j(k,"stroke-dasharray",`${t} ${t}`),d(()=>j(k,"stroke-dashoffset",c())),i})()}function Z(e){const t=g(),r=o(()=>t.usedTokens/t.maxTokens),c=o(()=>D.format(r()));return n(M,{get children(){return n(a,{get when(){return!e.children},get fallback(){return e.children},get children(){return n(E,{type:"button",variant:"ghost",get class(){return e.class},get children(){return[(()=>{var i=R();return s(i,c),i})(),n(Y,{})]}})}})}})}function ee(e){return n($,{get class(){return h("min-w-60 divide-y divide-border overflow-hidden",e.class)},get children(){return e.children}})}function te(e){const t=g(),r=o(()=>t.usedTokens/t.maxTokens),c=o(()=>D.format(r())),i=o(()=>y.format(t.usedTokens)),p=o(()=>y.format(t.maxTokens)),k=o(()=>{const l=r();return l>t.dangerThreshold?"danger":l>t.warnThreshold?"warn":"ok"}),F=o(()=>{const l=k();return l==="danger"?"error":l==="warn"?"warning":"primary"});return(()=>{var l=T();return s(l,n(a,{get when(){return!e.children},get fallback(){return e.children},get children(){return[(()=>{var m=q(),C=m.firstChild,w=C.nextSibling,U=w.firstChild;return s(C,c),s(w,i,U),s(w,p,null),m})(),(()=>{var m=z();return s(m,n(G,{get value(){return t.usedTokens},get max(){return t.maxTokens},get tone(){return F()},"aria-label":"Context usage"})),m})()]}})),d(()=>f(l,h("w-full space-y-2 p-3",e.class))),l})()}function re(e){return(()=>{var t=T();return s(t,()=>e.children),d(()=>f(t,h("w-full p-3",e.class))),t})()}function ne(e){const t=g(),r=o(()=>_.format(t.estimatedCost??0));return(()=>{var c=T();return s(c,n(a,{get when(){return!e.children},get fallback(){return e.children},get children(){return[A(),(()=>{var i=S();return s(i,r),i})()]}})),d(()=>f(c,h("flex w-full items-center justify-between gap-3 bg-muted p-3 text-xs",e.class))),c})()}function x(e){return(()=>{var t=S();return s(t,(()=>{var r=B(()=>e.tokens===void 0);return()=>r()?"\u2014":y.format(e.tokens)})()),t})()}function se(e){const t=g();return n(a,{get when(){return e.children||t.inputTokens},get children(){return n(a,{get when(){return!e.children},get fallback(){return e.children},get children(){var r=J();return r.firstChild,s(r,n(x,{get tokens(){return t.inputTokens}}),null),d(()=>f(r,h("flex items-center justify-between text-xs",e.class))),r}})}})}function oe(e){const t=g();return n(a,{get when(){return e.children||t.outputTokens},get children(){return n(a,{get when(){return!e.children},get fallback(){return e.children},get children(){var r=K();return r.firstChild,s(r,n(x,{get tokens(){return t.outputTokens}}),null),d(()=>f(r,h("flex items-center justify-between text-xs",e.class))),r}})}})}function ae(e){const t=g();return n(a,{get when(){return e.children||t.reasoningTokens},get children(){return n(a,{get when(){return!e.children},get fallback(){return e.children},get children(){var r=L();return r.firstChild,s(r,n(x,{get tokens(){return t.reasoningTokens}}),null),d(()=>f(r,h("flex items-center justify-between text-xs",e.class))),r}})}})}function ue(e){const t=g();return n(a,{get when(){return e.children||t.cacheTokens},get children(){return n(a,{get when(){return!e.children},get fallback(){return e.children},get children(){var r=Q();return r.firstChild,s(r,n(x,{get tokens(){return t.cacheTokens}}),null),d(()=>f(r,h("flex items-center justify-between text-xs",e.class))),r}})}})}export{X as C,v as D,Z as a,ee as b,te as c,re as d,se as e,oe as f,ne as g,W as h,ae as i,ue as j,b as k};
1
+ import{k as o,c as n,S as a,i as s,a as d,b as f,G as N,H as P,t as u,d as j,m as B}from"./define-B3OpsIDE.js";import{H,a as M,b as $}from"./hover-card-C5ptzZOZ.js";import{c as h}from"./cn-DN5AWfiS.js";import{B as E}from"./button-BM0YTTDQ.js";import{P as G}from"./progress-bar-D-aQfy5h.js";var O=u('<svg aria-label="Model context usage"height=20 role=img viewBox="0 0 24 24"width=20 style=color:currentcolor><circle cx=12 cy=12 fill=none opacity=0.25 r=10 stroke=currentColor stroke-width=2></circle><circle cx=12 cy=12 fill=none opacity=0.7 r=10 stroke=currentColor stroke-linecap=round stroke-width=2 style=transform:rotate(-90deg);transform-origin:center>'),R=u('<span class="font-medium text-muted-foreground">'),q=u('<div class="flex items-center justify-between gap-3 text-xs"><p></p><p class="font-mono text-muted-foreground"> / '),z=u("<div class=space-y-2>"),T=u("<div>"),A=u("<span class=text-muted-foreground>Total cost"),S=u("<span>"),J=u("<div><span class=text-muted-foreground>Input"),K=u("<div><span class=text-muted-foreground>Output"),L=u("<div><span class=text-muted-foreground>Reasoning"),Q=u("<div><span class=text-muted-foreground>Cache");const V=10,v=.7,b=.9;function W(e,t=v,r=b){return e>r?"danger":e>t?"warn":"ok"}const I=N();function g(){const e=P(I);if(!e)throw new Error("Context components must be used within Context");return e}const y=new Intl.NumberFormat("en-US",{notation:"compact"}),D=new Intl.NumberFormat("en-US",{maximumFractionDigits:1,style:"percent"}),_=new Intl.NumberFormat("en-US",{currency:"USD",style:"currency"});function X(e){const t=o(()=>({usedTokens:e.usedTokens,maxTokens:e.maxTokens,inputTokens:e.inputTokens,outputTokens:e.outputTokens,reasoningTokens:e.reasoningTokens,cacheTokens:e.cacheTokens,estimatedCost:e.estimatedCost,warnThreshold:e.warnThreshold??v,dangerThreshold:e.dangerThreshold??b}));return n(I.Provider,{get value(){return t()},get children(){return n(H,{openDelay:0,get children(){return e.children}})}})}function Y(){const e=g(),t=2*Math.PI*V,r=o(()=>e.usedTokens/e.maxTokens),c=o(()=>t*(1-r()));return(()=>{var i=O(),p=i.firstChild,k=p.nextSibling;return j(k,"stroke-dasharray",`${t} ${t}`),d(()=>j(k,"stroke-dashoffset",c())),i})()}function Z(e){const t=g(),r=o(()=>t.usedTokens/t.maxTokens),c=o(()=>D.format(r()));return n(M,{get children(){return n(a,{get when(){return!e.children},get fallback(){return e.children},get children(){return n(E,{type:"button",variant:"ghost",get class(){return e.class},get children(){return[(()=>{var i=R();return s(i,c),i})(),n(Y,{})]}})}})}})}function ee(e){return n($,{get class(){return h("min-w-60 divide-y divide-border overflow-hidden",e.class)},get children(){return e.children}})}function te(e){const t=g(),r=o(()=>t.usedTokens/t.maxTokens),c=o(()=>D.format(r())),i=o(()=>y.format(t.usedTokens)),p=o(()=>y.format(t.maxTokens)),k=o(()=>{const l=r();return l>t.dangerThreshold?"danger":l>t.warnThreshold?"warn":"ok"}),F=o(()=>{const l=k();return l==="danger"?"error":l==="warn"?"warning":"primary"});return(()=>{var l=T();return s(l,n(a,{get when(){return!e.children},get fallback(){return e.children},get children(){return[(()=>{var m=q(),C=m.firstChild,w=C.nextSibling,U=w.firstChild;return s(C,c),s(w,i,U),s(w,p,null),m})(),(()=>{var m=z();return s(m,n(G,{get value(){return t.usedTokens},get max(){return t.maxTokens},get tone(){return F()},"aria-label":"Context usage"})),m})()]}})),d(()=>f(l,h("w-full space-y-2 p-3",e.class))),l})()}function re(e){return(()=>{var t=T();return s(t,()=>e.children),d(()=>f(t,h("w-full p-3",e.class))),t})()}function ne(e){const t=g(),r=o(()=>_.format(t.estimatedCost??0));return(()=>{var c=T();return s(c,n(a,{get when(){return!e.children},get fallback(){return e.children},get children(){return[A(),(()=>{var i=S();return s(i,r),i})()]}})),d(()=>f(c,h("flex w-full items-center justify-between gap-3 bg-muted p-3 text-xs",e.class))),c})()}function x(e){return(()=>{var t=S();return s(t,(()=>{var r=B(()=>e.tokens===void 0);return()=>r()?"\u2014":y.format(e.tokens)})()),t})()}function se(e){const t=g();return n(a,{get when(){return e.children||t.inputTokens},get children(){return n(a,{get when(){return!e.children},get fallback(){return e.children},get children(){var r=J();return r.firstChild,s(r,n(x,{get tokens(){return t.inputTokens}}),null),d(()=>f(r,h("flex items-center justify-between text-xs",e.class))),r}})}})}function oe(e){const t=g();return n(a,{get when(){return e.children||t.outputTokens},get children(){return n(a,{get when(){return!e.children},get fallback(){return e.children},get children(){var r=K();return r.firstChild,s(r,n(x,{get tokens(){return t.outputTokens}}),null),d(()=>f(r,h("flex items-center justify-between text-xs",e.class))),r}})}})}function ae(e){const t=g();return n(a,{get when(){return e.children||t.reasoningTokens},get children(){return n(a,{get when(){return!e.children},get fallback(){return e.children},get children(){var r=L();return r.firstChild,s(r,n(x,{get tokens(){return t.reasoningTokens}}),null),d(()=>f(r,h("flex items-center justify-between text-xs",e.class))),r}})}})}function ue(e){const t=g();return n(a,{get when(){return e.children||t.cacheTokens},get children(){return n(a,{get when(){return!e.children},get fallback(){return e.children},get children(){var r=Q();return r.firstChild,s(r,n(x,{get tokens(){return t.cacheTokens}}),null),d(()=>f(r,h("flex items-center justify-between text-xs",e.class))),r}})}})}export{X as C,v as D,Z as a,ee as b,te as c,re as d,se as e,oe as f,ne as g,W as h,ae as i,ue as j,b as k};
@@ -0,0 +1 @@
1
+ import{g as c}from"./define-B3OpsIDE.js";function i(t,o){const[r,n]=c(o);return[()=>t()??r(),a=>n(a)]}export{i as c};
@@ -1 +1 @@
1
- import{s as k,i as o,c as u,S as v,a as g,d,b as m,t as c,k as $,e as C}from"./define-CI0y3eE4.js";import{c as l}from"./cn-DN5AWfiS.js";import{m as M}from"./message-square-BLbsd9BJ.js";var S=c('<span part=leading class="flex shrink-0 items-center text-muted-foreground">'),D=c('<div part=meta class="mt-0.5 truncate text-xs text-muted-foreground">'),I=c('<span part=menu data-kai-item-menu class="ml-auto flex shrink-0 items-center">'),R=c('<div part=row><div part=body role=button data-kai-item-body class="flex min-w-0 flex-1 cursor-pointer items-center gap-2.5 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"><div class="min-w-0 flex-1"><div part=title>'),y=c('<span part=trailing class="ml-auto shrink-0 text-xs text-muted-foreground">'),j=c('<div class="flex items-center gap-2.5"><span>'),E=c("<button>"),q=c('<div class="flex items-center gap-2"><div>'),z=c("<div> messages");function N(s,t=Date.now()){if(!s)return"";const n=Date.parse(s);if(Number.isNaN(n))return"";const i=Math.max(0,Math.round((t-n)/1e3));if(i<60)return"just now";const r=Math.floor(i/60);if(r<60)return`${r}m ago`;const a=Math.floor(r/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function B(s){if(!s.lastReadAt)return!1;const t=Date.parse(s.updatedAt),n=Date.parse(s.lastReadAt);return Number.isNaN(t)||Number.isNaN(n)?!1:t>n}function F(s){const[t]=k(s,["conversationId","active","compact","leading","meta","menu","children","hostSemantics","onActivate","class"]);return(()=>{var n=R(),i=n.firstChild,r=i.firstChild,a=r.firstChild;return i.$$keydown=e=>{t.onActivate&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),t.onActivate())},i.$$click=()=>{var e;return(e=t.onActivate)==null?void 0:e.call(t)},o(i,u(v,{get when(){return t.leading},get children(){var e=S();return o(e,()=>t.leading),e}}),r),o(a,()=>t.children),o(r,u(v,{get when(){return t.meta},get children(){var e=D();return o(e,()=>t.meta),e}}),null),o(n,u(v,{get when(){return t.menu},get children(){var e=I();return o(e,()=>t.menu),e}}),null),g(e=>{var f=t.hostSemantics?"presentation":"listitem",x=t.active?"":void 0,p=t.conversationId,h=l("flex w-full items-center gap-2.5 rounded-lg text-left transition-colors",t.compact?"px-2.5 py-1.5":"px-2.5 py-2",t.active?"bg-muted":"hover:bg-muted/50",t.class),b=t.active?"true":"false",w=t.onActivate?0:void 0,A=l("truncate text-sm",t.active?"font-medium text-foreground":"text-foreground/80");return f!==e.e&&d(n,"role",e.e=f),x!==e.t&&d(n,"data-active",e.t=x),p!==e.a&&d(n,"data-conversation-id",e.a=p),h!==e.o&&m(n,e.o=h),b!==e.i&&d(i,"aria-current",e.i=b),w!==e.n&&d(i,"tabindex",e.n=w),A!==e.s&&m(a,e.s=A),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),n})()}function U(s){const[t]=k(s,["conversation","isActive","onSelect","compact","class"]),n=$(()=>t.conversation.trailing??N(t.conversation.updatedAt??t.conversation.lastMessageAt));return(()=>{var i=E();return i.$$click=()=>t.onSelect(t.conversation.id),o(i,u(v,{get when(){return t.compact},get fallback(){return[(()=>{var r=q(),a=r.firstChild;return o(a,()=>t.conversation.title),o(r,u(v,{get when(){return n()},get children(){var e=y();return o(e,n),e}}),null),g(()=>m(a,l("min-w-0 flex-1 truncate text-sm",t.isActive?"font-medium text-foreground":"text-foreground/80"))),r})(),(()=>{var r=z(),a=r.firstChild;return o(r,()=>t.conversation.messageCount,a),g(()=>m(r,l("mt-0.5 truncate text-xs",t.isActive?"text-foreground/70":"text-muted-foreground"))),r})()]},get children(){var r=j(),a=r.firstChild;return o(r,u(M,{get class(){return l("size-3.5 shrink-0",t.isActive?"text-foreground":"text-muted-foreground")}}),a),o(a,()=>t.conversation.title),o(r,u(v,{get when(){return n()},get children(){var e=y();return o(e,n),e}}),null),g(()=>m(a,l("min-w-0 flex-1 truncate text-sm",t.isActive?"font-medium text-foreground":"text-foreground/80"))),r}})),g(r=>{var a=t.conversation.id,e=t.isActive?"true":void 0,f=l("w-full rounded-lg text-left transition-colors",t.compact?"px-2.5 py-1.5":"px-2.5 py-2",t.isActive?"bg-muted":"hover:bg-muted/50",t.class);return a!==r.e&&d(i,"data-conversation-id",r.e=a),e!==r.t&&d(i,"aria-current",r.t=e),f!==r.a&&m(i,r.a=f),r},{e:void 0,t:void 0,a:void 0}),i})()}C(["click","keydown"]);export{U as C,F as S,B as i,N as r};
1
+ import{s as k,i as o,c as u,S as v,a as g,d,b as m,t as c,k as $,e as C}from"./define-B3OpsIDE.js";import{c as l}from"./cn-DN5AWfiS.js";import{m as M}from"./message-square-BXNBKC6i.js";var S=c('<span part=leading class="flex shrink-0 items-center text-muted-foreground">'),D=c('<div part=meta class="mt-0.5 truncate text-xs text-muted-foreground">'),I=c('<span part=menu data-kai-item-menu class="ml-auto flex shrink-0 items-center">'),R=c('<div part=row><div part=body role=button data-kai-item-body class="flex min-w-0 flex-1 cursor-pointer items-center gap-2.5 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"><div class="min-w-0 flex-1"><div part=title>'),y=c('<span part=trailing class="ml-auto shrink-0 text-xs text-muted-foreground">'),j=c('<div class="flex items-center gap-2.5"><span>'),E=c("<button>"),q=c('<div class="flex items-center gap-2"><div>'),z=c("<div> messages");function N(s,t=Date.now()){if(!s)return"";const n=Date.parse(s);if(Number.isNaN(n))return"";const i=Math.max(0,Math.round((t-n)/1e3));if(i<60)return"just now";const r=Math.floor(i/60);if(r<60)return`${r}m ago`;const a=Math.floor(r/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function B(s){if(!s.lastReadAt)return!1;const t=Date.parse(s.updatedAt),n=Date.parse(s.lastReadAt);return Number.isNaN(t)||Number.isNaN(n)?!1:t>n}function F(s){const[t]=k(s,["conversationId","active","compact","leading","meta","menu","children","hostSemantics","onActivate","class"]);return(()=>{var n=R(),i=n.firstChild,r=i.firstChild,a=r.firstChild;return i.$$keydown=e=>{t.onActivate&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),t.onActivate())},i.$$click=()=>{var e;return(e=t.onActivate)==null?void 0:e.call(t)},o(i,u(v,{get when(){return t.leading},get children(){var e=S();return o(e,()=>t.leading),e}}),r),o(a,()=>t.children),o(r,u(v,{get when(){return t.meta},get children(){var e=D();return o(e,()=>t.meta),e}}),null),o(n,u(v,{get when(){return t.menu},get children(){var e=I();return o(e,()=>t.menu),e}}),null),g(e=>{var f=t.hostSemantics?"presentation":"listitem",x=t.active?"":void 0,p=t.conversationId,h=l("flex w-full items-center gap-2.5 rounded-lg text-left transition-colors",t.compact?"px-2.5 py-1.5":"px-2.5 py-2",t.active?"bg-muted":"hover:bg-muted/50",t.class),b=t.active?"true":"false",w=t.onActivate?0:void 0,A=l("truncate text-sm",t.active?"font-medium text-foreground":"text-foreground/80");return f!==e.e&&d(n,"role",e.e=f),x!==e.t&&d(n,"data-active",e.t=x),p!==e.a&&d(n,"data-conversation-id",e.a=p),h!==e.o&&m(n,e.o=h),b!==e.i&&d(i,"aria-current",e.i=b),w!==e.n&&d(i,"tabindex",e.n=w),A!==e.s&&m(a,e.s=A),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),n})()}function U(s){const[t]=k(s,["conversation","isActive","onSelect","compact","class"]),n=$(()=>t.conversation.trailing??N(t.conversation.updatedAt??t.conversation.lastMessageAt));return(()=>{var i=E();return i.$$click=()=>t.onSelect(t.conversation.id),o(i,u(v,{get when(){return t.compact},get fallback(){return[(()=>{var r=q(),a=r.firstChild;return o(a,()=>t.conversation.title),o(r,u(v,{get when(){return n()},get children(){var e=y();return o(e,n),e}}),null),g(()=>m(a,l("min-w-0 flex-1 truncate text-sm",t.isActive?"font-medium text-foreground":"text-foreground/80"))),r})(),(()=>{var r=z(),a=r.firstChild;return o(r,()=>t.conversation.messageCount,a),g(()=>m(r,l("mt-0.5 truncate text-xs",t.isActive?"text-foreground/70":"text-muted-foreground"))),r})()]},get children(){var r=j(),a=r.firstChild;return o(r,u(M,{get class(){return l("size-3.5 shrink-0",t.isActive?"text-foreground":"text-muted-foreground")}}),a),o(a,()=>t.conversation.title),o(r,u(v,{get when(){return n()},get children(){var e=y();return o(e,n),e}}),null),g(()=>m(a,l("min-w-0 flex-1 truncate text-sm",t.isActive?"font-medium text-foreground":"text-foreground/80"))),r}})),g(r=>{var a=t.conversation.id,e=t.isActive?"true":void 0,f=l("w-full rounded-lg text-left transition-colors",t.compact?"px-2.5 py-1.5":"px-2.5 py-2",t.isActive?"bg-muted":"hover:bg-muted/50",t.class);return a!==r.e&&d(i,"data-conversation-id",r.e=a),e!==r.t&&d(i,"aria-current",r.t=e),f!==r.a&&m(i,r.a=f),r},{e:void 0,t:void 0,a:void 0}),i})()}C(["click","keydown"]);export{U as C,F as S,B as i,N as r};
@@ -1 +1 @@
1
- import{c as a,q as M,s as z,g as N,k as x,o as O,i as h,S as f,u as T,a as k,F as C,m as j,b as q,t as d,d as K,e as L}from"./define-CI0y3eE4.js";import{c as S}from"./cn-DN5AWfiS.js";import{a as P,b as R,C as U}from"./collapsible-Bhc636Cf.js";import{B as I}from"./button-C_3te6fm.js";import{B as F}from"./badge-Dh_vp8A5.js";import{S as B}from"./scroll-area-zRyXoLhI.js";import{C as D}from"./conversation-item-BsOsVGmT.js";import{I as H}from"./Icon-BzBET3E-.js";var G=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],J=i=>a(H,M(i,{name:"PanelLeftOpen",iconNode:G})),Q=J,V=d('<div class="px-3 pb-2"><div class="flex items-center gap-2 rounded-md bg-surface-strong px-2.5 py-1.5"><svg width=13 height=13 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 class=text-muted-foreground><circle cx=11 cy=11 r=8></circle><line x1=21 y1=21 x2=16.65 y2=16.65></line></svg><input type=text placeholder="Search chats..."aria-label="Search chats"class="bg-transparent text-compact text-foreground placeholder:text-muted-foreground rounded-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring w-full">'),W=d('<div role=list aria-label=Conversations part=items class="space-y-0.5 py-1">'),X=d('<div class="flex flex-1 flex-col items-center justify-center gap-1 p-6 text-center text-sm text-muted-foreground">No conversations match your search'),Y=d('<div class="space-y-0.5 py-1">'),Z=d('<div class="shrink-0 border-t border-border">'),_=d("<div>"),ee=d('<svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><line x1=3 y1=12 x2=21 y2=12></line><line x1=3 y1=6 x2=21 y2=6></line><line x1=3 y1=18 x2=21 y2=18>'),te=d('<svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><line x1=12 y1=5 x2=12 y2=19></line><line x1=5 y1=12 x2=19 y2=12>'),re=d('<div class="flex items-center justify-between p-3 pb-2"><div class="flex items-center gap-2"><span class="text-sm font-semibold text-foreground">Chats'),ne=d('<div class="flex flex-1 flex-col items-center justify-center gap-1 p-6 text-center text-sm text-muted-foreground">No conversations yet'),oe=d('<svg width=10 height=10 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><polyline points="6 9 12 15 18 9">'),ae=d("<span>"),ie=d('<div class="pl-2 mt-0.5 space-y-0.5">');function le(i){return a(I,{variant:"ghost",size:"icon-sm","aria-label":"Open sidebar",get class(){return S("rounded-full bg-card/80 shadow-sm backdrop-blur",i.class)},get onClick(){return i.onExpand},get children(){return a(Q,{class:"size-4"})}})}function w(i){const e=i.conversationId;return typeof e=="string"&&e?e:i.getAttribute("conversation-id")??i.id}function ce(i){var e;return((e=i.parentElement)==null?void 0:e.localName)!=="kai-conversations"}function se(i){const e=n=>{const r=i.getItems();return n.composedPath().find(c=>r.includes(c))},p=n=>{var r;return((r=n.shadowRoot)==null?void 0:r.querySelector("[data-kai-item-body]"))??n},u=n=>n.composedPath().some(r=>r instanceof Element&&(r.hasAttribute("data-kai-item-menu")||r.getAttribute("slot")==="menu")),m=(n,r,c)=>{n.getAttribute(r)!==c&&n.setAttribute(r,c)},y=n=>{const r=new Map;for(const c of n){const s=p(c);s===c&&c.localName.includes("-")||r.set(c,s)}return r},v=(n,r)=>{for(const[c,s]of y(n))m(s,"tabindex",c===r?"0":"-1")};return{sync:()=>{const n=i.getItems(),r=i.getActiveId(),c=y(n);let s;for(const[o,t]of c){const l=r!==void 0&&w(o)===r;t.hasAttribute("role")||t.setAttribute("role","button"),m(t,"aria-current",l?"true":"false");const g=o;g.active!==l&&(g.active=l),l&&(s=o)}v(n,s??c.keys().next().value)},handleClick(n){const r=e(n);!r||u(n)||i.onSelect(w(r))},handleKeyDown(n){const r=i.getItems();if(r.length===0)return;const c=e(n);if(n.key==="Enter"||n.key===" "){if(!c||u(n))return;n.preventDefault(),i.onSelect(w(c));return}let s;const o=c?r.indexOf(c):r.findIndex(t=>p(t).getAttribute("tabindex")==="0");n.key==="ArrowDown"?s=r[Math.min(o+1,r.length-1)]:n.key==="ArrowUp"?s=r[Math.max(o-1,0)]:n.key==="Home"?s=r[0]:n.key==="End"&&(s=r[r.length-1]),s&&(n.preventDefault(),v(r,s),p(s).focus())}}}function ue(i){const[e]=z(i,["groups","conversations","activeId","onSelect","onNewChat","onToggleSidebar","header","footer","empty","compact","onSearchChange","controllerRef","items","itemsKeyDown","itemsClick","class"]),[p,u]=N(""),m=x(()=>e.items!=null),y=x(()=>e.conversations.length===0);let v;const n=o=>{var t;u(o),(t=e.onSearchChange)==null||t.call(e,o)};O(()=>{var o;(o=e.controllerRef)==null||o.call(e,{focus:t=>v?.focus(t),clearSearch:()=>n("")})});const r=x(()=>{const o=p().toLowerCase();return o?e.conversations.filter(t=>t.title.toLowerCase().includes(o)):e.conversations}),c=x(()=>{const o=new Map;for(const t of r()){const l=t.groupId;o.has(l)||o.set(l,[]),o.get(l).push(t)}return o}),s=x(()=>{const o=new Set((e.groups??[]).map(t=>t.id));return r().filter(t=>t.groupId==null||!o.has(t.groupId))});return(()=>{var o=_();return h(o,a(f,{get when(){return e.header},get fallback(){return(()=>{var t=re(),l=t.firstChild,g=l.firstChild;return h(l,a(I,{variant:"ghost",size:"icon-sm","aria-label":"Toggle sidebar",get onClick(){return e.onToggleSidebar},get children(){return ee()}}),g),h(t,a(I,{variant:"ghost",size:"icon-sm","aria-label":"New chat",get onClick(){return e.onNewChat},get children(){return te()}}),null),t})()},get children(){return e.header}}),null),h(o,a(f,{get when(){return m()||!y()},get children(){var t=V(),l=t.firstChild,g=l.firstChild,b=g.nextSibling;b.$$input=E=>n(E.currentTarget.value);var A=v;return typeof A=="function"?T(A,b):v=b,k(()=>b.value=p()),t}}),null),h(o,a(f,{get when(){return m()},get children(){return a(B,{class:"flex-1 px-2",get children(){var t=W();return t.$$click=l=>{var g;return(g=e.itemsClick)==null?void 0:g.call(e,l)},t.$$keydown=l=>{var g;return(g=e.itemsKeyDown)==null?void 0:g.call(e,l)},h(t,()=>e.items),t}})}}),null),h(o,a(f,{get when(){return j(()=>!m())()&&!y()},get fallback(){return a(f,{get when(){return!m()},get children(){return a(f,{get when(){return e.empty},get fallback(){return ne()},get children(){return e.empty}})}})},get children(){return[a(f,{get when(){return r().length===0},get children(){return X()}}),a(f,{get when(){return r().length>0},get children(){return a(B,{class:"flex-1 px-2",get children(){return[a(C,{get each(){return e.groups},children:t=>{const l=x(()=>c().get(t.id)??[]);return a(f,{get when(){return l().length>0},get children(){return a($,{get name(){return t.name},get count(){return l().length},get conversations(){return l()},get activeId(){return e.activeId},get onSelect(){return e.onSelect},get compact(){return e.compact}})}})}}),a(f,{get when(){return s().length>0},get children(){return a(f,{get when(){return e.compact},get fallback(){return a($,{name:"Ungrouped",get count(){return s().length},get conversations(){return s()},get activeId(){return e.activeId},get onSelect(){return e.onSelect}})},get children(){var t=Y();return h(t,a(C,{get each(){return s()},children:l=>a(D,{conversation:l,get isActive(){return l.id===e.activeId},get onSelect(){return e.onSelect},compact:!0})})),t}})}})]}})}})]}}),null),h(o,a(f,{get when(){return e.footer},get children(){var t=Z();return h(t,()=>e.footer),t}}),null),k(()=>q(o,S("flex flex-col h-full bg-sidebar",e.class))),o})()}function $(i){const[e,p]=N(!0);return a(U,{get open(){return e()},onOpenChange:p,get children(){return[a(P,{class:"flex items-center gap-1.5 w-full px-1.5 py-1 rounded-md text-compact text-muted-foreground font-medium hover:bg-muted/30 transition-colors cursor-pointer mt-1.5",get children(){return[(()=>{var u=oe();return k(()=>K(u,"class",S("transition-transform",!e()&&"-rotate-90"))),u})(),(()=>{var u=ae();return h(u,()=>i.name),u})(),a(F,{variant:"count",class:"ml-auto text-caption",get children(){return i.count}})]}}),a(R,{get children(){var u=ie();return h(u,a(C,{get each(){return i.conversations},children:m=>a(D,{conversation:m,get isActive(){return m.id===i.activeId},get onSelect(){return i.onSelect},get compact(){return i.compact}})})),u}})]}})}L(["input","keydown","click"]);export{ue as C,le as a,se as c,ce as i,w as r};
1
+ import{c as a,q as M,s as z,g as N,k as x,o as O,i as h,S as f,u as T,a as k,F as C,m as j,b as q,t as d,d as K,e as L}from"./define-B3OpsIDE.js";import{c as S}from"./cn-DN5AWfiS.js";import{a as P,b as R,C as U}from"./collapsible-CBq1Tj6y.js";import{B as I}from"./button-BM0YTTDQ.js";import{B as F}from"./badge-BGm7pcwi.js";import{S as B}from"./scroll-area-RrKnLYlA.js";import{C as D}from"./conversation-item-piXZFRWa.js";import{I as H}from"./Icon-DJDuE_-x.js";var G=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],J=i=>a(H,M(i,{name:"PanelLeftOpen",iconNode:G})),Q=J,V=d('<div class="px-3 pb-2"><div class="flex items-center gap-2 rounded-md bg-surface-strong px-2.5 py-1.5"><svg width=13 height=13 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 class=text-muted-foreground><circle cx=11 cy=11 r=8></circle><line x1=21 y1=21 x2=16.65 y2=16.65></line></svg><input type=text placeholder="Search chats..."aria-label="Search chats"class="bg-transparent text-compact text-foreground placeholder:text-muted-foreground rounded-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring w-full">'),W=d('<div role=list aria-label=Conversations part=items class="space-y-0.5 py-1">'),X=d('<div class="flex flex-1 flex-col items-center justify-center gap-1 p-6 text-center text-sm text-muted-foreground">No conversations match your search'),Y=d('<div class="space-y-0.5 py-1">'),Z=d('<div class="shrink-0 border-t border-border">'),_=d("<div>"),ee=d('<svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><line x1=3 y1=12 x2=21 y2=12></line><line x1=3 y1=6 x2=21 y2=6></line><line x1=3 y1=18 x2=21 y2=18>'),te=d('<svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><line x1=12 y1=5 x2=12 y2=19></line><line x1=5 y1=12 x2=19 y2=12>'),re=d('<div class="flex items-center justify-between p-3 pb-2"><div class="flex items-center gap-2"><span class="text-sm font-semibold text-foreground">Chats'),ne=d('<div class="flex flex-1 flex-col items-center justify-center gap-1 p-6 text-center text-sm text-muted-foreground">No conversations yet'),oe=d('<svg width=10 height=10 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><polyline points="6 9 12 15 18 9">'),ae=d("<span>"),ie=d('<div class="pl-2 mt-0.5 space-y-0.5">');function le(i){return a(I,{variant:"ghost",size:"icon-sm","aria-label":"Open sidebar",get class(){return S("rounded-full bg-card/80 shadow-sm backdrop-blur",i.class)},get onClick(){return i.onExpand},get children(){return a(Q,{class:"size-4"})}})}function w(i){const e=i.conversationId;return typeof e=="string"&&e?e:i.getAttribute("conversation-id")??i.id}function ce(i){var e;return((e=i.parentElement)==null?void 0:e.localName)!=="kai-conversations"}function se(i){const e=n=>{const r=i.getItems();return n.composedPath().find(c=>r.includes(c))},p=n=>{var r;return((r=n.shadowRoot)==null?void 0:r.querySelector("[data-kai-item-body]"))??n},u=n=>n.composedPath().some(r=>r instanceof Element&&(r.hasAttribute("data-kai-item-menu")||r.getAttribute("slot")==="menu")),m=(n,r,c)=>{n.getAttribute(r)!==c&&n.setAttribute(r,c)},y=n=>{const r=new Map;for(const c of n){const s=p(c);s===c&&c.localName.includes("-")||r.set(c,s)}return r},v=(n,r)=>{for(const[c,s]of y(n))m(s,"tabindex",c===r?"0":"-1")};return{sync:()=>{const n=i.getItems(),r=i.getActiveId(),c=y(n);let s;for(const[o,t]of c){const l=r!==void 0&&w(o)===r;t.hasAttribute("role")||t.setAttribute("role","button"),m(t,"aria-current",l?"true":"false");const g=o;g.active!==l&&(g.active=l),l&&(s=o)}v(n,s??c.keys().next().value)},handleClick(n){const r=e(n);!r||u(n)||i.onSelect(w(r))},handleKeyDown(n){const r=i.getItems();if(r.length===0)return;const c=e(n);if(n.key==="Enter"||n.key===" "){if(!c||u(n))return;n.preventDefault(),i.onSelect(w(c));return}let s;const o=c?r.indexOf(c):r.findIndex(t=>p(t).getAttribute("tabindex")==="0");n.key==="ArrowDown"?s=r[Math.min(o+1,r.length-1)]:n.key==="ArrowUp"?s=r[Math.max(o-1,0)]:n.key==="Home"?s=r[0]:n.key==="End"&&(s=r[r.length-1]),s&&(n.preventDefault(),v(r,s),p(s).focus())}}}function ue(i){const[e]=z(i,["groups","conversations","activeId","onSelect","onNewChat","onToggleSidebar","header","footer","empty","compact","onSearchChange","controllerRef","items","itemsKeyDown","itemsClick","class"]),[p,u]=N(""),m=x(()=>e.items!=null),y=x(()=>e.conversations.length===0);let v;const n=o=>{var t;u(o),(t=e.onSearchChange)==null||t.call(e,o)};O(()=>{var o;(o=e.controllerRef)==null||o.call(e,{focus:t=>v?.focus(t),clearSearch:()=>n("")})});const r=x(()=>{const o=p().toLowerCase();return o?e.conversations.filter(t=>t.title.toLowerCase().includes(o)):e.conversations}),c=x(()=>{const o=new Map;for(const t of r()){const l=t.groupId;o.has(l)||o.set(l,[]),o.get(l).push(t)}return o}),s=x(()=>{const o=new Set((e.groups??[]).map(t=>t.id));return r().filter(t=>t.groupId==null||!o.has(t.groupId))});return(()=>{var o=_();return h(o,a(f,{get when(){return e.header},get fallback(){return(()=>{var t=re(),l=t.firstChild,g=l.firstChild;return h(l,a(I,{variant:"ghost",size:"icon-sm","aria-label":"Toggle sidebar",get onClick(){return e.onToggleSidebar},get children(){return ee()}}),g),h(t,a(I,{variant:"ghost",size:"icon-sm","aria-label":"New chat",get onClick(){return e.onNewChat},get children(){return te()}}),null),t})()},get children(){return e.header}}),null),h(o,a(f,{get when(){return m()||!y()},get children(){var t=V(),l=t.firstChild,g=l.firstChild,b=g.nextSibling;b.$$input=E=>n(E.currentTarget.value);var A=v;return typeof A=="function"?T(A,b):v=b,k(()=>b.value=p()),t}}),null),h(o,a(f,{get when(){return m()},get children(){return a(B,{class:"flex-1 px-2",get children(){var t=W();return t.$$click=l=>{var g;return(g=e.itemsClick)==null?void 0:g.call(e,l)},t.$$keydown=l=>{var g;return(g=e.itemsKeyDown)==null?void 0:g.call(e,l)},h(t,()=>e.items),t}})}}),null),h(o,a(f,{get when(){return j(()=>!m())()&&!y()},get fallback(){return a(f,{get when(){return!m()},get children(){return a(f,{get when(){return e.empty},get fallback(){return ne()},get children(){return e.empty}})}})},get children(){return[a(f,{get when(){return r().length===0},get children(){return X()}}),a(f,{get when(){return r().length>0},get children(){return a(B,{class:"flex-1 px-2",get children(){return[a(C,{get each(){return e.groups},children:t=>{const l=x(()=>c().get(t.id)??[]);return a(f,{get when(){return l().length>0},get children(){return a($,{get name(){return t.name},get count(){return l().length},get conversations(){return l()},get activeId(){return e.activeId},get onSelect(){return e.onSelect},get compact(){return e.compact}})}})}}),a(f,{get when(){return s().length>0},get children(){return a(f,{get when(){return e.compact},get fallback(){return a($,{name:"Ungrouped",get count(){return s().length},get conversations(){return s()},get activeId(){return e.activeId},get onSelect(){return e.onSelect}})},get children(){var t=Y();return h(t,a(C,{get each(){return s()},children:l=>a(D,{conversation:l,get isActive(){return l.id===e.activeId},get onSelect(){return e.onSelect},compact:!0})})),t}})}})]}})}})]}}),null),h(o,a(f,{get when(){return e.footer},get children(){var t=Z();return h(t,()=>e.footer),t}}),null),k(()=>q(o,S("flex flex-col h-full bg-sidebar",e.class))),o})()}function $(i){const[e,p]=N(!0);return a(U,{get open(){return e()},onOpenChange:p,get children(){return[a(P,{class:"flex items-center gap-1.5 w-full px-1.5 py-1 rounded-md text-compact text-muted-foreground font-medium hover:bg-muted/30 transition-colors cursor-pointer mt-1.5",get children(){return[(()=>{var u=oe();return k(()=>K(u,"class",S("transition-transform",!e()&&"-rotate-90"))),u})(),(()=>{var u=ae();return h(u,()=>i.name),u})(),a(F,{variant:"count",class:"ml-auto text-caption",get children(){return i.count}})]}}),a(R,{get children(){var u=ie();return h(u,a(C,{get each(){return i.conversations},children:m=>a(D,{conversation:m,get isActive(){return m.id===i.activeId},get onSelect(){return i.onSelect},get compact(){return i.compact}})})),u}})]}})}L(["input","keydown","click"]);export{ue as C,le as a,se as c,ce as i,w as r};
@@ -1 +1 @@
1
- import{I as a}from"./Icon-BzBET3E-.js";import{c as o,q as c}from"./define-CI0y3eE4.js";var e=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],t=r=>o(a,c(r,{name:"Copy",iconNode:e})),i=t;export{i as c};
1
+ import{I as a}from"./Icon-DJDuE_-x.js";import{c as o,q as c}from"./define-B3OpsIDE.js";var e=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],t=r=>o(a,c(r,{name:"Copy",iconNode:e})),i=t;export{i as c};
@@ -1,4 +1,4 @@
1
- import{k as N,h as U,j as ce,z as fe,a as ye,b as Le,t as Re,u as Ie,g as ue}from"./define-CI0y3eE4.js";import{c as _e}from"./cn-DN5AWfiS.js";var Pe=Re("<canvas part=canvas>");const me="#1FD5F9";function ve(e){const n=e.trim().match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);if(!n)return ve(me);const[,o,a,l]=n;return[parseInt(o,16)/255,parseInt(a,16)/255,parseInt(l,16)/255]}const ke={"1f":"float","1i":"int","1fv":"float","2f":"vec2","3f":"vec3","3fv":"vec3","4f":"vec4","4fv":"vec4",Matrix2fv:"mat2",Matrix3fv:"mat3",Matrix4fv:"mat4"},Ce={"1fv":1,"3fv":3,"4fv":4,Matrix2fv:4,Matrix3fv:9,Matrix4fv:16};function Te(e){const n=Ce[e.type];if(!n||!Array.isArray(e.value))return;const o=e.value.length/n;return o>1&&Number.isInteger(o)?o:void 0}function he(e){return e.arraySize??Te(e)}const Oe=["uniform float iTime;","uniform vec2 iResolution;","uniform vec4 iMouse;","uniform int iFrame;","uniform vec4 iDate;"].join(`
1
+ import{k as N,h as U,j as ce,z as fe,a as ye,b as Le,t as Re,u as Ie,g as ue}from"./define-B3OpsIDE.js";import{c as _e}from"./cn-DN5AWfiS.js";var Pe=Re("<canvas part=canvas>");const me="#1FD5F9";function ve(e){const n=e.trim().match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);if(!n)return ve(me);const[,o,a,l]=n;return[parseInt(o,16)/255,parseInt(a,16)/255,parseInt(l,16)/255]}const ke={"1f":"float","1i":"int","1fv":"float","2f":"vec2","3f":"vec3","3fv":"vec3","4f":"vec4","4fv":"vec4",Matrix2fv:"mat2",Matrix3fv:"mat3",Matrix4fv:"mat4"},Ce={"1fv":1,"3fv":3,"4fv":4,Matrix2fv:4,Matrix3fv:9,Matrix4fv:16};function Te(e){const n=Ce[e.type];if(!n||!Array.isArray(e.value))return;const o=e.value.length/n;return o>1&&Number.isInteger(o)?o:void 0}function he(e){return e.arraySize??Te(e)}const Oe=["uniform float iTime;","uniform vec2 iResolution;","uniform vec4 iMouse;","uniform int iFrame;","uniform vec4 iDate;"].join(`
2
2
  `),De=`
3
3
  attribute vec3 aVertexPosition;
4
4
  void main() { gl_Position = vec4(aVertexPosition, 1.0); }
@@ -1,6 +1,6 @@
1
1
  import { ssr as Le, ssrAttribute as we, escape as ye } from "solid-js/web";
2
2
  import { createMemo as U, onCleanup as G, createEffect as ue, untrack as ve, createSignal as le } from "solid-js";
3
- import { c as Re } from "./solid-15v_3WVL.js";
3
+ import { c as Re } from "./solid-BITWG_VE.js";
4
4
  var _e = ['<canvas part="canvas"', "></canvas>"];
5
5
  const Ce = "#1FD5F9";
6
6
  function Ie(e) {
@@ -1,6 +1,6 @@
1
1
  import { effect as Le, className as ye, template as we, use as Re } from "solid-js/web";
2
2
  import { createMemo as U, onCleanup as z, createEffect as ue, untrack as ve, createSignal as le } from "solid-js";
3
- import { c as _e } from "./solid-5P-otgdi.js";
3
+ import { c as _e } from "./solid-CRFYWlBw.js";
4
4
  var Ce = /* @__PURE__ */ we("<canvas part=canvas>");
5
5
  const Ie = "#1FD5F9";
6
6
  function Te(e) {
@@ -1,4 +1,4 @@
1
- import{t as ye,u as Le,c as Re,f as Ie}from"./register-impl-DvEnhIxx.js";import{c as N,o as j,h as ce,u as fe,d as _e,i as ue}from"./kai.es.js";var Pe=ye("<canvas part=canvas>");const me="#1FD5F9";function ve(e){const n=e.trim().match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);if(!n)return ve(me);const[,o,i,l]=n;return[parseInt(o,16)/255,parseInt(i,16)/255,parseInt(l,16)/255]}const Ce={"1f":"float","1i":"int","1fv":"float","2f":"vec2","3f":"vec3","3fv":"vec3","4f":"vec4","4fv":"vec4",Matrix2fv:"mat2",Matrix3fv:"mat3",Matrix4fv:"mat4"},Te={"1fv":1,"3fv":3,"4fv":4,Matrix2fv:4,Matrix3fv:9,Matrix4fv:16};function ke(e){const n=Te[e.type];if(!n||!Array.isArray(e.value))return;const o=e.value.length/n;return o>1&&Number.isInteger(o)?o:void 0}function he(e){return e.arraySize??ke(e)}const Oe=["uniform float iTime;","uniform vec2 iResolution;","uniform vec4 iMouse;","uniform int iFrame;","uniform vec4 iDate;"].join(`
1
+ import{t as ye,u as Le,c as Re,f as Ie}from"./register-impl-WcrdIihK.js";import{c as N,o as j,h as ce,u as fe,d as _e,i as ue}from"./kai.es.js";var Pe=ye("<canvas part=canvas>");const me="#1FD5F9";function ve(e){const n=e.trim().match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);if(!n)return ve(me);const[,o,i,l]=n;return[parseInt(o,16)/255,parseInt(i,16)/255,parseInt(l,16)/255]}const Ce={"1f":"float","1i":"int","1fv":"float","2f":"vec2","3f":"vec3","3fv":"vec3","4f":"vec4","4fv":"vec4",Matrix2fv:"mat2",Matrix3fv:"mat3",Matrix4fv:"mat4"},Te={"1fv":1,"3fv":3,"4fv":4,Matrix2fv:4,Matrix3fv:9,Matrix4fv:16};function ke(e){const n=Te[e.type];if(!n||!Array.isArray(e.value))return;const o=e.value.length/n;return o>1&&Number.isInteger(o)?o:void 0}function he(e){return e.arraySize??ke(e)}const Oe=["uniform float iTime;","uniform vec2 iResolution;","uniform vec4 iMouse;","uniform int iFrame;","uniform vec4 iDate;"].join(`
2
2
  `),De=`
3
3
  attribute vec3 aVertexPosition;
4
4
  void main() { gl_Position = vec4(aVertexPosition, 1.0); }