@tylertech/forge-ai 0.15.3-dev.1 → 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 +5757 -15411
- 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 +1 -2
- package/dist/ai-assistant-response/ai-assistant-response.mjs +4 -236
- 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 +3 -3
- package/dist/ai-canvas/ai-canvas.mjs +4 -95
- package/dist/ai-canvas/ai-canvas2.mjs +74 -0
- package/dist/ai-canvas/index.d.ts +1 -1
- package/dist/ai-canvas/index.mjs +1 -5
- 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 +4 -3
- package/dist/ai-message-thread/ai-message-thread.mjs +4 -360
- 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-chatbot → ai-tool-call}/create-tool-renderer.d.ts +1 -1
- 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-chatbot → ai-tool-call}/tool-canvas.d.ts +1 -1
- 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 +1 -1
- 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 +3 -2
- package/dist/core/index.mjs +7 -8
- 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.mjs +132 -154
- 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 -53
- package/dist/index.mjs +100 -214
- 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-canvas/ai-canvas.scss.mjs +0 -4
- 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 -179
- package/dist/ai-chatbot/ai-chatbot-base.mjs +0 -684
- package/dist/ai-chatbot/ai-chatbot-tool-call.d.ts +0 -19
- package/dist/ai-chatbot/ai-chatbot-tool-call.mjs +0 -182
- package/dist/ai-chatbot/ai-chatbot-tool-call.scss.mjs +0 -4
- package/dist/ai-chatbot/ai-chatbot.d.ts +0 -196
- package/dist/ai-chatbot/ai-chatbot.mjs +0 -502
- package/dist/ai-chatbot/ai-chatbot.scss.mjs +0 -4
- 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 -18
- package/dist/ai-chatbot/index.mjs +0 -40
- 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/tool-canvas.mjs +0 -128
- package/dist/ai-chatbot/types.d.ts +0 -582
- package/dist/ai-chatbot/utils.d.ts +0 -49
- package/dist/ai-chatbot/utils.mjs +0 -114
- package/dist/ai-chatbot-launcher/ai-chatbot-launcher.d.ts +0 -190
- package/dist/ai-chatbot-launcher/ai-chatbot-launcher.mjs +0 -986
- 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 -173
- 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/canvas-controller.d.ts +0 -81
- package/dist/core/canvas-controller.mjs +0 -221
- package/dist/core/chatbot-core-controller.d.ts +0 -57
- package/dist/core/chatbot-core-controller.mjs +0 -545
- 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 -43
- 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 -70
- package/dist/tools/ai-mcp-app/ai-mcp-app.mjs +0 -589
- 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 -60
- package/dist/tools/ai-mcp-app/mcp-app-bridge-controller.mjs +0 -147
- package/dist/tools/ai-mcp-app/mcp-app-bridge-types.d.ts +0 -124
- 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 -51
- 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,310 +0,0 @@
|
|
|
1
|
-
import { ChatMessage, FileUploadCallbacks, McpAppUiResource, McpToolResult, AnyToolDefinition } from './types.js';
|
|
2
|
-
import { EventEmitter, Subscription } from './event-emitter.js';
|
|
3
|
-
export interface MessageStartEvent {
|
|
4
|
-
messageId: string;
|
|
5
|
-
rawEvent?: unknown;
|
|
6
|
-
}
|
|
7
|
-
export interface MessageDeltaEvent {
|
|
8
|
-
messageId: string;
|
|
9
|
-
delta: string;
|
|
10
|
-
rawEvent?: unknown;
|
|
11
|
-
}
|
|
12
|
-
export interface MessageEndEvent {
|
|
13
|
-
messageId: string;
|
|
14
|
-
rawEvent?: unknown;
|
|
15
|
-
}
|
|
16
|
-
export interface ToolCallEvent {
|
|
17
|
-
id: string;
|
|
18
|
-
messageId: string;
|
|
19
|
-
name: string;
|
|
20
|
-
args: Record<string, unknown>;
|
|
21
|
-
rawEvent?: unknown;
|
|
22
|
-
}
|
|
23
|
-
export interface ToolCallStartEvent {
|
|
24
|
-
id: string;
|
|
25
|
-
messageId: string;
|
|
26
|
-
name: string;
|
|
27
|
-
rawEvent?: unknown;
|
|
28
|
-
}
|
|
29
|
-
export interface ToolCallArgsEvent {
|
|
30
|
-
id: string;
|
|
31
|
-
messageId: string;
|
|
32
|
-
name: string;
|
|
33
|
-
/** Args text accumulated so far across this tool call's delta events. */
|
|
34
|
-
argsBuffer: string;
|
|
35
|
-
partialArgs?: Record<string, unknown>;
|
|
36
|
-
rawEvent?: unknown;
|
|
37
|
-
}
|
|
38
|
-
export interface ToolCallEndEvent {
|
|
39
|
-
id: string;
|
|
40
|
-
messageId: string;
|
|
41
|
-
name: string;
|
|
42
|
-
args: Record<string, unknown>;
|
|
43
|
-
rawEvent?: unknown;
|
|
44
|
-
}
|
|
45
|
-
export interface ToolResultEvent {
|
|
46
|
-
toolCallId: string;
|
|
47
|
-
/** Model-facing result. Never delivered to an MCP-app View. */
|
|
48
|
-
result: unknown;
|
|
49
|
-
message: ChatMessage;
|
|
50
|
-
/** Companion structured payload delivered to an MCP-app widget, stripped from LLM context. */
|
|
51
|
-
structuredContent?: unknown;
|
|
52
|
-
/** `true` when the backend dropped `structuredContent` (size caps). */
|
|
53
|
-
structuredContentOmitted?: boolean;
|
|
54
|
-
/** Raw MCP result for an MCP-app tool call; the View's `tool-result` is built from it. */
|
|
55
|
-
mcpResult?: McpToolResult;
|
|
56
|
-
/** `true` when the backend dropped `mcpResult` (size caps). */
|
|
57
|
-
mcpResultOmitted?: boolean;
|
|
58
|
-
isError?: boolean;
|
|
59
|
-
/** `true` when the tool call was cancelled rather than failed; takes precedence over `isError`. */
|
|
60
|
-
cancelled?: boolean;
|
|
61
|
-
rawEvent?: unknown;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Emitted when the backend signals that a tool call is backed by an MCP-app UI
|
|
65
|
-
* resource. Carries only the widget binding — the HTML and the `csp`/`permissions`
|
|
66
|
-
* policy come from {@link AgentAdapter.resolveMcpAppResource}. The core controller
|
|
67
|
-
* resolves the resource and stamps a {@link McpAppUiResource} onto the tool call.
|
|
68
|
-
*
|
|
69
|
-
* May be emitted before or after the matching `tool-call` chunk, and also after
|
|
70
|
-
* `setMessages`/`setThreadState` to remount widgets restored from history.
|
|
71
|
-
*/
|
|
72
|
-
export interface McpUiResourceEvent {
|
|
73
|
-
toolCallId: string;
|
|
74
|
-
toolName?: string;
|
|
75
|
-
/** The concrete resolved `ui://` URI (interpolation done server-side). */
|
|
76
|
-
resourceUri: string;
|
|
77
|
-
serverId?: string;
|
|
78
|
-
mimeType?: string;
|
|
79
|
-
rawEvent?: unknown;
|
|
80
|
-
}
|
|
81
|
-
/** Parameters for {@link AgentAdapter.resolveMcpAppResource}. */
|
|
82
|
-
export interface McpAppResourceResolveParams {
|
|
83
|
-
/** The concrete resolved `ui://` URI from the `mcp-ui-resource` event. */
|
|
84
|
-
resourceUri: string;
|
|
85
|
-
/** The widget's tool call id; template reads are bound to it. */
|
|
86
|
-
toolCallId: string;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Parameters an MCP-app widget passes when forwarding a `tools/call` to the server.
|
|
90
|
-
* The library never owns a `Client`; these delegate to the adapter.
|
|
91
|
-
*/
|
|
92
|
-
export interface McpToolCallParams {
|
|
93
|
-
name: string;
|
|
94
|
-
arguments?: Record<string, unknown>;
|
|
95
|
-
/** The calling widget's tool call id; the backend derives the MCP server from it. */
|
|
96
|
-
toolCallId: string;
|
|
97
|
-
}
|
|
98
|
-
/** Parameters for an MCP-app widget-initiated `resources/read`. */
|
|
99
|
-
export interface McpResourceReadParams {
|
|
100
|
-
uri: string;
|
|
101
|
-
/** The calling widget's tool call id. */
|
|
102
|
-
toolCallId: string;
|
|
103
|
-
}
|
|
104
|
-
/** Payload of a widget's `ui/update-model-context`, forwarded to the adapter. */
|
|
105
|
-
export interface McpModelContextUpdateParams {
|
|
106
|
-
/** The widget's tool call id. */
|
|
107
|
-
toolCallId: string;
|
|
108
|
-
content?: unknown[];
|
|
109
|
-
structuredContent?: unknown;
|
|
110
|
-
}
|
|
111
|
-
export interface AdapterState {
|
|
112
|
-
isConnected: boolean;
|
|
113
|
-
isConnecting: boolean;
|
|
114
|
-
isRunning: boolean;
|
|
115
|
-
}
|
|
116
|
-
export interface FileUploadEvent extends FileUploadCallbacks {
|
|
117
|
-
file: File;
|
|
118
|
-
}
|
|
119
|
-
export interface FileRemoveEvent {
|
|
120
|
-
fileId: string;
|
|
121
|
-
onSuccess: () => void;
|
|
122
|
-
onError: (error: string) => void;
|
|
123
|
-
}
|
|
124
|
-
export interface ErrorEvent {
|
|
125
|
-
message: string;
|
|
126
|
-
}
|
|
127
|
-
export interface CustomAgentEvent {
|
|
128
|
-
name: string;
|
|
129
|
-
value: unknown;
|
|
130
|
-
rawEvent?: unknown;
|
|
131
|
-
}
|
|
132
|
-
export interface RawAgentEvent {
|
|
133
|
-
event: unknown;
|
|
134
|
-
rawEvent?: unknown;
|
|
135
|
-
}
|
|
136
|
-
export interface RunStartedAgentEvent {
|
|
137
|
-
threadId: string;
|
|
138
|
-
runId: string;
|
|
139
|
-
rawEvent?: unknown;
|
|
140
|
-
}
|
|
141
|
-
export interface StepStartedAgentEvent {
|
|
142
|
-
stepName: string;
|
|
143
|
-
rawEvent?: unknown;
|
|
144
|
-
}
|
|
145
|
-
export interface StepFinishedAgentEvent {
|
|
146
|
-
stepName: string;
|
|
147
|
-
rawEvent?: unknown;
|
|
148
|
-
}
|
|
149
|
-
export interface StateSnapshotAgentEvent {
|
|
150
|
-
state: unknown;
|
|
151
|
-
rawEvent?: unknown;
|
|
152
|
-
}
|
|
153
|
-
export interface StateDeltaAgentEvent {
|
|
154
|
-
delta: unknown[];
|
|
155
|
-
rawEvent?: unknown;
|
|
156
|
-
}
|
|
157
|
-
export interface ActivitySnapshotAgentEvent {
|
|
158
|
-
activity: unknown;
|
|
159
|
-
activityMessage?: unknown;
|
|
160
|
-
existingMessage?: unknown;
|
|
161
|
-
rawEvent?: unknown;
|
|
162
|
-
}
|
|
163
|
-
export interface ActivityDeltaAgentEvent {
|
|
164
|
-
delta: unknown;
|
|
165
|
-
activityMessage?: unknown;
|
|
166
|
-
rawEvent?: unknown;
|
|
167
|
-
}
|
|
168
|
-
export declare abstract class AgentAdapter {
|
|
169
|
-
protected _state: AdapterState;
|
|
170
|
-
protected _tools: AnyToolDefinition[];
|
|
171
|
-
protected _events: {
|
|
172
|
-
runStarted: EventEmitter<void>;
|
|
173
|
-
runFinished: EventEmitter<void>;
|
|
174
|
-
runAborted: EventEmitter<void>;
|
|
175
|
-
messageStart: EventEmitter<MessageStartEvent>;
|
|
176
|
-
messageDelta: EventEmitter<MessageDeltaEvent>;
|
|
177
|
-
messageEnd: EventEmitter<MessageEndEvent>;
|
|
178
|
-
toolCall: EventEmitter<ToolCallEvent>;
|
|
179
|
-
toolCallStart: EventEmitter<ToolCallStartEvent>;
|
|
180
|
-
toolCallArgs: EventEmitter<ToolCallArgsEvent>;
|
|
181
|
-
toolCallEnd: EventEmitter<ToolCallEndEvent>;
|
|
182
|
-
toolResult: EventEmitter<ToolResultEvent>;
|
|
183
|
-
mcpUiResource: EventEmitter<McpUiResourceEvent>;
|
|
184
|
-
fileUpload: EventEmitter<FileUploadEvent>;
|
|
185
|
-
fileRemove: EventEmitter<FileRemoveEvent>;
|
|
186
|
-
error: EventEmitter<ErrorEvent>;
|
|
187
|
-
stateChange: EventEmitter<AdapterState>;
|
|
188
|
-
customEvent: EventEmitter<CustomAgentEvent>;
|
|
189
|
-
rawEvent: EventEmitter<RawAgentEvent>;
|
|
190
|
-
runStartedEvent: EventEmitter<RunStartedAgentEvent>;
|
|
191
|
-
stepStarted: EventEmitter<StepStartedAgentEvent>;
|
|
192
|
-
stepFinished: EventEmitter<StepFinishedAgentEvent>;
|
|
193
|
-
stateSnapshot: EventEmitter<StateSnapshotAgentEvent>;
|
|
194
|
-
stateDelta: EventEmitter<StateDeltaAgentEvent>;
|
|
195
|
-
activitySnapshot: EventEmitter<ActivitySnapshotAgentEvent>;
|
|
196
|
-
activityDelta: EventEmitter<ActivityDeltaAgentEvent>;
|
|
197
|
-
};
|
|
198
|
-
abstract connect(): Promise<void>;
|
|
199
|
-
abstract disconnect(): Promise<void>;
|
|
200
|
-
abstract sendMessage(messages: ChatMessage[]): void;
|
|
201
|
-
abstract sendToolResult(toolCallId: string, result: unknown, messages: ChatMessage[]): void;
|
|
202
|
-
abstract abort(): void;
|
|
203
|
-
abstract get threadId(): string;
|
|
204
|
-
abstract set threadId(value: string);
|
|
205
|
-
clearMemory?(): Promise<void>;
|
|
206
|
-
/**
|
|
207
|
-
* Resolve the MCP-app UI resource for an already-resolved `resourceUri`, bound to the
|
|
208
|
-
* widget's `toolCallId`. The adapter fetches the template for that concrete URI and
|
|
209
|
-
* fills `csp`/`permissions` from the template response's `_meta.ui` (`{}` when absent).
|
|
210
|
-
* It MUST NOT re-derive the URI (templated-URI interpolation is server-side only).
|
|
211
|
-
*/
|
|
212
|
-
resolveMcpAppResource?(params: McpAppResourceResolveParams): Promise<McpAppUiResource | undefined>;
|
|
213
|
-
/**
|
|
214
|
-
* Forward a widget-initiated `tools/call` to the MCP server. Resolve with the View's
|
|
215
|
-
* `CallToolResult` (tool-level errors resolve with `isError: true`); reject for
|
|
216
|
-
* transport/HTTP errors (e.g. a 403 for a tool without `"app"` visibility) — the
|
|
217
|
-
* rejection is returned to the View as a JSON-RPC error.
|
|
218
|
-
*/
|
|
219
|
-
callMcpTool?(params: McpToolCallParams): Promise<unknown>;
|
|
220
|
-
/**
|
|
221
|
-
* Forward a widget-initiated `resources/read` to the MCP server. When not implemented
|
|
222
|
-
* the View's request is rejected with a JSON-RPC error.
|
|
223
|
-
*/
|
|
224
|
-
readMcpResource?(params: McpResourceReadParams): Promise<unknown>;
|
|
225
|
-
/**
|
|
226
|
-
* Called when a widget sends `ui/update-model-context`. Each call replaces the previous
|
|
227
|
-
* context for that `toolCallId`; adapters should debounce and may hold the latest value
|
|
228
|
-
* until the run ends.
|
|
229
|
-
*/
|
|
230
|
-
updateMcpModelContext?(params: McpModelContextUpdateParams): Promise<void>;
|
|
231
|
-
/**
|
|
232
|
-
* Called after a widget is torn down (its turn left the visible thread, or the thread was
|
|
233
|
-
* cleared/replaced). Drop any state held for that `toolCallId`, e.g. a pending model context.
|
|
234
|
-
*/
|
|
235
|
-
disposeMcpAppView?(params: {
|
|
236
|
-
toolCallId: string;
|
|
237
|
-
}): void;
|
|
238
|
-
setTools(tools: AnyToolDefinition[]): void;
|
|
239
|
-
getTools(): AnyToolDefinition[];
|
|
240
|
-
/**
|
|
241
|
-
* Tools to forward to the backend agent, excluding MCP-app tools (`ToolDefinition.mcpApp`).
|
|
242
|
-
* MCP-app tools are a host-internal mechanism for streaming a UI resource into an existing
|
|
243
|
-
* tool call — the model never calls them directly, so they must never reach the agent.
|
|
244
|
-
*/
|
|
245
|
-
getModelFacingTools(): AnyToolDefinition[];
|
|
246
|
-
getState(): AdapterState;
|
|
247
|
-
get isConnected(): boolean;
|
|
248
|
-
get isConnecting(): boolean;
|
|
249
|
-
get isRunning(): boolean;
|
|
250
|
-
onRunStarted(callback: () => void): Subscription;
|
|
251
|
-
onRunFinished(callback: () => void): Subscription;
|
|
252
|
-
onRunAborted(callback: () => void): Subscription;
|
|
253
|
-
onMessageStart(callback: (event: MessageStartEvent) => void): Subscription;
|
|
254
|
-
onMessageDelta(callback: (event: MessageDeltaEvent) => void): Subscription;
|
|
255
|
-
onMessageEnd(callback: (event: MessageEndEvent) => void): Subscription;
|
|
256
|
-
onToolCall(callback: (event: ToolCallEvent) => void): Subscription;
|
|
257
|
-
onToolCallStart(callback: (event: ToolCallStartEvent) => void): Subscription;
|
|
258
|
-
onToolCallArgs(callback: (event: ToolCallArgsEvent) => void): Subscription;
|
|
259
|
-
onToolCallEnd(callback: (event: ToolCallEndEvent) => void): Subscription;
|
|
260
|
-
onToolCallResult(callback: (event: ToolResultEvent) => void): Subscription;
|
|
261
|
-
onMcpUiResource(callback: (event: McpUiResourceEvent) => void): Subscription;
|
|
262
|
-
onFileUpload(callback: (event: FileUploadEvent) => void): Subscription;
|
|
263
|
-
onFileRemove(callback: (event: FileRemoveEvent) => void): Subscription;
|
|
264
|
-
onError(callback: (event: ErrorEvent) => void): Subscription;
|
|
265
|
-
onStateChange(callback: (state: AdapterState) => void): Subscription;
|
|
266
|
-
onCustomEvent(callback: (event: CustomAgentEvent) => void): Subscription;
|
|
267
|
-
onRawEvent(callback: (event: RawAgentEvent) => void): Subscription;
|
|
268
|
-
onRunStartedEvent(callback: (event: RunStartedAgentEvent) => void): Subscription;
|
|
269
|
-
onStepStarted(callback: (event: StepStartedAgentEvent) => void): Subscription;
|
|
270
|
-
onStepFinished(callback: (event: StepFinishedAgentEvent) => void): Subscription;
|
|
271
|
-
onStateSnapshot(callback: (event: StateSnapshotAgentEvent) => void): Subscription;
|
|
272
|
-
onStateDelta(callback: (event: StateDeltaAgentEvent) => void): Subscription;
|
|
273
|
-
onActivitySnapshot(callback: (event: ActivitySnapshotAgentEvent) => void): Subscription;
|
|
274
|
-
onActivityDelta(callback: (event: ActivityDeltaAgentEvent) => void): Subscription;
|
|
275
|
-
protected _emitRunStarted(): void;
|
|
276
|
-
protected _emitRunFinished(): void;
|
|
277
|
-
protected _emitRunAborted(): void;
|
|
278
|
-
protected _emitMessageStart(messageId: string, rawEvent?: unknown): void;
|
|
279
|
-
protected _emitMessageDelta(messageId: string, delta: string, rawEvent?: unknown): void;
|
|
280
|
-
protected _emitMessageEnd(messageId: string, rawEvent?: unknown): void;
|
|
281
|
-
protected _emitToolCall(event: ToolCallEvent, rawEvent?: unknown): void;
|
|
282
|
-
protected _emitToolCallStart(event: ToolCallStartEvent, rawEvent?: unknown): void;
|
|
283
|
-
protected _emitToolCallArgs(event: ToolCallArgsEvent, rawEvent?: unknown): void;
|
|
284
|
-
protected _emitToolCallEnd(event: ToolCallEndEvent, rawEvent?: unknown): void;
|
|
285
|
-
protected _emitToolResult(event: ToolResultEvent, rawEvent?: unknown): void;
|
|
286
|
-
/**
|
|
287
|
-
* Announce that a tool call renders as an MCP-app widget. Also the way to remount
|
|
288
|
-
* widgets restored from history: call it per widget after `setMessages`/`setThreadState`
|
|
289
|
-
* — the resource is resolved and stamped onto the restored (already finalized) tool
|
|
290
|
-
* call. If the tool call isn't in state yet, the resource is held and applied when it
|
|
291
|
-
* arrives.
|
|
292
|
-
*/
|
|
293
|
-
protected _emitMcpUiResource(event: McpUiResourceEvent, rawEvent?: unknown): void;
|
|
294
|
-
emitFileUpload(file: File, callbacks: FileUploadCallbacks): void;
|
|
295
|
-
emitFileRemove(fileId: string, callbacks: {
|
|
296
|
-
onSuccess: () => void;
|
|
297
|
-
onError: (error: string) => void;
|
|
298
|
-
}): void;
|
|
299
|
-
protected _emitError(message: string): void;
|
|
300
|
-
protected _emitCustomEvent(name: string, value: unknown, rawEvent?: unknown): void;
|
|
301
|
-
protected _emitRawEvent(event: unknown, rawEvent?: unknown): void;
|
|
302
|
-
protected _emitRunStartedEvent(threadId: string, runId: string, rawEvent?: unknown): void;
|
|
303
|
-
protected _emitStepStarted(stepName: string, rawEvent?: unknown): void;
|
|
304
|
-
protected _emitStepFinished(stepName: string, rawEvent?: unknown): void;
|
|
305
|
-
protected _emitStateSnapshot(state: unknown, rawEvent?: unknown): void;
|
|
306
|
-
protected _emitStateDelta(delta: unknown[], rawEvent?: unknown): void;
|
|
307
|
-
protected _emitActivitySnapshot(activity: unknown, activityMessage?: unknown, existingMessage?: unknown, rawEvent?: unknown): void;
|
|
308
|
-
protected _emitActivityDelta(delta: unknown, activityMessage?: unknown, rawEvent?: unknown): void;
|
|
309
|
-
protected _updateState(updates: Partial<AdapterState>): void;
|
|
310
|
-
}
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from "./event-emitter.mjs";
|
|
2
|
-
class AgentAdapter {
|
|
3
|
-
constructor() {
|
|
4
|
-
this._state = { isConnected: false, isConnecting: false, isRunning: false };
|
|
5
|
-
this._tools = [];
|
|
6
|
-
this._events = {
|
|
7
|
-
runStarted: new EventEmitter(),
|
|
8
|
-
runFinished: new EventEmitter(),
|
|
9
|
-
runAborted: new EventEmitter(),
|
|
10
|
-
messageStart: new EventEmitter(),
|
|
11
|
-
messageDelta: new EventEmitter(),
|
|
12
|
-
messageEnd: new EventEmitter(),
|
|
13
|
-
toolCall: new EventEmitter(),
|
|
14
|
-
toolCallStart: new EventEmitter(),
|
|
15
|
-
toolCallArgs: new EventEmitter(),
|
|
16
|
-
toolCallEnd: new EventEmitter(),
|
|
17
|
-
toolResult: new EventEmitter(),
|
|
18
|
-
mcpUiResource: new EventEmitter(),
|
|
19
|
-
fileUpload: new EventEmitter(),
|
|
20
|
-
fileRemove: new EventEmitter(),
|
|
21
|
-
error: new EventEmitter(),
|
|
22
|
-
stateChange: new EventEmitter(),
|
|
23
|
-
customEvent: new EventEmitter(),
|
|
24
|
-
rawEvent: new EventEmitter(),
|
|
25
|
-
runStartedEvent: new EventEmitter(),
|
|
26
|
-
stepStarted: new EventEmitter(),
|
|
27
|
-
stepFinished: new EventEmitter(),
|
|
28
|
-
stateSnapshot: new EventEmitter(),
|
|
29
|
-
stateDelta: new EventEmitter(),
|
|
30
|
-
activitySnapshot: new EventEmitter(),
|
|
31
|
-
activityDelta: new EventEmitter()
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
setTools(tools) {
|
|
35
|
-
this._tools = tools;
|
|
36
|
-
}
|
|
37
|
-
getTools() {
|
|
38
|
-
return [...this._tools];
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Tools to forward to the backend agent, excluding MCP-app tools (`ToolDefinition.mcpApp`).
|
|
42
|
-
* MCP-app tools are a host-internal mechanism for streaming a UI resource into an existing
|
|
43
|
-
* tool call — the model never calls them directly, so they must never reach the agent.
|
|
44
|
-
*/
|
|
45
|
-
getModelFacingTools() {
|
|
46
|
-
return this._tools.filter((tool) => tool.mcpApp === void 0);
|
|
47
|
-
}
|
|
48
|
-
getState() {
|
|
49
|
-
return { ...this._state };
|
|
50
|
-
}
|
|
51
|
-
get isConnected() {
|
|
52
|
-
return this._state.isConnected;
|
|
53
|
-
}
|
|
54
|
-
get isConnecting() {
|
|
55
|
-
return this._state.isConnecting;
|
|
56
|
-
}
|
|
57
|
-
get isRunning() {
|
|
58
|
-
return this._state.isRunning;
|
|
59
|
-
}
|
|
60
|
-
onRunStarted(callback) {
|
|
61
|
-
return this._events.runStarted.subscribe(callback);
|
|
62
|
-
}
|
|
63
|
-
onRunFinished(callback) {
|
|
64
|
-
return this._events.runFinished.subscribe(callback);
|
|
65
|
-
}
|
|
66
|
-
onRunAborted(callback) {
|
|
67
|
-
return this._events.runAborted.subscribe(callback);
|
|
68
|
-
}
|
|
69
|
-
onMessageStart(callback) {
|
|
70
|
-
return this._events.messageStart.subscribe(callback);
|
|
71
|
-
}
|
|
72
|
-
onMessageDelta(callback) {
|
|
73
|
-
return this._events.messageDelta.subscribe(callback);
|
|
74
|
-
}
|
|
75
|
-
onMessageEnd(callback) {
|
|
76
|
-
return this._events.messageEnd.subscribe(callback);
|
|
77
|
-
}
|
|
78
|
-
onToolCall(callback) {
|
|
79
|
-
return this._events.toolCall.subscribe(callback);
|
|
80
|
-
}
|
|
81
|
-
onToolCallStart(callback) {
|
|
82
|
-
return this._events.toolCallStart.subscribe(callback);
|
|
83
|
-
}
|
|
84
|
-
onToolCallArgs(callback) {
|
|
85
|
-
return this._events.toolCallArgs.subscribe(callback);
|
|
86
|
-
}
|
|
87
|
-
onToolCallEnd(callback) {
|
|
88
|
-
return this._events.toolCallEnd.subscribe(callback);
|
|
89
|
-
}
|
|
90
|
-
onToolCallResult(callback) {
|
|
91
|
-
return this._events.toolResult.subscribe(callback);
|
|
92
|
-
}
|
|
93
|
-
onMcpUiResource(callback) {
|
|
94
|
-
return this._events.mcpUiResource.subscribe(callback);
|
|
95
|
-
}
|
|
96
|
-
onFileUpload(callback) {
|
|
97
|
-
return this._events.fileUpload.subscribe(callback);
|
|
98
|
-
}
|
|
99
|
-
onFileRemove(callback) {
|
|
100
|
-
return this._events.fileRemove.subscribe(callback);
|
|
101
|
-
}
|
|
102
|
-
onError(callback) {
|
|
103
|
-
return this._events.error.subscribe(callback);
|
|
104
|
-
}
|
|
105
|
-
onStateChange(callback) {
|
|
106
|
-
return this._events.stateChange.subscribe(callback);
|
|
107
|
-
}
|
|
108
|
-
onCustomEvent(callback) {
|
|
109
|
-
return this._events.customEvent.subscribe(callback);
|
|
110
|
-
}
|
|
111
|
-
onRawEvent(callback) {
|
|
112
|
-
return this._events.rawEvent.subscribe(callback);
|
|
113
|
-
}
|
|
114
|
-
onRunStartedEvent(callback) {
|
|
115
|
-
return this._events.runStartedEvent.subscribe(callback);
|
|
116
|
-
}
|
|
117
|
-
onStepStarted(callback) {
|
|
118
|
-
return this._events.stepStarted.subscribe(callback);
|
|
119
|
-
}
|
|
120
|
-
onStepFinished(callback) {
|
|
121
|
-
return this._events.stepFinished.subscribe(callback);
|
|
122
|
-
}
|
|
123
|
-
onStateSnapshot(callback) {
|
|
124
|
-
return this._events.stateSnapshot.subscribe(callback);
|
|
125
|
-
}
|
|
126
|
-
onStateDelta(callback) {
|
|
127
|
-
return this._events.stateDelta.subscribe(callback);
|
|
128
|
-
}
|
|
129
|
-
onActivitySnapshot(callback) {
|
|
130
|
-
return this._events.activitySnapshot.subscribe(callback);
|
|
131
|
-
}
|
|
132
|
-
onActivityDelta(callback) {
|
|
133
|
-
return this._events.activityDelta.subscribe(callback);
|
|
134
|
-
}
|
|
135
|
-
_emitRunStarted() {
|
|
136
|
-
this._events.runStarted.emit();
|
|
137
|
-
}
|
|
138
|
-
_emitRunFinished() {
|
|
139
|
-
this._events.runFinished.emit();
|
|
140
|
-
}
|
|
141
|
-
_emitRunAborted() {
|
|
142
|
-
this._events.runAborted.emit();
|
|
143
|
-
}
|
|
144
|
-
_emitMessageStart(messageId, rawEvent) {
|
|
145
|
-
this._events.messageStart.emit({ messageId, rawEvent });
|
|
146
|
-
}
|
|
147
|
-
_emitMessageDelta(messageId, delta, rawEvent) {
|
|
148
|
-
this._events.messageDelta.emit({ messageId, delta, rawEvent });
|
|
149
|
-
}
|
|
150
|
-
_emitMessageEnd(messageId, rawEvent) {
|
|
151
|
-
this._events.messageEnd.emit({ messageId, rawEvent });
|
|
152
|
-
}
|
|
153
|
-
_emitToolCall(event, rawEvent) {
|
|
154
|
-
this._events.toolCall.emit({ ...event, rawEvent });
|
|
155
|
-
}
|
|
156
|
-
_emitToolCallStart(event, rawEvent) {
|
|
157
|
-
this._events.toolCallStart.emit({ ...event, rawEvent });
|
|
158
|
-
}
|
|
159
|
-
_emitToolCallArgs(event, rawEvent) {
|
|
160
|
-
this._events.toolCallArgs.emit({ ...event, rawEvent });
|
|
161
|
-
}
|
|
162
|
-
_emitToolCallEnd(event, rawEvent) {
|
|
163
|
-
this._events.toolCallEnd.emit({ ...event, rawEvent });
|
|
164
|
-
}
|
|
165
|
-
_emitToolResult(event, rawEvent) {
|
|
166
|
-
this._events.toolResult.emit({ ...event, rawEvent });
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Announce that a tool call renders as an MCP-app widget. Also the way to remount
|
|
170
|
-
* widgets restored from history: call it per widget after `setMessages`/`setThreadState`
|
|
171
|
-
* — the resource is resolved and stamped onto the restored (already finalized) tool
|
|
172
|
-
* call. If the tool call isn't in state yet, the resource is held and applied when it
|
|
173
|
-
* arrives.
|
|
174
|
-
*/
|
|
175
|
-
_emitMcpUiResource(event, rawEvent) {
|
|
176
|
-
this._events.mcpUiResource.emit({ ...event, rawEvent });
|
|
177
|
-
}
|
|
178
|
-
emitFileUpload(file, callbacks) {
|
|
179
|
-
this._events.fileUpload.emit({ file, ...callbacks });
|
|
180
|
-
}
|
|
181
|
-
emitFileRemove(fileId, callbacks) {
|
|
182
|
-
this._events.fileRemove.emit({ fileId, ...callbacks });
|
|
183
|
-
}
|
|
184
|
-
_emitError(message) {
|
|
185
|
-
this._events.error.emit({ message });
|
|
186
|
-
}
|
|
187
|
-
_emitCustomEvent(name, value, rawEvent) {
|
|
188
|
-
this._events.customEvent.emit({ name, value, rawEvent });
|
|
189
|
-
}
|
|
190
|
-
_emitRawEvent(event, rawEvent) {
|
|
191
|
-
this._events.rawEvent.emit({ event, rawEvent });
|
|
192
|
-
}
|
|
193
|
-
_emitRunStartedEvent(threadId, runId, rawEvent) {
|
|
194
|
-
this._events.runStartedEvent.emit({ threadId, runId, rawEvent });
|
|
195
|
-
}
|
|
196
|
-
_emitStepStarted(stepName, rawEvent) {
|
|
197
|
-
this._events.stepStarted.emit({ stepName, rawEvent });
|
|
198
|
-
}
|
|
199
|
-
_emitStepFinished(stepName, rawEvent) {
|
|
200
|
-
this._events.stepFinished.emit({ stepName, rawEvent });
|
|
201
|
-
}
|
|
202
|
-
_emitStateSnapshot(state, rawEvent) {
|
|
203
|
-
this._events.stateSnapshot.emit({ state, rawEvent });
|
|
204
|
-
}
|
|
205
|
-
_emitStateDelta(delta, rawEvent) {
|
|
206
|
-
this._events.stateDelta.emit({ delta, rawEvent });
|
|
207
|
-
}
|
|
208
|
-
_emitActivitySnapshot(activity, activityMessage, existingMessage, rawEvent) {
|
|
209
|
-
this._events.activitySnapshot.emit({ activity, activityMessage, existingMessage, rawEvent });
|
|
210
|
-
}
|
|
211
|
-
_emitActivityDelta(delta, activityMessage, rawEvent) {
|
|
212
|
-
this._events.activityDelta.emit({ delta, activityMessage, rawEvent });
|
|
213
|
-
}
|
|
214
|
-
_updateState(updates) {
|
|
215
|
-
this._state = { ...this._state, ...updates };
|
|
216
|
-
this._events.stateChange.emit(this.getState());
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
export {
|
|
220
|
-
AgentAdapter
|
|
221
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { AgentAdapter } from './agent-adapter.js';
|
|
2
|
-
import { ChatMessage, ToolCall, AnyToolDefinition } from './types.js';
|
|
3
|
-
export interface AgentRunnerConfig {
|
|
4
|
-
/** The adapter instance that handles communication with the AI model */
|
|
5
|
-
adapter: AgentAdapter;
|
|
6
|
-
/** The user prompt to send to the agent */
|
|
7
|
-
prompt: string;
|
|
8
|
-
/** Optional tools the agent can call during execution */
|
|
9
|
-
tools?: AnyToolDefinition[];
|
|
10
|
-
/** Execution mode: 'one-shot' stops after first response, 'multi-turn' allows tool usage loops. @default 'one-shot' */
|
|
11
|
-
mode?: 'one-shot' | 'multi-turn';
|
|
12
|
-
/** Maximum conversation turns in multi-turn mode to prevent infinite loops. @default 20 */
|
|
13
|
-
maxTurns?: number;
|
|
14
|
-
/** Callback fired when agent starts generating a new message */
|
|
15
|
-
onStart?: (messageId: string) => void;
|
|
16
|
-
/** Callback fired for each text chunk as it streams in */
|
|
17
|
-
onDelta?: (delta: string) => void;
|
|
18
|
-
/** Callback fired when agent requests a tool call */
|
|
19
|
-
onToolCall?: (toolCall: ToolCall) => void;
|
|
20
|
-
/** Callback fired when execution completes with final result */
|
|
21
|
-
onComplete?: (result: AgentRunnerResult) => void;
|
|
22
|
-
}
|
|
23
|
-
export interface AgentRunnerResult {
|
|
24
|
-
/** Complete message history including user, assistant, and tool messages */
|
|
25
|
-
messages: ChatMessage[];
|
|
26
|
-
/** The final assistant message returned by the agent */
|
|
27
|
-
finalMessage: ChatMessage;
|
|
28
|
-
/** All tool calls executed during the conversation */
|
|
29
|
-
toolCalls: ToolCall[];
|
|
30
|
-
/** Number of conversation turns completed */
|
|
31
|
-
turns: number;
|
|
32
|
-
/** Whether execution completed successfully without errors */
|
|
33
|
-
success: boolean;
|
|
34
|
-
/** Reason execution stopped: 'text-response' (natural completion), 'max-turns' (hit turn limit), 'error' (failed), or 'one-shot-complete' (single turn mode) */
|
|
35
|
-
stoppedReason: 'text-response' | 'max-turns' | 'error' | 'one-shot-complete';
|
|
36
|
-
}
|
|
37
|
-
export declare class AgentRunner {
|
|
38
|
-
#private;
|
|
39
|
-
private constructor();
|
|
40
|
-
static run(config: AgentRunnerConfig): Promise<AgentRunnerResult>;
|
|
41
|
-
}
|