@adea-ai/ui 0.152.1 → 0.152.3

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 (271) hide show
  1. package/dist/components/composites/about-dialog/about-dialog.js +2 -2
  2. package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
  3. package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
  4. package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
  5. package/dist/components/composites/account-menu/account-menu.js.map +1 -1
  6. package/dist/components/composites/action-button/action-button.js.map +1 -1
  7. package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
  8. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  9. package/dist/components/composites/appearance-editor/appearance-editor.js +3 -3
  10. package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
  11. package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
  12. package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
  13. package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
  14. package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
  15. package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
  16. package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
  17. package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
  18. package/dist/components/composites/chat/chat.js.map +1 -1
  19. package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
  20. package/dist/components/composites/confirmation/confirmation.js.map +1 -1
  21. package/dist/components/composites/context/context.js.map +1 -1
  22. package/dist/components/composites/file-tree/file-tree.js.map +1 -1
  23. package/dist/components/composites/help-center/help-center.js.map +1 -1
  24. package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
  25. package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
  26. package/dist/components/composites/list-row/list-row-control.js.map +1 -1
  27. package/dist/components/composites/list-row/list-row.js.map +1 -1
  28. package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
  29. package/dist/components/composites/model-selector/model-selector.js +3 -0
  30. package/dist/components/composites/model-selector/model-selector.js.map +1 -1
  31. package/dist/components/composites/plan/plan.js.map +1 -1
  32. package/dist/components/composites/queue/queue.js.map +1 -1
  33. package/dist/components/composites/reasoning/reasoning.js.map +1 -1
  34. package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
  35. package/dist/components/composites/settings/settings-layout.js.map +1 -1
  36. package/dist/components/composites/settings/settings-navigation.js.map +1 -1
  37. package/dist/components/composites/settings/settings.js.map +1 -1
  38. package/dist/components/composites/sources/sources.js.map +1 -1
  39. package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
  40. package/dist/components/composites/stat/stat.js.map +1 -1
  41. package/dist/components/composites/subagent/subagent.js.map +1 -1
  42. package/dist/components/composites/suggestion/suggestion.js.map +1 -1
  43. package/dist/components/composites/task/task.js.map +1 -1
  44. package/dist/components/composites/terminal/terminal.js +1 -1
  45. package/dist/components/composites/terminal/terminal.js.map +1 -1
  46. package/dist/components/composites/test-results/test-results.js.map +1 -1
  47. package/dist/components/composites/tool/tool.js.map +1 -1
  48. package/dist/components/composites/tree/tree.js.map +1 -1
  49. package/dist/components/composites/update-dialog/channel-control.js +3 -3
  50. package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
  51. package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
  52. package/dist/components/composites/update-dialog/update-dialog.js +3 -3
  53. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
  54. package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
  55. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
  56. package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
  57. package/dist/components/conversation/atomic/chat-composer.js.map +1 -1
  58. package/dist/components/conversation/busy-send-button.js.map +1 -1
  59. package/dist/components/conversation/chat-composer.js.map +1 -1
  60. package/dist/components/conversation/composer-menu.js.map +1 -1
  61. package/dist/components/conversation/conversation-avatar.js.map +1 -1
  62. package/dist/components/conversation/conversation-pane.js.map +1 -1
  63. package/dist/components/conversation/conversation-surface.js.map +1 -1
  64. package/dist/components/conversation/internal/chat-composer-shell.js +1 -1
  65. package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
  66. package/dist/components/conversation/message-composer.d.ts.map +1 -1
  67. package/dist/components/conversation/message-composer.js +1 -1
  68. package/dist/components/conversation/message-composer.js.map +1 -1
  69. package/dist/components/conversation/message-row.js.map +1 -1
  70. package/dist/components/conversation/paste-token-editor.js.map +1 -1
  71. package/dist/components/conversation/thread-panel.js.map +1 -1
  72. package/dist/components/conversation/transcript-composition.js.map +1 -1
  73. package/dist/components/layout/app-shell/app-shell.js.map +1 -1
  74. package/dist/components/layout/app-shell/skip-link.js.map +1 -1
  75. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
  76. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js.map +1 -1
  77. package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
  78. package/dist/components/layout/orbit-layout/orbit-layout.js.map +1 -1
  79. package/dist/components/layout/page/page.js.map +1 -1
  80. package/dist/components/layout/panel/panel.js.map +1 -1
  81. package/dist/components/layout/pixel-pane/pixel-pane.js.map +1 -1
  82. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
  83. package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
  84. package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
  85. package/dist/components/layout/side-rail/side-rail.js.map +1 -1
  86. package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js.map +1 -1
  87. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
  88. package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
  89. package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
  90. package/dist/components/layout/split-layout/split-layout.js +1 -1
  91. package/dist/components/layout/split-layout/split-layout.js.map +1 -1
  92. package/dist/components/layout/status-bar/status-bar.js.map +1 -1
  93. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  94. package/dist/components/layout/virtual-window/virtual-window.js.map +1 -1
  95. package/dist/components/motion/presence.js.map +1 -1
  96. package/dist/components/theme/appearance-panel.d.ts.map +1 -1
  97. package/dist/components/theme/appearance-panel.js +1 -1
  98. package/dist/components/theme/appearance-panel.js.map +1 -1
  99. package/dist/components/theme/theme-mode-toggle.js.map +1 -1
  100. package/dist/components/theme/theme-picker.js.map +1 -1
  101. package/dist/components/theme/theme-provider.js.map +1 -1
  102. package/dist/components/theme/theme-toggle.js.map +1 -1
  103. package/dist/components/ui/accordion/accordion.js.map +1 -1
  104. package/dist/components/ui/alert/alert.js.map +1 -1
  105. package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
  106. package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
  107. package/dist/components/ui/aspect-ratio/aspect-ratio.js.map +1 -1
  108. package/dist/components/ui/attachment/attachment.js.map +1 -1
  109. package/dist/components/ui/avatar/avatar.js.map +1 -1
  110. package/dist/components/ui/badge/badge.js.map +1 -1
  111. package/dist/components/ui/board/board.js.map +1 -1
  112. package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
  113. package/dist/components/ui/bubble/bubble.js.map +1 -1
  114. package/dist/components/ui/button/button.js.map +1 -1
  115. package/dist/components/ui/button-group/button-group.js.map +1 -1
  116. package/dist/components/ui/calendar/calendar.js.map +1 -1
  117. package/dist/components/ui/callout/callout.js.map +1 -1
  118. package/dist/components/ui/card/card.js.map +1 -1
  119. package/dist/components/ui/carousel/carousel.js.map +1 -1
  120. package/dist/components/ui/chart/chart.js.map +1 -1
  121. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  122. package/dist/components/ui/code-block/code-block.js.map +1 -1
  123. package/dist/components/ui/collapsible/collapsible.js.map +1 -1
  124. package/dist/components/ui/combobox/combobox.js.map +1 -1
  125. package/dist/components/ui/combobox/value-combobox.js.map +1 -1
  126. package/dist/components/ui/command/command.js.map +1 -1
  127. package/dist/components/ui/context-menu/context-menu.js.map +1 -1
  128. package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
  129. package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
  130. package/dist/components/ui/dialog/dialog.js.map +1 -1
  131. package/dist/components/ui/diff-block/diff-block.js.map +1 -1
  132. package/dist/components/ui/drawer/drawer.js.map +1 -1
  133. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
  134. package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
  135. package/dist/components/ui/empty/empty-state.js.map +1 -1
  136. package/dist/components/ui/empty/empty.js.map +1 -1
  137. package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
  138. package/dist/components/ui/field/field.js.map +1 -1
  139. package/dist/components/ui/field/number-field.js.map +1 -1
  140. package/dist/components/ui/hover-card/hover-card.js.map +1 -1
  141. package/dist/components/ui/input/input-control.js.map +1 -1
  142. package/dist/components/ui/input/input.js.map +1 -1
  143. package/dist/components/ui/input-group/input-group.js.map +1 -1
  144. package/dist/components/ui/input-group/secret-input-group.js.map +1 -1
  145. package/dist/components/ui/input-otp/input-otp.js.map +1 -1
  146. package/dist/components/ui/item/item.js.map +1 -1
  147. package/dist/components/ui/kbd/kbd.js.map +1 -1
  148. package/dist/components/ui/label/label.js.map +1 -1
  149. package/dist/components/ui/marker/marker.js.map +1 -1
  150. package/dist/components/ui/menubar/menubar.js.map +1 -1
  151. package/dist/components/ui/message/message.js.map +1 -1
  152. package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
  153. package/dist/components/ui/native-select/native-select.js.map +1 -1
  154. package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
  155. package/dist/components/ui/pagination/pagination.js.map +1 -1
  156. package/dist/components/ui/popover/popover.js.map +1 -1
  157. package/dist/components/ui/progress/progress.js.map +1 -1
  158. package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
  159. package/dist/components/ui/radio-group/radio-group.js.map +1 -1
  160. package/dist/components/ui/resizable/resizable.js.map +1 -1
  161. package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
  162. package/dist/components/ui/select/select.js.map +1 -1
  163. package/dist/components/ui/separator/separator.js.map +1 -1
  164. package/dist/components/ui/sheet/sheet.js.map +1 -1
  165. package/dist/components/ui/skeleton/skeleton.js.map +1 -1
  166. package/dist/components/ui/slider/slider.js.map +1 -1
  167. package/dist/components/ui/spinner/spinner.js.map +1 -1
  168. package/dist/components/ui/status-chip/status-chip.js.map +1 -1
  169. package/dist/components/ui/switch/switch.js.map +1 -1
  170. package/dist/components/ui/table/table.js.map +1 -1
  171. package/dist/components/ui/tabs/tabs.js.map +1 -1
  172. package/dist/components/ui/text-link/text-link.js.map +1 -1
  173. package/dist/components/ui/textarea/textarea.js.map +1 -1
  174. package/dist/components/ui/toast/toast.js.map +1 -1
  175. package/dist/components/ui/toggle/toggle.js.map +1 -1
  176. package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
  177. package/dist/components/ui/tooltip/tooltip.js.map +1 -1
  178. package/dist/components/ui/trace/trace.js.map +1 -1
  179. package/dist/components/ui/typography/typography.js.map +1 -1
  180. package/dist/r/about-dialog.json +1 -1
  181. package/dist/r/accordion.json +1 -1
  182. package/dist/r/account-menu.json +1 -1
  183. package/dist/r/alert.json +1 -1
  184. package/dist/r/appearance-editor.json +1 -1
  185. package/dist/r/attachment.json +1 -1
  186. package/dist/r/breadcrumb.json +1 -1
  187. package/dist/r/calendar.json +1 -1
  188. package/dist/r/carousel.json +1 -1
  189. package/dist/r/catalog-browser.json +1 -1
  190. package/dist/r/chain-of-thought.json +1 -1
  191. package/dist/r/chat.json +1 -1
  192. package/dist/r/checkbox.json +1 -1
  193. package/dist/r/checkpoint.json +1 -1
  194. package/dist/r/code-block.json +1 -1
  195. package/dist/r/combobox.json +1 -1
  196. package/dist/r/command.json +1 -1
  197. package/dist/r/confirmation.json +1 -1
  198. package/dist/r/context.json +1 -1
  199. package/dist/r/conversation.json +1 -1
  200. package/dist/r/detail-panel.json +1 -1
  201. package/dist/r/dialog.json +1 -1
  202. package/dist/r/dropdown-menu.json +1 -1
  203. package/dist/r/empty.json +1 -1
  204. package/dist/r/file-tree.json +1 -1
  205. package/dist/r/floating-preview.json +1 -1
  206. package/dist/r/help-center.json +1 -1
  207. package/dist/r/icon-picker.json +1 -1
  208. package/dist/r/inline-citation.json +1 -1
  209. package/dist/r/lib.json +1 -1
  210. package/dist/r/message-scroller.json +1 -1
  211. package/dist/r/model-selector.json +1 -1
  212. package/dist/r/native-select.json +1 -1
  213. package/dist/r/navigation-menu.json +1 -1
  214. package/dist/r/pagination.json +1 -1
  215. package/dist/r/pixel-resize-handle.json +1 -1
  216. package/dist/r/plan.json +1 -1
  217. package/dist/r/questionnaire.json +1 -1
  218. package/dist/r/queue.json +1 -1
  219. package/dist/r/radio-group.json +1 -1
  220. package/dist/r/reasoning.json +1 -1
  221. package/dist/r/registry.json +65 -65
  222. package/dist/r/resizable.json +1 -1
  223. package/dist/r/scene-controls.json +1 -1
  224. package/dist/r/select.json +1 -1
  225. package/dist/r/settings.json +1 -1
  226. package/dist/r/sheet.json +1 -1
  227. package/dist/r/shell-rail.json +1 -1
  228. package/dist/r/sidebar-nav.json +1 -1
  229. package/dist/r/sources.json +1 -1
  230. package/dist/r/spinner.json +1 -1
  231. package/dist/r/split-layout.json +1 -1
  232. package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +2 -2
  233. package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +4 -4
  234. package/dist/r/src/components/composites/model-selector/model-selector.tsx +4 -1
  235. package/dist/r/src/components/composites/terminal/terminal.tsx +2 -2
  236. package/dist/r/src/components/composites/update-dialog/channel-control.tsx +3 -3
  237. package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +3 -5
  238. package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +1 -1
  239. package/dist/r/src/components/conversation/message-composer.tsx +1 -2
  240. package/dist/r/src/components/layout/split-layout/split-layout.tsx +1 -1
  241. package/dist/r/src/components/theme/appearance-panel.tsx +2 -4
  242. package/dist/r/stack-trace.json +1 -1
  243. package/dist/r/stat.json +1 -1
  244. package/dist/r/subagent.json +1 -1
  245. package/dist/r/task.json +1 -1
  246. package/dist/r/terminal.json +1 -1
  247. package/dist/r/test-results.json +1 -1
  248. package/dist/r/theming.json +1 -1
  249. package/dist/r/toast.json +1 -1
  250. package/dist/r/tool.json +1 -1
  251. package/dist/r/top-bar.json +1 -1
  252. package/dist/r/trace.json +1 -1
  253. package/dist/r/tree.json +1 -1
  254. package/dist/r/update-dialog.json +1 -1
  255. package/dist/r/workspace-switcher.json +1 -1
  256. package/dist/vite/tailwind-sources.d.ts.map +1 -1
  257. package/dist/vite/tailwind-sources.js +49 -9
  258. package/dist/vite/tailwind-sources.js.map +1 -1
  259. package/package.json +11 -11
  260. package/registry.json +65 -65
  261. package/src/components/composites/about-dialog/about-dialog.tsx +2 -2
  262. package/src/components/composites/appearance-editor/appearance-editor.tsx +4 -4
  263. package/src/components/composites/model-selector/model-selector.tsx +4 -1
  264. package/src/components/composites/terminal/terminal.tsx +2 -2
  265. package/src/components/composites/update-dialog/channel-control.tsx +3 -3
  266. package/src/components/composites/update-dialog/update-dialog.tsx +3 -5
  267. package/src/components/conversation/internal/chat-composer-shell.tsx +1 -1
  268. package/src/components/conversation/message-composer.tsx +1 -2
  269. package/src/components/layout/split-layout/split-layout.tsx +1 -1
  270. package/src/components/theme/appearance-panel.tsx +2 -4
  271. package/src/vite/tailwind-sources.ts +67 -7
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","names":["CircleHelp","ComponentProps","JSX","createUniqueId","Show","splitProps","createFormFieldContext","FormFieldContext","cn","Tooltip","TooltipContent","TooltipTrigger","Heading","HelpTip","props","label","help","_$createComponent","children","as","type","aria-label","SettingsSection","title","description","action","Element","bodyLayout","local","rest","_el$","_tmpl$3","_el$2","firstChild","_el$3","_el$4","_el$7","nextSibling","_$spread","_$mergeProps","class","_$insert","size","when","_el$5","_tmpl$","_el$6","_tmpl$2","_$effect","_$className","SettingsRow","orientation","bare","flush","rowId","labelId","descriptionId","field","defaultControlId","hint","error","undefined","group","Provider","value","_el$8","_tmpl$4","_el$9","_el$0","_el$1","_el$11","_$setAttribute","_el$10","SettingsField","htmlFor","_el$12","_tmpl$5","_el$13","_el$14","_el$16","_el$15","SettingsPage","_el$17","_tmpl$6","_$createComponent","_$mergeProps","_$className","_$setAttribute"],"sources":["../../../../src/components/composites/settings/settings.tsx"],"sourcesContent":["import { CircleHelp } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { createUniqueId, Show, splitProps } from 'solid-js'\nimport { createFormFieldContext, FormFieldContext } from '#lib/form-field'\nimport { cn } from '#lib/utils'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/tooltip'\nimport { Heading } from '../../ui/typography'\n\n/**\n * SettingsSection and SettingsRow.\n *\n * A settings page is the most repetitive surface in any application, and the\n * one where drift is most visible: label sizes, control widths and description\n * placement all wander unless something fixes them.\n *\n * The row puts the label and description at the start and the control at the\n * end (stacked on a narrow window), so controls line up down the page's end\n * edge regardless of how long the labels are. `SettingsRow` also\n * exposes its label and description through the shared form-field context to\n * the first control inside it. `SettingsField` is the visual stacked layout;\n * use `FormField` when the control needs label, help, or validation wiring.\n */\nfunction HelpTip(props: { label: string; help: string }) {\n return (\n <Tooltip>\n <TooltipTrigger\n as=\"button\"\n type=\"button\"\n data-slot=\"settings-row-help\"\n aria-label={`About ${props.label}`}\n class=\"inline-flex size-4 items-center justify-center rounded-full text-muted-foreground hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none\"\n >\n <CircleHelp class=\"size-3.5\" aria-hidden=\"true\" />\n </TooltipTrigger>\n <TooltipContent>{props.help}</TooltipContent>\n </Tooltip>\n )\n}\n\nexport function SettingsSection(\n props: ComponentProps<'section'> & {\n title: string\n description?: string\n /** A short explanation behind a help icon beside the title; prefer it to a long description. */\n help?: string\n /** A control for the section as a whole, e.g. a master toggle. */\n action?: JSX.Element\n /** Use a spaced content stack for fields, alerts, and cards instead of divided rows. */\n bodyLayout?: 'rows' | 'content'\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'title',\n 'description',\n 'help',\n 'action',\n 'bodyLayout',\n 'children',\n ])\n\n return (\n <section\n data-slot=\"settings-section\"\n class={cn('flex flex-col gap-4 px-5 py-5', local.class)}\n {...rest}\n >\n <div class=\"flex items-start justify-between gap-4\">\n <div class=\"flex min-w-0 flex-col gap-0.5\">\n <div class=\"flex items-center gap-1.5\">\n <Heading as=\"h2\" size=\"card\">\n {local.title}\n </Heading>\n <Show when={local.help}>{(help) => <HelpTip label={local.title} help={help()} />}</Show>\n </div>\n <Show when={local.description}>\n <p class=\"max-w-prose text-sm text-muted-foreground text-pretty\">{local.description}</p>\n </Show>\n </div>\n <Show when={local.action}>\n <div class=\"flex shrink-0 items-center gap-2\">{local.action}</div>\n </Show>\n </div>\n <div\n data-slot=\"settings-section-body\"\n class={cn(\n local.bodyLayout === 'content'\n ? 'flex flex-col gap-4'\n : 'divide-y divide-border rounded-xl border border-border [&>[data-slot=empty-description]]:p-4'\n )}\n >\n {local.children}\n </div>\n </section>\n )\n}\n\n/**\n * One setting: a label and description on the leading side, a control on the\n * trailing side.\n *\n * The label and description are linked to a shared control through field\n * context. An explicit `aria-label` or `aria-labelledby` on the control keeps\n * precedence; otherwise the visible row label names it.\n */\nexport function SettingsRow(\n props: ComponentProps<'div'> & {\n label: string\n description?: string\n /**\n * A short explanation behind a help icon beside the label. Prefer it to a\n * long description: the row stays quiet and the explanation is one hover or\n * focus away.\n */\n help?: string\n /** Render a vertical stack when the control needs the full width. */\n orientation?: 'horizontal' | 'vertical'\n /** Hide the divider this row would otherwise contribute. */\n bare?: boolean\n /**\n * Drop the row's own 16px padding so its label and control sit on the same\n * edges as the fields around it. For a row placed loose in a\n * `bodyLayout=\"content\"` section, where nothing encloses it and the section's\n * gap already spaces it from its neighbours. Leave it off inside a divided\n * rows body or a `Card`, whose edge the padding is there to clear.\n */\n flush?: boolean\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'description',\n 'help',\n 'orientation',\n 'bare',\n 'flush',\n 'children',\n ])\n const rowId = createUniqueId()\n const labelId = `${rowId}-label`\n const descriptionId = `${rowId}-description`\n const field = createFormFieldContext({\n defaultControlId: rowId,\n labelId,\n descriptionId,\n hint: () => local.description,\n error: () => undefined,\n group: () => false,\n })\n\n return (\n <FormFieldContext.Provider value={field}>\n <div\n data-slot=\"settings-row\"\n class={cn(\n 'flex gap-4',\n local.flush ? 'p-0' : 'p-4',\n local.orientation === 'vertical'\n ? 'flex-col'\n : 'flex-col sm:flex-row sm:items-center sm:justify-between',\n local.class\n )}\n {...rest}\n >\n <div class=\"flex min-w-0 flex-col gap-0.5\">\n <div class=\"flex items-center gap-1.5\">\n <div id={labelId} data-slot=\"settings-row-label\" class=\"text-sm font-medium\">\n {local.label}\n </div>\n <Show when={local.help}>{(help) => <HelpTip label={local.label} help={help()} />}</Show>\n </div>\n <Show when={local.description}>\n <p id={descriptionId} class=\"max-w-prose text-sm text-muted-foreground text-pretty\">\n {local.description}\n </p>\n </Show>\n </div>\n <div\n data-slot=\"settings-row-control\"\n class={cn('shrink-0', local.orientation === 'vertical' && 'w-full')}\n >\n {local.children}\n </div>\n </div>\n </FormFieldContext.Provider>\n )\n}\n\n/** A stacked label-and-control pair, for a control too wide for a row. */\nexport function SettingsField(\n props: ComponentProps<'div'> & { label: string; description?: string; htmlFor?: string }\n) {\n const [local, rest] = splitProps(props, ['class', 'label', 'description', 'htmlFor', 'children'])\n\n return (\n <div data-slot=\"settings-field\" class={cn('flex flex-col gap-2 p-4', local.class)} {...rest}>\n <div class=\"flex flex-col gap-0.5\">\n <label for={local.htmlFor} class=\"text-sm font-medium\">\n {local.label}\n </label>\n <Show when={local.description}>\n <p class=\"max-w-prose text-sm text-muted-foreground text-pretty\">{local.description}</p>\n </Show>\n </div>\n <div>{local.children}</div>\n </div>\n )\n}\n\n/** A settings page's scrolling body, with the header sticky at the top. */\nexport function SettingsPage(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"settings-page\"\n class={cn('flex min-h-0 flex-1 flex-col overflow-y-auto', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAASa,QAAQC,OAAwC;CACvD,OAAAG,gBACGR,SAAO,EAAA,IAAAS,WAAA;EAAA,OAAA,CAAAD,gBACLN,gBAAc;GACbQ,IAAE;GACFC,MAAI;GAAA,aAAA;GAAA,KAAA,gBAAA;IAAA,OAEQ,SAASN,MAAMC;GAAO;GAAA,SAAA;GAAA,IAAAG,WAAA;IAAA,OAAAD,gBAGjCjB,YAAU;KAAA,SAAA;KAAA,eAAA;IAAA,CAAA;GAAA;EAAA,CAAA,GAAAiB,gBAEZP,gBAAc,EAAA,IAAAQ,WAAA;GAAA,OAAEJ,MAAME;EAAI,EAAA,CAAA,CAAA;CAAA,EAAA,CAAA;AAGjC;AAEA,SAAgBM,gBACdR,OAUA;CACA,MAAM,CAACc,OAAOC,QAAQxB,WAAWS,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,cAAA;EAAA,IAAAgB,OAAAC,QAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAC,YAAAE,QAAAD,MAAAD,YAAAG,QAAAJ,MAAAK;EAAAC,OAAAR,MAAAS,WAAA,EAAA,KAAA,WAAA;GAAA,OAGW/B,GAAG,iCAAiCoB,MAAMY,KAAK;EAAC,EAAA,GACnDX,IAAI,GAAA,OAAA,IAAA;EAAAY,OAAAN,OAAAlB,gBAKDL,SAAO;GAACO,IAAE;GAAMuB,MAAI;GAAA,IAAAxB,WAAA;IAAA,OAClBU,MAAML;GAAK;EAAA,CAAA,GAAA,IA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AA,IAAA6D,SAAAC,QAAA,GAAAC,SAAAF,OAAA1C,YAAA6C,SAAAD,OAAA5C,YAAA8C,SAAAF,OAAAxC;EAAAC,OAAAqC,QAAApC,WAAA,EAAA,KAAA,WAAA;GAAA,OACyC/B,GAAG,2BAA2BoB,MAAMY,KAAK;EAAC,EAAA,GAAMX,IAAI,GAAA,OAAA,IAAA;EAAAY,OAAAqC,cAGpFlD,MAAMb,KAAK;EAAA0B,OAAAoC,QAAA5D,gBAEbb,MAAI;GAAA,IAACuC,OAAI;IAAA,OAAEf,MAAMJ;GAAW;GAAA,IAAAN,WAAA;IAAA,IAAA8D,SAAAnC,OAAA;IAAAJ,OAAAuC,cACuCpD,MAAMJ,WAAW;IAAA,OAAAwD;GAAA;EAAA,CAAA,GAAA,IAAA;EAAAvC,OAAAsC,cAGjFnD,MAAMV,QAAQ;EAAA8B,aAAAuB,aAAAO,QAAA,OAPNlD,MAAM8C,OAAO,CAAA;EAAA,OAAAC;CAAA,EAAA,CAAA;AAUjC;;AAGA,SAAgBM,aAAanE,OAA8B;CACzD,MAAM,CAACc,OAAOC,QAAQxB,WAAWS,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAoE,SAAAC,QAAA;EAAA7C,OAAA4C,QAAA3C,WAAA,EAAA,KAAA,WAAA;GAAA,OAGW/B,GAAG,gDAAgDoB,MAAMY,KAAK;EAAC,EAAA,GAClEX,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAqD;CAAA,EAAA,CAAA;AAGd"}
1
+ {"version":3,"file":"settings.js","names":["CircleHelp","createUniqueId","Show","splitProps","createFormFieldContext","FormFieldContext","cn","Tooltip","TooltipContent","TooltipTrigger","Heading","HelpTip","props","label","help","_$createComponent","children","as","type","SettingsSection","title","description","action","bodyLayout","local","rest","_el$","_tmpl$3","_el$2","firstChild","_el$3","_el$4","_el$7","nextSibling","_$spread","_$mergeProps","class","_$insert","size","when","_el$5","_tmpl$","_el$6","_tmpl$2","_$effect","_$className","SettingsRow","orientation","flush","rowId","labelId","descriptionId","field","defaultControlId","hint","error","undefined","group","Provider","value","_el$8","_tmpl$4","_el$9","_el$0","_el$1","_el$11","_$setAttribute","_el$10","SettingsField","htmlFor","_el$12","_tmpl$5","_el$13","_el$14","_el$16","_el$15","SettingsPage","_el$17","_tmpl$6"],"sources":["../../../../src/components/composites/settings/settings.tsx"],"sourcesContent":["import { CircleHelp } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { createUniqueId, Show, splitProps } from 'solid-js'\nimport { createFormFieldContext, FormFieldContext } from '#lib/form-field'\nimport { cn } from '#lib/utils'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/tooltip'\nimport { Heading } from '../../ui/typography'\n\n/**\n * SettingsSection and SettingsRow.\n *\n * A settings page is the most repetitive surface in any application, and the\n * one where drift is most visible: label sizes, control widths and description\n * placement all wander unless something fixes them.\n *\n * The row puts the label and description at the start and the control at the\n * end (stacked on a narrow window), so controls line up down the page's end\n * edge regardless of how long the labels are. `SettingsRow` also\n * exposes its label and description through the shared form-field context to\n * the first control inside it. `SettingsField` is the visual stacked layout;\n * use `FormField` when the control needs label, help, or validation wiring.\n */\nfunction HelpTip(props: { label: string; help: string }) {\n return (\n <Tooltip>\n <TooltipTrigger\n as=\"button\"\n type=\"button\"\n data-slot=\"settings-row-help\"\n aria-label={`About ${props.label}`}\n class=\"inline-flex size-4 items-center justify-center rounded-full text-muted-foreground hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none\"\n >\n <CircleHelp class=\"size-3.5\" aria-hidden=\"true\" />\n </TooltipTrigger>\n <TooltipContent>{props.help}</TooltipContent>\n </Tooltip>\n )\n}\n\nexport function SettingsSection(\n props: ComponentProps<'section'> & {\n title: string\n description?: string\n /** A short explanation behind a help icon beside the title; prefer it to a long description. */\n help?: string\n /** A control for the section as a whole, e.g. a master toggle. */\n action?: JSX.Element\n /** Use a spaced content stack for fields, alerts, and cards instead of divided rows. */\n bodyLayout?: 'rows' | 'content'\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'title',\n 'description',\n 'help',\n 'action',\n 'bodyLayout',\n 'children',\n ])\n\n return (\n <section\n data-slot=\"settings-section\"\n class={cn('flex flex-col gap-4 px-5 py-5', local.class)}\n {...rest}\n >\n <div class=\"flex items-start justify-between gap-4\">\n <div class=\"flex min-w-0 flex-col gap-0.5\">\n <div class=\"flex items-center gap-1.5\">\n <Heading as=\"h2\" size=\"card\">\n {local.title}\n </Heading>\n <Show when={local.help}>{(help) => <HelpTip label={local.title} help={help()} />}</Show>\n </div>\n <Show when={local.description}>\n <p class=\"max-w-prose text-sm text-muted-foreground text-pretty\">{local.description}</p>\n </Show>\n </div>\n <Show when={local.action}>\n <div class=\"flex shrink-0 items-center gap-2\">{local.action}</div>\n </Show>\n </div>\n <div\n data-slot=\"settings-section-body\"\n class={cn(\n local.bodyLayout === 'content'\n ? 'flex flex-col gap-4'\n : 'divide-y divide-border rounded-xl border border-border [&>[data-slot=empty-description]]:p-4'\n )}\n >\n {local.children}\n </div>\n </section>\n )\n}\n\n/**\n * One setting: a label and description on the leading side, a control on the\n * trailing side.\n *\n * The label and description are linked to a shared control through field\n * context. An explicit `aria-label` or `aria-labelledby` on the control keeps\n * precedence; otherwise the visible row label names it.\n */\nexport function SettingsRow(\n props: ComponentProps<'div'> & {\n label: string\n description?: string\n /**\n * A short explanation behind a help icon beside the label. Prefer it to a\n * long description: the row stays quiet and the explanation is one hover or\n * focus away.\n */\n help?: string\n /** Render a vertical stack when the control needs the full width. */\n orientation?: 'horizontal' | 'vertical'\n /** Hide the divider this row would otherwise contribute. */\n bare?: boolean\n /**\n * Drop the row's own 16px padding so its label and control sit on the same\n * edges as the fields around it. For a row placed loose in a\n * `bodyLayout=\"content\"` section, where nothing encloses it and the section's\n * gap already spaces it from its neighbours. Leave it off inside a divided\n * rows body or a `Card`, whose edge the padding is there to clear.\n */\n flush?: boolean\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'description',\n 'help',\n 'orientation',\n 'bare',\n 'flush',\n 'children',\n ])\n const rowId = createUniqueId()\n const labelId = `${rowId}-label`\n const descriptionId = `${rowId}-description`\n const field = createFormFieldContext({\n defaultControlId: rowId,\n labelId,\n descriptionId,\n hint: () => local.description,\n error: () => undefined,\n group: () => false,\n })\n\n return (\n <FormFieldContext.Provider value={field}>\n <div\n data-slot=\"settings-row\"\n class={cn(\n 'flex gap-4',\n local.flush ? 'p-0' : 'p-4',\n local.orientation === 'vertical'\n ? 'flex-col'\n : 'flex-col sm:flex-row sm:items-center sm:justify-between',\n local.class\n )}\n {...rest}\n >\n <div class=\"flex min-w-0 flex-col gap-0.5\">\n <div class=\"flex items-center gap-1.5\">\n <div id={labelId} data-slot=\"settings-row-label\" class=\"text-sm font-medium\">\n {local.label}\n </div>\n <Show when={local.help}>{(help) => <HelpTip label={local.label} help={help()} />}</Show>\n </div>\n <Show when={local.description}>\n <p id={descriptionId} class=\"max-w-prose text-sm text-muted-foreground text-pretty\">\n {local.description}\n </p>\n </Show>\n </div>\n <div\n data-slot=\"settings-row-control\"\n class={cn('shrink-0', local.orientation === 'vertical' && 'w-full')}\n >\n {local.children}\n </div>\n </div>\n </FormFieldContext.Provider>\n )\n}\n\n/** A stacked label-and-control pair, for a control too wide for a row. */\nexport function SettingsField(\n props: ComponentProps<'div'> & { label: string; description?: string; htmlFor?: string }\n) {\n const [local, rest] = splitProps(props, ['class', 'label', 'description', 'htmlFor', 'children'])\n\n return (\n <div data-slot=\"settings-field\" class={cn('flex flex-col gap-2 p-4', local.class)} {...rest}>\n <div class=\"flex flex-col gap-0.5\">\n <label for={local.htmlFor} class=\"text-sm font-medium\">\n {local.label}\n </label>\n <Show when={local.description}>\n <p class=\"max-w-prose text-sm text-muted-foreground text-pretty\">{local.description}</p>\n </Show>\n </div>\n <div>{local.children}</div>\n </div>\n )\n}\n\n/** A settings page's scrolling body, with the header sticky at the top. */\nexport function SettingsPage(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"settings-page\"\n class={cn('flex min-h-0 flex-1 flex-col overflow-y-auto', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAASW,QAAQC,OAAwC;CACvD,OAAAG,gBACGR,SAAO,EAAA,IAAAS,WAAA;EAAA,OAAA,CAAAD,gBACLN,gBAAc;GACbQ,IAAE;GACFC,MAAI;GAAA,aAAA;GAAA,KAAA,gBAAA;IAAA,OAEQ,SAASN,MAAMC;GAAO;GAAA,SAAA;GAAA,IAAAG,WAAA;IAAA,OAAAD,gBAGjCf,YAAU;KAAA,SAAA;KAAA,eAAA;IAAA,CAAA;GAAA;EAAA,CAAA,GAAAe,gBAEZP,gBAAc,EAAA,IAAAQ,WAAA;GAAA,OAAEJ,MAAME;EAAI,EAAA,CAAA,CAAA;CAAA,EAAA,CAAA;AAGjC;AAEA,SAAgBK,gBACdP,OAUA;CACA,MAAM,CAACY,OAAOC,QAAQtB,WAAWS,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,cAAA;EAAA,IAAAc,OAAAC,QAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAC,YAAAE,QAAAD,MAAAD,YAAAG,QAAAJ,MAAAK;EAAAC,OAAAR,MAAAS,WAAA,EAAA,KAAA,WAAA;GAAA,OAGW7B,GAAG,iCAAiCkB,MAAMY,KAAK;EAAC,EAAA,GACnDX,IAAI,GAAA,OAAA,IAAA;EAAAY,OAAAN,OAAAhB,gBAKDL,SAAO;GAACO,IAAE;GAAMqB,MAAI;GAAA,IAAAtB,WAAA;IAAA,OAClBQ,MAAMJ;GAAK;EAAA,CAAA,GAAA,IAAA;EAAAiB,OAAAN,OAAAhB,gBAEbb,MAAI;GAAA,IAACqC,OAAI;IAAA,OAAEf,MAAMV;GAAI;GAAAE,WAAIF,SAAIC,gBAAMJ,S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AA,KAAA,WAAA;GAAA,OACyC7B,GAAG,2BAA2BkB,MAAMY,KAAK;EAAC,EAAA,GAAMX,IAAI,GAAA,OAAA,IAAA;EAAAY,OAAAoC,cAGpFjD,MAAMX,KAAK;EAAAwB,OAAAmC,QAAAzD,gBAEbb,MAAI;GAAA,IAACqC,OAAI;IAAA,OAAEf,MAAMH;GAAW;GAAA,IAAAL,WAAA;IAAA,IAAA2D,SAAAlC,OAAA;IAAAJ,OAAAsC,cACuCnD,MAAMH,WAAW;IAAA,OAAAsD;GAAA;EAAA,CAAA,GAAA,IAAA;EAAAtC,OAAAqC,cAGjFlD,MAAMR,QAAQ;EAAA4B,aAAAsB,aAAAO,QAAA,OAPNjD,MAAM6C,OAAO,CAAA;EAAA,OAAAC;CAAA,EAAA,CAAA;AAUjC;;AAGA,SAAgBM,aAAahE,OAA8B;CACzD,MAAM,CAACY,OAAOC,QAAQtB,WAAWS,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAiE,SAAAC,QAAA;EAAA5C,OAAA2C,QAAA1C,WAAA,EAAA,KAAA,WAAA;GAAA,OAGW7B,GAAG,gDAAgDkB,MAAMY,KAAK;EAAC,EAAA,GAClEX,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAoD;CAAA,EAAA,CAAA;AAGd"}
@@ -1 +1 @@
1
- {"version":3,"file":"sources.js","names":["BookOpen","createSignal","For","Show","splitProps","Button","TextLink","Trace","TraceDetail","TraceLine","TraceProps","SOURCE_SNIPPET_LIMIT","boundText","safeSourceUrl","sourceHost","sourceTitle","sourcesLabel","Source","SourcesProps","Omit","sources","label","open","defaultOpen","onOpenChange","initialVisible","DEFAULT_VISIBLE","Sources","props","local","rest","expanded","setExpanded","limit","Math","max","floor","hidden","length","visible","slice","_$createComponent","when","children","_$mergeProps","icon","title","_el$","_tmpl$","_$insert","each","source","index","SourceRow","position","type","variant","size","aria-expanded","onClick","value","_$memo","href","url","host","snippet","withheld","undefined","_el$2","_tmpl$4","_el$3","firstChild","_el$4","nextSibling","fallback","_el$7","_tmpl$5","_el$8","_el$9","_el$1","_el$0","target","rel","_el$10","_tmpl$6","_el$11","_el$13","_el$12","_tmpl$7","_el$5","_tmpl$2","_el$6","_tmpl$3","_$createComponent","_$mergeProps","_$memo"],"sources":["../../../../src/components/composites/sources/sources.tsx"],"sourcesContent":["import { BookOpen } from 'lucide-solid'\nimport { createSignal, For, Show, splitProps } from 'solid-js'\nimport { Button } from '../../ui/button'\nimport { TextLink } from '../../ui/text-link'\nimport { Trace, TraceDetail, TraceLine, type TraceProps } from '../../ui/trace'\nimport {\n SOURCE_SNIPPET_LIMIT,\n boundText,\n safeSourceUrl,\n sourceHost,\n sourceTitle,\n sourcesLabel,\n type Source,\n} from './source'\n\n/**\n * Sources.\n *\n * The links a reply used, as one `Trace` line — \"Used 4 sources\" — that expands\n * into the list. It lives under the answer with the rest of the agent's activity\n * rather than as a card of its own, because a reader who wants to check a claim\n * will open it and one who does not should not have to scroll past it. For a\n * marker inside a sentence use `InlineCitation`, which points at the same\n * `Source` shape; the two are numbered the same way (position in this list).\n *\n * ## What it will and will not say\n *\n * - **No sources, no line.** An empty list renders nothing: \"Used 0 sources\" is a\n * claim about an answer that may simply not have been grounded.\n * - **A row is a link only with a safe address.** `http:`, `https:` and `mailto:`\n * without embedded credentials (`safeSourceUrl`). Any other address is not\n * linked and not printed — the row says the address was not linked, so the\n * reader knows something was withheld instead of finding a dead title.\n * - **The host is read from the parsed URL**, never from the title, so a title\n * that reads \"docs.example.com\" cannot make a link to somewhere else look like it.\n * - **Nothing is merged.** Two entries that share a URL are two rows, with their\n * own numbers; the host may have cited two passages and the citations point at\n * positions.\n * - **Hostile and long values are bounded.** Titles, hosts and snippets are\n * clipped and stripped of direction overrides (`boundText`), and are only ever\n * text nodes.\n * - **A long list is shown in pages.** Past `initialVisible` the rest is behind a\n * button that names how many there are, so a 200-source answer is not 200 rows\n * the moment it opens. The button stays in place and toggles, so focus is never\n * left on a control that has just disappeared.\n */\nexport type SourcesProps = Omit<TraceProps, 'children'> & {\n sources: readonly Source[]\n /** Replaces the default \"Used N sources\" for another language or a different verb. */\n label?: string\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /** Rows shown before the \"Show all\" button. Default 25. */\n initialVisible?: number\n}\n\nconst DEFAULT_VISIBLE = 25\n\nexport function Sources(props: SourcesProps) {\n const [local, rest] = splitProps(props, [\n 'sources',\n 'label',\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'initialVisible',\n ])\n const [expanded, setExpanded] = createSignal(false)\n const limit = () => Math.max(1, Math.floor(local.initialVisible ?? DEFAULT_VISIBLE))\n const hidden = () => Math.max(0, local.sources.length - limit())\n const visible = () => (expanded() ? local.sources : local.sources.slice(0, limit()))\n\n return (\n <Show when={local.sources.length > 0}>\n <Trace aria-label=\"Sources\" data-slot=\"sources\" {...rest}>\n <TraceLine\n icon={<BookOpen />}\n title={local.label ?? sourcesLabel(local.sources.length)}\n open={local.open}\n defaultOpen={local.defaultOpen}\n onOpenChange={local.onOpenChange}\n >\n <TraceDetail>\n <ol class=\"m-0 flex list-none flex-col gap-2 p-0\" aria-label=\"Sources used\">\n <For each={visible()}>\n {(source, index) => <SourceRow source={source} position={index() + 1} />}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded()}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>\n </Show>\n </TraceDetail>\n </TraceLine>\n </Trace>\n </Show>\n )\n}\n\nfunction SourceRow(props: { source: Source; position: number }) {\n const href = () => safeSourceUrl(props.source.url)\n const host = () => sourceHost(props.source.url)\n const title = () => sourceTitle(props.source)\n const snippet = () =>\n props.source.snippet ? boundText(props.source.snippet, SOURCE_SNIPPET_LIMIT) : ''\n // An address was supplied but is not one we link: say so rather than go silent.\n const withheld = () => props.source.url !== undefined && props.source.url !== '' && !href()\n\n return (\n <li data-slot=\"source\" class=\"flex min-w-0 items-baseline gap-2\">\n <span\n aria-hidden=\"true\"\n class=\"w-5 shrink-0 text-end text-xs text-muted-foreground tabular-nums\"\n >\n {props.position}\n </span>\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <Show\n when={href()}\n fallback={\n <span class=\"text-sm text-foreground [overflow-wrap:anywhere]\">\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n </span>\n }\n >\n {(url) => (\n <TextLink\n href={url()}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"w-fit max-w-full text-sm [overflow-wrap:anywhere]\"\n >\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n <span class=\"visually-hidden\"> (opens in a new tab)</span>\n </TextLink>\n )}\n </Show>\n <Show when={host() || withheld()}>\n <span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {host()}\n <Show when={withheld()}>{host() ? ' · ' : ''}Address not linked</Show>\n </span>\n </Show>\n <Show when={snippet()}>\n <p class=\"m-0 line-clamp-3 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {snippet()}\n </p>\n </Show>\n </div>\n </li>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAyDA,IAAM0B,kBAAkB;AAExB,SAAgBC,QAAQC,OAAqB;CAC3C,MAAM,CAACC,OAAOC,QAAQ1B,WAAWwB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;CAAgB,CACjB;CACD,MAAM,CAACG,UAAUC,eAAe/B,aAAa,KAAK;CAClD,MAAMgC,cAAcC,KAAKC,IAAI,GAAGD,KAAKE,MAAMP,MAAMJ,kBAAkBC,eAAe,CAAC;CACnF,MAAMW,eAAeH,KAAKC,IAAI,GAAGN,MAAMT,QAAQkB,SAASL,MAAM,CAAC;CAC/D,MAAMM,gBAAiBR,SAAS,IAAIF,MAAMT,UAAUS,MAAMT,QAAQoB,MAAM,GAAGP,MAAM,CA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Ab;OAAAxB,OAAAkC,cAGmCvD,MAAM0B,UAAQgC,MAAA;OAAA,OAAAH;MAAA,EAAA,CAAA;MAAAtB,WACnDf,MAAM,CAAC;MAAA0C,QAAA;KAAA;IAAA;GAAA,CAAA;EAGX,CAAA,GAAA,IAAA;EAAAvC,OAAAuB,OAAA/B,gBAEFtC,MAAI;GAAA,IAACuC,OAAI;IAAA,OAAEsB,KAAK,KAAKE,SAAS;GAAC;GAAA,IAAAvB,WAAA;IAAA,IAAA8C,QAAAC,QAAA;IAAAzC,OAAAwC,OAE3BzB,MAAI,IAAA;IAAAf,OAAAwC,OAAAhD,gBACJtC,MAAI;KAAA,IAACuC,OAAI;MAAA,OAAEwB,SAAS;KAAC;KAAA,IAAAvB,WAAA;MAAA,OAAA,CAAAkB,WAAGG,KAAK,IAAI,QAAQ,EAAE,GAAA,oBAAA;KAAA;IAAA,CAAA,GAAA,IAAA;IAAA,OAAAyB;GAAA;EAAA,CAAA,GAAA,IAAA;EAAAxC,OAAAuB,OAAA/B,gBAG/CtC,MAAI;GAAA,IAACuC,OAAI;IAAA,OAAEuB,QAAQ;GAAC;GAAA,IAAAtB,WAAA;IAAA,IAAAgD,QAAAC,QAAA;IAAA3C,OAAA0C,OAEhB1B,OAAO;IAAA,OAAA0B;GAAA;EAAA,CAAA,GAAA,IAAA;EAAA,OAAAvB;CAAA,EAAA,CAAA;AAMpB"}
1
+ {"version":3,"file":"sources.js","names":["BookOpen","createSignal","For","Show","splitProps","Button","TextLink","Trace","TraceDetail","TraceLine","boundText","safeSourceUrl","sourceHost","sourceTitle","sourcesLabel","sources","label","open","defaultOpen","onOpenChange","initialVisible","DEFAULT_VISIBLE","Sources","props","local","rest","expanded","setExpanded","limit","Math","max","floor","hidden","length","visible","slice","_$createComponent","when","children","_$mergeProps","icon","title","_el$","_tmpl$","_$insert","each","source","index","SourceRow","position","type","variant","size","onClick","value","_$memo","href","url","host","snippet","withheld","undefined","_el$2","_tmpl$4","_el$3","firstChild","_el$4","nextSibling","fallback","_el$7","_tmpl$5","_el$8","_el$1","target","rel","_el$10","_tmpl$6","_el$13","_tmpl$7","_el$5","_tmpl$2","_el$6","_tmpl$3"],"sources":["../../../../src/components/composites/sources/sources.tsx"],"sourcesContent":["import { BookOpen } from 'lucide-solid'\nimport { createSignal, For, Show, splitProps } from 'solid-js'\nimport { Button } from '../../ui/button'\nimport { TextLink } from '../../ui/text-link'\nimport { Trace, TraceDetail, TraceLine, type TraceProps } from '../../ui/trace'\nimport {\n SOURCE_SNIPPET_LIMIT,\n boundText,\n safeSourceUrl,\n sourceHost,\n sourceTitle,\n sourcesLabel,\n type Source,\n} from './source'\n\n/**\n * Sources.\n *\n * The links a reply used, as one `Trace` line — \"Used 4 sources\" — that expands\n * into the list. It lives under the answer with the rest of the agent's activity\n * rather than as a card of its own, because a reader who wants to check a claim\n * will open it and one who does not should not have to scroll past it. For a\n * marker inside a sentence use `InlineCitation`, which points at the same\n * `Source` shape; the two are numbered the same way (position in this list).\n *\n * ## What it will and will not say\n *\n * - **No sources, no line.** An empty list renders nothing: \"Used 0 sources\" is a\n * claim about an answer that may simply not have been grounded.\n * - **A row is a link only with a safe address.** `http:`, `https:` and `mailto:`\n * without embedded credentials (`safeSourceUrl`). Any other address is not\n * linked and not printed — the row says the address was not linked, so the\n * reader knows something was withheld instead of finding a dead title.\n * - **The host is read from the parsed URL**, never from the title, so a title\n * that reads \"docs.example.com\" cannot make a link to somewhere else look like it.\n * - **Nothing is merged.** Two entries that share a URL are two rows, with their\n * own numbers; the host may have cited two passages and the citations point at\n * positions.\n * - **Hostile and long values are bounded.** Titles, hosts and snippets are\n * clipped and stripped of direction overrides (`boundText`), and are only ever\n * text nodes.\n * - **A long list is shown in pages.** Past `initialVisible` the rest is behind a\n * button that names how many there are, so a 200-source answer is not 200 rows\n * the moment it opens. The button stays in place and toggles, so focus is never\n * left on a control that has just disappeared.\n */\nexport type SourcesProps = Omit<TraceProps, 'children'> & {\n sources: readonly Source[]\n /** Replaces the default \"Used N sources\" for another language or a different verb. */\n label?: string\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /** Rows shown before the \"Show all\" button. Default 25. */\n initialVisible?: number\n}\n\nconst DEFAULT_VISIBLE = 25\n\nexport function Sources(props: SourcesProps) {\n const [local, rest] = splitProps(props, [\n 'sources',\n 'label',\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'initialVisible',\n ])\n const [expanded, setExpanded] = createSignal(false)\n const limit = () => Math.max(1, Math.floor(local.initialVisible ?? DEFAULT_VISIBLE))\n const hidden = () => Math.max(0, local.sources.length - limit())\n const visible = () => (expanded() ? local.sources : local.sources.slice(0, limit()))\n\n return (\n <Show when={local.sources.length > 0}>\n <Trace aria-label=\"Sources\" data-slot=\"sources\" {...rest}>\n <TraceLine\n icon={<BookOpen />}\n title={local.label ?? sourcesLabel(local.sources.length)}\n open={local.open}\n defaultOpen={local.defaultOpen}\n onOpenChange={local.onOpenChange}\n >\n <TraceDetail>\n <ol class=\"m-0 flex list-none flex-col gap-2 p-0\" aria-label=\"Sources used\">\n <For each={visible()}>\n {(source, index) => <SourceRow source={source} position={index() + 1} />}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n class=\"mt-1\"\n aria-expanded={expanded()}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? 'Show fewer sources' : `Show all ${local.sources.length} sources`}\n </Button>\n </Show>\n </TraceDetail>\n </TraceLine>\n </Trace>\n </Show>\n )\n}\n\nfunction SourceRow(props: { source: Source; position: number }) {\n const href = () => safeSourceUrl(props.source.url)\n const host = () => sourceHost(props.source.url)\n const title = () => sourceTitle(props.source)\n const snippet = () =>\n props.source.snippet ? boundText(props.source.snippet, SOURCE_SNIPPET_LIMIT) : ''\n // An address was supplied but is not one we link: say so rather than go silent.\n const withheld = () => props.source.url !== undefined && props.source.url !== '' && !href()\n\n return (\n <li data-slot=\"source\" class=\"flex min-w-0 items-baseline gap-2\">\n <span\n aria-hidden=\"true\"\n class=\"w-5 shrink-0 text-end text-xs text-muted-foreground tabular-nums\"\n >\n {props.position}\n </span>\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <Show\n when={href()}\n fallback={\n <span class=\"text-sm text-foreground [overflow-wrap:anywhere]\">\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n </span>\n }\n >\n {(url) => (\n <TextLink\n href={url()}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"w-fit max-w-full text-sm [overflow-wrap:anywhere]\"\n >\n <span class=\"visually-hidden\">Source {props.position}: </span>\n {title()}\n <span class=\"visually-hidden\"> (opens in a new tab)</span>\n </TextLink>\n )}\n </Show>\n <Show when={host() || withheld()}>\n <span class=\"text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {host()}\n <Show when={withheld()}>{host() ? ' · ' : ''}Address not linked</Show>\n </span>\n </Show>\n <Show when={snippet()}>\n <p class=\"m-0 line-clamp-3 text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {snippet()}\n </p>\n </Show>\n </div>\n </li>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAyDA,IAAMqB,kBAAkB;AAExB,SAAgBC,QAAQC,OAAqB;CAC3C,MAAM,CAACC,OAAOC,QAAQrB,WAAWmB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;CAAgB,CACjB;CACD,MAAM,CAACG,UAAUC,eAAe1B,aAAa,KAAK;CAClD,MAAM2B,cAAcC,KAAKC,IAAI,GAAGD,KAAKE,MAAMP,MAAMJ,kBAAkBC,eAAe,CAAC;CACnF,MAAMW,eAAeH,KAAKC,IAAI,GAAGN,MAAMT,QAAQkB,SAASL,MAAM,CAAC;CAC/D,MAAMM,gBAAiBR,SAAS,IAAIF,MAAMT,UAAUS,MAAMT,QAAQoB,MAAM,GAAGP,MAAM,CAAC;CAElF,OAAAQ,gBACGjC,MAAI;EAAA,IAACkC,OAAI;GAAA,OAAEb,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F;MAAA,EAAA,CAAA;MAAApB,WACnDd,MAAM,CAAC;MAAAqC,QAAA;KAAA;IAAA;GAAA,CAAA;EAGX,CAAA,GAAA,IAAA;EAAAlC,OAAAsB,OAAA9B,gBAEFjC,MAAI;GAAA,IAACkC,OAAI;IAAA,OAAEqB,KAAK,KAAKE,SAAS;GAAC;GAAA,IAAAtB,WAAA;IAAA,IAAAyC,QAAAC,QAAA;IAAApC,OAAAmC,OAE3BrB,MAAI,IAAA;IAAAd,OAAAmC,OAAA3C,gBACJjC,MAAI;KAAA,IAACkC,OAAI;MAAA,OAAEuB,SAAS;KAAC;KAAA,IAAAtB,WAAA;MAAA,OAAA,CAAAiB,WAAGG,KAAK,IAAI,QAAQ,EAAE,GAAA,oBAAA;KAAA;IAAA,CAAA,GAAA,IAAA;IAAA,OAAAqB;GAAA;EAAA,CAAA,GAAA,IAAA;EAAAnC,OAAAsB,OAAA9B,gBAG/CjC,MAAI;GAAA,IAACkC,OAAI;IAAA,OAAEsB,QAAQ;GAAC;GAAA,IAAArB,WAAA;IAAA,IAAA2C,QAAAC,QAAA;IAAAtC,OAAAqC,OAEhBtB,OAAO;IAAA,OAAAsB;GAAA;EAAA,CAAA,GAAA,IAAA;EAAA,OAAAnB;CAAA,EAAA,CAAA;AAMpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"stack-trace.js","names":["Check","CircleAlert","Copy","Package","createMemo","createSignal","For","Match","Show","splitProps","Switch","ComponentProps","createCopyFeedback","cn","Button","CodeBlock","TraceLine","boundLines","dedentLines","describeFrameGroup","frameLocation","groupStackEntries","parseStackTrace","ParseStackTraceOptions","StackBlock","StackFrame","StackTraceProps","Omit","text","onOpenFrame","frame","classify","collapseDependencies","defaultDependenciesOpen","maxBlocks","copyLabel","copiedLabel","onCopy","ok","STACK_TRACE_MAX_BLOCKS","TEXT_DISPLAY_LIMIT","DETAIL_LINE_LIMIT","DETAIL_CHAR_LIMIT","rowClass","interactiveClass","omissionNote","lines","chars","toLocaleString","FrameDetail","props","bounded","_el$","_tmpl$","_$insert","join","_$createComponent","when","omittedLines","omittedChars","children","_el$2","_tmpl$2","_el$3","firstChild","ClippedText","class","clipped","length","_el$4","_tmpl$3","_c$","_$memo","slice","_$effect","_$className","_el$5","_tmpl$4","_el$6","_el$8","nextSibling","_el$7","FrameGroup","frames","defaultOpen","pageSize","onOpen","open","setOpen","limit","setLimit","title","shown","hidden","icon","onOpenChange","_el$9","_tmpl$5","each","FrameRow","_$setAttribute","ShowMore","onClick","_el$0","_tmpl$6","variant","size","Math","min","location","first","kind","content","_el$1","async","function","_el$10","_tmpl$7","_el$11","_tmpl$8","_el$12","_tmpl$0","undefined","file","fallback","_el$14","_tmpl$1","_el$13","_tmpl$9","$$click","_p$","_v$","_v$2","e","t","detail","TextRow","_el$15","_tmpl$11","_c$2","_el$16","_tmpl$10","_el$17","_el$19","_el$18","StackTrace","local","rest","parsed","blocks","entries","filter","block","type","trim","max","floor","copied","failed","copyFailed","copy","copyText","_el$20","_tmpl$15","_$spread","_$mergeProps","data-format","format","code","complete","wrap","_el$21","_tmpl$12","_el$22","_el$23","header","_tmpl$16","_el$27","_tmpl$18","message","_tmpl$17","_el$29","_tmpl$19","aria-label","_el$24","_tmpl$13","entry","Extract","_el$25","_tmpl$14","_$delegateEvents","_$createComponent","_$memo","_$className","_$setAttribute","_$mergeProps","_$delegateEvents"],"sources":["../../../../src/components/composites/stack-trace/stack-trace.tsx"],"sourcesContent":["import { Check, CircleAlert, Copy, Package } from 'lucide-solid'\nimport {\n createMemo,\n createSignal,\n For,\n Match,\n Show,\n splitProps,\n Switch,\n type ComponentProps,\n} from 'solid-js'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport { CodeBlock } from '../../ui/code-block'\nimport { TraceLine } from '../../ui/trace'\nimport {\n boundLines,\n dedentLines,\n describeFrameGroup,\n frameLocation,\n groupStackEntries,\n parseStackTrace,\n type ParseStackTraceOptions,\n type StackBlock,\n type StackFrame,\n} from './parse-stack-trace'\n\n/**\n * StackTrace.\n *\n * A failed call and the frames it failed through. Put it in the body of the\n * `TraceLine` for the call that failed, or under a failing test; reach for\n * `CodeBlock` when the text is not a trace, and for `Terminal` when it is the\n * live output of a command rather than one error.\n *\n * ## The reader's code first\n *\n * A trace is mostly someone else's frames. Runs of dependency and runtime frames\n * (`node_modules`, `site-packages`, `.cargo/registry`, `node:` internals, Rust's\n * `std`) fold into one disclosure line that says what it holds, and a lone\n * dependency frame is dimmed rather than folded. When *none* of the frames is the\n * reader's, nothing folds: hiding the whole trace behind a button helps nobody.\n * Whose code a frame is comes from its path; a host that knows the project layout\n * passes `classify`.\n *\n * ## It never hides a line\n *\n * Every line of `text` is on screen in order — as a frame, as a header, or as\n * muted text — and a trace in a format this does not know is shown whole in a\n * `CodeBlock`, which also copies it. Copy writes `text` exactly as given, not a\n * reformatted version of what was parsed.\n *\n * ## Opening a frame is the host's decision\n *\n * A frame is a button only when `onOpenFrame` is supplied, and only when the\n * frame names a file; without it frames are plain text, because a control that\n * does nothing is a tab stop with no purpose. The component never builds a path\n * or tries to open one — the trace is untrusted text, and what a path in it means\n * on this machine is the host's call.\n *\n * Text is text throughout: frames, messages and source lines are rendered as text\n * nodes, long unbroken tokens wrap rather than widening the column, and what is\n * drawn is bounded with the omission stated every time: a text line or a header\n * message beyond 10 000 characters, a frame's printed lines beyond 40 lines or\n * 10 000 characters, and the frames of a folded group, which are built only while\n * it is open and then `maxBlocks` at a time. Copy and `onOpenFrame` still get all of\n * it.\n */\nexport type StackTraceProps = Omit<ComponentProps<'div'>, 'children'> & {\n /** The trace exactly as the runtime printed it. */\n text: string\n /** Make frames that name a file open it. Omit to render them as plain text. */\n onOpenFrame?: (frame: StackFrame) => void\n classify?: ParseStackTraceOptions['classify']\n /** Fold runs of dependency and runtime frames. Default true. */\n collapseDependencies?: boolean\n /** Start folded groups open. */\n defaultDependenciesOpen?: boolean\n /** Blocks (frames, groups, text) shown before \"show more\". Default 200. */\n maxBlocks?: number\n copyLabel?: string\n copiedLabel?: string\n /** Called after each copy attempt with whether the clipboard accepted it. */\n onCopy?: (ok: boolean) => void\n}\n\nexport const STACK_TRACE_MAX_BLOCKS = 200\nconst TEXT_DISPLAY_LIMIT = 10_000\n/** What a frame's own printed lines (a Python source line, a locals dump) may show. */\nconst DETAIL_LINE_LIMIT = 40\nconst DETAIL_CHAR_LIMIT = 10_000\n\nconst rowClass =\n 'flex min-w-0 flex-wrap items-baseline gap-x-2 rounded-md px-1.5 py-0.5 text-start text-xs outline-none'\nconst interactiveClass =\n 'w-full cursor-pointer transition-colors ease-out hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-primary-subtle focus-visible:border-ring'\n\nfunction omissionNote(lines: number, chars: number): string {\n return lines > 0\n ? `… ${lines.toLocaleString()} more ${lines === 1 ? 'line' : 'lines'} (${chars.toLocaleString()} characters) not shown`\n : `… ${chars.toLocaleString()} more characters not shown`\n}\n\n/** A frame's printed lines, bounded so one frame cannot be the whole page. */\nfunction FrameDetail(props: { lines: readonly string[] }) {\n const bounded = createMemo(() => boundLines(props.lines, DETAIL_LINE_LIMIT, DETAIL_CHAR_LIMIT))\n return (\n <>\n <pre class=\"m-0 ms-1.5 px-1.5 font-code text-code whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n {dedentLines(bounded().lines).join('\\n')}\n </pre>\n <Show when={bounded().omittedLines > 0 || bounded().omittedChars > 0}>\n <p class=\"m-0 ms-1.5 px-1.5 text-xs text-muted-foreground italic\">\n {omissionNote(bounded().omittedLines, bounded().omittedChars)}\n {' (copy has all of it)'}\n </p>\n </Show>\n </>\n )\n}\n\n/** Header text, cut to the display limit with what was cut stated. */\nfunction ClippedText(props: { text: string; class?: string }) {\n const clipped = () => props.text.length > TEXT_DISPLAY_LIMIT\n return (\n <>\n <span class={props.class}>\n {clipped() ? props.text.slice(0, TEXT_DISPLAY_LIMIT) : props.text}\n </span>\n <Show when={clipped()}>\n <span class=\"block text-xs text-muted-foreground italic\">\n … {(props.text.length - TEXT_DISPLAY_LIMIT).toLocaleString()} more characters not shown\n (copy has all of it)\n </span>\n </Show>\n </>\n )\n}\n\n/**\n * A folded run of dependency or runtime frames. Its rows are built only while it\n * is open and then a page at a time, so a run of ten thousand frames costs the\n * same as one of a few hundred until the reader asks for more.\n */\nfunction FrameGroup(props: {\n frames: readonly StackFrame[]\n defaultOpen?: boolean\n pageSize: number\n onOpen?: (frame: StackFrame) => void\n}) {\n const [open, setOpen] = createSignal(props.defaultOpen === true)\n const [limit, setLimit] = createSignal<number | undefined>()\n const title = createMemo(() => describeFrameGroup(props.frames))\n const shown = createMemo(() => props.frames.slice(0, limit() ?? props.pageSize))\n const hidden = () => props.frames.length - shown().length\n return (\n <TraceLine icon={<Package />} title={title()} open={open()} onOpenChange={setOpen}>\n <Show when={open()}>\n <ol role=\"list\" aria-label={title()} class=\"m-0 flex min-w-0 list-none flex-col gap-px p-0\">\n <For each={shown()}>{(frame) => <FrameRow frame={frame} onOpen={props.onOpen} />}</For>\n </ol>\n <Show when={hidden() > 0}>\n <ShowMore\n hidden={hidden()}\n pageSize={props.pageSize}\n onClick={() => setLimit(shown().length + props.pageSize)}\n />\n </Show>\n </Show>\n </TraceLine>\n )\n}\n\nfunction ShowMore(props: { hidden: number; pageSize: number; onClick: () => void }) {\n return (\n <div class=\"ps-1.5\">\n <Button variant=\"ghost\" size=\"2xs\" onClick={props.onClick}>\n Show {Math.min(props.hidden, props.pageSize).toLocaleString()} more (\n {props.hidden.toLocaleString()} hidden)\n </Button>\n </div>\n )\n}\n\nfunction FrameRow(props: { frame: StackFrame; onOpen?: (frame: StackFrame) => void }) {\n const location = () => frameLocation(props.frame)\n const first = () => props.frame.kind === 'first-party'\n const content = () => (\n <>\n <span\n class={cn('font-code text-code', {\n 'text-foreground': first(),\n 'text-muted-foreground': !first(),\n })}\n >\n {props.frame.async ? 'async ' : ''}\n {props.frame.function ?? '(anonymous)'}\n </span>\n <Show when={location()}>\n <span class=\"min-w-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n {location()}\n </span>\n </Show>\n {/* The dimming is a colour; the kind is also spoken. */}\n <Show when={!first()}>\n <span class=\"sr-only\">\n {props.frame.kind === 'dependency' ? 'in a dependency' : 'in the runtime'}\n </span>\n </Show>\n </>\n )\n return (\n <li data-slot=\"stack-frame\" data-kind={props.frame.kind} class=\"min-w-0\">\n <Show\n when={props.onOpen !== undefined && props.frame.file !== undefined}\n fallback={<div class={rowClass}>{content()}</div>}\n >\n <button\n type=\"button\"\n aria-label={`Open ${props.frame.async ? 'async ' : ''}${props.frame.function ?? '(anonymous)'} ${location()}`}\n class={cn(rowClass, interactiveClass)}\n onClick={() => props.onOpen?.(props.frame)}\n >\n {content()}\n </button>\n </Show>\n <Show when={props.frame.detail && props.frame.detail.length > 0}>\n <FrameDetail lines={props.frame.detail!} />\n </Show>\n </li>\n )\n}\n\nfunction TextRow(props: { text: string }) {\n const clipped = () => props.text.length > TEXT_DISPLAY_LIMIT\n return (\n <li class=\"min-w-0 px-1.5 py-0.5 font-code text-code whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n {clipped() ? props.text.slice(0, TEXT_DISPLAY_LIMIT) : props.text}\n <Show when={clipped()}>\n <span class=\"block font-sans text-xs italic\">\n … {(props.text.length - TEXT_DISPLAY_LIMIT).toLocaleString()} more characters not shown\n </span>\n </Show>\n </li>\n )\n}\n\nexport function StackTrace(props: StackTraceProps) {\n const [local, rest] = splitProps(props, [\n 'text',\n 'onOpenFrame',\n 'classify',\n 'collapseDependencies',\n 'defaultDependenciesOpen',\n 'maxBlocks',\n 'copyLabel',\n 'copiedLabel',\n 'onCopy',\n 'class',\n ])\n\n const parsed = createMemo(() => parseStackTrace(local.text, { classify: local.classify }))\n const blocks = createMemo<readonly StackBlock[]>(() =>\n groupStackEntries(parsed().entries, local.collapseDependencies !== false).filter(\n // A blank line between paragraphs of a trace carries nothing to draw.\n (block) => block.type !== 'text' || block.text.trim() !== ''\n )\n )\n const pageSize = () => Math.max(1, Math.floor(local.maxBlocks ?? STACK_TRACE_MAX_BLOCKS))\n const [limit, setLimit] = createSignal<number | undefined>()\n const shown = createMemo(() => blocks().slice(0, limit() ?? pageSize()))\n const hidden = () => blocks().length - shown().length\n\n const { copied, failed: copyFailed, copy: copyText } = createCopyFeedback()\n const copy = async () => {\n const ok = await copyText(local.text)\n local.onCopy?.(ok)\n }\n\n return (\n <div\n data-slot=\"stack-trace\"\n data-format={parsed().format}\n class={cn('flex min-w-0 flex-col gap-1', local.class)}\n {...rest}\n >\n <Show\n when={parsed().format !== 'unknown'}\n fallback={\n // Nothing recognised: the whole text, in the block that copies it.\n <CodeBlock size=\"sm\" title=\"Error output\" code={local.text} complete wrap />\n }\n >\n <div class=\"group/stack flex items-start gap-2\">\n <CircleAlert aria-hidden=\"true\" class=\"mt-0.5 size-4 shrink-0 text-destructive\" />\n <div class=\"min-w-0 flex-1 text-sm\">\n <Show\n when={parsed().header}\n fallback={<span class=\"text-muted-foreground\">Stack trace</span>}\n >\n {(header) => (\n <>\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Show when={header().type}>\n <ClippedText class=\"font-semibold text-destructive\" text={header().type!} />\n <Show when={header().message !== ''}>\n <span class=\"text-muted-foreground\">: </span>\n </Show>\n </Show>\n <ClippedText class=\"text-foreground\" text={header().message} />\n </p>\n <Show when={header().location}>\n <p class=\"m-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n <ClippedText text={header().location!} />\n </p>\n </Show>\n </>\n )}\n </Show>\n </div>\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/stack:opacity-100 group-hover/stack:opacity-100 [@media(hover:none)]:opacity-100\">\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={\n copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy stack trace')\n }\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </Button>\n </div>\n </div>\n\n <ol\n role=\"list\"\n aria-label=\"Stack frames\"\n class=\"m-0 ms-2 flex min-w-0 list-none flex-col gap-px border-s border-border p-0 ps-2\"\n >\n <For each={shown()}>\n {(block) => (\n <Switch>\n <Match when={block.type === 'frame' && block}>\n {(entry) => (\n <FrameRow\n frame={(entry() as Extract<StackBlock, { type: 'frame' }>).frame}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n <Match when={block.type === 'text' && block}>\n {(entry) => (\n <TextRow text={(entry() as Extract<StackBlock, { type: 'text' }>).text} />\n )}\n </Match>\n <Match when={block.type === 'group' && block}>\n {(entry) => (\n <FrameGroup\n frames={(entry() as Extract<StackBlock, { type: 'group' }>).frames}\n defaultOpen={local.defaultDependenciesOpen}\n pageSize={pageSize()}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n </Switch>\n )}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <div class=\"ms-2\">\n <ShowMore\n hidden={hidden()}\n pageSize={pageSize()}\n onClick={() => setLimit(shown().length + pageSize())}\n />\n </div>\n </Show>\n </Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuFA,IAAauC,yBAAyB;AACtC,IAAMC,qBAAqB;;AAE3B,IAAMC,oBAAoB;AAC1B,IAAMC,oBAAoB;AAE1B,IAAMC,WACJ;AACF,IAAMC,mBACJ;AAEF,SAASC,aAAaC,OAAeC,OAAuB;CAC1D,OAAOD,QAAQ,IACX,KAAKA,MAAME,eAAe,EAAC,QAASF,UAAU,IAAI,SAAS,QAAO,IAAKC,MAAMC,eAAe,EAAC,0BAC7F,KAAKD,MAAMC,eAAe,EAAC;AACjC;;AAGA,SAASC,YAAYC,OAAqC;CACxD,MAAMC,UAAU/C,iBAAiBa,WAAWiC,MAAMJ,OAAOL,mBAAmBC,iBAA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AA,OAAG8J,MAAM,CAAC,CAA2C9J;UAAI,EAAA,CAAA;SACvE,CAAA;SAAA4B,gBAEFjD,OAAK;UAAA,IAACkD,OAAI;WAAA,OAAE+F,MAAMC,SAAS,WAAWD;UAAK;UAAA5F,WACxC8H,UAAKlI,gBACJ0B,YAAU;WAAA,IACTC,SAAM;YAAA,OAAGuG,MAAM,CAAC,CAA4CvG;WAAM;WAAA,IAClEC,cAAW;YAAA,OAAE8D,MAAMjH;WAAuB;WAAA,IAC1CoD,WAAQ;YAAA,OAAEA,SAAS;WAAC;WAAA,IACpBC,SAAM;YAAA,OAAE4D,MAAMrH;WAAW;UAAA,CAAA;SAE5B,CAAA;QAAA;OAAA,EAAA,CAAA;MAGN,CAAA,CAAA;MAAA,OAAA2J;KAAA,EAAA,CAAA;KAAAhI,gBAGJhD,MAAI;MAAA,IAACiD,OAAI;OAAA,OAAEoC,OAAO,IAAI;MAAC;MAAA,IAAAjC,WAAA;OAAA,IAAAgI,SAAAC,SAAA;OAAAvI,OAAAsI,QAAApI,gBAEnB6C,UAAQ;QAAA,IACPR,SAAM;SAAA,OAAEA,OAAO;QAAC;QAAA,IAChBR,WAAQ;SAAA,OAAEA,SAAS;QAAC;QACpBiB,eAAeZ,SAASE,MAAM,CAAC,CAACxB,SAASiB,SAAS,CAAC;OAAC,CAAA,CAAA;OAAA,OAAAuG;MAAA;KAAA,CAAA;IAAA;GAAA;EAAA,CAAA,CAAA;EAAA,OAAA1B;CAAA,EAAA,CAAA;AAOlE;AAAC4B,eAAA,CAAA,OAAA,CAAA"}
1
+ {"version":3,"file":"stack-trace.js","names":["Check","CircleAlert","Copy","Package","createMemo","createSignal","For","Match","Show","splitProps","Switch","createCopyFeedback","cn","Button","CodeBlock","TraceLine","boundLines","dedentLines","describeFrameGroup","frameLocation","groupStackEntries","parseStackTrace","text","onOpenFrame","frame","classify","collapseDependencies","defaultDependenciesOpen","maxBlocks","copyLabel","copiedLabel","onCopy","ok","STACK_TRACE_MAX_BLOCKS","TEXT_DISPLAY_LIMIT","DETAIL_LINE_LIMIT","DETAIL_CHAR_LIMIT","rowClass","interactiveClass","omissionNote","lines","chars","toLocaleString","FrameDetail","props","bounded","_el$","_tmpl$","_$insert","join","_$createComponent","when","omittedLines","omittedChars","children","_el$2","_tmpl$2","_el$3","firstChild","ClippedText","class","clipped","length","_el$4","_tmpl$3","_c$","_$memo","slice","_$effect","_$className","_el$5","_tmpl$4","_el$8","nextSibling","FrameGroup","frames","defaultOpen","pageSize","onOpen","open","setOpen","limit","setLimit","title","shown","hidden","icon","onOpenChange","_el$9","_tmpl$5","each","FrameRow","_$setAttribute","ShowMore","onClick","_el$0","_tmpl$6","variant","size","Math","min","location","first","kind","content","_el$1","async","function","_el$10","_tmpl$7","_el$11","_tmpl$8","_el$12","_tmpl$0","undefined","file","fallback","_el$14","_tmpl$1","_el$13","_tmpl$9","$$click","_p$","_v$","_v$2","e","t","detail","TextRow","_el$15","_tmpl$11","_c$2","_el$16","_tmpl$10","_el$19","StackTrace","local","rest","parsed","blocks","entries","filter","block","type","trim","max","floor","copied","failed","copyFailed","copy","copyText","_el$20","_tmpl$15","_$spread","_$mergeProps","format","code","complete","wrap","_el$21","_tmpl$12","_el$22","_el$23","header","_tmpl$16","_el$27","_tmpl$18","message","_tmpl$17","_el$29","_tmpl$19","_el$24","_tmpl$13","entry","_el$25","_tmpl$14","_$delegateEvents"],"sources":["../../../../src/components/composites/stack-trace/stack-trace.tsx"],"sourcesContent":["import { Check, CircleAlert, Copy, Package } from 'lucide-solid'\nimport {\n createMemo,\n createSignal,\n For,\n Match,\n Show,\n splitProps,\n Switch,\n type ComponentProps,\n} from 'solid-js'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport { CodeBlock } from '../../ui/code-block'\nimport { TraceLine } from '../../ui/trace'\nimport {\n boundLines,\n dedentLines,\n describeFrameGroup,\n frameLocation,\n groupStackEntries,\n parseStackTrace,\n type ParseStackTraceOptions,\n type StackBlock,\n type StackFrame,\n} from './parse-stack-trace'\n\n/**\n * StackTrace.\n *\n * A failed call and the frames it failed through. Put it in the body of the\n * `TraceLine` for the call that failed, or under a failing test; reach for\n * `CodeBlock` when the text is not a trace, and for `Terminal` when it is the\n * live output of a command rather than one error.\n *\n * ## The reader's code first\n *\n * A trace is mostly someone else's frames. Runs of dependency and runtime frames\n * (`node_modules`, `site-packages`, `.cargo/registry`, `node:` internals, Rust's\n * `std`) fold into one disclosure line that says what it holds, and a lone\n * dependency frame is dimmed rather than folded. When *none* of the frames is the\n * reader's, nothing folds: hiding the whole trace behind a button helps nobody.\n * Whose code a frame is comes from its path; a host that knows the project layout\n * passes `classify`.\n *\n * ## It never hides a line\n *\n * Every line of `text` is on screen in order — as a frame, as a header, or as\n * muted text — and a trace in a format this does not know is shown whole in a\n * `CodeBlock`, which also copies it. Copy writes `text` exactly as given, not a\n * reformatted version of what was parsed.\n *\n * ## Opening a frame is the host's decision\n *\n * A frame is a button only when `onOpenFrame` is supplied, and only when the\n * frame names a file; without it frames are plain text, because a control that\n * does nothing is a tab stop with no purpose. The component never builds a path\n * or tries to open one — the trace is untrusted text, and what a path in it means\n * on this machine is the host's call.\n *\n * Text is text throughout: frames, messages and source lines are rendered as text\n * nodes, long unbroken tokens wrap rather than widening the column, and what is\n * drawn is bounded with the omission stated every time: a text line or a header\n * message beyond 10 000 characters, a frame's printed lines beyond 40 lines or\n * 10 000 characters, and the frames of a folded group, which are built only while\n * it is open and then `maxBlocks` at a time. Copy and `onOpenFrame` still get all of\n * it.\n */\nexport type StackTraceProps = Omit<ComponentProps<'div'>, 'children'> & {\n /** The trace exactly as the runtime printed it. */\n text: string\n /** Make frames that name a file open it. Omit to render them as plain text. */\n onOpenFrame?: (frame: StackFrame) => void\n classify?: ParseStackTraceOptions['classify']\n /** Fold runs of dependency and runtime frames. Default true. */\n collapseDependencies?: boolean\n /** Start folded groups open. */\n defaultDependenciesOpen?: boolean\n /** Blocks (frames, groups, text) shown before \"show more\". Default 200. */\n maxBlocks?: number\n copyLabel?: string\n copiedLabel?: string\n /** Called after each copy attempt with whether the clipboard accepted it. */\n onCopy?: (ok: boolean) => void\n}\n\nexport const STACK_TRACE_MAX_BLOCKS = 200\nconst TEXT_DISPLAY_LIMIT = 10_000\n/** What a frame's own printed lines (a Python source line, a locals dump) may show. */\nconst DETAIL_LINE_LIMIT = 40\nconst DETAIL_CHAR_LIMIT = 10_000\n\nconst rowClass =\n 'flex min-w-0 flex-wrap items-baseline gap-x-2 rounded-md px-1.5 py-0.5 text-start text-xs outline-none'\nconst interactiveClass =\n 'w-full cursor-pointer transition-colors ease-out hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-primary-subtle focus-visible:border-ring'\n\nfunction omissionNote(lines: number, chars: number): string {\n return lines > 0\n ? `… ${lines.toLocaleString()} more ${lines === 1 ? 'line' : 'lines'} (${chars.toLocaleString()} characters) not shown`\n : `… ${chars.toLocaleString()} more characters not shown`\n}\n\n/** A frame's printed lines, bounded so one frame cannot be the whole page. */\nfunction FrameDetail(props: { lines: readonly string[] }) {\n const bounded = createMemo(() => boundLines(props.lines, DETAIL_LINE_LIMIT, DETAIL_CHAR_LIMIT))\n return (\n <>\n <pre class=\"m-0 ms-1.5 px-1.5 font-code text-code whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n {dedentLines(bounded().lines).join('\\n')}\n </pre>\n <Show when={bounded().omittedLines > 0 || bounded().omittedChars > 0}>\n <p class=\"m-0 ms-1.5 px-1.5 text-xs text-muted-foreground italic\">\n {omissionNote(bounded().omittedLines, bounded().omittedChars)}\n {' (copy has all of it)'}\n </p>\n </Show>\n </>\n )\n}\n\n/** Header text, cut to the display limit with what was cut stated. */\nfunction ClippedText(props: { text: string; class?: string }) {\n const clipped = () => props.text.length > TEXT_DISPLAY_LIMIT\n return (\n <>\n <span class={props.class}>\n {clipped() ? props.text.slice(0, TEXT_DISPLAY_LIMIT) : props.text}\n </span>\n <Show when={clipped()}>\n <span class=\"block text-xs text-muted-foreground italic\">\n … {(props.text.length - TEXT_DISPLAY_LIMIT).toLocaleString()} more characters not shown\n (copy has all of it)\n </span>\n </Show>\n </>\n )\n}\n\n/**\n * A folded run of dependency or runtime frames. Its rows are built only while it\n * is open and then a page at a time, so a run of ten thousand frames costs the\n * same as one of a few hundred until the reader asks for more.\n */\nfunction FrameGroup(props: {\n frames: readonly StackFrame[]\n defaultOpen?: boolean\n pageSize: number\n onOpen?: (frame: StackFrame) => void\n}) {\n const [open, setOpen] = createSignal(props.defaultOpen === true)\n const [limit, setLimit] = createSignal<number | undefined>()\n const title = createMemo(() => describeFrameGroup(props.frames))\n const shown = createMemo(() => props.frames.slice(0, limit() ?? props.pageSize))\n const hidden = () => props.frames.length - shown().length\n return (\n <TraceLine icon={<Package />} title={title()} open={open()} onOpenChange={setOpen}>\n <Show when={open()}>\n <ol role=\"list\" aria-label={title()} class=\"m-0 flex min-w-0 list-none flex-col gap-px p-0\">\n <For each={shown()}>{(frame) => <FrameRow frame={frame} onOpen={props.onOpen} />}</For>\n </ol>\n <Show when={hidden() > 0}>\n <ShowMore\n hidden={hidden()}\n pageSize={props.pageSize}\n onClick={() => setLimit(shown().length + props.pageSize)}\n />\n </Show>\n </Show>\n </TraceLine>\n )\n}\n\nfunction ShowMore(props: { hidden: number; pageSize: number; onClick: () => void }) {\n return (\n <div class=\"ps-1.5\">\n <Button variant=\"ghost\" size=\"2xs\" onClick={props.onClick}>\n Show {Math.min(props.hidden, props.pageSize).toLocaleString()} more (\n {props.hidden.toLocaleString()} hidden)\n </Button>\n </div>\n )\n}\n\nfunction FrameRow(props: { frame: StackFrame; onOpen?: (frame: StackFrame) => void }) {\n const location = () => frameLocation(props.frame)\n const first = () => props.frame.kind === 'first-party'\n const content = () => (\n <>\n <span\n class={cn('font-code text-code', {\n 'text-foreground': first(),\n 'text-muted-foreground': !first(),\n })}\n >\n {props.frame.async ? 'async ' : ''}\n {props.frame.function ?? '(anonymous)'}\n </span>\n <Show when={location()}>\n <span class=\"min-w-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n {location()}\n </span>\n </Show>\n {/* The dimming is a colour; the kind is also spoken. */}\n <Show when={!first()}>\n <span class=\"sr-only\">\n {props.frame.kind === 'dependency' ? 'in a dependency' : 'in the runtime'}\n </span>\n </Show>\n </>\n )\n return (\n <li data-slot=\"stack-frame\" data-kind={props.frame.kind} class=\"min-w-0\">\n <Show\n when={props.onOpen !== undefined && props.frame.file !== undefined}\n fallback={<div class={rowClass}>{content()}</div>}\n >\n <button\n type=\"button\"\n aria-label={`Open ${props.frame.async ? 'async ' : ''}${props.frame.function ?? '(anonymous)'} ${location()}`}\n class={cn(rowClass, interactiveClass)}\n onClick={() => props.onOpen?.(props.frame)}\n >\n {content()}\n </button>\n </Show>\n <Show when={props.frame.detail && props.frame.detail.length > 0}>\n <FrameDetail lines={props.frame.detail!} />\n </Show>\n </li>\n )\n}\n\nfunction TextRow(props: { text: string }) {\n const clipped = () => props.text.length > TEXT_DISPLAY_LIMIT\n return (\n <li class=\"min-w-0 px-1.5 py-0.5 font-code text-code whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n {clipped() ? props.text.slice(0, TEXT_DISPLAY_LIMIT) : props.text}\n <Show when={clipped()}>\n <span class=\"block font-sans text-xs italic\">\n … {(props.text.length - TEXT_DISPLAY_LIMIT).toLocaleString()} more characters not shown\n </span>\n </Show>\n </li>\n )\n}\n\nexport function StackTrace(props: StackTraceProps) {\n const [local, rest] = splitProps(props, [\n 'text',\n 'onOpenFrame',\n 'classify',\n 'collapseDependencies',\n 'defaultDependenciesOpen',\n 'maxBlocks',\n 'copyLabel',\n 'copiedLabel',\n 'onCopy',\n 'class',\n ])\n\n const parsed = createMemo(() => parseStackTrace(local.text, { classify: local.classify }))\n const blocks = createMemo<readonly StackBlock[]>(() =>\n groupStackEntries(parsed().entries, local.collapseDependencies !== false).filter(\n // A blank line between paragraphs of a trace carries nothing to draw.\n (block) => block.type !== 'text' || block.text.trim() !== ''\n )\n )\n const pageSize = () => Math.max(1, Math.floor(local.maxBlocks ?? STACK_TRACE_MAX_BLOCKS))\n const [limit, setLimit] = createSignal<number | undefined>()\n const shown = createMemo(() => blocks().slice(0, limit() ?? pageSize()))\n const hidden = () => blocks().length - shown().length\n\n const { copied, failed: copyFailed, copy: copyText } = createCopyFeedback()\n const copy = async () => {\n const ok = await copyText(local.text)\n local.onCopy?.(ok)\n }\n\n return (\n <div\n data-slot=\"stack-trace\"\n data-format={parsed().format}\n class={cn('flex min-w-0 flex-col gap-1', local.class)}\n {...rest}\n >\n <Show\n when={parsed().format !== 'unknown'}\n fallback={\n // Nothing recognised: the whole text, in the block that copies it.\n <CodeBlock size=\"sm\" title=\"Error output\" code={local.text} complete wrap />\n }\n >\n <div class=\"group/stack flex items-start gap-2\">\n <CircleAlert aria-hidden=\"true\" class=\"mt-0.5 size-4 shrink-0 text-destructive\" />\n <div class=\"min-w-0 flex-1 text-sm\">\n <Show\n when={parsed().header}\n fallback={<span class=\"text-muted-foreground\">Stack trace</span>}\n >\n {(header) => (\n <>\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Show when={header().type}>\n <ClippedText class=\"font-semibold text-destructive\" text={header().type!} />\n <Show when={header().message !== ''}>\n <span class=\"text-muted-foreground\">: </span>\n </Show>\n </Show>\n <ClippedText class=\"text-foreground\" text={header().message} />\n </p>\n <Show when={header().location}>\n <p class=\"m-0 font-code text-code text-muted-foreground [overflow-wrap:anywhere]\">\n <ClippedText text={header().location!} />\n </p>\n </Show>\n </>\n )}\n </Show>\n </div>\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/stack:opacity-100 group-hover/stack:opacity-100 [@media(hover:none)]:opacity-100\">\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={\n copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy stack trace')\n }\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </Button>\n </div>\n </div>\n\n <ol\n role=\"list\"\n aria-label=\"Stack frames\"\n class=\"m-0 ms-2 flex min-w-0 list-none flex-col gap-px border-s border-border p-0 ps-2\"\n >\n <For each={shown()}>\n {(block) => (\n <Switch>\n <Match when={block.type === 'frame' && block}>\n {(entry) => (\n <FrameRow\n frame={(entry() as Extract<StackBlock, { type: 'frame' }>).frame}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n <Match when={block.type === 'text' && block}>\n {(entry) => (\n <TextRow text={(entry() as Extract<StackBlock, { type: 'text' }>).text} />\n )}\n </Match>\n <Match when={block.type === 'group' && block}>\n {(entry) => (\n <FrameGroup\n frames={(entry() as Extract<StackBlock, { type: 'group' }>).frames}\n defaultOpen={local.defaultDependenciesOpen}\n pageSize={pageSize()}\n onOpen={local.onOpenFrame}\n />\n )}\n </Match>\n </Switch>\n )}\n </For>\n </ol>\n <Show when={hidden() > 0}>\n <div class=\"ms-2\">\n <ShowMore\n hidden={hidden()}\n pageSize={pageSize()}\n onClick={() => setLimit(shown().length + pageSize())}\n />\n </div>\n </Show>\n </Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuFA,IAAaiC,yBAAyB;AACtC,IAAMC,qBAAqB;;AAE3B,IAAMC,oBAAoB;AAC1B,IAAMC,oBAAoB;AAE1B,IAAMC,WACJ;AACF,IAAMC,mBACJ;AAEF,SAASC,aAAaC,OAAeC,OAAuB;CAC1D,OAAOD,QAAQ,IACX,KAAKA,MAAME,eAAe,EAAC,QAASF,UAAU,IAAI,SAAS,QAAO,IAAKC,MAAMC,eAAe,EAAC,0BAC7F,KAAKD,MAAMC,eAAe,EAAC;AACjC;;AAGA,SAASC,YAAYC,OAAqC;CACxD,MAAMC,UAAUzC,iBAAiBY,WAAW4B,MAAMJ,OAA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,IAAC1G,OAAI;WAAA,OAAGwJ,MAAM,CAAC,CAA2CxJ;UAAI,EAAA,CAAA;SACvE,CAAA;SAAA4B,gBAEF3C,OAAK;UAAA,IAAC4C,OAAI;WAAA,OAAE2F,MAAMC,SAAS,WAAWD;UAAK;UAAAxF,WACxCwH,UAAK5H,gBACJwB,YAAU;WAAA,IACTC,SAAM;YAAA,OAAGmG,MAAM,CAAC,CAA4CnG;WAAM;WAAA,IAClEC,cAAW;YAAA,OAAE4D,MAAM7G;WAAuB;WAAA,IAC1CkD,WAAQ;YAAA,OAAEA,SAAS;WAAC;WAAA,IACpBC,SAAM;YAAA,OAAE0D,MAAMjH;WAAW;UAAA,CAAA;SAE5B,CAAA;QAAA;OAAA,EAAA,CAAA;MAGN,CAAA,CAAA;MAAA,OAAAqJ;KAAA,EAAA,CAAA;KAAA1H,gBAGJ1C,MAAI;MAAA,IAAC2C,OAAI;OAAA,OAAEkC,OAAO,IAAI;MAAC;MAAA,IAAA/B,WAAA;OAAA,IAAAyH,SAAAC,SAAA;OAAAhI,OAAA+H,QAAA7H,gBAEnB2C,UAAQ;QAAA,IACPR,SAAM;SAAA,OAAEA,OAAO;QAAC;QAAA,IAChBR,WAAQ;SAAA,OAAEA,SAAS;QAAC;QACpBiB,eAAeZ,SAASE,MAAM,CAAC,CAACtB,SAASe,SAAS,CAAC;OAAC,CAAA,CAAA;OAAA,OAAAkG;MAAA;KAAA,CAAA;IAAA;GAAA;EAAA,CAAA,CAAA;EAAA,OAAAvB;CAAA,EAAA,CAAA;AAOlE;AAACyB,eAAA,CAAA,OAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"stat.js","names":["ArrowDownRight","ArrowUpRight","ComponentProps","JSX","Show","splitProps","Dynamic","cn","Heading","Text","StatProps","label","value","Element","unit","delta","deltaTone","accent","Stat","props","local","rest","_el$","_tmpl$2","_el$2","firstChild","_el$3","nextSibling","_$spread","_$mergeProps","class","_$insert","_$createComponent","as","size","numeric","children","when","variant","tone","_el$4","_tmpl$","_el$5","component","StatGroup","fit","_el$6","_tmpl$3","PropertyList","_el$7","_tmpl$4","PropertyTerm","_el$8","_tmpl$5","PropertyValue","_el$9","_tmpl$6","PropertyRow","term","_el$0","_tmpl$7","_el$1","_el$10","_$mergeProps","_$createComponent"],"sources":["../../../../src/components/composites/stat/stat.tsx"],"sourcesContent":["import { ArrowDownRight, ArrowUpRight } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { cn } from '#lib/utils'\nimport { Heading, Text } from '../../ui/typography'\n\n/**\n * Stat.\n *\n * A single measured number with its label and, optionally, its change. The\n * whole component is a decision about honesty: a value shown without its\n * comparison is not information, so `delta` carries the direction, the amount\n * and — through `deltaTone` — whether the direction is *good*. A rising number\n * is not always a rising outcome, and only the caller knows which way is which.\n *\n * `tabular-nums` on the value is what lets two stats in a row be compared\n * without the digits shifting under the reader.\n */\nexport type StatProps = ComponentProps<'div'> & {\n label: string\n value: JSX.Element\n /** A unit or qualifier after the value, e.g. \"ms\", \"of 10\". */\n unit?: string\n /** The change, e.g. \"+12% from last week\". */\n delta?: string\n /** Whether the change is an improvement. Decides the arrow and the colour. */\n deltaTone?: 'up' | 'down' | 'neutral'\n /** Draws the leading accent rule used for a row of headline numbers. */\n accent?: boolean\n}\n\nexport function Stat(props: StatProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'value',\n 'unit',\n 'delta',\n 'deltaTone',\n 'accent',\n 'children',\n ])\n\n return (\n <div\n data-slot=\"stat\"\n class={cn(\n 'flex min-w-0 flex-col gap-1 rounded-lg border border-border bg-card p-3',\n { 'border-t-2 border-t-primary': local.accent },\n local.class\n )}\n {...rest}\n >\n <div class=\"text-muted-foreground truncate text-xs font-medium\">{local.label}</div>\n <div class=\"flex items-baseline gap-1\">\n <Heading as=\"span\" size=\"page\" numeric>\n {local.value}\n </Heading>\n <Show when={local.unit}>\n <Text variant=\"caption\" tone=\"muted\">\n {local.unit}\n </Text>\n </Show>\n </div>\n <Show when={local.delta}>\n <div class=\"text-foreground flex items-center gap-1 text-xs\">\n <Show when={local.deltaTone === 'up' || local.deltaTone === 'down'}>\n <Dynamic\n component={local.deltaTone === 'down' ? ArrowDownRight : ArrowUpRight}\n aria-hidden=\"true\"\n class={cn('size-3', {\n 'text-success': local.deltaTone === 'up',\n 'text-destructive': local.deltaTone === 'down',\n })}\n />\n </Show>\n <span class=\"tabular-nums\">{local.delta}</span>\n </div>\n </Show>\n {local.children}\n </div>\n )\n}\n\n/**\n * A row of stats that shares one gap and wraps as the window narrows.\n *\n * By default the column count steps with the *viewport* (two from `sm`, four from\n * `lg`), which is right for a group that spans the page. A group inside a pane\n * whose width is not the window's (a docked panel, a resizable column, a view\n * beside a sidebar) gets the wrong count from a viewport breakpoint. `fit` sizes\n * from the group's own width instead: as many tiles per row as fit at the\n * minimum tile width, each growing to share the remainder, however many stats\n * there are.\n */\nexport function StatGroup(props: ComponentProps<'div'> & { fit?: boolean }) {\n const [local, rest] = splitProps(props, ['class', 'fit'])\n return (\n <div\n data-slot=\"stat-group\"\n class={cn(\n 'grid gap-3',\n // 9.375rem is 150px at the default root size: room for a label of about\n // twenty characters and a six-digit value before the tile truncates.\n local.fit\n ? 'grid-cols-[repeat(auto-fill,minmax(9.375rem,1fr))]'\n : 'sm:grid-cols-2 lg:grid-cols-4',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/**\n * PropertyList.\n *\n * A definition list for read-only metadata: the details of a file, a session, a\n * build. This is a `<dl>`, not a table and not a grid of divs, because the\n * relationship being expressed is term-and-definition and the platform has an\n * element for exactly that.\n *\n * Values are selectable by default. Metadata is the thing users copy most and\n * get the least often: a commit hash behind a drag-to-select gesture is a small\n * daily failure.\n */\nexport function PropertyList(props: ComponentProps<'dl'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <dl\n data-slot=\"property-list\"\n class={cn('grid grid-cols-[auto_1fr] items-baseline gap-x-4 gap-y-2 text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function PropertyTerm(props: ComponentProps<'dt'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <dt\n data-slot=\"property-term\"\n class={cn('text-muted-foreground whitespace-nowrap', local.class)}\n {...rest}\n />\n )\n}\n\nexport function PropertyValue(props: ComponentProps<'dd'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <dd\n data-slot=\"property-value\"\n class={cn('min-w-0 break-words select-text', local.class)}\n {...rest}\n />\n )\n}\n\n/** A single term/value pair, for a list built one row at a time. */\nexport function PropertyRow(props: ComponentProps<'div'> & { term: string }) {\n const [local, rest] = splitProps(props, ['class', 'term', 'children'])\n\n return (\n <div\n data-slot=\"property-row\"\n class={cn('flex items-baseline justify-between gap-4 text-sm', local.class)}\n {...rest}\n >\n <span class=\"text-muted-foreground shrink-0\">{local.term}</span>\n <span class=\"min-w-0 truncate text-end select-text\">{local.children}</span>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAgCA,SAAgBkB,KAAKC,OAAkB;CACrC,MAAM,CAACC,OAAOC,QAAQhB,WAAWc,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,cAAA;EAAA,IAAAG,OAAAC,QAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAG;EAAAC,OAAAN,MAAAO,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWtB,GACL,2EACA,EAAE,+BAA+Ba,MAAMH,OAAO,GAC9CG,MAAMU,KACR;EAAC,EAAA,GACGT,IAAI,GAAA,OAAA,IAAA;EAAAU,OAAAP,aAEyDJ,MAAMT,KAAK;EAAAoB,OAAAL,OAAAM,gBAEzExB,SAAO;GAACyB,IAAE;GAAQC,MAAI;GAAQC,SAAO;GAAA,IAAAC,WAAA;IAAA,OACnChB,MAAMR;GAAK;EAAA,CAAA,GAAA,IAAA;EAAAmB,OAAAL,OAAAM,gBAEb5B,M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A9B,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWtB,GAAG,qDAAqDa,MAAMU,KAAK;EAAC,EAAA,GACvET,IAAI,GAAA,OAAA,IAAA;EAAAU,OAAA8B,aAEsCzC,MAAMsC,IAAI;EAAA3B,OAAA+B,cACH1C,MAAMgB,QAAQ;EAAA,OAAAuB;CAAA,EAAA,CAAA;AAGzE"}
1
+ {"version":3,"file":"stat.js","names":["ArrowDownRight","ArrowUpRight","Show","splitProps","Dynamic","cn","Heading","Text","label","value","unit","delta","deltaTone","accent","Stat","props","local","rest","_el$","_tmpl$2","_el$2","firstChild","_el$3","nextSibling","_$spread","_$mergeProps","class","_$insert","_$createComponent","as","size","numeric","children","when","variant","tone","_el$4","_tmpl$","_el$5","component","StatGroup","fit","_el$6","_tmpl$3","PropertyList","_el$7","_tmpl$4","PropertyTerm","_el$8","_tmpl$5","PropertyValue","_el$9","_tmpl$6","PropertyRow","term","_el$0","_tmpl$7","_el$1","_el$10"],"sources":["../../../../src/components/composites/stat/stat.tsx"],"sourcesContent":["import { ArrowDownRight, ArrowUpRight } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { cn } from '#lib/utils'\nimport { Heading, Text } from '../../ui/typography'\n\n/**\n * Stat.\n *\n * A single measured number with its label and, optionally, its change. The\n * whole component is a decision about honesty: a value shown without its\n * comparison is not information, so `delta` carries the direction, the amount\n * and — through `deltaTone` — whether the direction is *good*. A rising number\n * is not always a rising outcome, and only the caller knows which way is which.\n *\n * `tabular-nums` on the value is what lets two stats in a row be compared\n * without the digits shifting under the reader.\n */\nexport type StatProps = ComponentProps<'div'> & {\n label: string\n value: JSX.Element\n /** A unit or qualifier after the value, e.g. \"ms\", \"of 10\". */\n unit?: string\n /** The change, e.g. \"+12% from last week\". */\n delta?: string\n /** Whether the change is an improvement. Decides the arrow and the colour. */\n deltaTone?: 'up' | 'down' | 'neutral'\n /** Draws the leading accent rule used for a row of headline numbers. */\n accent?: boolean\n}\n\nexport function Stat(props: StatProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'value',\n 'unit',\n 'delta',\n 'deltaTone',\n 'accent',\n 'children',\n ])\n\n return (\n <div\n data-slot=\"stat\"\n class={cn(\n 'flex min-w-0 flex-col gap-1 rounded-lg border border-border bg-card p-3',\n { 'border-t-2 border-t-primary': local.accent },\n local.class\n )}\n {...rest}\n >\n <div class=\"text-muted-foreground truncate text-xs font-medium\">{local.label}</div>\n <div class=\"flex items-baseline gap-1\">\n <Heading as=\"span\" size=\"page\" numeric>\n {local.value}\n </Heading>\n <Show when={local.unit}>\n <Text variant=\"caption\" tone=\"muted\">\n {local.unit}\n </Text>\n </Show>\n </div>\n <Show when={local.delta}>\n <div class=\"text-foreground flex items-center gap-1 text-xs\">\n <Show when={local.deltaTone === 'up' || local.deltaTone === 'down'}>\n <Dynamic\n component={local.deltaTone === 'down' ? ArrowDownRight : ArrowUpRight}\n aria-hidden=\"true\"\n class={cn('size-3', {\n 'text-success': local.deltaTone === 'up',\n 'text-destructive': local.deltaTone === 'down',\n })}\n />\n </Show>\n <span class=\"tabular-nums\">{local.delta}</span>\n </div>\n </Show>\n {local.children}\n </div>\n )\n}\n\n/**\n * A row of stats that shares one gap and wraps as the window narrows.\n *\n * By default the column count steps with the *viewport* (two from `sm`, four from\n * `lg`), which is right for a group that spans the page. A group inside a pane\n * whose width is not the window's (a docked panel, a resizable column, a view\n * beside a sidebar) gets the wrong count from a viewport breakpoint. `fit` sizes\n * from the group's own width instead: as many tiles per row as fit at the\n * minimum tile width, each growing to share the remainder, however many stats\n * there are.\n */\nexport function StatGroup(props: ComponentProps<'div'> & { fit?: boolean }) {\n const [local, rest] = splitProps(props, ['class', 'fit'])\n return (\n <div\n data-slot=\"stat-group\"\n class={cn(\n 'grid gap-3',\n // 9.375rem is 150px at the default root size: room for a label of about\n // twenty characters and a six-digit value before the tile truncates.\n local.fit\n ? 'grid-cols-[repeat(auto-fill,minmax(9.375rem,1fr))]'\n : 'sm:grid-cols-2 lg:grid-cols-4',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/**\n * PropertyList.\n *\n * A definition list for read-only metadata: the details of a file, a session, a\n * build. This is a `<dl>`, not a table and not a grid of divs, because the\n * relationship being expressed is term-and-definition and the platform has an\n * element for exactly that.\n *\n * Values are selectable by default. Metadata is the thing users copy most and\n * get the least often: a commit hash behind a drag-to-select gesture is a small\n * daily failure.\n */\nexport function PropertyList(props: ComponentProps<'dl'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <dl\n data-slot=\"property-list\"\n class={cn('grid grid-cols-[auto_1fr] items-baseline gap-x-4 gap-y-2 text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function PropertyTerm(props: ComponentProps<'dt'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <dt\n data-slot=\"property-term\"\n class={cn('text-muted-foreground whitespace-nowrap', local.class)}\n {...rest}\n />\n )\n}\n\nexport function PropertyValue(props: ComponentProps<'dd'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <dd\n data-slot=\"property-value\"\n class={cn('min-w-0 break-words select-text', local.class)}\n {...rest}\n />\n )\n}\n\n/** A single term/value pair, for a list built one row at a time. */\nexport function PropertyRow(props: ComponentProps<'div'> & { term: string }) {\n const [local, rest] = splitProps(props, ['class', 'term', 'children'])\n\n return (\n <div\n data-slot=\"property-row\"\n class={cn('flex items-baseline justify-between gap-4 text-sm', local.class)}\n {...rest}\n >\n <span class=\"text-muted-foreground shrink-0\">{local.term}</span>\n <span class=\"min-w-0 truncate text-end select-text\">{local.children}</span>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAgCA,SAAgBc,KAAKC,OAAkB;CACrC,MAAM,CAACC,OAAOC,QAAQd,WAAWY,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,cAAA;EAAA,IAAAG,OAAAC,QAAA,GAA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;EAAA,IAAAoC,QAAAC,QAAA;EAAA5B,OAAA2B,OAAA1B,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWpB,GAAG,mCAAmCW,MAAMU,KAAK;EAAC,EAAA,GACrDT,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAkC;CAAA,EAAA,CAAA;AAGd;;AAGA,SAAgBE,YAAYtC,OAAiD;CAC3E,MAAM,CAACC,OAAOC,QAAQd,WAAWY,OAAO;EAAC;EAAS;EAAQ;CAAU,CAAC;CAErE,cAAA;EAAA,IAAAwC,QAAAC,QAAA,GAAAC,QAAAF,MAAAlC,YAAAqC,SAAAD,MAAAlC;EAAAC,OAAA+B,OAAA9B,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWpB,GAAG,qDAAqDW,MAAMU,KAAK;EAAC,EAAA,GACvET,IAAI,GAAA,OAAA,IAAA;EAAAU,OAAA8B,aAEsCzC,MAAMsC,IAAI;EAAA3B,OAAA+B,cACH1C,MAAMgB,QAAQ;EAAA,OAAAuB;CAAA,EAAA,CAAA;AAGzE"}
@@ -1 +1 @@
1
- {"version":3,"file":"subagent.js","names":["Bot","children","resolveChildren","Show","splitProps","JSX","ScrollArea","formatDuration","Trace","TraceDetail","TraceError","TraceLine","TraceLineProps","TraceStatus","SubagentProps","Omit","Element","name","task","status","model","duration","stepCount","result","errorText","meta","stepCountLabel","count","Subagent","props","local","rest","steps","toArray","length","hasError","undefined","hasResult","hasDetail","summary","parts","filter","part","join","_$createComponent","when","_el$","_tmpl$","_$insert","_$memo","detail","size","aria-label","text","_el$2","_tmpl$2","_el$3","firstChild","role","_$mergeProps","icon","title","description","resolveChildren","_$createComponent","_$memo","_$mergeProps"],"sources":["../../../../src/components/composites/subagent/subagent.tsx"],"sourcesContent":["import { Bot } from 'lucide-solid'\nimport { children as resolveChildren, Show, splitProps, type JSX } from 'solid-js'\nimport { ScrollArea } from '../../ui/scroll-area'\nimport {\n formatDuration,\n Trace,\n TraceDetail,\n TraceError,\n TraceLine,\n type TraceLineProps,\n type TraceStatus,\n} from '../../ui/trace'\n\n/**\n * Subagent.\n *\n * Another agent the main one handed work to, as a `TraceLine`: its name, the task\n * it was given, its status, and — folded away — everything it did. The body is a\n * nested `Trace`, so a subagent's tool calls, reasoning and own subagents are the\n * same lines as the parent's, one level in; nothing about \"a run inside a run\"\n * needs a new visual. Reach for `Tool` when the call has an input and an output\n * and no steps of its own, and for `Task` when the items are a statement of work\n * rather than a record of what ran.\n *\n * ## The collapsed line is the summary\n *\n * Folded, the line carries what a reader scanning the turn needs: the name, the\n * task, the status, and — in the trailing text — the model, the number of steps\n * and how long it took. Each of those appears only when known: `model` and\n * `duration` are the host's, and the step count is the number of lines passed as\n * `children` unless the host knows better (`stepCount`, for a run whose earlier\n * steps are not loaded). No count is shown for a run with no steps.\n *\n * ## Result and failure\n *\n * `result` is a slot for the answer the subagent returned — usually prose or a\n * `CodeBlock` — below its steps, labelled \"Result\". `errorText` is a failure as\n * text. Neither is invented: a subagent that finished without a result shows\n * none, and one with no steps, result or error yet is a plain line (there is\n * nothing to open; the line becomes a disclosure when its first step arrives).\n *\n * A `Subagent` is a line: place it inside a `Trace`, and its `children` are\n * `TraceLine`s.\n */\nexport type SubagentProps = Omit<\n TraceLineProps,\n 'title' | 'description' | 'href' | 'onSelect' | 'selectHaspopup' | 'meta' | 'children'\n> & {\n /** The run's steps, as `TraceLine`s. */\n children?: JSX.Element\n /** The subagent's name. Rendered as text. */\n name: string\n /** The task it was given, on the line. */\n task?: JSX.Element\n status?: TraceStatus\n /** A model label, e.g. `sonnet-5`. Rendered as text. */\n model?: string\n /** Seconds the run took, if the host measured it. */\n duration?: number\n /** Overrides the count taken from `children`. */\n stepCount?: number\n /** What the subagent returned. */\n result?: JSX.Element\n errorText?: string\n /** Trailing text appended after the derived summary. */\n meta?: JSX.Element\n}\n\n/** `3 steps`, `1 step`. */\nexport function stepCountLabel(count: number): string {\n return `${count} ${count === 1 ? 'step' : 'steps'}`\n}\n\nexport function Subagent(props: SubagentProps) {\n const [local, rest] = splitProps(props, [\n 'name',\n 'task',\n 'status',\n 'model',\n 'duration',\n 'stepCount',\n 'result',\n 'errorText',\n 'icon',\n 'meta',\n 'children',\n ])\n // Resolved once: the steps are created once and keep their own state (an open\n // tool call, a scrolled output) while the run is folded and unfolded.\n const steps = resolveChildren(() => local.children)\n const count = () => local.stepCount ?? steps.toArray().length\n const hasError = () => local.errorText !== undefined && local.errorText !== ''\n const hasResult = () => local.result !== undefined && local.result !== null\n const hasDetail = () => steps.toArray().length > 0 || hasResult() || hasError()\n\n const summary = () => {\n const parts = [\n local.model,\n count() > 0 ? stepCountLabel(count()) : undefined,\n formatDuration(local.duration),\n ].filter((part): part is string => part !== undefined && part !== '')\n return parts.length > 0 ? parts.join(' · ') : undefined\n }\n\n // A model label is host text and may be long; it must not widen the line.\n const meta = () =>\n summary() || local.meta ? (\n <>\n <Show when={summary()}>\n <span class=\"inline-block max-w-72 truncate align-bottom\">{summary()}</span>\n </Show>\n {local.meta}\n </>\n ) : undefined\n\n const detail = () => (\n <TraceDetail class=\"flex flex-col gap-2\">\n <Show when={steps.toArray().length > 0}>\n <Trace size=\"sm\" aria-label={`${local.name} steps`}>\n {steps()}\n </Trace>\n </Show>\n <Show when={hasError()}>\n <TraceError text={local.errorText ?? ''} />\n </Show>\n <Show when={hasResult()}>\n <div class=\"flex min-w-0 flex-col gap-1\">\n <p class=\"m-0 font-medium text-foreground\">Result</p>\n <ScrollArea role=\"region\" aria-label={`${local.name} result`} class=\"max-h-72\">\n {local.result}\n </ScrollArea>\n </div>\n </Show>\n </TraceDetail>\n )\n\n return (\n <TraceLine\n icon={local.icon ?? <Bot />}\n title={local.name}\n description={local.task}\n status={local.status}\n meta={meta()}\n {...rest}\n >\n {hasDetail() ? detail : undefined}\n </TraceLine>\n )\n}\n"],"mappings":";;;;;;;;;AAqEA,SAAgB0B,eAAeC,OAAuB;CACpD,OAAO,GAAGA,MAAK,GAAIA,UAAU,IAAI,SAAS;AAC5C;AAEA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Area","formatDuration","Trace","TraceDetail","TraceError","TraceLine","name","task","status","model","duration","stepCount","result","errorText","meta","stepCountLabel","count","Subagent","props","local","rest","steps","toArray","length","hasError","undefined","hasResult","hasDetail","summary","parts","filter","part","join","_$createComponent","when","_el$","_tmpl$","_$insert","_$memo","detail","size","text","_el$2","_tmpl$2","firstChild","role","_$mergeProps","icon","title","description"],"sources":["../../../../src/components/composites/subagent/subagent.tsx"],"sourcesContent":["import { Bot } from 'lucide-solid'\nimport { children as resolveChildren, Show, splitProps, type JSX } from 'solid-js'\nimport { ScrollArea } from '../../ui/scroll-area'\nimport {\n formatDuration,\n Trace,\n TraceDetail,\n TraceError,\n TraceLine,\n type TraceLineProps,\n type TraceStatus,\n} from '../../ui/trace'\n\n/**\n * Subagent.\n *\n * Another agent the main one handed work to, as a `TraceLine`: its name, the task\n * it was given, its status, and — folded away — everything it did. The body is a\n * nested `Trace`, so a subagent's tool calls, reasoning and own subagents are the\n * same lines as the parent's, one level in; nothing about \"a run inside a run\"\n * needs a new visual. Reach for `Tool` when the call has an input and an output\n * and no steps of its own, and for `Task` when the items are a statement of work\n * rather than a record of what ran.\n *\n * ## The collapsed line is the summary\n *\n * Folded, the line carries what a reader scanning the turn needs: the name, the\n * task, the status, and — in the trailing text — the model, the number of steps\n * and how long it took. Each of those appears only when known: `model` and\n * `duration` are the host's, and the step count is the number of lines passed as\n * `children` unless the host knows better (`stepCount`, for a run whose earlier\n * steps are not loaded). No count is shown for a run with no steps.\n *\n * ## Result and failure\n *\n * `result` is a slot for the answer the subagent returned — usually prose or a\n * `CodeBlock` — below its steps, labelled \"Result\". `errorText` is a failure as\n * text. Neither is invented: a subagent that finished without a result shows\n * none, and one with no steps, result or error yet is a plain line (there is\n * nothing to open; the line becomes a disclosure when its first step arrives).\n *\n * A `Subagent` is a line: place it inside a `Trace`, and its `children` are\n * `TraceLine`s.\n */\nexport type SubagentProps = Omit<\n TraceLineProps,\n 'title' | 'description' | 'href' | 'onSelect' | 'selectHaspopup' | 'meta' | 'children'\n> & {\n /** The run's steps, as `TraceLine`s. */\n children?: JSX.Element\n /** The subagent's name. Rendered as text. */\n name: string\n /** The task it was given, on the line. */\n task?: JSX.Element\n status?: TraceStatus\n /** A model label, e.g. `sonnet-5`. Rendered as text. */\n model?: string\n /** Seconds the run took, if the host measured it. */\n duration?: number\n /** Overrides the count taken from `children`. */\n stepCount?: number\n /** What the subagent returned. */\n result?: JSX.Element\n errorText?: string\n /** Trailing text appended after the derived summary. */\n meta?: JSX.Element\n}\n\n/** `3 steps`, `1 step`. */\nexport function stepCountLabel(count: number): string {\n return `${count} ${count === 1 ? 'step' : 'steps'}`\n}\n\nexport function Subagent(props: SubagentProps) {\n const [local, rest] = splitProps(props, [\n 'name',\n 'task',\n 'status',\n 'model',\n 'duration',\n 'stepCount',\n 'result',\n 'errorText',\n 'icon',\n 'meta',\n 'children',\n ])\n // Resolved once: the steps are created once and keep their own state (an open\n // tool call, a scrolled output) while the run is folded and unfolded.\n const steps = resolveChildren(() => local.children)\n const count = () => local.stepCount ?? steps.toArray().length\n const hasError = () => local.errorText !== undefined && local.errorText !== ''\n const hasResult = () => local.result !== undefined && local.result !== null\n const hasDetail = () => steps.toArray().length > 0 || hasResult() || hasError()\n\n const summary = () => {\n const parts = [\n local.model,\n count() > 0 ? stepCountLabel(count()) : undefined,\n formatDuration(local.duration),\n ].filter((part): part is string => part !== undefined && part !== '')\n return parts.length > 0 ? parts.join(' · ') : undefined\n }\n\n // A model label is host text and may be long; it must not widen the line.\n const meta = () =>\n summary() || local.meta ? (\n <>\n <Show when={summary()}>\n <span class=\"inline-block max-w-72 truncate align-bottom\">{summary()}</span>\n </Show>\n {local.meta}\n </>\n ) : undefined\n\n const detail = () => (\n <TraceDetail class=\"flex flex-col gap-2\">\n <Show when={steps.toArray().length > 0}>\n <Trace size=\"sm\" aria-label={`${local.name} steps`}>\n {steps()}\n </Trace>\n </Show>\n <Show when={hasError()}>\n <TraceError text={local.errorText ?? ''} />\n </Show>\n <Show when={hasResult()}>\n <div class=\"flex min-w-0 flex-col gap-1\">\n <p class=\"m-0 font-medium text-foreground\">Result</p>\n <ScrollArea role=\"region\" aria-label={`${local.name} result`} class=\"max-h-72\">\n {local.result}\n </ScrollArea>\n </div>\n </Show>\n </TraceDetail>\n )\n\n return (\n <TraceLine\n icon={local.icon ?? <Bot />}\n title={local.name}\n description={local.task}\n status={local.status}\n meta={meta()}\n {...rest}\n >\n {hasDetail() ? detail : undefined}\n </TraceLine>\n )\n}\n"],"mappings":";;;;;;;;;AAqEA,SAAgBoB,eAAeC,OAAuB;CACpD,OAAO,GAAGA,MAAK,GAAIA,UAAU,IAAI,SAAS;AAC5C;AAEA,SAAgBC,SAASC,OAAsB;CAC7C,MAAM,CAACC,OAAOC,QAAQrB,WAAWmB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAGD,MAAMG,QAAQxB,eAAsBsB,MAAMvB,QAAQ;CAClD,MAAMoB,cAAcG,MAAMR,aAAaU,MAAMC,QAAQ,CAAC,CAACC;CACvD,MAAMC,iBAAiBL,MAAMN,cAAcY,KAAAA,KAAaN,MAAMN,cAAc;CAC5E,MAAMa,kBAAkBP,MAAMP,WAAWa,KAAAA,KAAaN,MAAMP,WAAW;CACvE,MAAMe,kBAAkBN,MAAMC,QAAQ,CAAC,CAACC,SAAS,KAAKG,UAAU,KAAKF,SAAS;CAE9E,MAAMI,gBAAgB;EACpB,MAAMC,QAAQ;GACZV,MAAMV;GACNO,MAAM,IAAI,IAAID,eAAeC,MAAM,CAAC,IAAIS,KAAAA;GACxCxB,eAAekB,MAAMT,QAAQ;EAAC,CAC/B,CAACoB,QAAQC,SAAyBA,SAASN,KAAAA,KAAaM,SAAS,EAAE;EACpE,OAAOF,MAAMN,SAAS,IAAIM,MAAMG,KAAK,KAAK,IAAIP,KAAAA;CAChD;CAGA,MAAMX,aACJc,QAAQ,KAAKT,MAAML,OAAI,CAAAmB,gBAElBnC,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B,MAAM4B,QAAId,gBAAKtC,KAAG,CAAA,CAAA;EAAG;EAAA,IAC3BqD,QAAK;GAAA,OAAE7B,MAAMb;EAAI;EAAA,IACjB2C,cAAW;GAAA,OAAE9B,MAAMZ;EAAI;EAAA,IACvBC,SAAM;GAAA,OAAEW,MAAMX;EAAM;EAAA,IACpBM,OAAI;GAAA,OAAEA,KAAK;EAAC;CAAA,GACRM,MAAI,EAAA,IAAAxB,WAAA;EAAA,OAEP+B,UAAU,IAAIY,SAASd,KAAAA;CAAS,EAAA,CAAA,CAAA;AAGvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"suggestion.js","names":["createContext","createUniqueId","Show","splitProps","useContext","ComponentProps","callHandler","cn","Button","REASON_TEXT_LIMIT","boundText","SuggestionsProps","Omit","label","layout","onSelect","text","disabledReason","SuggestionsContext","select","blocked","reasonId","Suggestions","props","local","rest","uid","reason","undefined","_$createComponent","Provider","value","children","_el$","_tmpl$2","_el$2","firstChild","_$spread","_$mergeProps","aria-label","class","_$insert","when","_el$3","_tmpl$","_$setAttribute","SuggestionProps","Suggestion","context","type","variant","size","title","_$memo","length","aria-disabled","aria-describedby","onClick","event","preventDefault","_el$4","_tmpl$3","_$createComponent","_$mergeProps","_$memo"],"sources":["../../../../src/components/composites/suggestion/suggestion.tsx"],"sourcesContent":["import {\n createContext,\n createUniqueId,\n Show,\n splitProps,\n useContext,\n type ComponentProps,\n} from 'solid-js'\nimport { callHandler } from '#lib/events'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport { REASON_TEXT_LIMIT, boundText } from '#lib/text'\n\n/**\n * Suggestions.\n *\n * A row of one-click prompts: each chip is the text that will be sent, so choosing\n * one is a single decision and never \"fill the composer, then still have to press\n * send\". What a chip *does* with its text — send it, drop it in the composer —\n * is the host's `onSelect`; this component only reports which one was chosen.\n *\n * - **Layout.** `wrap` (default) lets chips flow onto further lines, which is the\n * right behaviour at a narrow width. `scroll` keeps a single line that scrolls\n * sideways, for a bar above a composer that must not grow; the chips are real\n * buttons, so keyboard focus scrolls them into view and nothing depends on a\n * pointer to reach the overflow.\n * - **Long text is clipped, not hidden.** A chip is one line and truncates; the\n * full text is the button's accessible name and its `title`.\n * - **The host owns authority.** No `onSelect`, or a `disabledReason`, disables\n * every chip and says why in words under the row. Chips use `aria-disabled`\n * rather than `disabled`, so a keyboard or screen-reader user can still reach\n * them and hear the reason instead of finding a row that is silently skipped.\n */\nexport type SuggestionsProps = Omit<ComponentProps<'div'>, 'onSelect'> & {\n /** The row's accessible name. */\n label?: string\n layout?: 'wrap' | 'scroll'\n /** Called with the chosen chip's text. Without it every chip is disabled. */\n onSelect?: (text: string) => void\n /** Why the chips cannot be used right now. Implies disabled. */\n disabledReason?: string\n}\n\ntype SuggestionsContext = {\n select: (text: string) => void\n blocked: () => boolean\n reasonId: () => string | undefined\n}\n\nconst SuggestionsContext = createContext<SuggestionsContext>()\n\nexport function Suggestions(props: SuggestionsProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'layout',\n 'onSelect',\n 'disabledReason',\n 'children',\n ])\n const uid = createUniqueId()\n const reasonId = `${uid}-reason`\n const reason = () =>\n local.disabledReason\n ? boundText(local.disabledReason, REASON_TEXT_LIMIT)\n : local.onSelect === undefined\n ? 'Suggestions are not available here.'\n : undefined\n\n return (\n <SuggestionsContext.Provider\n value={{\n select: (text) => local.onSelect?.(text),\n blocked: () => reason() !== undefined,\n reasonId: () => (reason() ? reasonId : undefined),\n }}\n >\n <div data-slot=\"suggestions\" class=\"flex min-w-0 flex-col gap-1.5\">\n <div\n role=\"group\"\n aria-label={local.label ?? 'Suggested prompts'}\n class={cn(\n 'flex min-w-0 gap-2',\n {\n 'flex-wrap': local.layout !== 'scroll',\n // Padding below keeps the focus ring of a chip from being clipped by the scroller.\n 'flex-nowrap overflow-x-auto p-1 [&>*]:shrink-0': local.layout === 'scroll',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>\n <Show when={reason()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {reason()}\n </p>\n </Show>\n </div>\n </SuggestionsContext.Provider>\n )\n}\n\nexport type SuggestionProps = Omit<ComponentProps<'button'>, 'onSelect' | 'children'> & {\n /** The text that is sent when the chip is chosen. Also the chip's name. */\n text: string\n}\n\nexport function Suggestion(props: SuggestionProps) {\n const [local, rest] = splitProps(props, ['class', 'text', 'onClick'])\n const context = useContext(SuggestionsContext)\n // A chip outside a `Suggestions` row has no handler to call: inert and honest.\n const blocked = () => context === undefined || context.blocked()\n const text = () => boundText(local.text, 400)\n\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n data-slot=\"suggestion\"\n title={text().length > 40 ? text() : undefined}\n aria-disabled={blocked() || undefined}\n aria-describedby={context?.reasonId()}\n class={cn('max-w-full', local.class)}\n onClick={(event) => {\n if (blocked()) {\n event.preventDefault()\n return\n }\n callHandler(local.onClick, event)\n // The host's own string, untouched: only the label is clipped, never what is sent.\n context?.select(local.text)\n }}\n {...rest}\n >\n <span class=\"truncate\">{text()}</span>\n </Button>\n )\n}\n"],"mappings":";;;;;;;;;;AAiDA,IAAMkB,qBAAqBlB,cAAkC;AAE7D,SAAgBsB,YAAYC,OAAyB;CACnD,MAAM,CAACC,OAAOC,QAAQtB,WAAWoB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,MAAMF,WAAW,GADLpB,eACQyB,EAAG;CACvB,MAAMC,eACJH,MAAMP,iBACFP,UAAUc,MAAMP,gBAAAA,GAAiC,IACjDO,MAAMT,aAAaa,KAAAA,IACjB,wCACAA,KAAAA;CAER,OAAAC,gBACGX,mBAAmBY,UAAQ;EAC1BC,OAAO;GACLZ,SAASH,SAASQ,MAAMT,WAAWC,IAAI;GACvCI,eAAeO,OAAO,MAAMC,KAAAA;GAC5BP,gBAAiBM,OAAO,IAAIN,WAAWO,KAAAA;EACzC;EAAC,IAAAI,WAAA;GAAA,IAAAC,OAAAC,QAAA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;EACpCiB,UAAUC,UAAU;GAClB,IAAItC,QAAQ,GAAG;IACbsC,MAAMC,eAAe;IACrB;GACF;GACArD,YAAYkB,MAAMiC,SAASC,KAAK;GAEhCV,SAAS7B,OAAOK,MAAMR,IAAI;EAC5B;CAAC,GACGS,MAAI,EAAA,IAAAO,WAAA;EAAA,IAAA4B,QAAAC,QAAA;EAAApB,OAAAmB,OAEgB5C,IAAI;EAAA,OAAA4C;CAAA,EAAA,CAAA,CAAA;AAGlC"}
1
+ {"version":3,"file":"suggestion.js","names":["createContext","createUniqueId","Show","splitProps","useContext","callHandler","cn","Button","boundText","label","layout","onSelect","text","disabledReason","SuggestionsContext","select","blocked","reasonId","Suggestions","props","local","rest","uid","reason","undefined","_$createComponent","Provider","value","children","_el$","_tmpl$2","_el$2","firstChild","_$spread","_$mergeProps","class","_$insert","when","_el$3","_tmpl$","_$setAttribute","Suggestion","context","type","variant","size","title","_$memo","length","onClick","event","preventDefault","_el$4","_tmpl$3"],"sources":["../../../../src/components/composites/suggestion/suggestion.tsx"],"sourcesContent":["import {\n createContext,\n createUniqueId,\n Show,\n splitProps,\n useContext,\n type ComponentProps,\n} from 'solid-js'\nimport { callHandler } from '#lib/events'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport { REASON_TEXT_LIMIT, boundText } from '#lib/text'\n\n/**\n * Suggestions.\n *\n * A row of one-click prompts: each chip is the text that will be sent, so choosing\n * one is a single decision and never \"fill the composer, then still have to press\n * send\". What a chip *does* with its text — send it, drop it in the composer —\n * is the host's `onSelect`; this component only reports which one was chosen.\n *\n * - **Layout.** `wrap` (default) lets chips flow onto further lines, which is the\n * right behaviour at a narrow width. `scroll` keeps a single line that scrolls\n * sideways, for a bar above a composer that must not grow; the chips are real\n * buttons, so keyboard focus scrolls them into view and nothing depends on a\n * pointer to reach the overflow.\n * - **Long text is clipped, not hidden.** A chip is one line and truncates; the\n * full text is the button's accessible name and its `title`.\n * - **The host owns authority.** No `onSelect`, or a `disabledReason`, disables\n * every chip and says why in words under the row. Chips use `aria-disabled`\n * rather than `disabled`, so a keyboard or screen-reader user can still reach\n * them and hear the reason instead of finding a row that is silently skipped.\n */\nexport type SuggestionsProps = Omit<ComponentProps<'div'>, 'onSelect'> & {\n /** The row's accessible name. */\n label?: string\n layout?: 'wrap' | 'scroll'\n /** Called with the chosen chip's text. Without it every chip is disabled. */\n onSelect?: (text: string) => void\n /** Why the chips cannot be used right now. Implies disabled. */\n disabledReason?: string\n}\n\ntype SuggestionsContext = {\n select: (text: string) => void\n blocked: () => boolean\n reasonId: () => string | undefined\n}\n\nconst SuggestionsContext = createContext<SuggestionsContext>()\n\nexport function Suggestions(props: SuggestionsProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'layout',\n 'onSelect',\n 'disabledReason',\n 'children',\n ])\n const uid = createUniqueId()\n const reasonId = `${uid}-reason`\n const reason = () =>\n local.disabledReason\n ? boundText(local.disabledReason, REASON_TEXT_LIMIT)\n : local.onSelect === undefined\n ? 'Suggestions are not available here.'\n : undefined\n\n return (\n <SuggestionsContext.Provider\n value={{\n select: (text) => local.onSelect?.(text),\n blocked: () => reason() !== undefined,\n reasonId: () => (reason() ? reasonId : undefined),\n }}\n >\n <div data-slot=\"suggestions\" class=\"flex min-w-0 flex-col gap-1.5\">\n <div\n role=\"group\"\n aria-label={local.label ?? 'Suggested prompts'}\n class={cn(\n 'flex min-w-0 gap-2',\n {\n 'flex-wrap': local.layout !== 'scroll',\n // Padding below keeps the focus ring of a chip from being clipped by the scroller.\n 'flex-nowrap overflow-x-auto p-1 [&>*]:shrink-0': local.layout === 'scroll',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>\n <Show when={reason()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {reason()}\n </p>\n </Show>\n </div>\n </SuggestionsContext.Provider>\n )\n}\n\nexport type SuggestionProps = Omit<ComponentProps<'button'>, 'onSelect' | 'children'> & {\n /** The text that is sent when the chip is chosen. Also the chip's name. */\n text: string\n}\n\nexport function Suggestion(props: SuggestionProps) {\n const [local, rest] = splitProps(props, ['class', 'text', 'onClick'])\n const context = useContext(SuggestionsContext)\n // A chip outside a `Suggestions` row has no handler to call: inert and honest.\n const blocked = () => context === undefined || context.blocked()\n const text = () => boundText(local.text, 400)\n\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n data-slot=\"suggestion\"\n title={text().length > 40 ? text() : undefined}\n aria-disabled={blocked() || undefined}\n aria-describedby={context?.reasonId()}\n class={cn('max-w-full', local.class)}\n onClick={(event) => {\n if (blocked()) {\n event.preventDefault()\n return\n }\n callHandler(local.onClick, event)\n // The host's own string, untouched: only the label is clipped, never what is sent.\n context?.select(local.text)\n }}\n {...rest}\n >\n <span class=\"truncate\">{text()}</span>\n </Button>\n )\n}\n"],"mappings":";;;;;;;;;;AAiDA,IAAMc,qBAAqBd,cAAkC;AAE7D,SAAgBkB,YAAYC,OAAyB;CACnD,MAAM,CAACC,OAAOC,QAAQlB,WAAWgB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,MAAMF,WAAW,GADLhB,eACQqB,EAAG;CACvB,MAAMC,eACJH,MAAMP,iBACFL,UAAUY,MAAMP,gBAAAA,GAAiC,IACjDO,MAAMT,aAAaa,KAAAA,IACjB,wCACAA,KAAAA;CAER,OAAAC,gBACGX,mBAAmBY,UAAQ;EAC1BC,OAAO;GACLZ,SAASH,SAASQ,MAAMT,WAAWC,IAAI;GACvCI,eAAeO,OAAO,MAAMC,KAAAA;GAC5BP,gBAAiBM,OAAO,IAAIN,WAAWO,KAAAA;EACzC;EAAC,IAAAI,WAAA;GAAA,IAAAC,OAAAC,QAAA,GAAAC,QAAAF,KAAAG;GAAAC,OAAAF,OAAAG,WAAA;IAAA,KAAA,gBAAA;KAAA,OAKed,MAAMX,SAAS;IAAmB;IAAA,KAAA,WAAA;KAAA,OACvCH,GACL,sBACA;MACE,aAAac,MAAMV,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,MAAI,EAAA,IAAAO,WAAA;EAAA,IAAAwB,QAAAC,QAAA;EAAAjB,OAAAgB,OAEgBxC,IAAI;EAAA,OAAAwC;CAAA,EAAA,CAAA,CAAA;AAGlC"}
@@ -1 +1 @@
1
- {"version":3,"file":"task.js","names":["ListChecks","createMemo","createSignal","For","Index","Show","splitProps","ComponentProps","JSX","cn","Attachment","AttachmentList","AttachmentKind","Button","ScrollArea","TraceLine","TraceMark","WORK_STATUS_LABELS","WORK_TRACE_STATUS","TraceLineProps","WorkStatus","TaskItemStatus","TaskFile","Readonly","name","kind","size","TaskItem","id","text","description","status","files","TASK_ITEM_STATUS_LABELS","Record","VISIBLE_FILES","MAX_TEXT","bound","max","length","slice","taskProgress","items","Pick","done","total","some","item","undefined","filter","taskProgressLabel","progress","TaskItemRowProps","Omit","statusLabel","TaskItemRow","props","local","rest","showAllFiles","setShowAllFiles","shownFiles","hiddenFiles","_el$","_tmpl$2","_el$2","firstChild","_el$3","_$spread","_$mergeProps","data-status","class","_$insert","_$createComponent","slot","_$memo","completed","icon","_tmpl$3","when","children","_el$6","_tmpl$4","_el$7","_el$8","_tmpl$5","each","file","_el$9","_tmpl$6","variant","_el$4","_tmpl$","type","aria-expanded","onClick","value","_$effect","_p$","_v$","_v$2","e","_$setAttribute","t","_$className","TaskItemListProps","label","Element","TaskItemList","role","aria-label","_el$0","_tmpl$7","TaskProps","itemsLabel","Task","derivedMeta","title","list","meta","_$mergeProps","_$createComponent","_$memo","_$setAttribute","_$className"],"sources":["../../../../src/components/composites/task/task.tsx"],"sourcesContent":["import { ListChecks } from 'lucide-solid'\nimport {\n createMemo,\n createSignal,\n For,\n Index,\n Show,\n splitProps,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Attachment, AttachmentList, type AttachmentKind } from '../../ui/attachment'\nimport { Button } from '../../ui/button'\nimport { ScrollArea } from '../../ui/scroll-area'\nimport {\n TraceLine,\n TraceMark,\n WORK_STATUS_LABELS,\n WORK_TRACE_STATUS,\n type TraceLineProps,\n type WorkStatus,\n} from '../../ui/trace'\n\n/**\n * Task.\n *\n * One piece of work the agent is doing, as a `TraceLine` that opens onto its\n * items: a title, then a list in which each item is a sentence, optionally a\n * status, and optionally the files it touched. Reach for `Plan` when the list is\n * a proposal the person approves, for `Queue` when it is the agent's running\n * todo list, and for a `Trace` of tool calls when the items are things that\n * *ran* — a Task item is a statement about work, not a record of a call.\n *\n * ## Items wrap; lines do not\n *\n * A `TraceLine` truncates its title to one row, which is right for \"Read\n * src/app.tsx\" and wrong for \"Backfill locale from profile.language, falling\n * back to en\". Items are therefore their own rows with the same mark and colour\n * vocabulary as a Trace line but wrapping text, clamped to three lines so a\n * pasted paragraph cannot take the column. `TaskItemRow` and `TaskItemList` are\n * exported because `Plan` and `Queue` are built from them.\n *\n * ## Status is a claim\n *\n * An item shows a mark and speaks a word only when the host supplied `status`.\n * The \"2 of 4 done\" in the header is derived from those statuses and appears\n * only if at least one item has one; items without a status are counted in the\n * total and not in \"done\" (see `taskProgress`). A task with no items is a plain\n * line: there is nothing to open, and an empty disclosure is a control that\n * does nothing.\n *\n * ## Files are untrusted metadata\n *\n * File chips are `Attachment` chips with no handlers, so they are text: a name\n * is never a link or a path. Past six, the rest sit behind one toggle button\n * whose label changes in place, so keyboard focus survives opening and closing\n * it.\n */\nexport type TaskItemStatus = WorkStatus\n\nexport type TaskFile = Readonly<{\n name: string\n kind?: AttachmentKind\n /** Bytes. */\n size?: number\n}>\n\nexport type TaskItem = Readonly<{\n /** Only needed for the host's own bookkeeping; rows are kept by position. */\n id?: string\n text: string\n description?: string\n status?: TaskItemStatus\n files?: readonly TaskFile[]\n}>\n\nexport const TASK_ITEM_STATUS_LABELS: Readonly<Record<TaskItemStatus, string>> = WORK_STATUS_LABELS\n\n/** Visible files per item before the rest go behind a toggle. */\nconst VISIBLE_FILES = 6\n/** Characters of item text kept; the rest of a pasted wall is not a todo. */\nconst MAX_TEXT = 1_000\n\nfunction bound(text: string, max: number): string {\n return text.length > max ? `${text.slice(0, max)}…` : text\n}\n\n/**\n * How many items are done, or nothing at all when no item carries a status.\n * Items without a status count toward the total: the host did not say they were\n * finished, so they are not.\n */\nexport function taskProgress(\n items: readonly Pick<TaskItem, 'status'>[]\n): Readonly<{ done: number; total: number }> | undefined {\n if (!items.some((item) => item.status !== undefined)) return undefined\n return {\n done: items.filter((item) => item.status === 'complete').length,\n total: items.length,\n }\n}\n\n/** `2 of 4 done`, in words. */\nexport function taskProgressLabel(progress: { done: number; total: number }): string {\n return `${progress.done} of ${progress.total} done`\n}\n\nexport type TaskItemRowProps = Omit<ComponentProps<'li'>, 'children'> & {\n text: string\n description?: string\n status?: TaskItemStatus\n files?: readonly TaskFile[]\n /** Spoken in place of the default status word. */\n statusLabel?: string\n}\n\nexport function TaskItemRow(props: TaskItemRowProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'text',\n 'description',\n 'status',\n 'files',\n 'statusLabel',\n ])\n const [showAllFiles, setShowAllFiles] = createSignal(false)\n const files = () => local.files ?? []\n const shownFiles = () => (showAllFiles() ? files() : files().slice(0, VISIBLE_FILES))\n const hiddenFiles = () => files().length - VISIBLE_FILES\n const text = () => bound(local.text, MAX_TEXT)\n\n return (\n <li\n data-slot=\"task-item\"\n data-status={local.status}\n class={cn('flex min-w-0 gap-2 rounded-md px-1.5 py-0.5', local.class)}\n {...rest}\n >\n <TraceMark\n slot=\"task-item-mark\"\n class=\"mt-0.5\"\n status={local.status ? WORK_TRACE_STATUS[local.status] : undefined}\n completed={local.status === 'complete'}\n icon={\n local.status ? undefined : <span class=\"size-1 rounded-full bg-muted-foreground/60\" />\n }\n />\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\n <p\n title={text()}\n class={cn(\n 'm-0 line-clamp-3 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap text-foreground',\n {\n 'text-muted-foreground': local.status === 'complete' || local.status === 'skipped',\n 'text-destructive': local.status === 'failed',\n }\n )}\n >\n {text()}\n <Show when={local.status}>\n {(status) => (\n <span class=\"sr-only\"> {local.statusLabel ?? TASK_ITEM_STATUS_LABELS[status()]}</span>\n )}\n </Show>\n </p>\n <Show when={local.description}>\n {(description) => (\n <p class=\"m-0 line-clamp-3 text-xs [overflow-wrap:anywhere] text-muted-foreground/80\">\n {bound(description(), MAX_TEXT)}\n </p>\n )}\n </Show>\n <Show when={files().length > 0}>\n <AttachmentList aria-label=\"Files\" class=\"gap-1\">\n <For each={shownFiles()}>\n {(file) => (\n <li class=\"min-w-0 max-w-full\">\n <Attachment variant=\"chip\" name={file.name} kind={file.kind} size={file.size} />\n </li>\n )}\n </For>\n <Show when={hiddenFiles() > 0}>\n <li class=\"flex items-center\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"2xs\"\n aria-expanded={showAllFiles()}\n onClick={() => setShowAllFiles((value) => !value)}\n >\n {showAllFiles() ? 'Show fewer files' : `Show ${hiddenFiles()} more files`}\n </Button>\n </li>\n </Show>\n </AttachmentList>\n </Show>\n </div>\n </li>\n )\n}\n\nexport type TaskItemListProps = Omit<ComponentProps<'div'>, 'children'> & {\n /** The list's accessible name. A scrolling region without one is an unlabelled tab stop. */\n label: string\n children?: JSX.Element\n}\n\n/**\n * The items, bounded. Two hundred todo items must scroll inside their line and\n * not push the answer out of view; the region is keyboard-focusable and named,\n * which is what makes the overflow reachable without a pointer.\n */\nexport function TaskItemList(props: TaskItemListProps) {\n const [local, rest] = splitProps(props, ['class', 'label', 'children'])\n return (\n <ScrollArea\n role=\"region\"\n aria-label={local.label}\n class={cn('max-h-72', local.class)}\n {...rest}\n >\n <ul role=\"list\" class=\"m-0 flex list-none flex-col gap-0.5 p-0\">\n {local.children}\n </ul>\n </ScrollArea>\n )\n}\n\nexport type TaskProps = Omit<\n TraceLineProps,\n 'description' | 'href' | 'onSelect' | 'selectHaspopup' | 'children'\n> & {\n items: readonly TaskItem[]\n /** The item list's accessible name. Defaults to the title when it is a string. */\n itemsLabel?: string\n}\n\nexport function Task(props: TaskProps) {\n const [local, rest] = splitProps(props, ['items', 'itemsLabel', 'icon', 'meta', 'title'])\n const progress = createMemo(() => taskProgress(local.items))\n const derivedMeta = () => {\n const value = progress()\n return value ? taskProgressLabel(value) : undefined\n }\n const label = () =>\n local.itemsLabel ?? (typeof local.title === 'string' ? `${local.title} items` : 'Task items')\n\n const list = () => (\n <TaskItemList label={label()}>\n <Index each={local.items}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status}\n files={item().files}\n />\n )}\n </Index>\n </TaskItemList>\n )\n\n return (\n <TraceLine\n icon={local.icon ?? <ListChecks />}\n title={local.title}\n meta={local.meta ?? derivedMeta()}\n {...rest}\n >\n {local.items.length > 0 ? list : undefined}\n </TraceLine>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA6EA,IAAaiC,0BAAoEhB;;AAGjF,IAAMkB,gBAAgB;;AAEtB,IAAMC,WAAW;AAEjB,SAASC,MAAMR,MAAcS,KAAqB;CAChD,OAAOT,KAAKU,SAASD,MAAM,GAAGT,KAAKW,MAAM,GAAGF,GAAG,EAAC,KAAMT;AACxD;;;;;;AAOA,SAAgBY,aACdC,OACuD;CACvD,IAAI,CAACA,MAAMI,MAAMC,SAASA,KAAKhB,WAAWiB,KAAAA,CAAS,GAAG,OAAOA,KAAAA;CAC7D,OAAO;EACLJ,MAAMF,MAAMO,QAAQF,SAASA,KAAKhB,WAAW,UAAU,CAAC,CAACQ;EACzDM,OAAOH,MAAMH;CACf;AACF;;AAGA,SAAgBW,kBAAkBC,UAAmD;CACnF,OAAO,GAAGA,SAASP,KAAI,MAAOO,SAASN,MAAK;AAC9C;AAWA,SAAgBU,YAAYC,OAAyB;CACnD,MAAM,CAACC,OAAOC,QAAQpD,WAAWkD,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;CAAa,CACd;CACD,MAAM,CAACG,cAAcC,mBAAmB1D,aAAa,KAAK;CAC1D,MAAM8B,cAAcyB,MAAMzB,SAAS,CAAA;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,cACJjD,MAAMyD,eAAe,OAAOzD,MAAM4D,UAAU,WAAW,GAAG5D,MAAM4D,MAAK,UAAW;CAElF,MAAMC,aAAO7C,gBACVmC,cAAY;EAAA,IAACF,QAAK;GAAA,OAAEA,MAAM;EAAC;EAAA,IAAA1B,WAAA;GAAA,OAAAP,gBACzBrE,OAAK;IAAA,IAACkF,OAAI;KAAA,OAAE7B,MAAMf;IAAK;IAAAsC,WACpBjC,SAAI0B,gBACHlB,aAAW;KAAA,IACV1B,OAAI;MAAA,OAAEkB,KAAK,CAAC,CAAClB;KAAI;KAAA,IACjBC,cAAW;MAAA,OAAEiB,KAAK,CAAC,CAACjB;KAAW;KAAA,IAC/BC,SAAM;MAAA,OAAEgB,KAAK,CAAC,CAAChB;KAAM;KAAA,IACrBC,QAAK;MAAA,OAAEe,KAAK,CAAC,CAACf;KAAK;IAAA,CAAA;GAEtB,CAAA;EAAA;CAAA,CAAA;CAKP,OAAAyC,gBACG1D,WAASsD,WAAA;EAAA,IACRQ,OAAI;GAAA,OAAEpB,MAAMoB,QAAIJ,gBAAKzE,YAAU,CAAA,CAAA;EAAG;EAAA,IAClCqH,QAAK;GAAA,OAAE5D,MAAM4D;EAAK;EAAA,IAClBE,OAAI;GAAA,OAAE9D,MAAM8D,QAAQH,YAAY;EAAC;CAAA,GAC7B1D,MAAI,EAAA,IAAAsB,WAAA;EAAA,OAEPvB,MAAMf,MAAMH,SAAS,IAAI+E,OAAOtE,KAAAA;CAAS,EAAA,CAAA,CAAA;AAGhD"}
1
+ {"version":3,"file":"task.js","names":["ListChecks","createMemo","createSignal","For","Index","Show","splitProps","cn","Attachment","AttachmentList","Button","ScrollArea","TraceLine","TraceMark","WORK_STATUS_LABELS","WORK_TRACE_STATUS","name","kind","size","text","description","status","files","TASK_ITEM_STATUS_LABELS","VISIBLE_FILES","MAX_TEXT","bound","max","length","slice","taskProgress","items","done","total","some","item","undefined","filter","taskProgressLabel","progress","statusLabel","TaskItemRow","props","local","rest","showAllFiles","setShowAllFiles","shownFiles","hiddenFiles","_el$","_tmpl$2","_el$2","firstChild","_el$3","_$spread","_$mergeProps","class","_$insert","_$createComponent","slot","_$memo","completed","icon","_tmpl$3","when","children","_el$6","_tmpl$4","_el$8","_tmpl$5","each","file","_el$9","_tmpl$6","variant","_el$4","_tmpl$","type","onClick","value","_$effect","_p$","_v$","_v$2","e","_$setAttribute","t","_$className","label","TaskItemList","role","_el$0","_tmpl$7","itemsLabel","Task","derivedMeta","title","list","meta"],"sources":["../../../../src/components/composites/task/task.tsx"],"sourcesContent":["import { ListChecks } from 'lucide-solid'\nimport {\n createMemo,\n createSignal,\n For,\n Index,\n Show,\n splitProps,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Attachment, AttachmentList, type AttachmentKind } from '../../ui/attachment'\nimport { Button } from '../../ui/button'\nimport { ScrollArea } from '../../ui/scroll-area'\nimport {\n TraceLine,\n TraceMark,\n WORK_STATUS_LABELS,\n WORK_TRACE_STATUS,\n type TraceLineProps,\n type WorkStatus,\n} from '../../ui/trace'\n\n/**\n * Task.\n *\n * One piece of work the agent is doing, as a `TraceLine` that opens onto its\n * items: a title, then a list in which each item is a sentence, optionally a\n * status, and optionally the files it touched. Reach for `Plan` when the list is\n * a proposal the person approves, for `Queue` when it is the agent's running\n * todo list, and for a `Trace` of tool calls when the items are things that\n * *ran* — a Task item is a statement about work, not a record of a call.\n *\n * ## Items wrap; lines do not\n *\n * A `TraceLine` truncates its title to one row, which is right for \"Read\n * src/app.tsx\" and wrong for \"Backfill locale from profile.language, falling\n * back to en\". Items are therefore their own rows with the same mark and colour\n * vocabulary as a Trace line but wrapping text, clamped to three lines so a\n * pasted paragraph cannot take the column. `TaskItemRow` and `TaskItemList` are\n * exported because `Plan` and `Queue` are built from them.\n *\n * ## Status is a claim\n *\n * An item shows a mark and speaks a word only when the host supplied `status`.\n * The \"2 of 4 done\" in the header is derived from those statuses and appears\n * only if at least one item has one; items without a status are counted in the\n * total and not in \"done\" (see `taskProgress`). A task with no items is a plain\n * line: there is nothing to open, and an empty disclosure is a control that\n * does nothing.\n *\n * ## Files are untrusted metadata\n *\n * File chips are `Attachment` chips with no handlers, so they are text: a name\n * is never a link or a path. Past six, the rest sit behind one toggle button\n * whose label changes in place, so keyboard focus survives opening and closing\n * it.\n */\nexport type TaskItemStatus = WorkStatus\n\nexport type TaskFile = Readonly<{\n name: string\n kind?: AttachmentKind\n /** Bytes. */\n size?: number\n}>\n\nexport type TaskItem = Readonly<{\n /** Only needed for the host's own bookkeeping; rows are kept by position. */\n id?: string\n text: string\n description?: string\n status?: TaskItemStatus\n files?: readonly TaskFile[]\n}>\n\nexport const TASK_ITEM_STATUS_LABELS: Readonly<Record<TaskItemStatus, string>> = WORK_STATUS_LABELS\n\n/** Visible files per item before the rest go behind a toggle. */\nconst VISIBLE_FILES = 6\n/** Characters of item text kept; the rest of a pasted wall is not a todo. */\nconst MAX_TEXT = 1_000\n\nfunction bound(text: string, max: number): string {\n return text.length > max ? `${text.slice(0, max)}…` : text\n}\n\n/**\n * How many items are done, or nothing at all when no item carries a status.\n * Items without a status count toward the total: the host did not say they were\n * finished, so they are not.\n */\nexport function taskProgress(\n items: readonly Pick<TaskItem, 'status'>[]\n): Readonly<{ done: number; total: number }> | undefined {\n if (!items.some((item) => item.status !== undefined)) return undefined\n return {\n done: items.filter((item) => item.status === 'complete').length,\n total: items.length,\n }\n}\n\n/** `2 of 4 done`, in words. */\nexport function taskProgressLabel(progress: { done: number; total: number }): string {\n return `${progress.done} of ${progress.total} done`\n}\n\nexport type TaskItemRowProps = Omit<ComponentProps<'li'>, 'children'> & {\n text: string\n description?: string\n status?: TaskItemStatus\n files?: readonly TaskFile[]\n /** Spoken in place of the default status word. */\n statusLabel?: string\n}\n\nexport function TaskItemRow(props: TaskItemRowProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'text',\n 'description',\n 'status',\n 'files',\n 'statusLabel',\n ])\n const [showAllFiles, setShowAllFiles] = createSignal(false)\n const files = () => local.files ?? []\n const shownFiles = () => (showAllFiles() ? files() : files().slice(0, VISIBLE_FILES))\n const hiddenFiles = () => files().length - VISIBLE_FILES\n const text = () => bound(local.text, MAX_TEXT)\n\n return (\n <li\n data-slot=\"task-item\"\n data-status={local.status}\n class={cn('flex min-w-0 gap-2 rounded-md px-1.5 py-0.5', local.class)}\n {...rest}\n >\n <TraceMark\n slot=\"task-item-mark\"\n class=\"mt-0.5\"\n status={local.status ? WORK_TRACE_STATUS[local.status] : undefined}\n completed={local.status === 'complete'}\n icon={\n local.status ? undefined : <span class=\"size-1 rounded-full bg-muted-foreground/60\" />\n }\n />\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\n <p\n title={text()}\n class={cn(\n 'm-0 line-clamp-3 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap text-foreground',\n {\n 'text-muted-foreground': local.status === 'complete' || local.status === 'skipped',\n 'text-destructive': local.status === 'failed',\n }\n )}\n >\n {text()}\n <Show when={local.status}>\n {(status) => (\n <span class=\"sr-only\"> {local.statusLabel ?? TASK_ITEM_STATUS_LABELS[status()]}</span>\n )}\n </Show>\n </p>\n <Show when={local.description}>\n {(description) => (\n <p class=\"m-0 line-clamp-3 text-xs [overflow-wrap:anywhere] text-muted-foreground/80\">\n {bound(description(), MAX_TEXT)}\n </p>\n )}\n </Show>\n <Show when={files().length > 0}>\n <AttachmentList aria-label=\"Files\" class=\"gap-1\">\n <For each={shownFiles()}>\n {(file) => (\n <li class=\"min-w-0 max-w-full\">\n <Attachment variant=\"chip\" name={file.name} kind={file.kind} size={file.size} />\n </li>\n )}\n </For>\n <Show when={hiddenFiles() > 0}>\n <li class=\"flex items-center\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"2xs\"\n aria-expanded={showAllFiles()}\n onClick={() => setShowAllFiles((value) => !value)}\n >\n {showAllFiles() ? 'Show fewer files' : `Show ${hiddenFiles()} more files`}\n </Button>\n </li>\n </Show>\n </AttachmentList>\n </Show>\n </div>\n </li>\n )\n}\n\nexport type TaskItemListProps = Omit<ComponentProps<'div'>, 'children'> & {\n /** The list's accessible name. A scrolling region without one is an unlabelled tab stop. */\n label: string\n children?: JSX.Element\n}\n\n/**\n * The items, bounded. Two hundred todo items must scroll inside their line and\n * not push the answer out of view; the region is keyboard-focusable and named,\n * which is what makes the overflow reachable without a pointer.\n */\nexport function TaskItemList(props: TaskItemListProps) {\n const [local, rest] = splitProps(props, ['class', 'label', 'children'])\n return (\n <ScrollArea\n role=\"region\"\n aria-label={local.label}\n class={cn('max-h-72', local.class)}\n {...rest}\n >\n <ul role=\"list\" class=\"m-0 flex list-none flex-col gap-0.5 p-0\">\n {local.children}\n </ul>\n </ScrollArea>\n )\n}\n\nexport type TaskProps = Omit<\n TraceLineProps,\n 'description' | 'href' | 'onSelect' | 'selectHaspopup' | 'children'\n> & {\n items: readonly TaskItem[]\n /** The item list's accessible name. Defaults to the title when it is a string. */\n itemsLabel?: string\n}\n\nexport function Task(props: TaskProps) {\n const [local, rest] = splitProps(props, ['items', 'itemsLabel', 'icon', 'meta', 'title'])\n const progress = createMemo(() => taskProgress(local.items))\n const derivedMeta = () => {\n const value = progress()\n return value ? taskProgressLabel(value) : undefined\n }\n const label = () =>\n local.itemsLabel ?? (typeof local.title === 'string' ? `${local.title} items` : 'Task items')\n\n const list = () => (\n <TaskItemList label={label()}>\n <Index each={local.items}>\n {(item) => (\n <TaskItemRow\n text={item().text}\n description={item().description}\n status={item().status}\n files={item().files}\n />\n )}\n </Index>\n </TaskItemList>\n )\n\n return (\n <TraceLine\n icon={local.icon ?? <ListChecks />}\n title={local.title}\n meta={local.meta ?? derivedMeta()}\n {...rest}\n >\n {local.items.length > 0 ? list : undefined}\n </TraceLine>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA6EA,IAAauB,0BAAoET;;AAGjF,IAAMU,gBAAgB;;AAEtB,IAAMC,WAAW;AAEjB,SAASC,MAAMP,MAAcQ,KAAqB;CAChD,OAAOR,KAA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nB,MAAMmB,QAAIJ,gBAAK1D,YAAU,CAAA,CAAA;EAAG;EAAA,IAClCgG,QAAK;GAAA,OAAErD,MAAMqD;EAAK;EAAA,IAClBE,OAAI;GAAA,OAAEvD,MAAMuD,QAAQH,YAAY;EAAC;CAAA,GAC7BnD,MAAI,EAAA,IAAAqB,WAAA;EAAA,OAEPtB,MAAMZ,MAAMH,SAAS,IAAIqE,OAAO7D,KAAAA;CAAS,EAAA,CAAA,CAAA;AAGhD"}
@@ -389,7 +389,7 @@ function Terminal$1(props) {
389
389
  return lineWindow().evicted > 0;
390
390
  },
391
391
  get children() {
392
- return [" ", memo(() => memo(() => !!lineWindow().lost)() ? `The lines you were reading were discarded to keep memory bounded; showing the oldest ${lineWindow().end.toLocaleString()} still kept.` : `${lineWindow().evicted.toLocaleString()} of the lines you were reading were discarded to keep memory bounded.`)];
392
+ return [" ", memo(() => memo(() => !!lineWindow().lost)() ? `Older lines dropped. Showing the oldest ${lineWindow().end.toLocaleString()} kept.` : `${lineWindow().evicted.toLocaleString()} older lines dropped.`)];
393
393
  }
394
394
  }), null);
395
395
  insert(_el$14, createComponent(Show, {