@krak-stack/registry 0.10.19 → 0.11.1
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/CHANGELOG.md +105 -0
- package/README.md +28 -7
- package/dist/components/agent/index.d.ts +454 -0
- package/dist/components/agent/react.d.ts +55 -0
- package/dist/components/agent/react.js +2594 -0
- package/dist/components/agent/schema.d.ts +55 -0
- package/dist/components/animated-list/classes.d.ts +9 -0
- package/dist/components/animated-list/html.d.ts +11 -0
- package/dist/components/animated-list/html.js +533 -0
- package/dist/components/animated-list/index.d.ts +205 -0
- package/dist/components/animated-list/react.d.ts +11 -0
- package/dist/components/animated-list/react.js +711 -0
- package/dist/components/animated-list/schema.d.ts +44 -0
- package/dist/components/animated-number/html.d.ts +19 -0
- package/dist/components/animated-number/html.js +101 -0
- package/dist/components/animated-number/index.d.ts +80 -0
- package/dist/components/{ui/animated-number.d.ts → animated-number/react.d.ts} +2 -7
- package/dist/components/animated-number/react.js +278 -0
- package/dist/components/animated-number/schema.d.ts +9 -0
- package/dist/components/app-brand/classes.d.ts +11 -0
- package/dist/components/app-brand/html.d.ts +26 -0
- package/dist/components/app-brand/html.js +78 -0
- package/dist/components/app-brand/react.d.ts +12 -0
- package/dist/components/app-brand/react.js +86 -0
- package/dist/components/app-brand/schema.d.ts +36 -0
- package/dist/components/app-switcher/classes.d.ts +15 -0
- package/dist/components/app-switcher/html.d.ts +72 -0
- package/dist/components/app-switcher/html.js +327 -0
- package/dist/components/app-switcher/index.d.ts +47 -0
- package/dist/components/app-switcher/react.d.ts +12 -0
- package/dist/components/{ui/app-switcher.js → app-switcher/react.js} +84 -15
- package/dist/components/app-switcher/schema.d.ts +39 -0
- package/dist/components/async-action-button/classes.d.ts +11 -0
- package/dist/components/async-action-button/html.d.ts +46 -0
- package/dist/components/async-action-button/html.js +266 -0
- package/dist/components/async-action-button/index.d.ts +73 -0
- package/dist/components/async-action-button/react.d.ts +10 -0
- package/dist/components/async-action-button/react.js +378 -0
- package/dist/components/async-action-button/schema.d.ts +28 -0
- package/dist/{services/events/client/audit-log-table.d.ts → components/audit-log-table/react.d.ts} +2 -2
- package/dist/{services/events/client/audit-log-table.js → components/audit-log-table/react.js} +2195 -918
- package/dist/components/auto-height/html.d.ts +8 -0
- package/dist/components/auto-height/html.js +81 -0
- package/dist/components/auto-height/index.d.ts +2 -0
- package/dist/components/{ui/auto-height.d.ts → auto-height/react.d.ts} +2 -4
- package/dist/components/auto-height/react.js +75 -0
- package/dist/components/auto-height/schema.d.ts +7 -0
- package/dist/components/bulk-list-input/classes.d.ts +7 -0
- package/dist/components/bulk-list-input/html.d.ts +41 -0
- package/dist/components/bulk-list-input/html.js +265 -0
- package/dist/components/bulk-list-input/index.d.ts +76 -0
- package/dist/components/bulk-list-input/react.d.ts +12 -0
- package/dist/components/{ui/bulk-list-input.js → bulk-list-input/react.js} +71 -4
- package/dist/components/bulk-list-input/schema.d.ts +33 -0
- package/dist/components/choice-cards/classes.d.ts +19 -0
- package/dist/components/choice-cards/html.d.ts +76 -0
- package/dist/components/choice-cards/html.js +237 -0
- package/dist/components/choice-cards/index.d.ts +1 -0
- package/dist/components/choice-cards/react.d.ts +21 -0
- package/dist/components/{ui/choice-cards.js → choice-cards/react.js} +29 -10
- package/dist/components/choice-cards/schema.d.ts +100 -0
- package/dist/components/code-block/classes.d.ts +13 -0
- package/dist/components/code-block/html.d.ts +21 -0
- package/dist/components/code-block/html.js +381 -0
- package/dist/components/code-block/index.d.ts +4 -0
- package/dist/components/code-block/react.d.ts +4 -0
- package/dist/components/code-block/react.js +493 -0
- package/dist/components/code-block/schema.d.ts +29 -0
- package/dist/components/color-input/classes.d.ts +9 -0
- package/dist/components/color-input/html.d.ts +48 -0
- package/dist/components/color-input/html.js +187 -0
- package/dist/components/color-input/index.d.ts +88 -0
- package/dist/components/color-input/react.d.ts +7 -0
- package/dist/components/{ui/color-picker.js → color-input/react.js} +165 -233
- package/dist/components/color-input/schema.d.ts +40 -0
- package/dist/components/copy-button/html.d.ts +48 -0
- package/dist/components/copy-button/html.js +266 -0
- package/dist/components/copy-button/index.d.ts +73 -0
- package/dist/components/copy-button/react.d.ts +12 -0
- package/dist/components/copy-button/react.js +388 -0
- package/dist/components/copy-button/schema.d.ts +37 -0
- package/dist/components/copy-value/html.d.ts +37 -0
- package/dist/components/copy-value/html.js +426 -0
- package/dist/components/copy-value/index.d.ts +57 -0
- package/dist/components/copy-value/react.d.ts +9 -0
- package/dist/components/copy-value/react.js +682 -0
- package/dist/components/copy-value/schema.d.ts +45 -0
- package/dist/components/cron-input/classes.d.ts +25 -0
- package/dist/components/cron-input/html.d.ts +36 -0
- package/dist/components/cron-input/html.js +204 -0
- package/dist/components/cron-input/index.d.ts +59 -0
- package/dist/components/cron-input/react.d.ts +7 -0
- package/dist/components/{ui/cron-expression-editor.js → cron-input/react.js} +126 -54
- package/dist/components/cron-input/schema.d.ts +24 -0
- package/dist/components/danger-confirmation/classes.d.ts +7 -0
- package/dist/components/danger-confirmation/html.d.ts +39 -0
- package/dist/components/danger-confirmation/html.js +227 -0
- package/dist/components/danger-confirmation/index.d.ts +113 -0
- package/dist/components/{ui/danger-confirmation.d.ts → danger-confirmation/react.d.ts} +3 -12
- package/dist/components/danger-confirmation/react.js +550 -0
- package/dist/components/danger-confirmation/schema.d.ts +34 -0
- package/dist/components/data-table/classes.d.ts +63 -0
- package/dist/components/data-table/html.d.ts +1938 -0
- package/dist/components/data-table/html.js +2682 -0
- package/dist/components/data-table/index.d.ts +2686 -0
- package/dist/components/data-table/react.d.ts +578 -0
- package/dist/components/{ui/data-table.js → data-table/react.js} +2189 -906
- package/dist/components/data-table/schema.d.ts +3012 -0
- package/dist/components/date-input/classes.d.ts +17 -0
- package/dist/components/date-input/html.d.ts +60 -0
- package/dist/components/date-input/html.js +418 -0
- package/dist/components/date-input/index.d.ts +91 -0
- package/dist/components/date-input/react.d.ts +10 -0
- package/dist/components/{ui/date-picker.js → date-input/react.js} +233 -79
- package/dist/components/date-input/schema.d.ts +41 -0
- package/dist/components/editable-text/classes.d.ts +17 -0
- package/dist/components/editable-text/html.d.ts +51 -0
- package/dist/components/editable-text/html.js +370 -0
- package/dist/components/editable-text/index.d.ts +143 -0
- package/dist/components/editable-text/react.d.ts +6 -0
- package/dist/components/editable-text/react.js +499 -0
- package/dist/components/editable-text/schema.d.ts +31 -0
- package/dist/components/editing-locale-switcher/classes.d.ts +7 -0
- package/dist/components/editing-locale-switcher/html.d.ts +27 -0
- package/dist/components/editing-locale-switcher/html.js +250 -0
- package/dist/components/editing-locale-switcher/index.d.ts +52 -0
- package/dist/components/editing-locale-switcher/react.d.ts +7 -0
- package/dist/components/{ui/editing-locale-switcher.js → editing-locale-switcher/react.js} +70 -17
- package/dist/components/editing-locale-switcher/schema.d.ts +16 -0
- package/dist/components/{ui/effect-form.d.ts → effect-form/react.d.ts} +2 -2
- package/dist/components/{ui/effect-form.js → effect-form/react.js} +309 -83
- package/dist/components/effectcn/alert-dialog.d.ts +13 -0
- package/dist/components/effectcn/button.d.ts +31 -0
- package/dist/components/effectcn/calendar.d.ts +12 -0
- package/dist/components/effectcn/checkbox.d.ts +10 -0
- package/dist/components/effectcn/combobox.d.ts +25 -0
- package/dist/components/effectcn/dialog.d.ts +19 -0
- package/dist/components/effectcn/field.d.ts +11 -0
- package/dist/components/effectcn/file-drop.d.ts +8 -0
- package/dist/components/effectcn/input.d.ts +26 -0
- package/dist/components/effectcn/menu.d.ts +85 -0
- package/dist/components/effectcn/menubar.d.ts +8 -0
- package/dist/components/effectcn/popover.d.ts +18 -0
- package/dist/components/effectcn/scroll-area.d.ts +12 -0
- package/dist/components/effectcn/select.d.ts +68 -0
- package/dist/components/effectcn/toast.d.ts +29 -0
- package/dist/components/email-composer/index.d.ts +229 -0
- package/dist/components/email-composer/labels.d.ts +12 -0
- package/dist/components/email-composer/react.d.ts +5 -0
- package/dist/components/email-composer/react.js +1354 -0
- package/dist/components/email-composer/schema.d.ts +42 -0
- package/dist/components/email-editor/classes.d.ts +21 -0
- package/dist/components/email-editor/html.d.ts +360 -0
- package/dist/components/email-editor/html.js +1706 -0
- package/dist/components/email-editor/index.d.ts +693 -0
- package/dist/components/{ui/email-editor.d.ts → email-editor/labels.d.ts} +1 -19
- package/dist/components/email-editor/legacy-editor.html.d.ts +160 -0
- package/dist/components/email-editor/react.d.ts +11 -0
- package/dist/components/{ui/email-editor.js → email-editor/react.js} +1057 -712
- package/dist/components/email-editor/schema.d.ts +162 -0
- package/dist/components/error-component/classes.d.ts +7 -0
- package/dist/components/error-component/html.d.ts +120 -0
- package/dist/components/error-component/html.js +346 -0
- package/dist/components/error-component/index.d.ts +69 -0
- package/dist/components/error-component/react.d.ts +8 -0
- package/dist/components/error-component/react.js +744 -0
- package/dist/components/error-component/schema.d.ts +56 -0
- package/dist/components/file-input/classes.d.ts +7 -0
- package/dist/components/file-input/html.d.ts +95 -0
- package/dist/components/file-input/html.js +368 -0
- package/dist/components/file-input/index.d.ts +99 -0
- package/dist/components/file-input/react.d.ts +11 -0
- package/dist/components/{ui/file-picker.js → file-input/react.js} +122 -19
- package/dist/components/file-input/schema.d.ts +37 -0
- package/dist/components/{ui/form.d.ts → form/react.d.ts} +4 -4
- package/dist/components/{ui/form.js → form/react.js} +314 -84
- package/dist/components/icon-input/html.d.ts +55 -0
- package/dist/components/icon-input/html.js +538 -0
- package/dist/components/icon-input/index.d.ts +143 -0
- package/dist/components/icon-input/react.d.ts +6 -0
- package/dist/components/{ui/icon-input.js → icon-input/react.js} +459 -89
- package/dist/components/icon-input/schema.d.ts +23 -0
- package/dist/components/image-crop-editor/classes.d.ts +19 -0
- package/dist/components/image-crop-editor/html.d.ts +66 -0
- package/dist/components/image-crop-editor/html.js +561 -0
- package/dist/components/image-crop-editor/index.d.ts +183 -0
- package/dist/components/image-crop-editor/react.d.ts +8 -0
- package/dist/components/image-crop-editor/react.js +802 -0
- package/dist/components/image-crop-editor/schema.d.ts +54 -0
- package/dist/components/krakstack-provider/html.d.ts +17 -0
- package/dist/components/krakstack-provider/html.js +37 -0
- package/dist/components/krakstack-provider/index.d.ts +7 -0
- package/dist/components/krakstack-provider/react.d.ts +8 -0
- package/dist/components/{ui/krakstack-provider.js → krakstack-provider/react.js} +14 -5
- package/dist/components/krakstack-provider/schema.d.ts +6 -0
- package/dist/components/loading/classes.d.ts +5 -0
- package/dist/components/loading/html.d.ts +18 -0
- package/dist/components/loading/html.js +166 -0
- package/dist/components/loading/index.d.ts +6 -0
- package/dist/components/loading/react.d.ts +4 -0
- package/dist/components/loading/react.js +51 -0
- package/dist/components/loading/schema.d.ts +23 -0
- package/dist/components/locale-switcher/html.d.ts +22 -0
- package/dist/components/locale-switcher/html.js +264 -0
- package/dist/components/locale-switcher/index.d.ts +50 -0
- package/dist/components/locale-switcher/react.d.ts +7 -0
- package/dist/components/{ui/locale-switcher.js → locale-switcher/react.js} +55 -22
- package/dist/components/locale-switcher/schema.d.ts +12 -0
- package/dist/components/map-menu/classes.d.ts +13 -0
- package/dist/components/map-menu/google-maps.d.ts +80 -0
- package/dist/components/map-menu/google-viewport.d.ts +7 -0
- package/dist/components/map-menu/html.d.ts +274 -0
- package/dist/components/map-menu/html.js +934 -0
- package/dist/components/map-menu/index.d.ts +246 -0
- package/dist/components/map-menu/map.d.ts +47 -0
- package/dist/components/map-menu/react.d.ts +40 -0
- package/dist/components/{ui/map-menu.js → map-menu/react.js} +502 -141
- package/dist/components/map-menu/schema.d.ts +132 -0
- package/dist/components/markdown/classes.d.ts +1 -0
- package/dist/components/markdown/html.d.ts +23 -0
- package/dist/components/markdown/html.js +510 -0
- package/dist/components/markdown/index.d.ts +6 -0
- package/dist/components/markdown/react.d.ts +3 -0
- package/dist/components/markdown/react.js +546 -0
- package/dist/components/markdown/schema.d.ts +20 -0
- package/dist/components/notification-menu/classes.d.ts +11 -0
- package/dist/components/notification-menu/html.d.ts +67 -0
- package/dist/components/notification-menu/html.js +425 -0
- package/dist/components/notification-menu/index.d.ts +132 -0
- package/dist/components/notification-menu/react.d.ts +57 -0
- package/dist/components/notification-menu/react.js +829 -0
- package/dist/components/notification-menu/schema.d.ts +59 -0
- package/dist/components/pagination/classes.d.ts +19 -0
- package/dist/components/pagination/html.d.ts +49 -0
- package/dist/components/pagination/html.js +387 -0
- package/dist/components/pagination/index.d.ts +109 -0
- package/dist/components/pagination/react.d.ts +9 -0
- package/dist/components/{ui/pagination.js → pagination/react.js} +130 -30
- package/dist/components/pagination/schema.d.ts +36 -0
- package/dist/components/phone-number-input/classes.d.ts +17 -0
- package/dist/components/phone-number-input/html.d.ts +52 -0
- package/dist/components/phone-number-input/html.js +655 -0
- package/dist/components/phone-number-input/index.d.ts +59 -0
- package/dist/components/phone-number-input/react.d.ts +11 -0
- package/dist/components/{ui/phone-number-input.js → phone-number-input/react.js} +368 -138
- package/dist/components/phone-number-input/schema.d.ts +31 -0
- package/dist/components/presence-transition/html.d.ts +13 -0
- package/dist/components/presence-transition/html.js +128 -0
- package/dist/components/presence-transition/index.d.ts +57 -0
- package/dist/components/{ui/presence-transition.d.ts → presence-transition/react.d.ts} +3 -5
- package/dist/components/presence-transition/react.js +293 -0
- package/dist/components/presence-transition/schema.d.ts +7 -0
- package/dist/components/registry-previews/component-example.d.ts +31 -0
- package/dist/components/registry-previews/component-example.js +679 -0
- package/dist/components/registry-previews/html-preview.d.ts +17 -0
- package/dist/components/registry-previews/html-preview.js +83 -0
- package/dist/components/rich-text-editor/classes.d.ts +15 -0
- package/dist/components/rich-text-editor/engine.d.ts +9 -0
- package/dist/components/rich-text-editor/html.d.ts +246 -0
- package/dist/components/rich-text-editor/html.js +830 -0
- package/dist/components/rich-text-editor/index.d.ts +453 -0
- package/dist/components/rich-text-editor/labels.d.ts +42 -0
- package/dist/components/rich-text-editor/react.d.ts +19 -0
- package/dist/components/rich-text-editor/react.js +1175 -0
- package/dist/components/rich-text-editor/schema.d.ts +116 -0
- package/dist/components/search-menu/classes.d.ts +9 -0
- package/dist/components/search-menu/html.d.ts +127 -0
- package/dist/components/search-menu/html.js +432 -0
- package/dist/components/search-menu/index.d.ts +85 -0
- package/dist/components/search-menu/react.d.ts +18 -0
- package/dist/components/{ui/search-menu.js → search-menu/react.js} +290 -31
- package/dist/components/search-menu/schema.d.ts +78 -0
- package/dist/components/select-with-custom-input/classes.d.ts +17 -0
- package/dist/components/select-with-custom-input/html.d.ts +60 -0
- package/dist/components/select-with-custom-input/html.js +238 -0
- package/dist/components/select-with-custom-input/index.d.ts +114 -0
- package/dist/components/select-with-custom-input/react.d.ts +7 -0
- package/dist/components/{ui/select-with-custom-input.js → select-with-custom-input/react.js} +134 -29
- package/dist/components/select-with-custom-input/schema.d.ts +54 -0
- package/dist/components/sidebar-layout/classes.d.ts +21 -0
- package/dist/components/sidebar-layout/html.d.ts +97 -0
- package/dist/components/sidebar-layout/html.js +361 -0
- package/dist/components/sidebar-layout/index.d.ts +57 -0
- package/dist/components/sidebar-layout/react.d.ts +30 -0
- package/dist/components/{ui/sidebar-layout.js → sidebar-layout/react.js} +353 -39
- package/dist/components/sidebar-layout/schema.d.ts +54 -0
- package/dist/components/stats-card/classes.d.ts +11 -0
- package/dist/components/stats-card/html.d.ts +15 -0
- package/dist/components/stats-card/html.js +55 -0
- package/dist/components/stats-card/react.d.ts +7 -0
- package/dist/components/{ui/stats-card.js → stats-card/react.js} +19 -15
- package/dist/components/stats-card/schema.d.ts +14 -0
- package/dist/components/stepper/classes.d.ts +39 -0
- package/dist/components/stepper/html.d.ts +107 -0
- package/dist/components/stepper/html.js +397 -0
- package/dist/components/stepper/index.d.ts +83 -0
- package/dist/components/stepper/react.d.ts +17 -0
- package/dist/components/{ui/stepper.js → stepper/react.js} +120 -21
- package/dist/components/stepper/schema.d.ts +52 -0
- package/dist/components/support/classes.d.ts +55 -0
- package/dist/components/support/form.d.ts +19 -0
- package/dist/components/support/html.d.ts +266 -0
- package/dist/components/support/html.js +604 -0
- package/dist/components/support/index.d.ts +226 -0
- package/dist/components/support/multipart.d.ts +21 -0
- package/dist/components/support/react.d.ts +54 -0
- package/dist/components/support/react.js +1252 -0
- package/dist/components/support/schema.d.ts +69 -0
- package/dist/components/support.d.ts +1 -66
- package/dist/components/theme-switcher/html.d.ts +28 -0
- package/dist/components/theme-switcher/html.js +288 -0
- package/dist/components/theme-switcher/index.d.ts +59 -0
- package/dist/components/{ui/theme-switcher.d.ts → theme-switcher/react.d.ts} +4 -12
- package/dist/components/{ui/theme-switcher.js → theme-switcher/react.js} +69 -35
- package/dist/components/theme-switcher/schema.d.ts +33 -0
- package/dist/components/time-input/classes.d.ts +23 -0
- package/dist/components/time-input/html.d.ts +75 -0
- package/dist/components/time-input/html.js +571 -0
- package/dist/components/time-input/index.d.ts +164 -0
- package/dist/components/time-input/react.d.ts +7 -0
- package/dist/components/{ui/time-picker.js → time-input/react.js} +286 -114
- package/dist/components/time-input/schema.d.ts +96 -0
- package/dist/components/timezone-input/classes.d.ts +13 -0
- package/dist/components/timezone-input/html.d.ts +58 -0
- package/dist/components/timezone-input/html.js +804 -0
- package/dist/components/timezone-input/index.d.ts +170 -0
- package/dist/components/timezone-input/react.d.ts +9 -0
- package/dist/components/{ui/timezone-select.js → timezone-input/react.js} +493 -106
- package/dist/components/timezone-input/schema.d.ts +43 -0
- package/dist/components/toast/classes.d.ts +7 -0
- package/dist/components/toast/html.d.ts +34 -0
- package/dist/components/toast/html.js +280 -0
- package/dist/components/toast/index.d.ts +10 -0
- package/dist/components/toast/react.d.ts +9 -0
- package/dist/components/{ui/toast.js → toast/react.js} +35 -15
- package/dist/components/toast/schema.d.ts +24 -0
- package/dist/{services/events/client/tracking-notice.d.ts → components/tracking-notice/react.d.ts} +7 -1
- package/dist/{services/events/client/tracking-notice.js → components/tracking-notice/react.js} +13 -7
- package/dist/components/ui/animated-list.d.ts +1 -21
- package/dist/components/ui/app-brand.d.ts +1 -33
- package/dist/components/ui/async-action-button.d.ts +1 -17
- package/dist/components/ui/code-block.d.ts +1 -14
- package/dist/components/ui/copy-button.d.ts +1 -21
- package/dist/components/ui/data-table.d.ts +1 -584
- package/dist/components/ui/krakstack-provider.d.ts +1 -9
- package/dist/components/ui/loading.d.ts +1 -13
- package/dist/components/ui/pagination.d.ts +1 -47
- package/dist/components/ui/rich-text-editor.d.ts +1 -70
- package/dist/components/ui/search-menu.d.ts +1 -36
- package/dist/components/ui/select.js +159 -0
- package/dist/components/ui/sidebar-layout.d.ts +1 -40
- package/dist/components/ui/virtualized-combobox.d.ts +1 -59
- package/dist/components/unsaved-changes-guard/html.d.ts +34 -0
- package/dist/components/unsaved-changes-guard/html.js +172 -0
- package/dist/components/unsaved-changes-guard/index.d.ts +56 -0
- package/dist/components/unsaved-changes-guard/react.d.ts +4 -0
- package/dist/components/{ui/unsaved-changes-guard.js → unsaved-changes-guard/react.js} +74 -11
- package/dist/components/unsaved-changes-guard/schema.d.ts +37 -0
- package/dist/components/upload-attachment/classes.d.ts +11 -0
- package/dist/components/upload-attachment/html.d.ts +84 -0
- package/dist/components/upload-attachment/html.js +312 -0
- package/dist/components/upload-attachment/index.d.ts +72 -0
- package/dist/components/upload-attachment/react.d.ts +9 -0
- package/dist/components/{ui/upload-attachment.js → upload-attachment/react.js} +114 -17
- package/dist/components/upload-attachment/schema.d.ts +53 -0
- package/dist/components/virtualized-combobox/classes.d.ts +7 -0
- package/dist/components/virtualized-combobox/html.d.ts +97 -0
- package/dist/components/virtualized-combobox/html.js +310 -0
- package/dist/components/virtualized-combobox/index.d.ts +182 -0
- package/dist/components/virtualized-combobox/react.d.ts +31 -0
- package/dist/components/{ui/virtualized-combobox.js → virtualized-combobox/react.js} +160 -40
- package/dist/components/virtualized-combobox/schema.d.ts +92 -0
- package/dist/components/webhook-delivery-table/html.d.ts +216 -0
- package/dist/components/webhook-delivery-table/html.js +3008 -0
- package/dist/components/webhook-delivery-table/index.d.ts +405 -0
- package/dist/components/webhook-delivery-table/react.d.ts +13 -0
- package/dist/{services/webhooks/client/delivery-table.js → components/webhook-delivery-table/react.js} +2475 -956
- package/dist/components/webhook-delivery-table/schema.d.ts +134 -0
- package/dist/lib/docs.d.ts +17 -1
- package/dist/lib/docs.integrations.server.js +358 -73
- package/dist/lib/docs.js +861 -293
- package/dist/lib/docs.server.js +342 -57
- package/dist/lib/documentation-toolkit.d.ts +4 -4
- package/dist/lib/documentation-toolkit.js +354 -69
- package/dist/lib/effect-ui-adapter/model-runtime.d.ts +17 -0
- package/dist/lib/effect-ui-adapter/use-model.d.ts +9 -0
- package/dist/lib/effectcn-form.d.ts +3 -0
- package/dist/lib/effectcn-form.js +54 -0
- package/dist/lib/email-composer/index.d.ts +12 -0
- package/dist/lib/email-composer/index.js +110 -0
- package/dist/lib/email-composer/schema.d.ts +14 -0
- package/dist/lib/email-composer/schema.js +13 -0
- package/dist/lib/email-document/legacy-rich-text/editor.d.ts +70 -0
- package/dist/lib/email-document/legacy-rich-text/model.d.ts +19 -0
- package/dist/lib/email-document/legacy-rich-text/schema.d.ts +65 -0
- package/dist/lib/email-document/legacy-rich-text/tiptap.d.ts +39 -0
- package/dist/lib/email-document/model.d.ts +1 -1
- package/dist/lib/email-document/model.js +2 -2
- package/dist/lib/email-document/render.js +2 -2
- package/dist/lib/email-document/schema.js +1 -1
- package/dist/lib/httpapi-toolkit.d.ts +1 -1
- package/dist/lib/lucide-effect.d.ts +39 -0
- package/dist/lib/markdown/content.d.ts +1 -12
- package/dist/lib/rich-text/model.d.ts +5 -19
- package/dist/lib/rich-text/model.js +79 -111
- package/dist/lib/rich-text/schema.d.ts +5 -55
- package/dist/lib/rich-text/schema.js +17 -36
- package/dist/lib/rich-text/tiptap.d.ts +12 -0
- package/dist/lib/webfetch-toolkit.d.ts +1 -1
- package/dist/services/agent/client/index.js +695 -179
- package/dist/services/agent/client/widget.d.ts +1 -55
- package/dist/services/notification/client/index.js +138 -27
- package/dist/services/notification/client/notification-menu.d.ts +1 -85
- package/dist/services/notification/public.js +138 -27
- package/dist/services/opentelemetry/browser.js +15 -9
- package/dist/services/webhooks/index.d.ts +4 -3
- package/package.json +199 -137
- package/dist/components/support-dialog.js +0 -881
- package/dist/components/support.js +0 -881
- package/dist/components/ui/animated-list.js +0 -414
- package/dist/components/ui/animated-number.js +0 -75
- package/dist/components/ui/app-brand.js +0 -126
- package/dist/components/ui/app-switcher.d.ts +0 -26
- package/dist/components/ui/async-action-button.js +0 -149
- package/dist/components/ui/auto-height.js +0 -86
- package/dist/components/ui/bulk-list-input.d.ts +0 -25
- package/dist/components/ui/choice-cards.d.ts +0 -33
- package/dist/components/ui/code-block.js +0 -221
- package/dist/components/ui/color-picker.d.ts +0 -31
- package/dist/components/ui/copy-button.js +0 -138
- package/dist/components/ui/copy-value.d.ts +0 -24
- package/dist/components/ui/copy-value.js +0 -352
- package/dist/components/ui/cron-expression-editor.d.ts +0 -16
- package/dist/components/ui/cron-expression-editor.schema.d.ts +0 -7
- package/dist/components/ui/danger-confirmation.js +0 -398
- package/dist/components/ui/date-picker.d.ts +0 -33
- package/dist/components/ui/date-picker.schema.d.ts +0 -9
- package/dist/components/ui/editable-text.d.ts +0 -19
- package/dist/components/ui/editable-text.js +0 -341
- package/dist/components/ui/editing-locale-switcher.d.ts +0 -11
- package/dist/components/ui/error-component.d.ts +0 -34
- package/dist/components/ui/error-component.js +0 -387
- package/dist/components/ui/file-picker.d.ts +0 -37
- package/dist/components/ui/icon-input.d.ts +0 -58
- package/dist/components/ui/image-crop-editor.d.ts +0 -41
- package/dist/components/ui/image-crop-editor.js +0 -417
- package/dist/components/ui/loading.js +0 -39
- package/dist/components/ui/locale-switcher.d.ts +0 -11
- package/dist/components/ui/map-menu-map.d.ts +0 -115
- package/dist/components/ui/map-menu.d.ts +0 -87
- package/dist/components/ui/phone-number-input.d.ts +0 -22
- package/dist/components/ui/phone-number-input.schema.d.ts +0 -7
- package/dist/components/ui/presence-transition.js +0 -94
- package/dist/components/ui/rich-text-editor.js +0 -1135
- package/dist/components/ui/select-with-custom-input.d.ts +0 -36
- package/dist/components/ui/stats-card.d.ts +0 -12
- package/dist/components/ui/stepper.d.ts +0 -37
- package/dist/components/ui/time-picker.d.ts +0 -50
- package/dist/components/ui/time-picker.schema.d.ts +0 -28
- package/dist/components/ui/timezone-select.d.ts +0 -57
- package/dist/components/ui/timezone-select.schema.d.ts +0 -9
- package/dist/components/ui/toast.d.ts +0 -18
- package/dist/components/ui/unsaved-changes-guard.d.ts +0 -16
- package/dist/components/ui/upload-attachment.d.ts +0 -39
- package/dist/lib/rich-text/dom.d.ts +0 -40
- package/dist/services/notification/persistence/drizzle.d.ts +0 -868
- package/dist/services/notification/persistence/drizzle.js +0 -214
- package/dist/services/notification/persistence/index.d.ts +0 -2
- package/dist/services/notification/persistence/index.js +0 -227
- package/dist/services/notification/persistence/schema.d.ts +0 -143
- package/dist/services/notification/persistence/schema.js +0 -118
- package/dist/services/webhooks/client/delivery-table.d.ts +0 -62
|
@@ -146,8 +146,8 @@ var makeAgentAtoms = ({
|
|
|
146
146
|
});
|
|
147
147
|
return { removeContext, reset, state, submit };
|
|
148
148
|
};
|
|
149
|
-
// ../../src/
|
|
150
|
-
import { useEffect as useEffect2, useId, useRef as
|
|
149
|
+
// ../../src/components/agent/react.tsx
|
|
150
|
+
import { useEffect as useEffect2, useId, useRef as useRef3, useState as useState3 } from "react";
|
|
151
151
|
import { Dialog as DialogPrimitive2 } from "@base-ui/react/dialog";
|
|
152
152
|
import {
|
|
153
153
|
ArrowDownIcon as ArrowDownIcon2,
|
|
@@ -210,20 +210,265 @@ function Button({
|
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
// ../../src/components/
|
|
213
|
+
// ../../src/components/copy-button/react.tsx
|
|
214
214
|
import { Check, Copy, TriangleAlert } from "lucide-react";
|
|
215
|
-
import {
|
|
216
|
-
import {
|
|
217
|
-
import {
|
|
218
|
-
|
|
215
|
+
import { Redacted as Redacted2 } from "effect";
|
|
216
|
+
import { Component as Component2 } from "effect/ui";
|
|
217
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState as useState2 } from "react";
|
|
218
|
+
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider/react";
|
|
219
|
+
|
|
220
|
+
// ../../src/lib/effect-ui-adapter/use-model.ts
|
|
221
|
+
import { MessageLog as MessageLog2 } from "effect/ui";
|
|
222
|
+
import {
|
|
223
|
+
createContext,
|
|
224
|
+
useCallback,
|
|
225
|
+
useContext,
|
|
226
|
+
useEffect,
|
|
227
|
+
useLayoutEffect,
|
|
228
|
+
useRef,
|
|
229
|
+
useState,
|
|
230
|
+
useSyncExternalStore
|
|
231
|
+
} from "react";
|
|
232
|
+
|
|
233
|
+
// ../../src/lib/effect-ui-adapter/model-runtime.ts
|
|
234
|
+
import { MessageLog, Renderer, View } from "effect/ui";
|
|
235
|
+
import { BrowserHost, Html } from "effect/ui/html";
|
|
236
|
+
import { Cause, Effect as Effect2, Fiber } from "effect";
|
|
237
|
+
var node = () => ({ children: [] });
|
|
238
|
+
var modelHost = (commit) => {
|
|
239
|
+
const remove = (child) => {
|
|
240
|
+
if (!child.parent)
|
|
241
|
+
return;
|
|
242
|
+
child.parent.children.splice(child.parent.children.indexOf(child), 1);
|
|
243
|
+
delete child.parent;
|
|
244
|
+
};
|
|
245
|
+
return {
|
|
246
|
+
createElement: node,
|
|
247
|
+
createText: node,
|
|
248
|
+
setText: () => {},
|
|
249
|
+
setAttr: () => {},
|
|
250
|
+
setProp: () => {},
|
|
251
|
+
setEvents: () => {},
|
|
252
|
+
insertBefore: (parent, child, before) => {
|
|
253
|
+
if (child === before)
|
|
254
|
+
return;
|
|
255
|
+
remove(child);
|
|
256
|
+
const index = before ? parent.children.indexOf(before) : parent.children.length;
|
|
257
|
+
parent.children.splice(index, 0, child);
|
|
258
|
+
child.parent = parent;
|
|
259
|
+
},
|
|
260
|
+
remove,
|
|
261
|
+
parentOf: (child) => child.parent,
|
|
262
|
+
nextOf: (child) => child.parent?.children[child.parent.children.indexOf(child) + 1],
|
|
263
|
+
elements: ["html"],
|
|
264
|
+
controlled: new Set,
|
|
265
|
+
runsMounts: false,
|
|
266
|
+
commit
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
var mountModel = (component, props, publishSnapshot, messageLog, onEmit) => {
|
|
270
|
+
let currentProps = props;
|
|
271
|
+
let root;
|
|
272
|
+
let active = true;
|
|
273
|
+
let failure;
|
|
274
|
+
const publish = () => {
|
|
275
|
+
if (!active)
|
|
276
|
+
return;
|
|
277
|
+
if (failure) {
|
|
278
|
+
publishSnapshot({ error: failure });
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
const current = root?.model();
|
|
282
|
+
if (current !== undefined)
|
|
283
|
+
publishSnapshot({ model: current });
|
|
284
|
+
};
|
|
285
|
+
const fiber = Effect2.runFork(Effect2.scoped(Effect2.gen(function* () {
|
|
286
|
+
const mounted = yield* Renderer.mount(component, Effect2.succeed(props), node(), {
|
|
287
|
+
head: false,
|
|
288
|
+
onEmit,
|
|
289
|
+
fallback: ({ cause }) => {
|
|
290
|
+
failure = new Error("Effect UI root failed", {
|
|
291
|
+
cause: Cause.squash(cause)
|
|
292
|
+
});
|
|
293
|
+
return View.text("");
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
if (!active)
|
|
297
|
+
return;
|
|
298
|
+
root = mounted;
|
|
299
|
+
if (props !== currentProps)
|
|
300
|
+
mounted.setProps(currentProps);
|
|
301
|
+
publish();
|
|
302
|
+
return yield* Effect2.never;
|
|
303
|
+
}).pipe(Effect2.provide(Renderer.layer(modelHost(publish))), Effect2.provideService(Html.Host, BrowserHost.htmlHost), Effect2.provideService(MessageLog.MessageLog, messageLog))));
|
|
304
|
+
return {
|
|
305
|
+
send: (message) => {
|
|
306
|
+
root?.send(message);
|
|
307
|
+
publish();
|
|
308
|
+
},
|
|
309
|
+
setProps: (next) => {
|
|
310
|
+
currentProps = next;
|
|
311
|
+
root?.setProps(next);
|
|
312
|
+
},
|
|
313
|
+
dispose: () => {
|
|
314
|
+
active = false;
|
|
315
|
+
root = undefined;
|
|
316
|
+
Effect2.runFork(Fiber.interrupt(fiber));
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
// ../../src/lib/effect-ui-adapter/use-model.ts
|
|
322
|
+
"use client";
|
|
323
|
+
var ModelMessageLogContext = createContext(undefined);
|
|
324
|
+
var useModel = (component, props, options = {}) => {
|
|
325
|
+
const contextLog = useContext(ModelMessageLogContext);
|
|
326
|
+
const messageLog = options.messageLog ?? (contextLog === undefined ? MessageLog2.noop : contextLog);
|
|
327
|
+
const [store] = useState(() => {
|
|
328
|
+
const initial = { model: component.init(props).model };
|
|
329
|
+
let snapshot = initial;
|
|
330
|
+
const listeners = new Set;
|
|
331
|
+
return {
|
|
332
|
+
subscribe: (listener) => {
|
|
333
|
+
listeners.add(listener);
|
|
334
|
+
return () => {
|
|
335
|
+
listeners.delete(listener);
|
|
336
|
+
};
|
|
337
|
+
},
|
|
338
|
+
getSnapshot: () => snapshot,
|
|
339
|
+
getServerSnapshot: () => initial,
|
|
340
|
+
publish: (next) => {
|
|
341
|
+
if ("model" in snapshot && "model" in next && Object.is(snapshot.model, next.model))
|
|
342
|
+
return;
|
|
343
|
+
if ("error" in snapshot && "error" in next && snapshot.error === next.error)
|
|
344
|
+
return;
|
|
345
|
+
snapshot = next;
|
|
346
|
+
listeners.forEach((listener) => listener());
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
});
|
|
350
|
+
const snapshot = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot);
|
|
351
|
+
const committed = useRef(props);
|
|
352
|
+
const onEmit = useRef(options.onEmit);
|
|
353
|
+
const runtime = useRef(undefined);
|
|
354
|
+
const send = useCallback((message) => runtime.current?.send(message), []);
|
|
355
|
+
useLayoutEffect(() => {
|
|
356
|
+
onEmit.current = options.onEmit;
|
|
357
|
+
committed.current = props;
|
|
358
|
+
runtime.current?.setProps(props);
|
|
359
|
+
}, [props, options.onEmit]);
|
|
360
|
+
useEffect(() => {
|
|
361
|
+
if (messageLog === null)
|
|
362
|
+
return;
|
|
363
|
+
const mounted = mountModel(component, committed.current, store.publish, messageLog, (event) => onEmit.current?.(event));
|
|
364
|
+
runtime.current = mounted;
|
|
365
|
+
return () => {
|
|
366
|
+
runtime.current = undefined;
|
|
367
|
+
mounted.dispose();
|
|
368
|
+
};
|
|
369
|
+
}, [component, messageLog, store]);
|
|
370
|
+
if ("error" in snapshot)
|
|
371
|
+
throw snapshot.error;
|
|
372
|
+
return { model: snapshot.model, send };
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
// ../../src/components/copy-button/index.ts
|
|
376
|
+
import { Effect as Effect3, Redacted, Schema as Schema3 } from "effect";
|
|
377
|
+
import { Command, Component, UiSchema, View as View2 } from "effect/ui";
|
|
378
|
+
|
|
379
|
+
// ../../src/components/copy-button/schema.ts
|
|
380
|
+
import { Schema as Schema2 } from "effect";
|
|
381
|
+
var MessageOverrides = Schema2.Struct({
|
|
382
|
+
copy: Schema2.optional(Schema2.String),
|
|
383
|
+
copied: Schema2.optional(Schema2.String),
|
|
384
|
+
copyFailed: Schema2.optional(Schema2.String)
|
|
385
|
+
}).annotate({ identifier: "CopyButtonMessageOverrides" });
|
|
386
|
+
var CopyButtonTranslations = Schema2.Record(Schema2.String, Schema2.UndefinedOr(MessageOverrides));
|
|
387
|
+
var copyButtonVariants = [
|
|
388
|
+
"default",
|
|
389
|
+
"secondary",
|
|
390
|
+
"outline",
|
|
391
|
+
"ghost",
|
|
392
|
+
"destructive",
|
|
393
|
+
"link"
|
|
394
|
+
];
|
|
395
|
+
var CopyButtonModelProps = Schema2.Struct({
|
|
396
|
+
value: Schema2.Redacted(Schema2.String, { disallowJsonEncode: true }),
|
|
397
|
+
disabled: Schema2.optional(Schema2.Boolean),
|
|
398
|
+
resetDelay: Schema2.optional(Schema2.Finite)
|
|
399
|
+
}).annotate({ identifier: "CopyButtonModelProps" });
|
|
400
|
+
var copyButtonSharedProps = Schema2.Struct({
|
|
401
|
+
...CopyButtonModelProps.fields,
|
|
402
|
+
valueDescription: Schema2.optional(Schema2.String),
|
|
403
|
+
copyVariant: Schema2.optional(Schema2.Literals(["default", "sm", "large"])),
|
|
404
|
+
variant: Schema2.optional(Schema2.Literals(copyButtonVariants)),
|
|
405
|
+
locale: Schema2.optional(Schema2.String),
|
|
406
|
+
messages: Schema2.optional(CopyButtonTranslations)
|
|
407
|
+
}).annotate({ identifier: "CopyButtonSharedProps" });
|
|
408
|
+
|
|
409
|
+
// ../../src/components/copy-button/index.ts
|
|
410
|
+
var labels = {
|
|
219
411
|
en: { copy: "Copy", copied: "Copied", copyFailed: "Copy failed" },
|
|
220
412
|
fr: { copy: "Copier", copied: "Copié", copyFailed: "Échec de la copie" }
|
|
221
413
|
};
|
|
222
414
|
var copyButtonMessages = (locale = "en", translations) => ({
|
|
223
|
-
...locale.startsWith("fr") ?
|
|
415
|
+
...locale.startsWith("fr") ? labels.fr : labels.en,
|
|
224
416
|
...translations?.[locale.split("-")[0] ?? locale],
|
|
225
417
|
...translations?.[locale]
|
|
226
418
|
});
|
|
419
|
+
var copyButtonLabel = (copy, description) => description ? `${copy} ${description}` : copy;
|
|
420
|
+
var CopyButtonMessage = UiSchema.TaggedEnum({
|
|
421
|
+
Pressed: {},
|
|
422
|
+
Finished: { success: Schema3.Boolean },
|
|
423
|
+
Reset: {}
|
|
424
|
+
}).annotate({ identifier: "CopyButtonMessage" });
|
|
425
|
+
|
|
426
|
+
class WriteClipboard extends Command.Service()("copy-button/WriteClipboard", {
|
|
427
|
+
args: {
|
|
428
|
+
value: Schema3.Redacted(Schema3.String, { disallowJsonEncode: true })
|
|
429
|
+
},
|
|
430
|
+
success: CopyButtonMessage
|
|
431
|
+
}) {
|
|
432
|
+
static layerFromWrite = (write) => WriteClipboard.toLayer(({ value }) => Effect3.tryPromise(() => write(Redacted.value(value))).pipe(Effect3.match({
|
|
433
|
+
onSuccess: () => CopyButtonMessage.Finished({ success: true }),
|
|
434
|
+
onFailure: () => CopyButtonMessage.Finished({ success: false })
|
|
435
|
+
})));
|
|
436
|
+
static browser = WriteClipboard.layerFromWrite((value) => navigator.clipboard.writeText(value));
|
|
437
|
+
}
|
|
438
|
+
var ResetClipboardFeedback = Command.make("copy-button/ResetFeedback", { args: { delay: Schema3.Number }, mode: "switch" }, ({ delay }) => Effect3.sleep(Math.max(0, delay)).pipe(Effect3.as(CopyButtonMessage.Reset())));
|
|
439
|
+
var copyButtonOptions = {
|
|
440
|
+
name: "CopyButton",
|
|
441
|
+
props: CopyButtonModelProps,
|
|
442
|
+
model: Schema3.Struct({
|
|
443
|
+
status: Schema3.Literals(["idle", "copied", "failed"])
|
|
444
|
+
}).annotate({ identifier: "CopyButtonModel" }),
|
|
445
|
+
message: CopyButtonMessage,
|
|
446
|
+
restore: false
|
|
447
|
+
};
|
|
448
|
+
var Definition = Component.define(copyButtonOptions);
|
|
449
|
+
var update = Definition.update({
|
|
450
|
+
Pressed: ($) => $.props.disabled ? $.model : $.run(WriteClipboard.make({ value: $.props.value })),
|
|
451
|
+
Finished: ($, { success }) => $.evolve({ status: success ? "copied" : "failed" }).run(ResetClipboardFeedback.make({ delay: $.props.resetDelay ?? 1500 })),
|
|
452
|
+
Reset: ($) => $.evolve({ status: "idle" })
|
|
453
|
+
});
|
|
454
|
+
var copyButtonBehaviours = {
|
|
455
|
+
init: () => ({ status: "idle" }),
|
|
456
|
+
update
|
|
457
|
+
};
|
|
458
|
+
var CopyButtonModel = Definition.make({
|
|
459
|
+
...copyButtonBehaviours,
|
|
460
|
+
view: () => View2.text("")
|
|
461
|
+
});
|
|
462
|
+
var copyButtonStatus = (status, copy, description) => {
|
|
463
|
+
if (status === "idle")
|
|
464
|
+
return "";
|
|
465
|
+
const text = status === "copied" ? copy.copied : copy.copyFailed;
|
|
466
|
+
return description ? `${text}: ${description}` : text;
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
// ../../src/components/copy-button/react.tsx
|
|
470
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
471
|
+
"use client";
|
|
227
472
|
function CopyButton({
|
|
228
473
|
value,
|
|
229
474
|
valueDescription,
|
|
@@ -239,39 +484,44 @@ function CopyButton({
|
|
|
239
484
|
...props
|
|
240
485
|
}) {
|
|
241
486
|
const locale = useKrakstackLocale(localeOverride);
|
|
242
|
-
const [copyState, setCopyState] = useState("idle");
|
|
243
|
-
const copyTimeout = useRef(undefined);
|
|
244
487
|
const labels = copyButtonMessages(locale, messages);
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
488
|
+
const callbacks = useRef2({
|
|
489
|
+
onCopied,
|
|
490
|
+
onCopyError,
|
|
491
|
+
failureLabel: labels.copyFailed
|
|
492
|
+
});
|
|
493
|
+
useLayoutEffect2(() => {
|
|
494
|
+
callbacks.current = {
|
|
495
|
+
onCopied,
|
|
496
|
+
onCopyError,
|
|
497
|
+
failureLabel: labels.copyFailed
|
|
252
498
|
};
|
|
253
|
-
}, []);
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
clearTimeout(copyTimeout.current);
|
|
257
|
-
copyTimeout.current = setTimeout(() => setCopyState("idle"), resetDelay);
|
|
258
|
-
};
|
|
259
|
-
const copy = async () => {
|
|
499
|
+
}, [onCopied, onCopyError, labels.copyFailed]);
|
|
500
|
+
const [component] = useState2(() => CopyButtonModel.pipe(Component2.provide(WriteClipboard.layerFromWrite(async (text) => {
|
|
501
|
+
const { onCopied, onCopyError, failureLabel } = callbacks.current;
|
|
260
502
|
try {
|
|
261
|
-
await navigator.clipboard.writeText(
|
|
262
|
-
setCopyState("copied");
|
|
503
|
+
await navigator.clipboard.writeText(text);
|
|
263
504
|
onCopied?.();
|
|
264
|
-
} catch (
|
|
265
|
-
|
|
266
|
-
|
|
505
|
+
} catch (cause) {
|
|
506
|
+
onCopyError?.(cause instanceof Error ? cause : new Error(failureLabel, { cause }));
|
|
507
|
+
throw cause;
|
|
267
508
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
509
|
+
}))));
|
|
510
|
+
const {
|
|
511
|
+
model: { status },
|
|
512
|
+
send
|
|
513
|
+
} = useModel(component, {
|
|
514
|
+
value: Redacted2.make(value),
|
|
515
|
+
disabled: disabled ?? false,
|
|
516
|
+
resetDelay
|
|
517
|
+
});
|
|
518
|
+
const accessibleLabel = ariaLabel ?? copyButtonLabel(labels.copy, valueDescription);
|
|
519
|
+
const isLarge = copyVariant === "large";
|
|
520
|
+
const defaultSize = copyVariant === "sm" ? "icon-xs" : isLarge ? "sm" : "icon-sm";
|
|
271
521
|
return /* @__PURE__ */ jsxs(Button, {
|
|
272
522
|
"aria-label": accessibleLabel,
|
|
273
523
|
disabled,
|
|
274
|
-
onClick:
|
|
524
|
+
onClick: () => send(CopyButtonMessage.Pressed()),
|
|
275
525
|
size: size ?? defaultSize,
|
|
276
526
|
...props,
|
|
277
527
|
children: [
|
|
@@ -279,15 +529,15 @@ function CopyButton({
|
|
|
279
529
|
"aria-live": "polite",
|
|
280
530
|
className: "sr-only",
|
|
281
531
|
role: "status",
|
|
282
|
-
children: status
|
|
532
|
+
children: copyButtonStatus(status, labels, valueDescription)
|
|
283
533
|
}),
|
|
284
|
-
|
|
534
|
+
status === "copied" ? /* @__PURE__ */ jsx2(Check, {
|
|
285
535
|
"aria-hidden": "true"
|
|
286
536
|
}) : null,
|
|
287
|
-
|
|
537
|
+
status === "failed" ? /* @__PURE__ */ jsx2(TriangleAlert, {
|
|
288
538
|
"aria-hidden": "true"
|
|
289
539
|
}) : null,
|
|
290
|
-
|
|
540
|
+
status === "idle" ? /* @__PURE__ */ jsx2(Copy, {
|
|
291
541
|
"aria-hidden": "true"
|
|
292
542
|
}) : null,
|
|
293
543
|
isLarge ? /* @__PURE__ */ jsx2("span", {
|
|
@@ -297,14 +547,30 @@ function CopyButton({
|
|
|
297
547
|
});
|
|
298
548
|
}
|
|
299
549
|
|
|
300
|
-
// ../../src/components/ui/
|
|
550
|
+
// ../../src/components/ui/copy-button.tsx
|
|
551
|
+
"use client";
|
|
552
|
+
|
|
553
|
+
// ../../src/components/code-block/react.tsx
|
|
301
554
|
import { highlight } from "@tanstack/highlight";
|
|
555
|
+
import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider/react";
|
|
556
|
+
|
|
557
|
+
// ../../src/components/code-block/classes.ts
|
|
558
|
+
var codeBlockClasses = {
|
|
559
|
+
root: "not-prose bg-muted overflow-hidden rounded-md border text-[var(--th-token)]",
|
|
560
|
+
header: "bg-background border-border/60 flex items-center justify-between border-b px-3 py-2",
|
|
561
|
+
language: "text-muted-foreground font-mono text-xs",
|
|
562
|
+
viewport: "max-h-full overflow-auto font-mono text-[0.875rem] leading-[1.625]"
|
|
563
|
+
};
|
|
564
|
+
var resolveCodeBlockClasses = (overrides) => ({
|
|
565
|
+
...codeBlockClasses,
|
|
566
|
+
...overrides
|
|
567
|
+
});
|
|
568
|
+
|
|
569
|
+
// ../../src/components/code-block/index.ts
|
|
302
570
|
import { createThemeCss } from "@tanstack/highlight/theme";
|
|
303
571
|
import { githubDarkTheme } from "@tanstack/highlight/themes/github-dark";
|
|
304
572
|
import { githubLightTheme } from "@tanstack/highlight/themes/github-light";
|
|
305
|
-
|
|
306
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
307
|
-
var themeCss = `${createThemeCss({
|
|
573
|
+
var codeThemeCss = `${createThemeCss({
|
|
308
574
|
light: githubLightTheme,
|
|
309
575
|
dark: githubDarkTheme,
|
|
310
576
|
lightSelector: "[data-code-theme]",
|
|
@@ -320,7 +586,7 @@ var themeCss = `${createThemeCss({
|
|
|
320
586
|
color: inherit;
|
|
321
587
|
}
|
|
322
588
|
[data-code-theme] pre.th-code code { font: inherit; }`;
|
|
323
|
-
var
|
|
589
|
+
var messages = {
|
|
324
590
|
en: {
|
|
325
591
|
codeDescription: (language) => `${language} code`,
|
|
326
592
|
copy: "Copy",
|
|
@@ -335,54 +601,82 @@ var messages2 = {
|
|
|
335
601
|
}
|
|
336
602
|
};
|
|
337
603
|
var codeBlockMessages = (locale = "en", translations) => ({
|
|
338
|
-
...locale.startsWith("fr") ?
|
|
604
|
+
...locale.startsWith("fr") ? messages.fr : messages.en,
|
|
339
605
|
...translations?.[locale.split("-")[0] ?? locale],
|
|
340
606
|
...translations?.[locale]
|
|
341
607
|
});
|
|
608
|
+
var codeLanguage = (language = "text") => language.toLowerCase() || "text";
|
|
609
|
+
|
|
610
|
+
// ../../src/components/code-block/react.tsx
|
|
611
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
342
612
|
function CodeBlock({
|
|
613
|
+
classes: classOverrides,
|
|
343
614
|
code,
|
|
344
615
|
language = "text",
|
|
345
616
|
locale: localeOverride,
|
|
346
617
|
messages
|
|
347
618
|
}) {
|
|
619
|
+
const codeBlockClasses = resolveCodeBlockClasses(classOverrides);
|
|
348
620
|
const locale = useKrakstackLocale2(localeOverride);
|
|
349
|
-
const normalizedLanguage = language
|
|
621
|
+
const normalizedLanguage = codeLanguage(language);
|
|
350
622
|
const highlighted = highlight(code, { lang: normalizedLanguage });
|
|
351
623
|
const labels = codeBlockMessages(locale, messages);
|
|
352
624
|
return /* @__PURE__ */ jsxs2("div", {
|
|
353
|
-
className:
|
|
625
|
+
className: codeBlockClasses.root,
|
|
354
626
|
"data-code-theme": true,
|
|
355
627
|
children: [
|
|
356
628
|
/* @__PURE__ */ jsx3("style", {
|
|
357
|
-
children:
|
|
629
|
+
children: codeThemeCss
|
|
358
630
|
}),
|
|
359
631
|
/* @__PURE__ */ jsxs2("div", {
|
|
360
|
-
className:
|
|
632
|
+
className: codeBlockClasses.header,
|
|
361
633
|
children: [
|
|
362
634
|
/* @__PURE__ */ jsx3("span", {
|
|
363
|
-
className:
|
|
635
|
+
className: codeBlockClasses.language,
|
|
364
636
|
children: highlighted.lang
|
|
365
637
|
}),
|
|
366
638
|
/* @__PURE__ */ jsx3(CopyButton, {
|
|
367
639
|
value: code,
|
|
368
640
|
valueDescription: labels.codeDescription(highlighted.lang),
|
|
369
|
-
variant: "
|
|
641
|
+
variant: "ghost",
|
|
370
642
|
locale,
|
|
371
643
|
messages: { [locale]: labels }
|
|
372
644
|
})
|
|
373
645
|
]
|
|
374
646
|
}),
|
|
375
647
|
/* @__PURE__ */ jsx3("div", {
|
|
376
|
-
className:
|
|
648
|
+
className: codeBlockClasses.viewport,
|
|
377
649
|
dangerouslySetInnerHTML: { __html: highlighted.html }
|
|
378
650
|
})
|
|
379
651
|
]
|
|
380
652
|
});
|
|
381
653
|
}
|
|
654
|
+
// ../../src/components/markdown/classes.ts
|
|
655
|
+
var markdownClass = "[&_a:hover]:text-primary [&_a]:decoration-border [&_blockquote]:border-primary/40 [&_blockquote]:bg-muted/40 [&_h2_a]:text-muted-foreground [&_h3_a]:text-muted-foreground [&_[data-inline-code]]:bg-muted text-[0.98rem] leading-7 [&_[data-inline-code]]:rounded [&_[data-inline-code]]:px-1.5 [&_[data-inline-code]]:py-0.5 [&_[data-inline-code]]:font-mono [&_[data-inline-code]]:text-[0.875em] [&_[data-markdown-table]]:overflow-x-auto [&_a]:font-medium [&_a]:underline [&_a]:decoration-1 [&_a]:underline-offset-4 [&_a]:transition-colors [&_blockquote]:my-5 [&_blockquote]:rounded-r-lg [&_blockquote]:border-l-4 [&_blockquote]:px-5 [&_blockquote]:py-1 [&_h2]:mt-12 [&_h2]:scroll-mt-20 [&_h2]:border-t [&_h2]:pt-8 [&_h2]:text-2xl [&_h2]:font-bold [&_h2]:tracking-tight [&_h2_a]:ml-2 [&_h2_a]:no-underline [&_h2:first-of-type]:mt-0 [&_h2:first-of-type]:border-t-0 [&_h2:first-of-type]:pt-0 [&_h3]:mt-8 [&_h3]:scroll-mt-20 [&_h3]:text-xl [&_h3]:font-semibold [&_h3]:tracking-tight [&_h3_a]:ml-2 [&_h3_a]:no-underline [&_ol]:my-5 [&_p]:my-5 [&_table]:w-full [&_table]:text-sm [&_td]:border-b [&_td]:p-2 [&_th]:border-b [&_th]:p-2 [&_th]:text-left [&_ul]:my-5 [&_li]:my-1 [&_li>ol]:my-2 [&_li>p]:my-2 [&_li>ul]:my-2 [&_ol]:list-decimal [&_ol]:ps-6 [&_ul]:list-disc [&_ul]:ps-6";
|
|
656
|
+
|
|
657
|
+
// ../../src/components/markdown/index.ts
|
|
658
|
+
var markdownSegments = ({
|
|
659
|
+
html,
|
|
660
|
+
codeBlocks
|
|
661
|
+
}) => {
|
|
662
|
+
let remainingHtml = html;
|
|
663
|
+
const segments = [];
|
|
664
|
+
codeBlocks.forEach((block, index) => {
|
|
665
|
+
const marker = `<markdown-code-block data-index="${index}"></markdown-code-block>`;
|
|
666
|
+
const at = remainingHtml.indexOf(marker);
|
|
667
|
+
if (at === -1)
|
|
668
|
+
return;
|
|
669
|
+
segments.push({ html: remainingHtml.slice(0, at), index, block });
|
|
670
|
+
remainingHtml = remainingHtml.slice(at + marker.length);
|
|
671
|
+
});
|
|
672
|
+
segments.push({ html: remainingHtml, index: codeBlocks.length });
|
|
673
|
+
return segments;
|
|
674
|
+
};
|
|
382
675
|
|
|
383
|
-
// ../../src/
|
|
676
|
+
// ../../src/components/markdown/react.tsx
|
|
384
677
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
385
678
|
var MarkdownContent = ({
|
|
679
|
+
classes,
|
|
386
680
|
className,
|
|
387
681
|
codeBlocks,
|
|
388
682
|
html,
|
|
@@ -390,36 +684,27 @@ var MarkdownContent = ({
|
|
|
390
684
|
messages
|
|
391
685
|
}) => {
|
|
392
686
|
const content = [];
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
const marker = `<markdown-code-block data-index="${index}"></markdown-code-block>`;
|
|
396
|
-
const markerIndex = remainingHtml.indexOf(marker);
|
|
397
|
-
if (markerIndex === -1)
|
|
398
|
-
return;
|
|
687
|
+
for (const segment of markdownSegments({ html, codeBlocks })) {
|
|
688
|
+
const { block, index } = segment;
|
|
399
689
|
content.push(/* @__PURE__ */ jsx4("div", {
|
|
400
|
-
dangerouslySetInnerHTML: {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
});
|
|
414
|
-
content.push(/* @__PURE__ */ jsx4("div", {
|
|
415
|
-
dangerouslySetInnerHTML: { __html: remainingHtml }
|
|
416
|
-
}, "html-final"));
|
|
690
|
+
dangerouslySetInnerHTML: { __html: segment.html }
|
|
691
|
+
}, `html-${index}`));
|
|
692
|
+
if (block)
|
|
693
|
+
content.push(/* @__PURE__ */ jsx4("div", {
|
|
694
|
+
className: "my-5",
|
|
695
|
+
children: /* @__PURE__ */ jsx4(CodeBlock, {
|
|
696
|
+
code: block.code,
|
|
697
|
+
language: block.language,
|
|
698
|
+
locale,
|
|
699
|
+
messages
|
|
700
|
+
})
|
|
701
|
+
}, `code-${index}`));
|
|
702
|
+
}
|
|
417
703
|
return /* @__PURE__ */ jsx4("div", {
|
|
418
|
-
className: cn(
|
|
704
|
+
className: cn(classes?.root ?? markdownClass, className),
|
|
419
705
|
children: content
|
|
420
706
|
});
|
|
421
707
|
};
|
|
422
|
-
|
|
423
708
|
// ../../src/components/ui/alert.tsx
|
|
424
709
|
import { cva as cva2 } from "class-variance-authority";
|
|
425
710
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
@@ -722,7 +1007,7 @@ function DialogTitle({ className, ...props }) {
|
|
|
722
1007
|
|
|
723
1008
|
// ../../src/components/ui/command.tsx
|
|
724
1009
|
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
725
|
-
function
|
|
1010
|
+
function Command2({
|
|
726
1011
|
className,
|
|
727
1012
|
...props
|
|
728
1013
|
}) {
|
|
@@ -1298,7 +1583,7 @@ function TraceCollapsibleContent({
|
|
|
1298
1583
|
}
|
|
1299
1584
|
|
|
1300
1585
|
// ../../src/services/agent/schema.ts
|
|
1301
|
-
import { Schema as
|
|
1586
|
+
import { Schema as Schema4 } from "effect";
|
|
1302
1587
|
import {
|
|
1303
1588
|
HttpApiEndpoint,
|
|
1304
1589
|
HttpApiError,
|
|
@@ -1306,107 +1591,179 @@ import {
|
|
|
1306
1591
|
HttpApiSchema,
|
|
1307
1592
|
OpenApi
|
|
1308
1593
|
} from "effect/http-api";
|
|
1309
|
-
var AgentMessageText =
|
|
1594
|
+
var AgentMessageText = Schema4.String.check(Schema4.isBetweenLength(1, 4000)).annotate({
|
|
1310
1595
|
identifier: "AgentMessageText",
|
|
1311
1596
|
title: "Agent message",
|
|
1312
1597
|
description: "A user message sent to the agent."
|
|
1313
1598
|
});
|
|
1314
|
-
var AgentReferenceLabel =
|
|
1599
|
+
var AgentReferenceLabel = Schema4.String.check(Schema4.isBetweenLength(1, 500));
|
|
1315
1600
|
var AGENT_REFERENCE_LIMIT = 20;
|
|
1316
|
-
var AgentToolMetadata =
|
|
1317
|
-
title:
|
|
1318
|
-
description:
|
|
1319
|
-
destructive:
|
|
1601
|
+
var AgentToolMetadata = Schema4.Struct({
|
|
1602
|
+
title: Schema4.optional(Schema4.String),
|
|
1603
|
+
description: Schema4.optional(Schema4.String),
|
|
1604
|
+
destructive: Schema4.Boolean
|
|
1320
1605
|
}).annotate({ identifier: "AgentToolMetadata" });
|
|
1321
|
-
var AgentMarkdownCodeBlock =
|
|
1322
|
-
code:
|
|
1323
|
-
language:
|
|
1606
|
+
var AgentMarkdownCodeBlock = Schema4.Struct({
|
|
1607
|
+
code: Schema4.String,
|
|
1608
|
+
language: Schema4.String
|
|
1324
1609
|
}).annotate({ identifier: "AgentMarkdownCodeBlock" });
|
|
1325
|
-
var AgentEvent =
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
type:
|
|
1329
|
-
messageId:
|
|
1610
|
+
var AgentEvent = Schema4.Union([
|
|
1611
|
+
Schema4.Struct({ type: Schema4.Literal("heartbeat") }),
|
|
1612
|
+
Schema4.Struct({
|
|
1613
|
+
type: Schema4.Literal("message-start"),
|
|
1614
|
+
messageId: Schema4.String
|
|
1330
1615
|
}),
|
|
1331
|
-
|
|
1332
|
-
type:
|
|
1333
|
-
messageId:
|
|
1334
|
-
delta:
|
|
1616
|
+
Schema4.Struct({
|
|
1617
|
+
type: Schema4.Literal("text-delta"),
|
|
1618
|
+
messageId: Schema4.String,
|
|
1619
|
+
delta: Schema4.String
|
|
1335
1620
|
}),
|
|
1336
|
-
|
|
1337
|
-
type:
|
|
1338
|
-
messageId:
|
|
1339
|
-
html:
|
|
1340
|
-
codeBlocks:
|
|
1621
|
+
Schema4.Struct({
|
|
1622
|
+
type: Schema4.Literal("markdown-snapshot"),
|
|
1623
|
+
messageId: Schema4.String,
|
|
1624
|
+
html: Schema4.String,
|
|
1625
|
+
codeBlocks: Schema4.Array(AgentMarkdownCodeBlock)
|
|
1341
1626
|
}),
|
|
1342
|
-
|
|
1343
|
-
type:
|
|
1344
|
-
messageId:
|
|
1345
|
-
toolCallId:
|
|
1346
|
-
name:
|
|
1347
|
-
input:
|
|
1627
|
+
Schema4.Struct({
|
|
1628
|
+
type: Schema4.Literal("tool-call"),
|
|
1629
|
+
messageId: Schema4.String,
|
|
1630
|
+
toolCallId: Schema4.String,
|
|
1631
|
+
name: Schema4.String,
|
|
1632
|
+
input: Schema4.Unknown,
|
|
1348
1633
|
metadata: AgentToolMetadata
|
|
1349
1634
|
}),
|
|
1350
|
-
|
|
1351
|
-
type:
|
|
1352
|
-
toolCallId:
|
|
1353
|
-
name:
|
|
1354
|
-
isFailure:
|
|
1635
|
+
Schema4.Struct({
|
|
1636
|
+
type: Schema4.Literal("tool-result"),
|
|
1637
|
+
toolCallId: Schema4.String,
|
|
1638
|
+
name: Schema4.String,
|
|
1639
|
+
isFailure: Schema4.Boolean
|
|
1355
1640
|
}),
|
|
1356
|
-
|
|
1357
|
-
type:
|
|
1358
|
-
approvalId:
|
|
1359
|
-
toolCallId:
|
|
1641
|
+
Schema4.Struct({
|
|
1642
|
+
type: Schema4.Literal("approval-required"),
|
|
1643
|
+
approvalId: Schema4.String,
|
|
1644
|
+
toolCallId: Schema4.String
|
|
1360
1645
|
}),
|
|
1361
|
-
|
|
1362
|
-
type:
|
|
1363
|
-
value:
|
|
1646
|
+
Schema4.Struct({
|
|
1647
|
+
type: Schema4.Literal("history"),
|
|
1648
|
+
value: Schema4.String
|
|
1364
1649
|
}),
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
type:
|
|
1368
|
-
code:
|
|
1650
|
+
Schema4.Struct({ type: Schema4.Literal("finish") }),
|
|
1651
|
+
Schema4.Struct({
|
|
1652
|
+
type: Schema4.Literal("error"),
|
|
1653
|
+
code: Schema4.Literals(["unavailable", "invalid-request", "stream-failed"])
|
|
1369
1654
|
})
|
|
1370
1655
|
]).annotate({
|
|
1371
1656
|
identifier: "AgentEvent",
|
|
1372
1657
|
title: "Agent stream event",
|
|
1373
1658
|
description: "An event emitted by the agent endpoint."
|
|
1374
1659
|
});
|
|
1375
|
-
var AgentStreamError =
|
|
1376
|
-
code:
|
|
1660
|
+
var AgentStreamError = Schema4.Struct({
|
|
1661
|
+
code: Schema4.Literals(["unavailable", "stream-failed"])
|
|
1377
1662
|
}).annotate({
|
|
1378
1663
|
identifier: "AgentStreamError",
|
|
1379
1664
|
title: "Agent stream error",
|
|
1380
1665
|
description: "A recoverable agent stream failure."
|
|
1381
1666
|
});
|
|
1382
1667
|
|
|
1383
|
-
// ../../src/
|
|
1384
|
-
import { useKrakstackLocale as useKrakstackLocale3 } from "@krak-stack/registry/krakstack-provider";
|
|
1385
|
-
|
|
1386
|
-
|
|
1668
|
+
// ../../src/components/agent/react.tsx
|
|
1669
|
+
import { useKrakstackLocale as useKrakstackLocale3 } from "@krak-stack/registry/krakstack-provider/react";
|
|
1670
|
+
|
|
1671
|
+
// ../../src/components/agent/index.ts
|
|
1672
|
+
import { Context, Effect as Effect4, Layer as Layer2, Redacted as Redacted3, Schema as Schema6, Stream as Stream2 } from "effect";
|
|
1673
|
+
import { AtomRegistry } from "effect/reactivity";
|
|
1674
|
+
import { Command as Command3, Component as Component3, Subscription, UiSchema as UiSchema2 } from "effect/ui";
|
|
1675
|
+
|
|
1676
|
+
// ../../src/components/agent/schema.ts
|
|
1677
|
+
import { Schema as Schema5 } from "effect";
|
|
1678
|
+
var AgentWidgetSharedPropsSchema = Schema5.Struct({
|
|
1679
|
+
locale: Schema5.optional(Schema5.String)
|
|
1680
|
+
}).annotate({ identifier: "AgentWidgetSharedProps" });
|
|
1681
|
+
var AgentWidgetSnapshotSchema = Schema5.Struct({
|
|
1682
|
+
context: Schema5.optional(Schema5.Struct({ key: Schema5.String, label: Schema5.String })),
|
|
1683
|
+
availableReferences: Schema5.Array(Schema5.Struct({ key: Schema5.String, label: Schema5.String })),
|
|
1684
|
+
contextLocked: Schema5.Boolean,
|
|
1685
|
+
pending: Schema5.Boolean,
|
|
1686
|
+
error: Schema5.optional(Schema5.Literals(["invalid-request", "stream-failed", "unavailable"])),
|
|
1687
|
+
messages: Schema5.Array(Schema5.Struct({
|
|
1688
|
+
id: Schema5.String,
|
|
1689
|
+
role: Schema5.Literals(["user", "assistant"]),
|
|
1690
|
+
text: Schema5.String,
|
|
1691
|
+
markdown: Schema5.optional(Schema5.Struct({
|
|
1692
|
+
html: Schema5.String,
|
|
1693
|
+
codeBlocks: Schema5.Array(AgentMarkdownCodeBlock)
|
|
1694
|
+
})),
|
|
1695
|
+
tools: Schema5.Array(Schema5.Struct({
|
|
1696
|
+
type: Schema5.Literal("tool-call"),
|
|
1697
|
+
toolCallId: Schema5.String,
|
|
1698
|
+
messageId: Schema5.String,
|
|
1699
|
+
name: Schema5.String,
|
|
1700
|
+
input: Schema5.Unknown,
|
|
1701
|
+
metadata: AgentToolMetadata,
|
|
1702
|
+
approvalId: Schema5.optional(Schema5.String),
|
|
1703
|
+
status: Schema5.Literals([
|
|
1704
|
+
"running",
|
|
1705
|
+
"approval-required",
|
|
1706
|
+
"approved",
|
|
1707
|
+
"denied",
|
|
1708
|
+
"completed",
|
|
1709
|
+
"failed"
|
|
1710
|
+
])
|
|
1711
|
+
}))
|
|
1712
|
+
}))
|
|
1713
|
+
}).annotate({ identifier: "AgentWidgetSnapshot" });
|
|
1714
|
+
var AgentWidgetDraftSchema = Schema5.Redacted(Schema5.String, {
|
|
1715
|
+
disallowJsonEncode: true
|
|
1716
|
+
});
|
|
1717
|
+
var AgentWidgetTextSchema = Schema5.String.check(Schema5.isBetweenLength(1, 4000)).annotate({ identifier: "AgentWidgetText" });
|
|
1718
|
+
var AgentWidgetIntentSchema = Schema5.Union([
|
|
1719
|
+
Schema5.TaggedStruct("Submit", {
|
|
1720
|
+
text: Schema5.Redacted(AgentWidgetTextSchema, { disallowJsonEncode: true }),
|
|
1721
|
+
referenceKeys: Schema5.Array(Schema5.String).check(Schema5.isMaxLength(AGENT_REFERENCE_LIMIT))
|
|
1722
|
+
}),
|
|
1723
|
+
Schema5.TaggedStruct("DecideApproval", {
|
|
1724
|
+
approvalId: Schema5.String,
|
|
1725
|
+
toolCallId: Schema5.String,
|
|
1726
|
+
approved: Schema5.Boolean
|
|
1727
|
+
}),
|
|
1728
|
+
Schema5.TaggedStruct("Interrupt", {}),
|
|
1729
|
+
Schema5.TaggedStruct("Reset", {}),
|
|
1730
|
+
Schema5.TaggedStruct("RemoveContext", {})
|
|
1731
|
+
]).annotate({ identifier: "AgentWidgetIntent" });
|
|
1732
|
+
|
|
1733
|
+
// ../../src/components/agent/index.ts
|
|
1734
|
+
class ConversationHost extends Context.Service()("agent/ConversationHost") {
|
|
1735
|
+
static layer = (host) => Layer2.merge(Layer2.succeed(ConversationHost, host), DispatchIntent.toLayer(({ intent }) => Effect4.suspend(() => host.dispatch(intent)).pipe(Effect4.match({
|
|
1736
|
+
onSuccess: () => AgentWidgetMessage.Delivered({ success: true }),
|
|
1737
|
+
onFailure: () => AgentWidgetMessage.Delivered({ success: false })
|
|
1738
|
+
}))));
|
|
1739
|
+
}
|
|
1740
|
+
var hasPendingApproval = (messages) => messages.some((message) => message.tools.some((tool) => tool.status === "approval-required"));
|
|
1741
|
+
var agentDraftText = (input) => input.trim();
|
|
1742
|
+
var agentToolInput = (input) => JSON.stringify(input, null, 2) ?? String(input);
|
|
1743
|
+
var defaultMessages = {
|
|
1387
1744
|
en: {
|
|
1388
1745
|
approve: "Approve",
|
|
1746
|
+
approved: "Approved",
|
|
1389
1747
|
approvalDestructive: "This may permanently remove data. Check the action before continuing.",
|
|
1390
1748
|
approvalDestructiveLabel: "Destructive",
|
|
1391
1749
|
approvalRequired: "The assistant needs your confirmation before making this change.",
|
|
1392
1750
|
cancel: "Cancel",
|
|
1393
1751
|
close: "Close",
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
copy: "Copy",
|
|
1752
|
+
completed: "Completed",
|
|
1753
|
+
conversation: "Conversation",
|
|
1397
1754
|
description: "Ask questions and use available tools to get things done.",
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1755
|
+
errors: {
|
|
1756
|
+
"invalid-request": "The request could not be processed. Start a new conversation and try again.",
|
|
1757
|
+
"stream-failed": "The response was interrupted. Please try again.",
|
|
1758
|
+
unavailable: "The assistant is currently unavailable."
|
|
1759
|
+
},
|
|
1401
1760
|
maximize: "Maximize assistant",
|
|
1402
|
-
minimize: "Minimize assistant",
|
|
1403
|
-
noReferences: "No references found.",
|
|
1404
1761
|
open: "Open AI Assistant",
|
|
1405
1762
|
placeholder: "Ask a question...",
|
|
1406
1763
|
removeContext: "Remove context",
|
|
1407
1764
|
references: "References",
|
|
1765
|
+
reset: "New conversation",
|
|
1408
1766
|
restore: "Restore assistant window",
|
|
1409
|
-
scrollLatest: "Scroll to latest message",
|
|
1410
1767
|
send: "Send message",
|
|
1411
1768
|
stop: "Stop response",
|
|
1412
1769
|
title: "AI Assistant",
|
|
@@ -1414,34 +1771,33 @@ var messages3 = {
|
|
|
1414
1771
|
toolDenied: "Cancelled",
|
|
1415
1772
|
toolFailed: "Failed",
|
|
1416
1773
|
toolRunning: "Working",
|
|
1417
|
-
toolWorked: (seconds) => `Worked for ${seconds} ${seconds === 1 ? "second" : "seconds"}`,
|
|
1418
|
-
viewLess: "View less",
|
|
1419
1774
|
viewMore: "View more",
|
|
1420
|
-
welcome: "How can I help?"
|
|
1775
|
+
welcome: "How can I help?",
|
|
1776
|
+
you: "You"
|
|
1421
1777
|
},
|
|
1422
1778
|
fr: {
|
|
1423
1779
|
approve: "Approuver",
|
|
1780
|
+
approved: "Approuvé",
|
|
1424
1781
|
approvalDestructive: "Cette action peut supprimer définitivement des données. Vérifiez-la avant de continuer.",
|
|
1425
1782
|
approvalDestructiveLabel: "Destructif",
|
|
1426
1783
|
approvalRequired: "L'assistant a besoin de votre confirmation avant d'effectuer cette modification.",
|
|
1427
1784
|
cancel: "Annuler",
|
|
1428
1785
|
close: "Fermer",
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
copy: "Copier",
|
|
1786
|
+
completed: "Terminé",
|
|
1787
|
+
conversation: "Conversation",
|
|
1432
1788
|
description: "Posez des questions et utilisez les outils disponibles pour accomplir vos tâches.",
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1789
|
+
errors: {
|
|
1790
|
+
"invalid-request": "La demande n'a pas pu être traitée. Commencez une nouvelle conversation et réessayez.",
|
|
1791
|
+
"stream-failed": "La réponse a été interrompue. Veuillez réessayer.",
|
|
1792
|
+
unavailable: "L'assistant est actuellement indisponible."
|
|
1793
|
+
},
|
|
1436
1794
|
maximize: "Agrandir l'assistant",
|
|
1437
|
-
minimize: "Réduire l'assistant",
|
|
1438
|
-
noReferences: "Aucune référence trouvée.",
|
|
1439
1795
|
open: "Ouvrir l'assistant IA",
|
|
1440
1796
|
placeholder: "Posez une question...",
|
|
1441
1797
|
removeContext: "Supprimer le contexte",
|
|
1442
1798
|
references: "Références",
|
|
1799
|
+
reset: "Nouvelle conversation",
|
|
1443
1800
|
restore: "Restaurer la fenêtre de l'assistant",
|
|
1444
|
-
scrollLatest: "Défiler jusqu'au dernier message",
|
|
1445
1801
|
send: "Envoyer le message",
|
|
1446
1802
|
stop: "Arrêter la réponse",
|
|
1447
1803
|
title: "Assistant IA",
|
|
@@ -1449,17 +1805,178 @@ var messages3 = {
|
|
|
1449
1805
|
toolDenied: "Annulé",
|
|
1450
1806
|
toolFailed: "Échec",
|
|
1451
1807
|
toolRunning: "En cours",
|
|
1452
|
-
toolWorked: (seconds) => `A travaillé pendant ${seconds} ${seconds === 1 ? "seconde" : "secondes"}`,
|
|
1453
|
-
viewLess: "Voir moins",
|
|
1454
1808
|
viewMore: "Voir plus",
|
|
1455
|
-
welcome: "Comment puis-je vous aider?"
|
|
1809
|
+
welcome: "Comment puis-je vous aider?",
|
|
1810
|
+
you: "Vous"
|
|
1456
1811
|
}
|
|
1457
1812
|
};
|
|
1458
|
-
var
|
|
1459
|
-
|
|
1460
|
-
...translations?.[locale.split("-")[0] ?? locale],
|
|
1461
|
-
...translations?.[locale]
|
|
1813
|
+
var visibleSnapshot = Schema6.Redacted(AgentWidgetSnapshotSchema, {
|
|
1814
|
+
disallowJsonEncode: true
|
|
1462
1815
|
});
|
|
1816
|
+
var AgentWidgetMessage = UiSchema2.TaggedEnum({
|
|
1817
|
+
Received: { snapshot: visibleSnapshot },
|
|
1818
|
+
Disconnected: {},
|
|
1819
|
+
OpenChanged: { open: Schema6.Boolean },
|
|
1820
|
+
ToggleMaximize: {},
|
|
1821
|
+
DraftChanged: { value: AgentWidgetDraftSchema },
|
|
1822
|
+
ReferenceToggled: { key: Schema6.String },
|
|
1823
|
+
Send: {},
|
|
1824
|
+
Approval: {
|
|
1825
|
+
approvalId: Schema6.String,
|
|
1826
|
+
toolCallId: Schema6.String,
|
|
1827
|
+
approved: Schema6.Boolean
|
|
1828
|
+
},
|
|
1829
|
+
Interrupt: {},
|
|
1830
|
+
Reset: {},
|
|
1831
|
+
RemoveContext: {},
|
|
1832
|
+
Delivered: { success: Schema6.Boolean }
|
|
1833
|
+
}).annotate({ identifier: "AgentWidgetMessage" });
|
|
1834
|
+
|
|
1835
|
+
class DispatchIntent extends Command3.Service()("agent/DispatchIntent", { args: { intent: AgentWidgetIntentSchema }, success: AgentWidgetMessage }) {
|
|
1836
|
+
}
|
|
1837
|
+
var agentWidgetOptions = {
|
|
1838
|
+
name: "AgentWidget",
|
|
1839
|
+
props: AgentWidgetSharedPropsSchema,
|
|
1840
|
+
model: Schema6.Struct({
|
|
1841
|
+
snapshot: Schema6.NullOr(visibleSnapshot),
|
|
1842
|
+
draft: AgentWidgetDraftSchema,
|
|
1843
|
+
references: Schema6.Array(Schema6.String),
|
|
1844
|
+
sending: Schema6.NullOr(Schema6.Literals([
|
|
1845
|
+
"Submit",
|
|
1846
|
+
"DecideApproval",
|
|
1847
|
+
"Interrupt",
|
|
1848
|
+
"Reset",
|
|
1849
|
+
"RemoveContext"
|
|
1850
|
+
])),
|
|
1851
|
+
open: Schema6.Boolean,
|
|
1852
|
+
maximized: Schema6.Boolean,
|
|
1853
|
+
deliveryFailed: Schema6.Boolean,
|
|
1854
|
+
disconnected: Schema6.Boolean
|
|
1855
|
+
}).annotate({ identifier: "AgentWidgetModel" }),
|
|
1856
|
+
message: AgentWidgetMessage,
|
|
1857
|
+
restore: false
|
|
1858
|
+
};
|
|
1859
|
+
var Definition2 = Component3.define(agentWidgetOptions);
|
|
1860
|
+
var readAgentWidgetSnapshot = (model) => model.snapshot && Redacted3.value(model.snapshot);
|
|
1861
|
+
var canCompose = (model) => {
|
|
1862
|
+
const snapshot = readAgentWidgetSnapshot(model);
|
|
1863
|
+
return !!snapshot && !snapshot.pending && !hasPendingApproval(snapshot.messages) && !model.sending && !model.disconnected;
|
|
1864
|
+
};
|
|
1865
|
+
var canSend = (model) => canCompose(model) && Schema6.is(AgentWidgetTextSchema)(agentDraftText(Redacted3.value(model.draft)));
|
|
1866
|
+
var clearComposer = { draft: Redacted3.make(""), references: [] };
|
|
1867
|
+
var allowedKeys = (snapshot) => snapshot.availableReferences.filter(({ key }) => key !== snapshot.context?.key).map(({ key }) => key);
|
|
1868
|
+
var sendIntent = ($, intent) => $.evolve({ sending: intent._tag, deliveryFailed: false }).run(DispatchIntent.make({ intent }));
|
|
1869
|
+
var agentWidgetBehaviours = {
|
|
1870
|
+
init: () => ({
|
|
1871
|
+
...clearComposer,
|
|
1872
|
+
snapshot: null,
|
|
1873
|
+
sending: null,
|
|
1874
|
+
deliveryFailed: false,
|
|
1875
|
+
disconnected: false,
|
|
1876
|
+
open: false,
|
|
1877
|
+
maximized: false
|
|
1878
|
+
}),
|
|
1879
|
+
subscriptions: () => [
|
|
1880
|
+
Subscription.make("agent/conversation", Stream2.unwrap(Effect4.map(ConversationHost, (host) => host.snapshots.pipe(Stream2.map((snapshot) => AgentWidgetMessage.Received({
|
|
1881
|
+
snapshot: Redacted3.make(snapshot)
|
|
1882
|
+
})), Stream2.concat(Stream2.make(AgentWidgetMessage.Disconnected()))))))
|
|
1883
|
+
],
|
|
1884
|
+
update: Definition2.update({
|
|
1885
|
+
Received: ($, { snapshot }) => {
|
|
1886
|
+
const valid = new Set(allowedKeys(Redacted3.value(snapshot)));
|
|
1887
|
+
return $.evolve({
|
|
1888
|
+
snapshot,
|
|
1889
|
+
references: $.model.references.filter((key) => valid.has(key))
|
|
1890
|
+
});
|
|
1891
|
+
},
|
|
1892
|
+
Disconnected: ($) => $.evolve({ disconnected: true }),
|
|
1893
|
+
OpenChanged: ($, { open }) => $.evolve({ open }),
|
|
1894
|
+
ToggleMaximize: ($) => $.evolve({ maximized: !$.model.maximized }),
|
|
1895
|
+
DraftChanged: ($, { value }) => canCompose($.model) ? $.evolve({ draft: value }) : $.model,
|
|
1896
|
+
ReferenceToggled: ($, { key }) => {
|
|
1897
|
+
const snapshot = readAgentWidgetSnapshot($.model);
|
|
1898
|
+
const { references } = $.model;
|
|
1899
|
+
if (!canCompose($.model) || !snapshot || !allowedKeys(snapshot).includes(key))
|
|
1900
|
+
return $.model;
|
|
1901
|
+
if (references.includes(key))
|
|
1902
|
+
return $.evolve({
|
|
1903
|
+
references: references.filter((entry) => entry !== key)
|
|
1904
|
+
});
|
|
1905
|
+
return references.length < AGENT_REFERENCE_LIMIT ? $.evolve({ references: [...references, key] }) : $.model;
|
|
1906
|
+
},
|
|
1907
|
+
Send: ($) => canSend($.model) ? sendIntent($, {
|
|
1908
|
+
_tag: "Submit",
|
|
1909
|
+
text: Redacted3.make(agentDraftText(Redacted3.value($.model.draft))),
|
|
1910
|
+
referenceKeys: $.model.references
|
|
1911
|
+
}) : $.model,
|
|
1912
|
+
Approval: ($, { approved, approvalId, toolCallId }) => {
|
|
1913
|
+
const snapshot = readAgentWidgetSnapshot($.model);
|
|
1914
|
+
return !snapshot?.pending && !$.model.sending && !$.model.disconnected && snapshot?.messages.some(({ tools }) => tools.some((tool) => tool.status === "approval-required" && tool.approvalId === approvalId && tool.toolCallId === toolCallId)) ? sendIntent($, {
|
|
1915
|
+
_tag: "DecideApproval",
|
|
1916
|
+
approved,
|
|
1917
|
+
approvalId,
|
|
1918
|
+
toolCallId
|
|
1919
|
+
}) : $.model;
|
|
1920
|
+
},
|
|
1921
|
+
Interrupt: ($) => !$.model.sending && !$.model.disconnected && readAgentWidgetSnapshot($.model)?.pending ? sendIntent($, { _tag: "Interrupt" }) : $.model,
|
|
1922
|
+
Reset: ($) => !$.model.sending && !$.model.disconnected && $.model.snapshot ? sendIntent($, { _tag: "Reset" }) : $.model,
|
|
1923
|
+
RemoveContext: ($) => {
|
|
1924
|
+
const snapshot = readAgentWidgetSnapshot($.model);
|
|
1925
|
+
return snapshot?.context && !snapshot.contextLocked && canCompose($.model) ? sendIntent($, { _tag: "RemoveContext" }) : $.model;
|
|
1926
|
+
},
|
|
1927
|
+
Delivered: ($, { success }) => $.evolve({
|
|
1928
|
+
...success && ($.model.sending === "Submit" || $.model.sending === "Reset") ? clearComposer : {},
|
|
1929
|
+
sending: null,
|
|
1930
|
+
deliveryFailed: !success
|
|
1931
|
+
})
|
|
1932
|
+
})
|
|
1933
|
+
};
|
|
1934
|
+
|
|
1935
|
+
// ../../src/components/agent/react.tsx
|
|
1936
|
+
import { jsx as jsx19, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1937
|
+
var messages2 = {
|
|
1938
|
+
en: {
|
|
1939
|
+
codeDescription: (language) => `${language} code`,
|
|
1940
|
+
copied: "Copied",
|
|
1941
|
+
copy: "Copy",
|
|
1942
|
+
minimize: "Minimize assistant",
|
|
1943
|
+
noReferences: "No references found.",
|
|
1944
|
+
scrollLatest: "Scroll to latest message",
|
|
1945
|
+
toolWorked: (seconds) => `Worked for ${seconds} ${seconds === 1 ? "second" : "seconds"}`,
|
|
1946
|
+
viewLess: "View less"
|
|
1947
|
+
},
|
|
1948
|
+
fr: {
|
|
1949
|
+
codeDescription: (language) => `code ${language}`,
|
|
1950
|
+
copied: "Copié",
|
|
1951
|
+
copy: "Copier",
|
|
1952
|
+
minimize: "Réduire l'assistant",
|
|
1953
|
+
noReferences: "Aucune référence trouvée.",
|
|
1954
|
+
scrollLatest: "Défiler jusqu'au dernier message",
|
|
1955
|
+
toolWorked: (seconds) => `A travaillé pendant ${seconds} ${seconds === 1 ? "seconde" : "secondes"}`,
|
|
1956
|
+
viewLess: "Voir moins"
|
|
1957
|
+
}
|
|
1958
|
+
};
|
|
1959
|
+
var agentWidgetMessages = (locale = "en", translations) => {
|
|
1960
|
+
const language = locale.startsWith("fr") ? "fr" : "en";
|
|
1961
|
+
const {
|
|
1962
|
+
approved: _approved,
|
|
1963
|
+
completed: _completed,
|
|
1964
|
+
conversation: _conversation,
|
|
1965
|
+
errors,
|
|
1966
|
+
reset: _reset,
|
|
1967
|
+
you: _you,
|
|
1968
|
+
...shared
|
|
1969
|
+
} = defaultMessages[language];
|
|
1970
|
+
return {
|
|
1971
|
+
...shared,
|
|
1972
|
+
...messages2[language],
|
|
1973
|
+
errorInvalidRequest: errors["invalid-request"],
|
|
1974
|
+
errorStreamFailed: errors["stream-failed"],
|
|
1975
|
+
errorUnavailable: errors.unavailable,
|
|
1976
|
+
...translations?.[locale.split("-")[0] ?? locale],
|
|
1977
|
+
...translations?.[locale]
|
|
1978
|
+
};
|
|
1979
|
+
};
|
|
1463
1980
|
var errorMessage = (code, labels) => {
|
|
1464
1981
|
switch (code) {
|
|
1465
1982
|
case "invalid-request":
|
|
@@ -1470,7 +1987,6 @@ var errorMessage = (code, labels) => {
|
|
|
1470
1987
|
return labels.errorUnavailable;
|
|
1471
1988
|
}
|
|
1472
1989
|
};
|
|
1473
|
-
var inputCode = (input) => JSON.stringify(input, null, 2) ?? String(input);
|
|
1474
1990
|
var escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1475
1991
|
var referenceMentionPattern = (label) => new RegExp(`@${escapeRegExp(label)}(?![\\p{L}\\p{N}_-])`, "u");
|
|
1476
1992
|
var hasReferenceMention = (input, label) => referenceMentionPattern(label).test(input);
|
|
@@ -1520,7 +2036,7 @@ var ToolInput = ({
|
|
|
1520
2036
|
children: tool.metadata.description
|
|
1521
2037
|
}) : null,
|
|
1522
2038
|
/* @__PURE__ */ jsx19(CodeBlock, {
|
|
1523
|
-
code:
|
|
2039
|
+
code: agentToolInput(tool.input),
|
|
1524
2040
|
language: "json",
|
|
1525
2041
|
locale,
|
|
1526
2042
|
messages: {
|
|
@@ -1659,7 +2175,7 @@ function ToolActivityLog({
|
|
|
1659
2175
|
tools,
|
|
1660
2176
|
workedSeconds
|
|
1661
2177
|
}) {
|
|
1662
|
-
const [open, setOpen] =
|
|
2178
|
+
const [open, setOpen] = useState3();
|
|
1663
2179
|
const approvals = tools.filter((tool) => tool.status === "approval-required");
|
|
1664
2180
|
const activity = tools.filter((tool) => tool.status !== "approval-required");
|
|
1665
2181
|
const currentTool = activity.at(-1);
|
|
@@ -1736,10 +2252,10 @@ function AgentMessageRow({
|
|
|
1736
2252
|
pending
|
|
1737
2253
|
}) {
|
|
1738
2254
|
const isUser = message.role === "user";
|
|
1739
|
-
const activeStartedAt =
|
|
1740
|
-
const activeMilliseconds =
|
|
1741
|
-
const wasPending =
|
|
1742
|
-
const [workedSeconds, setWorkedSeconds] =
|
|
2255
|
+
const activeStartedAt = useRef3(undefined);
|
|
2256
|
+
const activeMilliseconds = useRef3(0);
|
|
2257
|
+
const wasPending = useRef3(pending);
|
|
2258
|
+
const [workedSeconds, setWorkedSeconds] = useState3();
|
|
1743
2259
|
const hasPendingApproval = message.tools.some((tool) => tool.status === "approval-required");
|
|
1744
2260
|
useEffect2(() => {
|
|
1745
2261
|
const isWorking = pending && !hasPendingApproval;
|
|
@@ -1826,15 +2342,15 @@ function AgentWidget({
|
|
|
1826
2342
|
const labels = agentWidgetMessages(locale, messageOverrides);
|
|
1827
2343
|
const referenceInputId = useId();
|
|
1828
2344
|
const referenceListId = `${referenceInputId}-list`;
|
|
1829
|
-
const [open, setOpen] =
|
|
1830
|
-
const [maximized, setMaximized] =
|
|
1831
|
-
const [referencePickerOpen, setReferencePickerOpen] =
|
|
1832
|
-
const [activeReferenceKey, setActiveReferenceKey] =
|
|
1833
|
-
const [activeReferenceSearch, setActiveReferenceSearch] =
|
|
1834
|
-
const [input, setInput] =
|
|
1835
|
-
const inputRef =
|
|
1836
|
-
const inputOverlayRef =
|
|
1837
|
-
const [references, setReferences] =
|
|
2345
|
+
const [open, setOpen] = useState3(false);
|
|
2346
|
+
const [maximized, setMaximized] = useState3(false);
|
|
2347
|
+
const [referencePickerOpen, setReferencePickerOpen] = useState3(false);
|
|
2348
|
+
const [activeReferenceKey, setActiveReferenceKey] = useState3("");
|
|
2349
|
+
const [activeReferenceSearch, setActiveReferenceSearch] = useState3();
|
|
2350
|
+
const [input, setInput] = useState3("");
|
|
2351
|
+
const inputRef = useRef3(null);
|
|
2352
|
+
const inputOverlayRef = useRef3(null);
|
|
2353
|
+
const [references, setReferences] = useState3([]);
|
|
1838
2354
|
const activeContext = state.contextLocked ? state.context ? {
|
|
1839
2355
|
...state.context,
|
|
1840
2356
|
icon: availableReferences.find(({ key }) => key === state.context?.key)?.icon
|
|
@@ -1846,10 +2362,10 @@ function AgentWidget({
|
|
|
1846
2362
|
const matchingReferences = selectableReferences.filter((reference) => referenceQuery === undefined ? false : `${reference.label} ${reference.key}`.toLocaleLowerCase().includes(referenceQuery.toLocaleLowerCase()));
|
|
1847
2363
|
const activeReferenceIndex = Math.max(0, matchingReferences.findIndex((reference) => reference.key === activeReferenceKey));
|
|
1848
2364
|
const activeReference = matchingReferences[activeReferenceIndex];
|
|
1849
|
-
const
|
|
2365
|
+
const hasPendingApproval2 = hasPendingApproval(state.messages);
|
|
1850
2366
|
const sendMessage = () => {
|
|
1851
|
-
const text = input
|
|
1852
|
-
if (!text || state.pending ||
|
|
2367
|
+
const text = agentDraftText(input);
|
|
2368
|
+
if (!text || state.pending || hasPendingApproval2)
|
|
1853
2369
|
return;
|
|
1854
2370
|
setInput("");
|
|
1855
2371
|
setReferences([]);
|
|
@@ -2105,7 +2621,7 @@ function AgentWidget({
|
|
|
2105
2621
|
"aria-autocomplete": "list",
|
|
2106
2622
|
"aria-controls": referenceListId,
|
|
2107
2623
|
"aria-expanded": referencePickerOpen,
|
|
2108
|
-
disabled: state.pending ||
|
|
2624
|
+
disabled: state.pending || hasPendingApproval2,
|
|
2109
2625
|
role: "combobox",
|
|
2110
2626
|
rows: 2,
|
|
2111
2627
|
onScroll: (event) => {
|
|
@@ -2152,7 +2668,7 @@ function AgentWidget({
|
|
|
2152
2668
|
initialFocus: false,
|
|
2153
2669
|
side: "top",
|
|
2154
2670
|
className: "w-[min(24rem,calc(100vw-2rem))] p-0",
|
|
2155
|
-
children: /* @__PURE__ */ jsx19(
|
|
2671
|
+
children: /* @__PURE__ */ jsx19(Command2, {
|
|
2156
2672
|
shouldFilter: false,
|
|
2157
2673
|
value: activeReference?.key ?? "",
|
|
2158
2674
|
onValueChange: setActiveReferenceKey,
|
|
@@ -2201,7 +2717,7 @@ function AgentWidget({
|
|
|
2201
2717
|
}) : /* @__PURE__ */ jsxs7(InputGroupButton, {
|
|
2202
2718
|
type: "submit",
|
|
2203
2719
|
size: "icon-xs",
|
|
2204
|
-
disabled: !input.trim() ||
|
|
2720
|
+
disabled: !input.trim() || hasPendingApproval2,
|
|
2205
2721
|
children: [
|
|
2206
2722
|
/* @__PURE__ */ jsx19(SendIcon, {}),
|
|
2207
2723
|
/* @__PURE__ */ jsx19("span", {
|