@constructive-io/ui 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{ai-CiaH2sfF.js → ai-4JrVVL3q.js} +1794 -250
- package/dist/ai-4JrVVL3q.js.map +1 -0
- package/dist/{ai-lAkichk8.cjs → ai-B08ufcbD.cjs} +1888 -248
- package/dist/ai-B08ufcbD.cjs.map +1 -0
- package/dist/{alert-BXuP0ayz.d.ts → alert-CJ4Qyk6W.d.cts} +4 -2
- package/dist/{alert-BXuP0ayz.d.cts → alert-CJ4Qyk6W.d.ts} +4 -2
- package/dist/components/accordion.cjs +60 -0
- package/dist/components/accordion.cjs.map +1 -0
- package/dist/components/accordion.d.cts +14 -0
- package/dist/components/accordion.d.ts +14 -0
- package/dist/components/accordion.js +54 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/ai/index.cjs +17 -1
- package/dist/components/ai/index.d.cts +2 -2
- package/dist/components/ai/index.d.ts +2 -2
- package/dist/components/ai/index.js +2 -2
- package/dist/components/alert-dialog.cjs +17 -8
- package/dist/components/alert-dialog.cjs.map +1 -1
- package/dist/components/alert-dialog.d.cts +1 -1
- package/dist/components/alert-dialog.d.ts +1 -1
- package/dist/components/alert-dialog.js +17 -8
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.cjs +18 -8
- package/dist/components/alert.cjs.map +1 -1
- package/dist/components/alert.d.cts +2 -2
- package/dist/components/alert.d.ts +2 -2
- package/dist/components/alert.js +18 -9
- package/dist/components/alert.js.map +1 -1
- package/dist/components/autocomplete.cjs +9 -5
- package/dist/components/autocomplete.cjs.map +1 -1
- package/dist/components/autocomplete.js +9 -5
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/avatar.cjs +9 -3
- package/dist/components/avatar.cjs.map +1 -1
- package/dist/components/avatar.d.cts +6 -0
- package/dist/components/avatar.d.ts +6 -0
- package/dist/components/avatar.js +9 -3
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.cjs +25 -18
- package/dist/components/badge.cjs.map +1 -1
- package/dist/components/badge.d.cts +2 -2
- package/dist/components/badge.d.ts +2 -2
- package/dist/components/badge.js +25 -18
- package/dist/components/badge.js.map +1 -1
- package/dist/components/breadcrumb.cjs +9 -6
- package/dist/components/breadcrumb.cjs.map +1 -1
- package/dist/components/breadcrumb.js +9 -6
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button-group.cjs +57 -0
- package/dist/components/button-group.cjs.map +1 -0
- package/dist/components/button-group.d.cts +16 -0
- package/dist/components/button-group.d.ts +16 -0
- package/dist/components/button-group.js +51 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.cjs +62 -18
- package/dist/components/button.cjs.map +1 -1
- package/dist/components/button.d.cts +32 -2
- package/dist/components/button.d.ts +32 -2
- package/dist/components/button.js +62 -18
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar-rac.cjs +14 -8
- package/dist/components/calendar-rac.cjs.map +1 -1
- package/dist/components/calendar-rac.js +14 -8
- package/dist/components/calendar-rac.js.map +1 -1
- package/dist/components/card.cjs +35 -23
- package/dist/components/card.cjs.map +1 -1
- package/dist/components/card.d.cts +3 -2
- package/dist/components/card.d.ts +3 -2
- package/dist/components/card.js +35 -23
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox.cjs +5 -5
- package/dist/components/checkbox.cjs.map +1 -1
- package/dist/components/checkbox.js +5 -5
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapsible.cjs +3 -3
- package/dist/components/collapsible.cjs.map +1 -1
- package/dist/components/collapsible.js +3 -3
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.cjs +24 -12
- package/dist/components/combobox.cjs.map +1 -1
- package/dist/components/combobox.d.cts +2 -1
- package/dist/components/combobox.d.ts +2 -1
- package/dist/components/combobox.js +24 -12
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.cjs +30 -14
- package/dist/components/command.cjs.map +1 -1
- package/dist/components/command.d.cts +9 -2
- package/dist/components/command.d.ts +9 -2
- package/dist/components/command.js +30 -14
- package/dist/components/command.js.map +1 -1
- package/dist/components/dialog.cjs +22 -12
- package/dist/components/dialog.cjs.map +1 -1
- package/dist/components/dialog.d.cts +5 -2
- package/dist/components/dialog.d.ts +5 -2
- package/dist/components/dialog.js +22 -12
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dock.cjs +50 -27
- package/dist/components/dock.cjs.map +1 -1
- package/dist/components/dock.d.cts +1 -1
- package/dist/components/dock.d.ts +1 -1
- package/dist/components/dock.js +51 -28
- package/dist/components/dock.js.map +1 -1
- package/dist/components/drawer.cjs +22 -14
- package/dist/components/drawer.cjs.map +1 -1
- package/dist/components/drawer.js +22 -14
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.cjs +34 -28
- package/dist/components/dropdown-menu.cjs.map +1 -1
- package/dist/components/dropdown-menu.d.cts +2 -2
- package/dist/components/dropdown-menu.d.ts +2 -2
- package/dist/components/dropdown-menu.js +52 -46
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/empty.cjs +4 -4
- package/dist/components/empty.cjs.map +1 -1
- package/dist/components/empty.js +4 -4
- package/dist/components/empty.js.map +1 -1
- package/dist/components/field.cjs +33 -33
- package/dist/components/field.cjs.map +1 -1
- package/dist/components/field.js +34 -34
- package/dist/components/field.js.map +1 -1
- package/dist/components/flickering-grid.cjs +1 -1
- package/dist/components/flickering-grid.cjs.map +1 -1
- package/dist/components/flickering-grid.js +1 -1
- package/dist/components/flickering-grid.js.map +1 -1
- package/dist/components/flow-zoom-panel.cjs +10 -5
- package/dist/components/flow-zoom-panel.cjs.map +1 -1
- package/dist/components/flow-zoom-panel.d.cts +8 -1
- package/dist/components/flow-zoom-panel.d.ts +8 -1
- package/dist/components/flow-zoom-panel.js +10 -5
- package/dist/components/flow-zoom-panel.js.map +1 -1
- package/dist/components/form-control.cjs +12 -8
- package/dist/components/form-control.cjs.map +1 -1
- package/dist/components/form-control.js +12 -8
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/form.cjs +5 -5
- package/dist/components/form.cjs.map +1 -1
- package/dist/components/form.js +5 -5
- package/dist/components/form.js.map +1 -1
- package/dist/components/input-group.cjs +13 -7
- package/dist/components/input-group.cjs.map +1 -1
- package/dist/components/input-group.d.cts +2 -2
- package/dist/components/input-group.d.ts +2 -2
- package/dist/components/input-group.js +11 -7
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input-otp.cjs +252 -0
- package/dist/components/input-otp.cjs.map +1 -0
- package/dist/components/input-otp.d.cts +44 -0
- package/dist/components/input-otp.d.ts +44 -0
- package/dist/components/input-otp.js +251 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.cjs +10 -4
- package/dist/components/input.cjs.map +1 -1
- package/dist/components/input.d.cts +11 -2
- package/dist/components/input.d.ts +11 -2
- package/dist/components/input.js +10 -4
- package/dist/components/input.js.map +1 -1
- package/dist/components/item.cjs +151 -0
- package/dist/components/item.cjs.map +1 -0
- package/dist/components/item.d.cts +37 -0
- package/dist/components/item.d.ts +37 -0
- package/dist/components/item.js +137 -0
- package/dist/components/item.js.map +1 -0
- package/dist/components/json-input.cjs +4 -143
- package/dist/components/json-input.d.cts +6 -4
- package/dist/components/json-input.d.ts +6 -4
- package/dist/components/json-input.js +2 -140
- package/dist/components/kbd.cjs +35 -0
- package/dist/components/kbd.cjs.map +1 -0
- package/dist/components/kbd.d.cts +16 -0
- package/dist/components/kbd.d.ts +16 -0
- package/dist/components/kbd.js +31 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.cjs +3 -3
- package/dist/components/label.cjs.map +1 -1
- package/dist/components/label.js +3 -3
- package/dist/components/label.js.map +1 -1
- package/dist/components/motion-grid.cjs +20 -8
- package/dist/components/motion-grid.cjs.map +1 -1
- package/dist/components/motion-grid.js +20 -8
- package/dist/components/motion-grid.js.map +1 -1
- package/dist/components/multi-select.cjs +77 -67
- package/dist/components/multi-select.cjs.map +1 -1
- package/dist/components/multi-select.js +77 -67
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/page-header.cjs +12 -9
- package/dist/components/page-header.cjs.map +1 -1
- package/dist/components/page-header.js +12 -9
- package/dist/components/page-header.js.map +1 -1
- package/dist/components/pagination.cjs +10 -4
- package/dist/components/pagination.cjs.map +1 -1
- package/dist/components/pagination.d.cts +1 -1
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.js +10 -4
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/phone-input.cjs +228 -0
- package/dist/components/phone-input.cjs.map +1 -0
- package/dist/components/phone-input.d.cts +42 -0
- package/dist/components/phone-input.d.ts +42 -0
- package/dist/components/phone-input.js +220 -0
- package/dist/components/phone-input.js.map +1 -0
- package/dist/components/popover.cjs +12 -4
- package/dist/components/popover.cjs.map +1 -1
- package/dist/components/popover.d.cts +7 -1
- package/dist/components/popover.d.ts +7 -1
- package/dist/components/popover.js +12 -5
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress.cjs +20 -3
- package/dist/components/progress.cjs.map +1 -1
- package/dist/components/progress.d.cts +1 -1
- package/dist/components/progress.d.ts +1 -1
- package/dist/components/progress.js +20 -3
- package/dist/components/progress.js.map +1 -1
- package/dist/components/progressive-blur-scroll-container.cjs +2 -2
- package/dist/components/progressive-blur-scroll-container.cjs.map +1 -1
- package/dist/components/progressive-blur-scroll-container.d.cts +1 -1
- package/dist/components/progressive-blur-scroll-container.d.ts +1 -1
- package/dist/components/progressive-blur-scroll-container.js +2 -2
- package/dist/components/progressive-blur-scroll-container.js.map +1 -1
- package/dist/components/progressive-blur.cjs +3 -2
- package/dist/components/progressive-blur.cjs.map +1 -1
- package/dist/components/progressive-blur.js +3 -2
- package/dist/components/progressive-blur.js.map +1 -1
- package/dist/components/radio-group.cjs +2 -2
- package/dist/components/radio-group.cjs.map +1 -1
- package/dist/components/radio-group.js +2 -2
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/record-picker.cjs +1 -1
- package/dist/components/record-picker.js +1 -1
- package/dist/components/resizable.cjs +2 -2
- package/dist/components/resizable.cjs.map +1 -1
- package/dist/components/resizable.js +2 -2
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/responsive-diagram.cjs +43 -21
- package/dist/components/responsive-diagram.cjs.map +1 -1
- package/dist/components/responsive-diagram.d.cts +7 -1
- package/dist/components/responsive-diagram.d.ts +7 -1
- package/dist/components/responsive-diagram.js +43 -21
- package/dist/components/responsive-diagram.js.map +1 -1
- package/dist/components/scroll-area.cjs +2 -2
- package/dist/components/scroll-area.cjs.map +1 -1
- package/dist/components/scroll-area.js +2 -2
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/select.cjs +84 -20
- package/dist/components/select.cjs.map +1 -1
- package/dist/components/select.d.cts +12 -7
- package/dist/components/select.d.ts +12 -7
- package/dist/components/select.js +84 -20
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.cjs +1 -1
- package/dist/components/separator.cjs.map +1 -1
- package/dist/components/separator.d.cts +11 -2
- package/dist/components/separator.d.ts +11 -2
- package/dist/components/separator.js +1 -1
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sheet.cjs +1 -1
- package/dist/components/sheet.d.cts +11 -5
- package/dist/components/sheet.d.ts +12 -6
- package/dist/components/sheet.js +1 -1
- package/dist/components/sidebar.cjs +2 -1
- package/dist/components/sidebar.d.cts +8 -7
- package/dist/components/sidebar.d.ts +8 -7
- package/dist/components/sidebar.js +2 -1
- package/dist/components/slider.cjs +47 -0
- package/dist/components/slider.cjs.map +1 -0
- package/dist/components/slider.d.cts +8 -0
- package/dist/components/slider.d.ts +8 -0
- package/dist/components/slider.js +44 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.cjs +15 -4
- package/dist/components/sonner.cjs.map +1 -1
- package/dist/components/sonner.d.cts +10 -1
- package/dist/components/sonner.d.ts +10 -1
- package/dist/components/sonner.js +16 -5
- package/dist/components/sonner.js.map +1 -1
- package/dist/components/spinner.cjs +25 -0
- package/dist/components/spinner.cjs.map +1 -0
- package/dist/components/spinner.d.cts +16 -0
- package/dist/components/spinner.d.ts +16 -0
- package/dist/components/spinner.js +22 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/stack/index.cjs +1 -1
- package/dist/components/stack/index.d.cts +1 -1
- package/dist/components/stack/index.d.ts +1 -1
- package/dist/components/stack/index.js +1 -1
- package/dist/components/stepper.cjs +23 -17
- package/dist/components/stepper.cjs.map +1 -1
- package/dist/components/stepper.d.cts +2 -2
- package/dist/components/stepper.d.ts +2 -2
- package/dist/components/stepper.js +23 -17
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/switch.cjs +5 -5
- package/dist/components/switch.cjs.map +1 -1
- package/dist/components/switch.js +5 -5
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.cjs +26 -7
- package/dist/components/table.cjs.map +1 -1
- package/dist/components/table.d.cts +20 -2
- package/dist/components/table.d.ts +20 -2
- package/dist/components/table.js +26 -8
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.cjs +64 -8
- package/dist/components/tabs.cjs.map +1 -1
- package/dist/components/tabs.d.cts +13 -2
- package/dist/components/tabs.d.ts +13 -2
- package/dist/components/tabs.js +66 -11
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tags.cjs +10 -5
- package/dist/components/tags.cjs.map +1 -1
- package/dist/components/tags.d.cts +1 -1
- package/dist/components/tags.d.ts +1 -1
- package/dist/components/tags.js +10 -5
- package/dist/components/tags.js.map +1 -1
- package/dist/components/textarea.cjs +5 -4
- package/dist/components/textarea.cjs.map +1 -1
- package/dist/components/textarea.js +5 -4
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/toast/index.cjs +1 -1
- package/dist/components/toast/index.d.cts +2 -2
- package/dist/components/toast/index.d.ts +2 -2
- package/dist/components/toast/index.js +1 -1
- package/dist/components/toggle-group.cjs +69 -0
- package/dist/components/toggle-group.cjs.map +1 -0
- package/dist/components/toggle-group.d.cts +27 -0
- package/dist/components/toggle-group.d.ts +27 -0
- package/dist/components/toggle-group.js +65 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.cjs +54 -0
- package/dist/components/toggle.cjs.map +1 -0
- package/dist/components/toggle.d.cts +13 -0
- package/dist/components/toggle.d.ts +13 -0
- package/dist/components/toggle.js +50 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.cjs +18 -6
- package/dist/components/tooltip.cjs.map +1 -1
- package/dist/components/tooltip.d.cts +1 -1
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +18 -6
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/unlink-button.cjs +2 -2
- package/dist/components/unlink-button.cjs.map +1 -1
- package/dist/components/unlink-button.d.cts +1 -0
- package/dist/components/unlink-button.d.ts +1 -0
- package/dist/components/unlink-button.js +2 -2
- package/dist/components/unlink-button.js.map +1 -1
- package/dist/components/workspace-kit/index.cjs +1507 -0
- package/dist/components/workspace-kit/index.cjs.map +1 -0
- package/dist/components/workspace-kit/index.d.cts +728 -0
- package/dist/components/workspace-kit/index.d.ts +728 -0
- package/dist/components/workspace-kit/index.js +1440 -0
- package/dist/components/workspace-kit/index.js.map +1 -0
- package/dist/compose-refs-Mbma1O3M.js +47 -0
- package/dist/compose-refs-Mbma1O3M.js.map +1 -0
- package/dist/compose-refs-uPrvNoiU.cjs +52 -0
- package/dist/compose-refs-uPrvNoiU.cjs.map +1 -0
- package/dist/fluid-highlight-CNELHV8o.js +134 -0
- package/dist/fluid-highlight-CNELHV8o.js.map +1 -0
- package/dist/fluid-highlight-YWFRZXsw.cjs +145 -0
- package/dist/fluid-highlight-YWFRZXsw.cjs.map +1 -0
- package/dist/{index-BzLmDsId.d.cts → index-B7cT7gZU.d.cts} +3 -3
- package/dist/{index-BzLmDsId.d.ts → index-B7cT7gZU.d.ts} +3 -3
- package/dist/{index-UnM04j0t.d.ts → index-BQZxmMpw.d.cts} +11 -31
- package/dist/{index-UnM04j0t.d.cts → index-BQZxmMpw.d.ts} +11 -31
- package/dist/{index-CyaFaZe2.d.cts → index-Cluc_xc5.d.ts} +345 -20
- package/dist/{index-B0wXxIAb.d.ts → index-DXoG0ghv.d.cts} +345 -20
- package/dist/index.cjs +107 -17
- package/dist/index.d.cts +64 -14
- package/dist/index.d.ts +64 -14
- package/dist/index.js +27 -14
- package/dist/initial-focus-B8RLtyOZ.cjs +67 -0
- package/dist/initial-focus-B8RLtyOZ.cjs.map +1 -0
- package/dist/initial-focus-j2E0EnIx.js +61 -0
- package/dist/initial-focus-j2E0EnIx.js.map +1 -0
- package/dist/initials-DSkWTOb0.cjs +127 -0
- package/dist/initials-DSkWTOb0.cjs.map +1 -0
- package/dist/initials-kCcHgrSy.js +97 -0
- package/dist/initials-kCcHgrSy.js.map +1 -0
- package/dist/json-input-CH5aEmoA.js +293 -0
- package/dist/json-input-CH5aEmoA.js.map +1 -0
- package/dist/json-input-D8yM578l.cjs +311 -0
- package/dist/json-input-D8yM578l.cjs.map +1 -0
- package/dist/{motion-config-COCFHq1L.cjs → motion-config-DZ7w5Uhq.cjs} +32 -2
- package/dist/motion-config-DZ7w5Uhq.cjs.map +1 -0
- package/dist/{motion-config-COsZ6azM.js → motion-config-DoFp4I8f.js} +21 -3
- package/dist/motion-config-DoFp4I8f.js.map +1 -0
- package/dist/{record-picker-Bz4FApxD.cjs → record-picker-BQ1-Vx0g.cjs} +23 -8
- package/dist/record-picker-BQ1-Vx0g.cjs.map +1 -0
- package/dist/{record-picker-BbxngCeV.js → record-picker-DSRo4RXV.js} +23 -8
- package/dist/record-picker-DSRo4RXV.js.map +1 -0
- package/dist/{sheet-BdA0rfIz.cjs → sheet-OxWlnT_G.cjs} +25 -32
- package/dist/sheet-OxWlnT_G.cjs.map +1 -0
- package/dist/{sheet-BLHnhLRH.js → sheet-wPF_l9Cn.js} +25 -32
- package/dist/sheet-wPF_l9Cn.js.map +1 -0
- package/dist/{sidebar-BavjjJp0.cjs → sidebar-BEEWmJwC.cjs} +74 -57
- package/dist/sidebar-BEEWmJwC.cjs.map +1 -0
- package/dist/{sidebar-DeoL2ttp.js → sidebar-DWl1Azyv.js} +74 -57
- package/dist/sidebar-DWl1Azyv.js.map +1 -0
- package/dist/{stack-ci2lkfkr.cjs → stack-CEvmUSwF.cjs} +12 -10
- package/dist/stack-CEvmUSwF.cjs.map +1 -0
- package/dist/{stack-C9GROTGA.js → stack-Kqu7YaR0.js} +12 -10
- package/dist/stack-Kqu7YaR0.js.map +1 -0
- package/dist/text-runs-CdmlS5C7.cjs +52 -0
- package/dist/text-runs-CdmlS5C7.cjs.map +1 -0
- package/dist/text-runs-DqcEO8L_.js +45 -0
- package/dist/text-runs-DqcEO8L_.js.map +1 -0
- package/dist/theme-CKpIa4Fj.d.cts +536 -0
- package/dist/theme-CKpIa4Fj.d.ts +536 -0
- package/dist/theme-dials-config.cjs +273 -0
- package/dist/theme-dials-config.cjs.map +1 -0
- package/dist/theme-dials-config.d.cts +95 -0
- package/dist/theme-dials-config.d.ts +95 -0
- package/dist/theme-dials-config.js +269 -0
- package/dist/theme-dials-config.js.map +1 -0
- package/dist/theme-presets.cjs +922 -0
- package/dist/theme-presets.cjs.map +1 -0
- package/dist/theme-presets.d.cts +89 -0
- package/dist/theme-presets.d.ts +89 -0
- package/dist/theme-presets.js +912 -0
- package/dist/theme-presets.js.map +1 -0
- package/dist/theme-tuning-CTOHSrsh.d.cts +158 -0
- package/dist/theme-tuning-DOko6Pmy.d.ts +158 -0
- package/dist/theme-tuning.cjs +349 -0
- package/dist/theme-tuning.cjs.map +1 -0
- package/dist/theme-tuning.d.cts +2 -0
- package/dist/theme-tuning.d.ts +2 -0
- package/dist/theme-tuning.js +333 -0
- package/dist/theme-tuning.js.map +1 -0
- package/dist/theme.cjs +438 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.cts +2 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +436 -0
- package/dist/theme.js.map +1 -0
- package/dist/toast-08jF1DBQ.cjs +193 -0
- package/dist/toast-08jF1DBQ.cjs.map +1 -0
- package/dist/toast-CVW5XY4u.js +164 -0
- package/dist/toast-CVW5XY4u.js.map +1 -0
- package/dist/toast-details-BdxxSLlN.cjs +209 -0
- package/dist/toast-details-BdxxSLlN.cjs.map +1 -0
- package/dist/toast-details-CfsB1Vxb.js +198 -0
- package/dist/toast-details-CfsB1Vxb.js.map +1 -0
- package/dist/{tooltip-CTRQoN1A.d.ts → tooltip-Fqb4JK-g.d.cts} +2 -2
- package/dist/{tooltip-CTRQoN1A.d.cts → tooltip-Fqb4JK-g.d.ts} +2 -2
- package/dist/tuning-BKVFsxLr.js +48 -0
- package/dist/tuning-BKVFsxLr.js.map +1 -0
- package/dist/tuning-BRPG7U1U.cjs +71 -0
- package/dist/tuning-BRPG7U1U.cjs.map +1 -0
- package/dist/use-document-theme-BSEuNsEE.cjs +43 -0
- package/dist/use-document-theme-BSEuNsEE.cjs.map +1 -0
- package/dist/use-document-theme-Ch_PqxZz.js +38 -0
- package/dist/use-document-theme-Ch_PqxZz.js.map +1 -0
- package/dist/use-scroll-fade-CaHp52u4.cjs +79 -0
- package/dist/use-scroll-fade-CaHp52u4.cjs.map +1 -0
- package/dist/use-scroll-fade-ilq-o00-.js +72 -0
- package/dist/use-scroll-fade-ilq-o00-.js.map +1 -0
- package/package.json +166 -27
- package/src/styles/globals.css +194 -97
- package/dist/ai-CiaH2sfF.js.map +0 -1
- package/dist/ai-lAkichk8.cjs.map +0 -1
- package/dist/button-Bvh83YGs.d.cts +0 -20
- package/dist/button-Bvh83YGs.d.ts +0 -20
- package/dist/components/app-bar.cjs +0 -81
- package/dist/components/app-bar.cjs.map +0 -1
- package/dist/components/app-bar.d.cts +0 -27
- package/dist/components/app-bar.d.ts +0 -27
- package/dist/components/app-bar.js +0 -77
- package/dist/components/app-bar.js.map +0 -1
- package/dist/components/app-shell.cjs +0 -267
- package/dist/components/app-shell.cjs.map +0 -1
- package/dist/components/app-shell.d.cts +0 -98
- package/dist/components/app-shell.d.ts +0 -98
- package/dist/components/app-shell.js +0 -264
- package/dist/components/app-shell.js.map +0 -1
- package/dist/components/json-input.cjs.map +0 -1
- package/dist/components/json-input.js.map +0 -1
- package/dist/input-CBrCuMH8.d.cts +0 -11
- package/dist/input-CBrCuMH8.d.ts +0 -11
- package/dist/motion-config-COCFHq1L.cjs.map +0 -1
- package/dist/motion-config-COsZ6azM.js.map +0 -1
- package/dist/record-picker-BbxngCeV.js.map +0 -1
- package/dist/record-picker-Bz4FApxD.cjs.map +0 -1
- package/dist/separator-BQEsr0Rc.d.cts +0 -11
- package/dist/separator-BQEsr0Rc.d.ts +0 -11
- package/dist/sheet-BLHnhLRH.js.map +0 -1
- package/dist/sheet-BdA0rfIz.cjs.map +0 -1
- package/dist/sidebar-BavjjJp0.cjs.map +0 -1
- package/dist/sidebar-DeoL2ttp.js.map +0 -1
- package/dist/stack-C9GROTGA.js.map +0 -1
- package/dist/stack-ci2lkfkr.cjs.map +0 -1
- package/dist/toast-D6MqijT2.cjs +0 -316
- package/dist/toast-D6MqijT2.cjs.map +0 -1
- package/dist/toast-D_BOLzm3.js +0 -287
- package/dist/toast-D_BOLzm3.js.map +0 -1
|
@@ -3,10 +3,16 @@ const require_rolldown_runtime = require('./rolldown-runtime-D_qnwXdH.cjs');
|
|
|
3
3
|
const require_utils = require('./utils-CzTQ3-VI.cjs');
|
|
4
4
|
const require_components_button = require('./components/button.cjs');
|
|
5
5
|
const require_components_badge = require('./components/badge.cjs');
|
|
6
|
+
const require_components_kbd = require('./components/kbd.cjs');
|
|
7
|
+
const require_components_spinner = require('./components/spinner.cjs');
|
|
6
8
|
const require_components_alert = require('./components/alert.cjs');
|
|
9
|
+
const require_fluid_highlight = require('./fluid-highlight-YWFRZXsw.cjs');
|
|
7
10
|
const require_components_tooltip = require('./components/tooltip.cjs');
|
|
11
|
+
const require_components_popover = require('./components/popover.cjs');
|
|
12
|
+
const require_compose_refs = require('./compose-refs-uPrvNoiU.cjs');
|
|
8
13
|
const require_components_collapsible = require('./components/collapsible.cjs');
|
|
9
14
|
const require_components_avatar = require('./components/avatar.cjs');
|
|
15
|
+
const require_components_command = require('./components/command.cjs');
|
|
10
16
|
let react = require("react");
|
|
11
17
|
react = require_rolldown_runtime.__toESM(react, 1);
|
|
12
18
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -24,7 +30,8 @@ function TextShimmer({ className, active = true, children, ...props }) {
|
|
|
24
30
|
"data-slot": "text-shimmer",
|
|
25
31
|
"data-active": active ? "true" : "false",
|
|
26
32
|
className: require_utils.cn("inline-block font-medium", active ? [
|
|
27
|
-
"bg-[linear-gradient(90deg,var(--muted-foreground)_35%,var(--foreground)_50%,var(--muted-foreground)_65%)]",
|
|
33
|
+
"bg-[linear-gradient(90deg,var(--muted-foreground)_35%,color-mix(in_oklab,var(--muted-foreground),var(--background)_55%)_50%,var(--muted-foreground)_65%)]",
|
|
34
|
+
"dark:bg-[linear-gradient(90deg,var(--muted-foreground)_35%,var(--foreground)_50%,var(--muted-foreground)_65%)]",
|
|
28
35
|
"bg-size-[200%_100%] bg-clip-text text-transparent",
|
|
29
36
|
"animate-[ai-shimmer-text_1.4s_linear_infinite]",
|
|
30
37
|
"motion-reduce:animate-none motion-reduce:bg-none motion-reduce:text-muted-foreground"
|
|
@@ -38,7 +45,7 @@ function TextShimmer({ className, active = true, children, ...props }) {
|
|
|
38
45
|
//#region src/components/ai/agent-loader.tsx
|
|
39
46
|
const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
40
47
|
function subscribeToReducedMotion(onStoreChange) {
|
|
41
|
-
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return () =>
|
|
48
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return () => {};
|
|
42
49
|
const mediaQuery = window.matchMedia(REDUCED_MOTION_QUERY);
|
|
43
50
|
mediaQuery.addEventListener("change", onStoreChange);
|
|
44
51
|
return () => mediaQuery.removeEventListener("change", onStoreChange);
|
|
@@ -82,7 +89,7 @@ const PIXEL_PATTERNS = {
|
|
|
82
89
|
round: false
|
|
83
90
|
}
|
|
84
91
|
};
|
|
85
|
-
function formatElapsed(totalSeconds) {
|
|
92
|
+
function formatElapsed$1(totalSeconds) {
|
|
86
93
|
if (totalSeconds < 60) return `${totalSeconds.toFixed(1)}s`;
|
|
87
94
|
return `${Math.floor(totalSeconds / 60)}m ${(totalSeconds % 60).toFixed(1)}s`;
|
|
88
95
|
}
|
|
@@ -209,8 +216,8 @@ function PulseDot({ size, className }) {
|
|
|
209
216
|
});
|
|
210
217
|
}
|
|
211
218
|
/**
|
|
212
|
-
* Agent loading indicator. Pixel variants (drive / dots / orbit)
|
|
213
|
-
*
|
|
219
|
+
* Agent loading indicator. Pixel variants (drive / dots / orbit) give the
|
|
220
|
+
* agent a distinct presence; simple variants cover common chat spinners.
|
|
214
221
|
*/
|
|
215
222
|
function AgentLoader({ variant = "drive", label = "Working", showElapsed = true, elapsedMs, size = "md", className, text }) {
|
|
216
223
|
const reducedMotion = react.useSyncExternalStore(subscribeToReducedMotion, getReducedMotionSnapshot, () => true);
|
|
@@ -229,16 +236,16 @@ function AgentLoader({ variant = "drive", label = "Working", showElapsed = true,
|
|
|
229
236
|
reducedMotion
|
|
230
237
|
}),
|
|
231
238
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextShimmer, {
|
|
232
|
-
className: "text-[
|
|
239
|
+
className: "text-[0.8125rem]",
|
|
233
240
|
children: statusText
|
|
234
241
|
}),
|
|
235
242
|
showElapsed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
236
243
|
className: "font-mono text-xs tabular-nums text-muted-foreground",
|
|
237
|
-
children: formatElapsed(elapsed)
|
|
244
|
+
children: formatElapsed$1(elapsed)
|
|
238
245
|
}) : null,
|
|
239
246
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
240
247
|
className: "sr-only",
|
|
241
|
-
children: [statusText, showElapsed ? `, ${formatElapsed(elapsed)}` : ""]
|
|
248
|
+
children: [statusText, showElapsed ? `, ${formatElapsed$1(elapsed)}` : ""]
|
|
242
249
|
})
|
|
243
250
|
]
|
|
244
251
|
});
|
|
@@ -254,7 +261,7 @@ function AgentLoader({ variant = "drive", label = "Working", showElapsed = true,
|
|
|
254
261
|
if (variant === "loading-dots") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
255
262
|
"data-slot": "agent-loader",
|
|
256
263
|
role: "status",
|
|
257
|
-
className: require_utils.cn("inline-flex items-center gap-0.5 font-medium text-
|
|
264
|
+
className: require_utils.cn("inline-flex items-center gap-0.5 font-medium text-link", className),
|
|
258
265
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
259
266
|
className: require_utils.cn(size === "sm" && "text-xs", size === "md" && "text-sm", size === "lg" && "text-base"),
|
|
260
267
|
children: statusText
|
|
@@ -332,7 +339,7 @@ function PromptInput({ className, isLoading = false, maxHeight = 240, value, onV
|
|
|
332
339
|
"data-shape": shape,
|
|
333
340
|
"data-loading": isLoading ? "true" : "false",
|
|
334
341
|
onClick: handleClick,
|
|
335
|
-
className: require_utils.cn("cursor-text border border-input bg-background p-2 shadow-xs", "transition-shadow focus-within:border-
|
|
342
|
+
className: require_utils.cn("cursor-text border border-input bg-background p-2 shadow-xs", "transition-shadow focus-within:border-ring/60 focus-within:ring-[3px] focus-within:ring-ring/35", shape === "pill" ? "rounded-3xl" : "rounded-lg", disabled && "cursor-not-allowed opacity-60", className),
|
|
336
343
|
...props,
|
|
337
344
|
children
|
|
338
345
|
})
|
|
@@ -375,7 +382,7 @@ function PromptInputTextarea({ className, onKeyDown, disableAutosize = false, ..
|
|
|
375
382
|
onKeyDown: handleKeyDown,
|
|
376
383
|
disabled,
|
|
377
384
|
rows: 1,
|
|
378
|
-
className: require_utils.cn("min-h-11 w-full resize-none border-none bg-transparent px-2 py-1.5 text-sm outline-none", "placeholder:text-
|
|
385
|
+
className: require_utils.cn("min-h-11 w-full resize-none border-none bg-transparent px-2 py-1.5 text-sm outline-none pointer-coarse:text-base", "placeholder:text-subtle-foreground disabled:cursor-not-allowed", className),
|
|
379
386
|
...props
|
|
380
387
|
});
|
|
381
388
|
}
|
|
@@ -460,10 +467,24 @@ function escapeHtml(value) {
|
|
|
460
467
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
461
468
|
}
|
|
462
469
|
/**
|
|
470
|
+
* `*` starts emphasis only in front of text, at the start of a word, and ends
|
|
471
|
+
* it only right after text. That keeps `A * B * C`, `src/**\/*.test.ts` and
|
|
472
|
+
* `*.md files` as the characters the writer typed instead of eating them.
|
|
473
|
+
*
|
|
474
|
+
* The text between the markers cannot contain the marker itself (`**` for
|
|
475
|
+
* strong, `***` for both), so an opener that never finds its closer gives up at
|
|
476
|
+
* the next marker instead of scanning to the end of the line: a long line of
|
|
477
|
+
* unmatched `**` takes time in proportion to its length, not its square.
|
|
478
|
+
*/
|
|
479
|
+
const STRONG_EM = /(?<![\w*])\*\*\*(?=[^\s*])((?:[^*\n]|\*(?!\*\*))*?[^\s*])\*\*\*(?![\w*])/g;
|
|
480
|
+
const STRONG = /(?<![\w*])\*\*(?=[^\s*])((?:[^*\n]|\*(?!\*))*?[^\s*])\*\*(?![\w*])/g;
|
|
481
|
+
const EM = /(?<![\w*])\*(?=[^\s*])([^\n*]*?[^\s*])\*(?![\w*])/g;
|
|
482
|
+
/**
|
|
463
483
|
* Lightweight markdown → HTML without hard deps.
|
|
464
|
-
* Handles paragraphs
|
|
465
|
-
*
|
|
466
|
-
*
|
|
484
|
+
* Handles paragraphs (consecutive lines stay together, joined with line
|
|
485
|
+
* breaks), headings, bold, italic, inline code, fenced code, links, lists.
|
|
486
|
+
* Tables and footnotes are outside this subset: hosts that need full GFM wrap
|
|
487
|
+
* their own marked+DOMPurify pipeline.
|
|
467
488
|
*/
|
|
468
489
|
function renderBasicMarkdown(source) {
|
|
469
490
|
const fences = [];
|
|
@@ -474,9 +495,15 @@ function renderBasicMarkdown(source) {
|
|
|
474
495
|
return `\u0000FENCE${index}\u0000`;
|
|
475
496
|
});
|
|
476
497
|
text = escapeHtml(text);
|
|
477
|
-
|
|
478
|
-
text = text.replace(
|
|
479
|
-
|
|
498
|
+
const spans = [];
|
|
499
|
+
text = text.replace(/`([^`\n]+)`/g, (_match, code) => {
|
|
500
|
+
spans.push(`<code class="ai-md-code">${code}</code>`);
|
|
501
|
+
return `\u0001CODE${spans.length - 1}\u0001`;
|
|
502
|
+
});
|
|
503
|
+
text = text.replace(STRONG_EM, "<strong><em>$1</em></strong>");
|
|
504
|
+
text = text.replace(STRONG, "<strong>$1</strong>");
|
|
505
|
+
text = text.replace(EM, "<em>$1</em>");
|
|
506
|
+
text = text.replace(/\u0001CODE(\d+)\u0001/g, (_match, index) => spans[Number(index)] ?? "");
|
|
480
507
|
text = text.replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g, "<a href=\"$2\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"ai-md-link\">$1</a>");
|
|
481
508
|
const lines = text.split("\n");
|
|
482
509
|
const html = [];
|
|
@@ -487,11 +514,19 @@ function renderBasicMarkdown(source) {
|
|
|
487
514
|
listOpen = null;
|
|
488
515
|
}
|
|
489
516
|
};
|
|
517
|
+
let paragraph = [];
|
|
518
|
+
const flushParagraph = () => {
|
|
519
|
+
if (paragraph.length > 0) {
|
|
520
|
+
html.push(`<p class="ai-md-p">${paragraph.join("<br>")}</p>`);
|
|
521
|
+
paragraph = [];
|
|
522
|
+
}
|
|
523
|
+
};
|
|
490
524
|
for (const line of lines) {
|
|
491
525
|
const unordered = line.match(/^[-*]\s+(.+)$/);
|
|
492
526
|
const ordered = line.match(/^\d+\.\s+(.+)$/);
|
|
493
|
-
const heading = line.match(/^(#{1,
|
|
527
|
+
const heading = line.match(/^(#{1,6})\s+(.+)$/);
|
|
494
528
|
if (unordered) {
|
|
529
|
+
flushParagraph();
|
|
495
530
|
if (listOpen !== "ul") {
|
|
496
531
|
closeList();
|
|
497
532
|
html.push("<ul class=\"ai-md-list\">");
|
|
@@ -501,6 +536,7 @@ function renderBasicMarkdown(source) {
|
|
|
501
536
|
continue;
|
|
502
537
|
}
|
|
503
538
|
if (ordered) {
|
|
539
|
+
flushParagraph();
|
|
504
540
|
if (listOpen !== "ol") {
|
|
505
541
|
closeList();
|
|
506
542
|
html.push("<ol class=\"ai-md-list\">");
|
|
@@ -511,20 +547,23 @@ function renderBasicMarkdown(source) {
|
|
|
511
547
|
}
|
|
512
548
|
closeList();
|
|
513
549
|
if (heading) {
|
|
550
|
+
flushParagraph();
|
|
514
551
|
const level = heading[1].length;
|
|
515
552
|
html.push(`<h${level} class="ai-md-h">${heading[2]}</h${level}>`);
|
|
516
553
|
continue;
|
|
517
554
|
}
|
|
518
555
|
if (line.trim() === "") {
|
|
519
|
-
|
|
556
|
+
flushParagraph();
|
|
520
557
|
continue;
|
|
521
558
|
}
|
|
522
559
|
if (line.includes("\0FENCE")) {
|
|
560
|
+
flushParagraph();
|
|
523
561
|
html.push(line.replace(/\u0000FENCE(\d+)\u0000/g, (_m, i) => fences[Number(i)] ?? ""));
|
|
524
562
|
continue;
|
|
525
563
|
}
|
|
526
|
-
|
|
564
|
+
paragraph.push(line);
|
|
527
565
|
}
|
|
566
|
+
flushParagraph();
|
|
528
567
|
closeList();
|
|
529
568
|
return html.join("\n").replace(/\u0000FENCE(\d+)\u0000/g, (_m, i) => fences[Number(i)] ?? "");
|
|
530
569
|
}
|
|
@@ -539,7 +578,7 @@ function Markdown({ className, children, streaming = false, ...props }) {
|
|
|
539
578
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
540
579
|
"data-slot": "markdown",
|
|
541
580
|
"data-streaming": streaming ? "true" : "false",
|
|
542
|
-
className: require_utils.cn("ai-markdown max-w-none space-y-3
|
|
581
|
+
className: require_utils.cn("ai-markdown max-w-none space-y-3 text-sm leading-relaxed text-foreground [overflow-wrap:anywhere]", "[&_.ai-md-p]:my-0", "[&_.ai-md-h]:font-semibold", "[&_h1.ai-md-h]:text-lg [&_h2.ai-md-h]:text-base [&_h3.ai-md-h]:text-sm [&_h4.ai-md-h]:text-sm [&_h5.ai-md-h]:text-[0.8125rem] [&_h6.ai-md-h]:text-xs", "[&_.ai-md-list]:my-1 [&_.ai-md-list]:list-disc [&_.ai-md-list]:space-y-1 [&_.ai-md-list]:ps-5", "[&_ol.ai-md-list]:list-decimal", "[&_.ai-md-code]:rounded-md [&_.ai-md-code]:bg-muted [&_.ai-md-code]:px-1 [&_.ai-md-code]:py-0.5 [&_.ai-md-code]:font-mono [&_.ai-md-code]:text-[0.85em]", "[&_.ai-md-pre]:overflow-x-auto [&_.ai-md-pre]:rounded-lg [&_.ai-md-pre]:border [&_.ai-md-pre]:border-border [&_.ai-md-pre]:bg-muted/50 [&_.ai-md-pre]:p-3 [&_.ai-md-pre]:font-mono [&_.ai-md-pre]:text-xs", "[&_.ai-md-link]:text-link [&_.ai-md-link]:underline-offset-2 hover:[&_.ai-md-link]:underline", className),
|
|
543
582
|
dangerouslySetInnerHTML: { __html: html },
|
|
544
583
|
...props
|
|
545
584
|
});
|
|
@@ -569,9 +608,10 @@ function MessageAvatar({ src, alt = "", fallback, className, delay }) {
|
|
|
569
608
|
});
|
|
570
609
|
}
|
|
571
610
|
function MessageContent({ className, markdown = false, streaming = false, children, ...props }) {
|
|
572
|
-
const contentClassName = require_utils.cn("min-w-0 max-w-[min(100%,42rem)] text-sm leading-relaxed text-foreground", className);
|
|
611
|
+
const contentClassName = require_utils.cn("min-w-0 max-w-[min(100%,42rem)] text-sm leading-relaxed text-foreground [overflow-wrap:anywhere]", typeof children === "string" && !markdown && "whitespace-pre-wrap", className);
|
|
573
612
|
if (markdown && typeof children === "string") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Markdown, {
|
|
574
613
|
"data-slot": "message-content",
|
|
614
|
+
dir: "auto",
|
|
575
615
|
streaming,
|
|
576
616
|
className: contentClassName,
|
|
577
617
|
...props,
|
|
@@ -579,6 +619,7 @@ function MessageContent({ className, markdown = false, streaming = false, childr
|
|
|
579
619
|
});
|
|
580
620
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
581
621
|
"data-slot": "message-content",
|
|
622
|
+
dir: "auto",
|
|
582
623
|
className: contentClassName,
|
|
583
624
|
...props,
|
|
584
625
|
children
|
|
@@ -718,28 +759,28 @@ function CodeBlock({ code, language, filename, showCopy = true, highlight: highl
|
|
|
718
759
|
children: [
|
|
719
760
|
hasHeader ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
720
761
|
"data-slot": "code-block-header",
|
|
721
|
-
className: "flex items-center gap-2 border-b border-border
|
|
762
|
+
className: "flex items-center gap-2 border-b border-border bg-muted/50 px-2.5 py-1.5",
|
|
722
763
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
723
764
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
724
765
|
children: [
|
|
725
766
|
filename ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
726
767
|
"data-slot": "code-block-filename",
|
|
727
|
-
className: "min-w-0 truncate font-mono text-[
|
|
768
|
+
className: "min-w-0 truncate font-mono text-[0.75rem] text-foreground/80",
|
|
728
769
|
title: filename,
|
|
729
770
|
children: filename
|
|
730
771
|
}) : language ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
731
772
|
"data-slot": "code-block-language",
|
|
732
|
-
className: "min-w-0 truncate font-mono text-[
|
|
773
|
+
className: "min-w-0 truncate font-mono text-[0.75rem] text-foreground/80",
|
|
733
774
|
children: language
|
|
734
775
|
}) : null,
|
|
735
776
|
filename && language ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
736
777
|
"data-slot": "code-block-language",
|
|
737
|
-
className: require_utils.cn("inline-flex shrink-0 items-center rounded-md px-1.5 py-0.5", "border border-border
|
|
778
|
+
className: require_utils.cn("inline-flex shrink-0 items-center rounded-md px-1.5 py-0.5", "border border-border bg-background/50", "font-sans text-[0.625rem] font-medium tracking-wide text-muted-foreground uppercase"),
|
|
738
779
|
children: language
|
|
739
780
|
}) : null,
|
|
740
781
|
collapsible ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
741
782
|
"data-slot": "code-block-meta",
|
|
742
|
-
className: "hidden shrink-0 font-sans text-[
|
|
783
|
+
className: "hidden shrink-0 font-sans text-[0.6875rem] tabular-nums text-muted-foreground/70 sm:inline",
|
|
743
784
|
children: [lineCount, " lines"]
|
|
744
785
|
}) : null
|
|
745
786
|
]
|
|
@@ -757,7 +798,7 @@ function CodeBlock({ code, language, filename, showCopy = true, highlight: highl
|
|
|
757
798
|
"data-slot": "code-block-body",
|
|
758
799
|
className: "relative",
|
|
759
800
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
760
|
-
className: require_utils.cn("overflow-x-auto p-3 font-mono text-xs leading-relaxed text-foreground", "[&_.sh__line]:block", "transition-[max-height] duration-
|
|
801
|
+
className: require_utils.cn("overflow-x-auto p-3 font-mono text-xs leading-relaxed text-foreground", "[&_.sh__line]:block", "transition-[max-height] duration-(--duration-slow) ease-out motion-reduce:transition-none", isCollapsed && "overflow-y-hidden", !isCollapsed && maxExpandedHeight !== false && collapsible && "overflow-y-auto"),
|
|
761
802
|
style: isCollapsed ? { maxHeight: collapsedMaxHeight } : collapsible && maxExpandedHeight !== false ? { maxHeight: maxExpandedHeight } : void 0,
|
|
762
803
|
children: highlightedHtml ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", { dangerouslySetInnerHTML: { __html: highlightedHtml } }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", { children: visible })
|
|
763
804
|
}), isCollapsed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -768,15 +809,15 @@ function CodeBlock({ code, language, filename, showCopy = true, highlight: highl
|
|
|
768
809
|
}),
|
|
769
810
|
collapsible ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
770
811
|
"data-slot": "code-block-footer",
|
|
771
|
-
className: "border-t border-border
|
|
812
|
+
className: "border-t border-border bg-muted/40",
|
|
772
813
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
773
814
|
type: "button",
|
|
774
815
|
"data-slot": "code-block-expand",
|
|
775
816
|
"aria-expanded": expanded,
|
|
776
817
|
onClick: () => setExpanded(!expanded),
|
|
777
|
-
className: require_utils.cn("flex w-full items-center justify-center gap-1.5 px-3 py-2", "text-[
|
|
818
|
+
className: require_utils.cn("flex w-full items-center justify-center gap-1.5 px-3 py-2", "text-[0.75rem] font-medium text-muted-foreground", "outline-none transition-[color,background-color,border-color,text-decoration-color,fill,stroke,box-shadow] duration-(--duration-moderate)", "hover:bg-muted/70 hover:text-foreground", "focus-visible:bg-muted/70 focus-visible:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:ring-inset"),
|
|
778
819
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: expanded ? "Show less" : hiddenLineCount === 1 ? "Show 1 more line" : `Show ${hiddenLineCount} more lines` }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, {
|
|
779
|
-
className: require_utils.cn("size-3.5 opacity-70 transition-transform duration-
|
|
820
|
+
className: require_utils.cn("size-3.5 opacity-70 transition-transform duration-(--duration-slow) ease-out motion-reduce:transition-none", expanded && "rotate-180"),
|
|
780
821
|
"aria-hidden": true
|
|
781
822
|
})]
|
|
782
823
|
})
|
|
@@ -826,7 +867,7 @@ function ResponseStream({ text, mode = "typewriter", speed = 2, className, markd
|
|
|
826
867
|
className: require_utils.cn("whitespace-pre-wrap text-sm leading-relaxed text-foreground", mode === "fade" && streaming && "animate-[fade-in_200ms_ease-out]", className),
|
|
827
868
|
children: [visible, streaming ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
828
869
|
"aria-hidden": true,
|
|
829
|
-
className: "
|
|
870
|
+
className: "ms-0.5 inline-block h-3.5 w-px translate-y-0.5 bg-foreground/70 animate-pulse motion-reduce:animate-none"
|
|
830
871
|
}) : null]
|
|
831
872
|
});
|
|
832
873
|
}
|
|
@@ -843,8 +884,9 @@ function useChatContainer() {
|
|
|
843
884
|
* Scroll region for chat transcripts with stick-to-bottom tracking.
|
|
844
885
|
* Pair with ScrollButton for jump-to-latest.
|
|
845
886
|
*/
|
|
846
|
-
function ChatContainer({ className, children, bottomThreshold = 48, autoScroll = true, ...props }) {
|
|
887
|
+
function ChatContainer({ className, children, bottomThreshold = 48, autoScroll = true, ref, ...props }) {
|
|
847
888
|
const scrollRef = react.useRef(null);
|
|
889
|
+
const mergedRef = require_compose_refs.useMergedRefs(scrollRef, ref);
|
|
848
890
|
const [isAtBottom, setIsAtBottom] = react.useState(true);
|
|
849
891
|
const isAtBottomRef = react.useRef(true);
|
|
850
892
|
const scrollToBottom = react.useCallback((behavior = "smooth") => {
|
|
@@ -891,7 +933,7 @@ function ChatContainer({ className, children, bottomThreshold = 48, autoScroll =
|
|
|
891
933
|
scrollToBottom
|
|
892
934
|
},
|
|
893
935
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
894
|
-
ref:
|
|
936
|
+
ref: mergedRef,
|
|
895
937
|
"data-slot": "chat-container",
|
|
896
938
|
"data-at-bottom": isAtBottom ? "true" : "false",
|
|
897
939
|
className: require_utils.cn("relative min-h-0 flex-1 overflow-y-auto overscroll-contain", className),
|
|
@@ -924,7 +966,7 @@ function ScrollButton({ className, visible, label = "Scroll to latest", onClick,
|
|
|
924
966
|
type,
|
|
925
967
|
"aria-label": label,
|
|
926
968
|
"data-slot": "scroll-button",
|
|
927
|
-
className: require_utils.cn("absolute bottom-4 left-1/2 z-10 flex size-9 -translate-x-1/2 items-center justify-center", "rounded-full border border-border
|
|
969
|
+
className: require_utils.cn("absolute bottom-4 left-1/2 z-10 flex size-9 -translate-x-1/2 items-center justify-center", "rounded-full border border-border bg-background/95 text-muted-foreground", "shadow-lg backdrop-blur-md", "dark:border-border dark:bg-card/90 dark:shadow-black/40", "outline-none transition-[transform,box-shadow] duration-(--duration-moderate) ease-out", "hover:border-border hover:bg-accent hover:text-foreground hover:shadow-lg", "focus-visible:ring-[3px] focus-visible:ring-ring/50", "motion-safe:active:scale-[0.96]", "animate-[fade-in_150ms_ease-out] motion-reduce:animate-none", className),
|
|
928
970
|
onClick: (event) => {
|
|
929
971
|
scrollToBottom("smooth");
|
|
930
972
|
onClick?.(event);
|
|
@@ -947,7 +989,7 @@ function SystemMessage({ className, title, variant = "info", children, ...props
|
|
|
947
989
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_alert.Alert, {
|
|
948
990
|
"data-slot": "system-message",
|
|
949
991
|
variant,
|
|
950
|
-
className: require_utils.cn("text-
|
|
992
|
+
className: require_utils.cn("text-start", className),
|
|
951
993
|
...props,
|
|
952
994
|
children: [title ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_alert.AlertTitle, { children: title }) : null, children ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_alert.AlertDescription, { children }) : null]
|
|
953
995
|
});
|
|
@@ -957,12 +999,17 @@ function SystemMessage({ className, title, variant = "info", children, ...props
|
|
|
957
999
|
//#region src/components/ai/format-duration.ts
|
|
958
1000
|
/** Format elapsed ms for "Thought for …" / "Worked for …" labels. */
|
|
959
1001
|
function formatDuration(ms) {
|
|
960
|
-
|
|
1002
|
+
const wholeMs = Math.round(ms);
|
|
1003
|
+
if (wholeMs < 1e3) return `${Math.max(1, wholeMs)}ms`;
|
|
961
1004
|
const seconds = ms / 1e3;
|
|
962
|
-
|
|
963
|
-
if (
|
|
964
|
-
const
|
|
965
|
-
|
|
1005
|
+
const tenths = Math.round(seconds * 10) / 10;
|
|
1006
|
+
if (tenths < 10) return `${tenths.toFixed(1)}s`;
|
|
1007
|
+
const total = Math.round(seconds);
|
|
1008
|
+
if (total < 60) return `${total}s`;
|
|
1009
|
+
const hours = Math.floor(total / 3600);
|
|
1010
|
+
const minutes = Math.floor(total % 3600 / 60);
|
|
1011
|
+
const rem = total % 60;
|
|
1012
|
+
if (hours > 0) return minutes === 0 ? `${hours}h` : `${hours}h ${minutes}m`;
|
|
966
1013
|
return rem === 0 ? `${minutes}m` : `${minutes}m ${rem}s`;
|
|
967
1014
|
}
|
|
968
1015
|
|
|
@@ -1011,31 +1058,31 @@ function Reasoning({ children, content, isStreaming = false, durationMs = null,
|
|
|
1011
1058
|
className: require_utils.cn("w-full", className),
|
|
1012
1059
|
"data-slot": "reasoning",
|
|
1013
1060
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_collapsible.CollapsibleTrigger, {
|
|
1014
|
-
className: require_utils.cn("group flex w-fit max-w-full items-center gap-1.5 rounded-md px-1.5 py-1 text-
|
|
1061
|
+
className: require_utils.cn("group -mx-1.5 flex w-fit max-w-full items-center gap-1.5 rounded-md px-1.5 py-1.5 text-start text-[0.8125rem]", "text-muted-foreground transition-[box-shadow] duration-(--duration-moderate) hover:bg-accent hover:text-foreground", "focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50"),
|
|
1015
1062
|
children: [
|
|
1016
1063
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Brain, { className: "size-3.5 shrink-0 opacity-80" }),
|
|
1017
1064
|
isStreaming ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextShimmer, {
|
|
1018
|
-
className: "text-[
|
|
1065
|
+
className: "text-[0.8125rem] font-medium tabular-nums",
|
|
1019
1066
|
children: label
|
|
1020
1067
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1021
|
-
className: "font-medium",
|
|
1068
|
+
className: "font-medium tabular-nums",
|
|
1022
1069
|
children: label
|
|
1023
1070
|
}),
|
|
1024
1071
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, {
|
|
1025
1072
|
"data-slot": "collapsible-icon",
|
|
1026
|
-
className: "size-3.5 shrink-0 opacity-60 transition-transform duration-
|
|
1073
|
+
className: "size-3.5 shrink-0 opacity-60 transition-transform duration-(--duration-slow)"
|
|
1027
1074
|
})
|
|
1028
1075
|
]
|
|
1029
1076
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_collapsible.CollapsibleContent, {
|
|
1030
1077
|
innerClassName: "py-0",
|
|
1031
1078
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1032
|
-
className: "my-1
|
|
1079
|
+
className: "my-1 ms-1.5 border-s border-border/70 py-1 ps-3",
|
|
1033
1080
|
children: markdown && typeof body === "string" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Markdown, {
|
|
1034
1081
|
streaming: isStreaming,
|
|
1035
|
-
className: "text-[
|
|
1082
|
+
className: "text-[0.8125rem] text-muted-foreground",
|
|
1036
1083
|
children: body
|
|
1037
1084
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1038
|
-
className: "whitespace-pre-wrap text-[
|
|
1085
|
+
className: "whitespace-pre-wrap text-[0.8125rem] leading-relaxed text-muted-foreground",
|
|
1039
1086
|
children: body
|
|
1040
1087
|
})
|
|
1041
1088
|
})
|
|
@@ -1050,7 +1097,7 @@ function ThinkingBar({ className, text = "Thinking", onStop, stopLabel = "Answer
|
|
|
1050
1097
|
children: [onClick ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1051
1098
|
type: "button",
|
|
1052
1099
|
onClick,
|
|
1053
|
-
className: "flex items-center gap-1 text-sm transition-opacity duration-
|
|
1100
|
+
className: "flex items-center gap-1 text-sm transition-opacity duration-(--duration-moderate) hover:opacity-80",
|
|
1054
1101
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextShimmer, {
|
|
1055
1102
|
className: "font-medium",
|
|
1056
1103
|
children: text
|
|
@@ -1061,7 +1108,7 @@ function ThinkingBar({ className, text = "Thinking", onStop, stopLabel = "Answer
|
|
|
1061
1108
|
}), onStop ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1062
1109
|
type: "button",
|
|
1063
1110
|
onClick: onStop,
|
|
1064
|
-
className: "border-b border-dotted border-muted-foreground/50 text-sm text-muted-foreground transition-
|
|
1111
|
+
className: "border-b border-dotted border-muted-foreground/50 text-sm text-muted-foreground transition-[color,background-color,border-color,text-decoration-color,fill,stroke,box-shadow] duration-(--duration-moderate) hover:border-foreground hover:text-foreground",
|
|
1065
1112
|
children: stopLabel
|
|
1066
1113
|
}) : null]
|
|
1067
1114
|
});
|
|
@@ -1070,7 +1117,7 @@ function ThinkingBar({ className, text = "Thinking", onStop, stopLabel = "Answer
|
|
|
1070
1117
|
//#endregion
|
|
1071
1118
|
//#region src/components/ai/thinking-trace.tsx
|
|
1072
1119
|
/**
|
|
1073
|
-
*
|
|
1120
|
+
* Expandable agent trace with mode variants.
|
|
1074
1121
|
* Production hosts pass rows + streaming; demos can drive visibleCount.
|
|
1075
1122
|
*/
|
|
1076
1123
|
function ThinkingTrace({ mode = "steps", activeLabel, doneLabel, durationMs = null, isStreaming = false, rows, query, open: openProp, onOpenChange, className, visibleCount }) {
|
|
@@ -1108,14 +1155,14 @@ function ThinkingTrace({ mode = "steps", activeLabel, doneLabel, durationMs = nu
|
|
|
1108
1155
|
open,
|
|
1109
1156
|
onOpenChange: setOpen,
|
|
1110
1157
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_collapsible.CollapsibleTrigger, {
|
|
1111
|
-
className: require_utils.cn("group -mx-1.5 flex w-fit items-center gap-2 rounded-md px-1.5 py-1 text-
|
|
1158
|
+
className: require_utils.cn("group -mx-1.5 flex w-fit items-center gap-2 rounded-md px-1.5 py-1.5 text-start", "hover:bg-accent"),
|
|
1112
1159
|
children: [
|
|
1113
1160
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Sparkles, { className: require_utils.cn("size-3.5 shrink-0", isStreaming ? "text-muted-foreground" : "text-muted-foreground/70") }),
|
|
1114
1161
|
isStreaming ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextShimmer, {
|
|
1115
|
-
className: "text-[
|
|
1162
|
+
className: "text-[0.8125rem] font-medium whitespace-nowrap",
|
|
1116
1163
|
children: workingLabel
|
|
1117
1164
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1118
|
-
className: "text-[
|
|
1165
|
+
className: "text-[0.8125rem] font-medium whitespace-nowrap text-muted-foreground animate-[fade-in_350ms_ease-out_both] motion-reduce:animate-none",
|
|
1119
1166
|
children: settledLabel
|
|
1120
1167
|
}),
|
|
1121
1168
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, {
|
|
@@ -1126,10 +1173,11 @@ function ThinkingTrace({ mode = "steps", activeLabel, doneLabel, durationMs = nu
|
|
|
1126
1173
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_collapsible.CollapsibleContent, {
|
|
1127
1174
|
innerClassName: "py-0",
|
|
1128
1175
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1129
|
-
className: "relative mt-1
|
|
1176
|
+
className: "relative mt-1 ms-1.5 border-s border-border/70 ps-3",
|
|
1130
1177
|
children: [mode === "search" && query ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1131
|
-
className: "mb-2 flex items-center gap-1.5 text-[
|
|
1178
|
+
className: "mb-2 flex items-center gap-1.5 text-[0.75rem] text-muted-foreground",
|
|
1132
1179
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Globe, { className: "size-3 shrink-0" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1180
|
+
title: query,
|
|
1133
1181
|
className: "truncate font-mono",
|
|
1134
1182
|
children: query
|
|
1135
1183
|
})]
|
|
@@ -1138,7 +1186,7 @@ function ThinkingTrace({ mode = "steps", activeLabel, doneLabel, durationMs = nu
|
|
|
1138
1186
|
children: shown.map((row, index) => {
|
|
1139
1187
|
const settled = !isStreaming || index < shown.length - 1 || count >= rows.length;
|
|
1140
1188
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
1141
|
-
className: "flex min-w-0 items-start gap-2 text-[
|
|
1189
|
+
className: "flex min-w-0 items-start gap-2 text-[0.8125rem] animate-[ai-fade-up_300ms_cubic-bezier(0.23,1,0.32,1)_both] motion-reduce:animate-none",
|
|
1142
1190
|
style: { animationDelay: `${Math.min(index, 6) * 40}ms` },
|
|
1143
1191
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1144
1192
|
className: "mt-0.5 shrink-0",
|
|
@@ -1156,20 +1204,20 @@ function ThinkingTrace({ mode = "steps", activeLabel, doneLabel, durationMs = nu
|
|
|
1156
1204
|
className: "font-medium text-foreground underline-offset-2 hover:underline",
|
|
1157
1205
|
children: row.primary
|
|
1158
1206
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1159
|
-
className: require_utils.cn("text-foreground", row.mono && "font-mono text-[
|
|
1207
|
+
className: require_utils.cn("text-foreground", row.mono && "font-mono text-[0.75rem]", mode === "reasoning" && "text-muted-foreground"),
|
|
1160
1208
|
children: row.primary
|
|
1161
1209
|
}),
|
|
1162
1210
|
row.secondary ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1163
|
-
className: require_utils.cn("
|
|
1211
|
+
className: require_utils.cn("ms-1.5 text-muted-foreground", row.mono && "font-mono text-[0.75rem]"),
|
|
1164
1212
|
children: row.secondary
|
|
1165
1213
|
}) : null,
|
|
1166
1214
|
(row.add != null || row.del != null) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1167
|
-
className: "
|
|
1215
|
+
className: "ms-1.5 font-mono text-[0.6875rem] tabular-nums",
|
|
1168
1216
|
children: [row.add != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1169
1217
|
className: "text-success",
|
|
1170
1218
|
children: ["+", row.add]
|
|
1171
1219
|
}) : null, row.del != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1172
|
-
className: "
|
|
1220
|
+
className: "ms-1 text-destructive",
|
|
1173
1221
|
children: ["-", row.del]
|
|
1174
1222
|
}) : null]
|
|
1175
1223
|
})
|
|
@@ -1221,7 +1269,7 @@ const MODE_DEFAULTS = {
|
|
|
1221
1269
|
const RAIL = 15;
|
|
1222
1270
|
/** Air between icon edge and the vertical segment (px). */
|
|
1223
1271
|
const GAP = 6;
|
|
1224
|
-
const STATUS_LABEL = {
|
|
1272
|
+
const STATUS_LABEL$1 = {
|
|
1225
1273
|
pending: "Pending",
|
|
1226
1274
|
running: "In progress",
|
|
1227
1275
|
done: "Completed",
|
|
@@ -1249,7 +1297,7 @@ function Steps({ children, className, open, onOpenChange, defaultOpen = true, ti
|
|
|
1249
1297
|
className: require_utils.cn("w-full min-w-0", className),
|
|
1250
1298
|
"data-slot": "steps",
|
|
1251
1299
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_collapsible.CollapsibleTrigger, {
|
|
1252
|
-
className: require_utils.cn("group flex w-fit max-w-full items-center gap-1.5 rounded-md px-1.5 py-1 text-[
|
|
1300
|
+
className: require_utils.cn("group flex w-fit max-w-full items-center gap-1.5 rounded-md px-1.5 py-1.5 text-[0.8125rem]", "text-muted-foreground hover:bg-accent hover:text-foreground"),
|
|
1253
1301
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1254
1302
|
className: "min-w-0 truncate font-medium",
|
|
1255
1303
|
children: title
|
|
@@ -1316,7 +1364,7 @@ function Step({ children, title, description, status = "pending", className }) {
|
|
|
1316
1364
|
}
|
|
1317
1365
|
})]
|
|
1318
1366
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1319
|
-
className: require_utils.cn("min-w-0 flex-1 text-[
|
|
1367
|
+
className: require_utils.cn("min-w-0 flex-1 text-[0.8125rem]", "pb-3.5 group-last/step:pb-0"),
|
|
1320
1368
|
children: [
|
|
1321
1369
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1322
1370
|
className: require_utils.cn("break-words font-medium", status === "running" && "text-foreground", status === "done" && "text-muted-foreground", status === "pending" && "text-muted-foreground/80", status === "error" && "text-destructive"),
|
|
@@ -1326,16 +1374,16 @@ function Step({ children, title, description, status = "pending", className }) {
|
|
|
1326
1374
|
},
|
|
1327
1375
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1328
1376
|
className: "sr-only",
|
|
1329
|
-
children: [STATUS_LABEL[status], ": "]
|
|
1377
|
+
children: [STATUS_LABEL$1[status], ": "]
|
|
1330
1378
|
}), title]
|
|
1331
1379
|
}),
|
|
1332
1380
|
description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1333
|
-
className: "mt-1 break-words text-[
|
|
1381
|
+
className: "mt-1 break-words text-[0.75rem] leading-snug text-muted-foreground",
|
|
1334
1382
|
children: description
|
|
1335
1383
|
}) : null,
|
|
1336
1384
|
children ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1337
1385
|
"data-slot": "step-body",
|
|
1338
|
-
className: require_utils.cn("mt-1.5 min-w-0 break-words text-[
|
|
1386
|
+
className: require_utils.cn("mt-1.5 min-w-0 break-words text-[0.75rem] leading-snug text-muted-foreground", "[&_pre]:mt-1.5 [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_pre]:rounded-md [&_pre]:border [&_pre]:border-border [&_pre]:bg-muted/40 [&_pre]:p-2 [&_pre]:font-mono [&_pre]:text-[0.6875rem] [&_pre]:leading-relaxed", "[&_code]:rounded-sm [&_code]:bg-muted/50 [&_code]:px-1 [&_code]:py-px [&_code]:font-mono [&_code]:text-[0.71875rem]"),
|
|
1339
1387
|
children
|
|
1340
1388
|
}) : null
|
|
1341
1389
|
]
|
|
@@ -1377,11 +1425,11 @@ function formatValue(value) {
|
|
|
1377
1425
|
}
|
|
1378
1426
|
function StatusIcon({ status }) {
|
|
1379
1427
|
switch (status) {
|
|
1380
|
-
case "pending": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.
|
|
1381
|
-
case "running": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.
|
|
1382
|
-
case "success": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CheckCircle2, { className: "size-3.5 text-success" });
|
|
1383
|
-
case "error": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CircleX, { className: "size-3.5 text-destructive" });
|
|
1384
|
-
case "aborted": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.
|
|
1428
|
+
case "pending": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CircleDashed, { className: "size-3.5 shrink-0 text-muted-foreground" });
|
|
1429
|
+
case "running": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Loader2, { className: "size-3.5 shrink-0 animate-spin text-muted-foreground motion-reduce:animate-none" });
|
|
1430
|
+
case "success": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CheckCircle2, { className: "size-3.5 shrink-0 text-success" });
|
|
1431
|
+
case "error": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CircleX, { className: "size-3.5 shrink-0 text-destructive" });
|
|
1432
|
+
case "aborted": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Ban, { className: "size-3.5 shrink-0 text-muted-foreground" });
|
|
1385
1433
|
}
|
|
1386
1434
|
}
|
|
1387
1435
|
function statusBadge(status) {
|
|
@@ -1419,91 +1467,98 @@ function Tool({ name, status: statusProp = "pending", summary, input, output, er
|
|
|
1419
1467
|
"data-slot": "tool",
|
|
1420
1468
|
"data-variant": "chip",
|
|
1421
1469
|
"data-status": status,
|
|
1422
|
-
className: require_utils.cn("inline-flex max-w-full items-center gap-1.5 rounded-md border border-border
|
|
1470
|
+
className: require_utils.cn("inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted/40 px-2 py-1 text-[0.75rem]", className),
|
|
1423
1471
|
children: [
|
|
1424
1472
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusIcon, { status }),
|
|
1425
1473
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1426
|
-
|
|
1474
|
+
title: name,
|
|
1475
|
+
className: "max-w-[9rem] shrink-0 truncate font-medium text-foreground",
|
|
1427
1476
|
children: name
|
|
1428
1477
|
}),
|
|
1429
1478
|
summary ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1479
|
+
dir: "auto",
|
|
1480
|
+
title: typeof summary === "string" ? summary : void 0,
|
|
1430
1481
|
className: "min-w-0 truncate font-mono text-muted-foreground",
|
|
1431
1482
|
children: summary
|
|
1432
1483
|
}) : null
|
|
1433
1484
|
]
|
|
1434
1485
|
});
|
|
1435
1486
|
const trigger = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1436
|
-
className: require_utils.cn("flex min-w-0 max-w-full items-center gap-1.5 text-[
|
|
1487
|
+
className: require_utils.cn("flex min-w-0 max-w-full items-center gap-1.5 text-[0.8125rem] text-muted-foreground", variant === "card" && "w-full justify-between font-normal"),
|
|
1437
1488
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1438
1489
|
className: "flex min-w-0 items-center gap-1.5",
|
|
1439
1490
|
children: [
|
|
1440
1491
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusIcon, { status }),
|
|
1441
1492
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1442
|
-
|
|
1493
|
+
title: name,
|
|
1494
|
+
className: "max-w-[45%] shrink-0 truncate font-medium text-foreground/90",
|
|
1443
1495
|
children: name
|
|
1444
1496
|
}),
|
|
1445
1497
|
summary ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1446
|
-
|
|
1498
|
+
dir: "auto",
|
|
1499
|
+
title: typeof summary === "string" ? summary : void 0,
|
|
1500
|
+
className: require_utils.cn("min-w-0 truncate rounded-md bg-muted px-1.5 py-0.5 font-mono text-[0.71875rem] text-muted-foreground"),
|
|
1447
1501
|
children: summary
|
|
1448
1502
|
}) : null,
|
|
1449
1503
|
variant === "card" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1450
|
-
className: require_utils.cn("rounded-full border px-2 py-0.5 text-[
|
|
1504
|
+
className: require_utils.cn("shrink-0 rounded-full border px-2 py-0.5 text-[0.6875rem] font-medium", statusBadge(status).className),
|
|
1451
1505
|
children: statusBadge(status).label
|
|
1452
1506
|
}) : null
|
|
1453
1507
|
]
|
|
1454
1508
|
}), hasBody ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, {
|
|
1455
1509
|
"data-slot": "collapsible-icon",
|
|
1456
|
-
className: "size-3.5 shrink-0 opacity-0 transition-[opacity,transform] duration-
|
|
1510
|
+
className: "size-3.5 shrink-0 opacity-0 transition-[opacity,transform] duration-(--duration-moderate) group-hover/tool:opacity-100 group-data-[panel-open]/collapsible:opacity-100"
|
|
1457
1511
|
}) : null]
|
|
1458
1512
|
});
|
|
1459
1513
|
if (!hasBody) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1460
1514
|
"data-slot": "tool",
|
|
1461
1515
|
"data-variant": variant,
|
|
1462
1516
|
"data-status": status,
|
|
1463
|
-
className: require_utils.cn("flex w-full items-center py-0.5 text-
|
|
1517
|
+
className: require_utils.cn("flex w-full items-center py-0.5 text-start", className),
|
|
1464
1518
|
children: trigger
|
|
1465
1519
|
});
|
|
1466
1520
|
const body = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1467
|
-
className: "space-y-2 text-[
|
|
1521
|
+
className: "space-y-2 text-[0.78125rem]",
|
|
1468
1522
|
children: [
|
|
1469
1523
|
children,
|
|
1470
1524
|
detail?.map((line, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1471
|
-
className: require_utils.cn("font-mono leading-relaxed text-muted-foreground", line.tone === "add" && "text-success"),
|
|
1525
|
+
className: require_utils.cn("font-mono leading-relaxed text-muted-foreground [overflow-wrap:anywhere]", line.tone === "add" && "text-success"),
|
|
1472
1526
|
children: line.text
|
|
1473
1527
|
}, i)),
|
|
1474
1528
|
input !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
|
|
1475
1529
|
className: "mb-1 text-xs font-medium text-muted-foreground",
|
|
1476
1530
|
children: "Input"
|
|
1477
1531
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
1478
|
-
className: "max-h-40 overflow-auto rounded-md border border-border bg-background p-2 font-mono text-[
|
|
1532
|
+
className: "max-h-40 overflow-auto rounded-md border border-border bg-background p-2 font-mono text-[0.71875rem] leading-relaxed",
|
|
1479
1533
|
children: formatValue(input)
|
|
1480
1534
|
})] }) : null,
|
|
1481
1535
|
output !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
|
|
1482
1536
|
className: "mb-1 text-xs font-medium text-muted-foreground",
|
|
1483
1537
|
children: "Output"
|
|
1484
1538
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
1485
|
-
className: "max-h-48 overflow-auto rounded-md border border-border bg-background p-2 font-mono text-[
|
|
1539
|
+
className: "max-h-48 overflow-auto rounded-md border border-border bg-background p-2 font-mono text-[0.71875rem] leading-relaxed",
|
|
1486
1540
|
children: formatValue(output)
|
|
1487
1541
|
})] }) : null,
|
|
1488
1542
|
errorText ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
|
|
1489
|
-
className: "rounded-md border border-destructive/30 bg-destructive/8 p-2 text-destructive",
|
|
1543
|
+
className: "rounded-md border border-destructive/30 bg-destructive/8 p-2 text-destructive [overflow-wrap:anywhere]",
|
|
1490
1544
|
children: errorText
|
|
1491
1545
|
}) : null,
|
|
1492
1546
|
diffs.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1493
1547
|
className: "flex flex-wrap gap-1.5 pt-0.5",
|
|
1494
1548
|
children: diffs.map((d) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1495
|
-
className: "inline-flex items-center gap-1.5 rounded-md border border-border bg-muted/50 px-1.5 py-0.5 font-mono text-[
|
|
1549
|
+
className: "inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted/50 px-1.5 py-0.5 font-mono text-[0.6875rem]",
|
|
1496
1550
|
children: [
|
|
1497
1551
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1498
|
-
|
|
1552
|
+
title: d.file,
|
|
1553
|
+
className: "min-w-0 break-all text-foreground",
|
|
1499
1554
|
children: d.file
|
|
1500
1555
|
}),
|
|
1501
1556
|
d.add != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1502
|
-
className: "text-success",
|
|
1557
|
+
className: "shrink-0 text-success",
|
|
1503
1558
|
children: ["+", d.add]
|
|
1504
1559
|
}) : null,
|
|
1505
1560
|
d.del != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1506
|
-
className: "text-destructive",
|
|
1561
|
+
className: "shrink-0 text-destructive",
|
|
1507
1562
|
children: ["-", d.del]
|
|
1508
1563
|
}) : null
|
|
1509
1564
|
]
|
|
@@ -1522,7 +1577,7 @@ function Tool({ name, status: statusProp = "pending", summary, input, output, er
|
|
|
1522
1577
|
onOpenChange,
|
|
1523
1578
|
className: "group/tool group/collapsible",
|
|
1524
1579
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_collapsible.CollapsibleTrigger, {
|
|
1525
|
-
className: "w-full bg-background px-3 py-2 hover:bg-accent/40",
|
|
1580
|
+
className: "w-full bg-background px-3 py-2.5 hover:bg-accent/40",
|
|
1526
1581
|
children: trigger
|
|
1527
1582
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_collapsible.CollapsibleContent, {
|
|
1528
1583
|
className: "border-t border-border",
|
|
@@ -1542,10 +1597,10 @@ function Tool({ name, status: statusProp = "pending", summary, input, output, er
|
|
|
1542
1597
|
onOpenChange,
|
|
1543
1598
|
className: "group/tool group/collapsible",
|
|
1544
1599
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_collapsible.CollapsibleTrigger, {
|
|
1545
|
-
className: require_utils.cn("group/row -mx-1 flex min-h-8 w-[calc(100%+0.5rem)] min-w-0 items-center gap-2 rounded-md px-1 py-1 text-
|
|
1600
|
+
className: require_utils.cn("group/row -mx-1 flex min-h-8 w-[calc(100%+0.5rem)] min-w-0 items-center gap-2 rounded-md px-1 py-1 text-start", "hover:bg-accent", "pointer-coarse:min-h-11"),
|
|
1546
1601
|
children: trigger
|
|
1547
1602
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_collapsible.CollapsibleContent, {
|
|
1548
|
-
innerClassName: "py-1
|
|
1603
|
+
innerClassName: "py-1 ps-5",
|
|
1549
1604
|
children: body
|
|
1550
1605
|
})]
|
|
1551
1606
|
})
|
|
@@ -1559,10 +1614,10 @@ function ToolGroup({ label, children, defaultOpen = true, className }) {
|
|
|
1559
1614
|
defaultOpen,
|
|
1560
1615
|
className: "group/collapsible",
|
|
1561
1616
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_collapsible.CollapsibleTrigger, {
|
|
1562
|
-
className: require_utils.cn("-mx-1.5 flex w-fit items-center gap-1.5 rounded-md px-1.5 py-1 text-[
|
|
1617
|
+
className: require_utils.cn("-mx-1.5 flex w-fit items-center gap-1.5 rounded-md px-1.5 py-1.5 text-[0.78125rem]", "text-muted-foreground hover:bg-accent hover:text-foreground"),
|
|
1563
1618
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, {
|
|
1564
1619
|
"data-slot": "collapsible-icon",
|
|
1565
|
-
className: "size-3"
|
|
1620
|
+
className: "size-3.5 shrink-0"
|
|
1566
1621
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1567
1622
|
className: "tabular-nums",
|
|
1568
1623
|
children: label
|
|
@@ -1583,7 +1638,7 @@ function ToolGroup({ label, children, defaultOpen = true, className }) {
|
|
|
1583
1638
|
/**
|
|
1584
1639
|
* Human-in-the-loop approval: simple confirm/skip or multi-question flow.
|
|
1585
1640
|
*/
|
|
1586
|
-
function ApprovalCard({ title, description, questions, confirmLabel = "Confirm", skipLabel = "Skip", destructive = false, preview, onConfirm, onSkip, onDismiss, className, defaultSent = false }) {
|
|
1641
|
+
function ApprovalCard({ title, description, questions, confirmLabel = "Confirm", skipLabel = "Skip", destructive = false, preview, eyebrow, onConfirm, onSkip, onDismiss, className, defaultSent = false }) {
|
|
1587
1642
|
const multi = Boolean(questions?.length);
|
|
1588
1643
|
const [qi, setQi] = react.useState(0);
|
|
1589
1644
|
const [answers, setAnswers] = react.useState({});
|
|
@@ -1621,7 +1676,7 @@ function ApprovalCard({ title, description, questions, confirmLabel = "Confirm",
|
|
|
1621
1676
|
};
|
|
1622
1677
|
if (sent) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1623
1678
|
"data-slot": "approval-card",
|
|
1624
|
-
className: require_utils.cn("flex min-h-28 w-full max-w-sm flex-col items-center justify-center gap-2 rounded-
|
|
1679
|
+
className: require_utils.cn("flex min-h-28 w-full max-w-sm flex-col items-center justify-center gap-2 rounded-lg bg-card p-4 shadow-card", className),
|
|
1625
1680
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1626
1681
|
className: "flex size-6 items-center justify-center rounded-full bg-success text-white animate-[ai-fade-up_300ms_cubic-bezier(0.23,1,0.32,1)_both]",
|
|
1627
1682
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, {
|
|
@@ -1629,26 +1684,33 @@ function ApprovalCard({ title, description, questions, confirmLabel = "Confirm",
|
|
|
1629
1684
|
strokeWidth: 3
|
|
1630
1685
|
})
|
|
1631
1686
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1632
|
-
className: "text-[
|
|
1687
|
+
className: "text-[0.8125rem] font-medium text-foreground",
|
|
1633
1688
|
children: "Approved"
|
|
1634
1689
|
})]
|
|
1635
1690
|
});
|
|
1636
1691
|
if (!multi) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1637
1692
|
"data-slot": "approval-card",
|
|
1638
1693
|
"data-destructive": destructive ? "true" : "false",
|
|
1639
|
-
className: require_utils.cn("w-full max-w-md overflow-hidden rounded-
|
|
1694
|
+
className: require_utils.cn("w-full max-w-md overflow-hidden rounded-lg bg-card shadow-card", destructive ? "border-destructive/35" : "border-border", className),
|
|
1640
1695
|
children: [
|
|
1641
1696
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1642
1697
|
className: "flex items-start justify-between gap-2 px-3 pt-3",
|
|
1643
1698
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1644
1699
|
className: "min-w-0 space-y-1",
|
|
1645
|
-
children: [
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1700
|
+
children: [
|
|
1701
|
+
eyebrow ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1702
|
+
className: "mb-1.5 flex min-h-4 items-center gap-1.5 text-xs text-muted-foreground [&_svg]:size-3.5 [&_svg]:shrink-0",
|
|
1703
|
+
children: eyebrow
|
|
1704
|
+
}) : null,
|
|
1705
|
+
title ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1706
|
+
className: "text-[0.8125rem] font-medium text-pretty text-foreground [overflow-wrap:anywhere]",
|
|
1707
|
+
children: title
|
|
1708
|
+
}) : null,
|
|
1709
|
+
description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1710
|
+
className: "text-xs text-pretty text-muted-foreground [overflow-wrap:anywhere]",
|
|
1711
|
+
children: description
|
|
1712
|
+
}) : null
|
|
1713
|
+
]
|
|
1652
1714
|
}), onDismiss ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_button.Button, {
|
|
1653
1715
|
type: "button",
|
|
1654
1716
|
variant: "ghost",
|
|
@@ -1659,20 +1721,22 @@ function ApprovalCard({ title, description, questions, confirmLabel = "Confirm",
|
|
|
1659
1721
|
}) : null]
|
|
1660
1722
|
}),
|
|
1661
1723
|
preview ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1662
|
-
className: "px-3 pt-2",
|
|
1724
|
+
className: "min-w-0 overflow-x-auto px-3 pt-2 [overflow-wrap:anywhere]",
|
|
1663
1725
|
children: preview
|
|
1664
1726
|
}) : null,
|
|
1665
1727
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1666
|
-
className: "flex items-center justify-end gap-1.5
|
|
1728
|
+
className: "flex flex-wrap items-center justify-end gap-1.5 p-3",
|
|
1667
1729
|
children: [onSkip ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_button.Button, {
|
|
1668
1730
|
type: "button",
|
|
1669
|
-
variant: "
|
|
1731
|
+
variant: "secondary",
|
|
1670
1732
|
size: "sm",
|
|
1733
|
+
wrap: true,
|
|
1671
1734
|
onClick: onSkip,
|
|
1672
1735
|
children: skipLabel
|
|
1673
1736
|
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_button.Button, {
|
|
1674
1737
|
type: "button",
|
|
1675
1738
|
size: "sm",
|
|
1739
|
+
wrap: true,
|
|
1676
1740
|
variant: destructive ? "destructive" : "default",
|
|
1677
1741
|
onClick: () => {
|
|
1678
1742
|
setSent(true);
|
|
@@ -1687,21 +1751,21 @@ function ApprovalCard({ title, description, questions, confirmLabel = "Confirm",
|
|
|
1687
1751
|
const canAdvance = selected.length > 0;
|
|
1688
1752
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1689
1753
|
"data-slot": "approval-card",
|
|
1690
|
-
className: require_utils.cn("w-full max-w-sm overflow-hidden rounded-
|
|
1754
|
+
className: require_utils.cn("w-full max-w-sm overflow-hidden rounded-lg shadow-card", className),
|
|
1691
1755
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1692
1756
|
className: "p-3 animate-[ai-fade-up_300ms_cubic-bezier(0.23,1,0.32,1)_both] motion-reduce:animate-none",
|
|
1693
1757
|
children: [
|
|
1694
1758
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1695
1759
|
className: "flex items-start justify-between gap-2",
|
|
1696
1760
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1697
|
-
className: "text-[
|
|
1761
|
+
className: "min-w-0 text-[0.8125rem] font-medium text-pretty text-foreground [overflow-wrap:anywhere]",
|
|
1698
1762
|
children: question.prompt
|
|
1699
1763
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1700
|
-
className: "flex items-center gap-1",
|
|
1764
|
+
className: "flex shrink-0 items-center gap-1",
|
|
1701
1765
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1702
|
-
className: "flex items-center gap-0.5",
|
|
1766
|
+
className: require_utils.cn("flex items-center gap-0.5", progress.length < 2 && "hidden"),
|
|
1703
1767
|
"aria-hidden": true,
|
|
1704
|
-
children: progress.map((on, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: require_utils.cn("h-1 rounded-full transition-[width,background-color] duration-
|
|
1768
|
+
children: progress.map((on, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: require_utils.cn("h-1 rounded-full transition-[width,background-color] duration-(--duration-slow)", on ? "w-3 bg-primary" : "w-1.5 bg-border") }, i))
|
|
1705
1769
|
}), onDismiss ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_button.Button, {
|
|
1706
1770
|
type: "button",
|
|
1707
1771
|
variant: "ghost",
|
|
@@ -1720,9 +1784,9 @@ function ApprovalCard({ title, description, questions, confirmLabel = "Confirm",
|
|
|
1720
1784
|
type: "button",
|
|
1721
1785
|
"aria-pressed": on,
|
|
1722
1786
|
onClick: () => toggleOption(option.id),
|
|
1723
|
-
className: require_utils.cn("-mx-1.5 flex min-h-10
|
|
1787
|
+
className: require_utils.cn("-mx-1.5 flex min-h-10 gap-2 rounded-md px-1.5 py-1.5 text-start text-[0.8125rem]", option.description ? "items-start" : "items-center", "transition-[box-shadow] duration-(--duration-moderate) hover:bg-accent", "focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50", on && "bg-accent"),
|
|
1724
1788
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1725
|
-
className: require_utils.cn("
|
|
1789
|
+
className: require_utils.cn("flex size-4 shrink-0 items-center justify-center rounded-full border", option.description && "mt-0.5", on ? "border-primary bg-primary text-primary-foreground" : "border-border"),
|
|
1726
1790
|
children: on ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, {
|
|
1727
1791
|
className: "size-2.5",
|
|
1728
1792
|
strokeWidth: 3
|
|
@@ -1730,10 +1794,10 @@ function ApprovalCard({ title, description, questions, confirmLabel = "Confirm",
|
|
|
1730
1794
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1731
1795
|
className: "min-w-0",
|
|
1732
1796
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1733
|
-
className: "font-medium text-foreground",
|
|
1797
|
+
className: "font-medium text-foreground [overflow-wrap:anywhere]",
|
|
1734
1798
|
children: option.label
|
|
1735
1799
|
}), option.description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1736
|
-
className: "mt-0.5 block text-xs text-muted-foreground",
|
|
1800
|
+
className: "mt-0.5 block text-xs text-muted-foreground [overflow-wrap:anywhere]",
|
|
1737
1801
|
children: option.description
|
|
1738
1802
|
}) : null]
|
|
1739
1803
|
})]
|
|
@@ -1756,22 +1820,68 @@ function ApprovalCard({ title, description, questions, confirmLabel = "Confirm",
|
|
|
1756
1820
|
});
|
|
1757
1821
|
}
|
|
1758
1822
|
|
|
1823
|
+
//#endregion
|
|
1824
|
+
//#region src/components/ai/use-image-failed.ts
|
|
1825
|
+
/**
|
|
1826
|
+
* Whether an `<img>` failed to load, for a fallback such as initials or an icon.
|
|
1827
|
+
*
|
|
1828
|
+
* `onError` alone misses an image that failed before React was listening: a
|
|
1829
|
+
* server-rendered page can hydrate after the browser has already given up on a
|
|
1830
|
+
* dead URL, and that `error` event is never replayed. So the ref also checks the
|
|
1831
|
+
* element when it mounts. A finished image with no pixels either failed or is an
|
|
1832
|
+
* SVG without an intrinsic size (which reports a natural width of 0 as well), and
|
|
1833
|
+
* `decode()` tells the two apart; a browser without it counts the image as failed.
|
|
1834
|
+
*
|
|
1835
|
+
* `failed` stays set for the life of the component that calls the hook, so key
|
|
1836
|
+
* that component by the image address and a new address gets a fresh attempt:
|
|
1837
|
+
*
|
|
1838
|
+
* ```tsx
|
|
1839
|
+
* function Photo({ src, fallback }: { src: string; fallback: React.ReactNode }) {
|
|
1840
|
+
* const { failed, ref, onError } = useImageFailed();
|
|
1841
|
+
* return failed ? fallback : <img ref={ref} src={src} onError={onError} alt="" />;
|
|
1842
|
+
* }
|
|
1843
|
+
* // <Photo key={url} src={url} fallback={<Initials />} />
|
|
1844
|
+
* ```
|
|
1845
|
+
*/
|
|
1846
|
+
function useImageFailed() {
|
|
1847
|
+
const [failed, setFailed] = react.useState(false);
|
|
1848
|
+
const onError = react.useCallback(() => setFailed(true), []);
|
|
1849
|
+
return {
|
|
1850
|
+
failed,
|
|
1851
|
+
ref: react.useCallback((image) => {
|
|
1852
|
+
if (!image || !image.complete || image.naturalWidth > 0) return;
|
|
1853
|
+
if (typeof image.decode !== "function") setFailed(true);
|
|
1854
|
+
else image.decode().catch(() => setFailed(true));
|
|
1855
|
+
}, []),
|
|
1856
|
+
onError
|
|
1857
|
+
};
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1759
1860
|
//#endregion
|
|
1760
1861
|
//#region src/components/ai/source.tsx
|
|
1761
|
-
|
|
1862
|
+
/** The site's icon, or a document glyph when there is none or it does not load. */
|
|
1863
|
+
function SourceFavicon({ src }) {
|
|
1864
|
+
const { failed, ref, onError } = useImageFailed();
|
|
1865
|
+
return src && !failed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
1866
|
+
ref,
|
|
1867
|
+
src,
|
|
1868
|
+
alt: "",
|
|
1869
|
+
onError,
|
|
1870
|
+
className: "size-3.5 rounded-sm outline outline-1 outline-black/10 dark:outline-white/10"
|
|
1871
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.FileText, { className: "size-3 shrink-0 opacity-70" });
|
|
1872
|
+
}
|
|
1873
|
+
function Source({ href, title, description, favicon, domain, showTitle = false, className }) {
|
|
1762
1874
|
const host = domain ?? (href ? safeHost(href) : void 0);
|
|
1875
|
+
const label = showTitle ? title : host ?? title;
|
|
1763
1876
|
const content = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1764
1877
|
"data-slot": "source",
|
|
1765
|
-
className: require_utils.cn("inline-flex max-w-full items-center gap-1.5 rounded-full border border-border bg-muted/50 px-2 py-
|
|
1878
|
+
className: require_utils.cn("inline-flex max-w-full items-center gap-1.5 rounded-full border border-border bg-muted/50 px-2 py-1.5 text-[0.75rem]", "text-muted-foreground hover:bg-accent hover:text-foreground", className),
|
|
1766
1879
|
children: [
|
|
1767
|
-
|
|
1768
|
-
src: favicon,
|
|
1769
|
-
alt: "",
|
|
1770
|
-
className: "size-3.5 rounded-sm outline outline-1 outline-black/10 dark:outline-white/10"
|
|
1771
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.FileText, { className: "size-3 shrink-0 opacity-70" }),
|
|
1880
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SourceFavicon, { src: favicon }, favicon),
|
|
1772
1881
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1882
|
+
title: label,
|
|
1773
1883
|
className: "min-w-0 truncate font-medium",
|
|
1774
|
-
children:
|
|
1884
|
+
children: label
|
|
1775
1885
|
}),
|
|
1776
1886
|
href ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ExternalLink, { className: "size-3 shrink-0 opacity-50" }) : null
|
|
1777
1887
|
]
|
|
@@ -1783,7 +1893,7 @@ function Source({ href, title, description, favicon, domain, className }) {
|
|
|
1783
1893
|
className: "inline-flex max-w-full",
|
|
1784
1894
|
children: content
|
|
1785
1895
|
}) : content;
|
|
1786
|
-
if (!description && title ===
|
|
1896
|
+
if (!description && title === label) return chip;
|
|
1787
1897
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_tooltip.Tooltip, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_tooltip.TooltipTrigger, {
|
|
1788
1898
|
asChild: true,
|
|
1789
1899
|
children: chip
|
|
@@ -1802,7 +1912,8 @@ function Source({ href, title, description, favicon, domain, className }) {
|
|
|
1802
1912
|
children: description
|
|
1803
1913
|
}) : null,
|
|
1804
1914
|
href ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1805
|
-
|
|
1915
|
+
title: href,
|
|
1916
|
+
className: "truncate font-mono text-[0.625rem] opacity-70",
|
|
1806
1917
|
children: href
|
|
1807
1918
|
}) : null
|
|
1808
1919
|
]
|
|
@@ -1810,15 +1921,19 @@ function Source({ href, title, description, favicon, domain, className }) {
|
|
|
1810
1921
|
})] });
|
|
1811
1922
|
}
|
|
1812
1923
|
function Sources({ children, className, label }) {
|
|
1924
|
+
const hostOf = (props) => props.domain ?? (props.href ? safeHost(props.href) : void 0) ?? props.title;
|
|
1925
|
+
const counts = /* @__PURE__ */ new Map();
|
|
1926
|
+
for (const child of react.Children.toArray(children)) if (react.isValidElement(child) && child.type === Source) counts.set(hostOf(child.props), (counts.get(hostOf(child.props)) ?? 0) + 1);
|
|
1927
|
+
const shown = react.Children.map(children, (child) => react.isValidElement(child) && child.type === Source && (counts.get(hostOf(child.props)) ?? 0) > 1 ? react.cloneElement(child, { showTitle: true }) : child);
|
|
1813
1928
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1814
1929
|
"data-slot": "sources",
|
|
1815
1930
|
className: require_utils.cn("flex flex-col gap-1.5", className),
|
|
1816
1931
|
children: [label ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1817
|
-
className: "text-[
|
|
1932
|
+
className: "text-[0.6875rem] font-medium text-muted-foreground",
|
|
1818
1933
|
children: label
|
|
1819
1934
|
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1820
1935
|
className: "flex flex-wrap gap-1.5",
|
|
1821
|
-
children
|
|
1936
|
+
children: shown
|
|
1822
1937
|
})]
|
|
1823
1938
|
});
|
|
1824
1939
|
}
|
|
@@ -1831,65 +1946,221 @@ function safeHost(url) {
|
|
|
1831
1946
|
}
|
|
1832
1947
|
|
|
1833
1948
|
//#endregion
|
|
1834
|
-
//#region src/components/ai/
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1949
|
+
//#region src/components/ai/line-diff.ts
|
|
1950
|
+
const DIFF_LIMITS = {
|
|
1951
|
+
maxCells: 4e6,
|
|
1952
|
+
maxEdits: 2e3,
|
|
1953
|
+
maxWork: 8e6
|
|
1954
|
+
};
|
|
1955
|
+
const context = (text) => ({
|
|
1956
|
+
type: "context",
|
|
1957
|
+
text
|
|
1958
|
+
});
|
|
1959
|
+
const added = (text) => ({
|
|
1960
|
+
type: "add",
|
|
1961
|
+
text
|
|
1962
|
+
});
|
|
1963
|
+
const removed = (text) => ({
|
|
1964
|
+
type: "del",
|
|
1965
|
+
text
|
|
1966
|
+
});
|
|
1967
|
+
/** Longest-common-subsequence diff of two line lists, in order. Cost is the product of the lengths. */
|
|
1968
|
+
function exactDiff(a, b) {
|
|
1969
|
+
const cols = b.length + 1;
|
|
1970
|
+
const table = new Uint32Array((a.length + 1) * cols);
|
|
1971
|
+
for (let i = a.length - 1; i >= 0; i--) for (let j = b.length - 1; j >= 0; j--) table[i * cols + j] = a[i] === b[j] ? table[(i + 1) * cols + j + 1] + 1 : Math.max(table[(i + 1) * cols + j], table[i * cols + j + 1]);
|
|
1972
|
+
const lines = [];
|
|
1973
|
+
let i = 0;
|
|
1974
|
+
let j = 0;
|
|
1975
|
+
while (i < a.length && j < b.length) if (a[i] === b[j]) {
|
|
1976
|
+
lines.push(context(a[i]));
|
|
1977
|
+
i += 1;
|
|
1978
|
+
j += 1;
|
|
1979
|
+
} else if (table[(i + 1) * cols + j] >= table[i * cols + j + 1]) {
|
|
1980
|
+
lines.push(removed(a[i]));
|
|
1981
|
+
i += 1;
|
|
1982
|
+
} else {
|
|
1983
|
+
lines.push(added(b[j]));
|
|
1984
|
+
j += 1;
|
|
1985
|
+
}
|
|
1986
|
+
for (; i < a.length; i++) lines.push(removed(a[i]));
|
|
1987
|
+
for (; j < b.length; j++) lines.push(added(b[j]));
|
|
1988
|
+
return lines;
|
|
1989
|
+
}
|
|
1990
|
+
/** Within each run of changes, every removal comes before every addition, as the exact comparison writes them. */
|
|
1991
|
+
function removalsFirst(lines) {
|
|
1992
|
+
const ordered = [];
|
|
1993
|
+
let dropped = [];
|
|
1994
|
+
let gained = [];
|
|
1995
|
+
const flush = () => {
|
|
1996
|
+
for (const line of dropped) ordered.push(line);
|
|
1997
|
+
for (const line of gained) ordered.push(line);
|
|
1998
|
+
dropped = [];
|
|
1999
|
+
gained = [];
|
|
2000
|
+
};
|
|
2001
|
+
for (const line of lines) if (line.type === "context") {
|
|
2002
|
+
flush();
|
|
2003
|
+
ordered.push(line);
|
|
2004
|
+
} else if (line.type === "del") dropped.push(line);
|
|
2005
|
+
else gained.push(line);
|
|
2006
|
+
flush();
|
|
2007
|
+
return ordered;
|
|
2008
|
+
}
|
|
2009
|
+
/**
|
|
2010
|
+
* Shortest edit script by Myers' greedy search, which takes time proportional
|
|
2011
|
+
* to the lines times the number of edits rather than to the product of the
|
|
2012
|
+
* lengths, so a few edits in a long file stay cheap however far apart they are.
|
|
2013
|
+
* Gives up (`null`) when more than `maxEdits` edits or `maxWork` steps are needed.
|
|
2014
|
+
*/
|
|
2015
|
+
function boundedDiff(a, b, { maxEdits, maxWork }) {
|
|
2016
|
+
const n = a.length;
|
|
2017
|
+
const m = b.length;
|
|
2018
|
+
const limit = Math.min(n + m, maxEdits);
|
|
2019
|
+
const offset = limit + 1;
|
|
2020
|
+
const furthest = new Int32Array(2 * limit + 3);
|
|
2021
|
+
const trace = [];
|
|
2022
|
+
let work = 0;
|
|
2023
|
+
for (let d = 0; d <= limit; d++) {
|
|
2024
|
+
trace.push(furthest.slice(offset - d, offset + d + 1));
|
|
2025
|
+
for (let k = -d; k <= d; k += 2) {
|
|
2026
|
+
let x = k === -d || k !== d && furthest[offset + k - 1] < furthest[offset + k + 1] ? furthest[offset + k + 1] : furthest[offset + k - 1] + 1;
|
|
2027
|
+
let y = x - k;
|
|
2028
|
+
const start = x;
|
|
2029
|
+
while (x < n && y < m && a[x] === b[y]) {
|
|
2030
|
+
x += 1;
|
|
2031
|
+
y += 1;
|
|
2032
|
+
}
|
|
2033
|
+
work += 1 + x - start;
|
|
2034
|
+
furthest[offset + k] = x;
|
|
2035
|
+
if (x >= n && y >= m) return removalsFirst(walkBack(a, b, trace, d));
|
|
2036
|
+
if (work > maxWork) return null;
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
return null;
|
|
2040
|
+
}
|
|
2041
|
+
/** The path of a finished search, from the end back to the start, as lines in order. */
|
|
2042
|
+
function walkBack(a, b, trace, edits) {
|
|
1841
2043
|
const lines = [];
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
if (
|
|
2044
|
+
let x = a.length;
|
|
2045
|
+
let y = b.length;
|
|
2046
|
+
for (let d = edits; d >= 0; d--) {
|
|
2047
|
+
const before = trace[d];
|
|
2048
|
+
const k = x - y;
|
|
2049
|
+
let fromAbove = false;
|
|
2050
|
+
let previousX = 0;
|
|
2051
|
+
let previousY = 0;
|
|
2052
|
+
if (d > 0) {
|
|
2053
|
+
fromAbove = k === -d || k !== d && before[k - 1 + d] < before[k + 1 + d];
|
|
2054
|
+
const previousK = fromAbove ? k + 1 : k - 1;
|
|
2055
|
+
previousX = before[previousK + d];
|
|
2056
|
+
previousY = previousX - previousK;
|
|
2057
|
+
}
|
|
2058
|
+
while (x > previousX && y > previousY) {
|
|
2059
|
+
lines.push(context(a[x - 1]));
|
|
2060
|
+
x -= 1;
|
|
2061
|
+
y -= 1;
|
|
2062
|
+
}
|
|
2063
|
+
if (d > 0) lines.push(fromAbove ? added(b[y - 1]) : removed(a[x - 1]));
|
|
2064
|
+
x = previousX;
|
|
2065
|
+
y = previousY;
|
|
2066
|
+
}
|
|
2067
|
+
return lines.reverse();
|
|
2068
|
+
}
|
|
2069
|
+
/** The part of two line lists between their common head and tail, compared as exactly as `limits` allow. */
|
|
2070
|
+
function diffMiddle(a, b, limits) {
|
|
2071
|
+
if (a.length === 0) return b.map(added);
|
|
2072
|
+
if (b.length === 0) return a.map(removed);
|
|
2073
|
+
if (a.length * b.length <= limits.maxCells) return exactDiff(a, b);
|
|
2074
|
+
return boundedDiff(a, b, limits) ?? [...a.map(removed), ...b.map(added)];
|
|
2075
|
+
}
|
|
2076
|
+
/**
|
|
2077
|
+
* Line diff between two line lists, in order: unchanged lines as `context`,
|
|
2078
|
+
* removed lines as `del`, new lines as `add`. The common head and tail are
|
|
2079
|
+
* trimmed first, so a small edit to a long file stays cheap, and a line that
|
|
2080
|
+
* also appears elsewhere is matched by position, so a repeated line is shown as
|
|
2081
|
+
* added or removed rather than hidden.
|
|
2082
|
+
*/
|
|
2083
|
+
function diffLines(before, after, limits = DIFF_LIMITS) {
|
|
2084
|
+
let head = 0;
|
|
2085
|
+
while (head < before.length && head < after.length && before[head] === after[head]) head += 1;
|
|
2086
|
+
let tailBefore = before.length;
|
|
2087
|
+
let tailAfter = after.length;
|
|
2088
|
+
while (tailBefore > head && tailAfter > head && before[tailBefore - 1] === after[tailAfter - 1]) {
|
|
2089
|
+
tailBefore -= 1;
|
|
2090
|
+
tailAfter -= 1;
|
|
2091
|
+
}
|
|
1871
2092
|
return [
|
|
1872
|
-
...
|
|
1873
|
-
...
|
|
1874
|
-
...
|
|
1875
|
-
...shared.slice(2)
|
|
2093
|
+
...before.slice(0, head).map(context),
|
|
2094
|
+
...diffMiddle(before.slice(head, tailBefore), after.slice(head, tailAfter), limits),
|
|
2095
|
+
...before.slice(tailBefore).map(context)
|
|
1876
2096
|
];
|
|
1877
2097
|
}
|
|
2098
|
+
|
|
2099
|
+
//#endregion
|
|
2100
|
+
//#region src/components/ai/inline-diff.tsx
|
|
2101
|
+
/** Unchanged lines kept on each side of a change. */
|
|
2102
|
+
const CONTEXT_LINES = 2;
|
|
2103
|
+
/**
|
|
2104
|
+
* Line diff between two texts, in order: unchanged lines as `context`, removed
|
|
2105
|
+
* lines as `del`, new lines as `add`. A line that also appears elsewhere is
|
|
2106
|
+
* matched by position, so a repeated line is shown as added or removed rather
|
|
2107
|
+
* than hidden. The common head and tail are trimmed before the comparison, and
|
|
2108
|
+
* a long file is compared by its edits rather than by a table of every pair of
|
|
2109
|
+
* lines, so a few edits stay cheap however far apart they are.
|
|
2110
|
+
*/
|
|
2111
|
+
function lineDiff(before, after) {
|
|
2112
|
+
return diffLines(before.split("\n"), after.split("\n"));
|
|
2113
|
+
}
|
|
2114
|
+
/** Keeps `CONTEXT_LINES` unchanged lines around each change and folds longer unchanged runs into one gap row. */
|
|
2115
|
+
function withContext(lines) {
|
|
2116
|
+
if (lines.every((line) => line.type === "context")) return lines;
|
|
2117
|
+
const keep = lines.map(() => false);
|
|
2118
|
+
lines.forEach((line, index) => {
|
|
2119
|
+
if (line.type === "context") return;
|
|
2120
|
+
for (let near = Math.max(0, index - CONTEXT_LINES); near <= Math.min(lines.length - 1, index + CONTEXT_LINES); near++) keep[near] = true;
|
|
2121
|
+
});
|
|
2122
|
+
const rows = [];
|
|
2123
|
+
let skipped = 0;
|
|
2124
|
+
const flush = (index) => {
|
|
2125
|
+
if (skipped === 1) rows.push(lines[index - 1]);
|
|
2126
|
+
else if (skipped > 1) rows.push({
|
|
2127
|
+
type: "gap",
|
|
2128
|
+
count: skipped
|
|
2129
|
+
});
|
|
2130
|
+
skipped = 0;
|
|
2131
|
+
};
|
|
2132
|
+
lines.forEach((line, index) => {
|
|
2133
|
+
if (keep[index]) {
|
|
2134
|
+
flush(index);
|
|
2135
|
+
rows.push(line);
|
|
2136
|
+
} else skipped += 1;
|
|
2137
|
+
});
|
|
2138
|
+
flush(lines.length);
|
|
2139
|
+
return rows;
|
|
2140
|
+
}
|
|
1878
2141
|
function InlineDiff({ source, className, maxLines = 40 }) {
|
|
1879
|
-
const lines = react.useMemo(() => lineDiff(source.before, source.after), [source.before, source.after]);
|
|
2142
|
+
const lines = react.useMemo(() => withContext(lineDiff(source.before, source.after)), [source.before, source.after]);
|
|
1880
2143
|
const visible = lines.slice(0, maxLines);
|
|
1881
2144
|
const hidden = lines.length - visible.length;
|
|
1882
2145
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1883
2146
|
"data-slot": "inline-diff",
|
|
1884
|
-
className: require_utils.cn("overflow-hidden rounded-lg border border-border bg-muted/30 font-mono text-[
|
|
2147
|
+
className: require_utils.cn("overflow-hidden rounded-lg border border-border bg-muted/30 font-mono text-[0.71875rem] leading-relaxed", className),
|
|
1885
2148
|
children: [
|
|
1886
2149
|
source.fileName ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1887
|
-
|
|
2150
|
+
title: source.fileName,
|
|
2151
|
+
className: "border-b border-border bg-muted/50 px-2.5 py-1 text-xs break-all text-muted-foreground",
|
|
1888
2152
|
children: source.fileName
|
|
1889
2153
|
}) : null,
|
|
1890
2154
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
1891
2155
|
className: "overflow-x-auto p-0",
|
|
1892
|
-
children: visible.map((line, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2156
|
+
children: visible.map((line, i) => line.type === "gap" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2157
|
+
className: "px-2.5 py-0.5 text-center text-[0.6875rem] text-subtle-foreground select-none",
|
|
2158
|
+
children: [
|
|
2159
|
+
line.count,
|
|
2160
|
+
" unchanged ",
|
|
2161
|
+
line.count === 1 ? "line" : "lines"
|
|
2162
|
+
]
|
|
2163
|
+
}, i) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1893
2164
|
className: require_utils.cn("flex gap-2 px-2.5 py-0.5", line.type === "add" && "bg-success/10 text-success", line.type === "del" && "bg-destructive/10 text-destructive", line.type === "context" && "text-muted-foreground"),
|
|
1894
2165
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1895
2166
|
className: "w-3 shrink-0 select-none opacity-70",
|
|
@@ -1901,11 +2172,11 @@ function InlineDiff({ source, className, maxLines = 40 }) {
|
|
|
1901
2172
|
}, i))
|
|
1902
2173
|
}),
|
|
1903
2174
|
hidden > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1904
|
-
className: "border-t border-border
|
|
2175
|
+
className: "border-t border-border px-2.5 py-1 text-[0.6875rem] text-muted-foreground",
|
|
1905
2176
|
children: [
|
|
1906
|
-
"+",
|
|
1907
2177
|
hidden,
|
|
1908
|
-
" more
|
|
2178
|
+
" more ",
|
|
2179
|
+
hidden === 1 ? "line" : "lines"
|
|
1909
2180
|
]
|
|
1910
2181
|
}) : null
|
|
1911
2182
|
]
|
|
@@ -1935,7 +2206,7 @@ function FeedbackBar({ className, onCopy, onRegenerate, onFeedback, copyText, sh
|
|
|
1935
2206
|
};
|
|
1936
2207
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_tooltip.TooltipProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1937
2208
|
"data-slot": "feedback-bar",
|
|
1938
|
-
className: require_utils.cn("flex items-center gap-
|
|
2209
|
+
className: require_utils.cn("flex items-center gap-2 text-muted-foreground", className),
|
|
1939
2210
|
children: [
|
|
1940
2211
|
showCopy ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Action, {
|
|
1941
2212
|
tip: copied ? "Copied" : "Copy",
|
|
@@ -1991,7 +2262,7 @@ function PromptSuggestion({ children, onClick, className }) {
|
|
|
1991
2262
|
type: "button",
|
|
1992
2263
|
"data-slot": "prompt-suggestion",
|
|
1993
2264
|
onClick,
|
|
1994
|
-
className: require_utils.cn("inline-flex max-w-full items-center rounded-full border border-border bg-background px-3 py-1.5", "text-
|
|
2265
|
+
className: require_utils.cn("inline-flex max-w-full items-center rounded-full border border-border bg-background px-3 py-1.5", "text-start text-[0.8125rem] text-foreground shadow-xs", "transition-[background-color,box-shadow,transform] duration-(--duration-moderate) ease-out", "hover:bg-accent hover:shadow-card", "motion-safe:active:scale-[0.98]", "focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50", className),
|
|
1995
2266
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1996
2267
|
className: "min-w-0 truncate",
|
|
1997
2268
|
children
|
|
@@ -2003,7 +2274,7 @@ function PromptSuggestions({ children, className, label = "Follow-ups" }) {
|
|
|
2003
2274
|
"data-slot": "prompt-suggestions",
|
|
2004
2275
|
className: require_utils.cn("flex flex-col gap-2", className),
|
|
2005
2276
|
children: [label ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2006
|
-
className: "text-[
|
|
2277
|
+
className: "text-[0.75rem] font-medium text-muted-foreground",
|
|
2007
2278
|
children: label
|
|
2008
2279
|
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2009
2280
|
className: "flex flex-wrap gap-1.5",
|
|
@@ -2059,7 +2330,7 @@ function StreamingText({ text = "", tokens, sources = [], followUps = [], onFoll
|
|
|
2059
2330
|
className: require_utils.cn("flex w-full flex-col gap-3", className),
|
|
2060
2331
|
children: [
|
|
2061
2332
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2062
|
-
className: "text-[
|
|
2333
|
+
className: "text-[0.8125rem] leading-relaxed text-pretty text-foreground",
|
|
2063
2334
|
children: tokens ? tokens.slice(0, visible).map((tok, i) => {
|
|
2064
2335
|
if (tok.type === "cite") {
|
|
2065
2336
|
const src = sources.find((s) => s.id === tok.id);
|
|
@@ -2069,16 +2340,16 @@ function StreamingText({ text = "", tokens, sources = [], followUps = [], onFoll
|
|
|
2069
2340
|
title: src?.title ?? tok.id,
|
|
2070
2341
|
href: src?.href,
|
|
2071
2342
|
description: src?.description,
|
|
2072
|
-
className: "align-super text-[
|
|
2343
|
+
className: "align-super text-[0.625rem]"
|
|
2073
2344
|
})
|
|
2074
2345
|
}, i);
|
|
2075
2346
|
}
|
|
2076
2347
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2077
|
-
className: require_utils.cn("transition-[filter,opacity] duration-
|
|
2348
|
+
className: require_utils.cn("transition-[filter,opacity] duration-(--duration-slow) ease-out motion-reduce:transition-none", i === visible - 1 && revealing ? "opacity-90 blur-[2px] motion-reduce:blur-0" : "opacity-100 blur-0"),
|
|
2078
2349
|
children: tok.text
|
|
2079
2350
|
}, i);
|
|
2080
2351
|
}) : words?.slice(0, visible).map((w, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2081
|
-
className: require_utils.cn("transition-[filter,opacity] duration-
|
|
2352
|
+
className: require_utils.cn("transition-[filter,opacity] duration-(--duration-slow) ease-out motion-reduce:transition-none", i === visible - 1 && revealing && !/^\s+$/.test(w) ? "opacity-90 blur-[2px] motion-reduce:blur-0" : "opacity-100 blur-0"),
|
|
2082
2353
|
children: w
|
|
2083
2354
|
}, i))
|
|
2084
2355
|
}),
|
|
@@ -2131,31 +2402,31 @@ function DiffTable({ title = "Proposed changes", columns, rows, addedRows = [],
|
|
|
2131
2402
|
const showAdded = stage >= 2 && addedRows.length > 0;
|
|
2132
2403
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2133
2404
|
"data-slot": "diff-table",
|
|
2134
|
-
className: require_utils.cn("w-full overflow-hidden rounded-
|
|
2405
|
+
className: require_utils.cn("w-full overflow-hidden rounded-lg bg-card shadow-card", className),
|
|
2135
2406
|
children: [title ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2136
2407
|
className: "flex items-center justify-between border-b border-border px-3 py-2",
|
|
2137
2408
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2138
|
-
className: "text-[
|
|
2409
|
+
className: "text-[0.78125rem] font-medium text-foreground",
|
|
2139
2410
|
children: title
|
|
2140
2411
|
})
|
|
2141
2412
|
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2142
2413
|
className: "overflow-x-auto",
|
|
2143
2414
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("table", {
|
|
2144
|
-
className: "w-full border-collapse text-
|
|
2415
|
+
className: "w-full border-collapse text-start text-[0.8125rem]",
|
|
2145
2416
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", {
|
|
2146
2417
|
className: "border-b border-border",
|
|
2147
2418
|
children: columns.map((col) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
|
|
2148
2419
|
scope: "col",
|
|
2149
|
-
className: require_utils.cn("px-3 py-2 text-[
|
|
2420
|
+
className: require_utils.cn("px-3 py-2 text-[0.75rem] font-medium text-muted-foreground", col.className),
|
|
2150
2421
|
children: col.header
|
|
2151
2422
|
}, col.id))
|
|
2152
2423
|
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tbody", { children: [rows.map((row) => {
|
|
2153
2424
|
const out = Boolean(row.removed && showRemovedTint);
|
|
2154
2425
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", {
|
|
2155
2426
|
"data-removed": out ? "true" : void 0,
|
|
2156
|
-
className: require_utils.cn("border-b border-border last:border-0", "transition-colors duration-
|
|
2427
|
+
className: require_utils.cn("border-b border-border last:border-0", "transition-colors duration-(--duration-slow) ease-out motion-reduce:transition-none", out && "bg-destructive/8"),
|
|
2157
2428
|
children: columns.map((col, colIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
2158
|
-
className: require_utils.cn("px-3 py-2 align-middle transition-colors duration-
|
|
2429
|
+
className: require_utils.cn("px-3 py-2 align-middle transition-colors duration-(--duration-slow) motion-reduce:transition-none", out && "text-destructive", out && colIndex > 0 && "line-through decoration-destructive/50", !out && colIndex === 0 && "font-medium text-foreground", !out && colIndex > 0 && "text-muted-foreground", col.className),
|
|
2159
2430
|
children: col.cell(row)
|
|
2160
2431
|
}, col.id))
|
|
2161
2432
|
}, row.id);
|
|
@@ -2165,14 +2436,14 @@ function DiffTable({ title = "Proposed changes", columns, rows, addedRows = [],
|
|
|
2165
2436
|
colSpan: columns.length,
|
|
2166
2437
|
className: "p-0",
|
|
2167
2438
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2168
|
-
className: require_utils.cn("grid transition-[grid-template-rows,opacity] duration-
|
|
2439
|
+
className: require_utils.cn("grid transition-[grid-template-rows,opacity] duration-(--duration-slow) ease-out motion-reduce:transition-none", showAdded ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"),
|
|
2169
2440
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2170
2441
|
className: "overflow-hidden bg-success/8",
|
|
2171
2442
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2172
2443
|
className: "grid items-center border-t border-border",
|
|
2173
2444
|
style: { gridTemplateColumns: `repeat(${columns.length}, minmax(0, 1fr))` },
|
|
2174
2445
|
children: row.cells.map((cell, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2175
|
-
className: require_utils.cn("px-3 py-2 text-success", i === 0 && "font-medium"),
|
|
2446
|
+
className: require_utils.cn("min-w-0 px-3 py-2 text-success [overflow-wrap:anywhere]", i === 0 && "font-medium"),
|
|
2176
2447
|
children: cell
|
|
2177
2448
|
}, i))
|
|
2178
2449
|
})
|
|
@@ -2207,18 +2478,20 @@ function PlanTracker({ plan, streaming = false, className, flushBottom = true, d
|
|
|
2207
2478
|
onOpenChange,
|
|
2208
2479
|
className: "group/collapsible",
|
|
2209
2480
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2210
|
-
className: require_utils.cn("border border-input bg-muted/40", flushBottom ? "rounded-t-
|
|
2481
|
+
className: require_utils.cn("border border-input bg-muted/40", flushBottom ? "rounded-t-lg border-b-0" : "rounded-lg"),
|
|
2211
2482
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_collapsible.CollapsibleTrigger, {
|
|
2212
|
-
className: require_utils.cn("group flex w-full items-center gap-1.5 px-3 py-2 text-
|
|
2483
|
+
className: require_utils.cn("group flex w-full items-center gap-1.5 px-3 py-2 text-start text-[0.8125rem]", "text-muted-foreground hover:text-foreground"),
|
|
2213
2484
|
children: [
|
|
2214
2485
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ListChecks, { className: "size-3.5 shrink-0" }),
|
|
2215
2486
|
complete ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2216
|
-
className: "min-w-0 flex-1 truncate font-medium",
|
|
2487
|
+
className: "min-w-0 flex-1 truncate font-medium tabular-nums",
|
|
2217
2488
|
children: `${total}/${total} done`
|
|
2218
2489
|
}) : focusStep ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2219
|
-
|
|
2490
|
+
dir: "auto",
|
|
2491
|
+
title: focusStep.label,
|
|
2492
|
+
className: "min-w-0 flex-1 truncate font-medium [text-align:match-parent]",
|
|
2220
2493
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2221
|
-
className: "
|
|
2494
|
+
className: "me-1.5 font-mono text-[0.75rem] font-normal tabular-nums text-muted-foreground/60",
|
|
2222
2495
|
children: [
|
|
2223
2496
|
focusIndex + 1,
|
|
2224
2497
|
"/",
|
|
@@ -2247,9 +2520,13 @@ function PlanTracker({ plan, streaming = false, className, flushBottom = true, d
|
|
|
2247
2520
|
}
|
|
2248
2521
|
function PlanRow({ step }) {
|
|
2249
2522
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
2250
|
-
className: "flex items-
|
|
2251
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2252
|
-
className:
|
|
2523
|
+
className: "flex items-start gap-2 rounded-md px-1.5 py-1 text-[0.8125rem]",
|
|
2524
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2525
|
+
className: "flex h-5 shrink-0 items-center",
|
|
2526
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StepIcon, { status: step.status })
|
|
2527
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2528
|
+
dir: "auto",
|
|
2529
|
+
className: require_utils.cn("min-w-0 flex-1 leading-5 text-pretty [overflow-wrap:anywhere] [text-align:match-parent]", step.status === "done" ? "text-muted-foreground line-through" : "text-foreground"),
|
|
2253
2530
|
children: step.label
|
|
2254
2531
|
})]
|
|
2255
2532
|
});
|
|
@@ -2262,16 +2539,13 @@ function StepIcon({ status }) {
|
|
|
2262
2539
|
|
|
2263
2540
|
//#endregion
|
|
2264
2541
|
//#region src/components/ai/context-ring.tsx
|
|
2542
|
+
const compactNumber = new Intl.NumberFormat("en-US", {
|
|
2543
|
+
notation: "compact",
|
|
2544
|
+
maximumFractionDigits: 1
|
|
2545
|
+
});
|
|
2546
|
+
/** `1048576` is "1M", `999500` is "999.5K" and `9960` is "10K": rounding rolls up to the next unit instead of printing "1000K" or "10.0K". */
|
|
2265
2547
|
function formatCompact(n) {
|
|
2266
|
-
|
|
2267
|
-
const m = n / 1e6;
|
|
2268
|
-
return `${Number.isInteger(m) ? m : m.toFixed(m < 10 ? 2 : 1)}M`;
|
|
2269
|
-
}
|
|
2270
|
-
if (n >= 1e3) {
|
|
2271
|
-
const k = n / 1e3;
|
|
2272
|
-
return `${Number.isInteger(k) ? k : k.toFixed(k < 10 ? 1 : 0)}K`;
|
|
2273
|
-
}
|
|
2274
|
-
return String(n);
|
|
2548
|
+
return Number.isFinite(n) ? compactNumber.format(n) : String(n);
|
|
2275
2549
|
}
|
|
2276
2550
|
function meterTone(pct, recomputing, hasUsage) {
|
|
2277
2551
|
if (!hasUsage) return "idle";
|
|
@@ -2315,7 +2589,8 @@ function ContextRing({ usage, size = 24, stroke = 2, className }) {
|
|
|
2315
2589
|
const center = size / 2;
|
|
2316
2590
|
const glowPad = snap(Math.max(4, size * .18));
|
|
2317
2591
|
const recomputing = !!usage && usage.tokens === null;
|
|
2318
|
-
const
|
|
2592
|
+
const reported = usage?.percent ?? (usage && usage.tokens !== null && usage.contextWindow > 0 ? usage.tokens / usage.contextWindow * 100 : null);
|
|
2593
|
+
const pct = reported != null ? Math.max(0, Math.min(100, reported)) : 0;
|
|
2319
2594
|
const tone = meterTone(pct, recomputing, !!usage);
|
|
2320
2595
|
const color = toneStroke(tone);
|
|
2321
2596
|
const hit = Math.max(size, 32);
|
|
@@ -2330,7 +2605,7 @@ function ContextRing({ usage, size = 24, stroke = 2, className }) {
|
|
|
2330
2605
|
let tooltip;
|
|
2331
2606
|
if (!usage) tooltip = "No usage yet";
|
|
2332
2607
|
else if (usage.tokens === null) tooltip = "Recomputing after compaction…";
|
|
2333
|
-
else tooltip = `${Math.round(
|
|
2608
|
+
else tooltip = `${Math.round(Math.max(0, reported ?? 0))}% used · ${formatCompact(usage.tokens)} / ${formatCompact(usage.contextWindow)}`;
|
|
2334
2609
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_tooltip.Tooltip, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_tooltip.TooltipTrigger, {
|
|
2335
2610
|
asChild: true,
|
|
2336
2611
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -2384,13 +2659,14 @@ function ContextRing({ usage, size = 24, stroke = 2, className }) {
|
|
|
2384
2659
|
strokeLinecap: "round",
|
|
2385
2660
|
opacity: filled ? recomputing ? .55 : isFrontier ? 1 : .92 : usage ? .38 : .28,
|
|
2386
2661
|
filter: filled ? `url(#${glowId})` : void 0,
|
|
2387
|
-
className: "transition-[stroke,opacity] duration-
|
|
2662
|
+
className: "transition-[stroke,opacity] duration-(--duration-slow) ease-out"
|
|
2388
2663
|
}, i);
|
|
2389
2664
|
})]
|
|
2390
2665
|
})
|
|
2391
2666
|
})
|
|
2392
2667
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_tooltip.TooltipContent, {
|
|
2393
2668
|
side: "top",
|
|
2669
|
+
className: "tabular-nums",
|
|
2394
2670
|
children: tooltip
|
|
2395
2671
|
})] });
|
|
2396
2672
|
}
|
|
@@ -2427,8 +2703,8 @@ function TaskRow({ label, meta, status, progress, details, onRetry, className, d
|
|
|
2427
2703
|
strokeDasharray: `${2 * Math.PI * 10 * .28} ${2 * Math.PI * 10 * .72}`
|
|
2428
2704
|
})]
|
|
2429
2705
|
}), progress != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2430
|
-
className: "relative text-[
|
|
2431
|
-
children: Math.round(progress)
|
|
2706
|
+
className: "relative text-[0.625rem] font-semibold tabular-nums text-foreground",
|
|
2707
|
+
children: Math.round(Math.max(0, Math.min(100, progress)))
|
|
2432
2708
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Loader2, { className: "relative size-3 animate-spin text-muted-foreground motion-reduce:animate-none" })] }) : status === "completed" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2433
2709
|
className: "flex size-5 items-center justify-center rounded-full bg-success text-white",
|
|
2434
2710
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, {
|
|
@@ -2446,20 +2722,22 @@ function TaskRow({ label, meta, status, progress, details, onRetry, className, d
|
|
|
2446
2722
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2447
2723
|
className: "min-w-0 flex-1",
|
|
2448
2724
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2449
|
-
|
|
2725
|
+
title: typeof label === "string" ? label : void 0,
|
|
2726
|
+
className: "truncate text-[0.8125rem] font-medium text-foreground",
|
|
2450
2727
|
children: label
|
|
2451
2728
|
}), meta ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2452
|
-
|
|
2729
|
+
title: typeof meta === "string" ? meta : void 0,
|
|
2730
|
+
className: "truncate text-[0.75rem] text-muted-foreground",
|
|
2453
2731
|
children: meta
|
|
2454
2732
|
}) : null]
|
|
2455
2733
|
}),
|
|
2456
2734
|
status === "completed" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2457
|
-
className: "inline-flex h-5 items-center rounded-full bg-success/10 px-2 text-[
|
|
2735
|
+
className: "inline-flex h-5 items-center rounded-full bg-success/10 px-2 text-[0.71875rem] font-medium text-success",
|
|
2458
2736
|
children: "Completed"
|
|
2459
2737
|
}) : status === "failed" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2460
2738
|
className: "inline-flex items-center gap-1",
|
|
2461
2739
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2462
|
-
className: "inline-flex h-5 items-center rounded-full bg-destructive/10 px-2 text-[
|
|
2740
|
+
className: "inline-flex h-5 items-center rounded-full bg-destructive/10 px-2 text-[0.71875rem] font-medium text-destructive",
|
|
2463
2741
|
children: "Failed"
|
|
2464
2742
|
}), onRetry ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_button.Button, {
|
|
2465
2743
|
type: "button",
|
|
@@ -2479,25 +2757,25 @@ function TaskRow({ label, meta, status, progress, details, onRetry, className, d
|
|
|
2479
2757
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2480
2758
|
"data-slot": "task-row",
|
|
2481
2759
|
"data-status": status,
|
|
2482
|
-
className: require_utils.cn("rounded-lg
|
|
2760
|
+
className: require_utils.cn("rounded-lg bg-card px-2.5 py-2 shadow-card", "animate-[ai-fade-up_300ms_cubic-bezier(0.23,1,0.32,1)_both] motion-reduce:animate-none", className),
|
|
2483
2761
|
style: { animationDelay: `${index * 80}ms` },
|
|
2484
2762
|
children: hasDetails ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_collapsible.Collapsible, {
|
|
2485
2763
|
defaultOpen,
|
|
2486
2764
|
className: "group/collapsible",
|
|
2487
2765
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_collapsible.CollapsibleTrigger, {
|
|
2488
|
-
className: "w-full text-
|
|
2766
|
+
className: "w-full text-start",
|
|
2489
2767
|
children: header
|
|
2490
2768
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_collapsible.CollapsibleContent, {
|
|
2491
|
-
innerClassName: "py-1.5
|
|
2769
|
+
innerClassName: "py-1.5 ps-8",
|
|
2492
2770
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
2493
2771
|
className: "space-y-1",
|
|
2494
2772
|
children: details.map((d, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
2495
|
-
className: "flex items-center justify-between gap-2 text-[
|
|
2773
|
+
className: "flex items-center justify-between gap-2 text-[0.75rem]",
|
|
2496
2774
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2497
|
-
className: "text-muted-foreground",
|
|
2775
|
+
className: "min-w-0 text-muted-foreground [overflow-wrap:anywhere]",
|
|
2498
2776
|
children: d.label
|
|
2499
2777
|
}), d.meta ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2500
|
-
className: "font-mono tabular-nums text-muted-foreground/80",
|
|
2778
|
+
className: "max-w-[55%] min-w-0 text-end font-mono tabular-nums text-muted-foreground/80 [overflow-wrap:anywhere]",
|
|
2501
2779
|
children: d.meta
|
|
2502
2780
|
}) : null]
|
|
2503
2781
|
}, i))
|
|
@@ -2519,34 +2797,35 @@ function TaskList({ children, className }) {
|
|
|
2519
2797
|
function ContextCard({ title, body, meta, sourceType, sourceName, className, index = 0 }) {
|
|
2520
2798
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
|
|
2521
2799
|
"data-slot": "context-card",
|
|
2522
|
-
className: require_utils.cn("rounded-
|
|
2800
|
+
className: require_utils.cn("rounded-lg bg-card p-3 shadow-card", "animate-[ai-fade-up_300ms_cubic-bezier(0.23,1,0.32,1)_both] motion-reduce:animate-none", className),
|
|
2523
2801
|
style: { animationDelay: `${index * 60}ms` },
|
|
2524
2802
|
children: [
|
|
2525
2803
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2526
2804
|
className: "flex items-start justify-between gap-2",
|
|
2527
2805
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
2528
|
-
className: "text-[
|
|
2806
|
+
className: "min-w-0 text-[0.8125rem] font-medium text-balance text-foreground [overflow-wrap:anywhere]",
|
|
2529
2807
|
children: title
|
|
2530
2808
|
}), meta ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2531
|
-
className: "shrink-0 text-[
|
|
2809
|
+
className: "shrink-0 text-[0.6875rem] tabular-nums text-muted-foreground",
|
|
2532
2810
|
children: meta
|
|
2533
2811
|
}) : null]
|
|
2534
2812
|
}),
|
|
2535
2813
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2536
|
-
className: "mt-1.5 text-[
|
|
2814
|
+
className: "mt-1.5 text-[0.8125rem] text-pretty leading-relaxed text-muted-foreground [overflow-wrap:anywhere]",
|
|
2537
2815
|
children: body
|
|
2538
2816
|
}),
|
|
2539
2817
|
(sourceType || sourceName) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2540
|
-
className: "mt-2.5 flex items-center gap-1.5 text-[
|
|
2818
|
+
className: "mt-2.5 flex flex-wrap items-center gap-x-1.5 gap-y-1 text-[0.75rem] text-muted-foreground",
|
|
2541
2819
|
children: [
|
|
2542
2820
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.FileText, { className: "size-3 shrink-0 opacity-70" }),
|
|
2543
2821
|
sourceType ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_badge.Badge, {
|
|
2544
2822
|
variant: "secondary",
|
|
2545
|
-
className: "h-5 px-1.5 text-[
|
|
2823
|
+
className: "h-5 px-1.5 text-[0.625rem] font-medium",
|
|
2546
2824
|
children: sourceType
|
|
2547
2825
|
}) : null,
|
|
2548
2826
|
sourceName ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2549
|
-
|
|
2827
|
+
title: typeof sourceName === "string" ? sourceName : void 0,
|
|
2828
|
+
className: "max-w-full min-w-0 truncate",
|
|
2550
2829
|
children: sourceName
|
|
2551
2830
|
}) : null
|
|
2552
2831
|
]
|
|
@@ -2559,7 +2838,7 @@ function ContextCards({ children, className, label = "Chunks", count }) {
|
|
|
2559
2838
|
"data-slot": "context-cards",
|
|
2560
2839
|
className: require_utils.cn("flex flex-col gap-2", className),
|
|
2561
2840
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2562
|
-
className: "flex items-center gap-2 text-[
|
|
2841
|
+
className: "flex items-center gap-2 text-[0.75rem] text-muted-foreground",
|
|
2563
2842
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2564
2843
|
className: "font-medium",
|
|
2565
2844
|
children: label
|
|
@@ -2586,22 +2865,22 @@ function RecommendationCard({ title = "Recommendation", body, confidence, confid
|
|
|
2586
2865
|
const pct = confidence != null ? Math.round(Math.max(0, Math.min(1, confidence)) * 100) : null;
|
|
2587
2866
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2588
2867
|
"data-slot": "recommendation-card",
|
|
2589
|
-
className: require_utils.cn("w-full max-w-md overflow-hidden rounded-
|
|
2868
|
+
className: require_utils.cn("w-full max-w-md overflow-hidden rounded-lg bg-card shadow-card", className),
|
|
2590
2869
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2591
2870
|
className: "space-y-3 p-3",
|
|
2592
2871
|
children: [
|
|
2593
2872
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2594
|
-
className: "text-[
|
|
2873
|
+
className: "text-[0.75rem] font-medium text-muted-foreground",
|
|
2595
2874
|
children: title
|
|
2596
2875
|
}),
|
|
2597
2876
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2598
|
-
className: "text-[
|
|
2877
|
+
className: "text-[0.8125rem] text-pretty leading-relaxed text-foreground [overflow-wrap:anywhere]",
|
|
2599
2878
|
children: displayBody
|
|
2600
2879
|
}),
|
|
2601
2880
|
pct != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2602
2881
|
className: "space-y-1",
|
|
2603
2882
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2604
|
-
className: "flex items-center justify-between text-[
|
|
2883
|
+
className: "flex items-center justify-between text-[0.6875rem] text-muted-foreground",
|
|
2605
2884
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: confidenceLabel ?? "Confidence" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2606
2885
|
className: "tabular-nums font-medium text-foreground",
|
|
2607
2886
|
children: [pct, "%"]
|
|
@@ -2609,7 +2888,7 @@ function RecommendationCard({ title = "Recommendation", body, confidence, confid
|
|
|
2609
2888
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2610
2889
|
className: "h-1.5 overflow-hidden rounded-full bg-muted",
|
|
2611
2890
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2612
|
-
className: "h-full origin-left rounded-full bg-primary transition-transform duration-
|
|
2891
|
+
className: "h-full origin-left rounded-full bg-primary rtl:origin-right transition-transform duration-(--duration-slow) ease-out motion-reduce:transition-none",
|
|
2613
2892
|
style: { transform: `scaleX(${pct / 100})` }
|
|
2614
2893
|
})
|
|
2615
2894
|
})]
|
|
@@ -2617,7 +2896,7 @@ function RecommendationCard({ title = "Recommendation", body, confidence, confid
|
|
|
2617
2896
|
alternatives.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_collapsible.Collapsible, {
|
|
2618
2897
|
className: "group/collapsible",
|
|
2619
2898
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_collapsible.CollapsibleTrigger, {
|
|
2620
|
-
className: require_utils.cn("flex w-full items-center justify-between rounded-md border border-border
|
|
2899
|
+
className: require_utils.cn("flex w-full items-center justify-between rounded-md border border-border px-2.5 py-1.5 text-[0.78125rem]", "text-muted-foreground hover:bg-accent hover:text-foreground"),
|
|
2621
2900
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "Other options" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, {
|
|
2622
2901
|
"data-slot": "collapsible-icon",
|
|
2623
2902
|
className: "size-3.5"
|
|
@@ -2634,7 +2913,7 @@ function RecommendationCard({ title = "Recommendation", body, confidence, confid
|
|
|
2634
2913
|
onClick: () => {
|
|
2635
2914
|
setInternalId(opt.id);
|
|
2636
2915
|
},
|
|
2637
|
-
className: require_utils.cn("flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-
|
|
2916
|
+
className: require_utils.cn("flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-start text-[0.8125rem]", "hover:bg-accent", on && "bg-accent"),
|
|
2638
2917
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2639
2918
|
className: require_utils.cn("mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border", on ? "border-primary bg-primary text-primary-foreground" : "border-border"),
|
|
2640
2919
|
children: on ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, {
|
|
@@ -2644,10 +2923,10 @@ function RecommendationCard({ title = "Recommendation", body, confidence, confid
|
|
|
2644
2923
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2645
2924
|
className: "min-w-0 flex-1",
|
|
2646
2925
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2647
|
-
className: "font-medium text-foreground",
|
|
2926
|
+
className: "font-medium text-foreground [overflow-wrap:anywhere]",
|
|
2648
2927
|
children: opt.label
|
|
2649
2928
|
}), opt.badge ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2650
|
-
className: "
|
|
2929
|
+
className: "ms-1.5 text-[0.6875rem] text-muted-foreground",
|
|
2651
2930
|
children: opt.badge
|
|
2652
2931
|
}) : null]
|
|
2653
2932
|
})]
|
|
@@ -2657,10 +2936,11 @@ function RecommendationCard({ title = "Recommendation", body, confidence, confid
|
|
|
2657
2936
|
})]
|
|
2658
2937
|
}) : null,
|
|
2659
2938
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2660
|
-
className: "flex justify-end",
|
|
2939
|
+
className: "flex flex-wrap justify-end",
|
|
2661
2940
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_button.Button, {
|
|
2662
2941
|
type: "button",
|
|
2663
2942
|
size: "sm",
|
|
2943
|
+
wrap: true,
|
|
2664
2944
|
onClick: () => onAccept?.(selectedId),
|
|
2665
2945
|
children: acceptLabel
|
|
2666
2946
|
})
|
|
@@ -2754,14 +3034,14 @@ function FileUpload({ files: filesProp, onFilesChange, multiple = true, accept,
|
|
|
2754
3034
|
onDragOver: (e) => e.preventDefault(),
|
|
2755
3035
|
onDragLeave: () => setDragging(false),
|
|
2756
3036
|
onDrop,
|
|
2757
|
-
className: require_utils.cn("flex cursor-pointer
|
|
3037
|
+
className: require_utils.cn("flex cursor-pointer items-center justify-center gap-2 rounded-lg border border-dashed px-4 text-center", "transition-colors duration-(--duration-moderate)", variant === "compact" ? "flex-row rounded-md py-3" : "flex-col py-6", dragging ? "border-primary bg-primary/5" : "border-border bg-muted/30 hover:bg-muted/50", disabled && "pointer-events-none opacity-60"),
|
|
2758
3038
|
children: [
|
|
2759
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Upload, { className: "
|
|
3039
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Upload, { className: require_utils.cn("text-muted-foreground", variant === "compact" ? "size-4" : "size-5") }),
|
|
2760
3040
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2761
|
-
className: "text-[
|
|
3041
|
+
className: "text-[0.8125rem] font-medium text-foreground",
|
|
2762
3042
|
children: "Drop files or click to upload"
|
|
2763
3043
|
}),
|
|
2764
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3044
|
+
variant === "compact" ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2765
3045
|
className: "text-xs text-muted-foreground",
|
|
2766
3046
|
children: multiple ? "Multiple files supported" : "Single file"
|
|
2767
3047
|
})
|
|
@@ -2770,10 +3050,11 @@ function FileUpload({ files: filesProp, onFilesChange, multiple = true, accept,
|
|
|
2770
3050
|
files.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
2771
3051
|
className: "flex flex-col gap-1",
|
|
2772
3052
|
children: files.map((file, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
2773
|
-
className: "flex items-center gap-2 rounded-md border border-border bg-card px-2 py-1.5 text-[
|
|
3053
|
+
className: "flex items-center gap-2 rounded-md border border-border bg-card px-2 py-1.5 text-[0.78125rem]",
|
|
2774
3054
|
children: [
|
|
2775
3055
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Paperclip, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
2776
3056
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3057
|
+
title: file.name,
|
|
2777
3058
|
className: "min-w-0 flex-1 truncate font-medium",
|
|
2778
3059
|
children: file.name
|
|
2779
3060
|
}),
|
|
@@ -2831,12 +3112,1281 @@ function AiImage({ data, mimeType = "image/png", src, bytes, alt = "", className
|
|
|
2831
3112
|
"data-slot": "ai-image",
|
|
2832
3113
|
src: resolved,
|
|
2833
3114
|
alt,
|
|
2834
|
-
className: require_utils.cn("max-h-80 max-w-full rounded-lg object-contain", "outline outline-1 outline-black/10 dark:outline-white/10", className),
|
|
3115
|
+
className: require_utils.cn("max-h-80 max-w-full rounded-lg object-contain", "outline outline-1 -outline-offset-1 outline-black/10 dark:outline-white/10", className),
|
|
2835
3116
|
...props
|
|
2836
3117
|
});
|
|
2837
3118
|
}
|
|
2838
3119
|
|
|
2839
3120
|
//#endregion
|
|
3121
|
+
//#region src/components/ai/mark-tile.tsx
|
|
3122
|
+
const SIZE = {
|
|
3123
|
+
xs: "size-4 rounded-[5px] text-[0.5625rem] [&_svg:not([class*=size-])]:size-2.5",
|
|
3124
|
+
sm: "size-6 rounded-md text-[0.6875rem] [&_svg:not([class*=size-])]:size-3.5",
|
|
3125
|
+
md: "size-8 rounded-lg text-sm [&_svg:not([class*=size-])]:size-4"
|
|
3126
|
+
};
|
|
3127
|
+
/**
|
|
3128
|
+
* Square tile that frames an app mark or glyph. The edge is an inset outline
|
|
3129
|
+
* rather than a border, so pale marks keep a shape on any surface without the
|
|
3130
|
+
* tile growing.
|
|
3131
|
+
*/
|
|
3132
|
+
function MarkTile({ size = "xs", className, children, ...props }) {
|
|
3133
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3134
|
+
"aria-hidden": "true",
|
|
3135
|
+
"data-slot": "mark-tile",
|
|
3136
|
+
className: require_utils.cn("grid shrink-0 place-items-center overflow-hidden bg-card leading-none text-muted-foreground", "outline-1 -outline-offset-1 outline-black/10 dark:outline-white/10", SIZE[size], className),
|
|
3137
|
+
...props,
|
|
3138
|
+
children
|
|
3139
|
+
});
|
|
3140
|
+
}
|
|
3141
|
+
/**
|
|
3142
|
+
* Enter treatment for icons that appear on a state change (a check replacing a
|
|
3143
|
+
* spinner, a settled chip). Uses `@starting-style` so it needs no keyframes.
|
|
3144
|
+
*/
|
|
3145
|
+
const iconEnterClass = "transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] starting:scale-25 starting:opacity-0 starting:blur-[4px] motion-reduce:transition-none";
|
|
3146
|
+
|
|
3147
|
+
//#endregion
|
|
3148
|
+
//#region src/components/ai/tool-trace.tsx
|
|
3149
|
+
const STATUS_LABEL = {
|
|
3150
|
+
pending: "Queued",
|
|
3151
|
+
running: "Running",
|
|
3152
|
+
done: "Done",
|
|
3153
|
+
error: "Failed"
|
|
3154
|
+
};
|
|
3155
|
+
/** Delay between rows as a trace enters, so it reads top to bottom. */
|
|
3156
|
+
const ROW_STAGGER_MS = 80;
|
|
3157
|
+
/**
|
|
3158
|
+
* Quiet tool-call trace: a heading row, then one row per call hung from a
|
|
3159
|
+
* single rail under the heading glyph. Each row morphs from spinner to check
|
|
3160
|
+
* as the call settles, or to an alert when it fails.
|
|
3161
|
+
*/
|
|
3162
|
+
function ToolTrace({ title = "Read tools", icon, steps, className, ...props }) {
|
|
3163
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("ol", {
|
|
3164
|
+
"data-slot": "tool-trace",
|
|
3165
|
+
className: require_utils.cn("flex flex-col", className),
|
|
3166
|
+
...props,
|
|
3167
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
3168
|
+
className: "mb-1 flex h-7 items-center gap-2",
|
|
3169
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkTile, { children: icon ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.BookOpen, {}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3170
|
+
className: "text-[0.8125rem] text-foreground",
|
|
3171
|
+
children: title
|
|
3172
|
+
})]
|
|
3173
|
+
}), steps.map((step, index) => {
|
|
3174
|
+
const status = step.status ?? "done";
|
|
3175
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
3176
|
+
"data-status": status,
|
|
3177
|
+
style: { animationDelay: `${(index + 1) * ROW_STAGGER_MS}ms` },
|
|
3178
|
+
className: "ms-2 flex h-8 animate-[ai-fade-up_var(--duration-slow)_var(--ease-out)_both] items-center gap-2 border-s border-subtle-foreground/25 ps-3 motion-reduce:animate-none",
|
|
3179
|
+
children: [
|
|
3180
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3181
|
+
className: "grid size-4 shrink-0 place-items-center text-subtle-foreground",
|
|
3182
|
+
children: [status === "done" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, {
|
|
3183
|
+
"aria-hidden": "true",
|
|
3184
|
+
className: require_utils.cn("size-3", iconEnterClass),
|
|
3185
|
+
strokeWidth: 2
|
|
3186
|
+
}) : status === "error" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CircleAlert, {
|
|
3187
|
+
"aria-hidden": "true",
|
|
3188
|
+
className: require_utils.cn("size-3.5 text-destructive", iconEnterClass)
|
|
3189
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_spinner.Spinner, {
|
|
3190
|
+
"aria-hidden": "true",
|
|
3191
|
+
role: void 0,
|
|
3192
|
+
className: "size-3.5",
|
|
3193
|
+
strokeWidth: 1.5
|
|
3194
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3195
|
+
className: "sr-only",
|
|
3196
|
+
children: STATUS_LABEL[status]
|
|
3197
|
+
})]
|
|
3198
|
+
}),
|
|
3199
|
+
step.icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkTile, {
|
|
3200
|
+
className: "text-foreground",
|
|
3201
|
+
children: step.icon
|
|
3202
|
+
}) : null,
|
|
3203
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3204
|
+
className: require_utils.cn("truncate text-[0.8125rem]", status === "running" || status === "error" ? "text-foreground" : "text-muted-foreground"),
|
|
3205
|
+
children: step.label
|
|
3206
|
+
})
|
|
3207
|
+
]
|
|
3208
|
+
}, step.id);
|
|
3209
|
+
})]
|
|
3210
|
+
});
|
|
3211
|
+
}
|
|
3212
|
+
|
|
3213
|
+
//#endregion
|
|
3214
|
+
//#region src/components/ai/thinking-status.tsx
|
|
3215
|
+
function formatElapsed(totalSeconds) {
|
|
3216
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
3217
|
+
const seconds = totalSeconds % 60;
|
|
3218
|
+
return minutes > 0 ? `${minutes}m ${seconds}s` : `${seconds}s`;
|
|
3219
|
+
}
|
|
3220
|
+
function ThinkingGlyph() {
|
|
3221
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3222
|
+
"aria-hidden": "true",
|
|
3223
|
+
className: "grid size-4 grid-cols-3 place-items-center gap-px p-0.5",
|
|
3224
|
+
children: Array.from({ length: 9 }, (_, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3225
|
+
className: "size-[3px] rounded-full bg-muted-foreground animate-[ai-pulse-dot_1.2s_ease-in-out_infinite] motion-reduce:animate-none",
|
|
3226
|
+
style: { animationDelay: `${index * 5 % 9 * 110}ms` }
|
|
3227
|
+
}, index))
|
|
3228
|
+
});
|
|
3229
|
+
}
|
|
3230
|
+
/**
|
|
3231
|
+
* Compact in-flight status: pulsing glyph, label, elapsed time, and token
|
|
3232
|
+
* spend. Digits are tabular so the row never jitters while it ticks.
|
|
3233
|
+
*/
|
|
3234
|
+
function ThinkingStatus({ label = "Thinking", elapsedSeconds = 0, tokens, live = true, tokensPerTick = 0, className, ...props }) {
|
|
3235
|
+
const [ticks, setTicks] = react.useState({
|
|
3236
|
+
seconds: 0,
|
|
3237
|
+
tokens: 0
|
|
3238
|
+
});
|
|
3239
|
+
react.useEffect(() => {
|
|
3240
|
+
if (!live) return;
|
|
3241
|
+
const id = window.setInterval(() => {
|
|
3242
|
+
setTicks((current) => ({
|
|
3243
|
+
seconds: current.seconds + 1,
|
|
3244
|
+
tokens: current.tokens + (tokensPerTick ? Math.round(tokensPerTick * (.6 + Math.random() * .8)) : 0)
|
|
3245
|
+
}));
|
|
3246
|
+
}, 1e3);
|
|
3247
|
+
return () => window.clearInterval(id);
|
|
3248
|
+
}, [live, tokensPerTick]);
|
|
3249
|
+
const seconds = elapsedSeconds + (live ? ticks.seconds : 0);
|
|
3250
|
+
const spent = (tokens ?? 0) + (live ? ticks.tokens : 0);
|
|
3251
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3252
|
+
role: "status",
|
|
3253
|
+
"aria-live": "polite",
|
|
3254
|
+
"data-slot": "thinking-status",
|
|
3255
|
+
className: require_utils.cn("flex h-7 items-center gap-2 text-[0.8125rem]", className),
|
|
3256
|
+
...props,
|
|
3257
|
+
children: [
|
|
3258
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThinkingGlyph, {}),
|
|
3259
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3260
|
+
className: "text-muted-foreground",
|
|
3261
|
+
children: label
|
|
3262
|
+
}),
|
|
3263
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3264
|
+
"aria-hidden": "true",
|
|
3265
|
+
className: "flex items-center gap-1.5 text-subtle-foreground tabular-nums",
|
|
3266
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: formatElapsed(seconds) }), tokens !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3267
|
+
"aria-hidden": "true",
|
|
3268
|
+
className: "size-0.5 rounded-full bg-current"
|
|
3269
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [formatCompact(spent), " tokens"] })] }) : null]
|
|
3270
|
+
})
|
|
3271
|
+
]
|
|
3272
|
+
});
|
|
3273
|
+
}
|
|
3274
|
+
|
|
3275
|
+
//#endregion
|
|
3276
|
+
//#region src/components/ai/prompt-input-tray.tsx
|
|
3277
|
+
const TONE_COLOR = {
|
|
3278
|
+
neutral: "var(--muted-foreground)",
|
|
3279
|
+
info: "var(--info)",
|
|
3280
|
+
warning: "var(--warning)",
|
|
3281
|
+
danger: "var(--destructive)"
|
|
3282
|
+
};
|
|
3283
|
+
/**
|
|
3284
|
+
* Tinted shell that docks status rows onto a composer so the two read as one
|
|
3285
|
+
* surface. The tray is 18px with a 4px inset, so the composer inside is
|
|
3286
|
+
* rounded to 14px (concentric). Tone tints the tray, its edge, and the icon in
|
|
3287
|
+
* each row; text stays at full contrast. Renders the composer alone when there
|
|
3288
|
+
* is nothing to dock.
|
|
3289
|
+
*/
|
|
3290
|
+
function PromptInputTray({ tone = "neutral", header, footer, children, className, style, ...props }) {
|
|
3291
|
+
if (!header && !footer) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children });
|
|
3292
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3293
|
+
"data-slot": "prompt-input-tray",
|
|
3294
|
+
"data-tone": tone,
|
|
3295
|
+
style: {
|
|
3296
|
+
"--tray-tone": TONE_COLOR[tone],
|
|
3297
|
+
...style
|
|
3298
|
+
},
|
|
3299
|
+
className: require_utils.cn("flex flex-col rounded-[18px] p-1", "bg-[color-mix(in_oklab,var(--tray-tone)_8%,var(--card))] dark:bg-[color-mix(in_oklab,var(--tray-tone)_13%,var(--card))]", "shadow-[inset_0_0_0_1px_color-mix(in_oklab,var(--tray-tone)_22%,transparent)]", "[&_[data-slot=prompt-input]]:rounded-[14px] [&_[data-slot=prompt-input]]:bg-card", className),
|
|
3300
|
+
...props,
|
|
3301
|
+
children: [
|
|
3302
|
+
header ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3303
|
+
"data-slot": "prompt-input-tray-header",
|
|
3304
|
+
children: header
|
|
3305
|
+
}) : null,
|
|
3306
|
+
children,
|
|
3307
|
+
footer ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3308
|
+
"data-slot": "prompt-input-tray-footer",
|
|
3309
|
+
children: footer
|
|
3310
|
+
}) : null
|
|
3311
|
+
]
|
|
3312
|
+
});
|
|
3313
|
+
}
|
|
3314
|
+
/** One line inside a tray: tone-colored icon, text, and trailing actions. */
|
|
3315
|
+
function PromptInputTrayRow({ icon, children, actions, className, ...props }) {
|
|
3316
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3317
|
+
"data-slot": "prompt-input-tray-row",
|
|
3318
|
+
className: require_utils.cn("flex min-h-8 items-center gap-2 px-2.5 py-1 text-[0.8125rem] text-foreground", className),
|
|
3319
|
+
...props,
|
|
3320
|
+
children: [
|
|
3321
|
+
icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3322
|
+
"aria-hidden": "true",
|
|
3323
|
+
className: "grid size-4 shrink-0 place-items-center text-[color-mix(in_oklab,var(--tray-tone,var(--muted-foreground)),var(--foreground)_20%)] [&_svg]:size-3.5",
|
|
3324
|
+
children: icon
|
|
3325
|
+
}) : null,
|
|
3326
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3327
|
+
className: "min-w-0 flex-1 text-pretty",
|
|
3328
|
+
children
|
|
3329
|
+
}),
|
|
3330
|
+
actions ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3331
|
+
className: "flex shrink-0 items-center gap-1",
|
|
3332
|
+
children: actions
|
|
3333
|
+
}) : null
|
|
3334
|
+
]
|
|
3335
|
+
});
|
|
3336
|
+
}
|
|
3337
|
+
|
|
3338
|
+
//#endregion
|
|
3339
|
+
//#region src/components/ai/usage-notice.tsx
|
|
3340
|
+
/** Tray tone for a budget share: calm below 75%, warning to 90%, danger beyond. */
|
|
3341
|
+
function usageTone(percent) {
|
|
3342
|
+
if (percent >= 90) return "danger";
|
|
3343
|
+
if (percent >= 75) return "warning";
|
|
3344
|
+
return "info";
|
|
3345
|
+
}
|
|
3346
|
+
const linkClass = "rounded-sm font-medium text-link underline-offset-2 outline-none hover:underline focus-visible:ring-[3px] focus-visible:ring-ring/50";
|
|
3347
|
+
/**
|
|
3348
|
+
* Plan-budget line for the header of a `PromptInputTray`:
|
|
3349
|
+
*
|
|
3350
|
+
* ```tsx
|
|
3351
|
+
* <PromptInputTray tone={usageTone(80)} header={<UsageNotice percent={80} onDismiss={dismiss} />}>
|
|
3352
|
+
* <PromptInput … />
|
|
3353
|
+
* </PromptInputTray>
|
|
3354
|
+
* ```
|
|
3355
|
+
*/
|
|
3356
|
+
function UsageNotice({ percent, message, actionLabel = "View usage", actionHref, onAction, onDismiss, ...props }) {
|
|
3357
|
+
const tone = usageTone(percent);
|
|
3358
|
+
const action = actionHref ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
3359
|
+
className: linkClass,
|
|
3360
|
+
href: actionHref,
|
|
3361
|
+
onClick: onAction,
|
|
3362
|
+
children: actionLabel
|
|
3363
|
+
}) : onAction ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3364
|
+
type: "button",
|
|
3365
|
+
className: require_utils.cn(linkClass, "cursor-pointer"),
|
|
3366
|
+
onClick: onAction,
|
|
3367
|
+
children: actionLabel
|
|
3368
|
+
}) : null;
|
|
3369
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PromptInputTrayRow, {
|
|
3370
|
+
"data-slot": "usage-notice",
|
|
3371
|
+
"data-tone": tone,
|
|
3372
|
+
icon: tone === "info" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Gauge, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.TriangleAlert, {}),
|
|
3373
|
+
actions: onDismiss ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3374
|
+
type: "button",
|
|
3375
|
+
"aria-label": "Dismiss",
|
|
3376
|
+
onClick: onDismiss,
|
|
3377
|
+
className: "relative grid size-6 shrink-0 cursor-pointer place-items-center rounded-md text-muted-foreground outline-none before:absolute before:-inset-2 hover:bg-overlay-hover hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 pointer-coarse:before:-inset-2.5",
|
|
3378
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, {
|
|
3379
|
+
"aria-hidden": "true",
|
|
3380
|
+
className: "size-3.5"
|
|
3381
|
+
})
|
|
3382
|
+
}) : null,
|
|
3383
|
+
...props,
|
|
3384
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", { children: [message ?? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
3385
|
+
"You've used ",
|
|
3386
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3387
|
+
className: "tabular-nums",
|
|
3388
|
+
children: [Math.round(percent), "%"]
|
|
3389
|
+
}),
|
|
3390
|
+
" of your tokens."
|
|
3391
|
+
] }), action ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [" ", action] }) : null] })
|
|
3392
|
+
});
|
|
3393
|
+
}
|
|
3394
|
+
|
|
3395
|
+
//#endregion
|
|
3396
|
+
//#region src/components/ai/model-selector.tsx
|
|
3397
|
+
const TAG_LABEL = {
|
|
3398
|
+
new: "New",
|
|
3399
|
+
free: "Free",
|
|
3400
|
+
beta: "Beta",
|
|
3401
|
+
preview: "Preview",
|
|
3402
|
+
deprecated: "Deprecated"
|
|
3403
|
+
};
|
|
3404
|
+
function levelOf(model, levelId) {
|
|
3405
|
+
return model.levels?.find((level) => level.id === levelId) ?? model.levels?.find((level) => level.id === model.defaultLevel) ?? model.levels?.[0];
|
|
3406
|
+
}
|
|
3407
|
+
function pricingOf(model, level) {
|
|
3408
|
+
return level?.pricing ?? model.pricing;
|
|
3409
|
+
}
|
|
3410
|
+
function formatPrice(amount, currency = "USD") {
|
|
3411
|
+
return new Intl.NumberFormat("en-US", {
|
|
3412
|
+
style: "currency",
|
|
3413
|
+
currency,
|
|
3414
|
+
minimumFractionDigits: Number.isInteger(amount) ? 0 : 2,
|
|
3415
|
+
maximumFractionDigits: amount > 0 && amount < 1 ? 3 : 2
|
|
3416
|
+
}).format(amount);
|
|
3417
|
+
}
|
|
3418
|
+
function formatTokens(tokens) {
|
|
3419
|
+
return formatCompact(tokens);
|
|
3420
|
+
}
|
|
3421
|
+
/** Blended cost used to rank models on the meter: output weighted 3:1, as in typical chat traffic. */
|
|
3422
|
+
function blendedCost(pricing) {
|
|
3423
|
+
return pricing ? (pricing.input + pricing.output * 3) / 4 : 0;
|
|
3424
|
+
}
|
|
3425
|
+
function isFree(pricing) {
|
|
3426
|
+
return pricing !== void 0 && pricing.input === 0 && pricing.output === 0;
|
|
3427
|
+
}
|
|
3428
|
+
/** Number of blocks in the cost indicator. */
|
|
3429
|
+
const COST_TIERS = 4;
|
|
3430
|
+
/** Maps a log-scaled cost share (0-1) to 1-4 blocks. Free models get 0. */
|
|
3431
|
+
function costTier(share, free) {
|
|
3432
|
+
if (free) return 0;
|
|
3433
|
+
return Math.min(COST_TIERS, Math.max(1, Math.ceil(share * COST_TIERS)));
|
|
3434
|
+
}
|
|
3435
|
+
/**
|
|
3436
|
+
* Relative cost as a row of building blocks: one to four filled, stepping up in height like a stack being built.
|
|
3437
|
+
* Discrete tiers read faster than a continuous bar, and the muted fill keeps the list calm while scanning.
|
|
3438
|
+
*/
|
|
3439
|
+
function CostBlocks({ tier }) {
|
|
3440
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3441
|
+
role: "img",
|
|
3442
|
+
"aria-label": `Cost tier ${tier} of ${COST_TIERS}`,
|
|
3443
|
+
className: "flex h-2.5 shrink-0 items-end gap-0.5",
|
|
3444
|
+
children: Array.from({ length: COST_TIERS }, (_, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3445
|
+
"aria-hidden": "true",
|
|
3446
|
+
className: require_utils.cn("w-[3px] rounded-[1px]", index < tier ? "bg-muted-foreground" : "bg-[color-mix(in_oklab,currentColor_14%,transparent)]"),
|
|
3447
|
+
style: { height: `${4 + index * 2}px` }
|
|
3448
|
+
}, index))
|
|
3449
|
+
});
|
|
3450
|
+
}
|
|
3451
|
+
function PriceText({ pricing }) {
|
|
3452
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3453
|
+
className: "text-[0.6875rem] text-muted-foreground tabular-nums",
|
|
3454
|
+
children: [
|
|
3455
|
+
formatPrice(pricing.input, pricing.currency),
|
|
3456
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3457
|
+
className: "text-subtle-foreground",
|
|
3458
|
+
children: " / "
|
|
3459
|
+
}),
|
|
3460
|
+
formatPrice(pricing.output, pricing.currency)
|
|
3461
|
+
]
|
|
3462
|
+
});
|
|
3463
|
+
}
|
|
3464
|
+
/** Tags shown on a model row before the rest collapse into a count. */
|
|
3465
|
+
const MAX_ROW_TAGS = 2;
|
|
3466
|
+
function Tag({ tag }) {
|
|
3467
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3468
|
+
className: require_utils.cn("shrink-0 text-[0.6875rem] font-medium", tag === "new" ? "text-link" : tag === "deprecated" ? "text-subtle-foreground line-through" : "text-muted-foreground"),
|
|
3469
|
+
children: TAG_LABEL[tag]
|
|
3470
|
+
});
|
|
3471
|
+
}
|
|
3472
|
+
function ModelGlyph({ model }) {
|
|
3473
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkTile, {
|
|
3474
|
+
className: "text-foreground",
|
|
3475
|
+
children: model.icon ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3476
|
+
className: "font-semibold",
|
|
3477
|
+
children: model.provider.charAt(0)
|
|
3478
|
+
})
|
|
3479
|
+
});
|
|
3480
|
+
}
|
|
3481
|
+
/**
|
|
3482
|
+
* A model's reasoning levels as compact radio rows. The description of the level under the pointer (or the chosen
|
|
3483
|
+
* one) shows once below them, in a slot sized to the longest so the card holds still while moving through them.
|
|
3484
|
+
*/
|
|
3485
|
+
function LevelMenu({ model, levelId, onPick }) {
|
|
3486
|
+
const [peek, setPeek] = react.useState();
|
|
3487
|
+
const levels = model.levels ?? [];
|
|
3488
|
+
const shown = peek ?? levelId;
|
|
3489
|
+
const described = levels.some((level) => level.description);
|
|
3490
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
3491
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
3492
|
+
className: "flex h-6 items-center justify-between gap-2 px-2 text-[0.6875rem] text-subtle-foreground",
|
|
3493
|
+
children: ["Reasoning", levels.length > 1 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3494
|
+
"aria-hidden": "true",
|
|
3495
|
+
className: "hidden items-center gap-0.5 pointer-fine:flex",
|
|
3496
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_kbd.Kbd, {
|
|
3497
|
+
className: "h-4 min-w-4 text-[0.625rem]",
|
|
3498
|
+
children: "←"
|
|
3499
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_kbd.Kbd, {
|
|
3500
|
+
className: "h-4 min-w-4 text-[0.625rem]",
|
|
3501
|
+
children: "→"
|
|
3502
|
+
})]
|
|
3503
|
+
}) : null]
|
|
3504
|
+
}),
|
|
3505
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3506
|
+
role: "radiogroup",
|
|
3507
|
+
"aria-label": `${model.name} reasoning level`,
|
|
3508
|
+
onPointerLeave: () => setPeek(void 0),
|
|
3509
|
+
className: "flex flex-col",
|
|
3510
|
+
children: levels.map((level) => {
|
|
3511
|
+
const checked = level.id === levelId;
|
|
3512
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
3513
|
+
type: "button",
|
|
3514
|
+
role: "radio",
|
|
3515
|
+
"aria-checked": checked,
|
|
3516
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
3517
|
+
onPointerEnter: () => setPeek(level.id),
|
|
3518
|
+
onFocus: () => setPeek(level.id),
|
|
3519
|
+
onBlur: () => setPeek(void 0),
|
|
3520
|
+
onClick: () => onPick(level.id),
|
|
3521
|
+
className: require_utils.cn("flex h-7 w-full cursor-pointer items-center gap-2 rounded-sm px-2 text-start text-[0.8125rem] outline-none pointer-coarse:h-11", "hover:bg-overlay-hover focus-visible:ring-[3px] focus-visible:ring-ring/50", checked ? "font-medium text-foreground" : "text-foreground/80"),
|
|
3522
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3523
|
+
className: "min-w-0 flex-1 truncate",
|
|
3524
|
+
children: level.label
|
|
3525
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, {
|
|
3526
|
+
"aria-hidden": "true",
|
|
3527
|
+
className: require_utils.cn("size-3.5 shrink-0", checked ? "opacity-100" : "opacity-0")
|
|
3528
|
+
})]
|
|
3529
|
+
}, level.id);
|
|
3530
|
+
})
|
|
3531
|
+
}),
|
|
3532
|
+
described ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3533
|
+
className: "grid px-2 pt-1 pb-1.5 text-[0.6875rem] leading-4 text-pretty text-muted-foreground",
|
|
3534
|
+
children: levels.map((level) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3535
|
+
"aria-hidden": level.id !== shown,
|
|
3536
|
+
className: require_utils.cn("[grid-area:1/1]", level.id === shown ? "visible" : "invisible"),
|
|
3537
|
+
children: level.description
|
|
3538
|
+
}, level.id))
|
|
3539
|
+
}) : null
|
|
3540
|
+
] });
|
|
3541
|
+
}
|
|
3542
|
+
/**
|
|
3543
|
+
* The side card for the active model: what it is, its reasoning levels, and its prices. It opens beside the list like
|
|
3544
|
+
* a submenu, so the list never changes size while moving through it.
|
|
3545
|
+
*/
|
|
3546
|
+
function ModelDetails({ model, levelId, onPickLevel }) {
|
|
3547
|
+
const level = levelOf(model, levelId);
|
|
3548
|
+
const pricing = pricingOf(model, level);
|
|
3549
|
+
const free = isFree(pricing);
|
|
3550
|
+
const price = (amount) => free ? "Free" : amount === void 0 || !pricing ? "—" : formatPrice(amount, pricing.currency);
|
|
3551
|
+
const facts = [
|
|
3552
|
+
{
|
|
3553
|
+
label: "Input /1M",
|
|
3554
|
+
value: price(pricing?.input)
|
|
3555
|
+
},
|
|
3556
|
+
{
|
|
3557
|
+
label: "Output /1M",
|
|
3558
|
+
value: price(pricing?.output)
|
|
3559
|
+
},
|
|
3560
|
+
{
|
|
3561
|
+
label: "Cached /1M",
|
|
3562
|
+
value: free ? "Free" : price(pricing?.cachedInput)
|
|
3563
|
+
},
|
|
3564
|
+
{
|
|
3565
|
+
label: "Context",
|
|
3566
|
+
value: model.contextWindow ? formatTokens(model.contextWindow) : "—"
|
|
3567
|
+
}
|
|
3568
|
+
];
|
|
3569
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
3570
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3571
|
+
className: "px-2 pt-1.5 pb-2",
|
|
3572
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3573
|
+
dir: "auto",
|
|
3574
|
+
title: model.name,
|
|
3575
|
+
className: "truncate text-[0.8125rem] font-medium text-foreground",
|
|
3576
|
+
children: model.name
|
|
3577
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3578
|
+
className: "line-clamp-2 text-[0.6875rem] leading-4 text-pretty text-muted-foreground",
|
|
3579
|
+
children: model.description ?? model.provider
|
|
3580
|
+
})]
|
|
3581
|
+
}),
|
|
3582
|
+
model.levels?.length ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LevelMenu, {
|
|
3583
|
+
model,
|
|
3584
|
+
levelId: level?.id,
|
|
3585
|
+
onPick: onPickLevel
|
|
3586
|
+
}) : null,
|
|
3587
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3588
|
+
"aria-hidden": "true",
|
|
3589
|
+
className: "mx-2 h-px bg-border/70"
|
|
3590
|
+
}),
|
|
3591
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dl", {
|
|
3592
|
+
className: "grid grid-cols-2 gap-x-3 gap-y-1.5 px-2 pt-2 pb-1.5",
|
|
3593
|
+
children: facts.map((fact) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3594
|
+
className: "min-w-0",
|
|
3595
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
|
|
3596
|
+
className: "truncate text-[0.6875rem] leading-4 text-subtle-foreground",
|
|
3597
|
+
children: fact.label
|
|
3598
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
|
|
3599
|
+
className: "truncate text-xs leading-4 text-foreground tabular-nums",
|
|
3600
|
+
children: fact.value
|
|
3601
|
+
})]
|
|
3602
|
+
}, fact.label))
|
|
3603
|
+
})
|
|
3604
|
+
] });
|
|
3605
|
+
}
|
|
3606
|
+
/** Whether `point` lies inside the triangle `a b c` (sign test). */
|
|
3607
|
+
function inTriangle(point, a, b, c) {
|
|
3608
|
+
const side = (p, q, r) => (p.x - r.x) * (q.y - r.y) - (q.x - r.x) * (p.y - r.y);
|
|
3609
|
+
const d1 = side(point, a, b);
|
|
3610
|
+
const d2 = side(point, b, c);
|
|
3611
|
+
const d3 = side(point, c, a);
|
|
3612
|
+
return !((d1 < 0 || d2 < 0 || d3 < 0) && (d1 > 0 || d2 > 0 || d3 > 0));
|
|
3613
|
+
}
|
|
3614
|
+
/** One shared empty list, so leaving the section props out doesn't rebuild the sections on every render. */
|
|
3615
|
+
const NO_IDS = [];
|
|
3616
|
+
/** How long a row crossed on the way to the side card waits before taking it over. */
|
|
3617
|
+
const PANEL_INTENT_MS = 240;
|
|
3618
|
+
/**
|
|
3619
|
+
* Model picker for composers: searchable list with pinned routers, recent and
|
|
3620
|
+
* recommended sections, per-provider groups, reasoning levels, relative cost
|
|
3621
|
+
* or per-million pricing, tags, and a side card for the highlighted model
|
|
3622
|
+
* with its reasoning levels.
|
|
3623
|
+
* Controlled: the host owns the selection and persists recents.
|
|
3624
|
+
*/
|
|
3625
|
+
function ModelSelector({ models, value, onValueChange, pinnedIds = NO_IDS, recentIds = NO_IDS, recommendedIds = NO_IDS, priceDisplay: priceDisplayProp = "meter", allowPriceToggle, disabled, align = "start", side = "top", triggerClassName, levelClassName, contentClassName, label = "Model" }) {
|
|
3626
|
+
const [open, setOpen] = react.useState(false);
|
|
3627
|
+
const [query, setQuery] = react.useState("");
|
|
3628
|
+
const [highlighted, setHighlighted] = react.useState("");
|
|
3629
|
+
const [pendingLevels, setPendingLevels] = react.useState({});
|
|
3630
|
+
const [priceDisplay, setPriceDisplay] = react.useState(priceDisplayProp);
|
|
3631
|
+
/** The row the side card shows. Follows the highlight, except while the pointer heads for the card. */
|
|
3632
|
+
const [active, setActive] = react.useState("");
|
|
3633
|
+
const [panel, setPanel] = react.useState({
|
|
3634
|
+
top: 0,
|
|
3635
|
+
side: "right"
|
|
3636
|
+
});
|
|
3637
|
+
/** The list's height when filtering starts, held so a short result list doesn't move the search field. */
|
|
3638
|
+
const [listHeight, setListHeight] = react.useState();
|
|
3639
|
+
const contentRef = react.useRef(null);
|
|
3640
|
+
const listRef = react.useRef(null);
|
|
3641
|
+
const panelRef = react.useRef(null);
|
|
3642
|
+
const trail = react.useRef([]);
|
|
3643
|
+
const intentTimer = react.useRef(void 0);
|
|
3644
|
+
const byId = react.useMemo(() => new Map(models.map((model) => [model.id, model])), [models]);
|
|
3645
|
+
const selected = byId.get(value.modelId);
|
|
3646
|
+
const selectedLevel = selected ? levelOf(selected, value.levelId) : void 0;
|
|
3647
|
+
const hasPricing = models.some((model) => model.pricing || model.levels?.some((level) => level.pricing));
|
|
3648
|
+
const canTogglePrice = (allowPriceToggle ?? hasPricing) && priceDisplayProp !== "none";
|
|
3649
|
+
const maxCost = react.useMemo(() => Math.max(0, ...models.map((model) => blendedCost(pricingOf(model, levelOf(model, void 0))))), [models]);
|
|
3650
|
+
const sections = react.useMemo(() => {
|
|
3651
|
+
const pick = (ids) => ids.map((id) => byId.get(id)).filter((model) => Boolean(model));
|
|
3652
|
+
const providers = /* @__PURE__ */ new Map();
|
|
3653
|
+
for (const model of [...models].sort((a, b) => Number(Boolean(a.disabled)) - Number(Boolean(b.disabled)))) {
|
|
3654
|
+
if (pinnedIds.includes(model.id)) continue;
|
|
3655
|
+
const group = providers.get(model.provider);
|
|
3656
|
+
if (group) group.push(model);
|
|
3657
|
+
else providers.set(model.provider, [model]);
|
|
3658
|
+
}
|
|
3659
|
+
const browsing = [
|
|
3660
|
+
{
|
|
3661
|
+
id: "pinned",
|
|
3662
|
+
label: void 0,
|
|
3663
|
+
items: pick(pinnedIds)
|
|
3664
|
+
},
|
|
3665
|
+
{
|
|
3666
|
+
id: "recent",
|
|
3667
|
+
label: "Recently used",
|
|
3668
|
+
items: pick(recentIds)
|
|
3669
|
+
},
|
|
3670
|
+
{
|
|
3671
|
+
id: "recommended",
|
|
3672
|
+
label: "Recommended",
|
|
3673
|
+
items: pick(recommendedIds)
|
|
3674
|
+
}
|
|
3675
|
+
];
|
|
3676
|
+
const all = [...providers].map(([provider, items]) => ({
|
|
3677
|
+
id: `provider:${provider}`,
|
|
3678
|
+
label: provider,
|
|
3679
|
+
items
|
|
3680
|
+
}));
|
|
3681
|
+
return {
|
|
3682
|
+
browsing: browsing.filter((section) => section.items.length > 0),
|
|
3683
|
+
all
|
|
3684
|
+
};
|
|
3685
|
+
}, [
|
|
3686
|
+
byId,
|
|
3687
|
+
models,
|
|
3688
|
+
pinnedIds,
|
|
3689
|
+
recentIds,
|
|
3690
|
+
recommendedIds
|
|
3691
|
+
]);
|
|
3692
|
+
const levelFor = (model) => pendingLevels[model.id] ?? (model.id === value.modelId ? value.levelId : void 0) ?? levelOf(model, void 0)?.id;
|
|
3693
|
+
const choose = (model, levelId = levelFor(model)) => {
|
|
3694
|
+
if (model.disabled) return;
|
|
3695
|
+
onValueChange({
|
|
3696
|
+
modelId: model.id,
|
|
3697
|
+
levelId
|
|
3698
|
+
});
|
|
3699
|
+
setOpen(false);
|
|
3700
|
+
};
|
|
3701
|
+
const highlightedModel = byId.get(highlighted.split("::")[1] ?? "");
|
|
3702
|
+
/** Falls back to the selection so the card is present from the first frame. */
|
|
3703
|
+
const detailModel = byId.get(active.split("::")[1] ?? "") ?? selected;
|
|
3704
|
+
/** The pointer is moving toward the side card through the rows between (the submenu "safe triangle"). */
|
|
3705
|
+
const headingToPanel = () => {
|
|
3706
|
+
const card = panelRef.current?.getBoundingClientRect();
|
|
3707
|
+
const from = trail.current[0];
|
|
3708
|
+
const to = trail.current[trail.current.length - 1];
|
|
3709
|
+
if (!card || !from || !to || panel.side === "below") return false;
|
|
3710
|
+
const edge = panel.side === "right" ? card.left : card.right;
|
|
3711
|
+
return (panel.side === "right" ? to.x > from.x : to.x < from.x) && inTriangle(to, from, {
|
|
3712
|
+
x: edge,
|
|
3713
|
+
y: card.top - 8
|
|
3714
|
+
}, {
|
|
3715
|
+
x: edge,
|
|
3716
|
+
y: card.bottom + 8
|
|
3717
|
+
});
|
|
3718
|
+
};
|
|
3719
|
+
react.useEffect(() => {
|
|
3720
|
+
if (!open) return;
|
|
3721
|
+
if (headingToPanel()) intentTimer.current = window.setTimeout(() => setActive(highlighted), PANEL_INTENT_MS);
|
|
3722
|
+
else setActive(highlighted);
|
|
3723
|
+
return () => window.clearTimeout(intentTimer.current);
|
|
3724
|
+
}, [highlighted, open]);
|
|
3725
|
+
/** Lines the card up with its row, clamped to the list, on whichever side has room. */
|
|
3726
|
+
const placePanel = react.useCallback(() => {
|
|
3727
|
+
const content = contentRef.current;
|
|
3728
|
+
const card = panelRef.current;
|
|
3729
|
+
if (!content || !card) return;
|
|
3730
|
+
if (window.innerWidth < 640) {
|
|
3731
|
+
setPanel((current) => current.side === "below" ? current : {
|
|
3732
|
+
top: 0,
|
|
3733
|
+
side: "below"
|
|
3734
|
+
});
|
|
3735
|
+
return;
|
|
3736
|
+
}
|
|
3737
|
+
const box = content.getBoundingClientRect();
|
|
3738
|
+
const rows = Array.from(content.querySelectorAll("[data-model-value]"));
|
|
3739
|
+
const row = rows.find((element) => element.dataset.modelValue === active) ?? rows.find((element) => element.dataset.modelValue?.endsWith(`::${value.modelId}`));
|
|
3740
|
+
const rowTop = row ? require_fluid_highlight.unscaledRect(row, content, box).top - 4 : 0;
|
|
3741
|
+
const top = Math.round(Math.min(Math.max(8 - box.top, rowTop), window.innerHeight - box.top - card.offsetHeight - 8));
|
|
3742
|
+
const side = box.right + card.offsetWidth + 8 > window.innerWidth ? "left" : "right";
|
|
3743
|
+
setPanel((current) => current.top === top && current.side === side ? current : {
|
|
3744
|
+
top,
|
|
3745
|
+
side
|
|
3746
|
+
});
|
|
3747
|
+
}, [active, value.modelId]);
|
|
3748
|
+
react.useLayoutEffect(() => {
|
|
3749
|
+
if (!open) return;
|
|
3750
|
+
placePanel();
|
|
3751
|
+
let frame = requestAnimationFrame(() => {
|
|
3752
|
+
frame = requestAnimationFrame(placePanel);
|
|
3753
|
+
});
|
|
3754
|
+
return () => cancelAnimationFrame(frame);
|
|
3755
|
+
}, [
|
|
3756
|
+
open,
|
|
3757
|
+
placePanel,
|
|
3758
|
+
detailModel
|
|
3759
|
+
]);
|
|
3760
|
+
const onKeyDown = (event) => {
|
|
3761
|
+
window.clearTimeout(intentTimer.current);
|
|
3762
|
+
trail.current = [];
|
|
3763
|
+
if (query || !highlightedModel?.levels?.length || event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
|
|
3764
|
+
event.preventDefault();
|
|
3765
|
+
const levels = highlightedModel.levels;
|
|
3766
|
+
const index = levels.findIndex((level) => level.id === levelFor(highlightedModel));
|
|
3767
|
+
const next = levels[Math.min(levels.length - 1, Math.max(0, index + (event.key === "ArrowRight" ? 1 : -1)))];
|
|
3768
|
+
if (next) setPendingLevels((current) => ({
|
|
3769
|
+
...current,
|
|
3770
|
+
[highlightedModel.id]: next.id
|
|
3771
|
+
}));
|
|
3772
|
+
};
|
|
3773
|
+
/** Right-aligned column with a fixed minimum width, so prices, blocks, and checks line up down the list. */
|
|
3774
|
+
const trailing = (model, pricing) => {
|
|
3775
|
+
if (model.disabled && model.disabledReason) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3776
|
+
title: model.disabledReason,
|
|
3777
|
+
className: "truncate text-[0.6875rem] text-muted-foreground",
|
|
3778
|
+
children: model.disabledReason
|
|
3779
|
+
});
|
|
3780
|
+
if (priceDisplay === "none" || !pricing) return null;
|
|
3781
|
+
if (isFree(pricing)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3782
|
+
className: "text-[0.6875rem] font-medium text-muted-foreground",
|
|
3783
|
+
children: "Free"
|
|
3784
|
+
});
|
|
3785
|
+
if (priceDisplay === "price") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PriceText, { pricing });
|
|
3786
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CostBlocks, { tier: costTier(maxCost > 0 ? Math.log1p(blendedCost(pricing)) / Math.log1p(maxCost) : 0, false) });
|
|
3787
|
+
};
|
|
3788
|
+
const renderItem = (model, section) => {
|
|
3789
|
+
const level = levelOf(model, levelFor(model));
|
|
3790
|
+
const pricing = pricingOf(model, level);
|
|
3791
|
+
const tags = model.tags?.filter((tag) => !(tag === "free" && isFree(pricing) && priceDisplay !== "none"));
|
|
3792
|
+
const current = model.id === value.modelId;
|
|
3793
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_command.CommandItem, {
|
|
3794
|
+
value: `${section}::${model.id}`,
|
|
3795
|
+
"data-model-value": `${section}::${model.id}`,
|
|
3796
|
+
keywords: [
|
|
3797
|
+
model.name,
|
|
3798
|
+
model.provider,
|
|
3799
|
+
...model.levels?.map((entry) => entry.label) ?? [],
|
|
3800
|
+
...model.tags ?? []
|
|
3801
|
+
],
|
|
3802
|
+
disabled: model.disabled,
|
|
3803
|
+
onSelect: () => choose(model),
|
|
3804
|
+
className: "h-7.5 gap-2 rounded-sm px-2 py-0 pointer-coarse:h-11",
|
|
3805
|
+
children: [
|
|
3806
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelGlyph, { model }),
|
|
3807
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3808
|
+
className: "flex min-w-0 flex-1 items-baseline gap-1.5",
|
|
3809
|
+
children: [
|
|
3810
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3811
|
+
dir: "auto",
|
|
3812
|
+
title: model.name,
|
|
3813
|
+
className: "min-w-0 truncate text-[0.8125rem] font-medium text-foreground",
|
|
3814
|
+
children: model.name
|
|
3815
|
+
}),
|
|
3816
|
+
level ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3817
|
+
title: level.label,
|
|
3818
|
+
className: "min-w-0 shrink-[8] truncate text-[0.6875rem] text-muted-foreground",
|
|
3819
|
+
children: level.label
|
|
3820
|
+
}) : null,
|
|
3821
|
+
tags?.slice(0, MAX_ROW_TAGS).map((tag) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tag, { tag }, tag)),
|
|
3822
|
+
tags && tags.length > MAX_ROW_TAGS ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3823
|
+
title: tags.slice(MAX_ROW_TAGS).map((tag) => TAG_LABEL[tag]).join(", "),
|
|
3824
|
+
className: "shrink-0 text-[0.6875rem] text-muted-foreground tabular-nums",
|
|
3825
|
+
children: ["+", tags.length - MAX_ROW_TAGS]
|
|
3826
|
+
}) : null
|
|
3827
|
+
]
|
|
3828
|
+
}),
|
|
3829
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3830
|
+
className: "flex min-w-10 shrink-0 justify-end text-muted-foreground",
|
|
3831
|
+
children: trailing(model, pricing)
|
|
3832
|
+
}),
|
|
3833
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, {
|
|
3834
|
+
"aria-hidden": "true",
|
|
3835
|
+
className: require_utils.cn("size-3.5 shrink-0 text-foreground", current ? "opacity-100" : "opacity-0")
|
|
3836
|
+
})
|
|
3837
|
+
]
|
|
3838
|
+
}, `${section}::${model.id}`);
|
|
3839
|
+
};
|
|
3840
|
+
const visible = query ? sections.all : [...sections.browsing, ...sections.all];
|
|
3841
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_popover.Popover, {
|
|
3842
|
+
open,
|
|
3843
|
+
onOpenChange: (next) => {
|
|
3844
|
+
setOpen(next);
|
|
3845
|
+
if (next) {
|
|
3846
|
+
setQuery("");
|
|
3847
|
+
setListHeight(void 0);
|
|
3848
|
+
setPendingLevels({});
|
|
3849
|
+
const home = [...sections.browsing, ...sections.all].find((section) => section.items.some((model) => model.id === value.modelId));
|
|
3850
|
+
if (home) setHighlighted(`${home.id}::${value.modelId}`);
|
|
3851
|
+
}
|
|
3852
|
+
},
|
|
3853
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_popover.PopoverTrigger, {
|
|
3854
|
+
"aria-label": selected ? `${label}: ${selected.name}${selectedLevel ? `, ${selectedLevel.label}` : ""}` : label,
|
|
3855
|
+
disabled,
|
|
3856
|
+
onClick: (event) => event.stopPropagation(),
|
|
3857
|
+
className: require_utils.cn("relative flex h-7 max-w-full min-w-0 cursor-pointer items-center gap-1.5 rounded-md px-1.5 text-xs font-medium text-foreground/85 outline-none", "hover:bg-overlay-hover hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 data-popup-open:bg-overlay-hover data-popup-open:text-foreground", "before:absolute before:inset-x-0 before:-inset-y-1.5", "transition-transform duration-(--duration-fast) motion-safe:active:scale-[0.96] disabled:cursor-not-allowed disabled:opacity-64", triggerClassName),
|
|
3858
|
+
children: [
|
|
3859
|
+
selected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelGlyph, { model: selected }) : null,
|
|
3860
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3861
|
+
dir: "auto",
|
|
3862
|
+
title: selected?.name ?? "Choose a model",
|
|
3863
|
+
className: "truncate",
|
|
3864
|
+
children: selected?.name ?? "Choose a model"
|
|
3865
|
+
}),
|
|
3866
|
+
selectedLevel ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3867
|
+
title: selectedLevel.label,
|
|
3868
|
+
className: require_utils.cn("truncate font-normal text-muted-foreground", levelClassName),
|
|
3869
|
+
children: selectedLevel.label
|
|
3870
|
+
}) : null,
|
|
3871
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, {
|
|
3872
|
+
"aria-hidden": "true",
|
|
3873
|
+
className: "size-3 shrink-0 text-muted-foreground"
|
|
3874
|
+
})
|
|
3875
|
+
]
|
|
3876
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_popover.PopoverContent, {
|
|
3877
|
+
side,
|
|
3878
|
+
align,
|
|
3879
|
+
className: require_utils.cn(require_components_popover.popoverSurfaceClass, "relative w-[min(17rem,calc(100vw-1.5rem))] p-0 max-sm:overflow-y-auto sm:overflow-visible", contentClassName),
|
|
3880
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3881
|
+
ref: contentRef,
|
|
3882
|
+
onPointerMove: (event) => {
|
|
3883
|
+
trail.current = [...trail.current.slice(-3), {
|
|
3884
|
+
x: event.clientX,
|
|
3885
|
+
y: event.clientY
|
|
3886
|
+
}];
|
|
3887
|
+
},
|
|
3888
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_command.Command, {
|
|
3889
|
+
value: highlighted,
|
|
3890
|
+
onValueChange: setHighlighted,
|
|
3891
|
+
onKeyDown,
|
|
3892
|
+
loop: true,
|
|
3893
|
+
className: "rounded-[inherit]",
|
|
3894
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3895
|
+
className: "mx-1 flex items-center gap-1 border-b border-border/70 py-1 *:data-[slot=command-input-wrapper]:min-w-0 *:data-[slot=command-input-wrapper]:flex-1 *:data-[slot=command-input-wrapper]:p-0",
|
|
3896
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_command.CommandInput, {
|
|
3897
|
+
value: query,
|
|
3898
|
+
onValueChange: (next) => {
|
|
3899
|
+
if (next && !query && listRef.current) setListHeight(listRef.current.offsetHeight);
|
|
3900
|
+
if (!next) setListHeight(void 0);
|
|
3901
|
+
setQuery(next);
|
|
3902
|
+
},
|
|
3903
|
+
placeholder: "Search models",
|
|
3904
|
+
className: "gap-2 px-2 [&_input]:h-7 [&_input]:text-[0.8125rem] [&_svg]:size-3.5"
|
|
3905
|
+
}), canTogglePrice ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_tooltip.Tooltip, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_tooltip.TooltipTrigger, { render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3906
|
+
type: "button",
|
|
3907
|
+
"aria-label": "Show prices per million tokens",
|
|
3908
|
+
"aria-pressed": priceDisplay === "price",
|
|
3909
|
+
onClick: () => setPriceDisplay((current) => current === "price" ? "meter" : "price"),
|
|
3910
|
+
className: require_utils.cn("grid size-6 shrink-0 cursor-pointer place-items-center rounded-sm outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50", priceDisplay === "price" ? "bg-overlay-hover text-foreground" : "text-muted-foreground hover:bg-overlay-hover hover:text-foreground"),
|
|
3911
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CircleDollarSign, {
|
|
3912
|
+
"aria-hidden": "true",
|
|
3913
|
+
className: "size-3.5"
|
|
3914
|
+
})
|
|
3915
|
+
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_tooltip.TooltipContent, { children: priceDisplay === "price" ? "Show relative cost" : "Show prices per 1M tokens" })] }) : null]
|
|
3916
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_command.CommandList, {
|
|
3917
|
+
ref: listRef,
|
|
3918
|
+
density: "compact",
|
|
3919
|
+
style: listHeight ? { height: listHeight } : void 0,
|
|
3920
|
+
className: "max-h-[min(20rem,50vh)]",
|
|
3921
|
+
onScroll: placePanel,
|
|
3922
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_command.CommandEmpty, {
|
|
3923
|
+
className: "py-6 text-center text-[0.8125rem] text-muted-foreground",
|
|
3924
|
+
children: "No models matched"
|
|
3925
|
+
}), visible.map((section) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_command.CommandGroup, {
|
|
3926
|
+
heading: section.label,
|
|
3927
|
+
children: section.items.map((model) => renderItem(model, section.id))
|
|
3928
|
+
}, section.id))]
|
|
3929
|
+
})]
|
|
3930
|
+
})
|
|
3931
|
+
}), detailModel ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3932
|
+
ref: panelRef,
|
|
3933
|
+
"data-slot": "model-selector-details",
|
|
3934
|
+
onPointerEnter: () => {
|
|
3935
|
+
window.clearTimeout(intentTimer.current);
|
|
3936
|
+
if (active && active !== highlighted) setHighlighted(active);
|
|
3937
|
+
},
|
|
3938
|
+
style: panel.side === "below" ? void 0 : { top: panel.top },
|
|
3939
|
+
className: require_utils.cn("p-1", panel.side === "below" ? "mx-1 border-t border-border/70 px-0" : require_utils.cn(require_components_popover.popoverSurfaceClass, "absolute w-56", panel.side === "right" ? "left-full ml-1.5" : "right-full mr-1.5")),
|
|
3940
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelDetails, {
|
|
3941
|
+
model: detailModel,
|
|
3942
|
+
levelId: levelFor(detailModel),
|
|
3943
|
+
onPickLevel: (levelId) => {
|
|
3944
|
+
setPendingLevels((current) => ({
|
|
3945
|
+
...current,
|
|
3946
|
+
[detailModel.id]: levelId
|
|
3947
|
+
}));
|
|
3948
|
+
choose(detailModel, levelId);
|
|
3949
|
+
}
|
|
3950
|
+
})
|
|
3951
|
+
}) : null]
|
|
3952
|
+
})]
|
|
3953
|
+
});
|
|
3954
|
+
}
|
|
3955
|
+
|
|
3956
|
+
//#endregion
|
|
3957
|
+
//#region src/components/ai/prompt-input-attachment.tsx
|
|
3958
|
+
/**
|
|
3959
|
+
* Staged file chip shown inside a composer before sending: thumbnail or icon,
|
|
3960
|
+
* name, meta, upload state, and remove.
|
|
3961
|
+
*/
|
|
3962
|
+
function PromptInputAttachment({ name, meta, previewUrl, icon, status = "ready", onRemove, className, ...props }) {
|
|
3963
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3964
|
+
"data-slot": "prompt-input-attachment",
|
|
3965
|
+
"data-status": status,
|
|
3966
|
+
className: require_utils.cn("relative flex h-10 max-w-56 min-w-0 items-center gap-2 rounded-lg bg-muted/70 pe-1.5 ps-1 text-start dark:bg-muted", status === "error" && "bg-destructive/8 dark:bg-destructive/16", className),
|
|
3967
|
+
...props,
|
|
3968
|
+
children: [
|
|
3969
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkTile, {
|
|
3970
|
+
size: "md",
|
|
3971
|
+
className: require_utils.cn("rounded-md", status === "error" && "text-destructive"),
|
|
3972
|
+
children: status === "uploading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_spinner.Spinner, {
|
|
3973
|
+
"aria-hidden": "true",
|
|
3974
|
+
role: void 0,
|
|
3975
|
+
className: "size-4",
|
|
3976
|
+
strokeWidth: 1.5
|
|
3977
|
+
}) : status === "error" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CircleAlert, {}) : previewUrl ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
3978
|
+
src: previewUrl,
|
|
3979
|
+
alt: "",
|
|
3980
|
+
className: "size-full object-cover"
|
|
3981
|
+
}) : icon ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.FileText, {})
|
|
3982
|
+
}),
|
|
3983
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3984
|
+
className: "min-w-0 flex-1 leading-tight",
|
|
3985
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3986
|
+
title: name,
|
|
3987
|
+
className: "truncate text-[0.8125rem] text-foreground",
|
|
3988
|
+
children: name
|
|
3989
|
+
}), meta ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3990
|
+
className: require_utils.cn("truncate text-xs", status === "error" ? "text-destructive" : "text-muted-foreground"),
|
|
3991
|
+
children: meta
|
|
3992
|
+
}) : null]
|
|
3993
|
+
}),
|
|
3994
|
+
status === "uploading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3995
|
+
className: "sr-only",
|
|
3996
|
+
children: "Uploading"
|
|
3997
|
+
}) : null,
|
|
3998
|
+
onRemove ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3999
|
+
type: "button",
|
|
4000
|
+
"aria-label": `Remove ${name}`,
|
|
4001
|
+
onClick: onRemove,
|
|
4002
|
+
className: "relative grid size-5 shrink-0 cursor-pointer place-items-center rounded-full text-muted-foreground outline-none before:absolute before:-inset-2 hover:bg-overlay-active hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 pointer-coarse:before:-inset-3",
|
|
4003
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, {
|
|
4004
|
+
"aria-hidden": "true",
|
|
4005
|
+
className: "size-3"
|
|
4006
|
+
})
|
|
4007
|
+
}) : null
|
|
4008
|
+
]
|
|
4009
|
+
});
|
|
4010
|
+
}
|
|
4011
|
+
/** Wrapping row of attachment chips, placed above the textarea. */
|
|
4012
|
+
function PromptInputAttachments({ className, ...props }) {
|
|
4013
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4014
|
+
role: "group",
|
|
4015
|
+
"aria-label": "Attachments",
|
|
4016
|
+
"data-slot": "prompt-input-attachments",
|
|
4017
|
+
className: require_utils.cn("flex flex-wrap gap-1.5 px-1 pt-0.5 pb-1 [&>*]:shrink-0", className),
|
|
4018
|
+
...props
|
|
4019
|
+
});
|
|
4020
|
+
}
|
|
4021
|
+
|
|
4022
|
+
//#endregion
|
|
4023
|
+
//#region src/components/ai/ask-card.tsx
|
|
4024
|
+
function QuestionHeading({ id, icon, children }) {
|
|
4025
|
+
const glyph = icon === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CircleHelp, {}) : icon;
|
|
4026
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4027
|
+
className: "flex items-start gap-2",
|
|
4028
|
+
children: [glyph ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4029
|
+
"aria-hidden": "true",
|
|
4030
|
+
className: "flex h-5 shrink-0 items-center text-muted-foreground [&_svg]:size-4",
|
|
4031
|
+
children: glyph
|
|
4032
|
+
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4033
|
+
id,
|
|
4034
|
+
className: "min-w-0 text-pretty text-sm font-medium text-foreground [overflow-wrap:anywhere]",
|
|
4035
|
+
children
|
|
4036
|
+
})]
|
|
4037
|
+
});
|
|
4038
|
+
}
|
|
4039
|
+
/** Radio dot: a ring at rest, a filled disc with a pip once chosen. */
|
|
4040
|
+
function RadioMark({ checked }) {
|
|
4041
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4042
|
+
"aria-hidden": "true",
|
|
4043
|
+
className: require_utils.cn("mt-0.5 grid size-4 shrink-0 place-items-center rounded-full border", checked ? "border-primary bg-primary" : "border-subtle-foreground/50"),
|
|
4044
|
+
children: checked ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: require_utils.cn("size-1.5 rounded-full bg-primary-foreground", iconEnterClass) }) : null
|
|
4045
|
+
});
|
|
4046
|
+
}
|
|
4047
|
+
function AskQuestionField({ question, choice, onChoose, otherLabel, icon, disabled }) {
|
|
4048
|
+
const headingId = react.useId();
|
|
4049
|
+
const otherValue = choice && "other" in choice ? choice.other : "";
|
|
4050
|
+
const rowClass = "-mx-1.5 flex min-h-8 items-start gap-2.5 rounded-md px-1.5 py-1.5 text-start text-sm outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50";
|
|
4051
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4052
|
+
className: "flex flex-col gap-2",
|
|
4053
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(QuestionHeading, {
|
|
4054
|
+
id: headingId,
|
|
4055
|
+
icon,
|
|
4056
|
+
children: question.question
|
|
4057
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4058
|
+
role: "radiogroup",
|
|
4059
|
+
"aria-labelledby": headingId,
|
|
4060
|
+
className: "flex flex-col gap-0.5",
|
|
4061
|
+
children: [question.options.map((option) => {
|
|
4062
|
+
const checked = Boolean(choice && "option" in choice && choice.option === option.id);
|
|
4063
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
4064
|
+
type: "button",
|
|
4065
|
+
role: "radio",
|
|
4066
|
+
"aria-checked": checked,
|
|
4067
|
+
disabled,
|
|
4068
|
+
onClick: () => onChoose({ option: option.id }),
|
|
4069
|
+
className: require_utils.cn(rowClass, "cursor-pointer hover:bg-overlay-hover disabled:cursor-not-allowed disabled:opacity-64", checked ? "bg-overlay-hover text-foreground" : "text-muted-foreground hover:text-foreground"),
|
|
4070
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RadioMark, { checked }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4071
|
+
className: "min-w-0 flex-1 [overflow-wrap:anywhere]",
|
|
4072
|
+
children: option.label
|
|
4073
|
+
})]
|
|
4074
|
+
}, option.id);
|
|
4075
|
+
}), question.allowOther !== false ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
4076
|
+
className: require_utils.cn(rowClass, "cursor-text focus-within:bg-overlay-hover", otherValue && "bg-overlay-hover"),
|
|
4077
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RadioMark, { checked: Boolean(otherValue) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
4078
|
+
type: "text",
|
|
4079
|
+
value: otherValue,
|
|
4080
|
+
disabled,
|
|
4081
|
+
placeholder: `${otherLabel}…`,
|
|
4082
|
+
"aria-label": otherLabel,
|
|
4083
|
+
onChange: (event) => onChoose(event.target.value ? { other: event.target.value } : void 0),
|
|
4084
|
+
className: "min-w-0 flex-1 bg-transparent text-sm text-foreground outline-none placeholder:text-subtle-foreground pointer-coarse:text-base"
|
|
4085
|
+
})]
|
|
4086
|
+
}) : null]
|
|
4087
|
+
})]
|
|
4088
|
+
});
|
|
4089
|
+
}
|
|
4090
|
+
function AnswerChip({ children, muted }) {
|
|
4091
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4092
|
+
className: require_utils.cn("inline-flex h-6 max-w-full items-center gap-1.5 rounded-md border border-border bg-muted px-1.5 text-[0.8125rem]", muted ? "text-muted-foreground" : "text-foreground"),
|
|
4093
|
+
children: [muted ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CircleCheck, {
|
|
4094
|
+
"aria-hidden": "true",
|
|
4095
|
+
className: require_utils.cn("size-3.5 shrink-0 fill-primary text-primary-foreground", iconEnterClass)
|
|
4096
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4097
|
+
title: typeof children === "string" ? children : void 0,
|
|
4098
|
+
className: "truncate",
|
|
4099
|
+
children
|
|
4100
|
+
})]
|
|
4101
|
+
});
|
|
4102
|
+
}
|
|
4103
|
+
/**
|
|
4104
|
+
* Inline clarifying questions from an agent, one at a time. Each question
|
|
4105
|
+
* offers its options as radio rows plus a free-text row; Continue moves to the
|
|
4106
|
+
* next question and submits after the last. The card settles into a one-line
|
|
4107
|
+
* summary per question once answered or skipped.
|
|
4108
|
+
*/
|
|
4109
|
+
function AskCard({ questions, answer, onSubmit, onSkip, continueLabel = "Continue", skipLabel = "Skip", otherLabel = "Something else", eyebrow, icon, disabled, className, ...props }) {
|
|
4110
|
+
const [choices, setChoices] = react.useState({});
|
|
4111
|
+
const [page, setPage] = react.useState(0);
|
|
4112
|
+
const answered = (question) => {
|
|
4113
|
+
const choice = question ? choices[question.id] : void 0;
|
|
4114
|
+
return Boolean(choice && ("option" in choice || choice.other.trim().length > 0));
|
|
4115
|
+
};
|
|
4116
|
+
const complete = questions.every(answered);
|
|
4117
|
+
const current = questions[Math.min(page, questions.length - 1)];
|
|
4118
|
+
const last = page >= questions.length - 1;
|
|
4119
|
+
const paged = questions.length > 1;
|
|
4120
|
+
if (answer) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4121
|
+
"data-slot": "ask-card",
|
|
4122
|
+
"data-state": "answered",
|
|
4123
|
+
className: require_utils.cn("flex animate-[ai-fade-up_var(--duration-slow)_var(--ease-out)_both] flex-col gap-1 motion-reduce:animate-none", className),
|
|
4124
|
+
...props,
|
|
4125
|
+
children: questions.map((question) => {
|
|
4126
|
+
const choice = "choices" in answer ? answer.choices[question.id] : void 0;
|
|
4127
|
+
const label = choice ? "option" in choice ? question.options.find((option) => option.id === choice.option)?.label : `“${choice.other}”` : void 0;
|
|
4128
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4129
|
+
className: "flex items-start gap-2",
|
|
4130
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CircleHelp, {
|
|
4131
|
+
"aria-hidden": "true",
|
|
4132
|
+
className: "mt-0.5 size-4 shrink-0 text-muted-foreground"
|
|
4133
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4134
|
+
className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",
|
|
4135
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4136
|
+
className: "min-w-0 text-pretty text-sm text-foreground [overflow-wrap:anywhere]",
|
|
4137
|
+
children: question.question
|
|
4138
|
+
}), label ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AnswerChip, { children: label }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AnswerChip, {
|
|
4139
|
+
muted: true,
|
|
4140
|
+
children: "Skipped"
|
|
4141
|
+
})]
|
|
4142
|
+
})]
|
|
4143
|
+
}, question.id);
|
|
4144
|
+
})
|
|
4145
|
+
});
|
|
4146
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4147
|
+
"data-slot": "ask-card",
|
|
4148
|
+
"data-state": "open",
|
|
4149
|
+
className: require_utils.cn("flex animate-[ai-fade-up_var(--duration-slow)_var(--ease-out)_both] flex-col gap-3 rounded-xl bg-card p-3 shadow-card motion-reduce:animate-none", className),
|
|
4150
|
+
...props,
|
|
4151
|
+
children: [
|
|
4152
|
+
eyebrow ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4153
|
+
className: "-mb-1 flex min-h-4 items-center gap-1.5 text-xs text-muted-foreground [&_svg]:size-3.5 [&_svg]:shrink-0",
|
|
4154
|
+
children: eyebrow
|
|
4155
|
+
}) : null,
|
|
4156
|
+
current ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4157
|
+
className: "animate-[ai-fade-up_var(--duration-slow)_var(--ease-out)_both] motion-reduce:animate-none",
|
|
4158
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AskQuestionField, {
|
|
4159
|
+
question: current,
|
|
4160
|
+
choice: choices[current.id],
|
|
4161
|
+
disabled,
|
|
4162
|
+
otherLabel,
|
|
4163
|
+
icon,
|
|
4164
|
+
onChoose: (choice) => setChoices((value) => {
|
|
4165
|
+
const next = { ...value };
|
|
4166
|
+
if (choice) next[current.id] = choice;
|
|
4167
|
+
else delete next[current.id];
|
|
4168
|
+
return next;
|
|
4169
|
+
})
|
|
4170
|
+
})
|
|
4171
|
+
}, current.id) : null,
|
|
4172
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4173
|
+
className: "flex flex-wrap items-center gap-2",
|
|
4174
|
+
children: [paged ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4175
|
+
className: "-ms-1 flex items-center text-xs text-muted-foreground tabular-nums",
|
|
4176
|
+
children: [
|
|
4177
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_button.Button, {
|
|
4178
|
+
size: "icon-xs",
|
|
4179
|
+
variant: "ghost",
|
|
4180
|
+
"aria-label": "Previous question",
|
|
4181
|
+
disabled: page === 0,
|
|
4182
|
+
onClick: () => setPage(page - 1),
|
|
4183
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronUp, { "aria-hidden": "true" })
|
|
4184
|
+
}),
|
|
4185
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4186
|
+
"aria-hidden": "true",
|
|
4187
|
+
children: [
|
|
4188
|
+
page + 1,
|
|
4189
|
+
"/",
|
|
4190
|
+
questions.length
|
|
4191
|
+
]
|
|
4192
|
+
}),
|
|
4193
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4194
|
+
className: "sr-only",
|
|
4195
|
+
children: [
|
|
4196
|
+
"Question ",
|
|
4197
|
+
page + 1,
|
|
4198
|
+
" of ",
|
|
4199
|
+
questions.length
|
|
4200
|
+
]
|
|
4201
|
+
}),
|
|
4202
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_button.Button, {
|
|
4203
|
+
size: "icon-xs",
|
|
4204
|
+
variant: "ghost",
|
|
4205
|
+
"aria-label": "Next question",
|
|
4206
|
+
disabled: last || !answered(current),
|
|
4207
|
+
onClick: () => setPage(page + 1),
|
|
4208
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, { "aria-hidden": "true" })
|
|
4209
|
+
})
|
|
4210
|
+
]
|
|
4211
|
+
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4212
|
+
className: "ms-auto flex flex-wrap items-center gap-1.5",
|
|
4213
|
+
children: [onSkip ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_button.Button, {
|
|
4214
|
+
size: "sm",
|
|
4215
|
+
variant: "secondary",
|
|
4216
|
+
disabled,
|
|
4217
|
+
onClick: onSkip,
|
|
4218
|
+
children: skipLabel
|
|
4219
|
+
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_button.Button, {
|
|
4220
|
+
size: "sm",
|
|
4221
|
+
disabled: disabled || (last ? !complete : !answered(current)),
|
|
4222
|
+
onClick: () => last ? onSubmit?.(choices) : setPage(page + 1),
|
|
4223
|
+
children: continueLabel
|
|
4224
|
+
})]
|
|
4225
|
+
})]
|
|
4226
|
+
})
|
|
4227
|
+
]
|
|
4228
|
+
});
|
|
4229
|
+
}
|
|
4230
|
+
|
|
4231
|
+
//#endregion
|
|
4232
|
+
//#region src/components/ai/connect-prompt.tsx
|
|
4233
|
+
/**
|
|
4234
|
+
* Inline request from an agent to connect a missing app before it continues.
|
|
4235
|
+
* Settles into a quiet "Connected" or "Skipped" chip.
|
|
4236
|
+
*/
|
|
4237
|
+
function ConnectPrompt({ icon, name, description, status = "idle", connectLabel = "Connect", skipLabel, onConnect, onSkip, className, ...props }) {
|
|
4238
|
+
const settled = status === "connected" || status === "skipped";
|
|
4239
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4240
|
+
"data-slot": "connect-prompt",
|
|
4241
|
+
"data-status": status,
|
|
4242
|
+
className: require_utils.cn("flex animate-[ai-fade-up_var(--duration-slow)_var(--ease-out)_both] flex-wrap items-center gap-x-3 gap-y-2 rounded-xl bg-card p-3 shadow-card motion-reduce:animate-none", className),
|
|
4243
|
+
...props,
|
|
4244
|
+
children: [
|
|
4245
|
+
icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkTile, {
|
|
4246
|
+
size: "md",
|
|
4247
|
+
className: "text-foreground",
|
|
4248
|
+
children: icon
|
|
4249
|
+
}) : null,
|
|
4250
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4251
|
+
className: "min-w-40 flex-1",
|
|
4252
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4253
|
+
title: typeof name === "string" ? name : void 0,
|
|
4254
|
+
className: "line-clamp-2 text-sm font-medium text-foreground [overflow-wrap:anywhere]",
|
|
4255
|
+
children: name
|
|
4256
|
+
}), description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4257
|
+
title: typeof description === "string" ? description : void 0,
|
|
4258
|
+
className: "line-clamp-2 text-[0.8125rem] text-muted-foreground [overflow-wrap:anywhere]",
|
|
4259
|
+
children: description
|
|
4260
|
+
}) : null]
|
|
4261
|
+
}),
|
|
4262
|
+
settled ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4263
|
+
className: "ms-auto inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md bg-muted px-2 text-[0.8125rem] text-foreground",
|
|
4264
|
+
children: [status === "connected" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, {
|
|
4265
|
+
"aria-hidden": "true",
|
|
4266
|
+
className: require_utils.cn("size-3.5", iconEnterClass)
|
|
4267
|
+
}) : null, status === "connected" ? "Connected" : "Skipped"]
|
|
4268
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4269
|
+
className: "ms-auto flex max-w-full flex-wrap items-center justify-end gap-2",
|
|
4270
|
+
children: [skipLabel && onSkip ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_button.Button, {
|
|
4271
|
+
size: "xs",
|
|
4272
|
+
variant: "outline",
|
|
4273
|
+
wrap: true,
|
|
4274
|
+
disabled: status === "connecting",
|
|
4275
|
+
onClick: onSkip,
|
|
4276
|
+
children: skipLabel
|
|
4277
|
+
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_button.Button, {
|
|
4278
|
+
size: "xs",
|
|
4279
|
+
wrap: true,
|
|
4280
|
+
disabled: status === "connecting",
|
|
4281
|
+
onClick: onConnect,
|
|
4282
|
+
children: connectLabel
|
|
4283
|
+
})]
|
|
4284
|
+
})
|
|
4285
|
+
]
|
|
4286
|
+
});
|
|
4287
|
+
}
|
|
4288
|
+
|
|
4289
|
+
//#endregion
|
|
4290
|
+
//#region src/components/ai/agent-draft-card.tsx
|
|
4291
|
+
/**
|
|
4292
|
+
* Proposed agent spec an assistant drafts in chat: schedule, tools, and the
|
|
4293
|
+
* ordered steps it will run. Nothing runs until the host handles an action.
|
|
4294
|
+
*/
|
|
4295
|
+
function AgentDraftCard({ name, badge = "Draft", schedule, tools = [], steps = [], actions = [], chosenActionId, onAction, defaultOpen = true, className, ...props }) {
|
|
4296
|
+
const chosen = actions.find((action) => action.id === chosenActionId);
|
|
4297
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4298
|
+
"data-slot": "agent-draft-card",
|
|
4299
|
+
className: require_utils.cn("animate-[ai-fade-up_var(--duration-slow)_var(--ease-out)_both] overflow-hidden rounded-xl bg-card shadow-card motion-reduce:animate-none", className),
|
|
4300
|
+
...props,
|
|
4301
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_collapsible.Collapsible, {
|
|
4302
|
+
defaultOpen,
|
|
4303
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4304
|
+
className: "flex h-10 items-center gap-2 px-2",
|
|
4305
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_collapsible.CollapsibleTrigger, {
|
|
4306
|
+
className: "group flex min-w-0 flex-1 cursor-pointer items-center justify-start gap-2 rounded-md font-normal py-1 text-start outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
4307
|
+
children: [
|
|
4308
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, {
|
|
4309
|
+
"aria-hidden": "true",
|
|
4310
|
+
className: "size-3.5 shrink-0 text-muted-foreground transition-transform duration-(--duration-moderate) ease-out group-data-panel-open:rotate-90 motion-reduce:transition-none rtl:-scale-x-100 rtl:group-data-panel-open:scale-x-100"
|
|
4311
|
+
}),
|
|
4312
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkTile, {
|
|
4313
|
+
className: "size-5 [&_svg:not([class*=size-])]:size-3",
|
|
4314
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Bot, {})
|
|
4315
|
+
}),
|
|
4316
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4317
|
+
title: typeof name === "string" ? name : void 0,
|
|
4318
|
+
className: "truncate font-mono text-[0.8125rem] text-foreground",
|
|
4319
|
+
children: name
|
|
4320
|
+
})
|
|
4321
|
+
]
|
|
4322
|
+
}), badge ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4323
|
+
className: "inline-flex h-5 shrink-0 items-center rounded-[5px] border border-border px-1.5 text-xs text-muted-foreground",
|
|
4324
|
+
children: badge
|
|
4325
|
+
}) : null]
|
|
4326
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_collapsible.CollapsibleContent, { children: [schedule || tools.length ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", {
|
|
4327
|
+
className: "grid grid-cols-[5.5rem_minmax(0,1fr)] gap-x-3 gap-y-2 border-t border-border px-4 py-3 text-[0.8125rem]",
|
|
4328
|
+
children: [schedule ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
|
|
4329
|
+
className: "text-muted-foreground",
|
|
4330
|
+
children: "Runs"
|
|
4331
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
|
|
4332
|
+
className: "min-w-0 text-foreground [overflow-wrap:anywhere]",
|
|
4333
|
+
children: schedule
|
|
4334
|
+
})] }) : null, tools.length ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
|
|
4335
|
+
className: "text-muted-foreground",
|
|
4336
|
+
children: "Tools"
|
|
4337
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", {
|
|
4338
|
+
className: "flex min-w-0 items-center gap-2 text-foreground",
|
|
4339
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4340
|
+
className: "flex -space-x-1",
|
|
4341
|
+
children: tools.map((tool) => tool.icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkTile, {
|
|
4342
|
+
className: "text-foreground ring-2 ring-card",
|
|
4343
|
+
children: tool.icon
|
|
4344
|
+
}, tool.id) : null)
|
|
4345
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4346
|
+
title: tools.map((tool) => tool.label).join(", "),
|
|
4347
|
+
className: "truncate",
|
|
4348
|
+
children: tools.map((tool) => tool.label).join(", ")
|
|
4349
|
+
})]
|
|
4350
|
+
})] }) : null]
|
|
4351
|
+
}) : null, steps.length ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ol", {
|
|
4352
|
+
className: "flex flex-col gap-1.5 border-t border-border px-4 py-3 text-[0.8125rem] text-muted-foreground",
|
|
4353
|
+
children: steps.map((step, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
4354
|
+
className: "flex gap-3",
|
|
4355
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4356
|
+
className: "w-3 shrink-0 text-end tabular-nums text-subtle-foreground",
|
|
4357
|
+
children: index + 1
|
|
4358
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4359
|
+
className: "min-w-0 text-pretty [overflow-wrap:anywhere]",
|
|
4360
|
+
children: step
|
|
4361
|
+
})]
|
|
4362
|
+
}, index))
|
|
4363
|
+
}) : null] })]
|
|
4364
|
+
}), actions.length ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4365
|
+
className: "flex flex-wrap items-center gap-2 border-t border-border p-2",
|
|
4366
|
+
children: chosen ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4367
|
+
className: "inline-flex min-h-7 max-w-full items-center gap-1.5 rounded-md bg-muted px-2 py-1 text-[0.8125rem] text-foreground [overflow-wrap:anywhere]",
|
|
4368
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, {
|
|
4369
|
+
"aria-hidden": "true",
|
|
4370
|
+
className: require_utils.cn("size-3.5 shrink-0", iconEnterClass)
|
|
4371
|
+
}), chosen.chosenLabel ?? chosen.label]
|
|
4372
|
+
}) : actions.map((action, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_button.Button, {
|
|
4373
|
+
size: "xs",
|
|
4374
|
+
wrap: true,
|
|
4375
|
+
variant: action.variant ?? (index === 0 ? "default" : "outline"),
|
|
4376
|
+
onClick: () => onAction?.(action.id),
|
|
4377
|
+
children: action.label
|
|
4378
|
+
}, action.id))
|
|
4379
|
+
}) : null]
|
|
4380
|
+
});
|
|
4381
|
+
}
|
|
4382
|
+
|
|
4383
|
+
//#endregion
|
|
4384
|
+
Object.defineProperty(exports, 'AgentDraftCard', {
|
|
4385
|
+
enumerable: true,
|
|
4386
|
+
get: function () {
|
|
4387
|
+
return AgentDraftCard;
|
|
4388
|
+
}
|
|
4389
|
+
});
|
|
2840
4390
|
Object.defineProperty(exports, 'AgentLoader', {
|
|
2841
4391
|
enumerable: true,
|
|
2842
4392
|
get: function () {
|
|
@@ -2855,6 +4405,12 @@ Object.defineProperty(exports, 'ApprovalCard', {
|
|
|
2855
4405
|
return ApprovalCard;
|
|
2856
4406
|
}
|
|
2857
4407
|
});
|
|
4408
|
+
Object.defineProperty(exports, 'AskCard', {
|
|
4409
|
+
enumerable: true,
|
|
4410
|
+
get: function () {
|
|
4411
|
+
return AskCard;
|
|
4412
|
+
}
|
|
4413
|
+
});
|
|
2858
4414
|
Object.defineProperty(exports, 'ChainOfThought', {
|
|
2859
4415
|
enumerable: true,
|
|
2860
4416
|
get: function () {
|
|
@@ -2885,6 +4441,12 @@ Object.defineProperty(exports, 'CodeBlock', {
|
|
|
2885
4441
|
return CodeBlock;
|
|
2886
4442
|
}
|
|
2887
4443
|
});
|
|
4444
|
+
Object.defineProperty(exports, 'ConnectPrompt', {
|
|
4445
|
+
enumerable: true,
|
|
4446
|
+
get: function () {
|
|
4447
|
+
return ConnectPrompt;
|
|
4448
|
+
}
|
|
4449
|
+
});
|
|
2888
4450
|
Object.defineProperty(exports, 'ContextCard', {
|
|
2889
4451
|
enumerable: true,
|
|
2890
4452
|
get: function () {
|
|
@@ -2903,6 +4465,12 @@ Object.defineProperty(exports, 'ContextRing', {
|
|
|
2903
4465
|
return ContextRing;
|
|
2904
4466
|
}
|
|
2905
4467
|
});
|
|
4468
|
+
Object.defineProperty(exports, 'CostBlocks', {
|
|
4469
|
+
enumerable: true,
|
|
4470
|
+
get: function () {
|
|
4471
|
+
return CostBlocks;
|
|
4472
|
+
}
|
|
4473
|
+
});
|
|
2906
4474
|
Object.defineProperty(exports, 'DiffTable', {
|
|
2907
4475
|
enumerable: true,
|
|
2908
4476
|
get: function () {
|
|
@@ -2933,6 +4501,12 @@ Object.defineProperty(exports, 'Loader', {
|
|
|
2933
4501
|
return Loader;
|
|
2934
4502
|
}
|
|
2935
4503
|
});
|
|
4504
|
+
Object.defineProperty(exports, 'MarkTile', {
|
|
4505
|
+
enumerable: true,
|
|
4506
|
+
get: function () {
|
|
4507
|
+
return MarkTile;
|
|
4508
|
+
}
|
|
4509
|
+
});
|
|
2936
4510
|
Object.defineProperty(exports, 'Markdown', {
|
|
2937
4511
|
enumerable: true,
|
|
2938
4512
|
get: function () {
|
|
@@ -2969,6 +4543,12 @@ Object.defineProperty(exports, 'MessageContent', {
|
|
|
2969
4543
|
return MessageContent;
|
|
2970
4544
|
}
|
|
2971
4545
|
});
|
|
4546
|
+
Object.defineProperty(exports, 'ModelSelector', {
|
|
4547
|
+
enumerable: true,
|
|
4548
|
+
get: function () {
|
|
4549
|
+
return ModelSelector;
|
|
4550
|
+
}
|
|
4551
|
+
});
|
|
2972
4552
|
Object.defineProperty(exports, 'PlanTracker', {
|
|
2973
4553
|
enumerable: true,
|
|
2974
4554
|
get: function () {
|
|
@@ -2993,6 +4573,18 @@ Object.defineProperty(exports, 'PromptInputActions', {
|
|
|
2993
4573
|
return PromptInputActions;
|
|
2994
4574
|
}
|
|
2995
4575
|
});
|
|
4576
|
+
Object.defineProperty(exports, 'PromptInputAttachment', {
|
|
4577
|
+
enumerable: true,
|
|
4578
|
+
get: function () {
|
|
4579
|
+
return PromptInputAttachment;
|
|
4580
|
+
}
|
|
4581
|
+
});
|
|
4582
|
+
Object.defineProperty(exports, 'PromptInputAttachments', {
|
|
4583
|
+
enumerable: true,
|
|
4584
|
+
get: function () {
|
|
4585
|
+
return PromptInputAttachments;
|
|
4586
|
+
}
|
|
4587
|
+
});
|
|
2996
4588
|
Object.defineProperty(exports, 'PromptInputBody', {
|
|
2997
4589
|
enumerable: true,
|
|
2998
4590
|
get: function () {
|
|
@@ -3005,6 +4597,18 @@ Object.defineProperty(exports, 'PromptInputTextarea', {
|
|
|
3005
4597
|
return PromptInputTextarea;
|
|
3006
4598
|
}
|
|
3007
4599
|
});
|
|
4600
|
+
Object.defineProperty(exports, 'PromptInputTray', {
|
|
4601
|
+
enumerable: true,
|
|
4602
|
+
get: function () {
|
|
4603
|
+
return PromptInputTray;
|
|
4604
|
+
}
|
|
4605
|
+
});
|
|
4606
|
+
Object.defineProperty(exports, 'PromptInputTrayRow', {
|
|
4607
|
+
enumerable: true,
|
|
4608
|
+
get: function () {
|
|
4609
|
+
return PromptInputTrayRow;
|
|
4610
|
+
}
|
|
4611
|
+
});
|
|
3008
4612
|
Object.defineProperty(exports, 'PromptSuggestion', {
|
|
3009
4613
|
enumerable: true,
|
|
3010
4614
|
get: function () {
|
|
@@ -3113,6 +4717,12 @@ Object.defineProperty(exports, 'ThinkingBar', {
|
|
|
3113
4717
|
return ThinkingBar;
|
|
3114
4718
|
}
|
|
3115
4719
|
});
|
|
4720
|
+
Object.defineProperty(exports, 'ThinkingStatus', {
|
|
4721
|
+
enumerable: true,
|
|
4722
|
+
get: function () {
|
|
4723
|
+
return ThinkingStatus;
|
|
4724
|
+
}
|
|
4725
|
+
});
|
|
3116
4726
|
Object.defineProperty(exports, 'ThinkingTrace', {
|
|
3117
4727
|
enumerable: true,
|
|
3118
4728
|
get: function () {
|
|
@@ -3131,6 +4741,18 @@ Object.defineProperty(exports, 'ToolGroup', {
|
|
|
3131
4741
|
return ToolGroup;
|
|
3132
4742
|
}
|
|
3133
4743
|
});
|
|
4744
|
+
Object.defineProperty(exports, 'ToolTrace', {
|
|
4745
|
+
enumerable: true,
|
|
4746
|
+
get: function () {
|
|
4747
|
+
return ToolTrace;
|
|
4748
|
+
}
|
|
4749
|
+
});
|
|
4750
|
+
Object.defineProperty(exports, 'UsageNotice', {
|
|
4751
|
+
enumerable: true,
|
|
4752
|
+
get: function () {
|
|
4753
|
+
return UsageNotice;
|
|
4754
|
+
}
|
|
4755
|
+
});
|
|
3134
4756
|
Object.defineProperty(exports, 'formatCompact', {
|
|
3135
4757
|
enumerable: true,
|
|
3136
4758
|
get: function () {
|
|
@@ -3143,6 +4765,18 @@ Object.defineProperty(exports, 'formatDuration', {
|
|
|
3143
4765
|
return formatDuration;
|
|
3144
4766
|
}
|
|
3145
4767
|
});
|
|
4768
|
+
Object.defineProperty(exports, 'formatElapsed', {
|
|
4769
|
+
enumerable: true,
|
|
4770
|
+
get: function () {
|
|
4771
|
+
return formatElapsed;
|
|
4772
|
+
}
|
|
4773
|
+
});
|
|
4774
|
+
Object.defineProperty(exports, 'iconEnterClass', {
|
|
4775
|
+
enumerable: true,
|
|
4776
|
+
get: function () {
|
|
4777
|
+
return iconEnterClass;
|
|
4778
|
+
}
|
|
4779
|
+
});
|
|
3146
4780
|
Object.defineProperty(exports, 'lineDiff', {
|
|
3147
4781
|
enumerable: true,
|
|
3148
4782
|
get: function () {
|
|
@@ -3161,6 +4795,12 @@ Object.defineProperty(exports, 'renderBasicMarkdown', {
|
|
|
3161
4795
|
return renderBasicMarkdown;
|
|
3162
4796
|
}
|
|
3163
4797
|
});
|
|
4798
|
+
Object.defineProperty(exports, 'usageTone', {
|
|
4799
|
+
enumerable: true,
|
|
4800
|
+
get: function () {
|
|
4801
|
+
return usageTone;
|
|
4802
|
+
}
|
|
4803
|
+
});
|
|
3164
4804
|
Object.defineProperty(exports, 'useChatContainer', {
|
|
3165
4805
|
enumerable: true,
|
|
3166
4806
|
get: function () {
|
|
@@ -3179,4 +4819,4 @@ Object.defineProperty(exports, 'useThrottledText', {
|
|
|
3179
4819
|
return useThrottledText;
|
|
3180
4820
|
}
|
|
3181
4821
|
});
|
|
3182
|
-
//# sourceMappingURL=ai-
|
|
4822
|
+
//# sourceMappingURL=ai-B08ufcbD.cjs.map
|