@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
package/dist/utils/markdown.mjs
CHANGED
|
@@ -1,45 +1,266 @@
|
|
|
1
1
|
import { marked } from "marked";
|
|
2
2
|
import DOMPurify from "dompurify";
|
|
3
3
|
import remend from "remend";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
//#region src/lib/utils/markdown.ts
|
|
5
|
+
/**
|
|
6
|
+
* `remend` config applied to complete (non-streaming) content: disable the
|
|
7
|
+
* link/image completion handlers, keeping escaping repairs intact. A finished
|
|
8
|
+
* message has no tag still arriving, so the trailing-tag repair is disabled too;
|
|
9
|
+
* it would otherwise cut prose such as `Cost<Budget` at the `<`.
|
|
10
|
+
*/
|
|
11
|
+
var COMPLETE_CONTENT_REMEND_OPTIONS = {
|
|
12
|
+
links: false,
|
|
13
|
+
images: false,
|
|
14
|
+
htmlTags: false
|
|
9
15
|
};
|
|
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
|
-
|
|
16
|
+
var FORBID_TAGS = [
|
|
17
|
+
"script",
|
|
18
|
+
"style",
|
|
19
|
+
"iframe",
|
|
20
|
+
"object",
|
|
21
|
+
"embed",
|
|
22
|
+
"form",
|
|
23
|
+
"input",
|
|
24
|
+
"select",
|
|
25
|
+
"textarea",
|
|
26
|
+
"button",
|
|
27
|
+
"picture",
|
|
28
|
+
"source",
|
|
29
|
+
"track",
|
|
30
|
+
"image",
|
|
31
|
+
"feImage",
|
|
32
|
+
"mglyph"
|
|
33
|
+
];
|
|
34
|
+
/**
|
|
35
|
+
* Rendered content is model output and therefore attacker-influenced. Only images from the trusted
|
|
36
|
+
* origin (see `TRUSTED_ORIGIN`) or `data:image/*` load inline; any other source becomes a link the
|
|
37
|
+
* user must click. Fetching elements and attributes are forbidden; `<img>`, `<video>`, `<audio>`
|
|
38
|
+
* and CSS-parsed attributes are handled by the hooks below.
|
|
39
|
+
*/
|
|
40
|
+
var DOMPURIFY_CONFIG = {
|
|
41
|
+
FORBID_TAGS,
|
|
42
|
+
FORBID_ATTR: [
|
|
43
|
+
"onerror",
|
|
44
|
+
"onload",
|
|
45
|
+
"onclick",
|
|
46
|
+
"onmouseover",
|
|
47
|
+
"style",
|
|
48
|
+
"srcset",
|
|
49
|
+
"poster",
|
|
50
|
+
"background"
|
|
51
|
+
],
|
|
52
|
+
ADD_ATTR: ["target", "rel"]
|
|
53
|
+
};
|
|
54
|
+
var INLINE_TEXT_LINKS_CONFIG = {
|
|
55
|
+
...DOMPURIFY_CONFIG,
|
|
56
|
+
FORBID_TAGS: [...FORBID_TAGS, "a"]
|
|
45
57
|
};
|
|
58
|
+
var DEFAULT_IMAGE_LABEL = "Image";
|
|
59
|
+
var DEFAULT_MEDIA_LABELS = {
|
|
60
|
+
VIDEO: "Video",
|
|
61
|
+
AUDIO: "Audio"
|
|
62
|
+
};
|
|
63
|
+
var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
|
|
64
|
+
var OPAQUE_ORIGIN = "null";
|
|
65
|
+
var EXTERNAL_CSS_URL = /url\s*\(\s*(?!['"]?#)/i;
|
|
66
|
+
var CSS_ESCAPE_OR_STRING = /[\\'"]/;
|
|
67
|
+
var CSS_FUNCTION = /([a-z-]+)(\s*\()?/gi;
|
|
68
|
+
var SAFE_CSS_FUNCTIONS = /* @__PURE__ */ new Set([
|
|
69
|
+
"url",
|
|
70
|
+
"rgb",
|
|
71
|
+
"rgba",
|
|
72
|
+
"hsl",
|
|
73
|
+
"hsla",
|
|
74
|
+
"hwb",
|
|
75
|
+
"lab",
|
|
76
|
+
"lch",
|
|
77
|
+
"oklab",
|
|
78
|
+
"oklch",
|
|
79
|
+
"color",
|
|
80
|
+
"matrix",
|
|
81
|
+
"translate",
|
|
82
|
+
"scale",
|
|
83
|
+
"rotate",
|
|
84
|
+
"skewx",
|
|
85
|
+
"skewy",
|
|
86
|
+
"calc",
|
|
87
|
+
"min",
|
|
88
|
+
"max",
|
|
89
|
+
"clamp"
|
|
90
|
+
]);
|
|
91
|
+
var URL_ATTRS = /* @__PURE__ */ new Set([
|
|
92
|
+
"href",
|
|
93
|
+
"xlink:href",
|
|
94
|
+
"src",
|
|
95
|
+
"alt",
|
|
96
|
+
"title"
|
|
97
|
+
]);
|
|
98
|
+
var CSS_PRESENTATION_ATTRS = /* @__PURE__ */ new Set([
|
|
99
|
+
"mask",
|
|
100
|
+
"fill",
|
|
101
|
+
"stroke",
|
|
102
|
+
"filter",
|
|
103
|
+
"clip-path",
|
|
104
|
+
"cursor",
|
|
105
|
+
"marker-start",
|
|
106
|
+
"marker-mid",
|
|
107
|
+
"marker-end"
|
|
108
|
+
]);
|
|
109
|
+
function scriptOrigin() {
|
|
110
|
+
try {
|
|
111
|
+
const url = new URL(import.meta.url);
|
|
112
|
+
return /^https?:$/.test(url.protocol) ? url.origin : void 0;
|
|
113
|
+
} catch {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The origin images may load from inline: the origin that served this module. When forge-ai is
|
|
119
|
+
* bundled into a widget embedded on a third-party page, that is the embedding service rather than
|
|
120
|
+
* the host page, which the service cannot vouch for (an open redirect there would bounce the
|
|
121
|
+
* request elsewhere). Falls back to the page origin when the module URL is not http(s), e.g. after
|
|
122
|
+
* a bundler rewrites it.
|
|
123
|
+
*/
|
|
124
|
+
var TRUSTED_ORIGIN = scriptOrigin() ?? self.origin;
|
|
125
|
+
/**
|
|
126
|
+
* Where relative sources resolve when the trusted origin is not the page's own: a relative path in
|
|
127
|
+
* the output then means the embedding service, so it must not resolve against the host page.
|
|
128
|
+
*/
|
|
129
|
+
var EMBEDDED_BASE = TRUSTED_ORIGIN === self.origin ? void 0 : TRUSTED_ORIGIN;
|
|
130
|
+
function resolveUrl(value) {
|
|
131
|
+
try {
|
|
132
|
+
return new URL(value, EMBEDDED_BASE ?? document.baseURI);
|
|
133
|
+
} catch {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function isInlineLoadable(url) {
|
|
138
|
+
if (url.protocol === "data:") return /^data:image\//i.test(url.href);
|
|
139
|
+
return url.origin !== OPAQUE_ORIGIN && url.origin === TRUSTED_ORIGIN;
|
|
140
|
+
}
|
|
141
|
+
function callsUnsafeCssFunction(value) {
|
|
142
|
+
return Array.from(value.matchAll(CSS_FUNCTION)).some(([, name, call]) => call !== void 0 && !SAFE_CSS_FUNCTIONS.has(name.toLowerCase()));
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* SVG and MathML presentation attributes are parsed as CSS. Escapes, strings and functions such as
|
|
146
|
+
* `attr()` or `image-set()` can all reference another origin, so only plain values and known-safe
|
|
147
|
+
* functions survive there.
|
|
148
|
+
*/
|
|
149
|
+
function dropFetchingCssAttribute(node, data) {
|
|
150
|
+
if (URL_ATTRS.has(data.attrName)) return;
|
|
151
|
+
const isParsedAsCss = node.namespaceURI !== HTML_NAMESPACE || CSS_PRESENTATION_ATTRS.has(data.attrName);
|
|
152
|
+
if (EXTERNAL_CSS_URL.test(data.attrValue) || isParsedAsCss && (CSS_ESCAPE_OR_STRING.test(data.attrValue) || callsUnsafeCssFunction(data.attrValue))) data.keepAttr = false;
|
|
153
|
+
}
|
|
154
|
+
function sanitizeElement(node) {
|
|
155
|
+
if (node.nodeName === "A") {
|
|
156
|
+
node.setAttribute("target", "_blank");
|
|
157
|
+
node.setAttribute("rel", "noreferrer noopener");
|
|
158
|
+
} else if (node.nodeName === "IMG") sanitizeImage(node);
|
|
159
|
+
else if (node.nodeName in DEFAULT_MEDIA_LABELS) replaceMedia(node);
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Keeps an image from the trusted origin and swaps any other for a click-to-open link naming its
|
|
163
|
+
* host, or for text when it cannot be linked. When embedded, a kept source is made absolute so the
|
|
164
|
+
* browser loads it from the embedding service rather than the host page.
|
|
165
|
+
*/
|
|
166
|
+
function sanitizeImage(img) {
|
|
167
|
+
const src = img.getAttribute("src")?.trim();
|
|
168
|
+
if (!src) return;
|
|
169
|
+
const url = resolveUrl(src);
|
|
170
|
+
if (url && isInlineLoadable(url)) {
|
|
171
|
+
if (EMBEDDED_BASE && url.protocol !== "data:") img.setAttribute("src", url.href);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
img.replaceWith(createFallback({
|
|
175
|
+
node: img,
|
|
176
|
+
url,
|
|
177
|
+
label: img.getAttribute("alt") || DEFAULT_IMAGE_LABEL
|
|
178
|
+
}));
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Media never loads inline. It becomes a click-to-open link to its source (its own `src`, or its
|
|
182
|
+
* first `<source>`), replacing any fallback content, or its label when it has no linkable source.
|
|
183
|
+
*/
|
|
184
|
+
function replaceMedia(media) {
|
|
185
|
+
const src = (media.getAttribute("src") ?? media.querySelector("source[src]")?.getAttribute("src"))?.trim();
|
|
186
|
+
const url = src ? resolveUrl(src) : void 0;
|
|
187
|
+
const label = media.getAttribute("title") || DEFAULT_MEDIA_LABELS[media.nodeName];
|
|
188
|
+
media.replaceWith(createFallback({
|
|
189
|
+
node: media,
|
|
190
|
+
url,
|
|
191
|
+
label
|
|
192
|
+
}));
|
|
193
|
+
}
|
|
194
|
+
/** A link inside a link would take the click and drop the outer destination, so a nested one becomes text. */
|
|
195
|
+
function createFallback({ node, url, label }) {
|
|
196
|
+
const doc = node.ownerDocument;
|
|
197
|
+
if (!url?.host || !/^https?:$/.test(url.protocol)) return doc.createTextNode(label);
|
|
198
|
+
const text = `${label} (${url.host})`;
|
|
199
|
+
if (node.closest("a")) return doc.createTextNode(text);
|
|
200
|
+
const link = doc.createElement("a");
|
|
201
|
+
link.setAttribute("href", url.href);
|
|
202
|
+
link.setAttribute("target", "_blank");
|
|
203
|
+
link.setAttribute("rel", "noreferrer noopener");
|
|
204
|
+
link.textContent = text;
|
|
205
|
+
return link;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* The DOMPurify singleton is shared with the host app, so these hooks are attached only for the
|
|
209
|
+
* duration of forge-ai's own (synchronous) sanitize calls and never reach the host's.
|
|
210
|
+
*/
|
|
211
|
+
function sanitize(rawHtml, config) {
|
|
212
|
+
DOMPurify.addHook("uponSanitizeAttribute", dropFetchingCssAttribute);
|
|
213
|
+
DOMPurify.addHook("afterSanitizeAttributes", sanitizeElement);
|
|
214
|
+
try {
|
|
215
|
+
return DOMPurify.sanitize(rawHtml, config);
|
|
216
|
+
} finally {
|
|
217
|
+
DOMPurify.removeHook("uponSanitizeAttribute", dropFetchingCssAttribute);
|
|
218
|
+
DOMPurify.removeHook("afterSanitizeAttributes", sanitizeElement);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Renders markdown content to sanitized HTML.
|
|
223
|
+
* Handles incomplete syntax in streaming content, and sanitizes the output to remove unsafe tags and attributes.
|
|
224
|
+
*
|
|
225
|
+
* Block-level tables and code blocks are wrapped as keyboard-focusable, labeled
|
|
226
|
+
* horizontal scroll containers (`role="group"` + `tabindex="0"` + `aria-label`)
|
|
227
|
+
* so keyboard and screen-reader users can reach and scroll overflowing content.
|
|
228
|
+
* The `role="group"` ensures the `aria-label` is reliably announced. The focus
|
|
229
|
+
* ring and scrollbar only appear when the content actually overflows (handled in CSS).
|
|
230
|
+
* @param content The markdown content to render.
|
|
231
|
+
* @param options Options for rendering, including whether the content is streaming.
|
|
232
|
+
* @returns The sanitized HTML string.
|
|
233
|
+
*/
|
|
234
|
+
function renderMarkdown(content, { streaming = true } = {}) {
|
|
235
|
+
const completedMarkdown = remend(content, streaming ? void 0 : COMPLETE_CONTENT_REMEND_OPTIONS);
|
|
236
|
+
const renderer = new marked.Renderer();
|
|
237
|
+
const renderTable = renderer.table.bind(renderer);
|
|
238
|
+
renderer.table = (token) => `<div data-scroll-region="table" role="group" tabindex="0" aria-label="Tabular data">${renderTable(token)}</div>`;
|
|
239
|
+
const renderCode = renderer.code.bind(renderer);
|
|
240
|
+
renderer.code = (token) => renderCode(token).replace(/^<pre/, "<pre data-scroll-region=\"code\" role=\"group\" tabindex=\"0\" aria-label=\"Code block\"");
|
|
241
|
+
return sanitize(marked.parse(completedMarkdown, {
|
|
242
|
+
async: false,
|
|
243
|
+
gfm: true,
|
|
244
|
+
breaks: true,
|
|
245
|
+
renderer
|
|
246
|
+
}), DOMPURIFY_CONFIG);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Renders a single line of markdown to sanitized inline HTML (no block-level
|
|
250
|
+
* wrapping such as `<p>`). Used where the agent may emit bare URLs/emails or
|
|
251
|
+
* raw `<a>` anchors that should render as clickable links, while leaving
|
|
252
|
+
* plain values (IDs, codes, formulas) untouched. Sanitization strips unsafe
|
|
253
|
+
* protocols (e.g. `javascript:`) and disallowed tags/attributes.
|
|
254
|
+
* @param content The markdown content to render.
|
|
255
|
+
* @param options Options for rendering, including whether links render as anchors.
|
|
256
|
+
* @returns The sanitized inline HTML string.
|
|
257
|
+
*/
|
|
258
|
+
function renderInlineMarkdown(content, { links = true } = {}) {
|
|
259
|
+
return sanitize(marked.parseInline(content, {
|
|
260
|
+
async: false,
|
|
261
|
+
gfm: true,
|
|
262
|
+
breaks: true
|
|
263
|
+
}), links ? DOMPURIFY_CONFIG : INLINE_TEXT_LINKS_CONFIG);
|
|
264
|
+
}
|
|
265
|
+
//#endregion
|
|
266
|
+
export { renderInlineMarkdown, renderMarkdown };
|
|
@@ -1,32 +1,38 @@
|
|
|
1
|
+
//#region src/lib/utils/storage-utils.ts
|
|
1
2
|
function resolveStorage(kind) {
|
|
2
|
-
|
|
3
|
+
return kind === "session" ? window.sessionStorage : window.localStorage;
|
|
3
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* Reads a numeric value from Web Storage.
|
|
7
|
+
*
|
|
8
|
+
* @returns The parsed number, or `undefined` if the key is missing, not a finite number, or storage is unavailable.
|
|
9
|
+
*/
|
|
4
10
|
function readStoredNumber({ kind, key }) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return void 0;
|
|
14
|
-
}
|
|
11
|
+
try {
|
|
12
|
+
const raw = resolveStorage(kind).getItem(key);
|
|
13
|
+
if (raw === null) return;
|
|
14
|
+
const value = Number(raw);
|
|
15
|
+
return Number.isFinite(value) ? value : void 0;
|
|
16
|
+
} catch {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
15
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Writes a numeric value to Web Storage. Fails silently if storage is unavailable
|
|
22
|
+
* (private mode, sandboxed iframe, quota exceeded).
|
|
23
|
+
*/
|
|
16
24
|
function writeStoredNumber({ kind, key, value }) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
25
|
+
try {
|
|
26
|
+
resolveStorage(kind).setItem(key, String(value));
|
|
27
|
+
} catch {}
|
|
21
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Removes a value from Web Storage. Fails silently if storage is unavailable.
|
|
31
|
+
*/
|
|
22
32
|
function removeStoredValue({ kind, key }) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
33
|
+
try {
|
|
34
|
+
resolveStorage(kind).removeItem(key);
|
|
35
|
+
} catch {}
|
|
27
36
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
removeStoredValue,
|
|
31
|
-
writeStoredNumber
|
|
32
|
-
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { readStoredNumber, removeStoredValue, writeStoredNumber };
|
package/package.json
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tylertech/forge-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0-dev.0",
|
|
4
4
|
"description": "A library of Tyler Forge™ AI chat interface web components.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Tyler Technologies, Inc.",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"tyler forge",
|
|
9
|
+
"web components",
|
|
10
|
+
"custom elements",
|
|
11
|
+
"lit",
|
|
12
|
+
"ai",
|
|
13
|
+
"chat"
|
|
14
|
+
],
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/tyler-technologies-oss/forge.git",
|
|
18
|
+
"directory": "packages/forge-ai"
|
|
19
|
+
},
|
|
20
|
+
"type": "module",
|
|
7
21
|
"main": "./dist/index.mjs",
|
|
8
22
|
"module": "./dist/index.mjs",
|
|
9
23
|
"types": "./dist/index.d.ts",
|
|
@@ -12,122 +26,44 @@
|
|
|
12
26
|
"types": "./dist/index.d.ts",
|
|
13
27
|
"default": "./dist/index.mjs"
|
|
14
28
|
},
|
|
29
|
+
"./jsx": {
|
|
30
|
+
"types": "./dist/jsx.d.ts"
|
|
31
|
+
},
|
|
15
32
|
"./*": {
|
|
16
33
|
"types": "./dist/*/index.d.ts",
|
|
17
34
|
"default": "./dist/*/index.mjs"
|
|
18
35
|
},
|
|
19
|
-
"./package.json": {
|
|
20
|
-
"default": "./package.json"
|
|
21
|
-
},
|
|
22
36
|
"./custom-elements.json": {
|
|
23
37
|
"default": "./custom-elements.json"
|
|
38
|
+
},
|
|
39
|
+
"./package.json": {
|
|
40
|
+
"default": "./package.json"
|
|
24
41
|
}
|
|
25
42
|
},
|
|
26
43
|
"customElements": "custom-elements.json",
|
|
27
|
-
"keywords": [
|
|
28
|
-
"tyler-forge",
|
|
29
|
-
"web-components",
|
|
30
|
-
"custom-elements",
|
|
31
|
-
"lit-element"
|
|
32
|
-
],
|
|
33
44
|
"files": [
|
|
34
|
-
"
|
|
35
|
-
"
|
|
45
|
+
"dist/",
|
|
46
|
+
"custom-elements.json",
|
|
47
|
+
"MIGRATION.md"
|
|
36
48
|
],
|
|
37
|
-
"repository": {
|
|
38
|
-
"type": "git",
|
|
39
|
-
"url": "git+https://github.com/tyler-technologies-oss/forge-ai.git"
|
|
40
|
-
},
|
|
41
49
|
"dependencies": {
|
|
42
|
-
"@ag-ui/client": "^0.0.57",
|
|
43
|
-
"@ag-ui/core": "^0.0.57",
|
|
44
50
|
"@floating-ui/dom": "^1.8.0",
|
|
45
51
|
"@lit/context": "^1.1.6",
|
|
46
|
-
"dompurify": "^3.4.
|
|
47
|
-
"lit": "3.3.
|
|
48
|
-
"marked": "^18.
|
|
49
|
-
"remend": "^1.
|
|
50
|
-
|
|
52
|
+
"dompurify": "^3.4.17",
|
|
53
|
+
"lit": "^3.3.2",
|
|
54
|
+
"marked": "^18.1.1",
|
|
55
|
+
"remend": "^1.4.0"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"@types/react": "^19"
|
|
59
|
+
},
|
|
60
|
+
"peerDependenciesMeta": {
|
|
61
|
+
"@types/react": {
|
|
62
|
+
"optional": true
|
|
63
|
+
}
|
|
51
64
|
},
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"@esm-bundle/chai": "4.3.4-fix.0",
|
|
55
|
-
"@modelcontextprotocol/ext-apps": "^1.7.5",
|
|
56
|
-
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
57
|
-
"@open-wc/testing": "4.0.0",
|
|
58
|
-
"@storybook/addon-a11y": "9.1.20",
|
|
59
|
-
"@storybook/addon-docs": "9.1.20",
|
|
60
|
-
"@storybook/addon-links": "9.1.20",
|
|
61
|
-
"@storybook/addon-themes": "9.1.20",
|
|
62
|
-
"@storybook/web-components-vite": "9.1.20",
|
|
63
|
-
"@tylertech-eslint/eslint-plugin": "3.0.0",
|
|
64
|
-
"@tylertech/forge": "3.15.2",
|
|
65
|
-
"@tylertech/stylelint-rules": "5.1.2",
|
|
66
|
-
"@tylertech/tyler-icons": "2.2.0",
|
|
67
|
-
"@types/cssbeautify": "^0.3.5",
|
|
68
|
-
"@types/dompurify": "^3.2.0",
|
|
69
|
-
"@types/mocha": "10.0.10",
|
|
70
|
-
"@types/node": "25.9.4",
|
|
71
|
-
"@types/react": "^18.3.31",
|
|
72
|
-
"@types/sinon": "21.0.1",
|
|
73
|
-
"@ungap/structured-clone": "^1.3.3",
|
|
74
|
-
"@vueless/storybook-dark-mode": "9.0.10",
|
|
75
|
-
"@wc-toolkit/jsdoc-tags": "^1.2.0",
|
|
76
|
-
"@web/dev-server-esbuild": "1.0.5",
|
|
77
|
-
"@web/dev-server-rollup": "0.6.4",
|
|
78
|
-
"@web/test-runner": "0.20.2",
|
|
79
|
-
"@web/test-runner-commands": "0.9.0",
|
|
80
|
-
"@web/test-runner-junit-reporter": "0.8.0",
|
|
81
|
-
"@web/test-runner-playwright": "0.11.1",
|
|
82
|
-
"cssbeautify": "^0.3.1",
|
|
83
|
-
"custom-element-svelte-integration": "^1.2.0",
|
|
84
|
-
"custom-element-vuejs-integration": "^1.4.0",
|
|
85
|
-
"eslint": "9.39.4",
|
|
86
|
-
"glob": "13.0.6",
|
|
87
|
-
"lit-analyzer": "2.0.3",
|
|
88
|
-
"plop": "4.0.5",
|
|
89
|
-
"postcss-lit": "1.4.1",
|
|
90
|
-
"react": "^18.3.1",
|
|
91
|
-
"react-dom": "^18.3.1",
|
|
92
|
-
"react-ga4": "^2.1.0",
|
|
93
|
-
"remark-gfm": "4.0.1",
|
|
94
|
-
"rimraf": "6.1.3",
|
|
95
|
-
"sass": "1.93.3",
|
|
96
|
-
"sinon": "21.1.2",
|
|
97
|
-
"storybook": "9.1.20",
|
|
98
|
-
"stylelint": "16.26.1",
|
|
99
|
-
"stylelint-config-standard": "39.0.1",
|
|
100
|
-
"typescript": "~5.9.3",
|
|
101
|
-
"vite": "7.3.6",
|
|
102
|
-
"vite-plugin-ejs": "^1.7.0",
|
|
103
|
-
"vite-plugin-full-reload": "^1.2.0",
|
|
104
|
-
"vite-plugin-dts": "4.5.4",
|
|
105
|
-
"vite-tsconfig-paths": "6.1.1",
|
|
106
|
-
"@repo/prettier-config": "0.0.0"
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"access": "public"
|
|
107
67
|
},
|
|
108
|
-
"
|
|
109
|
-
"dev": "vite src/dev",
|
|
110
|
-
"start": "pnpm run storybook",
|
|
111
|
-
"prebuild": "rimraf dist",
|
|
112
|
-
"build": "pnpm run lint && vite build && pnpm run cem",
|
|
113
|
-
"preview": "vite preview",
|
|
114
|
-
"prestorybook": "pnpm run cem",
|
|
115
|
-
"storybook": "storybook dev -p 6016",
|
|
116
|
-
"sandbox": "node sandbox/server.mjs",
|
|
117
|
-
"prebuild:storybook": "pnpm run cem",
|
|
118
|
-
"build:storybook": "storybook build",
|
|
119
|
-
"lint": "pnpm run lint:lit-analyzer && pnpm run lint:eslint && pnpm run lint:stylelint",
|
|
120
|
-
"lint:eslint": "eslint .",
|
|
121
|
-
"lint:stylelint": "stylelint src/**/*.scss",
|
|
122
|
-
"lint:lit-analyzer": "lit-analyzer",
|
|
123
|
-
"format": "prettier --write .",
|
|
124
|
-
"format:check": "prettier --check .",
|
|
125
|
-
"cem": "cem analyze --config custom-elements-manifest.config.mjs --litelement --globs \"src/lib/**/*.ts\"",
|
|
126
|
-
"cem:watch": "pnpm run analyze -- --watch",
|
|
127
|
-
"test": "wtr --coverage --watch --group lib",
|
|
128
|
-
"test:focus": "wtr --coverage --watch --group",
|
|
129
|
-
"test:ci": "wtr --group lib",
|
|
130
|
-
"ci:package": "tar -czvhf deployment-assets.tar.gz -C cdn-deployment/@tylertech/forge-ai .",
|
|
131
|
-
"plop": "plop"
|
|
132
|
-
}
|
|
68
|
+
"publishedAt": "2026-11-11T00:58:55.973Z"
|
|
133
69
|
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const styles = '/**\n * @license\n * Copyright Tyler Technologies, Inc.\n * License: Apache-2.0\n */\n.forge-label-value {\n --_label-value-align:var(--forge-label-value-align, start);\n --_label-value-label-spacing:var(--forge-label-value-label-spacing, var(--forge-spacing-xxsmall, 4px));\n --_label-value-label-block-start-spacing:var(--forge-label-value-label-block-start-spacing, var(--_label-value-label-spacing));\n --_label-value-label-block-end-spacing:var(--forge-label-value-label-block-end-spacing, var(--_label-value-label-spacing));\n --_label-value-label-color:var(--forge-label-value-label-color, var(--forge-theme-text-medium, rgba(0, 0, 0, 0.6)));\n --_label-value-icon-spacing:var(--forge-label-value-icon-spacing, var(--forge-spacing-xxsmall, 4px));\n --_label-value-inline-label-spacing:var(--forge-label-value-inline-label-spacing, var(--forge-spacing-xsmall, 8px));\n --_label-value-empty-color:var(--forge-label-value-empty-color, var(--forge-theme-text-medium, rgba(0, 0, 0, 0.6)));\n --_label-value-empty-style:var(--forge-label-value-empty-style, italic);\n}\n\n.forge-label-value {\n display: inline-block;\n min-width: 0;\n display: grid;\n grid-template-columns: auto 1fr;\n grid-template-areas: "icon label" "icon value";\n}\n\n.forge-label-value--inline {\n display: flex;\n align-items: center;\n}\n\n.forge-label-value--inline .forge-label-value__label {\n margin-block: 0;\n margin-inline-end: var(--_label-value-inline-label-spacing);\n}\n\n.forge-label-value--empty .forge-label-value__value {\n color: var(--_label-value-empty-color);\n font-style: var(--_label-value-empty-style);\n}\n\n.forge-label-value--ellipsis .forge-label-value__value {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n display: block;\n justify-self: auto;\n}\n\n.forge-label-value__icon, .forge-label-value .forge-icon, .forge-label-value forge-icon {\n display: inline-flex;\n grid-area: icon;\n margin-inline-end: var(--_label-value-icon-spacing);\n}\n\n.forge-label-value__label {\n -moz-osx-font-smoothing: grayscale;\n -webkit-font-smoothing: antialiased;\n font-family: var(--forge-typography-label2-font-family, var(--forge-typography-font-family, "Roboto", sans-serif));\n font-size: var(--forge-typography-label2-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-font-size-scale, 0.8125)));\n font-weight: var(--forge-typography-label2-font-weight, 400);\n line-height: var(--forge-typography-label2-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-line-height-scale, 1.25)));\n letter-spacing: var(--forge-typography-label2-letter-spacing, 0.0096153846em);\n text-transform: var(--forge-typography-label2-text-transform, inherit);\n text-decoration: var(--forge-typography-label2-text-decoration, inherit);\n grid-area: label;\n justify-self: var(--_label-value-align);\n margin-block-start: var(--_label-value-label-block-start-spacing);\n margin-block-end: var(--_label-value-label-block-end-spacing);\n line-height: normal;\n text-align: var(--_label-value-align);\n overflow-wrap: anywhere;\n color: var(--_label-value-label-color);\n}\n\n.forge-label-value__value {\n -moz-osx-font-smoothing: grayscale;\n -webkit-font-smoothing: antialiased;\n font-family: var(--forge-typography-body2-font-family, var(--forge-typography-font-family, "Roboto", sans-serif));\n font-size: var(--forge-typography-body2-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-body-font-size-scale, 1)));\n font-weight: var(--forge-typography-body2-font-weight, 400);\n line-height: var(--forge-typography-body2-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-body-line-height-scale, 1.375)));\n letter-spacing: var(--forge-typography-body2-letter-spacing, 0.015625em);\n text-transform: var(--forge-typography-body2-text-transform, inherit);\n text-decoration: var(--forge-typography-body2-text-decoration, inherit);\n grid-area: value;\n display: grid;\n align-items: center;\n justify-self: var(--_label-value-align);\n line-height: normal;\n text-align: var(--_label-value-align);\n overflow-wrap: anywhere;\n}\n\n:host {\n display: block;\n}\n\n.forge-label-value {\n grid-template-rows: auto 1fr;\n}\n.forge-label-value .forge-label-value__value {\n align-self: start;\n}\n\n.agent-info-container {\n display: flex;\n flex-direction: column;\n gap: var(--forge-spacing-medium, 16px);\n}\n\n.agent-info-header {\n display: flex;\n gap: var(--forge-spacing-medium, 16px);\n}\n.agent-info-header .forge-label-value {\n flex: 1 1 0;\n min-width: 0;\n}\n\n.agent-info-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));\n gap: var(--forge-spacing-medium, 16px);\n}\n\n.agent-info-row {\n display: grid;\n grid-template-columns: 1fr 1fr;\n grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));\n gap: var(--forge-spacing-medium, 16px);\n}\n\n.with-copy-button {\n position: relative;\n}\n.with-copy-button forge-ai-copy-button {\n position: absolute;\n top: -4px;\n right: 0;\n transform: translateY(50%);\n}\n.with-copy-button .forge-label-value__value {\n display: grid;\n grid-template-columns: 1fr auto;\n width: 100%;\n align-items: center;\n gap: var(--forge-spacing-xsmall, 8px);\n}\n.with-copy-button .value-text {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n margin-inline-end: 36px;\n}';
|
|
2
|
-
export {
|
|
3
|
-
styles as default
|
|
4
|
-
};
|