@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
|
@@ -1,470 +0,0 @@
|
|
|
1
|
-
import { Thread } from '../ai-threads';
|
|
2
|
-
/**
|
|
3
|
-
* Valid HTML heading levels for accessibility and semantic structure
|
|
4
|
-
*/
|
|
5
|
-
export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
|
-
export interface Agent {
|
|
7
|
-
id: string;
|
|
8
|
-
name: string;
|
|
9
|
-
description?: string;
|
|
10
|
-
}
|
|
11
|
-
export type SlashCommandId = 'clear' | 'export' | 'info' | 'debug';
|
|
12
|
-
export type SlashCommandGroup = 'Conversation' | 'Help';
|
|
13
|
-
export interface SlashCommand {
|
|
14
|
-
id: SlashCommandId;
|
|
15
|
-
name: string;
|
|
16
|
-
group: SlashCommandGroup;
|
|
17
|
-
}
|
|
18
|
-
export interface ForgeAiSlashCommandMenuSelectEventData {
|
|
19
|
-
command: SlashCommand;
|
|
20
|
-
index: number;
|
|
21
|
-
}
|
|
22
|
-
export interface ToolRenderer {
|
|
23
|
-
elementTag?: string;
|
|
24
|
-
render?: (toolCall: ToolCall) => HTMLElement | DocumentFragment;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Interface that tool renderer components should implement for type-safe tool call handling.
|
|
28
|
-
* @template TArgs - Type of the tool call arguments
|
|
29
|
-
*/
|
|
30
|
-
export interface IToolRenderer<TArgs = Record<string, unknown>> {
|
|
31
|
-
toolCall: ToolCall<TArgs>;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Context provided to tool handlers when they are invoked.
|
|
35
|
-
* @template TArgs - Type of the tool call arguments
|
|
36
|
-
*/
|
|
37
|
-
export interface HandlerContext<TArgs = Record<string, unknown>> {
|
|
38
|
-
/** Tool call arguments */
|
|
39
|
-
args: TArgs;
|
|
40
|
-
/** Unique identifier for this tool call */
|
|
41
|
-
toolCallId: string;
|
|
42
|
-
/** Name of the tool being called */
|
|
43
|
-
toolName: string;
|
|
44
|
-
/** Optional abort signal for cancellation support */
|
|
45
|
-
signal?: AbortSignal;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Context provided to onStart callback when tool call begins.
|
|
49
|
-
*/
|
|
50
|
-
export interface ToolStartContext {
|
|
51
|
-
toolCallId: string;
|
|
52
|
-
toolName: string;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Context provided to onDelta callback during streaming.
|
|
56
|
-
* @template TArgs - Type of the tool call arguments
|
|
57
|
-
*/
|
|
58
|
-
export interface ToolDeltaContext<TArgs = Record<string, unknown>> {
|
|
59
|
-
argsBuffer: string;
|
|
60
|
-
partialArgs: Partial<TArgs>;
|
|
61
|
-
toolCallId: string;
|
|
62
|
-
toolName: string;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Context provided to onEnd callback when args are complete.
|
|
66
|
-
* @template TArgs - Type of the tool call arguments
|
|
67
|
-
*/
|
|
68
|
-
export interface ToolEndContext<TArgs = Record<string, unknown>> {
|
|
69
|
-
args: TArgs;
|
|
70
|
-
toolCallId: string;
|
|
71
|
-
toolName: string;
|
|
72
|
-
}
|
|
73
|
-
export type ToolType = 'client' | 'agent';
|
|
74
|
-
/**
|
|
75
|
-
* Tool definition with optional type-safe handler.
|
|
76
|
-
* @template TArgs - Type of the tool call arguments for type-safe handler context
|
|
77
|
-
*/
|
|
78
|
-
export interface ToolDefinition<THandlerArgs = Record<string, unknown>> {
|
|
79
|
-
name: string;
|
|
80
|
-
displayName?: string;
|
|
81
|
-
description?: string;
|
|
82
|
-
parameters?: {
|
|
83
|
-
type: 'object';
|
|
84
|
-
properties?: Record<string, unknown>;
|
|
85
|
-
required?: string[];
|
|
86
|
-
};
|
|
87
|
-
/** Optional renderer for displaying tool call results within the chat UI. */
|
|
88
|
-
renderer?: ToolRenderer;
|
|
89
|
-
/** If true, renderer shows immediately on tool call start (default: false). */
|
|
90
|
-
renderOnStart?: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Opt-in marker declaring this tool is backed by an MCP-app UI resource. Presence
|
|
93
|
-
* signals the core controller to resolve + stamp a {@link McpAppUiResource} when the
|
|
94
|
-
* tool is called. `resourceUri` is informational; the resolved URI arrives on the
|
|
95
|
-
* `mcp-ui-resource` event.
|
|
96
|
-
*/
|
|
97
|
-
mcpApp?: {
|
|
98
|
-
resourceUri?: string;
|
|
99
|
-
};
|
|
100
|
-
/** Called when tool call starts (before args stream). */
|
|
101
|
-
onStart?: (context: ToolStartContext) => void;
|
|
102
|
-
/** Called during streaming with partial args. */
|
|
103
|
-
onDelta?: (context: ToolDeltaContext<THandlerArgs>) => void;
|
|
104
|
-
/** Called when args are complete (before handler execution). */
|
|
105
|
-
onEnd?: (context: ToolEndContext<THandlerArgs>) => void;
|
|
106
|
-
/**
|
|
107
|
-
* Optional handler function invoked when tool is called.
|
|
108
|
-
* Can return a string, object, or void. Strings and objects are used directly as tool results.
|
|
109
|
-
*/
|
|
110
|
-
handler?: (context: HandlerContext<THandlerArgs>) => Promise<string | Record<string, unknown> | void> | string | Record<string, unknown> | void;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Content-Security-Policy domain allow-lists for an MCP-app resource, mirroring the
|
|
114
|
-
* spec's `_meta.ui.csp` shape (2026-01-26). The sandbox proxy composes these into the
|
|
115
|
-
* enforced CSP; when omitted a restrictive default block applies.
|
|
116
|
-
*
|
|
117
|
-
* Local type — intentionally NOT aliased from `@modelcontextprotocol/ext-apps` so the
|
|
118
|
-
* type layer stays bridge-agnostic.
|
|
119
|
-
*/
|
|
120
|
-
export interface McpAppResourceCsp {
|
|
121
|
-
/** Domains the widget may `connect-src` to (fetch/XHR/WebSocket). */
|
|
122
|
-
connectDomains?: string[];
|
|
123
|
-
/** Domains the widget may load passive resources from (img/media/etc.). */
|
|
124
|
-
resourceDomains?: string[];
|
|
125
|
-
/** Domains allowed in `frame-src`; absent → `frame-src 'none'`. */
|
|
126
|
-
frameDomains?: string[];
|
|
127
|
-
/** Domains allowed in `base-uri`; absent → `base-uri 'self'`. */
|
|
128
|
-
baseUriDomains?: string[];
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Iframe permission policy for an MCP-app resource, mirroring the spec's
|
|
132
|
-
* `_meta.ui.permissions` shape (2026-01-26): a key being present (with an empty object
|
|
133
|
-
* value) means the permission is requested. The sandbox maps requested keys onto the
|
|
134
|
-
* iframe `allow` attribute.
|
|
135
|
-
*
|
|
136
|
-
* Local type — not aliased from ext-apps.
|
|
137
|
-
*/
|
|
138
|
-
export interface McpAppResourcePermissions {
|
|
139
|
-
camera?: Record<string, never>;
|
|
140
|
-
microphone?: Record<string, never>;
|
|
141
|
-
geolocation?: Record<string, never>;
|
|
142
|
-
clipboardWrite?: Record<string, never>;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* The resolved UI resource stamped onto a {@link ToolCall} once a `mcp-ui-resource`
|
|
146
|
-
* event arrives. Presence of this on a tool call is the single render discriminator for
|
|
147
|
-
* mounting `<forge-ai-mcp-app>`.
|
|
148
|
-
*
|
|
149
|
-
* Returned by `AgentAdapter.resolveMcpAppResource`, which fills `csp`/`permissions` from
|
|
150
|
-
* the template response's `_meta.ui` (pass `{}` when the template declares none). The
|
|
151
|
-
* widget refuses to render when either is missing.
|
|
152
|
-
*
|
|
153
|
-
* Local type — not aliased from ext-apps.
|
|
154
|
-
*/
|
|
155
|
-
export interface McpAppUiResource {
|
|
156
|
-
/** The complete standalone app HTML document, resolved server-side. */
|
|
157
|
-
html: string;
|
|
158
|
-
/** CSP domain allow-lists to enforce in the sandbox. Empty → restrictive default. */
|
|
159
|
-
csp: McpAppResourceCsp;
|
|
160
|
-
/** Iframe permission policy for the sandbox inner frame. */
|
|
161
|
-
permissions: McpAppResourcePermissions;
|
|
162
|
-
/** The concrete resolved `ui://` resource URI (never a template). */
|
|
163
|
-
resourceUri?: string;
|
|
164
|
-
/**
|
|
165
|
-
* Whether the widget prefers the host to draw a border/background around it.
|
|
166
|
-
* `true` → visible chrome, `false` → none, omitted → renderer default.
|
|
167
|
-
*/
|
|
168
|
-
prefersBorder?: boolean;
|
|
169
|
-
}
|
|
170
|
-
/** Display modes an MCP-app widget can be presented in (spec 2026-01-26). */
|
|
171
|
-
export type McpAppDisplayMode = 'inline' | 'fullscreen' | 'pip';
|
|
172
|
-
/**
|
|
173
|
-
* The raw MCP `CallToolResult` (minus `structuredContent`) for an MCP-app tool call. The
|
|
174
|
-
* View's `ui/notifications/tool-result` is built from this plus
|
|
175
|
-
* {@link ToolCall.structuredContent} — never from the model-facing `result`.
|
|
176
|
-
*/
|
|
177
|
-
export interface McpToolResult {
|
|
178
|
-
content: unknown[];
|
|
179
|
-
isError?: boolean;
|
|
180
|
-
_meta?: Record<string, unknown>;
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Size of the container holding a widget, in CSS pixels (spec `containerDimensions`): a
|
|
184
|
-
* fixed `height` or a `maxHeight` bound, and a fixed `width` or a `maxWidth` bound.
|
|
185
|
-
*/
|
|
186
|
-
export type McpAppContainerDimensions = ({
|
|
187
|
-
height: number;
|
|
188
|
-
} | {
|
|
189
|
-
maxHeight?: number;
|
|
190
|
-
}) & ({
|
|
191
|
-
width: number;
|
|
192
|
-
} | {
|
|
193
|
-
maxWidth?: number;
|
|
194
|
-
});
|
|
195
|
-
/** The tool call that instantiated a widget (spec `toolInfo`). */
|
|
196
|
-
export interface McpAppToolInfo {
|
|
197
|
-
id?: string | number;
|
|
198
|
-
tool: {
|
|
199
|
-
name: string;
|
|
200
|
-
inputSchema: {
|
|
201
|
-
type: 'object';
|
|
202
|
-
[key: string]: unknown;
|
|
203
|
-
};
|
|
204
|
-
[key: string]: unknown;
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Theming sent to MCP-app widgets (spec `hostContext.styles`): spec CSS variables (e.g.
|
|
209
|
-
* `--color-background-primary`) resolved from Forge tokens. Font loading (`css.fonts`) is not sent.
|
|
210
|
-
*/
|
|
211
|
-
export interface McpAppHostStyles {
|
|
212
|
-
variables?: Record<string, string>;
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Host context projected into an MCP-app widget.
|
|
216
|
-
*
|
|
217
|
-
* Local type — not aliased from ext-apps.
|
|
218
|
-
*/
|
|
219
|
-
export interface McpAppHostContext {
|
|
220
|
-
theme: 'light' | 'dark';
|
|
221
|
-
/** Spec CSS variables resolved from the widget's Forge tokens. */
|
|
222
|
-
styles?: McpAppHostStyles;
|
|
223
|
-
/** The tool call that instantiated the widget. */
|
|
224
|
-
toolInfo?: McpAppToolInfo;
|
|
225
|
-
/** Size of the container holding the widget. */
|
|
226
|
-
containerDimensions?: McpAppContainerDimensions;
|
|
227
|
-
/** The widget's current display mode. */
|
|
228
|
-
displayMode?: McpAppDisplayMode;
|
|
229
|
-
/** Display modes the host is able to present. */
|
|
230
|
-
availableDisplayModes?: McpAppDisplayMode[];
|
|
231
|
-
/** BCP 47 language tag. */
|
|
232
|
-
locale?: string;
|
|
233
|
-
/** IANA time zone. */
|
|
234
|
-
timeZone?: string;
|
|
235
|
-
userAgent?: string;
|
|
236
|
-
platform?: 'web' | 'desktop' | 'mobile';
|
|
237
|
-
deviceCapabilities?: {
|
|
238
|
-
touch?: boolean;
|
|
239
|
-
hover?: boolean;
|
|
240
|
-
};
|
|
241
|
-
safeAreaInsets?: {
|
|
242
|
-
top: number;
|
|
243
|
-
right: number;
|
|
244
|
-
bottom: number;
|
|
245
|
-
left: number;
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
/** Content-block types a host accepts for `ui/message` / `ui/update-model-context`. */
|
|
249
|
-
export interface McpAppContentModalities {
|
|
250
|
-
text?: Record<string, never>;
|
|
251
|
-
image?: Record<string, never>;
|
|
252
|
-
audio?: Record<string, never>;
|
|
253
|
-
resource?: Record<string, never>;
|
|
254
|
-
resourceLink?: Record<string, never>;
|
|
255
|
-
structuredContent?: Record<string, never>;
|
|
256
|
-
}
|
|
257
|
-
/** The sandbox policy the host enforces for a widget, echoed in its host capabilities. */
|
|
258
|
-
export interface McpAppSandboxCapabilities {
|
|
259
|
-
csp?: McpAppResourceCsp;
|
|
260
|
-
permissions?: McpAppResourcePermissions;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Host capability advertisement returned to the widget in `McpUiInitializeResult`.
|
|
264
|
-
* Spec-compliant widgets gate `ui/open-link` / `tools/call` / `resources/read` on these,
|
|
265
|
-
* so they must be declared, not left implicit.
|
|
266
|
-
*
|
|
267
|
-
* Local type — not aliased from ext-apps.
|
|
268
|
-
*/
|
|
269
|
-
export interface McpAppHostCapabilities {
|
|
270
|
-
openLinks?: Record<string, never>;
|
|
271
|
-
serverTools?: {
|
|
272
|
-
listChanged?: boolean;
|
|
273
|
-
};
|
|
274
|
-
serverResources?: {
|
|
275
|
-
listChanged?: boolean;
|
|
276
|
-
};
|
|
277
|
-
logging?: Record<string, never>;
|
|
278
|
-
message?: McpAppContentModalities;
|
|
279
|
-
updateModelContext?: McpAppContentModalities;
|
|
280
|
-
sandbox?: McpAppSandboxCapabilities;
|
|
281
|
-
}
|
|
282
|
-
export interface ChatMessage {
|
|
283
|
-
id: string;
|
|
284
|
-
role: 'user' | 'assistant' | 'system' | 'tool';
|
|
285
|
-
content: string;
|
|
286
|
-
timestamp: number;
|
|
287
|
-
status: 'pending' | 'streaming' | 'complete' | 'error';
|
|
288
|
-
toolCalls?: ToolCall[];
|
|
289
|
-
toolCallId?: string;
|
|
290
|
-
feedback?: ResponseFeedback;
|
|
291
|
-
children?: ResponseItem[];
|
|
292
|
-
clientOnly?: boolean;
|
|
293
|
-
kind?: ClientMessageKind;
|
|
294
|
-
header?: string;
|
|
295
|
-
actions?: ClientMessageAction[];
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* Visual treatment for a client-only message. `text` matches the plain,
|
|
299
|
-
* italic system-message style; the others render as a Forge inline-message
|
|
300
|
-
* banner with a matching icon.
|
|
301
|
-
*/
|
|
302
|
-
export type ClientMessageKind = 'text' | 'info' | 'warning' | 'error' | 'success';
|
|
303
|
-
export interface ClientMessageAction {
|
|
304
|
-
id: string;
|
|
305
|
-
label: string;
|
|
306
|
-
onClick: () => void;
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Input to {@link AiChatbotBase.addClientMessage}. Pass the same `id` on a
|
|
310
|
-
* later call to upsert (replace) a previously added client message.
|
|
311
|
-
*/
|
|
312
|
-
export interface ClientMessageInput {
|
|
313
|
-
id?: string;
|
|
314
|
-
content: string;
|
|
315
|
-
kind?: ClientMessageKind;
|
|
316
|
-
header?: string;
|
|
317
|
-
actions?: ClientMessageAction[];
|
|
318
|
-
}
|
|
319
|
-
export interface ToolCall<TArgs = Record<string, unknown>> {
|
|
320
|
-
id: string;
|
|
321
|
-
messageId: string;
|
|
322
|
-
name: string;
|
|
323
|
-
args: TArgs;
|
|
324
|
-
argsBuffer?: string;
|
|
325
|
-
result?: unknown;
|
|
326
|
-
status: ToolCallStatus;
|
|
327
|
-
type: ToolType;
|
|
328
|
-
startTimestamp?: number;
|
|
329
|
-
endTimestamp?: number;
|
|
330
|
-
/**
|
|
331
|
-
* The resolved MCP-app UI resource. When present, this tool call renders as a
|
|
332
|
-
* sandboxed `<forge-ai-mcp-app>` widget instead of the standard tool-call UI. Its
|
|
333
|
-
* presence is the single render discriminator.
|
|
334
|
-
*/
|
|
335
|
-
uiResource?: McpAppUiResource;
|
|
336
|
-
/** Companion structured payload for the widget, stripped from LLM context. */
|
|
337
|
-
structuredContent?: unknown;
|
|
338
|
-
/** `true` when `structuredContent` was dropped by the backend (size caps). */
|
|
339
|
-
structuredContentOmitted?: boolean;
|
|
340
|
-
/** Raw MCP result for an MCP-app tool call; the source of the View's `tool-result`. */
|
|
341
|
-
mcpResult?: McpToolResult;
|
|
342
|
-
/** `true` when `mcpResult` was dropped by the backend (size caps). */
|
|
343
|
-
mcpResultOmitted?: boolean;
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Tool call lifecycle. `cancelled` means the call ended without a result (run aborted,
|
|
347
|
-
* stream ended/errored, or the adapter reported `cancelled: true`).
|
|
348
|
-
*/
|
|
349
|
-
export type ToolCallStatus = 'pending' | 'parsing' | 'executing' | 'complete' | 'error' | 'cancelled';
|
|
350
|
-
export type ResponseItem = {
|
|
351
|
-
type: 'text';
|
|
352
|
-
messageId: string;
|
|
353
|
-
content: string;
|
|
354
|
-
status: 'streaming' | 'complete';
|
|
355
|
-
} | {
|
|
356
|
-
type: 'toolCall';
|
|
357
|
-
data: ToolCall;
|
|
358
|
-
};
|
|
359
|
-
export type FeedbackType = 'positive' | 'negative';
|
|
360
|
-
export interface ResponseFeedback {
|
|
361
|
-
type: FeedbackType;
|
|
362
|
-
reason?: string;
|
|
363
|
-
}
|
|
364
|
-
export interface AssistantResponse {
|
|
365
|
-
id: string;
|
|
366
|
-
children: ResponseItem[];
|
|
367
|
-
status: 'streaming' | 'complete' | 'error';
|
|
368
|
-
timestamp: number;
|
|
369
|
-
feedback?: ResponseFeedback;
|
|
370
|
-
isThinking?: boolean;
|
|
371
|
-
}
|
|
372
|
-
export interface FileAttachment {
|
|
373
|
-
id: string;
|
|
374
|
-
filename: string;
|
|
375
|
-
size: number;
|
|
376
|
-
mimeType: string;
|
|
377
|
-
timestamp: number;
|
|
378
|
-
uploading?: boolean;
|
|
379
|
-
progress?: number;
|
|
380
|
-
status?: 'pending' | 'uploading' | 'success' | 'error';
|
|
381
|
-
error?: string;
|
|
382
|
-
fileId?: string;
|
|
383
|
-
}
|
|
384
|
-
export interface UploadedFileMetadata {
|
|
385
|
-
fileId: string;
|
|
386
|
-
fileName: string;
|
|
387
|
-
fileType: string;
|
|
388
|
-
fileSize: number;
|
|
389
|
-
uploadedAt: string;
|
|
390
|
-
}
|
|
391
|
-
export interface FileUploadCallbacks {
|
|
392
|
-
updateProgress: (progress: number) => void;
|
|
393
|
-
markComplete: (metadata: UploadedFileMetadata) => void;
|
|
394
|
-
markError: (error: string) => void;
|
|
395
|
-
onAbort: (callback: () => void) => void;
|
|
396
|
-
}
|
|
397
|
-
export type FileUploadHandler = (file: File, callbacks: FileUploadCallbacks) => Promise<void> | void;
|
|
398
|
-
export interface FileRemoveCallbacks {
|
|
399
|
-
onSuccess: () => void;
|
|
400
|
-
onError: (error: string) => void;
|
|
401
|
-
}
|
|
402
|
-
export interface FileRemoveEvent extends FileRemoveCallbacks {
|
|
403
|
-
fileId: string;
|
|
404
|
-
}
|
|
405
|
-
export interface ForgeAiChatbotFileSelectEventData {
|
|
406
|
-
fileId: string;
|
|
407
|
-
file: File;
|
|
408
|
-
filename: string;
|
|
409
|
-
size: number;
|
|
410
|
-
mimeType: string;
|
|
411
|
-
timestamp: number;
|
|
412
|
-
updateProgress: (progress: number) => void;
|
|
413
|
-
markComplete: (metadata: UploadedFileMetadata) => void;
|
|
414
|
-
markError: (error: string) => void;
|
|
415
|
-
onAbort: (callback: () => void) => void;
|
|
416
|
-
}
|
|
417
|
-
export type MessageItem = {
|
|
418
|
-
type: 'message';
|
|
419
|
-
data: ChatMessage;
|
|
420
|
-
} | {
|
|
421
|
-
type: 'toolCall';
|
|
422
|
-
data: ToolCall;
|
|
423
|
-
} | {
|
|
424
|
-
type: 'assistant';
|
|
425
|
-
data: AssistantResponse;
|
|
426
|
-
};
|
|
427
|
-
export interface ThreadState {
|
|
428
|
-
threadId?: string;
|
|
429
|
-
messages: ChatMessage[];
|
|
430
|
-
timestamp?: number;
|
|
431
|
-
selectedAgentId?: string;
|
|
432
|
-
}
|
|
433
|
-
export interface ForgeAiChatbotThreadSelectEventData {
|
|
434
|
-
id: string;
|
|
435
|
-
title: string;
|
|
436
|
-
}
|
|
437
|
-
export interface ForgeAiChatbotThreadSearchEventData {
|
|
438
|
-
query: string;
|
|
439
|
-
setResults: (results: Thread[]) => void;
|
|
440
|
-
}
|
|
441
|
-
export interface ForgeAiChatbotThreadLoadMoreEventData {
|
|
442
|
-
query: string;
|
|
443
|
-
appendResults: (results: Thread[]) => void;
|
|
444
|
-
}
|
|
445
|
-
export interface ForgeAiChatbotThreadRenameEventData {
|
|
446
|
-
id: string;
|
|
447
|
-
oldTitle: string;
|
|
448
|
-
newTitle: string;
|
|
449
|
-
onSuccess: () => void;
|
|
450
|
-
onError: (error?: string) => void;
|
|
451
|
-
}
|
|
452
|
-
export interface ForgeAiChatbotThreadDeleteEventData {
|
|
453
|
-
id: string;
|
|
454
|
-
thread: Thread;
|
|
455
|
-
onSuccess: () => void;
|
|
456
|
-
onError: (error?: string) => void;
|
|
457
|
-
}
|
|
458
|
-
export interface ContextItem {
|
|
459
|
-
id: string;
|
|
460
|
-
label: string;
|
|
461
|
-
removable?: boolean;
|
|
462
|
-
sublabel?: string;
|
|
463
|
-
loading?: boolean;
|
|
464
|
-
type?: 'file' | 'context';
|
|
465
|
-
}
|
|
466
|
-
export interface ForgeAiChatbotContextRemoveEventData {
|
|
467
|
-
id: string;
|
|
468
|
-
item: ContextItem;
|
|
469
|
-
}
|
|
470
|
-
export type { Thread };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { ChatMessage, ContextItem, FileAttachment, ToolCall, ToolDefinition } from './types.js';
|
|
2
|
-
export { renderMarkdown, renderInlineMarkdown, type RenderMarkdownOptions } from '../utils/markdown.js';
|
|
3
|
-
/**
|
|
4
|
-
* Whether a tool call's renderer should currently be shown: once the call is complete,
|
|
5
|
-
* or immediately (while still parsing/executing) if the tool opted into `renderOnStart`.
|
|
6
|
-
*/
|
|
7
|
-
export declare function shouldShowToolRenderer(toolCall: ToolCall, toolDefinition?: ToolDefinition): boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Whether a tool call should be treated as settled for activity indicators (thinking
|
|
10
|
-
* indicator, tool-call summary spinner): either genuinely finished, or already showing
|
|
11
|
-
* its own renderer to the user, which makes a redundant "running" spinner misleading.
|
|
12
|
-
*/
|
|
13
|
-
export declare function isToolCallSettled(toolCall: ToolCall, toolDefinition?: ToolDefinition): boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Generates a unique ID using UUID v4
|
|
16
|
-
*/
|
|
17
|
-
export declare function generateId(): string;
|
|
18
|
-
/**
|
|
19
|
-
* Downloads content as a file with specified MIME type
|
|
20
|
-
*/
|
|
21
|
-
export declare function downloadFile(content: string, filename: string, mimeType?: string): void;
|
|
22
|
-
/**
|
|
23
|
-
* Converts file attachments to context items
|
|
24
|
-
*/
|
|
25
|
-
export declare function fileAttachmentsToContextItems(completedAttachments: FileAttachment[], pendingAttachments: FileAttachment[]): ContextItem[];
|
|
26
|
-
/**
|
|
27
|
-
* Formats a single tool call as indented text lines for a chat export.
|
|
28
|
-
*/
|
|
29
|
-
export declare function formatToolCallForExport(toolCall: ToolCall): string;
|
|
30
|
-
/**
|
|
31
|
-
* Formats a list of chat messages into a plain-text transcript. Tool call
|
|
32
|
-
* details are only included when `includeToolCalls` is enabled. When a message
|
|
33
|
-
* retains its interleaved `children`, text and tool calls are emitted in the
|
|
34
|
-
* exact order they occurred; otherwise it falls back to the flat content plus a
|
|
35
|
-
* trailing tool call block.
|
|
36
|
-
*/
|
|
37
|
-
export declare function formatChatTranscript(messages: ChatMessage[], { includeToolCalls }?: {
|
|
38
|
-
includeToolCalls?: boolean | undefined;
|
|
39
|
-
}): string;
|
|
40
|
-
/**
|
|
41
|
-
* Builds a timestamped filename for an exported chat transcript, optionally
|
|
42
|
-
* prefixed with a slugified agent name.
|
|
43
|
-
*/
|
|
44
|
-
export declare function createChatExportFilename(agentName?: string): string;
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { v4 } from "uuid";
|
|
2
|
-
import { renderInlineMarkdown, renderMarkdown } from "../utils/markdown.mjs";
|
|
3
|
-
function shouldShowToolRenderer(toolCall, toolDefinition) {
|
|
4
|
-
if (!toolDefinition?.renderer) {
|
|
5
|
-
return false;
|
|
6
|
-
}
|
|
7
|
-
if (toolCall.status === "complete") {
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
return !!toolDefinition.renderOnStart && (toolCall.status === "parsing" || toolCall.status === "executing");
|
|
11
|
-
}
|
|
12
|
-
function isToolCallSettled(toolCall, toolDefinition) {
|
|
13
|
-
return toolCall.status === "complete" || toolCall.status === "error" || toolCall.status === "cancelled" || shouldShowToolRenderer(toolCall, toolDefinition);
|
|
14
|
-
}
|
|
15
|
-
function generateId() {
|
|
16
|
-
return v4();
|
|
17
|
-
}
|
|
18
|
-
function downloadFile(content, filename, mimeType = "text/plain") {
|
|
19
|
-
const blob = new Blob([content], { type: mimeType });
|
|
20
|
-
const url = URL.createObjectURL(blob);
|
|
21
|
-
const link = document.createElement("a");
|
|
22
|
-
link.href = url;
|
|
23
|
-
link.download = filename;
|
|
24
|
-
document.body.appendChild(link);
|
|
25
|
-
link.click();
|
|
26
|
-
document.body.removeChild(link);
|
|
27
|
-
URL.revokeObjectURL(url);
|
|
28
|
-
}
|
|
29
|
-
function fileAttachmentsToContextItems(completedAttachments, pendingAttachments) {
|
|
30
|
-
const pending = pendingAttachments.map((file) => ({
|
|
31
|
-
id: file.id,
|
|
32
|
-
label: file.filename,
|
|
33
|
-
sublabel: formatBytes(file.size),
|
|
34
|
-
loading: file.uploading ?? true,
|
|
35
|
-
removable: true,
|
|
36
|
-
type: "file"
|
|
37
|
-
}));
|
|
38
|
-
const completed = completedAttachments.map((file) => ({
|
|
39
|
-
id: file.id,
|
|
40
|
-
label: file.filename,
|
|
41
|
-
sublabel: formatBytes(file.size),
|
|
42
|
-
removable: true,
|
|
43
|
-
type: "file"
|
|
44
|
-
}));
|
|
45
|
-
return [...pending, ...completed];
|
|
46
|
-
}
|
|
47
|
-
function formatToolCallForExport(toolCall) {
|
|
48
|
-
const lines = [` - Tool: ${toolCall.name}`, ` Args: ${JSON.stringify(toolCall.args)}`];
|
|
49
|
-
if (toolCall.status === "error") {
|
|
50
|
-
const errorMsg = typeof toolCall.result === "object" && toolCall.result !== null && "error" in toolCall.result ? toolCall.result.error : "Unknown error";
|
|
51
|
-
lines.push(` Error: ${errorMsg}`);
|
|
52
|
-
} else if (toolCall.status === "cancelled") {
|
|
53
|
-
lines.push(" Cancelled");
|
|
54
|
-
} else if (toolCall.result !== void 0) {
|
|
55
|
-
lines.push(` Result: ${JSON.stringify(toolCall.result)}`);
|
|
56
|
-
}
|
|
57
|
-
return lines.join("\n");
|
|
58
|
-
}
|
|
59
|
-
function formatChatTranscript(messages, { includeToolCalls = false } = {}) {
|
|
60
|
-
return messages.map((message) => {
|
|
61
|
-
const timestamp = new Date(message.timestamp).toLocaleString();
|
|
62
|
-
const role = message.role === "user" ? "You" : "Agent";
|
|
63
|
-
const body = message.children?.length ? formatInterleavedBody(message.children, includeToolCalls) : formatFlatBody(message, includeToolCalls);
|
|
64
|
-
return `[${timestamp}] ${role}:
|
|
65
|
-
${body}
|
|
66
|
-
`;
|
|
67
|
-
}).join("\n");
|
|
68
|
-
}
|
|
69
|
-
function formatInterleavedBody(children, includeToolCalls) {
|
|
70
|
-
return children.map((item) => {
|
|
71
|
-
if (item.type === "text") {
|
|
72
|
-
return item.content;
|
|
73
|
-
}
|
|
74
|
-
return includeToolCalls ? formatToolCallForExport(item.data) : "";
|
|
75
|
-
}).filter((part) => part.trim().length > 0).join("\n\n");
|
|
76
|
-
}
|
|
77
|
-
function formatFlatBody(message, includeToolCalls) {
|
|
78
|
-
let body = message.content;
|
|
79
|
-
if (includeToolCalls && message.toolCalls?.length) {
|
|
80
|
-
body += "\n" + message.toolCalls.map(formatToolCallForExport).join("\n\n") + "\n";
|
|
81
|
-
}
|
|
82
|
-
return body;
|
|
83
|
-
}
|
|
84
|
-
function createChatExportFilename(agentName) {
|
|
85
|
-
const timestamp = (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace(/:/g, "-");
|
|
86
|
-
const slug = agentName?.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
87
|
-
const prefix = slug ? `${slug}-` : "";
|
|
88
|
-
return `${prefix}chat-history-${timestamp}.txt`;
|
|
89
|
-
}
|
|
90
|
-
function formatBytes(bytes) {
|
|
91
|
-
if (bytes === 0) {
|
|
92
|
-
return "0 B";
|
|
93
|
-
}
|
|
94
|
-
const k = 1024;
|
|
95
|
-
const sizes = ["B", "KB", "MB", "GB"];
|
|
96
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
97
|
-
return `${Math.round(bytes / Math.pow(k, i) * 100) / 100} ${sizes[i]}`;
|
|
98
|
-
}
|
|
99
|
-
export {
|
|
100
|
-
createChatExportFilename,
|
|
101
|
-
downloadFile,
|
|
102
|
-
fileAttachmentsToContextItems,
|
|
103
|
-
formatChatTranscript,
|
|
104
|
-
formatToolCallForExport,
|
|
105
|
-
generateId,
|
|
106
|
-
isToolCallSettled,
|
|
107
|
-
renderInlineMarkdown,
|
|
108
|
-
renderMarkdown,
|
|
109
|
-
shouldShowToolRenderer
|
|
110
|
-
};
|