@adea-ai/ui 0.154.0 → 0.154.2

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 (554) hide show
  1. package/README.md +10 -10
  2. package/dist/components/composites/about-dialog/about-dialog.d.ts.map +1 -1
  3. package/dist/components/composites/about-dialog/about-dialog.js +3 -1
  4. package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
  5. package/dist/components/composites/accent-picker/accent-picker.js +20 -9
  6. package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
  7. package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
  8. package/dist/components/composites/account-menu/account-menu.js +20 -10
  9. package/dist/components/composites/account-menu/account-menu.js.map +1 -1
  10. package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
  11. package/dist/components/composites/action-button/action-button.js +37 -24
  12. package/dist/components/composites/action-button/action-button.js.map +1 -1
  13. package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
  14. package/dist/components/composites/appearance-editor/appearance-choices.js +7 -3
  15. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  16. package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
  17. package/dist/components/composites/appearance-editor/appearance-editor.js +11 -6
  18. package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
  19. package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
  20. package/dist/components/composites/appearance-editor/appearance-rows.js +8 -3
  21. package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
  22. package/dist/components/composites/appearance-editor/font-settings-group.d.ts.map +1 -1
  23. package/dist/components/composites/appearance-editor/font-settings-group.js +8 -4
  24. package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
  25. package/dist/components/composites/catalog-browser/catalog-browser-group.d.ts.map +1 -1
  26. package/dist/components/composites/catalog-browser/catalog-browser-group.js +7 -3
  27. package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
  28. package/dist/components/composites/catalog-browser/catalog-browser.d.ts.map +1 -1
  29. package/dist/components/composites/catalog-browser/catalog-browser.js +8 -4
  30. package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
  31. package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts.map +1 -1
  32. package/dist/components/composites/chain-of-thought/chain-of-thought.js +3 -1
  33. package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
  34. package/dist/components/composites/chat/chat.d.ts.map +1 -1
  35. package/dist/components/composites/chat/chat.js +5 -1
  36. package/dist/components/composites/chat/chat.js.map +1 -1
  37. package/dist/components/composites/checkpoint/checkpoint.d.ts.map +1 -1
  38. package/dist/components/composites/checkpoint/checkpoint.js +3 -1
  39. package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
  40. package/dist/components/composites/confirmation/confirmation.d.ts.map +1 -1
  41. package/dist/components/composites/confirmation/confirmation.js +11 -5
  42. package/dist/components/composites/confirmation/confirmation.js.map +1 -1
  43. package/dist/components/composites/context/context.d.ts.map +1 -1
  44. package/dist/components/composites/context/context.js +7 -4
  45. package/dist/components/composites/context/context.js.map +1 -1
  46. package/dist/components/composites/file-tree/file-tree.d.ts.map +1 -1
  47. package/dist/components/composites/file-tree/file-tree.js +7 -3
  48. package/dist/components/composites/file-tree/file-tree.js.map +1 -1
  49. package/dist/components/composites/help-center/help-center.d.ts.map +1 -1
  50. package/dist/components/composites/help-center/help-center.js +3 -1
  51. package/dist/components/composites/help-center/help-center.js.map +1 -1
  52. package/dist/components/composites/icon-picker/icon-picker.d.ts +2 -2
  53. package/dist/components/composites/icon-picker/icon-picker.d.ts.map +1 -1
  54. package/dist/components/composites/icon-picker/icon-picker.js +77 -71
  55. package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
  56. package/dist/components/composites/icon-picker/shell-icons.d.ts.map +1 -1
  57. package/dist/components/composites/icon-picker/shell-icons.js +119 -59
  58. package/dist/components/composites/icon-picker/shell-icons.js.map +1 -1
  59. package/dist/components/composites/inline-citation/inline-citation.d.ts.map +1 -1
  60. package/dist/components/composites/inline-citation/inline-citation.js +5 -2
  61. package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
  62. package/dist/components/composites/list-row/list-row-control.d.ts.map +1 -1
  63. package/dist/components/composites/list-row/list-row-control.js +3 -4
  64. package/dist/components/composites/list-row/list-row-control.js.map +1 -1
  65. package/dist/components/composites/message-scroller/message-scroller.d.ts.map +1 -1
  66. package/dist/components/composites/message-scroller/message-scroller.js +5 -2
  67. package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
  68. package/dist/components/composites/model-selector/model-selector.d.ts.map +1 -1
  69. package/dist/components/composites/model-selector/model-selector.js +9 -5
  70. package/dist/components/composites/model-selector/model-selector.js.map +1 -1
  71. package/dist/components/composites/plan/plan.d.ts.map +1 -1
  72. package/dist/components/composites/plan/plan.js +3 -1
  73. package/dist/components/composites/plan/plan.js.map +1 -1
  74. package/dist/components/composites/queue/queue.d.ts.map +1 -1
  75. package/dist/components/composites/queue/queue.js +11 -5
  76. package/dist/components/composites/queue/queue.js.map +1 -1
  77. package/dist/components/composites/reasoning/reasoning.d.ts.map +1 -1
  78. package/dist/components/composites/reasoning/reasoning.js +3 -1
  79. package/dist/components/composites/reasoning/reasoning.js.map +1 -1
  80. package/dist/components/composites/scene-controls/scene-controls.d.ts.map +1 -1
  81. package/dist/components/composites/scene-controls/scene-controls.js +14 -7
  82. package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
  83. package/dist/components/composites/settings/settings.d.ts.map +1 -1
  84. package/dist/components/composites/settings/settings.js +77 -67
  85. package/dist/components/composites/settings/settings.js.map +1 -1
  86. package/dist/components/composites/sources/sources.d.ts.map +1 -1
  87. package/dist/components/composites/sources/sources.js +39 -39
  88. package/dist/components/composites/sources/sources.js.map +1 -1
  89. package/dist/components/composites/stack-trace/stack-trace.d.ts.map +1 -1
  90. package/dist/components/composites/stack-trace/stack-trace.js +9 -4
  91. package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
  92. package/dist/components/composites/stat/stat.d.ts.map +1 -1
  93. package/dist/components/composites/stat/stat.js +4 -1
  94. package/dist/components/composites/stat/stat.js.map +1 -1
  95. package/dist/components/composites/subagent/subagent.d.ts.map +1 -1
  96. package/dist/components/composites/subagent/subagent.js +3 -1
  97. package/dist/components/composites/subagent/subagent.js.map +1 -1
  98. package/dist/components/composites/task/task.d.ts.map +1 -1
  99. package/dist/components/composites/task/task.js +3 -1
  100. package/dist/components/composites/task/task.js.map +1 -1
  101. package/dist/components/composites/terminal/ansi.d.ts.map +1 -1
  102. package/dist/components/composites/terminal/ansi.js +16 -0
  103. package/dist/components/composites/terminal/ansi.js.map +1 -1
  104. package/dist/components/composites/terminal/terminal.d.ts.map +1 -1
  105. package/dist/components/composites/terminal/terminal.js +15 -7
  106. package/dist/components/composites/terminal/terminal.js.map +1 -1
  107. package/dist/components/composites/test-results/test-results.d.ts.map +1 -1
  108. package/dist/components/composites/test-results/test-results.js +15 -7
  109. package/dist/components/composites/test-results/test-results.js.map +1 -1
  110. package/dist/components/composites/tool/tool.d.ts.map +1 -1
  111. package/dist/components/composites/tool/tool.js +3 -1
  112. package/dist/components/composites/tool/tool.js.map +1 -1
  113. package/dist/components/composites/tree/tree.d.ts.map +1 -1
  114. package/dist/components/composites/tree/tree.js +3 -1
  115. package/dist/components/composites/tree/tree.js.map +1 -1
  116. package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
  117. package/dist/components/composites/update-dialog/update-dialog.js +34 -24
  118. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
  119. package/dist/components/composites/workspace-mark/workspace-mark.d.ts.map +1 -1
  120. package/dist/components/composites/workspace-mark/workspace-mark.js +17 -12
  121. package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
  122. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.d.ts.map +1 -1
  123. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +5 -2
  124. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
  125. package/dist/components/composites/workspace-switcher/workspace-switcher.d.ts.map +1 -1
  126. package/dist/components/composites/workspace-switcher/workspace-switcher.js +9 -4
  127. package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
  128. package/dist/components/conversation/busy-send-button.d.ts.map +1 -1
  129. package/dist/components/conversation/busy-send-button.js +9 -5
  130. package/dist/components/conversation/busy-send-button.js.map +1 -1
  131. package/dist/components/conversation/conversation-avatar.d.ts.map +1 -1
  132. package/dist/components/conversation/conversation-avatar.js +6 -3
  133. package/dist/components/conversation/conversation-avatar.js.map +1 -1
  134. package/dist/components/conversation/conversation-surface.d.ts.map +1 -1
  135. package/dist/components/conversation/conversation-surface.js +3 -1
  136. package/dist/components/conversation/conversation-surface.js.map +1 -1
  137. package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -1
  138. package/dist/components/conversation/internal/chat-composer-shell.js +9 -4
  139. package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
  140. package/dist/components/conversation/message-composer.d.ts.map +1 -1
  141. package/dist/components/conversation/message-composer.js +9 -4
  142. package/dist/components/conversation/message-composer.js.map +1 -1
  143. package/dist/components/conversation/message-row.d.ts.map +1 -1
  144. package/dist/components/conversation/message-row.js +11 -5
  145. package/dist/components/conversation/message-row.js.map +1 -1
  146. package/dist/components/conversation/thread-panel.d.ts.map +1 -1
  147. package/dist/components/conversation/thread-panel.js +3 -1
  148. package/dist/components/conversation/thread-panel.js.map +1 -1
  149. package/dist/components/conversation/transcript-composition.d.ts.map +1 -1
  150. package/dist/components/conversation/transcript-composition.js +3 -1
  151. package/dist/components/conversation/transcript-composition.js.map +1 -1
  152. package/dist/components/layout/floating-preview/floating-preview.d.ts.map +1 -1
  153. package/dist/components/layout/floating-preview/floating-preview.js +5 -2
  154. package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
  155. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts.map +1 -1
  156. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +3 -1
  157. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
  158. package/dist/components/layout/shell-rail/shell-rail.d.ts.map +1 -1
  159. package/dist/components/layout/shell-rail/shell-rail.js +3 -1
  160. package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
  161. package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -1
  162. package/dist/components/layout/sidebar-nav/sidebar-nav.js +3 -1
  163. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
  164. package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
  165. package/dist/components/layout/split-layout/split-layout.js +5 -2
  166. package/dist/components/layout/split-layout/split-layout.js.map +1 -1
  167. package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -1
  168. package/dist/components/layout/top-bar/top-bar.js +3 -1
  169. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  170. package/dist/components/theme/appearance-panel.d.ts.map +1 -1
  171. package/dist/components/theme/appearance-panel.js +3 -1
  172. package/dist/components/theme/appearance-panel.js.map +1 -1
  173. package/dist/components/theme/theme-mode-toggle.d.ts.map +1 -1
  174. package/dist/components/theme/theme-mode-toggle.js +6 -3
  175. package/dist/components/theme/theme-mode-toggle.js.map +1 -1
  176. package/dist/components/theme/theme-toggle.d.ts.map +1 -1
  177. package/dist/components/theme/theme-toggle.js +6 -3
  178. package/dist/components/theme/theme-toggle.js.map +1 -1
  179. package/dist/components/ui/accordion/accordion.d.ts.map +1 -1
  180. package/dist/components/ui/accordion/accordion.js +3 -1
  181. package/dist/components/ui/accordion/accordion.js.map +1 -1
  182. package/dist/components/ui/alert/alert.d.ts.map +1 -1
  183. package/dist/components/ui/alert/alert.js +15 -9
  184. package/dist/components/ui/alert/alert.js.map +1 -1
  185. package/dist/components/ui/annotation-surface/annotation-surface.d.ts.map +1 -1
  186. package/dist/components/ui/annotation-surface/annotation-surface.js +5 -4
  187. package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
  188. package/dist/components/ui/attachment/attachment.d.ts.map +1 -1
  189. package/dist/components/ui/attachment/attachment.js +18 -9
  190. package/dist/components/ui/attachment/attachment.js.map +1 -1
  191. package/dist/components/ui/badge/badge.d.ts.map +1 -1
  192. package/dist/components/ui/badge/badge.js +30 -11
  193. package/dist/components/ui/badge/badge.js.map +1 -1
  194. package/dist/components/ui/breadcrumb/breadcrumb.d.ts.map +1 -1
  195. package/dist/components/ui/breadcrumb/breadcrumb.js +5 -2
  196. package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
  197. package/dist/components/ui/button/button.d.ts.map +1 -1
  198. package/dist/components/ui/button/button.js +37 -13
  199. package/dist/components/ui/button/button.js.map +1 -1
  200. package/dist/components/ui/calendar/calendar.d.ts.map +1 -1
  201. package/dist/components/ui/calendar/calendar.js +5 -2
  202. package/dist/components/ui/calendar/calendar.js.map +1 -1
  203. package/dist/components/ui/carousel/carousel.d.ts.map +1 -1
  204. package/dist/components/ui/carousel/carousel.js +12 -6
  205. package/dist/components/ui/carousel/carousel.js.map +1 -1
  206. package/dist/components/ui/checkbox/checkbox.d.ts +13 -0
  207. package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
  208. package/dist/components/ui/checkbox/checkbox.js +296 -21
  209. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  210. package/dist/components/ui/code-block/code-block.d.ts.map +1 -1
  211. package/dist/components/ui/code-block/code-block.js +9 -6
  212. package/dist/components/ui/code-block/code-block.js.map +1 -1
  213. package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
  214. package/dist/components/ui/combobox/combobox.js +8 -11
  215. package/dist/components/ui/combobox/combobox.js.map +1 -1
  216. package/dist/components/ui/command/command.d.ts.map +1 -1
  217. package/dist/components/ui/command/command.js +4 -2
  218. package/dist/components/ui/command/command.js.map +1 -1
  219. package/dist/components/ui/detail-panel/detail-panel.d.ts.map +1 -1
  220. package/dist/components/ui/detail-panel/detail-panel.js +3 -1
  221. package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
  222. package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
  223. package/dist/components/ui/dialog/dialog.js +3 -1
  224. package/dist/components/ui/dialog/dialog.js.map +1 -1
  225. package/dist/components/ui/dropdown-menu/menu-parts.d.ts.map +1 -1
  226. package/dist/components/ui/dropdown-menu/menu-parts.js +7 -3
  227. package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
  228. package/dist/components/ui/empty/empty-state.d.ts.map +1 -1
  229. package/dist/components/ui/empty/empty-state.js +3 -1
  230. package/dist/components/ui/empty/empty-state.js.map +1 -1
  231. package/dist/components/ui/field/field.d.ts.map +1 -1
  232. package/dist/components/ui/field/field.js +12 -6
  233. package/dist/components/ui/field/field.js.map +1 -1
  234. package/dist/components/ui/input/input-control.d.ts +2 -0
  235. package/dist/components/ui/input/input-control.d.ts.map +1 -1
  236. package/dist/components/ui/input/input-control.js +24 -6
  237. package/dist/components/ui/input/input-control.js.map +1 -1
  238. package/dist/components/ui/input/input.d.ts.map +1 -1
  239. package/dist/components/ui/input/input.js +47 -48
  240. package/dist/components/ui/input/input.js.map +1 -1
  241. package/dist/components/ui/input-group/input-group.d.ts.map +1 -1
  242. package/dist/components/ui/input-group/input-group.js +1 -8
  243. package/dist/components/ui/input-group/input-group.js.map +1 -1
  244. package/dist/components/ui/message/index.d.ts +1 -1
  245. package/dist/components/ui/message/index.d.ts.map +1 -1
  246. package/dist/components/ui/message/index.js +2 -2
  247. package/dist/components/ui/message/message.d.ts.map +1 -1
  248. package/dist/components/ui/message/message.js +5 -3
  249. package/dist/components/ui/message/message.js.map +1 -1
  250. package/dist/components/ui/message/parse-message-text.d.ts +32 -0
  251. package/dist/components/ui/message/parse-message-text.d.ts.map +1 -1
  252. package/dist/components/ui/message/parse-message-text.js +63 -3
  253. package/dist/components/ui/message/parse-message-text.js.map +1 -1
  254. package/dist/components/ui/native-select/native-select.d.ts.map +1 -1
  255. package/dist/components/ui/native-select/native-select.js +4 -9
  256. package/dist/components/ui/native-select/native-select.js.map +1 -1
  257. package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -1
  258. package/dist/components/ui/navigation-menu/navigation-menu.js +3 -1
  259. package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
  260. package/dist/components/ui/pagination/pagination.d.ts.map +1 -1
  261. package/dist/components/ui/pagination/pagination.js +7 -3
  262. package/dist/components/ui/pagination/pagination.js.map +1 -1
  263. package/dist/components/ui/questionnaire/questionnaire.d.ts.map +1 -1
  264. package/dist/components/ui/questionnaire/questionnaire.js +9 -4
  265. package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
  266. package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
  267. package/dist/components/ui/radio-group/radio-group.js +4 -9
  268. package/dist/components/ui/radio-group/radio-group.js.map +1 -1
  269. package/dist/components/ui/resizable/resizable.d.ts.map +1 -1
  270. package/dist/components/ui/resizable/resizable.js +3 -1
  271. package/dist/components/ui/resizable/resizable.js.map +1 -1
  272. package/dist/components/ui/select/select.d.ts.map +1 -1
  273. package/dist/components/ui/select/select.js +7 -3
  274. package/dist/components/ui/select/select.js.map +1 -1
  275. package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
  276. package/dist/components/ui/sheet/sheet.js +3 -1
  277. package/dist/components/ui/sheet/sheet.js.map +1 -1
  278. package/dist/components/ui/spinner/spinner.d.ts.map +1 -1
  279. package/dist/components/ui/spinner/spinner.js +3 -1
  280. package/dist/components/ui/spinner/spinner.js.map +1 -1
  281. package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -1
  282. package/dist/components/ui/status-chip/status-chip.js +35 -30
  283. package/dist/components/ui/status-chip/status-chip.js.map +1 -1
  284. package/dist/components/ui/switch/switch.d.ts +7 -0
  285. package/dist/components/ui/switch/switch.d.ts.map +1 -1
  286. package/dist/components/ui/switch/switch.js +255 -17
  287. package/dist/components/ui/switch/switch.js.map +1 -1
  288. package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
  289. package/dist/components/ui/textarea/textarea.js +1 -8
  290. package/dist/components/ui/textarea/textarea.js.map +1 -1
  291. package/dist/components/ui/toast/toast.d.ts.map +1 -1
  292. package/dist/components/ui/toast/toast.js +3 -1
  293. package/dist/components/ui/toast/toast.js.map +1 -1
  294. package/dist/components/ui/tooltip/deferred-tooltip.d.ts.map +1 -1
  295. package/dist/components/ui/tooltip/deferred-tooltip.js +10 -4
  296. package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
  297. package/dist/components/ui/tooltip/index.d.ts +1 -0
  298. package/dist/components/ui/tooltip/index.d.ts.map +1 -1
  299. package/dist/components/ui/tooltip/index.js +2 -1
  300. package/dist/components/ui/tooltip/lazy-tooltip.d.ts +40 -0
  301. package/dist/components/ui/tooltip/lazy-tooltip.d.ts.map +1 -0
  302. package/dist/components/ui/tooltip/lazy-tooltip.js +61 -0
  303. package/dist/components/ui/tooltip/lazy-tooltip.js.map +1 -0
  304. package/dist/components/ui/trace/trace.d.ts.map +1 -1
  305. package/dist/components/ui/trace/trace.js +82 -68
  306. package/dist/components/ui/trace/trace.js.map +1 -1
  307. package/dist/components/ui/typography/typography.d.ts +1 -1
  308. package/dist/components/ui/typography/typography.d.ts.map +1 -1
  309. package/dist/components/ui/typography/typography.js +5 -6
  310. package/dist/components/ui/typography/typography.js.map +1 -1
  311. package/dist/index.js +3 -2
  312. package/dist/lib/clipboard.d.ts.map +1 -1
  313. package/dist/lib/clipboard.js +3 -0
  314. package/dist/lib/clipboard.js.map +1 -1
  315. package/dist/lib/fast-icon.d.ts +18 -0
  316. package/dist/lib/fast-icon.d.ts.map +1 -0
  317. package/dist/lib/fast-icon.js +75 -0
  318. package/dist/lib/fast-icon.js.map +1 -0
  319. package/dist/lib/form-field.d.ts +1 -1
  320. package/dist/lib/form-field.js +3 -1
  321. package/dist/lib/form-field.js.map +1 -1
  322. package/dist/lib/observe-resize.d.ts +14 -0
  323. package/dist/lib/observe-resize.d.ts.map +1 -0
  324. package/dist/lib/observe-resize.js +19 -0
  325. package/dist/lib/observe-resize.js.map +1 -0
  326. package/dist/lint/index.d.ts +1 -0
  327. package/dist/lint/index.d.ts.map +1 -1
  328. package/dist/lint.js +251 -118
  329. package/dist/lint.js.map +1 -1
  330. package/dist/r/action-button.json +3 -1
  331. package/dist/r/floating-preview.json +2 -1
  332. package/dist/r/icon-picker.json +0 -1
  333. package/dist/r/lib.json +10 -0
  334. package/dist/r/plan.json +2 -1
  335. package/dist/r/queue.json +2 -1
  336. package/dist/r/registry.json +30 -9
  337. package/dist/r/scene-controls.json +2 -1
  338. package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +5 -1
  339. package/dist/r/src/components/composites/accent-picker/accent-picker.tsx +22 -17
  340. package/dist/r/src/components/composites/account-menu/account-menu.tsx +21 -9
  341. package/dist/r/src/components/composites/action-button/action-button.tsx +38 -21
  342. package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +7 -1
  343. package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +13 -1
  344. package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +13 -1
  345. package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +13 -1
  346. package/dist/r/src/components/composites/catalog-browser/catalog-browser-group.tsx +11 -1
  347. package/dist/r/src/components/composites/catalog-browser/catalog-browser.tsx +11 -1
  348. package/dist/r/src/components/composites/chain-of-thought/chain-of-thought.tsx +5 -1
  349. package/dist/r/src/components/composites/chat/chat.tsx +11 -1
  350. package/dist/r/src/components/composites/checkpoint/checkpoint.tsx +5 -1
  351. package/dist/r/src/components/composites/confirmation/confirmation.tsx +15 -1
  352. package/dist/r/src/components/composites/context/context.tsx +9 -1
  353. package/dist/r/src/components/composites/file-tree/file-tree.tsx +11 -1
  354. package/dist/r/src/components/composites/help-center/help-center.tsx +5 -1
  355. package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +59 -31
  356. package/dist/r/src/components/composites/icon-picker/shell-icons.ts +121 -59
  357. package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +6 -1
  358. package/dist/r/src/components/composites/list-row/list-row-control.tsx +7 -5
  359. package/dist/r/src/components/composites/message-scroller/message-scroller.tsx +6 -1
  360. package/dist/r/src/components/composites/model-selector/model-selector.tsx +11 -1
  361. package/dist/r/src/components/composites/plan/plan.tsx +5 -1
  362. package/dist/r/src/components/composites/queue/queue.tsx +15 -1
  363. package/dist/r/src/components/composites/reasoning/reasoning.tsx +5 -1
  364. package/dist/r/src/components/composites/scene-controls/scene-controls.tsx +17 -1
  365. package/dist/r/src/components/composites/settings/settings.tsx +23 -14
  366. package/dist/r/src/components/composites/sources/sources.tsx +27 -20
  367. package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +13 -1
  368. package/dist/r/src/components/composites/stat/stat.tsx +9 -1
  369. package/dist/r/src/components/composites/subagent/subagent.tsx +5 -1
  370. package/dist/r/src/components/composites/task/task.tsx +5 -1
  371. package/dist/r/src/components/composites/terminal/ansi.ts +18 -0
  372. package/dist/r/src/components/composites/terminal/terminal.tsx +17 -7
  373. package/dist/r/src/components/composites/test-results/test-results.tsx +17 -7
  374. package/dist/r/src/components/composites/tool/tool.tsx +5 -1
  375. package/dist/r/src/components/composites/tree/tree.tsx +5 -1
  376. package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +35 -15
  377. package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +14 -7
  378. package/dist/r/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +6 -1
  379. package/dist/r/src/components/composites/workspace-switcher/workspace-switcher.tsx +13 -1
  380. package/dist/r/src/components/conversation/busy-send-button.tsx +11 -1
  381. package/dist/r/src/components/conversation/conversation-avatar.tsx +7 -1
  382. package/dist/r/src/components/conversation/conversation-surface.tsx +5 -1
  383. package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +13 -1
  384. package/dist/r/src/components/conversation/message-composer.tsx +13 -1
  385. package/dist/r/src/components/conversation/message-row.tsx +15 -1
  386. package/dist/r/src/components/conversation/thread-panel.tsx +5 -1
  387. package/dist/r/src/components/conversation/transcript-composition.tsx +5 -1
  388. package/dist/r/src/components/layout/floating-preview/floating-preview.tsx +6 -1
  389. package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +5 -1
  390. package/dist/r/src/components/layout/shell-rail/shell-rail.tsx +5 -1
  391. package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +5 -1
  392. package/dist/r/src/components/layout/split-layout/split-layout.tsx +6 -1
  393. package/dist/r/src/components/layout/top-bar/top-bar.tsx +5 -1
  394. package/dist/r/src/components/theme/appearance-panel.tsx +6 -1
  395. package/dist/r/src/components/theme/theme-mode-toggle.tsx +7 -1
  396. package/dist/r/src/components/theme/theme-toggle.tsx +7 -1
  397. package/dist/r/src/components/ui/accordion/accordion.tsx +5 -1
  398. package/dist/r/src/components/ui/alert/alert.tsx +20 -3
  399. package/dist/r/src/components/ui/annotation-surface/annotation-surface.tsx +6 -3
  400. package/dist/r/src/components/ui/attachment/attachment.tsx +19 -8
  401. package/dist/r/src/components/ui/badge/badge.tsx +24 -8
  402. package/dist/r/src/components/ui/breadcrumb/breadcrumb.tsx +9 -1
  403. package/dist/r/src/components/ui/button/button.tsx +47 -16
  404. package/dist/r/src/components/ui/calendar/calendar.tsx +6 -1
  405. package/dist/r/src/components/ui/carousel/carousel.tsx +15 -5
  406. package/dist/r/src/components/ui/checkbox/checkbox.tsx +260 -22
  407. package/dist/r/src/components/ui/code-block/code-block.tsx +11 -5
  408. package/dist/r/src/components/ui/combobox/combobox.tsx +8 -9
  409. package/dist/r/src/components/ui/command/command.tsx +8 -4
  410. package/dist/r/src/components/ui/detail-panel/detail-panel.tsx +5 -1
  411. package/dist/r/src/components/ui/dialog/dialog.tsx +5 -1
  412. package/dist/r/src/components/ui/dropdown-menu/menu-parts.tsx +11 -1
  413. package/dist/r/src/components/ui/empty/empty-state.tsx +5 -1
  414. package/dist/r/src/components/ui/field/field.tsx +14 -5
  415. package/dist/r/src/components/ui/input/input-control.tsx +28 -19
  416. package/dist/r/src/components/ui/input/input.tsx +9 -12
  417. package/dist/r/src/components/ui/input-group/input-group.tsx +1 -8
  418. package/dist/r/src/components/ui/message/index.ts +3 -0
  419. package/dist/r/src/components/ui/message/message.tsx +11 -2
  420. package/dist/r/src/components/ui/message/parse-message-text.ts +94 -2
  421. package/dist/r/src/components/ui/native-select/native-select.tsx +6 -9
  422. package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +5 -1
  423. package/dist/r/src/components/ui/pagination/pagination.tsx +11 -1
  424. package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +13 -1
  425. package/dist/r/src/components/ui/radio-group/radio-group.tsx +6 -9
  426. package/dist/r/src/components/ui/resizable/resizable.tsx +5 -1
  427. package/dist/r/src/components/ui/select/select.tsx +11 -1
  428. package/dist/r/src/components/ui/sheet/sheet.tsx +5 -1
  429. package/dist/r/src/components/ui/spinner/spinner.tsx +5 -1
  430. package/dist/r/src/components/ui/status-chip/status-chip.tsx +14 -7
  431. package/dist/r/src/components/ui/switch/switch.tsx +235 -28
  432. package/dist/r/src/components/ui/textarea/textarea.tsx +1 -8
  433. package/dist/r/src/components/ui/toast/toast.tsx +5 -1
  434. package/dist/r/src/components/ui/tooltip/deferred-tooltip.tsx +14 -8
  435. package/dist/r/src/components/ui/tooltip/index.ts +1 -0
  436. package/dist/r/src/components/ui/tooltip/lazy-tooltip.tsx +73 -0
  437. package/dist/r/src/components/ui/trace/trace.tsx +61 -28
  438. package/dist/r/src/components/ui/typography/typography.tsx +6 -5
  439. package/dist/r/src/lib/clipboard.ts +4 -0
  440. package/dist/r/src/lib/fast-icon.ts +88 -0
  441. package/dist/r/src/lib/form-field.ts +7 -7
  442. package/dist/r/src/lib/observe-resize.ts +28 -0
  443. package/dist/r/subagent.json +2 -1
  444. package/dist/r/tool.json +2 -1
  445. package/dist/r/tooltip.json +5 -0
  446. package/dist/r/trace.json +0 -1
  447. package/package.json +1 -1
  448. package/registry.json +30 -9
  449. package/src/components/composites/about-dialog/about-dialog.tsx +5 -1
  450. package/src/components/composites/accent-picker/accent-picker.tsx +22 -17
  451. package/src/components/composites/account-menu/account-menu.tsx +21 -9
  452. package/src/components/composites/action-button/action-button.tsx +38 -21
  453. package/src/components/composites/appearance-editor/appearance-choices.tsx +7 -1
  454. package/src/components/composites/appearance-editor/appearance-editor.tsx +13 -1
  455. package/src/components/composites/appearance-editor/appearance-rows.tsx +13 -1
  456. package/src/components/composites/appearance-editor/font-settings-group.tsx +13 -1
  457. package/src/components/composites/catalog-browser/catalog-browser-group.tsx +11 -1
  458. package/src/components/composites/catalog-browser/catalog-browser.tsx +11 -1
  459. package/src/components/composites/chain-of-thought/chain-of-thought.tsx +5 -1
  460. package/src/components/composites/chat/chat.tsx +11 -1
  461. package/src/components/composites/checkpoint/checkpoint.tsx +5 -1
  462. package/src/components/composites/confirmation/confirmation.tsx +15 -1
  463. package/src/components/composites/context/context.tsx +9 -1
  464. package/src/components/composites/file-tree/file-tree.tsx +11 -1
  465. package/src/components/composites/help-center/help-center.tsx +5 -1
  466. package/src/components/composites/icon-picker/icon-picker.tsx +59 -31
  467. package/src/components/composites/icon-picker/shell-icons.ts +121 -59
  468. package/src/components/composites/inline-citation/inline-citation.tsx +6 -1
  469. package/src/components/composites/list-row/list-row-control.tsx +7 -5
  470. package/src/components/composites/message-scroller/message-scroller.tsx +6 -1
  471. package/src/components/composites/model-selector/model-selector.tsx +11 -1
  472. package/src/components/composites/plan/plan.tsx +5 -1
  473. package/src/components/composites/queue/queue.tsx +15 -1
  474. package/src/components/composites/reasoning/reasoning.tsx +5 -1
  475. package/src/components/composites/scene-controls/scene-controls.tsx +17 -1
  476. package/src/components/composites/settings/settings.tsx +23 -14
  477. package/src/components/composites/sources/sources.tsx +27 -20
  478. package/src/components/composites/stack-trace/stack-trace.tsx +13 -1
  479. package/src/components/composites/stat/stat.tsx +9 -1
  480. package/src/components/composites/subagent/subagent.tsx +5 -1
  481. package/src/components/composites/task/task.tsx +5 -1
  482. package/src/components/composites/terminal/ansi.ts +18 -0
  483. package/src/components/composites/terminal/terminal.tsx +17 -7
  484. package/src/components/composites/test-results/test-results.tsx +17 -7
  485. package/src/components/composites/tool/tool.tsx +5 -1
  486. package/src/components/composites/tree/tree.tsx +5 -1
  487. package/src/components/composites/update-dialog/update-dialog.tsx +35 -15
  488. package/src/components/composites/workspace-mark/workspace-mark.tsx +14 -7
  489. package/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +6 -1
  490. package/src/components/composites/workspace-switcher/workspace-switcher.tsx +13 -1
  491. package/src/components/conversation/busy-send-button.tsx +11 -1
  492. package/src/components/conversation/conversation-avatar.tsx +7 -1
  493. package/src/components/conversation/conversation-surface.tsx +5 -1
  494. package/src/components/conversation/internal/chat-composer-shell.tsx +13 -1
  495. package/src/components/conversation/message-composer.tsx +13 -1
  496. package/src/components/conversation/message-row.tsx +15 -1
  497. package/src/components/conversation/thread-panel.tsx +5 -1
  498. package/src/components/conversation/transcript-composition.tsx +5 -1
  499. package/src/components/layout/floating-preview/floating-preview.tsx +6 -1
  500. package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +5 -1
  501. package/src/components/layout/shell-rail/shell-rail.tsx +5 -1
  502. package/src/components/layout/sidebar-nav/sidebar-nav.tsx +5 -1
  503. package/src/components/layout/split-layout/split-layout.tsx +6 -1
  504. package/src/components/layout/top-bar/top-bar.tsx +5 -1
  505. package/src/components/theme/appearance-panel.tsx +6 -1
  506. package/src/components/theme/theme-mode-toggle.tsx +7 -1
  507. package/src/components/theme/theme-toggle.tsx +7 -1
  508. package/src/components/ui/accordion/accordion.tsx +5 -1
  509. package/src/components/ui/alert/alert.tsx +20 -3
  510. package/src/components/ui/annotation-surface/annotation-surface.tsx +6 -3
  511. package/src/components/ui/attachment/attachment.tsx +19 -8
  512. package/src/components/ui/badge/badge.tsx +24 -8
  513. package/src/components/ui/breadcrumb/breadcrumb.tsx +9 -1
  514. package/src/components/ui/button/button.tsx +47 -16
  515. package/src/components/ui/calendar/calendar.tsx +6 -1
  516. package/src/components/ui/carousel/carousel.tsx +15 -5
  517. package/src/components/ui/checkbox/checkbox.tsx +260 -22
  518. package/src/components/ui/code-block/code-block.tsx +11 -5
  519. package/src/components/ui/combobox/combobox.tsx +8 -9
  520. package/src/components/ui/command/command.tsx +8 -4
  521. package/src/components/ui/detail-panel/detail-panel.tsx +5 -1
  522. package/src/components/ui/dialog/dialog.tsx +5 -1
  523. package/src/components/ui/dropdown-menu/menu-parts.tsx +11 -1
  524. package/src/components/ui/empty/empty-state.tsx +5 -1
  525. package/src/components/ui/field/field.tsx +14 -5
  526. package/src/components/ui/input/input-control.tsx +28 -19
  527. package/src/components/ui/input/input.tsx +9 -12
  528. package/src/components/ui/input-group/input-group.tsx +1 -8
  529. package/src/components/ui/message/index.ts +3 -0
  530. package/src/components/ui/message/message.tsx +11 -2
  531. package/src/components/ui/message/parse-message-text.ts +94 -2
  532. package/src/components/ui/native-select/native-select.tsx +6 -9
  533. package/src/components/ui/navigation-menu/navigation-menu.tsx +5 -1
  534. package/src/components/ui/pagination/pagination.tsx +11 -1
  535. package/src/components/ui/questionnaire/questionnaire.tsx +13 -1
  536. package/src/components/ui/radio-group/radio-group.tsx +6 -9
  537. package/src/components/ui/resizable/resizable.tsx +5 -1
  538. package/src/components/ui/select/select.tsx +11 -1
  539. package/src/components/ui/sheet/sheet.tsx +5 -1
  540. package/src/components/ui/spinner/spinner.tsx +5 -1
  541. package/src/components/ui/status-chip/status-chip.tsx +14 -7
  542. package/src/components/ui/switch/switch.tsx +235 -28
  543. package/src/components/ui/textarea/textarea.tsx +1 -8
  544. package/src/components/ui/toast/toast.tsx +5 -1
  545. package/src/components/ui/tooltip/deferred-tooltip.tsx +14 -8
  546. package/src/components/ui/tooltip/index.ts +1 -0
  547. package/src/components/ui/tooltip/lazy-tooltip.tsx +73 -0
  548. package/src/components/ui/trace/trace.tsx +61 -28
  549. package/src/components/ui/typography/typography.tsx +6 -5
  550. package/src/lib/clipboard.ts +4 -0
  551. package/src/lib/fast-icon.ts +88 -0
  552. package/src/lib/form-field.ts +7 -7
  553. package/src/lib/observe-resize.ts +28 -0
  554. package/src/lint/index.ts +199 -0
@@ -1,6 +1,7 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
2
  import { Badge } from "../../ui/badge/badge.js";
3
3
  import { Trace, TraceLine, WORK_STATUS_LABELS, WORK_TRACE_STATUS } from "../../ui/trace/trace.js";
4
+ import { fastIcon } from "../../../lib/fast-icon.js";
4
5
  import { createComponent, insert, memo, mergeProps, spread, template } from "solid-js/web";
5
6
  import { ListOrdered } from "lucide-solid";
6
7
  import { children, splitProps } from "solid-js";
@@ -8,6 +9,7 @@ import { children, splitProps } from "solid-js";
8
9
  var _tmpl$ = /*#__PURE__*/ template(`<ul role=list data-slot=chain-of-thought-results>`);
9
10
  var _tmpl$2 = /*#__PURE__*/ template(`<span class=truncate>`);
10
11
  var _tmpl$3 = /*#__PURE__*/ template(`<li data-slot=chain-of-thought-result>`);
12
+ var ListOrdered$1 = fastIcon(ListOrdered);
11
13
  var CHAIN_OF_THOUGHT_STATUS_LABELS = {
12
14
  complete: "Done",
13
15
  active: WORK_STATUS_LABELS.active,
@@ -33,7 +35,7 @@ function ChainOfThought(props) {
33
35
  });
34
36
  return createComponent(TraceLine, mergeProps({
35
37
  get icon() {
36
- return local.icon ?? createComponent(ListOrdered, {});
38
+ return local.icon ?? createComponent(ListOrdered$1, {});
37
39
  },
38
40
  get title() {
39
41
  return local.summary ?? "Steps";
@@ -1 +1 @@
1
- {"version":3,"file":"chain-of-thought.js","names":["ListOrdered","children","resolveChildren","splitProps","cn","Badge","Trace","TraceLine","WORK_STATUS_LABELS","WORK_TRACE_STATUS","CHAIN_OF_THOUGHT_STATUS_LABELS","complete","active","pending","summary","stepsLabel","ChainOfThought","props","local","rest","steps","hasSteps","toArray","length","stepList","_$createComponent","size","_$mergeProps","icon","title","undefined","label","status","ChainOfThoughtStep","_$memo","statusLabel","defaultOpen","ChainOfThoughtResults","_el$","_tmpl$","_$spread","class","_$insert","ChainOfThoughtResult","_el$2","_tmpl$3","variant","_el$3","_tmpl$2"],"sources":["../../../../src/components/composites/chain-of-thought/chain-of-thought.tsx"],"sourcesContent":["import { ListOrdered } from 'lucide-solid'\nimport { children as resolveChildren, splitProps, type ComponentProps, type JSX } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Badge } from '../../ui/badge'\nimport {\n Trace,\n TraceLine,\n WORK_STATUS_LABELS,\n WORK_TRACE_STATUS,\n type TraceLineProps,\n type WorkStatus,\n} from '../../ui/trace'\n\n/**\n * ChainOfThought.\n *\n * A summary line that opens onto the steps behind it: \"Searched 3 sources and\n * compared them\", then each source and each comparison as its own line. Reach for\n * `Reasoning` when the thinking is prose, for `Plan` when the steps are a\n * proposal still to be carried out, and for a plain `Trace` when each line is a\n * tool call, a step here is a statement about the agent's *method*, whatever\n * the host chooses to put in it.\n *\n * Nothing here knows how the steps were produced. The host passes the summary and\n * the steps it wants shown; the component does not imply there is more, and a\n * summary with no steps is a plain line.\n *\n * ## Steps\n *\n * A `ChainOfThoughtStep` is a `TraceLine` with a three-state `status`, `complete`\n * (keeps its own icon, or a tick), `active` (running mark and shimmer) and\n * `pending` (dashed mark). Every status is also spoken. A step without a status\n * makes no claim at all. A step's `children` are its evidence, search-result\n * badges, a snippet, and are open by default: someone who unfolded the summary\n * to see the working wants to see what the working found, and one more click per\n * step to read it defeats the point of the summary.\n *\n * `description` is a single truncated row beside the label. Anything longer\n * belongs in `children`.\n *\n * Both parts are lines: put a `ChainOfThought` inside a `Trace`, next to the\n * other activity of the turn.\n */\nexport type ChainOfThoughtStepStatus = Extract<WorkStatus, 'complete' | 'active' | 'pending'>\n\nexport const CHAIN_OF_THOUGHT_STATUS_LABELS: Readonly<Record<ChainOfThoughtStepStatus, string>> = {\n complete: 'Done',\n active: WORK_STATUS_LABELS.active,\n pending: WORK_STATUS_LABELS.pending,\n}\n\nexport type ChainOfThoughtProps = Omit<\n TraceLineProps,\n 'title' | 'href' | 'onSelect' | 'selectHaspopup' | 'children'\n> & {\n /** The steps, as `ChainOfThoughtStep`s. */\n children?: JSX.Element\n /** The one-line account of what the steps add up to. */\n summary?: JSX.Element\n /** The steps' accessible name. */\n stepsLabel?: string\n}\n\nexport function ChainOfThought(props: ChainOfThoughtProps) {\n const [local, rest] = splitProps(props, ['summary', 'stepsLabel', 'icon', 'children'])\n // Resolved once so the steps are created once: a step keeps its own open state\n // and its DOM while the summary is folded and unfolded.\n const steps = resolveChildren(() => local.children)\n const hasSteps = () => steps.toArray().length > 0\n const stepList = () => (\n <Trace size=\"sm\" aria-label={local.stepsLabel ?? 'Steps'}>\n {steps()}\n </Trace>\n )\n\n return (\n <TraceLine icon={local.icon ?? <ListOrdered />} title={local.summary ?? 'Steps'} {...rest}>\n {hasSteps() ? stepList : undefined}\n </TraceLine>\n )\n}\n\nexport type ChainOfThoughtStepProps = Omit<\n TraceLineProps,\n 'title' | 'status' | 'href' | 'onSelect' | 'selectHaspopup'\n> & {\n label: JSX.Element\n status?: ChainOfThoughtStepStatus\n}\n\nexport function ChainOfThoughtStep(props: ChainOfThoughtStepProps) {\n const [local, rest] = splitProps(props, ['label', 'status', 'statusLabel', 'defaultOpen'])\n return (\n <TraceLine\n title={local.label}\n status={local.status ? WORK_TRACE_STATUS[local.status] : undefined}\n statusLabel={\n local.status\n ? (local.statusLabel ?? CHAIN_OF_THOUGHT_STATUS_LABELS[local.status])\n : undefined\n }\n defaultOpen={local.defaultOpen ?? true}\n {...rest}\n />\n )\n}\n\n/** Evidence for a step: the sources it searched, as a wrapping row of badges. */\nexport function ChainOfThoughtResults(props: ComponentProps<'ul'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <ul\n role=\"list\"\n data-slot=\"chain-of-thought-results\"\n class={cn('m-0 flex min-w-0 list-none flex-wrap gap-1.5 p-0', local.class)}\n {...rest}\n >\n {local.children}\n </ul>\n )\n}\n\nexport type ChainOfThoughtResultProps = Omit<ComponentProps<'li'>, 'children'> & {\n /** Rendered as text. A long label truncates and keeps its full text in `title`. */\n label: string\n icon?: JSX.Element\n}\n\nexport function ChainOfThoughtResult(props: ChainOfThoughtResultProps) {\n const [local, rest] = splitProps(props, ['class', 'label', 'icon'])\n return (\n <li data-slot=\"chain-of-thought-result\" class={cn('min-w-0 max-w-full', local.class)} {...rest}>\n <Badge variant=\"outline\" class=\"max-w-full min-w-0\" title={local.label}>\n {local.icon}\n <span class=\"truncate\">{local.label}</span>\n </Badge>\n </li>\n )\n}\n"],"mappings":";;;;;;;;;;AA6CA,IAAaU,iCAAqF;CAChGC,UAAU;CACVC,QAAQJ,mBAAmBI;CAC3BC,SAASL,mBAAmBK;AAC9B;AAcA,SAAgBG,eAAeC,OAA4B;CACzD,MAAM,CAACC,OAAOC,QAAQhB,WAAWc,OAAO;EAAC;EAAW;EAAc;EAAQ;CAAU,CAAC;CAGrF,MAAMG,QAAQlB,eAAsBgB,MAAMjB,QAAQ;CAClD,MAAMoB,iBAAiBD,MAAME,QAAQ,CAAC,CAACC,SAAS;CAChD,MAAMC,iBAAWC,gBACdnB,OAAK;EAACoB,MAAI;EAAA,KAAA,gBAAA;GAAA,OAAkBR,MAAMH,cAAc;EAAO;EAAA,IAAAd,WAAA;GAAA,OACrDmB,MAAM;EAAC;CAAA,CAAA;CAIZ,OAAAK,gBACGlB,WAASoB,WAAA;EAAA,IAACC,OAAI;GAAA,OAAEV,MAAMU,QAAIH,gBAAKzB,aAAW,CAAA,CAAA;EAAG;EAAA,IAAE6B,QAAK;GAAA,OAAEX,MAAMJ,WAAW;EAAO;CAAA,GAAMK,MAAI,EAAA,IAAAlB,WAAA;EAAA,OACtFoB,SAAS,IAAIG,WAAWM,KAAAA;CAAS,EAAA,CAAA,CAAA;AAGxC;AAUA,SAAgBG,mBAAmBhB,OAAgC;CACjE,MAAM,CAACC,OAAOC,QAAQhB,WAAWc,OAAO;EAAC;EAAS;EAAU;EAAe;CAAa,CAAC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WACnEhB,MAAMU,IAAI,UAAA;KAAA,IAAAmB,QAAAC,QAAA;KAAAN,OAAAK,aACa7B,MAAMa,KAAK;KAAA,OAAAgB;IAAA,EAAA,CAAA,CAAA;GAAA;EAAA,CAAA,CAAA;EAAA,OAAAH;CAAA,EAAA,CAAA;AAI3C"}
1
+ {"version":3,"file":"chain-of-thought.js","names":["ListOrdered","LucideListOrdered","children","resolveChildren","splitProps","cn","Badge","Trace","TraceLine","WORK_STATUS_LABELS","WORK_TRACE_STATUS","fastIcon","CHAIN_OF_THOUGHT_STATUS_LABELS","complete","active","pending","summary","stepsLabel","ChainOfThought","props","local","rest","steps","hasSteps","toArray","length","stepList","_$createComponent","size","_$mergeProps","icon","title","undefined","label","status","ChainOfThoughtStep","_$memo","statusLabel","defaultOpen","ChainOfThoughtResults","_el$","_tmpl$","_$spread","class","_$insert","ChainOfThoughtResult","_el$2","_tmpl$3","variant","_el$3","_tmpl$2"],"sources":["../../../../src/components/composites/chain-of-thought/chain-of-thought.tsx"],"sourcesContent":["import { ListOrdered as LucideListOrdered } from 'lucide-solid'\nimport { children as resolveChildren, splitProps, type ComponentProps, type JSX } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Badge } from '../../ui/badge'\nimport {\n Trace,\n TraceLine,\n WORK_STATUS_LABELS,\n WORK_TRACE_STATUS,\n type TraceLineProps,\n type WorkStatus,\n} from '../../ui/trace'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ListOrdered = fastIcon(LucideListOrdered)\n\n/**\n * ChainOfThought.\n *\n * A summary line that opens onto the steps behind it: \"Searched 3 sources and\n * compared them\", then each source and each comparison as its own line. Reach for\n * `Reasoning` when the thinking is prose, for `Plan` when the steps are a\n * proposal still to be carried out, and for a plain `Trace` when each line is a\n * tool call, a step here is a statement about the agent's *method*, whatever\n * the host chooses to put in it.\n *\n * Nothing here knows how the steps were produced. The host passes the summary and\n * the steps it wants shown; the component does not imply there is more, and a\n * summary with no steps is a plain line.\n *\n * ## Steps\n *\n * A `ChainOfThoughtStep` is a `TraceLine` with a three-state `status`, `complete`\n * (keeps its own icon, or a tick), `active` (running mark and shimmer) and\n * `pending` (dashed mark). Every status is also spoken. A step without a status\n * makes no claim at all. A step's `children` are its evidence, search-result\n * badges, a snippet, and are open by default: someone who unfolded the summary\n * to see the working wants to see what the working found, and one more click per\n * step to read it defeats the point of the summary.\n *\n * `description` is a single truncated row beside the label. Anything longer\n * belongs in `children`.\n *\n * Both parts are lines: put a `ChainOfThought` inside a `Trace`, next to the\n * other activity of the turn.\n */\nexport type ChainOfThoughtStepStatus = Extract<WorkStatus, 'complete' | 'active' | 'pending'>\n\nexport const CHAIN_OF_THOUGHT_STATUS_LABELS: Readonly<Record<ChainOfThoughtStepStatus, string>> = {\n complete: 'Done',\n active: WORK_STATUS_LABELS.active,\n pending: WORK_STATUS_LABELS.pending,\n}\n\nexport type ChainOfThoughtProps = Omit<\n TraceLineProps,\n 'title' | 'href' | 'onSelect' | 'selectHaspopup' | 'children'\n> & {\n /** The steps, as `ChainOfThoughtStep`s. */\n children?: JSX.Element\n /** The one-line account of what the steps add up to. */\n summary?: JSX.Element\n /** The steps' accessible name. */\n stepsLabel?: string\n}\n\nexport function ChainOfThought(props: ChainOfThoughtProps) {\n const [local, rest] = splitProps(props, ['summary', 'stepsLabel', 'icon', 'children'])\n // Resolved once so the steps are created once: a step keeps its own open state\n // and its DOM while the summary is folded and unfolded.\n const steps = resolveChildren(() => local.children)\n const hasSteps = () => steps.toArray().length > 0\n const stepList = () => (\n <Trace size=\"sm\" aria-label={local.stepsLabel ?? 'Steps'}>\n {steps()}\n </Trace>\n )\n\n return (\n <TraceLine icon={local.icon ?? <ListOrdered />} title={local.summary ?? 'Steps'} {...rest}>\n {hasSteps() ? stepList : undefined}\n </TraceLine>\n )\n}\n\nexport type ChainOfThoughtStepProps = Omit<\n TraceLineProps,\n 'title' | 'status' | 'href' | 'onSelect' | 'selectHaspopup'\n> & {\n label: JSX.Element\n status?: ChainOfThoughtStepStatus\n}\n\nexport function ChainOfThoughtStep(props: ChainOfThoughtStepProps) {\n const [local, rest] = splitProps(props, ['label', 'status', 'statusLabel', 'defaultOpen'])\n return (\n <TraceLine\n title={local.label}\n status={local.status ? WORK_TRACE_STATUS[local.status] : undefined}\n statusLabel={\n local.status\n ? (local.statusLabel ?? CHAIN_OF_THOUGHT_STATUS_LABELS[local.status])\n : undefined\n }\n defaultOpen={local.defaultOpen ?? true}\n {...rest}\n />\n )\n}\n\n/** Evidence for a step: the sources it searched, as a wrapping row of badges. */\nexport function ChainOfThoughtResults(props: ComponentProps<'ul'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <ul\n role=\"list\"\n data-slot=\"chain-of-thought-results\"\n class={cn('m-0 flex min-w-0 list-none flex-wrap gap-1.5 p-0', local.class)}\n {...rest}\n >\n {local.children}\n </ul>\n )\n}\n\nexport type ChainOfThoughtResultProps = Omit<ComponentProps<'li'>, 'children'> & {\n /** Rendered as text. A long label truncates and keeps its full text in `title`. */\n label: string\n icon?: JSX.Element\n}\n\nexport function ChainOfThoughtResult(props: ChainOfThoughtResultProps) {\n const [local, rest] = splitProps(props, ['class', 'label', 'icon'])\n return (\n <li data-slot=\"chain-of-thought-result\" class={cn('min-w-0 max-w-full', local.class)} {...rest}>\n <Badge variant=\"outline\" class=\"max-w-full min-w-0\" title={local.label}>\n {local.icon}\n <span class=\"truncate\">{local.label}</span>\n </Badge>\n </li>\n )\n}\n"],"mappings":";;;;;;;;;;;AAeA,IAAMA,gBAAcW,SAASV,WAAiB;AAkC9C,IAAaW,iCAAqF;CAChGC,UAAU;CACVC,QAAQL,mBAAmBK;CAC3BC,SAASN,mBAAmBM;AAC9B;AAcA,SAAgBG,eAAeC,OAA4B;CACzD,MAAM,CAACC,OAAOC,QAAQjB,WAAWe,OAAO;EAAC;EAAW;EAAc;EAAQ;CAAU,CAAC;CAGrF,MAAMG,QAAQnB,eAAsBiB,MAAMlB,QA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,CAAC,OAAO,CAAA;IACzB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACpB,iFAAiF;IACjF,IAAI,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAA;CAC9B,CAAA;AAEH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,eA2ChD;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,GAAG;IAClE,KAAK,EAAE,GAAG,CAAC,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACzB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CAC1B,CAAA;AAED,gFAAgF;AAChF,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,eAsB9C"}
@@ -1,5 +1,6 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
2
  import { cva } from "../../../lib/variants.js";
3
+ import { fastIcon } from "../../../lib/fast-icon.js";
3
4
  import { Dynamic, className, createComponent, effect, insert, memo, mergeProps, spread, template } from "solid-js/web";
4
5
  import { CircleAlert, Info, TriangleAlert } from "lucide-solid";
5
6
  import { Show, splitProps } from "solid-js";
@@ -13,6 +14,9 @@ var _tmpl$6 = /*#__PURE__*/ template(`<p class="m-0 text-xs text-muted-foregroun
13
14
  var _tmpl$7 = /*#__PURE__*/ template(`<div class="flex shrink-0 items-center gap-1.5">`);
14
15
  var _tmpl$8 = /*#__PURE__*/ template(`<div data-slot=chat-empty><div class="flex flex-col gap-1"><h3 class="m-0 text-base font-semibold tracking-tight text-balance">`);
15
16
  var _tmpl$9 = /*#__PURE__*/ template(`<p class="m-0 text-sm text-muted-foreground text-balance">`);
17
+ var CircleAlert$1 = fastIcon(CircleAlert);
18
+ var Info$1 = fastIcon(Info);
19
+ var TriangleAlert$1 = fastIcon(TriangleAlert);
16
20
  function Chat(props) {
17
21
  const [local, rest] = splitProps(props, [
18
22
  "class",
@@ -93,7 +97,7 @@ function ChatNotice(props) {
93
97
  "action",
94
98
  "live"
95
99
  ]);
96
- const Glyph = () => local.tone === "danger" ? CircleAlert : local.tone === "warning" ? TriangleAlert : Info;
100
+ const Glyph = () => local.tone === "danger" ? CircleAlert$1 : local.tone === "warning" ? TriangleAlert$1 : Info$1;
97
101
  return (() => {
98
102
  var _el$1 = _tmpl$5(), _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling, _el$12 = _el$11.firstChild;
99
103
  spread(_el$1, mergeProps({
@@ -1 +1 @@
1
- {"version":3,"file":"chat.js","names":["CircleAlert","Info","TriangleAlert","Show","splitProps","Dynamic","cn","cva","header","notices","composer","Chat","props","local","rest","_el$","_tmpl$","_el$2","firstChild","_el$3","nextSibling","_el$4","_el$5","_$spread","_$mergeProps","class","_$insert","children","title","subtitle","status","actions","ChatHeader","_el$6","_tmpl$2","_el$7","_el$8","_$createComponent","when","subtitleSlot","_el$9","_tmpl$3","statusSlot","_$memo","actionsSlot","_el$0","_tmpl$4","chatNoticeVariants","variants","tone","info","warning","danger","defaultVariants","description","action","live","ChatNotice","Glyph","_el$1","_tmpl$5","_el$10","_el$11","_el$12","role","undefined","component","descriptionSlot","_el$13","_tmpl$6","actionSlot","_el$14","_tmpl$7","_$effect","_$className","suggestions","ChatEmpty","_el$15","_tmpl$8","_el$16","_el$17","_el$18","_tmpl$9","suggestionsSlot"],"sources":["../../../../src/components/composites/chat/chat.tsx"],"sourcesContent":["import { CircleAlert, Info, TriangleAlert } from 'lucide-solid'\nimport { Show, splitProps, type ComponentProps, type JSX } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { cn } from '#lib/utils'\nimport { cva, type VariantProps } from '#lib/variants'\n\n/**\n * Chat.\n *\n * The frame a conversation lives in: a header, a strip for things the reader\n * must know before reading anything else, the thread, and the composer. It is a\n * layout and nothing more — the thread is a `MessageScroller`, the input is a\n * composer, and what happens in between is the host's — which is why it takes\n * slots instead of data. `ConversationPane` is the other frame: reach for it when\n * the conversation opens a side thread rather than showing notices.\n *\n * ## Why notices have their own row\n *\n * \"The connection dropped\", \"this transcript has a gap\", \"this session is\n * read-only\" are about the whole conversation, not about a turn, and they must\n * not scroll away with the turns. They sit between the header and the thread in\n * their own grid track, so a notice appearing never steals the thread's row and\n * collapses to zero height when there are none. Each notice states its cause in\n * words and carries its own remedy (`action`); one that reports a *change*\n * (`live`) is announced, one that describes a standing condition is not.\n *\n * ## Layout\n *\n * `h-full min-h-0`, so the thread scrolls inside the frame rather than the page\n * growing, and a `min-w-0` track, so a long unbroken token in a turn cannot widen\n * the whole conversation. Nothing here sets a width: the reading column is the\n * turn's, and the composer sets its own measure.\n */\nexport type ChatProps = ComponentProps<'section'> & {\n header?: JSX.Element\n /** `ChatNotice`s. The row collapses when this is empty. */\n notices?: JSX.Element\n composer?: JSX.Element\n}\n\nexport function Chat(props: ChatProps) {\n const [local, rest] = splitProps(props, ['class', 'header', 'notices', 'composer', 'children'])\n return (\n <section\n data-slot=\"chat\"\n class={cn(\n 'grid h-full min-h-0 min-w-0 grid-cols-[minmax(0,1fr)] grid-rows-[auto_auto_minmax(0,1fr)_auto] bg-background text-foreground',\n local.class\n )}\n {...rest}\n >\n <div class=\"row-start-1 min-w-0\">{local.header}</div>\n <div class=\"row-start-2 flex min-w-0 flex-col\">{local.notices}</div>\n <div class=\"row-start-3 flex min-h-0 min-w-0 flex-col\">{local.children}</div>\n <div class=\"row-start-4 min-w-0\">{local.composer}</div>\n </section>\n )\n}\n\nexport type ChatHeaderProps = Omit<ComponentProps<'header'>, 'title'> & {\n title: JSX.Element\n /** One line under the title: identity, scope, generation. */\n subtitle?: JSX.Element\n /** The conversation's state in words (a `StatusChip`). */\n status?: JSX.Element\n /** Host actions: rename, archive, hand off. */\n actions?: JSX.Element\n}\n\nexport function ChatHeader(props: ChatHeaderProps) {\n const [local, rest] = splitProps(props, ['class', 'title', 'subtitle', 'status', 'actions'])\n return (\n <header\n data-slot=\"chat-header\"\n class={cn(\n 'flex min-h-topbar min-w-0 items-center gap-3 border-b border-border px-4 py-2',\n local.class\n )}\n {...rest}\n >\n <div class=\"flex min-w-0 flex-1 flex-col\">\n <h2 class=\"m-0 truncate text-sm font-semibold tracking-tight\">{local.title}</h2>\n <Show when={local.subtitle}>\n {(subtitleSlot) => (\n <p class=\"m-0 truncate text-xs text-muted-foreground\">{subtitleSlot()}</p>\n )}\n </Show>\n </div>\n <Show when={local.status}>{(statusSlot) => <>{statusSlot()}</>}</Show>\n <Show when={local.actions}>\n {(actionsSlot) => <div class=\"flex shrink-0 items-center gap-1\">{actionsSlot()}</div>}\n </Show>\n </header>\n )\n}\n\nexport const chatNoticeVariants = cva(\n 'flex min-w-0 items-start gap-2.5 border-b px-4 py-2 text-sm',\n {\n variants: {\n tone: {\n info: 'border-border bg-muted/40',\n warning: 'border-warning/30 bg-warning-subtle',\n danger: 'border-destructive/30 bg-destructive-subtle',\n },\n },\n defaultVariants: { tone: 'info' },\n }\n)\n\nexport type ChatNoticeProps = Omit<ComponentProps<'div'>, 'title'> &\n VariantProps<typeof chatNoticeVariants> & {\n title: JSX.Element\n description?: JSX.Element\n /** The remedy: Reconnect, Jump to terminal. */\n action?: JSX.Element\n /** Announce it. Use for a change (connection lost), not a standing condition. */\n live?: 'polite' | 'assertive'\n }\n\nexport function ChatNotice(props: ChatNoticeProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'tone',\n 'title',\n 'description',\n 'action',\n 'live',\n ])\n const Glyph = () =>\n local.tone === 'danger' ? CircleAlert : local.tone === 'warning' ? TriangleAlert : Info\n return (\n <div\n data-slot=\"chat-notice\"\n role={local.live === 'assertive' ? 'alert' : local.live === 'polite' ? 'status' : undefined}\n class={cn(chatNoticeVariants({ tone: local.tone }), local.class)}\n {...rest}\n >\n <span\n aria-hidden=\"true\"\n class={cn('mt-0.5 shrink-0 [&_svg]:size-4', {\n 'text-muted-foreground': (local.tone ?? 'info') === 'info',\n 'text-warning': local.tone === 'warning',\n 'text-destructive': local.tone === 'danger',\n })}\n >\n <Dynamic component={Glyph()} />\n </span>\n <div class=\"min-w-0 flex-1\">\n <p class=\"m-0 font-medium [overflow-wrap:anywhere]\">{local.title}</p>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {descriptionSlot()}\n </p>\n )}\n </Show>\n </div>\n <Show when={local.action}>\n {(actionSlot) => <div class=\"flex shrink-0 items-center gap-1.5\">{actionSlot()}</div>}\n </Show>\n </div>\n )\n}\n\nexport type ChatEmptyProps = Omit<ComponentProps<'div'>, 'title'> & {\n title: JSX.Element\n description?: JSX.Element\n /** Prompt chips (`Suggestions`), shown only when the host has real ones. */\n suggestions?: JSX.Element\n}\n\n/** A conversation with no turns yet. Centred in the thread, never in a card. */\nexport function ChatEmpty(props: ChatEmptyProps) {\n const [local, rest] = splitProps(props, ['class', 'title', 'description', 'suggestions'])\n return (\n <div\n data-slot=\"chat-empty\"\n class={cn(\n 'mx-auto flex min-h-full w-full max-w-xl flex-col items-center justify-center gap-4 px-6 py-10 text-center',\n local.class\n )}\n {...rest}\n >\n <div class=\"flex flex-col gap-1\">\n <h3 class=\"m-0 text-base font-semibold tracking-tight text-balance\">{local.title}</h3>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 text-sm text-muted-foreground text-balance\">{descriptionSlot()}</p>\n )}\n </Show>\n </div>\n <Show when={local.suggestions}>{(suggestionsSlot) => <>{suggestionsSlot()}</>}</Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAwCA,SAAgBW,KAAKC,OAAkB;CACrC,MAAM,CAACC,OAAOC,QAAQV,WAAWQ,OAAO;EAAC;EAAS;EAAU;EAAW;EAAY;CAAU,CAAC;CAC9F,cAAA;EAAA,IAAAG,OAAAC,OAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAG,aAAAC,QAAAF,MAAAC,aAAAE,QAAAD,MAAAD;EA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at.js","names":["CircleAlert","LucideCircleAlert","Info","LucideInfo","TriangleAlert","LucideTriangleAlert","Show","splitProps","Dynamic","cn","cva","fastIcon","header","notices","composer","Chat","props","local","rest","_el$","_tmpl$","_el$2","firstChild","_el$3","nextSibling","_el$4","_el$5","_$spread","_$mergeProps","class","_$insert","children","title","subtitle","status","actions","ChatHeader","_el$6","_tmpl$2","_el$7","_el$8","_$createComponent","when","subtitleSlot","_el$9","_tmpl$3","statusSlot","_$memo","actionsSlot","_el$0","_tmpl$4","chatNoticeVariants","variants","tone","info","warning","danger","defaultVariants","description","action","live","ChatNotice","Glyph","_el$1","_tmpl$5","_el$10","_el$11","_el$12","role","undefined","component","descriptionSlot","_el$13","_tmpl$6","actionSlot","_el$14","_tmpl$7","_$effect","_$className","suggestions","ChatEmpty","_el$15","_tmpl$8","_el$16","_el$17","_el$18","_tmpl$9","suggestionsSlot"],"sources":["../../../../src/components/composites/chat/chat.tsx"],"sourcesContent":["import {\n CircleAlert as LucideCircleAlert,\n Info as LucideInfo,\n TriangleAlert as LucideTriangleAlert,\n} from 'lucide-solid'\nimport { Show, splitProps, type ComponentProps, type JSX } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { cn } from '#lib/utils'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst CircleAlert = fastIcon(LucideCircleAlert)\nconst Info = fastIcon(LucideInfo)\nconst TriangleAlert = fastIcon(LucideTriangleAlert)\n\n/**\n * Chat.\n *\n * The frame a conversation lives in: a header, a strip for things the reader\n * must know before reading anything else, the thread, and the composer. It is a\n * layout and nothing more — the thread is a `MessageScroller`, the input is a\n * composer, and what happens in between is the host's — which is why it takes\n * slots instead of data. `ConversationPane` is the other frame: reach for it when\n * the conversation opens a side thread rather than showing notices.\n *\n * ## Why notices have their own row\n *\n * \"The connection dropped\", \"this transcript has a gap\", \"this session is\n * read-only\" are about the whole conversation, not about a turn, and they must\n * not scroll away with the turns. They sit between the header and the thread in\n * their own grid track, so a notice appearing never steals the thread's row and\n * collapses to zero height when there are none. Each notice states its cause in\n * words and carries its own remedy (`action`); one that reports a *change*\n * (`live`) is announced, one that describes a standing condition is not.\n *\n * ## Layout\n *\n * `h-full min-h-0`, so the thread scrolls inside the frame rather than the page\n * growing, and a `min-w-0` track, so a long unbroken token in a turn cannot widen\n * the whole conversation. Nothing here sets a width: the reading column is the\n * turn's, and the composer sets its own measure.\n */\nexport type ChatProps = ComponentProps<'section'> & {\n header?: JSX.Element\n /** `ChatNotice`s. The row collapses when this is empty. */\n notices?: JSX.Element\n composer?: JSX.Element\n}\n\nexport function Chat(props: ChatProps) {\n const [local, rest] = splitProps(props, ['class', 'header', 'notices', 'composer', 'children'])\n return (\n <section\n data-slot=\"chat\"\n class={cn(\n 'grid h-full min-h-0 min-w-0 grid-cols-[minmax(0,1fr)] grid-rows-[auto_auto_minmax(0,1fr)_auto] bg-background text-foreground',\n local.class\n )}\n {...rest}\n >\n <div class=\"row-start-1 min-w-0\">{local.header}</div>\n <div class=\"row-start-2 flex min-w-0 flex-col\">{local.notices}</div>\n <div class=\"row-start-3 flex min-h-0 min-w-0 flex-col\">{local.children}</div>\n <div class=\"row-start-4 min-w-0\">{local.composer}</div>\n </section>\n )\n}\n\nexport type ChatHeaderProps = Omit<ComponentProps<'header'>, 'title'> & {\n title: JSX.Element\n /** One line under the title: identity, scope, generation. */\n subtitle?: JSX.Element\n /** The conversation's state in words (a `StatusChip`). */\n status?: JSX.Element\n /** Host actions: rename, archive, hand off. */\n actions?: JSX.Element\n}\n\nexport function ChatHeader(props: ChatHeaderProps) {\n const [local, rest] = splitProps(props, ['class', 'title', 'subtitle', 'status', 'actions'])\n return (\n <header\n data-slot=\"chat-header\"\n class={cn(\n 'flex min-h-topbar min-w-0 items-center gap-3 border-b border-border px-4 py-2',\n local.class\n )}\n {...rest}\n >\n <div class=\"flex min-w-0 flex-1 flex-col\">\n <h2 class=\"m-0 truncate text-sm font-semibold tracking-tight\">{local.title}</h2>\n <Show when={local.subtitle}>\n {(subtitleSlot) => (\n <p class=\"m-0 truncate text-xs text-muted-foreground\">{subtitleSlot()}</p>\n )}\n </Show>\n </div>\n <Show when={local.status}>{(statusSlot) => <>{statusSlot()}</>}</Show>\n <Show when={local.actions}>\n {(actionsSlot) => <div class=\"flex shrink-0 items-center gap-1\">{actionsSlot()}</div>}\n </Show>\n </header>\n )\n}\n\nexport const chatNoticeVariants = cva(\n 'flex min-w-0 items-start gap-2.5 border-b px-4 py-2 text-sm',\n {\n variants: {\n tone: {\n info: 'border-border bg-muted/40',\n warning: 'border-warning/30 bg-warning-subtle',\n danger: 'border-destructive/30 bg-destructive-subtle',\n },\n },\n defaultVariants: { tone: 'info' },\n }\n)\n\nexport type ChatNoticeProps = Omit<ComponentProps<'div'>, 'title'> &\n VariantProps<typeof chatNoticeVariants> & {\n title: JSX.Element\n description?: JSX.Element\n /** The remedy: Reconnect, Jump to terminal. */\n action?: JSX.Element\n /** Announce it. Use for a change (connection lost), not a standing condition. */\n live?: 'polite' | 'assertive'\n }\n\nexport function ChatNotice(props: ChatNoticeProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'tone',\n 'title',\n 'description',\n 'action',\n 'live',\n ])\n const Glyph = () =>\n local.tone === 'danger' ? CircleAlert : local.tone === 'warning' ? TriangleAlert : Info\n return (\n <div\n data-slot=\"chat-notice\"\n role={local.live === 'assertive' ? 'alert' : local.live === 'polite' ? 'status' : undefined}\n class={cn(chatNoticeVariants({ tone: local.tone }), local.class)}\n {...rest}\n >\n <span\n aria-hidden=\"true\"\n class={cn('mt-0.5 shrink-0 [&_svg]:size-4', {\n 'text-muted-foreground': (local.tone ?? 'info') === 'info',\n 'text-warning': local.tone === 'warning',\n 'text-destructive': local.tone === 'danger',\n })}\n >\n <Dynamic component={Glyph()} />\n </span>\n <div class=\"min-w-0 flex-1\">\n <p class=\"m-0 font-medium [overflow-wrap:anywhere]\">{local.title}</p>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {descriptionSlot()}\n </p>\n )}\n </Show>\n </div>\n <Show when={local.action}>\n {(actionSlot) => <div class=\"flex shrink-0 items-center gap-1.5\">{actionSlot()}</div>}\n </Show>\n </div>\n )\n}\n\nexport type ChatEmptyProps = Omit<ComponentProps<'div'>, 'title'> & {\n title: JSX.Element\n description?: JSX.Element\n /** Prompt chips (`Suggestions`), shown only when the host has real ones. */\n suggestions?: JSX.Element\n}\n\n/** A conversation with no turns yet. Centred in the thread, never in a card. */\nexport function ChatEmpty(props: ChatEmptyProps) {\n const [local, rest] = splitProps(props, ['class', 'title', 'description', 'suggestions'])\n return (\n <div\n data-slot=\"chat-empty\"\n class={cn(\n 'mx-auto flex min-h-full w-full max-w-xl flex-col items-center justify-center gap-4 px-6 py-10 text-center',\n local.class\n )}\n {...rest}\n >\n <div class=\"flex flex-col gap-1\">\n <h3 class=\"m-0 text-base font-semibold tracking-tight text-balance\">{local.title}</h3>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 text-sm text-muted-foreground text-balance\">{descriptionSlot()}</p>\n )}\n </Show>\n </div>\n <Show when={local.suggestions}>{(suggestionsSlot) => <>{suggestionsSlot()}</>}</Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAYA,IAAMA,gBAAcW,SAASV,WAAiB;AAC9C,IAAMC,SAAOS,SAASR,IAAU;AAChC,IAAMC,kBAAgBO,SAASN,aAAmB;AAoClD,SAAgBU,KAAKC,OAAkB;CACrC,MAAM,CAACC,OAAOC,QAAQX,WAAWS,OAAO;EAAC;EAAS;EAAU;EAAW;EAAY;CAAU,CAAC;CAC9F,cAAA;EAAA,IAAAG,OAAAC,OAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAG,aAAAC,QAAAF,MAAAC,aAAAE,QAAAD,MAAAD;EAAAG,OAAAR,MAAAS,WAAA,EA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ts","sourceRoot":"","sources":["../../../../src/components/composites/checkpoint/checkpoint.tsx"],"names":[],"mappings":"AACA,OAAO,EAQL,KAAK,cAAc,EACpB,MAAM,UAAU,CAAA;AAkBjB,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,GAAG;IAClF,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,eAAe,CAAA;IACvB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACtC,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,4CAA4C;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,kCAoIhD"}
1
+ {"version":3,"file":"checkpoint.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/checkpoint/checkpoint.tsx"],"names":[],"mappings":"AACA,OAAO,EAQL,KAAK,cAAc,EACpB,MAAM,UAAU,CAAA;AAkBjB,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAA;AAM3B;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,GAAG;IAClF,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,eAAe,CAAA;IACvB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACtC,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,4CAA4C;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,kCAoIhD"}
@@ -6,11 +6,13 @@ import { Spinner } from "../../ui/spinner/spinner.js";
6
6
  import { settleAction } from "../../../lib/async-action.js";
7
7
  import { boundText } from "../../../lib/text.js";
8
8
  import { checkpointLabel, checkpointStatus, restoreControl, restoreDialogCopy } from "./checkpoint-model.js";
9
+ import { fastIcon } from "../../../lib/fast-icon.js";
9
10
  import { className, createComponent, effect, insert, memo, mergeProps, setAttribute, spread, template, use } from "solid-js/web";
10
11
  import { Flag } from "lucide-solid";
11
12
  import { Show, createEffect, createMemo, createSignal, createUniqueId, on, splitProps } from "solid-js";
12
13
  // src/components/composites/checkpoint/checkpoint.tsx
13
14
  var _tmpl$ = /*#__PURE__*/ template(`<div data-slot=checkpoint><p role=status tabindex=-1>`);
15
+ var Flag$1 = fastIcon(Flag);
14
16
  function Checkpoint(props) {
15
17
  const [local, rest] = splitProps(props, [
16
18
  "class",
@@ -129,7 +131,7 @@ function Checkpoint(props) {
129
131
  insert(_el$, createComponent(Marker, {
130
132
  variant: "rule",
131
133
  get icon() {
132
- return createComponent(Flag, {});
134
+ return createComponent(Flag$1, {});
133
135
  },
134
136
  get tone() {
135
137
  return state() === "failed" ? "danger" : "neutral";
@@ -1 +1 @@
1
- {"version":3,"file":"checkpoint.js","names":["Flag","createEffect","createMemo","createSignal","createUniqueId","on","Show","splitProps","cn","Button","AlertDialog","AlertDialogAction","AlertDialogCancel","AlertDialogContent","AlertDialogDescription","AlertDialogFooter","AlertDialogHeader","AlertDialogTitle","AlertDialogTrigger","Marker","Spinner","settleAction","boundText","checkpointLabel","checkpointStatus","restoreControl","restoreDialogCopy","label","time","state","onRestore","consequence","restoreLabel","disabledReason","error","Checkpoint","props","local","rest","uid","reasonId","followed","setFollowed","failure","setFailure","undefined","confirming","setConfirming","inflight","root","status","control","copy","statusText","restore","disabled","result","ok","message","restored","active","document","activeElement","body","contains","focus","defer","restoreAction","_$createComponent","when","visible","children","open","onOpenChange","as","variant","size","_$memo","title","description","onClick","_el$","_tmpl$","_el$2","firstChild","_$use","element","_$spread","_$mergeProps","class","_$insert","icon","tone","action","_$setAttribute","_$effect","_$className"],"sources":["../../../../src/components/composites/checkpoint/checkpoint.tsx"],"sourcesContent":["import { Flag } from 'lucide-solid'\nimport {\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n on,\n Show,\n splitProps,\n type ComponentProps,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from '../../ui/alert-dialog'\nimport { Marker } from '../../ui/marker'\nimport { Spinner } from '../../ui/spinner'\nimport { settleAction } from '#lib/async-action'\nimport { boundText } from '#lib/text'\nimport {\n checkpointLabel,\n checkpointStatus,\n restoreControl,\n restoreDialogCopy,\n type CheckpointState,\n} from './checkpoint-model'\n\n/**\n * Checkpoint.\n *\n * A point in the conversation the host can name: a divider in the transcript with\n * a label and a time. It always renders, as a `Marker`, the quietest thing in the\n * column, and it is honest about what it is:\n *\n * - **Without `onRestore` it is only a marker.** Not a disabled button, not a\n * greyed-out \"Restore\": nothing. Whether a checkpoint can be returned to is a\n * fact about the host's storage and permissions, and a control that implies it\n * can would be a claim nobody made.\n * - **With `onRestore` it offers Restore, and Restore asks first.** An\n * `AlertDialog` (Escape and the scrim do nothing; every exit is a named choice)\n * states what will change in the host's own words (`consequence`) before the\n * handler is called. A restore throws work away; the confirmation is the point.\n *\n * ## States\n *\n * `idle` → `restoring` → `restored`, or `failed` with `error`. Pass `state` to\n * drive it from the host; omit it and the component follows the promise\n * `onRestore` returns. The status sentence is a live region that exists from the\n * start, so a change is announced. While restoring, the control stays focusable\n * (`aria-disabled`, not `disabled`) so focus is not dropped when the dialog hands\n * it back; once restored the control goes and focus moves to the status line.\n *\n * A restore that cannot happen now takes `disabledReason`, shown in words under\n * the divider; the host decides, the component explains.\n */\nexport type CheckpointProps = Omit<ComponentProps<'div'>, 'children' | 'onError'> & {\n /** The checkpoint's name. Defaults to \"Checkpoint\". */\n label?: string\n /** When it was taken, already formatted for the reader. */\n time?: string\n state?: CheckpointState\n /** Supplying this is what makes the checkpoint restorable. */\n onRestore?: () => void | Promise<void>\n /** What restoring will change, in the host's words. Shown in the confirmation. */\n consequence?: string\n restoreLabel?: string\n /** Why Restore cannot be used right now. */\n disabledReason?: string\n /** Why a restore failed. */\n error?: string\n}\n\nexport function Checkpoint(props: CheckpointProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'time',\n 'state',\n 'onRestore',\n 'consequence',\n 'restoreLabel',\n 'disabledReason',\n 'error',\n ])\n const uid = createUniqueId()\n const reasonId = `${uid}-status`\n const [followed, setFollowed] = createSignal<CheckpointState>('idle')\n const [failure, setFailure] = createSignal<string | undefined>(undefined)\n const [confirming, setConfirming] = createSignal(false)\n let inflight = false\n let root: HTMLDivElement | undefined\n let status: HTMLParagraphElement | undefined\n\n const state = (): CheckpointState => local.state ?? followed()\n const error = () => local.error ?? failure()\n const control = () => restoreControl(local.onRestore !== undefined, state(), local.disabledReason)\n const copy = () => restoreDialogCopy(local.label, local.consequence)\n const statusText = () => checkpointStatus(state(), error(), local.disabledReason)\n\n const restore = async () => {\n if (inflight || control().disabled) return\n inflight = true\n setFailure(undefined)\n setFollowed('restoring')\n const result = await settleAction(local.onRestore)\n inflight = false\n if (result.ok) {\n setFollowed('restored')\n } else {\n setFailure(result.message)\n setFollowed('failed')\n }\n }\n\n // The control is replaced by the status line on success; do not strand focus.\n createEffect(\n on(\n () => state() === 'restored',\n (restored) => {\n if (!restored) return\n const active = document.activeElement\n if (active === null || active === document.body || root?.contains(active)) {\n status?.focus()\n }\n },\n { defer: true }\n )\n )\n\n // Built once. `Marker` reads `action` twice (to test it, then to draw it), and a\n // JSX prop re-creates its component on every read: a second AlertDialog root\n // would portal a second, invisible-to-the-tree dialog when this one opens.\n const restoreAction = createMemo(() => (\n <Show when={control().visible}>\n <AlertDialog\n open={confirming()}\n onOpenChange={(open) => setConfirming(open && !control().disabled)}\n >\n <AlertDialogTrigger\n as={Button}\n variant=\"ghost\"\n size=\"2xs\"\n aria-disabled={control().disabled || undefined}\n aria-describedby={statusText() ? reasonId : undefined}\n >\n <Show when={state() === 'restoring'}>\n <Spinner size=\"xs\" label={false} />\n </Show>\n {state() === 'restoring'\n ? 'Restoring…'\n : (local.restoreLabel ?? (state() === 'failed' ? 'Try again' : 'Restore'))}\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>{copy().title}</AlertDialogTitle>\n <AlertDialogDescription class=\"[overflow-wrap:anywhere]\">\n {copy().description}\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel as={Button} variant=\"ghost\">\n Do not restore\n </AlertDialogCancel>\n <AlertDialogAction as={Button} onClick={() => void restore()}>\n {local.restoreLabel ?? 'Restore'}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </Show>\n ))\n\n return (\n <div\n ref={(element) => (root = element)}\n data-slot=\"checkpoint\"\n data-state={state()}\n class={local.class}\n {...rest}\n >\n <Marker\n variant=\"rule\"\n icon={<Flag />}\n tone={state() === 'failed' ? 'danger' : 'neutral'}\n label={checkpointLabel(local.label)}\n description={local.time ? boundText(local.time, 60) : undefined}\n action={restoreAction()}\n />\n {/* Always present, so a state change is a change to a live region rather than\n the arrival of one. Empty while idle, which takes no space. */}\n <p\n id={reasonId}\n ref={(element) => (status = element)}\n role=\"status\"\n tabindex=\"-1\"\n class={cn('m-0 text-center text-xs outline-none [overflow-wrap:anywhere]', {\n 'text-destructive': state() === 'failed',\n 'text-muted-foreground': state() !== 'failed',\n })}\n >\n {statusText()}\n </p>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAiFA,SAAgBmC,WAAWC,OAAwB;CACjD,MAAM,CAACC,OAAOC,QAAQ/B,WAAW6B,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CAED,MAAMI,WAAW,GADLpC,eACQmC,EAAG;CACvB,MAAM,CAACE,UAAUC,eAAevC,aAA8B,MAAM;CACpE,MAAM,CAACwC,SAASC,cAAczC,aAAiC0C,KAAAA,CAAS;CACxE,MAAM,CAACC,YAAYC,iBAAiB5C,aAAa,KAAK;CACtD,IAAI6C,WAAW;CACf,IAAIC;CACJ,IAAIC;CAEJ,MAAMrB,cAA+BQ,MAAMR,SAASY,SAAS;CAC7D,MAAMP,cAAcG,MAAMH,SAASS,QAAQ;CAC3C,MAAMQ,gBAAgB1B,eAAeY,MAAMP,cAAce,KAAAA,GAAWhB,MAAM,GAAGQ,MAAMJ,cAAc;CACjG,MAAMmB,aAAa1B,kBAAkBW,MAAMV,OAAOU,MAAMN,WAAW;CACnE,MAAMsB,mBAAmB7B,iBAAiBK,MAAM,GAAGK,MAAM,GAAGG,MAAMJ,cAAc;CAEhF,MAAMqB,UAAU,YAAY;EAC1B,IAAIN,YAAYG,QAAQ,CAAC,CAACI,UAAU;EACpCP,WAAW;EACXJ,WAAWC,KAAAA,CAAS;EACpBH,YAAY,WAAW;EACvB,MAAMc,SAAS,MAAMnC,aAAagB,MAAMP,SAAS;EACjDkB,WAAW;EACX,IAAIQ,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AAA,CAAAxC,MAAMT,IAAI,CAAA,CAAA,IAAGN,UAAUe,MAAMT,MAAM,EAAE,IAAIiB,KAAAA;GAAS;GAAA,IAC/DgD,SAAM;IAAA,OAAE1B,cAAc;GAAC;EAAA,CAAA,GAAAgB,KAAA;EAAAE,KAMjBC,YAAapC,SAASoC,SAAQH,KAAA;EAAAW,aAAAX,OAAA,MADhC3C,QAAQ;EAAAkD,OAAAP,OASX9B,UAAU;EAAA0C,aAAAC,UAAAb,OALJ3E,GAAG,iEAAiE;GACzE,oBAAoBqB,MAAM,MAAM;GAChC,yBAAyBA,MAAM,MAAM;EACvC,CAAC,CAAC,CAAA;EAAA,OAAAoD;CAAA,EAAA,CAAA;AAMV"}
1
+ {"version":3,"file":"checkpoint.js","names":["Flag","LucideFlag","createEffect","createMemo","createSignal","createUniqueId","on","Show","splitProps","cn","Button","AlertDialog","AlertDialogAction","AlertDialogCancel","AlertDialogContent","AlertDialogDescription","AlertDialogFooter","AlertDialogHeader","AlertDialogTitle","AlertDialogTrigger","Marker","Spinner","settleAction","boundText","checkpointLabel","checkpointStatus","restoreControl","restoreDialogCopy","fastIcon","label","time","state","onRestore","consequence","restoreLabel","disabledReason","error","Checkpoint","props","local","rest","uid","reasonId","followed","setFollowed","failure","setFailure","undefined","confirming","setConfirming","inflight","root","status","control","copy","statusText","restore","disabled","result","ok","message","restored","active","document","activeElement","body","contains","focus","defer","restoreAction","_$createComponent","when","visible","children","open","onOpenChange","as","variant","size","_$memo","title","description","onClick","_el$","_tmpl$","_el$2","firstChild","_$use","element","_$spread","_$mergeProps","class","_$insert","icon","tone","action","_$setAttribute","_$effect","_$className"],"sources":["../../../../src/components/composites/checkpoint/checkpoint.tsx"],"sourcesContent":["import { Flag as LucideFlag } from 'lucide-solid'\nimport {\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n on,\n Show,\n splitProps,\n type ComponentProps,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from '../../ui/alert-dialog'\nimport { Marker } from '../../ui/marker'\nimport { Spinner } from '../../ui/spinner'\nimport { settleAction } from '#lib/async-action'\nimport { boundText } from '#lib/text'\nimport {\n checkpointLabel,\n checkpointStatus,\n restoreControl,\n restoreDialogCopy,\n type CheckpointState,\n} from './checkpoint-model'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Flag = fastIcon(LucideFlag)\n\n/**\n * Checkpoint.\n *\n * A point in the conversation the host can name: a divider in the transcript with\n * a label and a time. It always renders, as a `Marker`, the quietest thing in the\n * column, and it is honest about what it is:\n *\n * - **Without `onRestore` it is only a marker.** Not a disabled button, not a\n * greyed-out \"Restore\": nothing. Whether a checkpoint can be returned to is a\n * fact about the host's storage and permissions, and a control that implies it\n * can would be a claim nobody made.\n * - **With `onRestore` it offers Restore, and Restore asks first.** An\n * `AlertDialog` (Escape and the scrim do nothing; every exit is a named choice)\n * states what will change in the host's own words (`consequence`) before the\n * handler is called. A restore throws work away; the confirmation is the point.\n *\n * ## States\n *\n * `idle` → `restoring` → `restored`, or `failed` with `error`. Pass `state` to\n * drive it from the host; omit it and the component follows the promise\n * `onRestore` returns. The status sentence is a live region that exists from the\n * start, so a change is announced. While restoring, the control stays focusable\n * (`aria-disabled`, not `disabled`) so focus is not dropped when the dialog hands\n * it back; once restored the control goes and focus moves to the status line.\n *\n * A restore that cannot happen now takes `disabledReason`, shown in words under\n * the divider; the host decides, the component explains.\n */\nexport type CheckpointProps = Omit<ComponentProps<'div'>, 'children' | 'onError'> & {\n /** The checkpoint's name. Defaults to \"Checkpoint\". */\n label?: string\n /** When it was taken, already formatted for the reader. */\n time?: string\n state?: CheckpointState\n /** Supplying this is what makes the checkpoint restorable. */\n onRestore?: () => void | Promise<void>\n /** What restoring will change, in the host's words. Shown in the confirmation. */\n consequence?: string\n restoreLabel?: string\n /** Why Restore cannot be used right now. */\n disabledReason?: string\n /** Why a restore failed. */\n error?: string\n}\n\nexport function Checkpoint(props: CheckpointProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'time',\n 'state',\n 'onRestore',\n 'consequence',\n 'restoreLabel',\n 'disabledReason',\n 'error',\n ])\n const uid = createUniqueId()\n const reasonId = `${uid}-status`\n const [followed, setFollowed] = createSignal<CheckpointState>('idle')\n const [failure, setFailure] = createSignal<string | undefined>(undefined)\n const [confirming, setConfirming] = createSignal(false)\n let inflight = false\n let root: HTMLDivElement | undefined\n let status: HTMLParagraphElement | undefined\n\n const state = (): CheckpointState => local.state ?? followed()\n const error = () => local.error ?? failure()\n const control = () => restoreControl(local.onRestore !== undefined, state(), local.disabledReason)\n const copy = () => restoreDialogCopy(local.label, local.consequence)\n const statusText = () => checkpointStatus(state(), error(), local.disabledReason)\n\n const restore = async () => {\n if (inflight || control().disabled) return\n inflight = true\n setFailure(undefined)\n setFollowed('restoring')\n const result = await settleAction(local.onRestore)\n inflight = false\n if (result.ok) {\n setFollowed('restored')\n } else {\n setFailure(result.message)\n setFollowed('failed')\n }\n }\n\n // The control is replaced by the status line on success; do not strand focus.\n createEffect(\n on(\n () => state() === 'restored',\n (restored) => {\n if (!restored) return\n const active = document.activeElement\n if (active === null || active === document.body || root?.contains(active)) {\n status?.focus()\n }\n },\n { defer: true }\n )\n )\n\n // Built once. `Marker` reads `action` twice (to test it, then to draw it), and a\n // JSX prop re-creates its component on every read: a second AlertDialog root\n // would portal a second, invisible-to-the-tree dialog when this one opens.\n const restoreAction = createMemo(() => (\n <Show when={control().visible}>\n <AlertDialog\n open={confirming()}\n onOpenChange={(open) => setConfirming(open && !control().disabled)}\n >\n <AlertDialogTrigger\n as={Button}\n variant=\"ghost\"\n size=\"2xs\"\n aria-disabled={control().disabled || undefined}\n aria-describedby={statusText() ? reasonId : undefined}\n >\n <Show when={state() === 'restoring'}>\n <Spinner size=\"xs\" label={false} />\n </Show>\n {state() === 'restoring'\n ? 'Restoring…'\n : (local.restoreLabel ?? (state() === 'failed' ? 'Try again' : 'Restore'))}\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>{copy().title}</AlertDialogTitle>\n <AlertDialogDescription class=\"[overflow-wrap:anywhere]\">\n {copy().description}\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel as={Button} variant=\"ghost\">\n Do not restore\n </AlertDialogCancel>\n <AlertDialogAction as={Button} onClick={() => void restore()}>\n {local.restoreLabel ?? 'Restore'}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </Show>\n ))\n\n return (\n <div\n ref={(element) => (root = element)}\n data-slot=\"checkpoint\"\n data-state={state()}\n class={local.class}\n {...rest}\n >\n <Marker\n variant=\"rule\"\n icon={<Flag />}\n tone={state() === 'failed' ? 'danger' : 'neutral'}\n label={checkpointLabel(local.label)}\n description={local.time ? boundText(local.time, 60) : undefined}\n action={restoreAction()}\n />\n {/* Always present, so a state change is a change to a live region rather than\n the arrival of one. Empty while idle, which takes no space. */}\n <p\n id={reasonId}\n ref={(element) => (status = element)}\n role=\"status\"\n tabindex=\"-1\"\n class={cn('m-0 text-center text-xs outline-none [overflow-wrap:anywhere]', {\n 'text-destructive': state() === 'failed',\n 'text-muted-foreground': state() !== 'failed',\n })}\n >\n {statusText()}\n </p>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAsCA,IAAMA,SAAO4B,SAAS3B,IAAU;AA+ChC,SAAgBoC,WAAWC,OAAwB;CACjD,MAAM,CAACC,OAAOC,QAAQhC,WAAW8B,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CAED,MAAMI,WAAW,GADLrC,eACQoC,EAAG;CACvB,MAAM,CAACE,UAAUC,eAAexC,aAA8B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C,MAAML,gBAAgB;QAAS;OAAA,CAAA,CAAA;MAAA,EAAA,CAAA,CAAA;KAAA,EAAA,CAAA,CAAA;IAAA;GAAA,CAAA;EAAA;CAAA,CAAA,CAM3C;CAED,cAAA;EAAA,IAAAiD,OAAAC,OAAA,GAAAC,QAAAF,KAAAG;EAAAC,KAEUC,YAAarC,OAAOqC,SAAQL,IAAA;EAAAM,OAAAN,MAAAO,WAAA;GAAA,KAAA,gBAAA;IAAA,OAEtB3D,MAAM;GAAC;GAAA,KAAA,WAAA;IAAA,OACZQ,MAAMoD;GAAK;EAAA,GACdnD,IAAI,GAAA,OAAA,IAAA;EAAAoD,OAAAT,MAAAb,gBAEPlD,QAAM;GACLyD,SAAO;GAAA,IACPgB,OAAI;IAAA,OAAAvB,gBAAGtE,QAAI,CAAA,CAAA;GAAA;GAAA,IACX8F,OAAI;IAAA,OAAE/D,MAAM,MAAM,WAAW,WAAW;GAAS;GAAA,IACjDF,QAAK;IAAA,OAAEL,gBAAgBe,MAAMV,KAAK;GAAC;GAAA,IACnCoD,cAAW;IAAA,OAAEF,WAAA,CAAA,CAAAxC,MAAMT,IAAI,CAAA,CAAA,IAAGP,UAAUgB,MAAMT,MAAM,EAAE,IAAIiB,KAAAA;GAAS;GAAA,IAC/DgD,SAAM;IAAA,OAAE1B,cAAc;GAAC;EAAA,CAAA,GAAAgB,KAAA;EAAAE,KAMjBC,YAAapC,SAASoC,SAAQH,KAAA;EAAAW,aAAAX,OAAA,MADhC3C,QAAQ;EAAAkD,OAAAP,OASX9B,UAAU;EAAA0C,aAAAC,UAAAb,OALJ5E,GAAG,iEAAiE;GACzE,oBAAoBsB,MAAM,MAAM;GAChC,yBAAyBA,MAAM,MAAM;EACvC,CAAC,CAAC,CAAA;EAAA,OAAAoD;CAAA,EAAA,CAAA;AAMV"}
@@ -1 +1 @@
1
- {"version":3,"file":"confirmation.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/confirmation/confirmation.tsx"],"names":[],"mappings":"AACA,O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,CAAC,OAAO,CAAA;CACvB,CAAA;AAID,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eAqLpD"}
1
+ {"version":3,"file":"confirmation.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/confirmation/confirmation.tsx"],"names":[],"mappings":"AAOA,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,GAAG,EACT,MAAM,UAAU,CAAA;AAOjB,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAA;AAU7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAC3E,QAAQ,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAE7D,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG;IACrF,KAAK,CAAC,EAAE,iBAAiB,CAAA;IACzB,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,mBAAmB,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACtC,MAAM,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACnC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,kFAAkF;IAClF,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACvB,CAAA;AAID,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eAqLpD"}
@@ -5,6 +5,7 @@ import { DiffBlock } from "../../ui/diff-block/diff-block.js";
5
5
  import { Spinner } from "../../ui/spinner/spinner.js";
6
6
  import { boundText } from "../../../lib/text.js";
7
7
  import { confirmationOutcome, decisionReason, isAwaitingAnswer, settleDecision } from "./confirmation-model.js";
8
+ import { fastIcon } from "../../../lib/fast-icon.js";
8
9
  import { createComponent, insert, memo, mergeProps, setAttribute, spread, template, use } from "solid-js/web";
9
10
  import { Ban, Check, Clock, Lock, ShieldQuestion } from "lucide-solid";
10
11
  import { Show, createEffect, createSignal, createUniqueId, splitProps } from "solid-js";
@@ -17,6 +18,11 @@ var _tmpl$5 = /*#__PURE__*/ template(`<footer class="flex flex-wrap items-center
17
18
  var _tmpl$6 = /*#__PURE__*/ template(`<section data-slot=confirmation><header class="flex items-start gap-2.5"><span aria-hidden=true class="mt-0.5 text-muted-foreground [&amp;_svg]:size-4"></span><div class="min-w-0 flex-1"><h3 class="m-0 text-sm font-semibold [overflow-wrap:anywhere]">`);
18
19
  var _tmpl$7 = /*#__PURE__*/ template(`<p tabindex=-1 role=status class="m-0 flex items-center gap-1.5 text-xs text-muted-foreground outline-none">`);
19
20
  var _tmpl$8 = /*#__PURE__*/ template(`<div role=region aria-label="Proposed changes"tabindex=0 class="max-h-64 overflow-auto rounded-xl outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle">`);
21
+ var Ban$1 = fastIcon(Ban);
22
+ var Check$1 = fastIcon(Check);
23
+ var Clock$1 = fastIcon(Clock);
24
+ var Lock$1 = fastIcon(Lock);
25
+ var ShieldQuestion$1 = fastIcon(ShieldQuestion);
20
26
  function Confirmation(props) {
21
27
  const [local, rest] = splitProps(props, [
22
28
  "class",
@@ -108,7 +114,7 @@ function Confirmation(props) {
108
114
  return state() === "approved";
109
115
  },
110
116
  get children() {
111
- return createComponent(Check, { "class": "text-success" });
117
+ return createComponent(Check$1, { "class": "text-success" });
112
118
  }
113
119
  }), null);
114
120
  insert(_el$3, createComponent(Show, {
@@ -116,7 +122,7 @@ function Confirmation(props) {
116
122
  return state() === "denied";
117
123
  },
118
124
  get children() {
119
- return createComponent(Ban, {});
125
+ return createComponent(Ban$1, {});
120
126
  }
121
127
  }), null);
122
128
  insert(_el$3, createComponent(Show, {
@@ -124,7 +130,7 @@ function Confirmation(props) {
124
130
  return state() === "expired";
125
131
  },
126
132
  get children() {
127
- return createComponent(Clock, {});
133
+ return createComponent(Clock$1, {});
128
134
  }
129
135
  }), null);
130
136
  insert(_el$3, createComponent(Show, {
@@ -132,7 +138,7 @@ function Confirmation(props) {
132
138
  return state() === "unavailable";
133
139
  },
134
140
  get children() {
135
- return createComponent(Lock, {});
141
+ return createComponent(Lock$1, {});
136
142
  }
137
143
  }), null);
138
144
  insert(_el$3, createComponent(Show, {
@@ -140,7 +146,7 @@ function Confirmation(props) {
140
146
  return state() === "requested";
141
147
  },
142
148
  get children() {
143
- return createComponent(ShieldQuestion, {});
149
+ return createComponent(ShieldQuestion$1, {});
144
150
  }
145
151
  }), null);
146
152
  setAttribute(_el$5, "id", titleId);
@@ -1 +1 @@
1
- {"version":3,"file":"confirmation.js","names":["Ban","Check","Clock","Lock","ShieldQuestion","createEffect","createSignal","createUniqueId","Show","splitProps","cn","Button","CodeBlock","DiffBlock","Spinner","boundText","confirmationOutcome","decisionReason","isAwaitingAnswer","settleDecision","kind","code","language","title","patch","state","description","details","onApprove","onDeny","approveLabel","denyLabel","disabledReason","error","resolvedBy","resolvedAt","children","Confirmation","props","local","rest","uid","titleId","reasonId","awaiting","pending","setPending","undefined","failure","setFailure","inflight","root","outcome","reasonFor","handler","missing","hasHandler","unavailableFallback","missingFallback","approveReason","denyReason","reasons","Set","filter","Boolean","join","choose","choice","blocked","result","ok","message","wasAwaiting","now","active","document","activeElement","body","contains","focus","buttonProps","disabled","onClick","_el$","_tmpl$6","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","_$use","element","_$setAttribute","_$spread","_$mergeProps","class","_$insert","_$createComponent","when","_el$6","_tmpl$","_el$7","_tmpl$2","Details","fallback","_el$10","_tmpl$7","_el$8","_tmpl$3","_el$9","_tmpl$4","_el$0","_tmpl$5","_el$1","type","variant","size","label","_$memo","bounded","value","limit","complete","wrap","maxHeight","diff","_el$11","_tmpl$8"],"sources":["../../../../src/components/composites/confirmation/confirmation.tsx"],"sourcesContent":["import { Ban, Check, Clock, Lock, ShieldQuestion } from 'lucide-solid'\nimport {\n createEffect,\n createSignal,\n createUniqueId,\n Show,\n splitProps,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport { CodeBlock } from '../../ui/code-block'\nimport { DiffBlock } from '../../ui/diff-block'\nimport { Spinner } from '../../ui/spinner'\nimport { REASON_TEXT_LIMIT, boundText } from '#lib/text'\nimport {\n confirmationOutcome,\n decisionReason,\n isAwaitingAnswer,\n settleDecision,\n type ConfirmationState,\n} from './confirmation-model'\n\n/**\n * Confirmation.\n *\n * The agent has stopped a tool and will not continue until the person approves or\n * denies it. Like `Questionnaire`, this is one of the two elements in a transcript\n * the reader *must* act on, so it is allowed a card surface — and the border is\n * the focus ring's colour only while it is waiting. Once answered it drops to a\n * hairline and a one-line record, because a settled decision should read as\n * history, not as something still asking.\n *\n * ## It shows what is being approved, and nothing else\n *\n * `title` and `description` say what the tool wants to do; `details` is the\n * evidence, rendered as `CodeBlock size=\"sm\"` (a command, a request) or\n * `DiffBlock` (a patch). Details are text: never interpreted, and a long one\n * scrolls inside its block. Approve and Deny exist only while the request is\n * open; afterwards they are replaced by the outcome, with *who* and *when* only if\n * the host supplied them.\n *\n * ## The host owns authority\n *\n * Whether this client may answer is not decided here. No handler, or a host\n * `disabledReason`, or the `unavailable` state, leaves the buttons visible and\n * disabled with the reason beside them in words — never hidden, because a reader\n * who cannot see the choice cannot tell whether the agent is waiting on them.\n *\n * ## Answering is a round trip\n *\n * `onApprove` / `onDeny` may return a promise. While one is pending both buttons\n * refuse input (a synchronous guard as well as the signal, so a double click in\n * one tick cannot submit twice) and the pressed one shows a spinner. A failure\n * shows `error` (or the rejection's own message) and re-enables the buttons. The\n * buttons use `aria-disabled` rather than `disabled`: a native disabled button\n * drops focus, and the reader's place would be lost mid-decision. When the state\n * settles, focus moves to the outcome line if it was in the card, so a keyboard\n * user is not stranded on a control that no longer exists.\n */\nexport type ConfirmationDetails =\n | Readonly<{ kind: 'code'; code: string; language?: string; title?: string }>\n | Readonly<{ kind: 'diff'; patch: string; title?: string }>\n\nexport type ConfirmationProps = Omit<ComponentProps<'section'>, 'title' | 'onError'> & {\n state?: ConfirmationState\n /** What the tool wants to do, as a short sentence. */\n title: string\n description?: string\n details?: ConfirmationDetails\n onApprove?: () => void | Promise<void>\n onDeny?: () => void | Promise<void>\n approveLabel?: string\n denyLabel?: string\n /** Why the choice cannot be made right now; shown in words beside the buttons. */\n disabledReason?: string\n /** A failed answer, in words. Overrides the rejection's own message. */\n error?: string\n /** Who answered, once settled. Omit if unknown; nothing is assumed. */\n resolvedBy?: string\n /** When it was answered, already formatted for the reader. Omit if unknown. */\n resolvedAt?: string\n /** Extra content between the details and the buttons. */\n children?: JSX.Element\n}\n\ntype Choice = 'approve' | 'deny'\n\nexport function Confirmation(props: ConfirmationProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'state',\n 'title',\n 'description',\n 'details',\n 'onApprove',\n 'onDeny',\n 'approveLabel',\n 'denyLabel',\n 'disabledReason',\n 'error',\n 'resolvedBy',\n 'resolvedAt',\n 'children',\n ])\n const uid = createUniqueId()\n const titleId = `${uid}-title`\n const reasonId = `${uid}-reason`\n const state = (): ConfirmationState => local.state ?? 'requested'\n const awaiting = () => isAwaitingAnswer(state())\n const [pending, setPending] = createSignal<Choice | undefined>(undefined)\n const [failure, setFailure] = createSignal<string | undefined>(undefined)\n let inflight = false\n let root: HTMLElement | undefined\n let outcome: HTMLParagraphElement | undefined\n\n const reasonFor = (handler: (() => void | Promise<void>) | undefined, missing: string) => {\n if (pending() !== undefined) return 'Your answer is being sent.'\n return decisionReason({\n state: state(),\n disabledReason: local.disabledReason,\n hasHandler: handler !== undefined,\n unavailableFallback: 'This request cannot be answered right now.',\n missingFallback: missing,\n })\n }\n const approveReason = () => reasonFor(local.onApprove, 'Approving is not available here.')\n const denyReason = () => reasonFor(local.onDeny, 'Denying is not available here.')\n // One sentence per distinct reason, so two identical reasons are not read twice.\n const reasons = () => [...new Set([approveReason(), denyReason()].filter(Boolean))].join(' ')\n const error = () => (local.error ? boundText(local.error, REASON_TEXT_LIMIT) : failure())\n\n const choose = async (choice: Choice) => {\n const handler = choice === 'approve' ? local.onApprove : local.onDeny\n const blocked = choice === 'approve' ? approveReason() : denyReason()\n if (inflight || blocked || !awaiting()) return\n inflight = true\n setPending(choice)\n setFailure(undefined)\n const result = await settleDecision(handler)\n inflight = false\n setPending(undefined)\n if (!result.ok) setFailure(result.message)\n }\n\n // The buttons are replaced by the outcome line; keep a keyboard reader in the card.\n // The previous value is kept by hand: `on(..., { defer: true })` does not record the\n // input of its skipped first run, so its \"previous\" is undefined on the first change.\n let wasAwaiting = awaiting()\n createEffect(() => {\n const now = awaiting()\n if (wasAwaiting && !now) {\n const active = document.activeElement\n if (active === null || active === document.body || root?.contains(active)) {\n outcome?.focus()\n }\n }\n wasAwaiting = now\n })\n\n const buttonProps = (choice: Choice) => {\n const blocked = () => (choice === 'approve' ? approveReason() : denyReason())\n const disabled = () => pending() !== undefined || blocked() !== undefined\n return {\n 'aria-disabled': disabled() || undefined,\n 'aria-describedby': blocked() ? reasonId : undefined,\n onClick: () => void choose(choice),\n }\n }\n\n return (\n <section\n ref={(element) => (root = element)}\n data-slot=\"confirmation\"\n data-state={state()}\n aria-labelledby={titleId}\n class={cn(\n 'flex w-full max-w-xl min-w-0 flex-col gap-3 rounded-xl border bg-card p-4',\n {\n 'border-ring': awaiting(),\n 'border-border': !awaiting(),\n },\n local.class\n )}\n {...rest}\n >\n <header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={state() === 'approved'}>\n <Check class=\"text-success\" />\n </Show>\n <Show when={state() === 'denied'}>\n <Ban />\n </Show>\n <Show when={state() === 'expired'}>\n <Clock />\n </Show>\n <Show when={state() === 'unavailable'}>\n <Lock />\n </Show>\n <Show when={state() === 'requested'}>\n <ShieldQuestion />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 id={titleId} class=\"m-0 text-sm font-semibold [overflow-wrap:anywhere]\">\n {boundText(local.title, 200)}\n </h3>\n <Show when={local.description}>\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {boundText(local.description ?? '', 400)}\n </p>\n </Show>\n </div>\n <Show when={awaiting()}>\n <span class=\"shrink-0 text-xs text-muted-foreground\">\n {state() === 'requested' ? 'Needs your answer' : 'Cannot be answered now'}\n </span>\n </Show>\n </header>\n\n <Show when={local.details}>{(details) => <Details details={details()} />}</Show>\n\n {local.children}\n\n <Show\n when={awaiting()}\n fallback={\n <p\n ref={(element) => (outcome = element)}\n tabindex=\"-1\"\n role=\"status\"\n class=\"m-0 flex items-center gap-1.5 text-xs text-muted-foreground outline-none\"\n >\n {confirmationOutcome(state(), local.resolvedBy, local.resolvedAt)}\n </p>\n }\n >\n <Show when={reasons()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {reasons()}\n </p>\n </Show>\n <Show when={error()}>\n <p role=\"alert\" class=\"m-0 text-xs text-destructive [overflow-wrap:anywhere]\">\n {error()}\n </p>\n </Show>\n <footer class=\"flex flex-wrap items-center justify-end gap-2\">\n <Button type=\"button\" variant=\"outline\" size=\"sm\" {...buttonProps('deny')}>\n <Show when={pending() === 'deny'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.denyLabel ?? 'Deny'}\n </Button>\n <Button type=\"button\" size=\"sm\" {...buttonProps('approve')}>\n <Show when={pending() === 'approve'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.approveLabel ?? 'Approve'}\n </Button>\n {/* Present from the start: a live region inserted with its text is not reliably announced. */}\n <span role=\"status\" class=\"visually-hidden\">\n {pending() !== undefined ? 'Sending your answer' : ''}\n </span>\n </footer>\n </Show>\n </section>\n )\n}\n\n/** A name from the host or the model, cleaned and clipped before it reaches a header. */\nfunction bounded(value: string | undefined, limit: number): string | undefined {\n return value ? boundText(value, limit) || undefined : undefined\n}\n\nfunction Details(props: { details: ConfirmationDetails }) {\n return (\n <Show\n when={props.details.kind === 'diff' && props.details}\n fallback={\n <CodeBlock\n size=\"sm\"\n code={(props.details as Extract<ConfirmationDetails, { kind: 'code' }>).code}\n language={bounded(\n (props.details as Extract<ConfirmationDetails, { kind: 'code' }>).language,\n 24\n )}\n title={bounded(props.details.title, 80)}\n complete\n wrap\n maxHeight=\"14rem\"\n />\n }\n >\n {(diff) => (\n // The diff block has no height cap of its own, so the cap lives here; a\n // scroller must be focusable, hence the labelled region and tab stop.\n <div\n role=\"region\"\n aria-label=\"Proposed changes\"\n tabindex=\"0\"\n class=\"max-h-64 overflow-auto rounded-xl outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n >\n <DiffBlock\n patch={(diff() as Extract<ConfirmationDetails, { kind: 'diff' }>).patch}\n title={bounded(diff().title, 80)}\n complete\n />\n </div>\n )}\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAyFA,SAAgBqC,aAAaC,OAA0B;CACrD,MAAM,CAACC,OAAOC,QAAQ/B,WAAW6B,OAAO;EACtC;EACA;EACA;EAC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A,CAAA,KAAIkB,MAAMX;EAAO;EAAA,IACpD8E,WAAQ;GAAA,OAAAP,gBACLtF,WAAS;IACRyG,MAAI;IAAA,IACJhG,OAAI;KAAA,OAAGiB,MAAMX,QAA2DN;IAAI;IAAA,IAC5EC,WAAQ;KAAA,OAAEkG,QACPlF,MAAMX,QAA2DL,UAClE,EACF;IAAC;IAAA,IACDC,QAAK;KAAA,OAAEiG,QAAQlF,MAAMX,QAAQJ,OAAO,EAAE;IAAC;IACvCoG,UAAQ;IACRC,MAAI;IACJC,WAAS;GAAA,CAAA;EAAA;EAAAzF,WAIX0F,gBAEA;GAAA,IAAAC,SAAAC,QAAA;GAAA/B,OAAA8B,QAAA7B,gBAOGrF,WAAS;IAAA,IACRW,QAAK;KAAA,OAAGsG,KAAK,CAAC,CAAoDtG;IAAK;IAAA,IACvED,QAAK;KAAA,OAAEiG,QAAQM,KAAK,CAAC,CAACvG,OAAO,EAAE;IAAC;IAChCoG,UAAQ;GAAA,CAAA,CAAA;GAAA,OAAAI;EAAA,EAAA,CAAA;CAGb,CAAA;AAGP"}
1
+ {"version":3,"file":"confirmation.js","names":["Ban","LucideBan","Check","LucideCheck","Clock","LucideClock","Lock","LucideLock","ShieldQuestion","LucideShieldQuestion","createEffect","createSignal","createUniqueId","Show","splitProps","cn","Button","CodeBlock","DiffBlock","Spinner","boundText","confirmationOutcome","decisionReason","isAwaitingAnswer","settleDecision","fastIcon","kind","code","language","title","patch","state","description","details","onApprove","onDeny","approveLabel","denyLabel","disabledReason","error","resolvedBy","resolvedAt","children","Confirmation","props","local","rest","uid","titleId","reasonId","awaiting","pending","setPending","undefined","failure","setFailure","inflight","root","outcome","reasonFor","handler","missing","hasHandler","unavailableFallback","missingFallback","approveReason","denyReason","reasons","Set","filter","Boolean","join","choose","choice","blocked","result","ok","message","wasAwaiting","now","active","document","activeElement","body","contains","focus","buttonProps","disabled","onClick","_el$","_tmpl$6","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","_$use","element","_$setAttribute","_$spread","_$mergeProps","class","_$insert","_$createComponent","when","_el$6","_tmpl$","_el$7","_tmpl$2","Details","fallback","_el$10","_tmpl$7","_el$8","_tmpl$3","_el$9","_tmpl$4","_el$0","_tmpl$5","_el$1","type","variant","size","label","_$memo","bounded","value","limit","complete","wrap","maxHeight","diff","_el$11","_tmpl$8"],"sources":["../../../../src/components/composites/confirmation/confirmation.tsx"],"sourcesContent":["import {\n Ban as LucideBan,\n Check as LucideCheck,\n Clock as LucideClock,\n Lock as LucideLock,\n ShieldQuestion as LucideShieldQuestion,\n} from 'lucide-solid'\nimport {\n createEffect,\n createSignal,\n createUniqueId,\n Show,\n splitProps,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport { CodeBlock } from '../../ui/code-block'\nimport { DiffBlock } from '../../ui/diff-block'\nimport { Spinner } from '../../ui/spinner'\nimport { REASON_TEXT_LIMIT, boundText } from '#lib/text'\nimport {\n confirmationOutcome,\n decisionReason,\n isAwaitingAnswer,\n settleDecision,\n type ConfirmationState,\n} from './confirmation-model'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Ban = fastIcon(LucideBan)\nconst Check = fastIcon(LucideCheck)\nconst Clock = fastIcon(LucideClock)\nconst Lock = fastIcon(LucideLock)\nconst ShieldQuestion = fastIcon(LucideShieldQuestion)\n\n/**\n * Confirmation.\n *\n * The agent has stopped a tool and will not continue until the person approves or\n * denies it. Like `Questionnaire`, this is one of the two elements in a transcript\n * the reader *must* act on, so it is allowed a card surface — and the border is\n * the focus ring's colour only while it is waiting. Once answered it drops to a\n * hairline and a one-line record, because a settled decision should read as\n * history, not as something still asking.\n *\n * ## It shows what is being approved, and nothing else\n *\n * `title` and `description` say what the tool wants to do; `details` is the\n * evidence, rendered as `CodeBlock size=\"sm\"` (a command, a request) or\n * `DiffBlock` (a patch). Details are text: never interpreted, and a long one\n * scrolls inside its block. Approve and Deny exist only while the request is\n * open; afterwards they are replaced by the outcome, with *who* and *when* only if\n * the host supplied them.\n *\n * ## The host owns authority\n *\n * Whether this client may answer is not decided here. No handler, or a host\n * `disabledReason`, or the `unavailable` state, leaves the buttons visible and\n * disabled with the reason beside them in words — never hidden, because a reader\n * who cannot see the choice cannot tell whether the agent is waiting on them.\n *\n * ## Answering is a round trip\n *\n * `onApprove` / `onDeny` may return a promise. While one is pending both buttons\n * refuse input (a synchronous guard as well as the signal, so a double click in\n * one tick cannot submit twice) and the pressed one shows a spinner. A failure\n * shows `error` (or the rejection's own message) and re-enables the buttons. The\n * buttons use `aria-disabled` rather than `disabled`: a native disabled button\n * drops focus, and the reader's place would be lost mid-decision. When the state\n * settles, focus moves to the outcome line if it was in the card, so a keyboard\n * user is not stranded on a control that no longer exists.\n */\nexport type ConfirmationDetails =\n | Readonly<{ kind: 'code'; code: string; language?: string; title?: string }>\n | Readonly<{ kind: 'diff'; patch: string; title?: string }>\n\nexport type ConfirmationProps = Omit<ComponentProps<'section'>, 'title' | 'onError'> & {\n state?: ConfirmationState\n /** What the tool wants to do, as a short sentence. */\n title: string\n description?: string\n details?: ConfirmationDetails\n onApprove?: () => void | Promise<void>\n onDeny?: () => void | Promise<void>\n approveLabel?: string\n denyLabel?: string\n /** Why the choice cannot be made right now; shown in words beside the buttons. */\n disabledReason?: string\n /** A failed answer, in words. Overrides the rejection's own message. */\n error?: string\n /** Who answered, once settled. Omit if unknown; nothing is assumed. */\n resolvedBy?: string\n /** When it was answered, already formatted for the reader. Omit if unknown. */\n resolvedAt?: string\n /** Extra content between the details and the buttons. */\n children?: JSX.Element\n}\n\ntype Choice = 'approve' | 'deny'\n\nexport function Confirmation(props: ConfirmationProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'state',\n 'title',\n 'description',\n 'details',\n 'onApprove',\n 'onDeny',\n 'approveLabel',\n 'denyLabel',\n 'disabledReason',\n 'error',\n 'resolvedBy',\n 'resolvedAt',\n 'children',\n ])\n const uid = createUniqueId()\n const titleId = `${uid}-title`\n const reasonId = `${uid}-reason`\n const state = (): ConfirmationState => local.state ?? 'requested'\n const awaiting = () => isAwaitingAnswer(state())\n const [pending, setPending] = createSignal<Choice | undefined>(undefined)\n const [failure, setFailure] = createSignal<string | undefined>(undefined)\n let inflight = false\n let root: HTMLElement | undefined\n let outcome: HTMLParagraphElement | undefined\n\n const reasonFor = (handler: (() => void | Promise<void>) | undefined, missing: string) => {\n if (pending() !== undefined) return 'Your answer is being sent.'\n return decisionReason({\n state: state(),\n disabledReason: local.disabledReason,\n hasHandler: handler !== undefined,\n unavailableFallback: 'This request cannot be answered right now.',\n missingFallback: missing,\n })\n }\n const approveReason = () => reasonFor(local.onApprove, 'Approving is not available here.')\n const denyReason = () => reasonFor(local.onDeny, 'Denying is not available here.')\n // One sentence per distinct reason, so two identical reasons are not read twice.\n const reasons = () => [...new Set([approveReason(), denyReason()].filter(Boolean))].join(' ')\n const error = () => (local.error ? boundText(local.error, REASON_TEXT_LIMIT) : failure())\n\n const choose = async (choice: Choice) => {\n const handler = choice === 'approve' ? local.onApprove : local.onDeny\n const blocked = choice === 'approve' ? approveReason() : denyReason()\n if (inflight || blocked || !awaiting()) return\n inflight = true\n setPending(choice)\n setFailure(undefined)\n const result = await settleDecision(handler)\n inflight = false\n setPending(undefined)\n if (!result.ok) setFailure(result.message)\n }\n\n // The buttons are replaced by the outcome line; keep a keyboard reader in the card.\n // The previous value is kept by hand: `on(..., { defer: true })` does not record the\n // input of its skipped first run, so its \"previous\" is undefined on the first change.\n let wasAwaiting = awaiting()\n createEffect(() => {\n const now = awaiting()\n if (wasAwaiting && !now) {\n const active = document.activeElement\n if (active === null || active === document.body || root?.contains(active)) {\n outcome?.focus()\n }\n }\n wasAwaiting = now\n })\n\n const buttonProps = (choice: Choice) => {\n const blocked = () => (choice === 'approve' ? approveReason() : denyReason())\n const disabled = () => pending() !== undefined || blocked() !== undefined\n return {\n 'aria-disabled': disabled() || undefined,\n 'aria-describedby': blocked() ? reasonId : undefined,\n onClick: () => void choose(choice),\n }\n }\n\n return (\n <section\n ref={(element) => (root = element)}\n data-slot=\"confirmation\"\n data-state={state()}\n aria-labelledby={titleId}\n class={cn(\n 'flex w-full max-w-xl min-w-0 flex-col gap-3 rounded-xl border bg-card p-4',\n {\n 'border-ring': awaiting(),\n 'border-border': !awaiting(),\n },\n local.class\n )}\n {...rest}\n >\n <header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={state() === 'approved'}>\n <Check class=\"text-success\" />\n </Show>\n <Show when={state() === 'denied'}>\n <Ban />\n </Show>\n <Show when={state() === 'expired'}>\n <Clock />\n </Show>\n <Show when={state() === 'unavailable'}>\n <Lock />\n </Show>\n <Show when={state() === 'requested'}>\n <ShieldQuestion />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 id={titleId} class=\"m-0 text-sm font-semibold [overflow-wrap:anywhere]\">\n {boundText(local.title, 200)}\n </h3>\n <Show when={local.description}>\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {boundText(local.description ?? '', 400)}\n </p>\n </Show>\n </div>\n <Show when={awaiting()}>\n <span class=\"shrink-0 text-xs text-muted-foreground\">\n {state() === 'requested' ? 'Needs your answer' : 'Cannot be answered now'}\n </span>\n </Show>\n </header>\n\n <Show when={local.details}>{(details) => <Details details={details()} />}</Show>\n\n {local.children}\n\n <Show\n when={awaiting()}\n fallback={\n <p\n ref={(element) => (outcome = element)}\n tabindex=\"-1\"\n role=\"status\"\n class=\"m-0 flex items-center gap-1.5 text-xs text-muted-foreground outline-none\"\n >\n {confirmationOutcome(state(), local.resolvedBy, local.resolvedAt)}\n </p>\n }\n >\n <Show when={reasons()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {reasons()}\n </p>\n </Show>\n <Show when={error()}>\n <p role=\"alert\" class=\"m-0 text-xs text-destructive [overflow-wrap:anywhere]\">\n {error()}\n </p>\n </Show>\n <footer class=\"flex flex-wrap items-center justify-end gap-2\">\n <Button type=\"button\" variant=\"outline\" size=\"sm\" {...buttonProps('deny')}>\n <Show when={pending() === 'deny'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.denyLabel ?? 'Deny'}\n </Button>\n <Button type=\"button\" size=\"sm\" {...buttonProps('approve')}>\n <Show when={pending() === 'approve'}>\n <Spinner size=\"sm\" label={false} />\n </Show>\n {local.approveLabel ?? 'Approve'}\n </Button>\n {/* Present from the start: a live region inserted with its text is not reliably announced. */}\n <span role=\"status\" class=\"visually-hidden\">\n {pending() !== undefined ? 'Sending your answer' : ''}\n </span>\n </footer>\n </Show>\n </section>\n )\n}\n\n/** A name from the host or the model, cleaned and clipped before it reaches a header. */\nfunction bounded(value: string | undefined, limit: number): string | undefined {\n return value ? boundText(value, limit) || undefined : undefined\n}\n\nfunction Details(props: { details: ConfirmationDetails }) {\n return (\n <Show\n when={props.details.kind === 'diff' && props.details}\n fallback={\n <CodeBlock\n size=\"sm\"\n code={(props.details as Extract<ConfirmationDetails, { kind: 'code' }>).code}\n language={bounded(\n (props.details as Extract<ConfirmationDetails, { kind: 'code' }>).language,\n 24\n )}\n title={bounded(props.details.title, 80)}\n complete\n wrap\n maxHeight=\"14rem\"\n />\n }\n >\n {(diff) => (\n // The diff block has no height cap of its own, so the cap lives here; a\n // scroller must be focusable, hence the labelled region and tab stop.\n <div\n role=\"region\"\n aria-label=\"Proposed changes\"\n tabindex=\"0\"\n class=\"max-h-64 overflow-auto rounded-xl outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n >\n <DiffBlock\n patch={(diff() as Extract<ConfirmationDetails, { kind: 'diff' }>).patch}\n title={bounded(diff().title, 80)}\n complete\n />\n </div>\n )}\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgCA,IAAMA,QAAMyB,SAASxB,GAAS;AAC9B,IAAMC,UAAQuB,SA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AmC;CAC7E,OAAOD,QAAQ3G,UAAU2G,OAAOC,KAAK,KAAK3E,KAAAA,IAAYA,KAAAA;AACxD;AAEA,SAASyD,QAAQlE,OAAyC;CACxD,OAAA4D,gBACG3F,MAAI;EAAA,IACH4F,OAAI;GAAA,OAAEoB,WAAAjF,MAAMX,QAAQP,SAAS,MAAM,CAAA,CAAA,KAAIkB,MAAMX;EAAO;EAAA,IACpD8E,WAAQ;GAAA,OAAAP,gBACLvF,WAAS;IACR0G,MAAI;IAAA,IACJhG,OAAI;KAAA,OAAGiB,MAAMX,QAA2DN;IAAI;IAAA,IAC5EC,WAAQ;KAAA,OAAEkG,QACPlF,MAAMX,QAA2DL,UAClE,EACF;IAAC;IAAA,IACDC,QAAK;KAAA,OAAEiG,QAAQlF,MAAMX,QAAQJ,OAAO,EAAE;IAAC;IACvCoG,UAAQ;IACRC,MAAI;IACJC,WAAS;GAAA,CAAA;EAAA;EAAAzF,WAIX0F,gBAEA;GAAA,IAAAC,SAAAC,QAAA;GAAA/B,OAAA8B,QAAA7B,gBAOGtF,WAAS;IAAA,IACRY,QAAK;KAAA,OAAGsG,KAAK,CAAC,CAAoDtG;IAAK;IAAA,IACvED,QAAK;KAAA,OAAEiG,QAAQM,KAAK,CAAC,CAACvG,OAAO,EAAE;IAAC;IAChCoG,UAAQ;GAAA,CAAA,CAAA;GAAA,OAAAI;EAAA,EAAA,CAAA;CAGb,CAAA;AAGP"}
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/context/context.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AAGrE,OAAO,EAAE,OAAO,EAAgD,MAAM,kBAAkB,CAAA;AAExF,OAAO,EAWL,KAAK,cAAc,EAEpB,MAAM,iBAAiB,CAAA;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG;IAC1C,kFAAkF;IAClF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC,WAAW,CAAC,CAAA;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAMD,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,kCAmG1C"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/context/context.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AAGrE,OAAO,EAAE,OAAO,EAAgD,MAAM,kBAAkB,CAAA;AAExF,OAAO,EAWL,KAAK,cAAc,EAEpB,MAAM,iBAAiB,CAAA;AAOxB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG;IAC1C,kFAAkF;IAClF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC,WAAW,CAAC,CAAA;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAMD,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,kCAmG1C"}
@@ -3,6 +3,7 @@ import { Button } from "../../ui/button/button.js";
3
3
  import { Popover, PopoverContent, PopoverTitle, PopoverTrigger } from "../../ui/popover/popover.js";
4
4
  import { Progress } from "../../ui/progress/progress.js";
5
5
  import { breakdownRows, contextLabel, contextLevel, contextLevelWord, contextPercent, contextShort, formatCost, formatExact, hasContextFigures, isFigure } from "./context-model.js";
6
+ import { fastIcon } from "../../../lib/fast-icon.js";
6
7
  import { className, createComponent, effect, insert, setAttribute, template } from "solid-js/web";
7
8
  import { OctagonAlert, TriangleAlert } from "lucide-solid";
8
9
  import { For, Show, splitProps } from "solid-js";
@@ -13,6 +14,8 @@ var _tmpl$3 = /*#__PURE__*/ template(`<p><span class=text-foreground>`);
13
14
  var _tmpl$4 = /*#__PURE__*/ template(`<div class="flex flex-col gap-2 px-2 pb-2"><dl class="m-0 flex flex-col gap-1 text-sm">`);
14
15
  var _tmpl$5 = /*#__PURE__*/ template(`<svg aria-hidden=true viewBox="0 0 16 16"fill=none class=size-4><circle cx=8 cy=8 r=6 stroke-width=2 class=stroke-border></circle><circle cx=8 cy=8 r=6 stroke-width=2 stroke-linecap=round transform="rotate(-90 8 8)"class=stroke-primary>`);
15
16
  var _tmpl$6 = /*#__PURE__*/ template(`<div class="flex items-baseline justify-between gap-4"><dt class=text-muted-foreground></dt><dd class="m-0 text-end tabular-nums">`);
17
+ var OctagonAlert$1 = fastIcon(OctagonAlert);
18
+ var TriangleAlert$1 = fastIcon(TriangleAlert);
16
19
  var RING_CIRCUMFERENCE = 2 * Math.PI * 6;
17
20
  function Context(props) {
18
21
  const [local, figures] = splitProps(props, [
@@ -76,10 +79,10 @@ function Context(props) {
76
79
  return level() === "high";
77
80
  },
78
81
  get fallback() {
79
- return createComponent(OctagonAlert, {});
82
+ return createComponent(OctagonAlert$1, {});
80
83
  },
81
84
  get children() {
82
- return createComponent(TriangleAlert, {});
85
+ return createComponent(TriangleAlert$1, {});
83
86
  }
84
87
  }));
85
88
  effect(() => className(_el$, cn({
@@ -126,10 +129,10 @@ function Context(props) {
126
129
  return level() === "high";
127
130
  },
128
131
  get fallback() {
129
- return createComponent(OctagonAlert, { "class": "size-4" });
132
+ return createComponent(OctagonAlert$1, { "class": "size-4" });
130
133
  },
131
134
  get children() {
132
- return createComponent(TriangleAlert, { "class": "size-4" });
135
+ return createComponent(TriangleAlert$1, { "class": "size-4" });
133
136
  }
134
137
  }), _el$5);
135
138
  insert(_el$5, levelWord);
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","names":["OctagonAlert","TriangleAlert","For","Show","splitProps","cn","Button","Popover","PopoverContent","PopoverTitle","PopoverTrigger","Progress","breakdownRows","contextLabel","contextLevel","contextLevelWord","contextPercent","contextShort","formatCost","formatExact","hasContextFigures","isFigure","locale","placement","class","RING_RADIUS","RING_CIRCUMFERENCE","Math","PI","Context","props","local","figures","percent","used","total","level","levelWord","rows","breakdown","remaining","undefined","cost","amount","_$createComponent","when","children","gutter","as","variant","size","fallback","Ring","_el$","_tmpl$","_$insert","_$effect","_$className","_el$2","_tmpl$2","_el$3","_tmpl$4","_el$6","firstChild","value","min","minValue","maxValue","label","getValueLabel","_el$4","_tmpl$3","_el$5","Row","each","row","filled","max","_el$7","_tmpl$5","_el$9","nextSibling","_$setAttribute","_el$0","_tmpl$6","_el$1","_el$10"],"sources":["../../../../src/components/composites/context/context.tsx"],"sourcesContent":["import { OctagonAlert, TriangleAlert } from 'lucide-solid'\nimport { For, Show, splitProps, type ComponentProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport { Popover, PopoverContent, PopoverTitle, PopoverTrigger } from '../../ui/popover'\nimport { Progress } from '../../ui/progress'\nimport {\n breakdownRows,\n contextLabel,\n contextLevel,\n contextLevelWord,\n contextPercent,\n contextShort,\n formatCost,\n formatExact,\n hasContextFigures,\n isFigure,\n type ContextFigures,\n type ContextLevel,\n} from './context-model'\n\n/**\n * Context.\n *\n * How much of the model's context window is in use, as a compact trigger that\n * opens the figures behind it. It sits next to the composer, where the reader\n * decides whether to keep going or start fresh, so the trigger is small and the\n * detail is a press away rather than permanent chrome.\n *\n * ## Every figure is a claim, so every figure is optional\n *\n * A host passes whatever it knows: `used`, `total`, a `breakdown` (input, output,\n * cache read and write, reasoning), a `cost`. A missing value is omitted, never\n * drawn as 0, which would say \"empty\" about a window nobody measured, and when\n * *nothing* is known the trigger is not rendered at all (`hasContextFigures`).\n * Nothing is estimated here; the one derived row, \"Remaining\", appears only when\n * both `used` and `total` are known and `used` does not exceed `total`.\n *\n * ## Never colour alone\n *\n * The ring shows the fraction; past 75% the ring gives way to a warning glyph\n * (triangle, then octagon at 90% and above), the popover says \"Getting full\",\n * \"Nearly full\" or \"Full\" in words, and the trigger's accessible name speaks the\n * same. An overrun is reported as it is (\"112%\"); only the ring saturates.\n *\n * It is a `Popover`, not a hover card: the figures must be reachable by keyboard\n * and by touch, and Escape closes it and returns focus to the trigger.\n */\nexport type ContextProps = ContextFigures & {\n /** BCP 47 tag for number formatting. Defaults to `en-US`, so output is stable. */\n locale?: string\n placement?: ComponentProps<typeof Popover>['placement']\n class?: string\n}\n\n// A circle of radius 6 in a 16-unit box; the dash array is the fraction of this.\nconst RING_RADIUS = 6\nconst RING_CIRCUMFERENCE = 2 * Math.PI * RING_RADIUS\n\nexport function Context(props: ContextProps) {\n const [local, figures] = splitProps(props, ['locale', 'placement', 'class'])\n const locale = () => local.locale ?? 'en-US'\n const percent = () => contextPercent(figures.used, figures.total)\n const level = (): ContextLevel => contextLevel(percent())\n const levelWord = () => contextLevelWord(level())\n const rows = () => breakdownRows(figures.breakdown)\n const remaining = () =>\n isFigure(figures.used) && isFigure(figures.total) && figures.used <= figures.total\n ? figures.total - figures.used\n : undefined\n const cost = () => (figures.cost && isFigure(figures.cost.amount) ? figures.cost : undefined)\n\n return (\n <Show when={hasContextFigures(figures)}>\n <Popover placement={local.placement ?? 'top'} gutter={6}>\n <PopoverTrigger\n as={Button}\n variant=\"ghost\"\n size=\"xs\"\n data-slot=\"context\"\n data-level={level()}\n aria-label={contextLabel(figures, locale())}\n class={local.class}\n >\n <Show\n when={level() !== 'normal'}\n fallback={\n <Show when={percent() !== undefined}>\n <Ring percent={percent() ?? 0} />\n </Show>\n }\n >\n <span\n aria-hidden=\"true\"\n class={cn({\n 'text-warning': level() === 'high',\n 'text-destructive': level() === 'critical' || level() === 'full',\n })}\n >\n <Show when={level() === 'high'} fallback={<OctagonAlert />}>\n <TriangleAlert />\n </Show>\n </span>\n </Show>\n <span aria-hidden=\"true\" class=\"tabular-nums\">\n {contextShort(figures, locale())}\n </span>\n </PopoverTrigger>\n <PopoverContent class=\"w-72 max-w-full\">\n <PopoverTitle>Context window</PopoverTitle>\n <div class=\"flex flex-col gap-2 px-2 pb-2\">\n <Show when={percent() !== undefined}>\n <Progress\n value={Math.min(percent() ?? 0, 100)}\n minValue={0}\n maxValue={100}\n label=\"Context used\"\n getValueLabel={() => `${percent()}% used`}\n />\n </Show>\n <Show when={levelWord()}>\n <p\n class={cn('m-0 flex items-center gap-1.5 text-sm font-medium', {\n 'text-warning': level() === 'high',\n 'text-destructive': level() === 'critical' || level() === 'full',\n })}\n >\n <Show when={level() === 'high'} fallback={<OctagonAlert class=\"size-4\" />}>\n <TriangleAlert class=\"size-4\" />\n </Show>\n <span class=\"text-foreground\">{levelWord()}</span>\n </p>\n </Show>\n <dl class=\"m-0 flex flex-col gap-1 text-sm\">\n <Show when={isFigure(figures.used)}>\n <Row label=\"Used\" value={`${formatExact(figures.used ?? 0, locale())} tokens`} />\n </Show>\n <Show when={isFigure(figures.total)}>\n <Row label=\"Window\" value={`${formatExact(figures.total ?? 0, locale())} tokens`} />\n </Show>\n <Show when={remaining() !== undefined}>\n <Row\n label=\"Remaining\"\n value={`${formatExact(remaining() ?? 0, locale())} tokens`}\n />\n </Show>\n <For each={rows()}>\n {(row) => <Row label={row.label} value={formatExact(row.value, locale())} />}\n </For>\n <Show when={cost()}>\n {(value) => <Row label=\"Cost\" value={formatCost(value(), locale())} />}\n </Show>\n </dl>\n </div>\n </PopoverContent>\n </Popover>\n </Show>\n )\n}\n\nfunction Ring(props: { percent: number }) {\n const filled = () => (RING_CIRCUMFERENCE * Math.min(Math.max(props.percent, 0), 100)) / 100\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" fill=\"none\" class=\"size-4\">\n <circle cx=\"8\" cy=\"8\" r={RING_RADIUS} stroke-width=\"2\" class=\"stroke-border\" />\n <circle\n cx=\"8\"\n cy=\"8\"\n r={RING_RADIUS}\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-dasharray={`${filled()} ${RING_CIRCUMFERENCE}`}\n transform=\"rotate(-90 8 8)\"\n class=\"stroke-primary\"\n />\n </svg>\n )\n}\n\nfunction Row(props: { label: string; value: string }) {\n return (\n <div class=\"flex items-baseline justify-between gap-4\">\n <dt class=\"text-muted-foreground\">{props.label}</dt>\n <dd class=\"m-0 text-end tabular-nums\">{props.value}</dd>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAyDA,IAAM0B,qBAAqB,IAAIC,KAAKC,KAAKH;AAEzC,SAAgBI,QAAQC,OAAqB;CAC3C,MAAM,CAACC,OAAOC,WAAW5B,WAAW0B,OAAO;EAAC;EAAU;EAAa;CAAO,CAAC;CAC3E,MAAMR,eAAeS,MAAMT,UAAU;CACrC,MAAMW,gBAAgBjB,eAAegB,QAAQE,MAAMF,QAAQG,KAAK;CAChE,MAAMC,cAA4BtB,aAAamB,QAAQ,CAAC;CACxD,MAAMI,kBAAkBtB,iBAAiBqB,MAAM,CAAC;CAChD,MAAME,aAAa1B,cAAcoB,QAAQO,SAAS;CAClD,MAAMC,kBACJnB,SAASW,QAAQE,IAAI,KAAKb,SAASW,QAAQG,KAAK,KAAKH,QAAQE,QAAQF,QAAQG,QACzEH,QAAQG,QAAQH,QAAQE,OACxBO,KAAAA;CACN,MAAMC,aAAcV,QAAQU,QAAQrB,SAASW,QAAQU,KAAKC,MAAM,IAAIX,QAAQU,OAAOD,KAAAA;CAEnF,OAAAG,gBACGzC,MAAI;EAAA,IAAC0C,OAAI;GAAA,OAAEzB,kBAAkBY,OAAO;EAAC;EAAA,IAAAc,WAAA;GAAA,OAAAF,gBACnCrC,SAAO;IAAA,IAACgB,YAAS;KAAA,OAAEQ,MAAMR,aAAa;IAAK;IAAEwB,QAAQ;IAAC,IAAAD,WAAA;KAAA,OAAA,CAAAF,gBACpDlC,gBAAc;MACbsC,IAAI1C;MACJ2C,SAAO;MACPC,MAAI;MAAA,aAAA;MAAA,KAAA,gBAAA;OAAA,OAEQd,MAAM;MAAC;MAAA,KAAA,gBAAA;OAAA,OACPvB,aAAamB,SAASV,OAAO,CAAC;MAAC;MAAA,KAAA,W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,SAASR,KAAKtB,OAA4B;CACxC,MAAM8C,eAAgBlD,qBAAqBC,KAAKsC,IAAItC,KAAKkD,IAAI/C,MAAMG,SAAS,CAAC,GAAG,GAAG,IAAK;CACxF,cAAA;EAAA,IAAA6C,QAAAC,QAAA,GAAAC,QAAAF,MAAAf,WAAAkB;EAAAzB,aAAA0B,aAAAF,OAAA,oBASwB,GAAGJ,OAAO,EAAC,GAAIlD,oBAAoB,CAAA;EAAA,OAAAoD;CAAA,EAAA,CAAA;AAM7D;AAEA,SAASL,IAAI3C,OAAyC;CACpD,cAAA;EAAA,IAAAqD,QAAAC,QAAA,GAAAC,QAAAF,MAAApB,YAAAuB,SAAAD,MAAAJ;EAAA1B,OAAA8B,aAEuCvD,MAAMsC,KAAK;EAAAb,OAAA+B,cACPxD,MAAMkC,KAAK;EAAA,OAAAmB;CAAA,EAAA,CAAA;AAGxD"}
1
+ {"version":3,"file":"context.js","names":["OctagonAlert","LucideOctagonAlert","TriangleAlert","LucideTriangleAlert","For","Show","splitProps","cn","Button","Popover","PopoverContent","PopoverTitle","PopoverTrigger","Progress","breakdownRows","contextLabel","contextLevel","contextLevelWord","contextPercent","contextShort","formatCost","formatExact","hasContextFigures","isFigure","fastIcon","locale","placement","class","RING_RADIUS","RING_CIRCUMFERENCE","Math","PI","Context","props","local","figures","percent","used","total","level","levelWord","rows","breakdown","remaining","undefined","cost","amount","_$createComponent","when","children","gutter","as","variant","size","fallback","Ring","_el$","_tmpl$","_$insert","_$effect","_$className","_el$2","_tmpl$2","_el$3","_tmpl$4","_el$6","firstChild","value","min","minValue","maxValue","label","getValueLabel","_el$4","_tmpl$3","_el$5","Row","each","row","filled","max","_el$7","_tmpl$5","_el$9","nextSibling","_$setAttribute","_el$0","_tmpl$6","_el$1","_el$10"],"sources":["../../../../src/components/composites/context/context.tsx"],"sourcesContent":["import {\n OctagonAlert as LucideOctagonAlert,\n TriangleAlert as LucideTriangleAlert,\n} from 'lucide-solid'\nimport { For, Show, splitProps, type ComponentProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport { Popover, PopoverContent, PopoverTitle, PopoverTrigger } from '../../ui/popover'\nimport { Progress } from '../../ui/progress'\nimport {\n breakdownRows,\n contextLabel,\n contextLevel,\n contextLevelWord,\n contextPercent,\n contextShort,\n formatCost,\n formatExact,\n hasContextFigures,\n isFigure,\n type ContextFigures,\n type ContextLevel,\n} from './context-model'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst OctagonAlert = fastIcon(LucideOctagonAlert)\nconst TriangleAlert = fastIcon(LucideTriangleAlert)\n\n/**\n * Context.\n *\n * How much of the model's context window is in use, as a compact trigger that\n * opens the figures behind it. It sits next to the composer, where the reader\n * decides whether to keep going or start fresh, so the trigger is small and the\n * detail is a press away rather than permanent chrome.\n *\n * ## Every figure is a claim, so every figure is optional\n *\n * A host passes whatever it knows: `used`, `total`, a `breakdown` (input, output,\n * cache read and write, reasoning), a `cost`. A missing value is omitted, never\n * drawn as 0, which would say \"empty\" about a window nobody measured, and when\n * *nothing* is known the trigger is not rendered at all (`hasContextFigures`).\n * Nothing is estimated here; the one derived row, \"Remaining\", appears only when\n * both `used` and `total` are known and `used` does not exceed `total`.\n *\n * ## Never colour alone\n *\n * The ring shows the fraction; past 75% the ring gives way to a warning glyph\n * (triangle, then octagon at 90% and above), the popover says \"Getting full\",\n * \"Nearly full\" or \"Full\" in words, and the trigger's accessible name speaks the\n * same. An overrun is reported as it is (\"112%\"); only the ring saturates.\n *\n * It is a `Popover`, not a hover card: the figures must be reachable by keyboard\n * and by touch, and Escape closes it and returns focus to the trigger.\n */\nexport type ContextProps = ContextFigures & {\n /** BCP 47 tag for number formatting. Defaults to `en-US`, so output is stable. */\n locale?: string\n placement?: ComponentProps<typeof Popover>['placement']\n class?: string\n}\n\n// A circle of radius 6 in a 16-unit box; the dash array is the fraction of this.\nconst RING_RADIUS = 6\nconst RING_CIRCUMFERENCE = 2 * Math.PI * RING_RADIUS\n\nexport function Context(props: ContextProps) {\n const [local, figures] = splitProps(props, ['locale', 'placement', 'class'])\n const locale = () => local.locale ?? 'en-US'\n const percent = () => contextPercent(figures.used, figures.total)\n const level = (): ContextLevel => contextLevel(percent())\n const levelWord = () => contextLevelWord(level())\n const rows = () => breakdownRows(figures.breakdown)\n const remaining = () =>\n isFigure(figures.used) && isFigure(figures.total) && figures.used <= figures.total\n ? figures.total - figures.used\n : undefined\n const cost = () => (figures.cost && isFigure(figures.cost.amount) ? figures.cost : undefined)\n\n return (\n <Show when={hasContextFigures(figures)}>\n <Popover placement={local.placement ?? 'top'} gutter={6}>\n <PopoverTrigger\n as={Button}\n variant=\"ghost\"\n size=\"xs\"\n data-slot=\"context\"\n data-level={level()}\n aria-label={contextLabel(figures, locale())}\n class={local.class}\n >\n <Show\n when={level() !== 'normal'}\n fallback={\n <Show when={percent() !== undefined}>\n <Ring percent={percent() ?? 0} />\n </Show>\n }\n >\n <span\n aria-hidden=\"true\"\n class={cn({\n 'text-warning': level() === 'high',\n 'text-destructive': level() === 'critical' || level() === 'full',\n })}\n >\n <Show when={level() === 'high'} fallback={<OctagonAlert />}>\n <TriangleAlert />\n </Show>\n </span>\n </Show>\n <span aria-hidden=\"true\" class=\"tabular-nums\">\n {contextShort(figures, locale())}\n </span>\n </PopoverTrigger>\n <PopoverContent class=\"w-72 max-w-full\">\n <PopoverTitle>Context window</PopoverTitle>\n <div class=\"flex flex-col gap-2 px-2 pb-2\">\n <Show when={percent() !== undefined}>\n <Progress\n value={Math.min(percent() ?? 0, 100)}\n minValue={0}\n maxValue={100}\n label=\"Context used\"\n getValueLabel={() => `${percent()}% used`}\n />\n </Show>\n <Show when={levelWord()}>\n <p\n class={cn('m-0 flex items-center gap-1.5 text-sm font-medium', {\n 'text-warning': level() === 'high',\n 'text-destructive': level() === 'critical' || level() === 'full',\n })}\n >\n <Show when={level() === 'high'} fallback={<OctagonAlert class=\"size-4\" />}>\n <TriangleAlert class=\"size-4\" />\n </Show>\n <span class=\"text-foreground\">{levelWord()}</span>\n </p>\n </Show>\n <dl class=\"m-0 flex flex-col gap-1 text-sm\">\n <Show when={isFigure(figures.used)}>\n <Row label=\"Used\" value={`${formatExact(figures.used ?? 0, locale())} tokens`} />\n </Show>\n <Show when={isFigure(figures.total)}>\n <Row label=\"Window\" value={`${formatExact(figures.total ?? 0, locale())} tokens`} />\n </Show>\n <Show when={remaining() !== undefined}>\n <Row\n label=\"Remaining\"\n value={`${formatExact(remaining() ?? 0, locale())} tokens`}\n />\n </Show>\n <For each={rows()}>\n {(row) => <Row label={row.label} value={formatExact(row.value, locale())} />}\n </For>\n <Show when={cost()}>\n {(value) => <Row label=\"Cost\" value={formatCost(value(), locale())} />}\n </Show>\n </dl>\n </div>\n </PopoverContent>\n </Popover>\n </Show>\n )\n}\n\nfunction Ring(props: { percent: number }) {\n const filled = () => (RING_CIRCUMFERENCE * Math.min(Math.max(props.percent, 0), 100)) / 100\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" fill=\"none\" class=\"size-4\">\n <circle cx=\"8\" cy=\"8\" r={RING_RADIUS} stroke-width=\"2\" class=\"stroke-border\" />\n <circle\n cx=\"8\"\n cy=\"8\"\n r={RING_RADIUS}\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-dasharray={`${filled()} ${RING_CIRCUMFERENCE}`}\n transform=\"rotate(-90 8 8)\"\n class=\"stroke-primary\"\n />\n </svg>\n )\n}\n\nfunction Row(props: { label: string; value: string }) {\n return (\n <div class=\"flex items-baseline justify-between gap-4\">\n <dt class=\"text-muted-foreground\">{props.label}</dt>\n <dd class=\"m-0 text-end tabular-nums\">{props.value}</dd>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA0BA,IAAMA,iBAAewB,SAASvB,YAAkB;AAChD,IAAMC,kBAAgBsB,SAASrB,aAAmB;AAsClD,IAAM0B,qBAAqB,IAAIC,KAAKC,KAAKH;AAEzC,SAAgBI,QAA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