@tylertech/forge-ai 0.15.3-dev.0 → 0.16.0-dev.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/MIGRATION.md +192 -0
- package/README.md +76 -2
- package/custom-elements.json +5156 -13880
- package/dist/_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.mjs +9 -0
- package/dist/ai-agent-info/ai-agent-info.mjs +4 -78
- package/dist/ai-agent-info/ai-agent-info2.mjs +55 -0
- package/dist/ai-agent-info/index.d.ts +1 -1
- package/dist/ai-agent-info/index.mjs +1 -5
- package/dist/ai-agent-selector/ai-agent-selector.d.ts +2 -2
- package/dist/ai-agent-selector/ai-agent-selector.mjs +4 -439
- package/dist/ai-agent-selector/ai-agent-selector2.mjs +344 -0
- package/dist/ai-agent-selector/index.mjs +1 -5
- package/dist/ai-artifact/ai-artifact.mjs +4 -39
- package/dist/ai-artifact/ai-artifact2.mjs +31 -0
- package/dist/ai-artifact/index.d.ts +1 -1
- package/dist/ai-artifact/index.mjs +1 -5
- package/dist/ai-artifact-card/ai-artifact-card.mjs +4 -142
- package/dist/ai-artifact-card/ai-artifact-card2.mjs +103 -0
- package/dist/ai-artifact-card/index.d.ts +1 -1
- package/dist/ai-artifact-card/index.mjs +1 -5
- package/dist/ai-artifact-card-group/ai-artifact-card-group.mjs +4 -137
- package/dist/ai-artifact-card-group/ai-artifact-card-group2.mjs +100 -0
- package/dist/ai-artifact-card-group/index.d.ts +1 -1
- package/dist/ai-artifact-card-group/index.mjs +1 -5
- package/dist/ai-assistant-response/ai-assistant-response.d.ts +2 -3
- package/dist/ai-assistant-response/ai-assistant-response.mjs +4 -235
- package/dist/ai-assistant-response/ai-assistant-response2.mjs +137 -0
- package/dist/ai-assistant-response/index.d.ts +1 -1
- package/dist/ai-assistant-response/index.mjs +1 -5
- package/dist/ai-canvas/ai-canvas.d.ts +43 -0
- package/dist/ai-canvas/ai-canvas.mjs +4 -0
- package/dist/ai-canvas/ai-canvas2.mjs +74 -0
- package/dist/ai-canvas/index.d.ts +1 -0
- package/dist/ai-canvas/index.mjs +1 -0
- package/dist/ai-chain-of-thought/ai-chain-of-thought.mjs +4 -45
- package/dist/ai-chain-of-thought/ai-chain-of-thought2.mjs +35 -0
- package/dist/ai-chain-of-thought/index.d.ts +5 -5
- package/dist/ai-chain-of-thought/index.mjs +6 -17
- package/dist/ai-chain-of-thought/thought-base/index.mjs +1 -5
- package/dist/ai-chain-of-thought/thought-base/thought-base.mjs +4 -43
- package/dist/ai-chain-of-thought/thought-base/thought-base2.mjs +31 -0
- package/dist/ai-chain-of-thought/thought-detail/index.mjs +1 -5
- package/dist/ai-chain-of-thought/thought-detail/thought-detail.mjs +4 -34
- package/dist/ai-chain-of-thought/thought-detail/thought-detail2.mjs +26 -0
- package/dist/ai-chain-of-thought/thought-image/index.mjs +1 -5
- package/dist/ai-chain-of-thought/thought-image/thought-image.mjs +4 -43
- package/dist/ai-chain-of-thought/thought-image/thought-image2.mjs +30 -0
- package/dist/ai-chain-of-thought/thought-search-result/index.mjs +1 -5
- package/dist/ai-chain-of-thought/thought-search-result/thought-search-result.mjs +4 -62
- package/dist/ai-chain-of-thought/thought-search-result/thought-search-result2.mjs +45 -0
- package/dist/ai-chat-header/ai-chat-header.d.ts +7 -5
- package/dist/ai-chat-header/ai-chat-header.mjs +4 -439
- package/dist/ai-chat-header/ai-chat-header2.mjs +319 -0
- package/dist/ai-chat-header/index.d.ts +2 -2
- package/dist/ai-chat-header/index.mjs +1 -5
- package/dist/ai-chat-interface/ai-chat-interface.d.ts +1 -0
- package/dist/ai-chat-interface/ai-chat-interface.mjs +4 -103
- package/dist/ai-chat-interface/ai-chat-interface2.mjs +73 -0
- package/dist/ai-chat-interface/index.mjs +1 -5
- package/dist/ai-client-message/ai-client-message.d.ts +5 -6
- package/dist/ai-client-message/ai-client-message.mjs +4 -112
- package/dist/ai-client-message/ai-client-message2.mjs +76 -0
- package/dist/ai-client-message/index.mjs +1 -5
- package/dist/ai-context-chip/ai-context-chip.d.ts +1 -1
- package/dist/ai-context-chip/ai-context-chip.mjs +4 -169
- package/dist/ai-context-chip/ai-context-chip2.mjs +113 -0
- package/dist/ai-context-chip/index.mjs +1 -5
- package/dist/ai-context-items/ai-context-items.d.ts +11 -5
- package/dist/ai-context-items/ai-context-items.mjs +4 -78
- package/dist/ai-context-items/ai-context-items2.mjs +53 -0
- package/dist/ai-context-items/index.d.ts +1 -1
- package/dist/ai-context-items/index.mjs +1 -5
- package/dist/ai-conversations-panel/ai-conversations-panel.d.ts +2 -2
- package/dist/ai-conversations-panel/ai-conversations-panel.mjs +4 -632
- package/dist/ai-conversations-panel/ai-conversations-panel2.mjs +531 -0
- package/dist/ai-conversations-panel/index.mjs +1 -5
- package/dist/ai-copy-button/ai-copy-button.mjs +4 -116
- package/dist/ai-copy-button/ai-copy-button2.mjs +88 -0
- package/dist/ai-copy-button/index.mjs +1 -5
- package/dist/ai-dialog/ai-dialog.mjs +4 -304
- package/dist/ai-dialog/ai-dialog2.mjs +237 -0
- package/dist/ai-dialog/index.d.ts +1 -1
- package/dist/ai-dialog/index.mjs +1 -5
- package/dist/ai-disclaimer/ai-disclaimer.mjs +4 -70
- package/dist/ai-disclaimer/ai-disclaimer2.mjs +46 -0
- package/dist/ai-disclaimer/index.d.ts +1 -1
- package/dist/ai-disclaimer/index.mjs +1 -5
- package/dist/ai-dropdown-menu/ai-dropdown-menu-item-group.mjs +4 -80
- package/dist/ai-dropdown-menu/ai-dropdown-menu-item-group2.mjs +51 -0
- package/dist/ai-dropdown-menu/ai-dropdown-menu-item.d.ts +5 -1
- package/dist/ai-dropdown-menu/ai-dropdown-menu-item.mjs +4 -330
- package/dist/ai-dropdown-menu/ai-dropdown-menu-item2.mjs +280 -0
- package/dist/ai-dropdown-menu/ai-dropdown-menu-separator.mjs +4 -26
- package/dist/ai-dropdown-menu/ai-dropdown-menu-separator2.mjs +19 -0
- package/dist/ai-dropdown-menu/ai-dropdown-menu.d.ts +5 -0
- package/dist/ai-dropdown-menu/ai-dropdown-menu.mjs +4 -351
- package/dist/ai-dropdown-menu/ai-dropdown-menu2.mjs +268 -0
- package/dist/ai-dropdown-menu/index.d.ts +1 -0
- package/dist/ai-dropdown-menu/index.mjs +5 -10
- package/dist/ai-dropdown-menu/navigation-controller.d.ts +9 -1
- package/dist/ai-dropdown-menu/navigation-controller.mjs +214 -204
- package/dist/ai-dropdown-menu/selection-manager.mjs +202 -182
- package/dist/ai-edit-thread/ai-edit-thread.d.ts +1 -1
- package/dist/ai-edit-thread/ai-edit-thread.mjs +4 -137
- package/dist/ai-edit-thread/ai-edit-thread2.mjs +96 -0
- package/dist/ai-edit-thread/index.d.ts +1 -1
- package/dist/ai-edit-thread/index.mjs +1 -5
- package/dist/ai-empty-state/ai-empty-state.mjs +4 -38
- package/dist/ai-empty-state/ai-empty-state2.mjs +28 -0
- package/dist/ai-empty-state/index.d.ts +1 -1
- package/dist/ai-empty-state/index.mjs +1 -5
- package/dist/ai-error-message/ai-error-message.mjs +4 -80
- package/dist/ai-error-message/ai-error-message2.mjs +62 -0
- package/dist/ai-error-message/index.mjs +1 -5
- package/dist/ai-fab/ai-fab.mjs +4 -81
- package/dist/ai-fab/ai-fab2.mjs +54 -0
- package/dist/ai-fab/index.d.ts +1 -1
- package/dist/ai-fab/index.mjs +1 -5
- package/dist/ai-file-picker/ai-file-picker.d.ts +1 -0
- package/dist/ai-file-picker/ai-file-picker.mjs +4 -224
- package/dist/ai-file-picker/ai-file-picker2.mjs +172 -0
- package/dist/ai-file-picker/index.mjs +1 -4
- package/dist/ai-gradient-container/ai-gradient-container.mjs +4 -61
- package/dist/ai-gradient-container/ai-gradient-container2.mjs +38 -0
- package/dist/ai-gradient-container/index.d.ts +1 -1
- package/dist/ai-gradient-container/index.mjs +1 -5
- package/dist/ai-icon/ai-icon.d.ts +3 -0
- package/dist/ai-icon/ai-icon.mjs +4 -71
- package/dist/ai-icon/ai-icon2.mjs +41 -0
- package/dist/ai-icon/index.d.ts +1 -1
- package/dist/ai-icon/index.mjs +1 -5
- package/dist/ai-message-thread/ai-message-thread.d.ts +5 -4
- package/dist/ai-message-thread/ai-message-thread.mjs +4 -359
- package/dist/ai-message-thread/ai-message-thread2.mjs +279 -0
- package/dist/ai-message-thread/index.mjs +1 -5
- package/dist/ai-modal/ai-modal.mjs +4 -178
- package/dist/ai-modal/ai-modal2.mjs +141 -0
- package/dist/ai-modal/index.mjs +1 -4
- package/dist/ai-prompt/ai-prompt.d.ts +10 -6
- package/dist/ai-prompt/ai-prompt.mjs +4 -534
- package/dist/ai-prompt/ai-prompt2.mjs +438 -0
- package/dist/ai-prompt/index.mjs +1 -5
- package/dist/ai-reasoning/ai-reasoning.mjs +4 -44
- package/dist/ai-reasoning/ai-reasoning2.mjs +35 -0
- package/dist/ai-reasoning/index.d.ts +2 -2
- package/dist/ai-reasoning/index.mjs +4 -8
- package/dist/ai-reasoning/reasoning-content/index.d.ts +1 -1
- package/dist/ai-reasoning/reasoning-content/index.mjs +1 -5
- package/dist/ai-reasoning/reasoning-content/reasoning-content.mjs +4 -90
- package/dist/ai-reasoning/reasoning-content/reasoning-content2.mjs +68 -0
- package/dist/ai-reasoning-header/ai-reasoning-header.d.ts +7 -1
- package/dist/ai-reasoning-header/ai-reasoning-header.mjs +4 -68
- package/dist/ai-reasoning-header/ai-reasoning-header2.mjs +51 -0
- package/dist/ai-reasoning-header/index.d.ts +1 -1
- package/dist/ai-reasoning-header/index.mjs +1 -5
- package/dist/ai-response-message/ai-response-message.mjs +4 -25
- package/dist/ai-response-message/ai-response-message2.mjs +17 -0
- package/dist/ai-response-message/index.mjs +1 -5
- package/dist/ai-response-message-toolbar/ai-response-message-toolbar.d.ts +1 -1
- package/dist/ai-response-message-toolbar/ai-response-message-toolbar.mjs +4 -230
- package/dist/ai-response-message-toolbar/ai-response-message-toolbar2.mjs +171 -0
- package/dist/ai-response-message-toolbar/index.mjs +1 -5
- package/dist/ai-sidebar/ai-sidebar.d.ts +4 -4
- package/dist/ai-sidebar/ai-sidebar.mjs +4 -256
- package/dist/ai-sidebar/ai-sidebar2.mjs +211 -0
- package/dist/ai-sidebar/index.d.ts +2 -2
- package/dist/ai-sidebar/index.mjs +1 -5
- package/dist/ai-slash-command-menu/ai-slash-command-menu.d.ts +1 -1
- package/dist/ai-slash-command-menu/ai-slash-command-menu.mjs +4 -200
- package/dist/ai-slash-command-menu/ai-slash-command-menu2.mjs +156 -0
- package/dist/ai-slash-command-menu/index.mjs +1 -5
- package/dist/ai-spinner/ai-spinner.mjs +4 -41
- package/dist/ai-spinner/ai-spinner2.mjs +29 -0
- package/dist/ai-spinner/index.d.ts +1 -1
- package/dist/ai-spinner/index.mjs +1 -5
- package/dist/ai-steps/ai-steps.mjs +4 -163
- package/dist/ai-steps/ai-steps2.mjs +133 -0
- package/dist/ai-steps/index.d.ts +1 -1
- package/dist/ai-steps/index.mjs +1 -5
- package/dist/ai-suggestions/ai-suggestions.d.ts +2 -5
- package/dist/ai-suggestions/ai-suggestions.mjs +4 -164
- package/dist/ai-suggestions/ai-suggestions2.mjs +125 -0
- package/dist/ai-suggestions/index.d.ts +2 -1
- package/dist/ai-suggestions/index.mjs +1 -5
- package/dist/ai-thinking-indicator/ai-thinking-indicator.d.ts +2 -1
- package/dist/ai-thinking-indicator/ai-thinking-indicator.mjs +4 -160
- package/dist/ai-thinking-indicator/ai-thinking-indicator2.mjs +143 -0
- package/dist/ai-thinking-indicator/index.d.ts +1 -1
- package/dist/ai-thinking-indicator/index.mjs +1 -5
- package/dist/ai-thread-actions-menu/ai-thread-actions-menu.d.ts +2 -2
- package/dist/ai-thread-actions-menu/ai-thread-actions-menu.mjs +4 -152
- package/dist/ai-thread-actions-menu/ai-thread-actions-menu2.mjs +109 -0
- package/dist/ai-thread-actions-menu/index.d.ts +1 -1
- package/dist/ai-thread-actions-menu/index.mjs +1 -5
- package/dist/ai-threads-search/ai-threads-search.d.ts +3 -4
- package/dist/ai-threads-search/ai-threads-search.mjs +4 -602
- package/dist/ai-threads-search/ai-threads-search2.mjs +495 -0
- package/dist/ai-threads-search/index.d.ts +1 -1
- package/dist/ai-threads-search/index.mjs +1 -5
- package/dist/ai-tool-call/ai-tool-call.d.ts +21 -0
- package/dist/ai-tool-call/ai-tool-call.mjs +4 -0
- package/dist/ai-tool-call/ai-tool-call2.mjs +132 -0
- package/dist/ai-tool-call/create-tool-renderer.d.ts +9 -0
- package/dist/ai-tool-call/create-tool-renderer.mjs +10 -0
- package/dist/ai-tool-call/index.d.ts +6 -0
- package/dist/ai-tool-call/index.mjs +5 -0
- package/dist/ai-tool-call/tool-canvas.d.ts +60 -0
- package/dist/ai-tool-call/tool-canvas.mjs +135 -0
- package/dist/ai-tool-call/utils.d.ts +12 -0
- package/dist/ai-tool-call/utils.mjs +20 -0
- package/dist/ai-tool-call-indicator/ai-tool-call-indicator.d.ts +2 -2
- package/dist/ai-tool-call-indicator/ai-tool-call-indicator.mjs +4 -331
- package/dist/ai-tool-call-indicator/ai-tool-call-indicator2.mjs +225 -0
- package/dist/ai-tool-call-indicator/index.mjs +1 -5
- package/dist/ai-user-message/ai-user-message.mjs +4 -151
- package/dist/ai-user-message/ai-user-message2.mjs +105 -0
- package/dist/ai-user-message/index.mjs +1 -5
- package/dist/ai-user-message-toolbar/ai-user-message-toolbar.mjs +4 -160
- package/dist/ai-user-message-toolbar/ai-user-message-toolbar2.mjs +102 -0
- package/dist/ai-user-message-toolbar/index.mjs +1 -5
- package/dist/ai-voice-input/ai-voice-input.d.ts +1 -1
- package/dist/ai-voice-input/ai-voice-input.mjs +4 -113
- package/dist/ai-voice-input/ai-voice-input2.mjs +92 -0
- package/dist/ai-voice-input/index.d.ts +1 -1
- package/dist/ai-voice-input/index.mjs +1 -5
- package/dist/core/drag-controller.mjs +196 -221
- package/dist/core/index.d.ts +4 -2
- package/dist/core/index.mjs +7 -6
- package/dist/core/overlay/index.mjs +1 -4
- package/dist/core/overlay/overlay.d.ts +1 -1
- package/dist/core/overlay/overlay.mjs +4 -180
- package/dist/core/overlay/overlay2.mjs +146 -0
- package/dist/core/popover/index.mjs +1 -4
- package/dist/core/popover/popover.mjs +4 -98
- package/dist/core/popover/popover2.mjs +71 -0
- package/dist/core/resize-controller.d.ts +5 -0
- package/dist/core/resize-controller.mjs +132 -152
- package/dist/core/tooltip/index.mjs +1 -4
- package/dist/core/tooltip/tooltip.mjs +4 -279
- package/dist/core/tooltip/tooltip2.mjs +213 -0
- package/dist/index.d.ts +45 -52
- package/dist/index.mjs +100 -208
- package/dist/jsx.d.ts +895 -0
- package/dist/tools/ai-data-table/ai-data-table.d.ts +1 -2
- package/dist/tools/ai-data-table/ai-data-table.mjs +4 -257
- package/dist/tools/ai-data-table/ai-data-table2.mjs +185 -0
- package/dist/tools/ai-data-table/index.d.ts +0 -1
- package/dist/tools/ai-data-table/index.mjs +1 -6
- package/dist/tools/ai-paginator/ai-paginator.d.ts +14 -0
- package/dist/tools/ai-paginator/ai-paginator.mjs +4 -115
- package/dist/tools/ai-paginator/ai-paginator2.mjs +90 -0
- package/dist/tools/ai-paginator/index.mjs +1 -4
- package/dist/tools/ai-steps/ai-steps.d.ts +2 -3
- package/dist/tools/ai-steps/ai-steps.mjs +4 -49
- package/dist/tools/ai-steps/ai-steps2.mjs +30 -0
- package/dist/tools/ai-steps/index.d.ts +0 -1
- package/dist/tools/ai-steps/index.mjs +1 -6
- package/dist/tools/index.d.ts +3 -3
- package/dist/tools/index.mjs +7 -12
- package/dist/types/chat.d.ts +102 -0
- package/dist/types/feature.d.ts +1 -0
- package/dist/types/file.d.ts +36 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.mjs +0 -0
- package/dist/types/thread.d.ts +14 -0
- package/dist/types/tool.d.ts +197 -0
- package/dist/utils/csv-utils.mjs +37 -57
- package/dist/utils/delete-thread-controller.d.ts +1 -1
- package/dist/utils/delete-thread-controller.mjs +48 -71
- package/dist/utils/dom.d.ts +14 -0
- package/dist/utils/dom.mjs +30 -0
- package/dist/utils/format.d.ts +9 -0
- package/dist/utils/format.mjs +27 -0
- package/dist/utils/index.d.ts +9 -6
- package/dist/utils/index.mjs +6 -16
- package/dist/utils/infinite-scroll-controller.mjs +88 -94
- package/dist/utils/keyboard-navigation-controller.mjs +62 -70
- package/dist/utils/markdown-stream-controller.mjs +48 -0
- package/dist/utils/markdown.d.ts +10 -1
- package/dist/utils/markdown.mjs +261 -40
- package/dist/utils/storage-utils.mjs +30 -24
- package/package.json +39 -103
- package/dist/ai-agent-info/ai-agent-info.scss.mjs +0 -4
- package/dist/ai-agent-selector/ai-agent-selector.scss.mjs +0 -4
- package/dist/ai-artifact/ai-artifact.scss.mjs +0 -4
- package/dist/ai-artifact-card/ai-artifact-card.scss.mjs +0 -283
- package/dist/ai-artifact-card-group/ai-artifact-card-group.scss.mjs +0 -173
- package/dist/ai-assistant-response/ai-assistant-response.scss.mjs +0 -4
- package/dist/ai-attachment/ai-attachment.d.ts +0 -39
- package/dist/ai-attachment/ai-attachment.mjs +0 -130
- package/dist/ai-attachment/ai-attachment.scss.mjs +0 -4
- package/dist/ai-attachment/index.d.ts +0 -1
- package/dist/ai-attachment/index.mjs +0 -5
- package/dist/ai-button/ai-button.d.ts +0 -21
- package/dist/ai-button/ai-button.mjs +0 -68
- package/dist/ai-button/ai-button.scss.mjs +0 -4
- package/dist/ai-button/index.d.ts +0 -1
- package/dist/ai-button/index.mjs +0 -5
- package/dist/ai-chain-of-thought/ai-chain-of-thought.scss.mjs +0 -4
- package/dist/ai-chain-of-thought/thought-base/thought-base.scss.mjs +0 -4
- package/dist/ai-chain-of-thought/thought-detail/thought-detail.scss.mjs +0 -4
- package/dist/ai-chain-of-thought/thought-image/thought-image.scss.mjs +0 -4
- package/dist/ai-chain-of-thought/thought-search-result/thought-search-result.scss.mjs +0 -4
- package/dist/ai-chat-header/ai-chat-header.scss.mjs +0 -4
- package/dist/ai-chat-interface/ai-chat-interface.scss.mjs +0 -4
- package/dist/ai-chatbot/ag-ui-adapter.d.ts +0 -24
- package/dist/ai-chatbot/ag-ui-adapter.mjs +0 -388
- package/dist/ai-chatbot/agent-adapter.d.ts +0 -310
- package/dist/ai-chatbot/agent-adapter.mjs +0 -221
- package/dist/ai-chatbot/agent-runner.d.ts +0 -41
- package/dist/ai-chatbot/agent-runner.mjs +0 -265
- package/dist/ai-chatbot/ai-chatbot-base.d.ts +0 -178
- package/dist/ai-chatbot/ai-chatbot-base.mjs +0 -673
- package/dist/ai-chatbot/ai-chatbot-tool-call.d.ts +0 -19
- package/dist/ai-chatbot/ai-chatbot-tool-call.mjs +0 -104
- package/dist/ai-chatbot/ai-chatbot-tool-call.scss.mjs +0 -4
- package/dist/ai-chatbot/ai-chatbot.d.ts +0 -173
- package/dist/ai-chatbot/ai-chatbot.mjs +0 -402
- package/dist/ai-chatbot/ai-chatbot.scss.mjs +0 -4
- package/dist/ai-chatbot/create-tool-renderer.d.ts +0 -9
- package/dist/ai-chatbot/create-tool-renderer.mjs +0 -16
- package/dist/ai-chatbot/event-emitter.d.ts +0 -43
- package/dist/ai-chatbot/event-emitter.mjs +0 -81
- package/dist/ai-chatbot/file-upload-manager.d.ts +0 -27
- package/dist/ai-chatbot/file-upload-manager.mjs +0 -106
- package/dist/ai-chatbot/http-agent-with-credentials.d.ts +0 -8
- package/dist/ai-chatbot/http-agent-with-credentials.mjs +0 -14
- package/dist/ai-chatbot/index.d.ts +0 -17
- package/dist/ai-chatbot/index.mjs +0 -37
- package/dist/ai-chatbot/markdown-stream-controller.mjs +0 -50
- package/dist/ai-chatbot/message-state-controller.d.ts +0 -72
- package/dist/ai-chatbot/message-state-controller.mjs +0 -392
- package/dist/ai-chatbot/request-serialization.d.ts +0 -33
- package/dist/ai-chatbot/request-serialization.mjs +0 -31
- package/dist/ai-chatbot/types.d.ts +0 -470
- package/dist/ai-chatbot/utils.d.ts +0 -44
- package/dist/ai-chatbot/utils.mjs +0 -110
- package/dist/ai-chatbot-launcher/ai-chatbot-launcher.d.ts +0 -152
- package/dist/ai-chatbot-launcher/ai-chatbot-launcher.mjs +0 -767
- package/dist/ai-chatbot-launcher/ai-chatbot-launcher.scss.mjs +0 -4
- package/dist/ai-chatbot-launcher/index.d.ts +0 -1
- package/dist/ai-chatbot-launcher/index.mjs +0 -5
- package/dist/ai-client-message/ai-client-message.scss.mjs +0 -4
- package/dist/ai-confirmation-prompt/ai-confirmation-prompt.d.ts +0 -34
- package/dist/ai-confirmation-prompt/ai-confirmation-prompt.mjs +0 -134
- package/dist/ai-confirmation-prompt/ai-confirmation-prompt.scss.mjs +0 -4
- package/dist/ai-confirmation-prompt/index.d.ts +0 -1
- package/dist/ai-confirmation-prompt/index.mjs +0 -5
- package/dist/ai-context-chip/ai-context-chip.scss.mjs +0 -4
- package/dist/ai-context-items/ai-context-items.scss.mjs +0 -4
- package/dist/ai-conversations-panel/ai-conversations-panel.scss.mjs +0 -4
- package/dist/ai-copy-button/ai-copy-button.scss.mjs +0 -4
- package/dist/ai-dialog/ai-dialog.scss.mjs +0 -4
- package/dist/ai-disclaimer/ai-disclaimer.scss.mjs +0 -4
- package/dist/ai-dropdown-menu/ai-dropdown-menu-item-group.scss.mjs +0 -4
- package/dist/ai-dropdown-menu/ai-dropdown-menu-item.scss.mjs +0 -4
- package/dist/ai-dropdown-menu/ai-dropdown-menu-separator.scss.mjs +0 -4
- package/dist/ai-dropdown-menu/ai-dropdown-menu.scss.mjs +0 -4
- package/dist/ai-edit-thread/ai-edit-thread.scss.mjs +0 -4
- package/dist/ai-embedded-chat/ai-embedded-chat.d.ts +0 -64
- package/dist/ai-embedded-chat/ai-embedded-chat.mjs +0 -172
- package/dist/ai-embedded-chat/ai-embedded-chat.scss.mjs +0 -4
- package/dist/ai-embedded-chat/index.d.ts +0 -1
- package/dist/ai-embedded-chat/index.mjs +0 -5
- package/dist/ai-empty-state/ai-empty-state.scss.mjs +0 -4
- package/dist/ai-error-message/ai-error-message.scss.mjs +0 -4
- package/dist/ai-fab/ai-fab.scss.mjs +0 -4
- package/dist/ai-file-picker/ai-file-picker.scss.mjs +0 -4
- package/dist/ai-floating-chat/ai-floating-chat.d.ts +0 -53
- package/dist/ai-floating-chat/ai-floating-chat.mjs +0 -147
- package/dist/ai-floating-chat/ai-floating-chat.scss.mjs +0 -4
- package/dist/ai-floating-chat/index.d.ts +0 -1
- package/dist/ai-floating-chat/index.mjs +0 -5
- package/dist/ai-gradient-container/ai-gradient-container.scss.mjs +0 -4
- package/dist/ai-icon/ai-icon.scss.mjs +0 -4
- package/dist/ai-icon-button/ai-icon-button.d.ts +0 -19
- package/dist/ai-icon-button/ai-icon-button.mjs +0 -66
- package/dist/ai-icon-button/ai-icon-button.scss.mjs +0 -4
- package/dist/ai-icon-button/index.d.ts +0 -1
- package/dist/ai-icon-button/index.mjs +0 -5
- package/dist/ai-message-thread/ai-message-thread.scss.mjs +0 -4
- package/dist/ai-modal/ai-modal.scss.mjs +0 -4
- package/dist/ai-prompt/ai-prompt.scss.mjs +0 -4
- package/dist/ai-prompt/prompt-button/index.d.ts +0 -1
- package/dist/ai-prompt/prompt-button/index.mjs +0 -5
- package/dist/ai-prompt/prompt-button/prompt-button.d.ts +0 -16
- package/dist/ai-prompt/prompt-button/prompt-button.mjs +0 -40
- package/dist/ai-prompt/prompt-button/prompt-button.scss.mjs +0 -4
- package/dist/ai-reasoning/ai-reasoning.scss.mjs +0 -4
- package/dist/ai-reasoning/reasoning-content/reasoning-content.scss.mjs +0 -4
- package/dist/ai-reasoning-header/ai-reasoning-header.scss.mjs +0 -4
- package/dist/ai-response-message/ai-response-message.scss.mjs +0 -4
- package/dist/ai-response-message-toolbar/ai-response-message-toolbar.scss.mjs +0 -4
- package/dist/ai-sidebar/ai-sidebar.scss.mjs +0 -4
- package/dist/ai-sidebar-chat/ai-sidebar-chat.d.ts +0 -54
- package/dist/ai-sidebar-chat/ai-sidebar-chat.mjs +0 -163
- package/dist/ai-sidebar-chat/ai-sidebar-chat.scss.mjs +0 -4
- package/dist/ai-sidebar-chat/index.d.ts +0 -1
- package/dist/ai-sidebar-chat/index.mjs +0 -5
- package/dist/ai-slash-command-menu/ai-slash-command-menu.scss.mjs +0 -4
- package/dist/ai-spinner/ai-spinner.scss.mjs +0 -4
- package/dist/ai-steps/ai-steps.scss.mjs +0 -4
- package/dist/ai-suggestions/ai-suggestions.scss.mjs +0 -500
- package/dist/ai-thinking-indicator/ai-thinking-indicator.scss.mjs +0 -143
- package/dist/ai-thread-actions-menu/ai-thread-actions-menu.scss.mjs +0 -4
- package/dist/ai-threads/ai-threads.d.ts +0 -82
- package/dist/ai-threads/ai-threads.mjs +0 -343
- package/dist/ai-threads/ai-threads.scss.mjs +0 -4
- package/dist/ai-threads/index.d.ts +0 -1
- package/dist/ai-threads/index.mjs +0 -5
- package/dist/ai-threads-search/ai-threads-search.scss.mjs +0 -4
- package/dist/ai-tool-call-indicator/ai-tool-call-indicator.scss.mjs +0 -4
- package/dist/ai-user-message/ai-user-message.scss.mjs +0 -4
- package/dist/ai-user-message-toolbar/ai-user-message-toolbar.scss.mjs +0 -4
- package/dist/ai-voice-input/ai-voice-input.scss.mjs +0 -4
- package/dist/core/chatbot-core-controller.d.ts +0 -57
- package/dist/core/chatbot-core-controller.mjs +0 -523
- package/dist/core/overlay/overlay.scss.mjs +0 -4
- package/dist/core/popover/popover.scss.mjs +0 -4
- package/dist/core/tooltip/tooltip.scss.mjs +0 -4
- package/dist/tools/ai-data-table/ai-data-table-definition.d.ts +0 -2
- package/dist/tools/ai-data-table/ai-data-table-definition.mjs +0 -42
- package/dist/tools/ai-data-table/ai-data-table.scss.mjs +0 -4
- package/dist/tools/ai-mcp-app/ai-mcp-app.d.ts +0 -69
- package/dist/tools/ai-mcp-app/ai-mcp-app.mjs +0 -574
- package/dist/tools/ai-mcp-app/ai-mcp-app.scss.mjs +0 -4
- package/dist/tools/ai-mcp-app/index.d.ts +0 -3
- package/dist/tools/ai-mcp-app/index.mjs +0 -6
- package/dist/tools/ai-mcp-app/mcp-app-bridge-controller.d.ts +0 -61
- package/dist/tools/ai-mcp-app/mcp-app-bridge-controller.mjs +0 -156
- package/dist/tools/ai-mcp-app/mcp-app-bridge-types.d.ts +0 -123
- package/dist/tools/ai-mcp-app/mcp-app-bridge.d.ts +0 -41
- package/dist/tools/ai-mcp-app/mcp-app-bridge.mjs +0 -293
- package/dist/tools/ai-mcp-app/mcp-app-context.d.ts +0 -46
- package/dist/tools/ai-mcp-app/mcp-app-context.mjs +0 -5
- package/dist/tools/ai-paginator/ai-paginator.scss.mjs +0 -4
- package/dist/tools/ai-steps/ai-steps-definition.d.ts +0 -2
- package/dist/tools/ai-steps/ai-steps-definition.mjs +0 -50
- package/dist/tools/ai-steps/ai-steps.scss.mjs +0 -4
- package/dist/utils/inert-outside.d.ts +0 -7
- package/dist/utils/inert-outside.mjs +0 -28
- package/dist/utils.d.ts +0 -32
- package/dist/utils.mjs +0 -57
- /package/dist/{ai-chatbot → utils}/markdown-stream-controller.d.ts +0 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Function of a tool call whose parameter stays bivariant, so a `ToolDefinition<MyArgs>` can be stored in a
|
|
3
|
+
* `ToolDefinition[]` alongside untyped tools without casts.
|
|
4
|
+
*/
|
|
5
|
+
export type ToolCallMapper<TReturn, TArgs = Record<string, unknown>, TResult = unknown> = {
|
|
6
|
+
bivarianceHack(toolCall: ToolCall<TArgs, TResult>): TReturn;
|
|
7
|
+
}['bivarianceHack'];
|
|
8
|
+
/** A static value, or one derived from the tool call. */
|
|
9
|
+
export type ToolCallValue<TValue, TArgs = Record<string, unknown>, TResult = unknown> = TValue | ToolCallMapper<TValue, TArgs, TResult>;
|
|
10
|
+
/** Host-provided context passed to a tool renderer's `render` function. */
|
|
11
|
+
export interface ToolRenderContext {
|
|
12
|
+
presentation: ToolPresentation;
|
|
13
|
+
/** Controls captured when `render` runs; element renderers receive a reactive `canvas` property instead. */
|
|
14
|
+
canvas: ToolCanvas;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Bivariant like `ToolCallMapper`. `context` is optional so existing `render(toolCall)` implementations and
|
|
18
|
+
* callers keep compiling; hosts always pass it.
|
|
19
|
+
*/
|
|
20
|
+
export type ToolRenderFunction<TArgs = Record<string, unknown>, TResult = unknown> = {
|
|
21
|
+
bivarianceHack(toolCall: ToolCall<TArgs, TResult>, context?: ToolRenderContext): HTMLElement | DocumentFragment;
|
|
22
|
+
}['bivarianceHack'];
|
|
23
|
+
export interface ToolRenderer<TArgs = any, TResult = any> {
|
|
24
|
+
elementTag?: string;
|
|
25
|
+
render?: ToolRenderFunction<TArgs, TResult>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Where a tool renderer instance is displayed. Set by the host on the elements it creates.
|
|
29
|
+
* - `inline`: in the message thread with no canvas available
|
|
30
|
+
* - `inline-expandable`: in the message thread; a canvas is available and the renderer may request it
|
|
31
|
+
* - `canvas`: inside the canvas panel
|
|
32
|
+
*/
|
|
33
|
+
export type ToolPresentation = 'inline' | 'inline-expandable' | 'canvas';
|
|
34
|
+
/** Artifact card icon: an `<svg>` element, or SVG markup reduced to static shape elements and attributes. */
|
|
35
|
+
export type ToolCanvasIcon = SVGElement | string;
|
|
36
|
+
/** Artifact card labels for each state; shown as the tooltip and read by assistive technology. */
|
|
37
|
+
export interface ToolCanvasActionLabel {
|
|
38
|
+
/** Label while the artifact is not in the canvas, e.g. "Open report". */
|
|
39
|
+
open: string;
|
|
40
|
+
/** Label while the artifact is in the canvas, e.g. "Collapse report". */
|
|
41
|
+
collapse: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Opts a tool into the canvas panel of hosts that provide one.
|
|
45
|
+
* Hosts without a canvas ignore this and render the tool inline as usual. Every mapper receives the
|
|
46
|
+
* `ToolCall`, so values can come from the agent's `args` or the handler's `result`.
|
|
47
|
+
*/
|
|
48
|
+
export interface ToolCanvasConfig<TArgs = Record<string, unknown>, TResult = unknown> {
|
|
49
|
+
/**
|
|
50
|
+
* When the canvas opens. `auto`: as soon as the tool call renders (hosts that can open it automatically; others treat it as
|
|
51
|
+
* `on-request`). `on-request` (default): only when the renderer or artifact card asks for it.
|
|
52
|
+
*/
|
|
53
|
+
open?: 'auto' | 'on-request';
|
|
54
|
+
/**
|
|
55
|
+
* What the thread shows for the tool call. `renderer`: the inline renderer. `card`: an artifact card that
|
|
56
|
+
* opens the canvas. `card-while-open`: the renderer, swapped for the card while this call is in the canvas.
|
|
57
|
+
* Defaults to `card` when `open` is `auto`, otherwise `renderer`.
|
|
58
|
+
*/
|
|
59
|
+
inline?: ToolCanvasInline;
|
|
60
|
+
/** Renderer used inside the canvas. Defaults to the tool's `renderer`. */
|
|
61
|
+
renderer?: ToolRenderer<TArgs, TResult>;
|
|
62
|
+
/** Canvas and artifact card title. Defaults to `displayName`, then `name`. */
|
|
63
|
+
title?: ToolCallValue<string, TArgs, TResult>;
|
|
64
|
+
/** Artifact card subtitle, e.g. a row count. */
|
|
65
|
+
subtitle?: ToolCallValue<string, TArgs, TResult>;
|
|
66
|
+
/** Artifact card icon. Defaults to a generic artifact glyph. */
|
|
67
|
+
icon?: ToolCallValue<ToolCanvasIcon, TArgs, TResult>;
|
|
68
|
+
/** Artifact card action labels. Defaults to "Open in canvas" / "Collapse canvas". */
|
|
69
|
+
actionLabel?: ToolCallValue<ToolCanvasActionLabel, TArgs, TResult>;
|
|
70
|
+
}
|
|
71
|
+
export type ToolCanvasInline = 'renderer' | 'card' | 'card-while-open';
|
|
72
|
+
/**
|
|
73
|
+
* Canvas controls the host injects into a tool renderer as `canvas`. A new object is assigned whenever
|
|
74
|
+
* `available` or `isOpen` changes, so declaring `canvas` as a reactive property re-renders the renderer.
|
|
75
|
+
* Hosts without a canvas inject one with `available: false` whose methods return `false`.
|
|
76
|
+
*/
|
|
77
|
+
export interface ToolCanvas {
|
|
78
|
+
/** Whether the host can show this tool call in a canvas. */
|
|
79
|
+
readonly available: boolean;
|
|
80
|
+
/** Whether this tool call is the one currently shown in the canvas. */
|
|
81
|
+
readonly isOpen: boolean;
|
|
82
|
+
/** Shows this tool call in the canvas. Returns false when unavailable or the host declined. */
|
|
83
|
+
open(options?: {
|
|
84
|
+
title?: string;
|
|
85
|
+
}): boolean;
|
|
86
|
+
/** Closes the canvas if it is showing this tool call. Returns false when it was not or the host declined. */
|
|
87
|
+
close(): boolean;
|
|
88
|
+
/** Closes the canvas when this tool call is open, otherwise opens it. */
|
|
89
|
+
toggle(): boolean;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Interface that tool renderer components should implement for type-safe tool call handling.
|
|
93
|
+
* @template TArgs - Type of the tool call arguments
|
|
94
|
+
* @template TResult - Type returned by the tool's handler
|
|
95
|
+
*/
|
|
96
|
+
export interface IToolRenderer<TArgs = Record<string, unknown>, TResult = unknown> {
|
|
97
|
+
toolCall: ToolCall<TArgs, TResult>;
|
|
98
|
+
/** Assigned by the host to tell the renderer where it is displayed. */
|
|
99
|
+
presentation?: ToolPresentation;
|
|
100
|
+
/** Assigned by the host to let the renderer open and close the canvas. */
|
|
101
|
+
canvas?: ToolCanvas;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Context provided to tool handlers when they are invoked.
|
|
105
|
+
* @template TArgs - Type of the tool call arguments
|
|
106
|
+
*/
|
|
107
|
+
export interface HandlerContext<TArgs = Record<string, unknown>> {
|
|
108
|
+
/** Tool call arguments */
|
|
109
|
+
args: TArgs;
|
|
110
|
+
/** Unique identifier for this tool call */
|
|
111
|
+
toolCallId: string;
|
|
112
|
+
/** Name of the tool being called */
|
|
113
|
+
toolName: string;
|
|
114
|
+
/** Optional abort signal for cancellation support */
|
|
115
|
+
signal?: AbortSignal;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Context provided to onStart callback when tool call begins.
|
|
119
|
+
*/
|
|
120
|
+
export interface ToolStartContext {
|
|
121
|
+
toolCallId: string;
|
|
122
|
+
toolName: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Context provided to onDelta callback during streaming.
|
|
126
|
+
* @template TArgs - Type of the tool call arguments
|
|
127
|
+
*/
|
|
128
|
+
export interface ToolDeltaContext<TArgs = Record<string, unknown>> {
|
|
129
|
+
argsBuffer: string;
|
|
130
|
+
partialArgs: Partial<TArgs>;
|
|
131
|
+
toolCallId: string;
|
|
132
|
+
toolName: string;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Context provided to onEnd callback when args are complete.
|
|
136
|
+
* @template TArgs - Type of the tool call arguments
|
|
137
|
+
*/
|
|
138
|
+
export interface ToolEndContext<TArgs = Record<string, unknown>> {
|
|
139
|
+
args: TArgs;
|
|
140
|
+
toolCallId: string;
|
|
141
|
+
toolName: string;
|
|
142
|
+
}
|
|
143
|
+
export type ToolType = 'client' | 'agent';
|
|
144
|
+
/**
|
|
145
|
+
* Tool definition with optional type-safe handler.
|
|
146
|
+
* @template TArgs - Type of the tool call arguments, typed through the handler, renderer, and canvas mappers
|
|
147
|
+
* @template TResult - Type returned by `handler`, available as `toolCall.result`
|
|
148
|
+
*/
|
|
149
|
+
export interface ToolDefinition<TArgs = Record<string, unknown>, TResult = string | Record<string, unknown>> {
|
|
150
|
+
name: string;
|
|
151
|
+
displayName?: string;
|
|
152
|
+
description?: string;
|
|
153
|
+
parameters?: {
|
|
154
|
+
type: 'object';
|
|
155
|
+
properties?: Record<string, unknown>;
|
|
156
|
+
required?: string[];
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Optional renderer for displaying tool call results within the chat UI. Deliberately untyped (`any`
|
|
160
|
+
* arguments) so renderers written before `ToolDefinition` had a `TResult`, including `render` callbacks
|
|
161
|
+
* annotated with plain `ToolCall`, keep compiling on any `ToolDefinition<TArgs>`.
|
|
162
|
+
*/
|
|
163
|
+
renderer?: ToolRenderer;
|
|
164
|
+
/** If true, renderer shows immediately on tool call start (default: false). */
|
|
165
|
+
renderOnStart?: boolean;
|
|
166
|
+
/** Canvas behavior for hosts that provide a canvas panel. Requires `renderer`. */
|
|
167
|
+
canvas?: ToolCanvasConfig<TArgs, TResult>;
|
|
168
|
+
/** Called when tool call starts (before args stream). */
|
|
169
|
+
onStart?(context: ToolStartContext): void;
|
|
170
|
+
/** Called during streaming with partial args. */
|
|
171
|
+
onDelta?(context: ToolDeltaContext<TArgs>): void;
|
|
172
|
+
/** Called when args are complete (before handler execution). */
|
|
173
|
+
onEnd?(context: ToolEndContext<TArgs>): void;
|
|
174
|
+
/**
|
|
175
|
+
* Optional handler function invoked when tool is called.
|
|
176
|
+
* Strings and objects are used directly as the tool result; `void` yields a generic success message.
|
|
177
|
+
*/
|
|
178
|
+
handler?(context: HandlerContext<TArgs>): Promise<TResult | void> | TResult | void;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Type-erased tool definition for collections that mix tools with different argument types, e.g. a
|
|
182
|
+
* list of tools passed to an agent. Any `ToolDefinition<TArgs, TResult>` is assignable to it.
|
|
183
|
+
*/
|
|
184
|
+
export type AnyToolDefinition = ToolDefinition<object, any>;
|
|
185
|
+
export interface ToolCall<TArgs = Record<string, unknown>, TResult = unknown> {
|
|
186
|
+
id: string;
|
|
187
|
+
messageId: string;
|
|
188
|
+
name: string;
|
|
189
|
+
args: TArgs;
|
|
190
|
+
argsBuffer?: string;
|
|
191
|
+
/** Handler return value once the call completes; an `{ error }` object if the handler threw. */
|
|
192
|
+
result?: TResult;
|
|
193
|
+
status: 'pending' | 'parsing' | 'executing' | 'complete' | 'error';
|
|
194
|
+
type: ToolType;
|
|
195
|
+
startTimestamp?: number;
|
|
196
|
+
endTimestamp?: number;
|
|
197
|
+
}
|
package/dist/utils/csv-utils.mjs
CHANGED
|
@@ -1,65 +1,45 @@
|
|
|
1
|
+
//#region src/lib/utils/csv-utils.ts
|
|
1
2
|
function escapeCSVCell(value) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
const dangerousFormulaPattern = /^(@)?(\+|-|=)?(DDE|HYPERLINK|IMPORTXML|IMPORTHTML|IMPORTDATA|IMPORTFEED|IMPORTRANGE)/i;
|
|
10
|
-
const needsFormulaEscape = /^[=+\-@|\t\r\n]/.test(stringValue) || dangerousFormulaPattern.test(stringValue);
|
|
11
|
-
const escapedValue = needsFormulaEscape ? `'${stringValue}` : stringValue;
|
|
12
|
-
if (/[",\n\r]/.test(escapedValue)) {
|
|
13
|
-
return `"${escapedValue.replace(/"/g, '""')}"`;
|
|
14
|
-
}
|
|
15
|
-
return escapedValue;
|
|
3
|
+
if (value === null || value === void 0) return "";
|
|
4
|
+
const stringValue = String(value);
|
|
5
|
+
if (!stringValue) return "";
|
|
6
|
+
const escapedValue = /^[=+\-@|\t\r\n]/.test(stringValue) || /^(@)?(\+|-|=)?(DDE|HYPERLINK|IMPORTXML|IMPORTHTML|IMPORTDATA|IMPORTFEED|IMPORTRANGE)/i.test(stringValue) ? `'${stringValue}` : stringValue;
|
|
7
|
+
if (/[",\n\r]/.test(escapedValue)) return `"${escapedValue.replace(/"/g, "\"\"")}"`;
|
|
8
|
+
return escapedValue;
|
|
16
9
|
}
|
|
17
10
|
function buildCSVContent(headers, rows) {
|
|
18
|
-
|
|
19
|
-
headers.map((h) => escapeCSVCell(h)).join(","),
|
|
20
|
-
...rows.map((row) => row.map((cell) => escapeCSVCell(cell)).join(","))
|
|
21
|
-
];
|
|
22
|
-
return csvRows.join("\r\n");
|
|
11
|
+
return [headers.map((h) => escapeCSVCell(h)).join(","), ...rows.map((row) => row.map((cell) => escapeCSVCell(cell)).join(","))].join("\r\n");
|
|
23
12
|
}
|
|
24
13
|
function sanitizeFilename(filename, fallback = "download") {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
normalized += nextChar;
|
|
43
|
-
lastWasDash = false;
|
|
44
|
-
}
|
|
45
|
-
normalized = normalized.replace(/^[.-]+|[.-]+$/g, "");
|
|
46
|
-
return `${normalized || fallback}.csv`;
|
|
14
|
+
const trimmed = filename.trim();
|
|
15
|
+
if (!trimmed) return `${fallback}.csv`;
|
|
16
|
+
let normalized = "";
|
|
17
|
+
let lastWasDash = false;
|
|
18
|
+
for (const char of trimmed) {
|
|
19
|
+
const nextChar = /[a-zA-Z0-9._-]/.test(char) ? char : "-";
|
|
20
|
+
if (nextChar === "-") {
|
|
21
|
+
if (!normalized || lastWasDash) continue;
|
|
22
|
+
normalized += nextChar;
|
|
23
|
+
lastWasDash = true;
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
normalized += nextChar;
|
|
27
|
+
lastWasDash = false;
|
|
28
|
+
}
|
|
29
|
+
normalized = normalized.replace(/^[.-]+|[.-]+$/g, "");
|
|
30
|
+
return `${normalized || fallback}.csv`;
|
|
47
31
|
}
|
|
48
32
|
function downloadCSV(content, filename) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
33
|
+
const blob = new Blob([content], { type: "text/csv;charset=utf-8" });
|
|
34
|
+
const url = URL.createObjectURL(blob);
|
|
35
|
+
const link = document.createElement("a");
|
|
36
|
+
link.href = url;
|
|
37
|
+
link.download = filename;
|
|
38
|
+
link.style.display = "none";
|
|
39
|
+
document.body.appendChild(link);
|
|
40
|
+
link.click();
|
|
41
|
+
link.remove();
|
|
42
|
+
URL.revokeObjectURL(url);
|
|
59
43
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
downloadCSV,
|
|
63
|
-
escapeCSVCell,
|
|
64
|
-
sanitizeFilename
|
|
65
|
-
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { buildCSVContent, downloadCSV, escapeCSVCell, sanitizeFilename };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactiveController, ReactiveControllerHost, nothing, TemplateResult } from 'lit';
|
|
2
|
-
import { Thread } from '../
|
|
2
|
+
import { Thread } from '../types/index.js';
|
|
3
3
|
export interface DeleteThreadControllerCallbacks {
|
|
4
4
|
onConfirm: (thread: Thread) => void;
|
|
5
5
|
}
|
|
@@ -1,80 +1,57 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { html, nothing } from "lit";
|
|
2
2
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (!this.#confirmingThread) {
|
|
45
|
-
return nothing;
|
|
46
|
-
}
|
|
47
|
-
return html`
|
|
48
|
-
<forge-ai-modal
|
|
49
|
-
${ref(this.#modalRef)}
|
|
50
|
-
.open=${true}
|
|
51
|
-
size-strategy="fixed"
|
|
52
|
-
@forge-ai-modal-close=${this.#handleModalClose}>
|
|
3
|
+
//#region src/lib/utils/delete-thread-controller.ts
|
|
4
|
+
var DeleteThreadController = class {
|
|
5
|
+
#host;
|
|
6
|
+
#callbacks;
|
|
7
|
+
#confirmingThread = null;
|
|
8
|
+
#modalRef = createRef();
|
|
9
|
+
constructor(host, callbacks) {
|
|
10
|
+
this.#host = host;
|
|
11
|
+
this.#callbacks = callbacks;
|
|
12
|
+
host.addController(this);
|
|
13
|
+
}
|
|
14
|
+
hostConnected() {}
|
|
15
|
+
hostDisconnected() {}
|
|
16
|
+
async show(thread) {
|
|
17
|
+
this.#confirmingThread = thread;
|
|
18
|
+
this.#host.requestUpdate();
|
|
19
|
+
await this.#host.updateComplete;
|
|
20
|
+
this.#modalRef.value?.show();
|
|
21
|
+
}
|
|
22
|
+
close() {
|
|
23
|
+
this.#modalRef.value?.close();
|
|
24
|
+
this.#confirmingThread = null;
|
|
25
|
+
this.#host.requestUpdate();
|
|
26
|
+
}
|
|
27
|
+
#handleConfirm = () => {
|
|
28
|
+
if (!this.#confirmingThread) return;
|
|
29
|
+
this.#callbacks.onConfirm(this.#confirmingThread);
|
|
30
|
+
this.close();
|
|
31
|
+
};
|
|
32
|
+
#handleDeny = () => {
|
|
33
|
+
this.close();
|
|
34
|
+
};
|
|
35
|
+
#handleModalClose = (evt) => {
|
|
36
|
+
evt.stopPropagation();
|
|
37
|
+
this.#confirmingThread = null;
|
|
38
|
+
this.#host.requestUpdate();
|
|
39
|
+
};
|
|
40
|
+
get template() {
|
|
41
|
+
if (!this.#confirmingThread) return nothing;
|
|
42
|
+
return html`
|
|
43
|
+
<forge-ai-modal ${ref(this.#modalRef)} .open=${true} size-strategy="fixed" @forge-ai-modal-close=${this.#handleModalClose}>
|
|
53
44
|
<div class="delete-confirmation" role="alertdialog" aria-labelledby="delete-confirm-title">
|
|
54
45
|
<h2 id="delete-confirm-title" class="delete-confirmation__title">Delete chat</h2>
|
|
55
|
-
<div class="delete-confirmation__text">
|
|
56
|
-
Are you sure you want to delete "${this.#confirmingThread.title}"? This action cannot be undone.
|
|
57
|
-
</div>
|
|
46
|
+
<div class="delete-confirmation__text">Are you sure you want to delete "${this.#confirmingThread.title}"? This action cannot be undone.</div>
|
|
58
47
|
<div class="delete-confirmation__actions">
|
|
59
|
-
<button
|
|
60
|
-
|
|
61
|
-
@click=${this.#handleDeny}
|
|
62
|
-
autofocus
|
|
63
|
-
aria-label="Cancel deletion">
|
|
64
|
-
Cancel
|
|
65
|
-
</button>
|
|
66
|
-
<button
|
|
67
|
-
class="forge-button forge-button--filled"
|
|
68
|
-
@click=${this.#handleConfirm}
|
|
69
|
-
aria-label="Confirm deletion">
|
|
70
|
-
Delete
|
|
71
|
-
</button>
|
|
48
|
+
<button class="forge-button forge-button--outlined" @click=${this.#handleDeny} autofocus aria-label="Cancel deletion">Cancel</button>
|
|
49
|
+
<button class="forge-button forge-button--filled" @click=${this.#handleConfirm} aria-label="Confirm deletion">Delete</button>
|
|
72
50
|
</div>
|
|
73
51
|
</div>
|
|
74
52
|
</forge-ai-modal>
|
|
75
53
|
`;
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
export {
|
|
79
|
-
DeleteThreadController
|
|
54
|
+
}
|
|
80
55
|
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { DeleteThreadController };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate a unique identifier with an optional prefix.
|
|
3
|
+
* @param prefix - Optional prefix for the ID.
|
|
4
|
+
* @returns A unique identifier string.
|
|
5
|
+
*/
|
|
6
|
+
export declare function generateUniqueId(prefix?: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Adds or removes a state from an element's custom state set.
|
|
9
|
+
*
|
|
10
|
+
* @param internals - The element's internals object.
|
|
11
|
+
* @param state - The name of the custom state to toggle.
|
|
12
|
+
* @param value - Whether to add or remove the state.
|
|
13
|
+
*/
|
|
14
|
+
export declare function toggleState(internals: ElementInternals, state: string, value: boolean): void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/lib/utils/dom.ts
|
|
2
|
+
/**
|
|
3
|
+
* Generate a unique identifier with an optional prefix.
|
|
4
|
+
* @param prefix - Optional prefix for the ID.
|
|
5
|
+
* @returns A unique identifier string.
|
|
6
|
+
*/
|
|
7
|
+
function generateUniqueId(prefix = "id") {
|
|
8
|
+
return `${prefix}-${Math.random().toString(36).substr(2, 9)}`;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Adds or removes a state from an element's custom state set.
|
|
12
|
+
*
|
|
13
|
+
* @param internals - The element's internals object.
|
|
14
|
+
* @param state - The name of the custom state to toggle.
|
|
15
|
+
* @param value - Whether to add or remove the state.
|
|
16
|
+
*/
|
|
17
|
+
function toggleState(internals, state, value) {
|
|
18
|
+
if (value) try {
|
|
19
|
+
internals.states.add(state);
|
|
20
|
+
} catch {
|
|
21
|
+
internals.states.add(`--${state}`);
|
|
22
|
+
}
|
|
23
|
+
else try {
|
|
24
|
+
internals.states.delete(state);
|
|
25
|
+
} catch {
|
|
26
|
+
internals.states.delete(`--${state}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { generateUniqueId, toggleState };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a date as a short relative time label: "Just now" under a minute, "Xm ago"/"Xh ago"
|
|
3
|
+
* under 24 hours, "Yesterday" between 24-48 hours elapsed, otherwise a short date (with year if
|
|
4
|
+
* not the current year).
|
|
5
|
+
*
|
|
6
|
+
* @param dateString - An ISO date string to format.
|
|
7
|
+
* @returns The formatted relative time label.
|
|
8
|
+
*/
|
|
9
|
+
export declare function formatRelativeTime(dateString: string): string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/lib/utils/format.ts
|
|
2
|
+
/**
|
|
3
|
+
* Formats a date as a short relative time label: "Just now" under a minute, "Xm ago"/"Xh ago"
|
|
4
|
+
* under 24 hours, "Yesterday" between 24-48 hours elapsed, otherwise a short date (with year if
|
|
5
|
+
* not the current year).
|
|
6
|
+
*
|
|
7
|
+
* @param dateString - An ISO date string to format.
|
|
8
|
+
* @returns The formatted relative time label.
|
|
9
|
+
*/
|
|
10
|
+
function formatRelativeTime(dateString) {
|
|
11
|
+
const date = new Date(dateString);
|
|
12
|
+
const diffMs = Date.now() - date.getTime();
|
|
13
|
+
const diffMinutes = Math.floor(diffMs / 6e4);
|
|
14
|
+
const diffHours = Math.floor(diffMs / 36e5);
|
|
15
|
+
const diffDays = Math.floor(diffMs / 864e5);
|
|
16
|
+
if (diffMinutes < 1) return "Just now";
|
|
17
|
+
if (diffHours < 24) return diffHours >= 1 ? `${diffHours}h ago` : `${diffMinutes}m ago`;
|
|
18
|
+
if (diffDays < 2) return "Yesterday";
|
|
19
|
+
const sameYear = date.getFullYear() === (/* @__PURE__ */ new Date()).getFullYear();
|
|
20
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
21
|
+
month: "short",
|
|
22
|
+
day: "numeric",
|
|
23
|
+
...sameYear ? {} : { year: "numeric" }
|
|
24
|
+
}).format(date);
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { formatRelativeTime };
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
1
|
+
export { generateUniqueId, toggleState } from './dom.js';
|
|
2
|
+
export { formatRelativeTime } from './format.js';
|
|
3
|
+
export { DeleteThreadController } from './delete-thread-controller.js';
|
|
4
|
+
export { InfiniteScrollController } from './infinite-scroll-controller.js';
|
|
5
|
+
export { KeyboardNavigationController } from './keyboard-navigation-controller.js';
|
|
6
|
+
export { MarkdownStreamController } from './markdown-stream-controller.js';
|
|
7
|
+
export { renderMarkdown, renderInlineMarkdown, type RenderMarkdownOptions, type RenderInlineMarkdownOptions } from './markdown.js';
|
|
8
|
+
export { buildCSVContent, downloadCSV, escapeCSVCell, sanitizeFilename } from './csv-utils.js';
|
|
9
|
+
export { readStoredNumber, writeStoredNumber, removeStoredValue, type StorageKind, type StorageOptions, type WriteStorageOptions } from './storage-utils.js';
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,20 +1,10 @@
|
|
|
1
|
+
import { renderInlineMarkdown, renderMarkdown } from "./markdown.mjs";
|
|
2
|
+
import { MarkdownStreamController } from "./markdown-stream-controller.mjs";
|
|
3
|
+
import { generateUniqueId, toggleState } from "./dom.mjs";
|
|
1
4
|
import { DeleteThreadController } from "./delete-thread-controller.mjs";
|
|
2
5
|
import { InfiniteScrollController } from "./infinite-scroll-controller.mjs";
|
|
3
6
|
import { KeyboardNavigationController } from "./keyboard-navigation-controller.mjs";
|
|
4
|
-
import { renderInlineMarkdown, renderMarkdown } from "./markdown.mjs";
|
|
5
|
-
import { buildCSVContent, downloadCSV, escapeCSVCell, sanitizeFilename } from "./csv-utils.mjs";
|
|
6
7
|
import { readStoredNumber, removeStoredValue, writeStoredNumber } from "./storage-utils.mjs";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
KeyboardNavigationController,
|
|
11
|
-
buildCSVContent,
|
|
12
|
-
downloadCSV,
|
|
13
|
-
escapeCSVCell,
|
|
14
|
-
readStoredNumber,
|
|
15
|
-
removeStoredValue,
|
|
16
|
-
renderInlineMarkdown,
|
|
17
|
-
renderMarkdown,
|
|
18
|
-
sanitizeFilename,
|
|
19
|
-
writeStoredNumber
|
|
20
|
-
};
|
|
8
|
+
import { formatRelativeTime } from "./format.mjs";
|
|
9
|
+
import { buildCSVContent, downloadCSV, escapeCSVCell, sanitizeFilename } from "./csv-utils.mjs";
|
|
10
|
+
export { DeleteThreadController, InfiniteScrollController, KeyboardNavigationController, MarkdownStreamController, buildCSVContent, downloadCSV, escapeCSVCell, formatRelativeTime, generateUniqueId, readStoredNumber, removeStoredValue, renderInlineMarkdown, renderMarkdown, sanitizeFilename, toggleState, writeStoredNumber };
|