@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,438 @@
|
|
|
1
|
+
import __decorate from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.mjs";
|
|
2
|
+
import "../core/tooltip/tooltip2.mjs";
|
|
3
|
+
import { toggleState } from "../utils/dom.mjs";
|
|
4
|
+
import "../ai-context-items/index.mjs";
|
|
5
|
+
import ai_prompt_default from "./ai-prompt.mjs";
|
|
6
|
+
import "../ai-slash-command-menu/ai-slash-command-menu2.mjs";
|
|
7
|
+
import { LitElement, html, nothing, unsafeCSS } from "lit";
|
|
8
|
+
import { customElement, property, query, state } from "lit/decorators.js";
|
|
9
|
+
import { when } from "lit/directives/when.js";
|
|
10
|
+
//#region src/lib/ai-prompt/ai-prompt.ts
|
|
11
|
+
var MAX_HISTORY_SIZE = 50;
|
|
12
|
+
var AiPromptComponentTagName = "forge-ai-prompt";
|
|
13
|
+
var AiPromptComponent = class AiPromptComponent extends LitElement {
|
|
14
|
+
static {
|
|
15
|
+
this.styles = unsafeCSS(ai_prompt_default);
|
|
16
|
+
}
|
|
17
|
+
#internals;
|
|
18
|
+
#messageHistory;
|
|
19
|
+
#historyIndex;
|
|
20
|
+
#draftMessage;
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
this.placeholder = "Ask a question...";
|
|
24
|
+
this.value = "";
|
|
25
|
+
this.variant = "stacked";
|
|
26
|
+
this.sendDisabled = false;
|
|
27
|
+
this.autofocus = false;
|
|
28
|
+
this.inputDisabled = false;
|
|
29
|
+
this.cancelOnEscape = true;
|
|
30
|
+
this.running = false;
|
|
31
|
+
this.debugMode = false;
|
|
32
|
+
this.slashCommands = [];
|
|
33
|
+
this.contextItems = [];
|
|
34
|
+
this._slashMenuOpen = false;
|
|
35
|
+
this._slashMenuQuery = "";
|
|
36
|
+
this.#messageHistory = [];
|
|
37
|
+
this.#historyIndex = -1;
|
|
38
|
+
this.#draftMessage = "";
|
|
39
|
+
this.#actionsStartSlot = html`<slot name="actions-start"></slot>`;
|
|
40
|
+
this.#actionsEndSlot = html`<slot name="actions-end"></slot>`;
|
|
41
|
+
this.#internals = this.attachInternals();
|
|
42
|
+
this.#setCssState();
|
|
43
|
+
}
|
|
44
|
+
willUpdate(changedProperties) {
|
|
45
|
+
if (changedProperties.has("variant")) this.#setCssState();
|
|
46
|
+
}
|
|
47
|
+
firstUpdated() {
|
|
48
|
+
if (this.autofocus) this.focus();
|
|
49
|
+
}
|
|
50
|
+
#setCssState() {
|
|
51
|
+
toggleState(this.#internals, "inline", this.variant === "inline");
|
|
52
|
+
toggleState(this.#internals, "stacked", this.variant === "stacked");
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Adds a message to the input history for up/down arrow navigation.
|
|
56
|
+
* Use this when sending messages externally (e.g., from suggestions).
|
|
57
|
+
*/
|
|
58
|
+
addToHistory(message) {
|
|
59
|
+
const trimmed = message?.trim();
|
|
60
|
+
if (!trimmed) return;
|
|
61
|
+
if (this.#messageHistory[this.#messageHistory.length - 1] === trimmed) {
|
|
62
|
+
this.#resetHistoryNavigation();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
this.#messageHistory.push(trimmed);
|
|
66
|
+
if (this.#messageHistory.length > MAX_HISTORY_SIZE) this.#messageHistory.shift();
|
|
67
|
+
this.#resetHistoryNavigation();
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Replaces the entire message history with the provided messages.
|
|
71
|
+
* Use this when restoring thread state from persistence.
|
|
72
|
+
*/
|
|
73
|
+
setHistory(messages) {
|
|
74
|
+
this.#messageHistory = messages.map((msg) => msg?.trim()).filter((msg) => msg.length > 0).slice(-50);
|
|
75
|
+
this.#resetHistoryNavigation();
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Returns a copy of the current message history.
|
|
79
|
+
*/
|
|
80
|
+
getHistory() {
|
|
81
|
+
return [...this.#messageHistory];
|
|
82
|
+
}
|
|
83
|
+
#resetHistoryNavigation() {
|
|
84
|
+
this.#historyIndex = -1;
|
|
85
|
+
this.#draftMessage = "";
|
|
86
|
+
}
|
|
87
|
+
#isCursorOnFirstLine() {
|
|
88
|
+
const cursorPos = this._inputElement?.selectionStart ?? 0;
|
|
89
|
+
return !this.value.substring(0, cursorPos).includes("\n");
|
|
90
|
+
}
|
|
91
|
+
#isCursorOnLastLine() {
|
|
92
|
+
const cursorPos = this._inputElement?.selectionStart ?? 0;
|
|
93
|
+
return !this.value.substring(cursorPos).includes("\n");
|
|
94
|
+
}
|
|
95
|
+
#isCursorAtStart() {
|
|
96
|
+
return (this._inputElement?.selectionStart ?? 0) === 0;
|
|
97
|
+
}
|
|
98
|
+
#isCursorAtEnd() {
|
|
99
|
+
return (this._inputElement?.selectionStart ?? 0) === this.value.length;
|
|
100
|
+
}
|
|
101
|
+
#moveCursorToStart() {
|
|
102
|
+
this._inputElement?.setSelectionRange(0, 0);
|
|
103
|
+
}
|
|
104
|
+
#moveCursorToEnd() {
|
|
105
|
+
const len = this.value.length;
|
|
106
|
+
this._inputElement?.setSelectionRange(len, len);
|
|
107
|
+
}
|
|
108
|
+
#navigateHistory(direction) {
|
|
109
|
+
if (this.#messageHistory.length === 0) return false;
|
|
110
|
+
if (direction > 0 && this.#historyIndex === -1) return false;
|
|
111
|
+
if (direction < 0) {
|
|
112
|
+
if (this.#historyIndex === -1) {
|
|
113
|
+
this.#draftMessage = this.value;
|
|
114
|
+
this.#historyIndex = this.#messageHistory.length - 1;
|
|
115
|
+
} else if (this.#historyIndex > 0) this.#historyIndex--;
|
|
116
|
+
else return false;
|
|
117
|
+
} else {
|
|
118
|
+
const newIndex = this.#historyIndex + 1;
|
|
119
|
+
if (newIndex >= this.#messageHistory.length) {
|
|
120
|
+
this.#historyIndex = -1;
|
|
121
|
+
this.value = this.#draftMessage;
|
|
122
|
+
if (this._inputElement) this._inputElement.value = this.#draftMessage;
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
this.#historyIndex = newIndex;
|
|
126
|
+
}
|
|
127
|
+
this.value = this.#messageHistory[this.#historyIndex];
|
|
128
|
+
if (this._inputElement) this._inputElement.value = this.#messageHistory[this.#historyIndex];
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
#actionsStartSlot;
|
|
132
|
+
#actionsEndSlot;
|
|
133
|
+
get #shouldShowStopButton() {
|
|
134
|
+
return this.running && !this.value.trim();
|
|
135
|
+
}
|
|
136
|
+
get #actions() {
|
|
137
|
+
return html`
|
|
138
|
+
<div class="actions">
|
|
139
|
+
<div class="actions-start-container">${this.#actionsStartSlot}</div>
|
|
140
|
+
<div class="actions-end-container">${this.#actionsEndSlot} ${this.#sendButton}</div>
|
|
141
|
+
</div>
|
|
142
|
+
${when(this.slashCommands.length, () => html`<div class="vertical-divider"></div>`)}
|
|
143
|
+
`;
|
|
144
|
+
}
|
|
145
|
+
_handleSend() {
|
|
146
|
+
if (this.sendDisabled || this.inputDisabled || !this.value.trim()) return;
|
|
147
|
+
const messageValue = this.value;
|
|
148
|
+
const now = /* @__PURE__ */ new Date();
|
|
149
|
+
const event = new CustomEvent("forge-ai-prompt-send", {
|
|
150
|
+
detail: {
|
|
151
|
+
value: messageValue,
|
|
152
|
+
time: now.toLocaleTimeString([], {
|
|
153
|
+
hour: "2-digit",
|
|
154
|
+
minute: "2-digit"
|
|
155
|
+
}),
|
|
156
|
+
date: now
|
|
157
|
+
},
|
|
158
|
+
bubbles: true,
|
|
159
|
+
composed: true,
|
|
160
|
+
cancelable: true
|
|
161
|
+
});
|
|
162
|
+
this.dispatchEvent(event);
|
|
163
|
+
if (!event.defaultPrevented) {
|
|
164
|
+
this.addToHistory(messageValue);
|
|
165
|
+
this.value = "";
|
|
166
|
+
this._slashMenuOpen = false;
|
|
167
|
+
this._slashMenuQuery = "";
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
_handleInput(event) {
|
|
171
|
+
this.value = event.target.value;
|
|
172
|
+
if (this.#historyIndex !== -1) {
|
|
173
|
+
this.#draftMessage = this.value;
|
|
174
|
+
this.#historyIndex = -1;
|
|
175
|
+
}
|
|
176
|
+
if (this.slashCommands.length === 0) return;
|
|
177
|
+
if (this.value === "/") {
|
|
178
|
+
this._slashMenuQuery = "";
|
|
179
|
+
this._slashMenuOpen = true;
|
|
180
|
+
} else if (this.value.startsWith("/") && this._slashMenuOpen) this._slashMenuQuery = this.value.slice(1);
|
|
181
|
+
else if (this._slashMenuOpen) {
|
|
182
|
+
this._slashMenuOpen = false;
|
|
183
|
+
this._slashMenuQuery = "";
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
_handleKeyDown(event) {
|
|
187
|
+
if (this._slashMenuOpen && this._slashMenuElement) {
|
|
188
|
+
if (this._slashMenuElement.handleKeyDown(event)) return;
|
|
189
|
+
}
|
|
190
|
+
if (!(event.shiftKey || event.ctrlKey || event.metaKey)) {
|
|
191
|
+
if (event.key === "ArrowUp" && this.#isCursorOnFirstLine()) {
|
|
192
|
+
if (this.#isCursorAtStart()) {
|
|
193
|
+
if (this.#navigateHistory(-1)) {
|
|
194
|
+
this.#moveCursorToStart();
|
|
195
|
+
event.preventDefault();
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
} else {
|
|
199
|
+
this.#moveCursorToStart();
|
|
200
|
+
event.preventDefault();
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
} else if (event.key === "ArrowDown" && this.#isCursorOnLastLine()) {
|
|
204
|
+
if (this.#isCursorAtEnd()) {
|
|
205
|
+
if (this.#navigateHistory(1)) {
|
|
206
|
+
event.preventDefault();
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
} else {
|
|
210
|
+
this.#moveCursorToEnd();
|
|
211
|
+
event.preventDefault();
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (event.key === "Enter" && !event.shiftKey) {
|
|
217
|
+
if (event.isComposing) return;
|
|
218
|
+
event.preventDefault();
|
|
219
|
+
if (this._slashMenuOpen) {
|
|
220
|
+
this._slashMenuOpen = false;
|
|
221
|
+
this._slashMenuQuery = "";
|
|
222
|
+
this._handleSend();
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (!this._slashMenuOpen) this._handleSend();
|
|
226
|
+
} else if (event.key === "Escape") {
|
|
227
|
+
if (this._slashMenuOpen) {
|
|
228
|
+
event.preventDefault();
|
|
229
|
+
this._slashMenuOpen = false;
|
|
230
|
+
this._slashMenuQuery = "";
|
|
231
|
+
} else if (this.cancelOnEscape) {
|
|
232
|
+
event.preventDefault();
|
|
233
|
+
this._handleEscape();
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
_handleStop() {
|
|
238
|
+
const event = new CustomEvent("forge-ai-prompt-stop", {
|
|
239
|
+
bubbles: true,
|
|
240
|
+
composed: true,
|
|
241
|
+
cancelable: true
|
|
242
|
+
});
|
|
243
|
+
this.dispatchEvent(event);
|
|
244
|
+
}
|
|
245
|
+
_handleEscape() {
|
|
246
|
+
const event = new CustomEvent("forge-ai-prompt-cancel", {
|
|
247
|
+
bubbles: true,
|
|
248
|
+
composed: true
|
|
249
|
+
});
|
|
250
|
+
this.dispatchEvent(event);
|
|
251
|
+
}
|
|
252
|
+
_handleDebugToggle() {
|
|
253
|
+
const event = new CustomEvent("forge-ai-prompt-debug-toggle", {
|
|
254
|
+
bubbles: true,
|
|
255
|
+
composed: true
|
|
256
|
+
});
|
|
257
|
+
this.dispatchEvent(event);
|
|
258
|
+
}
|
|
259
|
+
_handlePaste(event) {
|
|
260
|
+
const files = Array.from(event.clipboardData?.files || []);
|
|
261
|
+
if (files.length > 0) {
|
|
262
|
+
event.preventDefault();
|
|
263
|
+
const attachmentEvent = new CustomEvent("forge-ai-prompt-attachment", {
|
|
264
|
+
detail: { files },
|
|
265
|
+
bubbles: true,
|
|
266
|
+
composed: true
|
|
267
|
+
});
|
|
268
|
+
this.dispatchEvent(attachmentEvent);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
#handleSlashCommandSelect(event) {
|
|
272
|
+
const { command } = event.detail;
|
|
273
|
+
this.dispatchEvent(new CustomEvent("forge-ai-prompt-command", {
|
|
274
|
+
detail: {
|
|
275
|
+
commandId: command.id,
|
|
276
|
+
group: command.group,
|
|
277
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
278
|
+
},
|
|
279
|
+
bubbles: true,
|
|
280
|
+
composed: true
|
|
281
|
+
}));
|
|
282
|
+
this.value = "";
|
|
283
|
+
if (this._inputElement) this._inputElement.value = "";
|
|
284
|
+
this._slashMenuOpen = false;
|
|
285
|
+
this._slashMenuQuery = "";
|
|
286
|
+
}
|
|
287
|
+
#handleSlashCommandClose() {
|
|
288
|
+
this._slashMenuOpen = false;
|
|
289
|
+
this._slashMenuQuery = "";
|
|
290
|
+
}
|
|
291
|
+
#handleContextItemRemove(evt) {
|
|
292
|
+
this.dispatchEvent(new CustomEvent("forge-ai-prompt-context-remove", {
|
|
293
|
+
detail: {
|
|
294
|
+
id: evt.detail.id,
|
|
295
|
+
item: evt.detail.item
|
|
296
|
+
},
|
|
297
|
+
bubbles: true,
|
|
298
|
+
composed: true
|
|
299
|
+
}));
|
|
300
|
+
}
|
|
301
|
+
get #contextItemsTemplate() {
|
|
302
|
+
if (this.contextItems.length === 0) return nothing;
|
|
303
|
+
return html`
|
|
304
|
+
<forge-ai-context-items .items=${this.contextItems} @forge-ai-context-items-remove=${this.#handleContextItemRemove}> </forge-ai-context-items>
|
|
305
|
+
`;
|
|
306
|
+
}
|
|
307
|
+
get #textArea() {
|
|
308
|
+
return html` <textarea
|
|
309
|
+
id="chat-input"
|
|
310
|
+
rows="1"
|
|
311
|
+
.value=${this.value}
|
|
312
|
+
placeholder=${this.placeholder}
|
|
313
|
+
?disabled=${this.inputDisabled}
|
|
314
|
+
@input=${this._handleInput}
|
|
315
|
+
@keydown=${this._handleKeyDown}
|
|
316
|
+
@paste=${this._handlePaste}></textarea>`;
|
|
317
|
+
}
|
|
318
|
+
get #sendButton() {
|
|
319
|
+
return html`
|
|
320
|
+
<button
|
|
321
|
+
id="send-btn"
|
|
322
|
+
aria-label=${this.#shouldShowStopButton ? "Stop" : "Send message"}
|
|
323
|
+
class="forge-icon-button forge-icon-button--medium send-button"
|
|
324
|
+
?disabled=${this.sendDisabled || this.inputDisabled}
|
|
325
|
+
@click=${this.#shouldShowStopButton ? this._handleStop : this._handleSend}>
|
|
326
|
+
${this.#shouldShowStopButton ? html`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
|
|
327
|
+
<path d="M18 18H6V6h12z" />
|
|
328
|
+
</svg>` : html`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
|
|
329
|
+
<path d="m2 21 21-9L2 3v7l15 2-15 2z" />
|
|
330
|
+
</svg>`}
|
|
331
|
+
<forge-ai-tooltip for="send-btn" placement="top">${this.#shouldShowStopButton ? "Stop" : "Send"}</forge-ai-tooltip>
|
|
332
|
+
</button>
|
|
333
|
+
`;
|
|
334
|
+
}
|
|
335
|
+
get #debugButton() {
|
|
336
|
+
return html`
|
|
337
|
+
<button
|
|
338
|
+
id="debug-btn"
|
|
339
|
+
aria-label="Exit debug mode"
|
|
340
|
+
class="forge-icon-button forge-icon-button--small forge-icon-button--tonal ai-icon-button debug-button"
|
|
341
|
+
@click=${this._handleDebugToggle}>
|
|
342
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
|
|
343
|
+
<path
|
|
344
|
+
d="M20 8h-2.81a5.985 5.985 0 0 0-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 0 0-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z" />
|
|
345
|
+
</svg>
|
|
346
|
+
<forge-ai-tooltip for="debug-btn" placement="top">Exit debug mode</forge-ai-tooltip>
|
|
347
|
+
</button>
|
|
348
|
+
`;
|
|
349
|
+
}
|
|
350
|
+
get #slashCommandMenu() {
|
|
351
|
+
return when(this.slashCommands.length, () => html`
|
|
352
|
+
<forge-ai-slash-command-menu
|
|
353
|
+
.commands=${this.slashCommands}
|
|
354
|
+
.filterQuery=${this._slashMenuQuery}
|
|
355
|
+
.open=${this._slashMenuOpen}
|
|
356
|
+
.anchor=${this._inputElement}
|
|
357
|
+
.widthReference=${this}
|
|
358
|
+
@forge-ai-slash-command-menu-select=${this.#handleSlashCommandSelect}
|
|
359
|
+
@forge-ai-slash-command-menu-close=${this.#handleSlashCommandClose}>
|
|
360
|
+
</forge-ai-slash-command-menu>
|
|
361
|
+
`);
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Closes the slash command menu
|
|
365
|
+
*/
|
|
366
|
+
closeSlashMenu() {
|
|
367
|
+
this._slashMenuOpen = false;
|
|
368
|
+
this._slashMenuQuery = "";
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Focuses the textarea element
|
|
372
|
+
*/
|
|
373
|
+
focus() {
|
|
374
|
+
this._inputElement?.focus();
|
|
375
|
+
}
|
|
376
|
+
render() {
|
|
377
|
+
return html`
|
|
378
|
+
${when(this.variant === "stacked", () => html`
|
|
379
|
+
<div class="input-container">
|
|
380
|
+
<div class="forge-card">
|
|
381
|
+
${this.#contextItemsTemplate}
|
|
382
|
+
<div class="forge-field">${this.#textArea} ${when(this.debugMode, () => html` ${this.#debugButton} `)}</div>
|
|
383
|
+
${this.#actions}
|
|
384
|
+
</div>
|
|
385
|
+
</div>
|
|
386
|
+
${this.#slashCommandMenu}
|
|
387
|
+
`)}
|
|
388
|
+
${when(this.variant === "inline", () => html`
|
|
389
|
+
<div class="input-container">
|
|
390
|
+
<div class="forge-card">
|
|
391
|
+
${this.#contextItemsTemplate}
|
|
392
|
+
<div class="forge-field">
|
|
393
|
+
${this.#actionsStartSlot} ${this.#textArea} ${when(this.debugMode, () => html` ${this.#debugButton} `)}
|
|
394
|
+
<div class="actions-end-container">${this.#actionsEndSlot} ${this.#sendButton}</div>
|
|
395
|
+
</div>
|
|
396
|
+
</div>
|
|
397
|
+
</div>
|
|
398
|
+
${this.#slashCommandMenu}
|
|
399
|
+
`)}
|
|
400
|
+
`;
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
__decorate([property()], AiPromptComponent.prototype, "placeholder", void 0);
|
|
404
|
+
__decorate([property()], AiPromptComponent.prototype, "value", void 0);
|
|
405
|
+
__decorate([property({
|
|
406
|
+
type: String,
|
|
407
|
+
attribute: "variant"
|
|
408
|
+
})], AiPromptComponent.prototype, "variant", void 0);
|
|
409
|
+
__decorate([property({
|
|
410
|
+
type: Boolean,
|
|
411
|
+
attribute: "send-disabled"
|
|
412
|
+
})], AiPromptComponent.prototype, "sendDisabled", void 0);
|
|
413
|
+
__decorate([property({ type: Boolean })], AiPromptComponent.prototype, "autofocus", void 0);
|
|
414
|
+
__decorate([property({
|
|
415
|
+
type: Boolean,
|
|
416
|
+
attribute: "input-disabled"
|
|
417
|
+
})], AiPromptComponent.prototype, "inputDisabled", void 0);
|
|
418
|
+
__decorate([property({
|
|
419
|
+
type: Boolean,
|
|
420
|
+
attribute: "cancel-on-escape"
|
|
421
|
+
})], AiPromptComponent.prototype, "cancelOnEscape", void 0);
|
|
422
|
+
__decorate([property({ type: Boolean })], AiPromptComponent.prototype, "running", void 0);
|
|
423
|
+
__decorate([property({
|
|
424
|
+
type: Boolean,
|
|
425
|
+
attribute: "debug-mode"
|
|
426
|
+
})], AiPromptComponent.prototype, "debugMode", void 0);
|
|
427
|
+
__decorate([property({
|
|
428
|
+
type: Array,
|
|
429
|
+
attribute: false
|
|
430
|
+
})], AiPromptComponent.prototype, "slashCommands", void 0);
|
|
431
|
+
__decorate([property({ attribute: false })], AiPromptComponent.prototype, "contextItems", void 0);
|
|
432
|
+
__decorate([state()], AiPromptComponent.prototype, "_slashMenuOpen", void 0);
|
|
433
|
+
__decorate([state()], AiPromptComponent.prototype, "_slashMenuQuery", void 0);
|
|
434
|
+
__decorate([query("#chat-input")], AiPromptComponent.prototype, "_inputElement", void 0);
|
|
435
|
+
__decorate([query("forge-ai-slash-command-menu")], AiPromptComponent.prototype, "_slashMenuElement", void 0);
|
|
436
|
+
AiPromptComponent = __decorate([customElement(AiPromptComponentTagName)], AiPromptComponent);
|
|
437
|
+
//#endregion
|
|
438
|
+
export { AiPromptComponent, AiPromptComponentTagName };
|
package/dist/ai-prompt/index.mjs
CHANGED
|
@@ -1,44 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
7
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
8
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9
|
-
if (decorator = decorators[i])
|
|
10
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
11
|
-
if (kind && result) __defProp(target, key, result);
|
|
12
|
-
return result;
|
|
13
|
-
};
|
|
14
|
-
const AiReasoningComponentTagName = "forge-ai-reasoning";
|
|
15
|
-
let AiReasoningComponent = class extends LitElement {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.expanded = false;
|
|
19
|
-
}
|
|
20
|
-
render() {
|
|
21
|
-
return html`
|
|
22
|
-
<slot name="header" @toggle=${this._handleHeaderToggle}></slot>
|
|
23
|
-
<div class="reasoning ${this.expanded ? "expanded" : ""}">
|
|
24
|
-
<div class="content">
|
|
25
|
-
<slot></slot>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
`;
|
|
29
|
-
}
|
|
30
|
-
_handleHeaderToggle(event) {
|
|
31
|
-
this.expanded = event.detail.expanded;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
AiReasoningComponent.styles = unsafeCSS(styles);
|
|
35
|
-
__decorateClass([
|
|
36
|
-
property({ type: Boolean, reflect: true })
|
|
37
|
-
], AiReasoningComponent.prototype, "expanded", 2);
|
|
38
|
-
AiReasoningComponent = __decorateClass([
|
|
39
|
-
customElement(AiReasoningComponentTagName)
|
|
40
|
-
], AiReasoningComponent);
|
|
41
|
-
export {
|
|
42
|
-
AiReasoningComponent,
|
|
43
|
-
AiReasoningComponentTagName
|
|
44
|
-
};
|
|
1
|
+
//#region src/lib/ai-reasoning/ai-reasoning.scss?inline
|
|
2
|
+
var ai_reasoning_default = ":host {\n display: block;\n}\n\n.reasoning {\n overflow: hidden;\n max-height: 0;\n transition: max-height 0.3s ease-out;\n}\n.reasoning.expanded {\n max-height: 500px;\n}\n\n.content {\n -moz-osx-font-smoothing: grayscale;\n -webkit-font-smoothing: antialiased;\n font-family: var(--forge-typography-body1-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));\n font-size: var(--forge-typography-body1-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-body-font-size-scale, 0.875)));\n font-weight: var(--forge-typography-body1-font-weight, 400);\n line-height: var(--forge-typography-body1-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-body-line-height-scale, 1.125)));\n letter-spacing: var(--forge-typography-body1-letter-spacing, 0.0357142857em);\n text-transform: var(--forge-typography-body1-text-transform, inherit);\n text-decoration: var(--forge-typography-body1-text-decoration, inherit);\n padding: var(--forge-spacing-medium, 16px);\n}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { ai_reasoning_default as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import __decorate from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.mjs";
|
|
2
|
+
import ai_reasoning_default from "./ai-reasoning.mjs";
|
|
3
|
+
import { LitElement, html, unsafeCSS } from "lit";
|
|
4
|
+
import { customElement, property } from "lit/decorators.js";
|
|
5
|
+
//#region src/lib/ai-reasoning/ai-reasoning.ts
|
|
6
|
+
var AiReasoningComponentTagName = "forge-ai-reasoning";
|
|
7
|
+
var AiReasoningComponent = class AiReasoningComponent extends LitElement {
|
|
8
|
+
constructor(..._args) {
|
|
9
|
+
super(..._args);
|
|
10
|
+
this.expanded = false;
|
|
11
|
+
}
|
|
12
|
+
static {
|
|
13
|
+
this.styles = unsafeCSS(ai_reasoning_default);
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
return html`
|
|
17
|
+
<slot name="header" @forge-ai-reasoning-header-toggle=${this._handleHeaderToggle}></slot>
|
|
18
|
+
<div class="reasoning ${this.expanded ? "expanded" : ""}">
|
|
19
|
+
<div class="content">
|
|
20
|
+
<slot></slot>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
`;
|
|
24
|
+
}
|
|
25
|
+
_handleHeaderToggle(event) {
|
|
26
|
+
this.expanded = event.detail.expanded;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
__decorate([property({
|
|
30
|
+
type: Boolean,
|
|
31
|
+
reflect: true
|
|
32
|
+
})], AiReasoningComponent.prototype, "expanded", void 0);
|
|
33
|
+
AiReasoningComponent = __decorate([customElement(AiReasoningComponentTagName)], AiReasoningComponent);
|
|
34
|
+
//#endregion
|
|
35
|
+
export { AiReasoningComponent, AiReasoningComponentTagName };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AiReasoningComponent, AiReasoningComponentTagName } from './ai-reasoning';
|
|
2
|
-
export { ReasoningContentComponent, ReasoningContentComponentTagName } from './reasoning-content';
|
|
1
|
+
export { AiReasoningComponent, AiReasoningComponentTagName } from './ai-reasoning.js';
|
|
2
|
+
export { ReasoningContentComponent, ReasoningContentComponentTagName } from './reasoning-content/index.js';
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { AiReasoningComponent, AiReasoningComponentTagName } from "./ai-
|
|
2
|
-
import { ReasoningContentComponent, ReasoningContentComponentTagName } from "./reasoning-content/reasoning-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
AiReasoningComponentTagName,
|
|
6
|
-
ReasoningContentComponent,
|
|
7
|
-
ReasoningContentComponentTagName
|
|
8
|
-
};
|
|
1
|
+
import { AiReasoningComponent, AiReasoningComponentTagName } from "./ai-reasoning2.mjs";
|
|
2
|
+
import { ReasoningContentComponent, ReasoningContentComponentTagName } from "./reasoning-content/reasoning-content2.mjs";
|
|
3
|
+
import "./reasoning-content/index.mjs";
|
|
4
|
+
export { AiReasoningComponent, AiReasoningComponentTagName, ReasoningContentComponent, ReasoningContentComponentTagName };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ReasoningContentComponent, ReasoningContentComponentTagName } from './reasoning-content';
|
|
1
|
+
export { ReasoningContentComponent, ReasoningContentComponentTagName } from './reasoning-content.js';
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
ReasoningContentComponent,
|
|
4
|
-
ReasoningContentComponentTagName
|
|
5
|
-
};
|
|
1
|
+
export { ReasoningContentComponent, ReasoningContentComponentTagName } from "./reasoning-content2.mjs";
|
|
@@ -1,90 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
7
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
8
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9
|
-
if (decorator = decorators[i])
|
|
10
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
11
|
-
if (kind && result) __defProp(target, key, result);
|
|
12
|
-
return result;
|
|
13
|
-
};
|
|
14
|
-
const ReasoningContentComponentTagName = "forge-ai-reasoning-content";
|
|
15
|
-
let ReasoningContentComponent = class extends LitElement {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this._displayedText = "";
|
|
19
|
-
this._fullText = "";
|
|
20
|
-
this._animationId = null;
|
|
21
|
-
this._hasStarted = false;
|
|
22
|
-
}
|
|
23
|
-
firstUpdated() {
|
|
24
|
-
setTimeout(() => {
|
|
25
|
-
this._extractTextAndAnimate();
|
|
26
|
-
}, 100);
|
|
27
|
-
}
|
|
28
|
-
_handleSlotChange() {
|
|
29
|
-
if (!this._hasStarted) {
|
|
30
|
-
this._extractTextAndAnimate();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
_extractTextAndAnimate() {
|
|
34
|
-
if (this._hasStarted) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
const slot = this.shadowRoot?.querySelector("slot");
|
|
38
|
-
if (slot) {
|
|
39
|
-
const assignedNodes = slot.assignedNodes({ flatten: true });
|
|
40
|
-
this._fullText = assignedNodes.map((node) => node.textContent || "").join("").trim();
|
|
41
|
-
if (this._fullText) {
|
|
42
|
-
this._hasStarted = true;
|
|
43
|
-
this._startTypingAnimation();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
_startTypingAnimation() {
|
|
48
|
-
if (this._animationId) {
|
|
49
|
-
clearTimeout(this._animationId);
|
|
50
|
-
}
|
|
51
|
-
this._displayedText = "";
|
|
52
|
-
let currentIndex = 0;
|
|
53
|
-
const typeSpeed = 10;
|
|
54
|
-
const typeNextCharacter = () => {
|
|
55
|
-
if (currentIndex < this._fullText.length) {
|
|
56
|
-
this._displayedText = this._fullText.substring(0, currentIndex + 1);
|
|
57
|
-
currentIndex++;
|
|
58
|
-
this._animationId = setTimeout(typeNextCharacter, typeSpeed);
|
|
59
|
-
} else {
|
|
60
|
-
this._animationId = null;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
typeNextCharacter();
|
|
64
|
-
}
|
|
65
|
-
render() {
|
|
66
|
-
if (this._hasStarted) {
|
|
67
|
-
return html`
|
|
68
|
-
<div class="reasoning-content">
|
|
69
|
-
<span class="animated-text">${this._displayedText}</span>
|
|
70
|
-
</div>
|
|
71
|
-
`;
|
|
72
|
-
}
|
|
73
|
-
return html`
|
|
74
|
-
<div class="reasoning-content">
|
|
75
|
-
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
76
|
-
</div>
|
|
77
|
-
`;
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
ReasoningContentComponent.styles = unsafeCSS(styles);
|
|
81
|
-
__decorateClass([
|
|
82
|
-
state()
|
|
83
|
-
], ReasoningContentComponent.prototype, "_displayedText", 2);
|
|
84
|
-
ReasoningContentComponent = __decorateClass([
|
|
85
|
-
customElement(ReasoningContentComponentTagName)
|
|
86
|
-
], ReasoningContentComponent);
|
|
87
|
-
export {
|
|
88
|
-
ReasoningContentComponent,
|
|
89
|
-
ReasoningContentComponentTagName
|
|
90
|
-
};
|
|
1
|
+
//#region src/lib/ai-reasoning/reasoning-content/reasoning-content.scss?inline
|
|
2
|
+
var reasoning_content_default = ":host {\n display: block;\n}\n\n.reasoning-content {\n padding: 0.5rem 0;\n}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { reasoning_content_default as default };
|