@blocklet/pages-kit 0.2.299 → 0.2.301
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/lib/cjs/builtin/async/ai-runtime/api/{assistant.js → agent.js} +5 -7
- package/lib/cjs/builtin/async/ai-runtime/api/session.js +20 -18
- package/lib/cjs/builtin/async/ai-runtime/components/ActionButton.js +1 -2
- package/lib/cjs/builtin/async/ai-runtime/components/{parameters → AgentInputField}/index.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/components/{GlobalLoading.js → GlobalLoading/index.js} +5 -2
- package/lib/cjs/builtin/async/ai-runtime/components/{runtime-form/RuntimeFormHeader.js → Header/SimpleHeader.js} +9 -16
- package/lib/cjs/builtin/async/ai-runtime/components/{runtime-form/RuntimeFormSubmit.js → Layout/SimpleLayout.js} +6 -8
- package/lib/cjs/builtin/async/ai-runtime/components/MarkdownRenderer.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/components/{RuntimeProvider.js → RuntimeCommonProvider.js} +2 -2
- package/lib/cjs/builtin/async/ai-runtime/components/ScrollView.js +40 -57
- package/lib/cjs/builtin/async/ai-runtime/components/SocialShare.js +8 -3
- package/lib/cjs/builtin/async/ai-runtime/components/ThemeProvider.js +0 -21
- package/lib/cjs/builtin/async/ai-runtime/components/{common/UserInfo.js → UserInfo.js} +1 -1
- package/lib/cjs/builtin/async/ai-runtime/constants.js +4 -1
- package/lib/cjs/builtin/async/ai-runtime/{components/runtime/contexts → contexts}/CurrentAgent.js +4 -4
- package/lib/cjs/builtin/async/ai-runtime/contexts/Runtime.js +32 -0
- package/lib/cjs/builtin/async/ai-runtime/index.js +16 -63
- package/lib/cjs/builtin/async/ai-runtime/runtime/ChatBotButton/index.js +72 -0
- package/lib/cjs/builtin/async/ai-runtime/{components/runtime → runtime/Runtime}/index.js +11 -7
- package/lib/cjs/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/AutoForm/index.js +4 -4
- package/lib/cjs/builtin/async/ai-runtime/{components/message → runtime-components/ChatOutput}/MessageActions.js +7 -4
- package/lib/cjs/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/ChatOutput/MessageErrorView.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/ChatOutput/MessageItemView.js +6 -6
- package/lib/cjs/builtin/async/ai-runtime/{components/common → runtime-components/ChatOutput}/MessageMetadataRenderer.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/PhotoGallery/index.js +102 -0
- package/lib/cjs/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/PhotoGalleryItem/index.js +17 -8
- package/lib/cjs/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/SimpleChat/index.js +34 -22
- package/lib/cjs/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/SimpleOutput/index.js +5 -3
- package/lib/cjs/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/SimplePage/index.js +25 -12
- package/lib/cjs/builtin/async/ai-runtime/{components/runtime/state/assistant.js → state/agent.js} +12 -12
- package/lib/cjs/builtin/async/ai-runtime/{components/runtime/state → state}/runtime.js +5 -10
- package/lib/cjs/builtin/async/ai-runtime/state/session.js +91 -92
- package/lib/esm/builtin/async/ai-runtime/api/{assistant.js → agent.js} +3 -5
- package/lib/esm/builtin/async/ai-runtime/api/session.js +19 -17
- package/lib/esm/builtin/async/ai-runtime/components/ActionButton.js +1 -1
- package/lib/esm/builtin/async/ai-runtime/components/{parameters → AgentInputField}/index.js +1 -1
- package/lib/esm/builtin/async/ai-runtime/components/{GlobalLoading.js → GlobalLoading/index.js} +2 -1
- package/lib/esm/builtin/async/ai-runtime/components/Header/SimpleHeader.js +23 -0
- package/lib/esm/builtin/async/ai-runtime/components/{runtime-form/RuntimeFormSubmit.js → Layout/SimpleLayout.js} +5 -4
- package/lib/esm/builtin/async/ai-runtime/components/MarkdownRenderer.js +1 -1
- package/lib/esm/builtin/async/ai-runtime/components/{RuntimeProvider.js → RuntimeCommonProvider.js} +1 -1
- package/lib/esm/builtin/async/ai-runtime/components/ScrollView.js +19 -57
- package/lib/esm/builtin/async/ai-runtime/components/SocialShare.js +8 -3
- package/lib/esm/builtin/async/ai-runtime/components/ThemeProvider.js +0 -21
- package/lib/esm/builtin/async/ai-runtime/components/{common/UserInfo.js → UserInfo.js} +1 -1
- package/lib/esm/builtin/async/ai-runtime/constants.js +3 -0
- package/lib/esm/builtin/async/ai-runtime/{components/runtime/contexts → contexts}/CurrentAgent.js +3 -3
- package/lib/esm/builtin/async/ai-runtime/contexts/Runtime.js +26 -0
- package/lib/esm/builtin/async/ai-runtime/index.js +13 -58
- package/lib/esm/builtin/async/ai-runtime/runtime/ChatBotButton/index.js +66 -0
- package/lib/esm/builtin/async/ai-runtime/{components/runtime → runtime/Runtime}/index.js +9 -5
- package/lib/esm/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/AutoForm/index.js +4 -4
- package/lib/esm/builtin/async/ai-runtime/{components/message → runtime-components/ChatOutput}/MessageActions.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/ChatOutput/MessageErrorView.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/ChatOutput/MessageItemView.js +5 -5
- package/lib/esm/builtin/async/ai-runtime/{components/common → runtime-components/ChatOutput}/MessageMetadataRenderer.js +1 -1
- package/lib/esm/builtin/async/ai-runtime/runtime-components/PhotoGallery/index.js +73 -0
- package/lib/esm/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/PhotoGalleryItem/index.js +17 -8
- package/lib/esm/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/SimpleChat/index.js +34 -22
- package/lib/esm/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/SimpleOutput/index.js +5 -3
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimplePage/index.js +63 -0
- package/lib/esm/builtin/async/ai-runtime/{components/runtime/state/assistant.js → state/agent.js} +9 -9
- package/lib/esm/builtin/async/ai-runtime/{components/runtime/state → state}/runtime.js +5 -10
- package/lib/esm/builtin/async/ai-runtime/state/session.js +91 -88
- package/lib/types/builtin/async/ai-runtime/api/{assistant.d.ts → agent.d.ts} +4 -4
- package/lib/types/builtin/async/ai-runtime/api/session.d.ts +7 -13
- package/lib/types/builtin/async/ai-runtime/components/ActionButton.d.ts +1 -1
- package/lib/types/builtin/async/ai-runtime/components/{parameters → AgentInputField}/index.d.ts +1 -1
- package/lib/types/builtin/async/ai-runtime/components/{GlobalLoading.d.ts → GlobalLoading/index.d.ts} +1 -0
- package/lib/types/builtin/async/ai-runtime/components/Header/SimpleHeader.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/components/Layout/SimpleLayout.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/components/LoadingButton.d.ts +2 -1
- package/lib/types/builtin/async/ai-runtime/components/{RuntimeProvider.d.ts → RuntimeCommonProvider.d.ts} +1 -1
- package/lib/types/builtin/async/ai-runtime/components/ScrollView.d.ts +8 -59
- package/lib/types/builtin/async/ai-runtime/constants.d.ts +3 -0
- package/lib/types/builtin/async/ai-runtime/{components/runtime/contexts → contexts}/CurrentAgent.d.ts +1 -1
- package/lib/types/builtin/async/ai-runtime/contexts/Runtime.d.ts +14 -0
- package/lib/types/builtin/async/ai-runtime/index.d.ts +13 -24
- package/lib/types/builtin/async/ai-runtime/runtime/ChatBotButton/index.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/PhotoGallery/index.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/PhotoGalleryItem/index.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/SimpleChat/index.d.ts +6 -0
- package/lib/types/builtin/async/ai-runtime/state/agent.d.ts +17 -0
- package/lib/types/builtin/async/ai-runtime/{components/runtime/state → state}/runtime.d.ts +2 -2
- package/lib/types/builtin/async/ai-runtime/state/session.d.ts +10 -18
- package/lib/types/builtin/async/react-scroll-to-bottom.d.ts +2 -2
- package/package.json +7 -7
- package/lib/cjs/builtin/async/ai-runtime/components/LoadingListItemButton.js +0 -49
- package/lib/cjs/builtin/async/ai-runtime/components/PoweredBy.js +0 -22
- package/lib/cjs/builtin/async/ai-runtime/components/collection/CollectionEditDialog.js +0 -92
- package/lib/cjs/builtin/async/ai-runtime/components/collection/CollectionListView.js +0 -197
- package/lib/cjs/builtin/async/ai-runtime/components/collection/CollectionView.js +0 -122
- package/lib/cjs/builtin/async/ai-runtime/components/collection/DocumentListView.js +0 -152
- package/lib/cjs/builtin/async/ai-runtime/components/collection/DocumentView.js +0 -135
- package/lib/cjs/builtin/async/ai-runtime/components/common/ChatBot.js +0 -104
- package/lib/cjs/builtin/async/ai-runtime/components/common/index.js +0 -12
- package/lib/cjs/builtin/async/ai-runtime/components/form/ParameterForm.js +0 -89
- package/lib/cjs/builtin/async/ai-runtime/components/form/ParameterFormDialog.js +0 -66
- package/lib/cjs/builtin/async/ai-runtime/components/form/ParameterFormFields.js +0 -61
- package/lib/cjs/builtin/async/ai-runtime/components/form/QuestionField.js +0 -44
- package/lib/cjs/builtin/async/ai-runtime/components/form/SettingButton.js +0 -88
- package/lib/cjs/builtin/async/ai-runtime/components/lottie/index.js +0 -34
- package/lib/cjs/builtin/async/ai-runtime/components/message/MessageErrorView.js +0 -35
- package/lib/cjs/builtin/async/ai-runtime/components/message/MessageItemView.js +0 -177
- package/lib/cjs/builtin/async/ai-runtime/components/message/MessageListView.js +0 -48
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/components/PhotoGallery/index.js +0 -121
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/constants.js +0 -6
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/state/session.js +0 -213
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-chat/InitialForm.js +0 -133
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-chat/RuntimeChatHeader.js +0 -60
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-chat/RuntimeChatSession.js +0 -59
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-chat/index.js +0 -28
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-form/RuntimeFormForms.js +0 -138
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-form/RuntimeFormResult.js +0 -31
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-form/index.js +0 -54
- package/lib/cjs/builtin/async/ai-runtime/components/session/CheckSession.js +0 -74
- package/lib/cjs/builtin/async/ai-runtime/components/session/SessionListView.js +0 -88
- package/lib/cjs/builtin/async/ai-runtime/hooks/auth.js +0 -31
- package/lib/cjs/builtin/async/ai-runtime/hooks/header.js +0 -69
- package/lib/cjs/builtin/async/ai-runtime/hooks/navigate.js +0 -38
- package/lib/cjs/builtin/async/ai-runtime/hooks/subscribe.js +0 -37
- package/lib/cjs/builtin/async/ai-runtime/hooks/useAsync.js +0 -32
- package/lib/cjs/builtin/async/ai-runtime/state/assistant.js +0 -59
- package/lib/cjs/builtin/async/ai-runtime/state/index.js +0 -423
- package/lib/cjs/builtin/async/ai-runtime/state/subscription.js +0 -52
- package/lib/cjs/builtin/async/ai-runtime/utils.js +0 -49
- package/lib/esm/builtin/async/ai-runtime/components/LoadingListItemButton.js +0 -46
- package/lib/esm/builtin/async/ai-runtime/components/PoweredBy.js +0 -19
- package/lib/esm/builtin/async/ai-runtime/components/collection/CollectionEditDialog.js +0 -92
- package/lib/esm/builtin/async/ai-runtime/components/collection/CollectionListView.js +0 -197
- package/lib/esm/builtin/async/ai-runtime/components/collection/CollectionView.js +0 -122
- package/lib/esm/builtin/async/ai-runtime/components/collection/DocumentListView.js +0 -152
- package/lib/esm/builtin/async/ai-runtime/components/collection/DocumentView.js +0 -135
- package/lib/esm/builtin/async/ai-runtime/components/common/ChatBot.js +0 -98
- package/lib/esm/builtin/async/ai-runtime/components/common/index.js +0 -3
- package/lib/esm/builtin/async/ai-runtime/components/form/ParameterForm.js +0 -60
- package/lib/esm/builtin/async/ai-runtime/components/form/ParameterFormDialog.js +0 -59
- package/lib/esm/builtin/async/ai-runtime/components/form/ParameterFormFields.js +0 -54
- package/lib/esm/builtin/async/ai-runtime/components/form/QuestionField.js +0 -38
- package/lib/esm/builtin/async/ai-runtime/components/form/SettingButton.js +0 -82
- package/lib/esm/builtin/async/ai-runtime/components/lottie/index.js +0 -8
- package/lib/esm/builtin/async/ai-runtime/components/message/MessageErrorView.js +0 -29
- package/lib/esm/builtin/async/ai-runtime/components/message/MessageItemView.js +0 -146
- package/lib/esm/builtin/async/ai-runtime/components/message/MessageListView.js +0 -42
- package/lib/esm/builtin/async/ai-runtime/components/runtime/components/PhotoGallery/index.js +0 -92
- package/lib/esm/builtin/async/ai-runtime/components/runtime/components/SimplePage/index.js +0 -50
- package/lib/esm/builtin/async/ai-runtime/components/runtime/constants.js +0 -3
- package/lib/esm/builtin/async/ai-runtime/components/runtime/state/session.js +0 -209
- package/lib/esm/builtin/async/ai-runtime/components/runtime-chat/InitialForm.js +0 -102
- package/lib/esm/builtin/async/ai-runtime/components/runtime-chat/RuntimeChatHeader.js +0 -34
- package/lib/esm/builtin/async/ai-runtime/components/runtime-chat/RuntimeChatSession.js +0 -53
- package/lib/esm/builtin/async/ai-runtime/components/runtime-chat/index.js +0 -22
- package/lib/esm/builtin/async/ai-runtime/components/runtime-form/RuntimeFormForms.js +0 -132
- package/lib/esm/builtin/async/ai-runtime/components/runtime-form/RuntimeFormHeader.js +0 -30
- package/lib/esm/builtin/async/ai-runtime/components/runtime-form/RuntimeFormResult.js +0 -25
- package/lib/esm/builtin/async/ai-runtime/components/runtime-form/index.js +0 -48
- package/lib/esm/builtin/async/ai-runtime/components/session/CheckSession.js +0 -68
- package/lib/esm/builtin/async/ai-runtime/components/session/SessionListView.js +0 -88
- package/lib/esm/builtin/async/ai-runtime/hooks/auth.js +0 -27
- package/lib/esm/builtin/async/ai-runtime/hooks/header.js +0 -62
- package/lib/esm/builtin/async/ai-runtime/hooks/navigate.js +0 -32
- package/lib/esm/builtin/async/ai-runtime/hooks/subscribe.js +0 -33
- package/lib/esm/builtin/async/ai-runtime/hooks/useAsync.js +0 -29
- package/lib/esm/builtin/async/ai-runtime/state/assistant.js +0 -54
- package/lib/esm/builtin/async/ai-runtime/state/index.js +0 -423
- package/lib/esm/builtin/async/ai-runtime/state/subscription.js +0 -47
- package/lib/esm/builtin/async/ai-runtime/utils.js +0 -42
- package/lib/types/builtin/async/ai-runtime/components/LoadingListItemButton.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/components/PoweredBy.d.ts +0 -4
- package/lib/types/builtin/async/ai-runtime/components/collection/CollectionEditDialog.d.ts +0 -0
- package/lib/types/builtin/async/ai-runtime/components/collection/CollectionListView.d.ts +0 -0
- package/lib/types/builtin/async/ai-runtime/components/collection/CollectionView.d.ts +0 -0
- package/lib/types/builtin/async/ai-runtime/components/collection/DocumentListView.d.ts +0 -0
- package/lib/types/builtin/async/ai-runtime/components/collection/DocumentView.d.ts +0 -0
- package/lib/types/builtin/async/ai-runtime/components/common/ChatBot.d.ts +0 -13
- package/lib/types/builtin/async/ai-runtime/components/common/index.d.ts +0 -3
- package/lib/types/builtin/async/ai-runtime/components/form/ParameterForm.d.ts +0 -13
- package/lib/types/builtin/async/ai-runtime/components/form/ParameterFormDialog.d.ts +0 -28
- package/lib/types/builtin/async/ai-runtime/components/form/ParameterFormFields.d.ts +0 -11
- package/lib/types/builtin/async/ai-runtime/components/form/QuestionField.d.ts +0 -14
- package/lib/types/builtin/async/ai-runtime/components/form/SettingButton.d.ts +0 -9
- package/lib/types/builtin/async/ai-runtime/components/lottie/index.d.ts +0 -4
- package/lib/types/builtin/async/ai-runtime/components/message/MessageErrorView.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/components/message/MessageItemView.d.ts +0 -15
- package/lib/types/builtin/async/ai-runtime/components/message/MessageListView.d.ts +0 -7
- package/lib/types/builtin/async/ai-runtime/components/runtime/components/PhotoGallery/index.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/components/runtime/components/PhotoGalleryItem/index.d.ts +0 -1
- package/lib/types/builtin/async/ai-runtime/components/runtime/components/SimpleChat/index.d.ts +0 -3
- package/lib/types/builtin/async/ai-runtime/components/runtime/constants.d.ts +0 -3
- package/lib/types/builtin/async/ai-runtime/components/runtime/state/assistant.d.ts +0 -17
- package/lib/types/builtin/async/ai-runtime/components/runtime/state/session.d.ts +0 -29
- package/lib/types/builtin/async/ai-runtime/components/runtime-chat/InitialForm.d.ts +0 -10
- package/lib/types/builtin/async/ai-runtime/components/runtime-chat/RuntimeChatHeader.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/components/runtime-chat/RuntimeChatSession.d.ts +0 -6
- package/lib/types/builtin/async/ai-runtime/components/runtime-chat/index.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/components/runtime-form/RuntimeFormForms.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/components/runtime-form/RuntimeFormHeader.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/components/runtime-form/RuntimeFormResult.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/components/runtime-form/RuntimeFormSubmit.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/components/runtime-form/index.d.ts +0 -4
- package/lib/types/builtin/async/ai-runtime/components/session/CheckSession.d.ts +0 -8
- package/lib/types/builtin/async/ai-runtime/components/session/SessionListView.d.ts +0 -0
- package/lib/types/builtin/async/ai-runtime/hooks/auth.d.ts +0 -4
- package/lib/types/builtin/async/ai-runtime/hooks/header.d.ts +0 -5
- package/lib/types/builtin/async/ai-runtime/hooks/navigate.d.ts +0 -25
- package/lib/types/builtin/async/ai-runtime/hooks/subscribe.d.ts +0 -7
- package/lib/types/builtin/async/ai-runtime/hooks/useAsync.d.ts +0 -1
- package/lib/types/builtin/async/ai-runtime/state/assistant.d.ts +0 -15
- package/lib/types/builtin/async/ai-runtime/state/index.d.ts +0 -0
- package/lib/types/builtin/async/ai-runtime/state/subscription.d.ts +0 -15
- package/lib/types/builtin/async/ai-runtime/utils.d.ts +0 -20
- /package/lib/cjs/builtin/async/ai-runtime/components/{parameters → AgentInputField}/LanguageField.js +0 -0
- /package/lib/cjs/builtin/async/ai-runtime/components/{parameters → AgentInputField}/NumberField.js +0 -0
- /package/lib/cjs/builtin/async/ai-runtime/components/{parameters → AgentInputField}/RadioField.js +0 -0
- /package/lib/cjs/builtin/async/ai-runtime/components/{parameters → AgentInputField}/SelectField.js +0 -0
- /package/lib/cjs/builtin/async/ai-runtime/components/{parameters → AgentInputField}/StringField.js +0 -0
- /package/lib/cjs/builtin/async/ai-runtime/{state/loading.js → components/GlobalLoading/state.js} +0 -0
- /package/lib/cjs/builtin/async/ai-runtime/{components/runtime/contexts → contexts}/CurrentMessage.js +0 -0
- /package/lib/cjs/builtin/async/ai-runtime/{components/common → runtime-components/ChatOutput}/MessageSuggestedQuestions.js +0 -0
- /package/lib/cjs/builtin/async/ai-runtime/{components/message → runtime-components/ChatOutput}/ReferenceLinks.js +0 -0
- /package/lib/cjs/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/ChatOutput/index.js +0 -0
- /package/lib/cjs/builtin/async/ai-runtime/{components/runtime/utils → utils}/map-right.js +0 -0
- /package/lib/esm/builtin/async/ai-runtime/components/{parameters → AgentInputField}/LanguageField.js +0 -0
- /package/lib/esm/builtin/async/ai-runtime/components/{parameters → AgentInputField}/NumberField.js +0 -0
- /package/lib/esm/builtin/async/ai-runtime/components/{parameters → AgentInputField}/RadioField.js +0 -0
- /package/lib/esm/builtin/async/ai-runtime/components/{parameters → AgentInputField}/SelectField.js +0 -0
- /package/lib/esm/builtin/async/ai-runtime/components/{parameters → AgentInputField}/StringField.js +0 -0
- /package/lib/esm/builtin/async/ai-runtime/{state/loading.js → components/GlobalLoading/state.js} +0 -0
- /package/lib/esm/builtin/async/ai-runtime/{components/runtime/contexts → contexts}/CurrentMessage.js +0 -0
- /package/lib/esm/builtin/async/ai-runtime/{components/common → runtime-components/ChatOutput}/MessageSuggestedQuestions.js +0 -0
- /package/lib/esm/builtin/async/ai-runtime/{components/message → runtime-components/ChatOutput}/ReferenceLinks.js +0 -0
- /package/lib/esm/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/ChatOutput/index.js +0 -0
- /package/lib/esm/builtin/async/ai-runtime/{components/runtime/utils → utils}/map-right.js +0 -0
- /package/lib/types/builtin/async/ai-runtime/components/{parameters → AgentInputField}/LanguageField.d.ts +0 -0
- /package/lib/types/builtin/async/ai-runtime/components/{parameters → AgentInputField}/NumberField.d.ts +0 -0
- /package/lib/types/builtin/async/ai-runtime/components/{parameters → AgentInputField}/RadioField.d.ts +0 -0
- /package/lib/types/builtin/async/ai-runtime/components/{parameters → AgentInputField}/SelectField.d.ts +0 -0
- /package/lib/types/builtin/async/ai-runtime/components/{parameters → AgentInputField}/StringField.d.ts +0 -0
- /package/lib/types/builtin/async/ai-runtime/{state/loading.d.ts → components/GlobalLoading/state.d.ts} +0 -0
- /package/lib/types/builtin/async/ai-runtime/components/{common/UserInfo.d.ts → UserInfo.d.ts} +0 -0
- /package/lib/types/builtin/async/ai-runtime/{components/runtime/contexts → contexts}/CurrentMessage.d.ts +0 -0
- /package/lib/types/builtin/async/ai-runtime/{components/runtime → runtime/Runtime}/index.d.ts +0 -0
- /package/lib/types/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/AutoForm/index.d.ts +0 -0
- /package/lib/types/builtin/async/ai-runtime/{components/message → runtime-components/ChatOutput}/MessageActions.d.ts +0 -0
- /package/lib/types/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/ChatOutput/MessageErrorView.d.ts +0 -0
- /package/lib/types/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/ChatOutput/MessageItemView.d.ts +0 -0
- /package/lib/types/builtin/async/ai-runtime/{components/common → runtime-components/ChatOutput}/MessageMetadataRenderer.d.ts +0 -0
- /package/lib/types/builtin/async/ai-runtime/{components/common → runtime-components/ChatOutput}/MessageSuggestedQuestions.d.ts +0 -0
- /package/lib/types/builtin/async/ai-runtime/{components/message → runtime-components/ChatOutput}/ReferenceLinks.d.ts +0 -0
- /package/lib/types/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/ChatOutput/index.d.ts +0 -0
- /package/lib/types/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/SimpleOutput/index.d.ts +0 -0
- /package/lib/types/builtin/async/ai-runtime/{components/runtime/components → runtime-components}/SimplePage/index.d.ts +0 -0
- /package/lib/types/builtin/async/ai-runtime/{components/runtime/utils → utils}/map-right.d.ts +0 -0
|
@@ -9,19 +9,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.getAgent = void 0;
|
|
13
13
|
const ufo_1 = require("ufo");
|
|
14
14
|
const utils_1 = require("../../../utils");
|
|
15
15
|
const constants_1 = require("../constants");
|
|
16
|
-
const utils_2 = require("../utils");
|
|
17
16
|
const request_1 = require("./request");
|
|
18
|
-
function
|
|
19
|
-
return __awaiter(this, arguments, void 0, function* ({
|
|
20
|
-
const { projectId, projectRef, assistantId } = (0, utils_2.parseIdentity)(id, { rejectWhenError: true });
|
|
17
|
+
function getAgent(_a) {
|
|
18
|
+
return __awaiter(this, arguments, void 0, function* ({ aid, working }) {
|
|
21
19
|
return (0, request_1.request)({
|
|
22
|
-
url: (0, ufo_1.joinURL)((0, utils_1.getComponentMountPoint)(constants_1.AI_STUDIO_DID), '/api/
|
|
20
|
+
url: (0, ufo_1.joinURL)((0, utils_1.getComponentMountPoint)(constants_1.AI_STUDIO_DID), '/api/agents', aid),
|
|
23
21
|
query: { working },
|
|
24
22
|
});
|
|
25
23
|
});
|
|
26
24
|
}
|
|
27
|
-
exports.
|
|
25
|
+
exports.getAgent = getAgent;
|
|
@@ -22,21 +22,17 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
|
|
|
22
22
|
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.
|
|
25
|
+
exports.runAgent = exports.deleteSession = exports.updateSession = exports.createSession = exports.getSession = exports.getSessions = void 0;
|
|
26
26
|
const ufo_1 = require("ufo");
|
|
27
27
|
const stream_1 = require("../../../stream");
|
|
28
28
|
const utils_1 = require("../../../utils");
|
|
29
29
|
const constants_1 = require("../constants");
|
|
30
|
-
const utils_2 = require("../utils");
|
|
31
30
|
const request_1 = require("./request");
|
|
32
31
|
function getSessions(_a) {
|
|
33
|
-
return __awaiter(this, arguments, void 0, function* ({
|
|
32
|
+
return __awaiter(this, arguments, void 0, function* ({ aid }) {
|
|
34
33
|
return (0, request_1.request)({
|
|
35
|
-
url: (0, ufo_1.
|
|
36
|
-
|
|
37
|
-
projectRef,
|
|
38
|
-
assistantId,
|
|
39
|
-
}),
|
|
34
|
+
url: (0, ufo_1.joinURL)((0, utils_1.getComponentMountPoint)(constants_1.AI_STUDIO_DID), '/api/sessions'),
|
|
35
|
+
query: { aid },
|
|
40
36
|
});
|
|
41
37
|
});
|
|
42
38
|
}
|
|
@@ -50,23 +46,24 @@ function getSession(_a) {
|
|
|
50
46
|
}
|
|
51
47
|
exports.getSession = getSession;
|
|
52
48
|
function createSession(_a) {
|
|
53
|
-
return __awaiter(this, arguments, void 0, function* ({
|
|
49
|
+
return __awaiter(this, arguments, void 0, function* ({ aid, name, }) {
|
|
54
50
|
return (0, request_1.request)({
|
|
55
51
|
method: 'POST',
|
|
56
52
|
url: (0, ufo_1.joinURL)((0, utils_1.getComponentMountPoint)(constants_1.AI_STUDIO_DID), '/api/sessions'),
|
|
57
|
-
body:
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
body: {
|
|
54
|
+
aid,
|
|
55
|
+
name,
|
|
56
|
+
},
|
|
60
57
|
});
|
|
61
58
|
});
|
|
62
59
|
}
|
|
63
60
|
exports.createSession = createSession;
|
|
64
61
|
function updateSession(_a) {
|
|
65
|
-
return __awaiter(this, arguments, void 0, function* ({ sessionId, name,
|
|
62
|
+
return __awaiter(this, arguments, void 0, function* ({ sessionId, name, }) {
|
|
66
63
|
return (0, request_1.request)({
|
|
67
64
|
method: 'PATCH',
|
|
68
65
|
url: (0, ufo_1.joinURL)((0, utils_1.getComponentMountPoint)(constants_1.AI_STUDIO_DID), '/api/sessions', sessionId),
|
|
69
|
-
body: { name
|
|
66
|
+
body: { name },
|
|
70
67
|
});
|
|
71
68
|
});
|
|
72
69
|
}
|
|
@@ -80,8 +77,8 @@ function deleteSession(_a) {
|
|
|
80
77
|
});
|
|
81
78
|
}
|
|
82
79
|
exports.deleteSession = deleteSession;
|
|
83
|
-
function
|
|
84
|
-
return __asyncGenerator(this, arguments, function*
|
|
80
|
+
function runAgent(_a) {
|
|
81
|
+
return __asyncGenerator(this, arguments, function* runAgent_1({ aid, sessionId, working, parameters, }) {
|
|
85
82
|
var _b;
|
|
86
83
|
const res = yield __await((0, request_1.fetch)((0, ufo_1.joinURL)((0, utils_1.getComponentMountPoint)(constants_1.AI_STUDIO_DID), '/api/ai/call'), {
|
|
87
84
|
method: 'POST',
|
|
@@ -89,7 +86,12 @@ function runAssistant(_a) {
|
|
|
89
86
|
'Content-Type': 'application/json',
|
|
90
87
|
Accept: 'text/event-stream',
|
|
91
88
|
},
|
|
92
|
-
body: JSON.stringify(
|
|
89
|
+
body: JSON.stringify({
|
|
90
|
+
sessionId,
|
|
91
|
+
parameters: Object.assign(Object.assign({}, parameters), { $clientTime: new Date().toISOString() }),
|
|
92
|
+
aid,
|
|
93
|
+
working,
|
|
94
|
+
}),
|
|
93
95
|
}));
|
|
94
96
|
if (!(res.status >= 200 && res.status < 300)) {
|
|
95
97
|
let json;
|
|
@@ -118,4 +120,4 @@ function runAssistant(_a) {
|
|
|
118
120
|
}
|
|
119
121
|
});
|
|
120
122
|
}
|
|
121
|
-
exports.
|
|
123
|
+
exports.runAgent = runAgent;
|
|
@@ -23,7 +23,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ActionButton = void 0;
|
|
27
26
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
27
|
const react_1 = require("@iconify/react");
|
|
29
28
|
const material_1 = require("@mui/material");
|
|
@@ -60,4 +59,4 @@ function ActionButton(_a) {
|
|
|
60
59
|
}
|
|
61
60
|
}), children: buttonText })) }) }));
|
|
62
61
|
}
|
|
63
|
-
exports.
|
|
62
|
+
exports.default = ActionButton;
|
|
@@ -20,7 +20,7 @@ const NumberField_1 = __importDefault(require("./NumberField"));
|
|
|
20
20
|
const RadioField_1 = __importDefault(require("./RadioField"));
|
|
21
21
|
const SelectField_1 = __importDefault(require("./SelectField"));
|
|
22
22
|
const StringField_1 = __importDefault(require("./StringField"));
|
|
23
|
-
function
|
|
23
|
+
function AgentInputField(_a) {
|
|
24
24
|
var _b;
|
|
25
25
|
var { parameter } = _a, props = __rest(_a, ["parameter"]);
|
|
26
26
|
if (parameter.type === 'source')
|
|
@@ -38,4 +38,4 @@ function ParameterField(_a) {
|
|
|
38
38
|
}[parameter.type || 'string'] || StringField_1.default;
|
|
39
39
|
return ((0, jsx_runtime_1.jsx)(Field, Object.assign({ label: parameter === null || parameter === void 0 ? void 0 : parameter.label, helperText: parameter === null || parameter === void 0 ? void 0 : parameter.helper, placeholder: parameter === null || parameter === void 0 ? void 0 : parameter.placeholder }, { parameter }, { size: "small" }, props)));
|
|
40
40
|
}
|
|
41
|
-
exports.default =
|
|
41
|
+
exports.default = AgentInputField;
|
package/lib/cjs/builtin/async/ai-runtime/components/{GlobalLoading.js → GlobalLoading/index.js}
RENAMED
|
@@ -11,12 +11,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.globalLoadingState = void 0;
|
|
14
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
16
|
const material_1 = require("@mui/material");
|
|
16
|
-
const
|
|
17
|
+
const state_1 = require("./state");
|
|
18
|
+
var state_2 = require("./state");
|
|
19
|
+
Object.defineProperty(exports, "globalLoadingState", { enumerable: true, get: function () { return state_2.globalLoadingState; } });
|
|
17
20
|
function GlobalLoading(_a) {
|
|
18
21
|
var props = __rest(_a, []);
|
|
19
|
-
const state = (0,
|
|
22
|
+
const state = (0, state_1.globalLoadingState)();
|
|
20
23
|
if (!state.loading)
|
|
21
24
|
return null;
|
|
22
25
|
return (0, jsx_runtime_1.jsx)(material_1.LinearProgress, Object.assign({}, props));
|
|
@@ -35,22 +35,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
35
35
|
};
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const css_1 = require("@emotion/css");
|
|
38
39
|
const material_1 = require("@mui/material");
|
|
39
40
|
const react_wrap_balancer_1 = __importStar(require("react-wrap-balancer"));
|
|
40
|
-
const
|
|
41
|
-
function
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}, justifyContent: "space-between", alignItems: "center", gap: 2 }, props, { children: [(0, jsx_runtime_1.jsx)(material_1.Stack, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { component: ux_1.Avatar, size: 120, src: (_b = agent.release) === null || _b === void 0 ? void 0 : _b.logo, did: blocklet === null || blocklet === void 0 ? void 0 : blocklet.appId, borderRadius: 1 }) }), (0, jsx_runtime_1.jsx)(react_wrap_balancer_1.Provider, { children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { spacing: 1, sx: {
|
|
48
|
-
flex: 1,
|
|
49
|
-
lineHeight: '28px',
|
|
50
|
-
textAlign: {
|
|
51
|
-
md: 'left',
|
|
52
|
-
xs: 'center',
|
|
53
|
-
},
|
|
54
|
-
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { component: "h5", sx: { fontSize: 18, fontWeight: 600 }, children: (0, jsx_runtime_1.jsx)(react_wrap_balancer_1.default, { children: ((_c = agent.release) === null || _c === void 0 ? void 0 : _c.title) || agent.name }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: { fontSize: 16, color: 'rgba(75, 85, 99, 1)' }, children: (0, jsx_runtime_1.jsx)(react_wrap_balancer_1.default, { children: ((_d = agent.release) === null || _d === void 0 ? void 0 : _d.description) || agent.description }) })] }) })] })));
|
|
41
|
+
const runtime_1 = require("../../state/runtime");
|
|
42
|
+
function SimpleHeader(_a) {
|
|
43
|
+
var { TitleProps, DescriptionProps } = _a, props = __rest(_a, ["TitleProps", "DescriptionProps"]);
|
|
44
|
+
const { agent, appearancePage } = (0, runtime_1.useRuntimeState)();
|
|
45
|
+
const title = (appearancePage === null || appearancePage === void 0 ? void 0 : appearancePage.name) || agent.name;
|
|
46
|
+
const description = (appearancePage === null || appearancePage === void 0 ? void 0 : appearancePage.description) || agent.description;
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ gap: 2, mt: 8, mb: 4 }, props, { className: (0, css_1.cx)('aigne-header aigne-simple-header', props.className), children: (0, jsx_runtime_1.jsxs)(react_wrap_balancer_1.Provider, { children: [title && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ width: "100%", component: "h5", fontSize: 30, fontWeight: 700, textAlign: "center" }, TitleProps, { children: (0, jsx_runtime_1.jsx)(react_wrap_balancer_1.default, { children: title }) }))), description && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ width: "100%", textAlign: "center" }, DescriptionProps, { children: (0, jsx_runtime_1.jsx)(react_wrap_balancer_1.default, { children: description }) })))] }) })));
|
|
55
48
|
}
|
|
56
|
-
exports.default =
|
|
49
|
+
exports.default = SimpleHeader;
|
|
@@ -10,14 +10,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
14
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
const css_1 = require("@emotion/css");
|
|
16
|
+
const material_1 = require("@mui/material");
|
|
17
|
+
function SimpleLayout(_a) {
|
|
18
|
+
var props = __rest(_a, []);
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ flexGrow: 1, maxWidth: "md", width: "100%", mx: "auto", px: { xs: 2, sm: 3 } }, props, { className: (0, css_1.cx)('aigne-layout aigne-layout-simple', props.className) })));
|
|
22
20
|
}
|
|
23
|
-
exports.default =
|
|
21
|
+
exports.default = SimpleLayout;
|
|
@@ -44,7 +44,7 @@ const react_2 = __importDefault(require("react"));
|
|
|
44
44
|
const locale_1 = require("../../../locale");
|
|
45
45
|
const react_markdown_1 = __importDefault(require("../../react-markdown"));
|
|
46
46
|
const react_syntax_highlighter_1 = __importDefault(require("../../react-syntax-highlighter"));
|
|
47
|
-
const ActionButton_1 = require("./ActionButton");
|
|
47
|
+
const ActionButton_1 = __importDefault(require("./ActionButton"));
|
|
48
48
|
const ReactSyntaxHighlighter = react_2.default.lazy(() => (0, react_syntax_highlighter_1.default)().then((m) => ({ default: m.Prism })));
|
|
49
49
|
const Markdown = react_2.default.lazy(() => Promise.all([
|
|
50
50
|
(0, react_markdown_1.default)(),
|
|
@@ -150,7 +150,7 @@ function MarkdownPre({ children }) {
|
|
|
150
150
|
borderRadius: 1,
|
|
151
151
|
bgcolor: 'rgb(245, 242, 240)',
|
|
152
152
|
'> pre': { mt: '0 !important' },
|
|
153
|
-
}, children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", alignItems: "center", p: 0.5, pl: 1.5, borderBottom: 1, borderColor: "grey.200", children: [(0, jsx_runtime_1.jsx)(material_1.Box, { children: language }), (0, jsx_runtime_1.jsx)(material_1.Box, { flex: 1 }), (0, jsx_runtime_1.jsx)(ActionButton_1.
|
|
153
|
+
}, children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", alignItems: "center", p: 0.5, pl: 1.5, borderBottom: 1, borderColor: "grey.200", children: [(0, jsx_runtime_1.jsx)(material_1.Box, { children: language }), (0, jsx_runtime_1.jsx)(material_1.Box, { flex: 1 }), (0, jsx_runtime_1.jsx)(ActionButton_1.default, { autoReset: true, tip: t('copyToClipboard'), tipSucceed: t('copied'), title: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:copy" }), titleSucceed: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:copy-check" }), sx: { minWidth: 32, minHeight: 32, p: 0, fontSize: 18 }, onClick: () => {
|
|
154
154
|
window.navigator.clipboard.writeText(childrenProps.children);
|
|
155
155
|
} })] }), children] }));
|
|
156
156
|
}
|
package/lib/cjs/builtin/async/ai-runtime/components/{RuntimeProvider.js → RuntimeCommonProvider.js}
RENAMED
|
@@ -13,10 +13,10 @@ const locale_1 = require("../../../locale");
|
|
|
13
13
|
const locales_1 = require("../locales");
|
|
14
14
|
const GlobalLoading_1 = __importDefault(require("./GlobalLoading"));
|
|
15
15
|
const ThemeProvider_1 = __importDefault(require("./ThemeProvider"));
|
|
16
|
-
function
|
|
16
|
+
function RuntimeCommonProvider({ children }) {
|
|
17
17
|
return ((0, jsx_runtime_1.jsx)(RuntimeLocaleProvider, { children: (0, jsx_runtime_1.jsx)(ThemeProvider_1.default, { children: (0, jsx_runtime_1.jsxs)(react_error_boundary_1.ErrorBoundary, { FallbackComponent: ErrorRender, children: [(0, jsx_runtime_1.jsx)(GlobalLoading_1.default, { sx: { position: 'fixed', left: 0, top: 0, width: '100%', zIndex: 'snackbar' } }), (0, jsx_runtime_1.jsx)(react_1.default.Suspense, { fallback: (0, jsx_runtime_1.jsx)(material_1.Stack, { flexGrow: 1, alignItems: "center", justifyContent: "center", children: (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 24 }) }), children: children })] }) }) }));
|
|
18
18
|
}
|
|
19
|
-
exports.default =
|
|
19
|
+
exports.default = RuntimeCommonProvider;
|
|
20
20
|
function ErrorRender({ error }) {
|
|
21
21
|
return ((0, jsx_runtime_1.jsx)(ux_1.Result, { status: error.status || 'error', description: error.message, sx: { bgcolor: 'transparent', mt: '20%' } }));
|
|
22
22
|
}
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
10
24
|
};
|
|
11
25
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
26
|
var t = {};
|
|
@@ -23,68 +37,37 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
38
|
};
|
|
25
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.useScrollToBottomModule = void 0;
|
|
27
40
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
41
|
const material_1 = require("@mui/material");
|
|
29
42
|
const react_1 = require("react");
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
.then((mod) => {
|
|
36
|
-
scrollToBottomModuleLoader.mod = mod;
|
|
37
|
-
return mod;
|
|
38
|
-
})
|
|
39
|
-
.catch((error) => {
|
|
40
|
-
scrollToBottomModuleLoader.error = error;
|
|
41
|
-
throw error;
|
|
42
|
-
}));
|
|
43
|
-
return scrollToBottomModuleLoader;
|
|
44
|
-
}
|
|
45
|
-
function useScrollToBottomModule() {
|
|
46
|
-
const loader = loadScrollToBottomModule();
|
|
47
|
-
const [mod, setMod] = (0, react_1.useState)(loader.mod);
|
|
48
|
-
const [error, setError] = (0, react_1.useState)(loader.error);
|
|
49
|
-
(0, react_1.useEffect)(() => {
|
|
50
|
-
(() => __awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
try {
|
|
52
|
-
yield loader.promise;
|
|
53
|
-
if (loader.mod)
|
|
54
|
-
setMod(loader.mod);
|
|
55
|
-
else if (loader.error)
|
|
56
|
-
setError(loader.error);
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
setError(error);
|
|
60
|
-
}
|
|
61
|
-
}))();
|
|
62
|
-
}, []);
|
|
63
|
-
if (mod)
|
|
64
|
-
return mod;
|
|
65
|
-
if (error)
|
|
66
|
-
throw error;
|
|
67
|
-
throw loader.promise;
|
|
68
|
-
}
|
|
69
|
-
exports.useScrollToBottomModule = useScrollToBottomModule;
|
|
43
|
+
const scrollToBottom = __importStar(require("react-scroll-to-bottom"));
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
const useInternalContext_1 = __importDefault(require("react-scroll-to-bottom/lib/esm/hooks/internal/useInternalContext"));
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
const Composer = scrollToBottom.Composer;
|
|
70
48
|
function ScrollView(_a) {
|
|
71
|
-
var { children, initialScrollBehavior } = _a, props = __rest(_a, ["children", "initialScrollBehavior"]);
|
|
72
|
-
|
|
73
|
-
|
|
49
|
+
var { disabled, children, scroll, component, initialScrollBehavior } = _a, props = __rest(_a, ["disabled", "children", "scroll", "component", "initialScrollBehavior"]);
|
|
50
|
+
if (disabled) {
|
|
51
|
+
if (component) {
|
|
52
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: component }, props, { children: children })));
|
|
53
|
+
}
|
|
54
|
+
return children;
|
|
55
|
+
}
|
|
56
|
+
return ((0, jsx_runtime_1.jsx)(Composer, { initialScrollBehavior: initialScrollBehavior, children: (0, jsx_runtime_1.jsx)(ScrollViewWithinWindow, Object.assign({ scroll: scroll, component: component }, props, { children: children })) }));
|
|
74
57
|
}
|
|
75
58
|
exports.default = ScrollView;
|
|
76
59
|
function ScrollViewWithinWindow(_a) {
|
|
77
|
-
var { children,
|
|
78
|
-
const { setTarget } =
|
|
60
|
+
var { children, scroll, component } = _a, props = __rest(_a, ["children", "scroll", "component"]);
|
|
61
|
+
const { setTarget } = (0, useInternalContext_1.default)();
|
|
79
62
|
const ele = useFakeScrollElementOfWindow();
|
|
80
63
|
(0, react_1.useEffect)(() => {
|
|
81
|
-
if (
|
|
64
|
+
if (scroll === 'window') {
|
|
82
65
|
setTarget(ele);
|
|
83
66
|
}
|
|
84
|
-
}, [
|
|
67
|
+
}, [scroll]);
|
|
85
68
|
if (!component)
|
|
86
69
|
return children;
|
|
87
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: component }, props, { ref: !
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: component }, props, { ref: !scroll ? setTarget : undefined, children: children })));
|
|
88
71
|
}
|
|
89
72
|
function useFakeScrollElementOfWindow() {
|
|
90
73
|
return (0, react_1.useMemo)(() => {
|
|
@@ -22,7 +22,6 @@ const react_2 = require("react");
|
|
|
22
22
|
const react_share_1 = require("react-share");
|
|
23
23
|
const locale_1 = require("../../../locale");
|
|
24
24
|
const locales_1 = require("../locales");
|
|
25
|
-
const utils_1 = require("../utils");
|
|
26
25
|
const MenuButton_1 = __importDefault(require("./MenuButton"));
|
|
27
26
|
const getFormattedUrl = (url) => {
|
|
28
27
|
// remove page & sessionId query params
|
|
@@ -88,8 +87,14 @@ function SocialShareMenu(_a) {
|
|
|
88
87
|
exports.SocialShareMenu = SocialShareMenu;
|
|
89
88
|
function SocialShareButtons(_a) {
|
|
90
89
|
var { url = getFormattedUrl(window.location.href), content, sx, itemSx, onClick, bgFill, iconFill } = _a, rest = __rest(_a, ["url", "content", "sx", "itemSx", "onClick", "bgFill", "iconFill"]);
|
|
91
|
-
const mergedSx =
|
|
92
|
-
|
|
90
|
+
const mergedSx = [
|
|
91
|
+
{ display: 'flex', alignItems: 'center', gap: 0.5, lineHeight: 1 },
|
|
92
|
+
...(Array.isArray(sx) ? sx : [sx]),
|
|
93
|
+
];
|
|
94
|
+
const mergedItemSx = [
|
|
95
|
+
{ width: { xs: 24, sm: 28 }, height: { xs: 24, sm: 28 }, borderRadius: 1 },
|
|
96
|
+
...(Array.isArray(itemSx) ? itemSx : [itemSx]),
|
|
97
|
+
];
|
|
93
98
|
const iconProps = {
|
|
94
99
|
bgStyle: { fill: bgFill || '#bbb' },
|
|
95
100
|
iconFillColor: iconFill || '#fff',
|
|
@@ -98,27 +98,6 @@ function ThemeProvider({ children, template, transparentHeaderBg, }) {
|
|
|
98
98
|
},
|
|
99
99
|
],
|
|
100
100
|
},
|
|
101
|
-
MuiDialog: {
|
|
102
|
-
variants: [
|
|
103
|
-
{
|
|
104
|
-
props: {},
|
|
105
|
-
style: ({ theme }) => theme.unstable_sx({
|
|
106
|
-
'.MuiDialogTitle-root': {
|
|
107
|
-
px: 2.5,
|
|
108
|
-
py: 2,
|
|
109
|
-
},
|
|
110
|
-
'.MuiDialogContent-root': {
|
|
111
|
-
px: 2.5,
|
|
112
|
-
py: 2,
|
|
113
|
-
},
|
|
114
|
-
'.MuiDialogActions-root': {
|
|
115
|
-
px: 2.5,
|
|
116
|
-
py: 2,
|
|
117
|
-
},
|
|
118
|
-
}),
|
|
119
|
-
},
|
|
120
|
-
],
|
|
121
|
-
},
|
|
122
101
|
},
|
|
123
102
|
};
|
|
124
103
|
const paletteTheme = (0, material_1.createTheme)({
|
|
@@ -20,7 +20,7 @@ const DID_1 = __importDefault(require("@arcblock/ux/lib/DID"));
|
|
|
20
20
|
const material_1 = require("@mui/material");
|
|
21
21
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
22
22
|
const react_1 = require("react");
|
|
23
|
-
const ux_1 = require("
|
|
23
|
+
const ux_1 = require("../../../arcblock/ux");
|
|
24
24
|
function UserInfo(_a) {
|
|
25
25
|
var { avatar, showDID, did, name, time, children, reverse } = _a, restProps = __rest(_a, ["avatar", "showDID", "did", "name", "time", "children", "reverse"]);
|
|
26
26
|
return ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: "user-info", alignItems: "center", direction: reverse ? 'row-reverse' : 'row', gap: 1.5 }, restProps, { children: [(avatar || did) && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PAYMENT_KIT_DID = exports.AI_STUDIO_DID = void 0;
|
|
3
|
+
exports.DEFAULT_OUTPUT_COMPONENT_ID = exports.DEFAULT_INPUT_COMPONENT_ID = exports.DEFAULT_PAGE_COMPONENT_ID = exports.PAYMENT_KIT_DID = exports.AI_STUDIO_DID = void 0;
|
|
4
4
|
exports.AI_STUDIO_DID = 'z8iZpog7mcgcgBZzTiXJCWESvmnRrQmnd3XBB';
|
|
5
5
|
exports.PAYMENT_KIT_DID = 'z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk';
|
|
6
|
+
exports.DEFAULT_PAGE_COMPONENT_ID = 'ctnxha29uu8cx4xv';
|
|
7
|
+
exports.DEFAULT_INPUT_COMPONENT_ID = '1wwtemqcdio6nqf0';
|
|
8
|
+
exports.DEFAULT_OUTPUT_COMPONENT_ID = 'q0ckknkxph4hfwas';
|
package/lib/cjs/builtin/async/ai-runtime/{components/runtime/contexts → contexts}/CurrentAgent.js
RENAMED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useCurrentAgent = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const aid_1 = require("@blocklet/ai-runtime/common/aid");
|
|
5
6
|
const types_1 = require("@blocklet/ai-runtime/types");
|
|
6
7
|
const react_1 = require("react");
|
|
7
|
-
const utils_1 = require("../../../utils");
|
|
8
8
|
const constants_1 = require("../constants");
|
|
9
|
-
const
|
|
9
|
+
const agent_1 = require("../state/agent");
|
|
10
10
|
const runtime_1 = require("../state/runtime");
|
|
11
11
|
const context = (0, react_1.createContext)(undefined);
|
|
12
12
|
function CurrentAgentProvider({ agentId, children }) {
|
|
13
13
|
const { aid } = (0, runtime_1.useRuntimeState)();
|
|
14
14
|
const state = (0, react_1.useMemo)(() => ({
|
|
15
|
-
aid: (0,
|
|
15
|
+
aid: (0, aid_1.stringifyIdentity)(Object.assign(Object.assign({}, (0, aid_1.parseIdentity)(aid, { rejectWhenError: true })), { assistantId: agentId })),
|
|
16
16
|
}), [aid, agentId]);
|
|
17
17
|
return (0, jsx_runtime_1.jsx)(context.Provider, { value: state, children: children });
|
|
18
18
|
}
|
|
@@ -23,7 +23,7 @@ function useCurrentAgent() {
|
|
|
23
23
|
if (!current) {
|
|
24
24
|
throw new Error('No such current agent state. You should use `useCurrentAgent` within the `CurrentAgentProvider`');
|
|
25
25
|
}
|
|
26
|
-
const [agent] = (0,
|
|
26
|
+
const [agent] = (0, agent_1.useAgentState)({ aid: current.aid, working });
|
|
27
27
|
const appearanceInput = (0, react_1.useMemo)(() => {
|
|
28
28
|
var _a, _b, _c;
|
|
29
29
|
return (_c = (_b = (_a = agent.outputVariables) === null || _a === void 0 ? void 0 : _a.find((i) => i.name === types_1.RuntimeOutputVariable.appearanceInput)) === null || _b === void 0 ? void 0 : _b.initialValue) !== null && _c !== void 0 ? _c : { componentId: constants_1.DEFAULT_INPUT_COMPONENT_ID };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RuntimeProviderFromUrl = exports.useRuntimeContext = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
7
|
+
const error_1 = require("../error");
|
|
8
|
+
const runtimeContext = (0, react_1.createContext)(undefined);
|
|
9
|
+
function useRuntimeContext() {
|
|
10
|
+
const context = (0, react_1.useContext)(runtimeContext);
|
|
11
|
+
if (!context) {
|
|
12
|
+
throw new Error('No such runtime context. You should use `useRuntimeContext` within the `RuntimeProvider`');
|
|
13
|
+
}
|
|
14
|
+
return context;
|
|
15
|
+
}
|
|
16
|
+
exports.useRuntimeContext = useRuntimeContext;
|
|
17
|
+
function RuntimeProvider({ aid, working, children, }) {
|
|
18
|
+
if (!aid)
|
|
19
|
+
throw new Error('Missing required props `aid`');
|
|
20
|
+
const value = (0, react_1.useMemo)(() => ({ aid, working }), [aid, working]);
|
|
21
|
+
return (0, jsx_runtime_1.jsx)(runtimeContext.Provider, { value: value, children: children });
|
|
22
|
+
}
|
|
23
|
+
exports.default = RuntimeProvider;
|
|
24
|
+
function RuntimeProviderFromUrl({ children }) {
|
|
25
|
+
const [query] = (0, react_router_dom_1.useSearchParams)();
|
|
26
|
+
const aid = query.get('aid');
|
|
27
|
+
const working = query.get('working') === 'true';
|
|
28
|
+
if (!aid)
|
|
29
|
+
throw new error_1.CustomError(404, 'Missing required query parameters `aid`');
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(RuntimeProvider, { aid: aid, working: working, children: children }));
|
|
31
|
+
}
|
|
32
|
+
exports.RuntimeProviderFromUrl = RuntimeProviderFromUrl;
|
|
@@ -17,73 +17,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const ScrollView_1 = __importDefault(require("./components/ScrollView"));
|
|
31
|
-
const CheckSession_1 = __importDefault(require("./components/session/CheckSession"));
|
|
32
|
-
const header_1 = require("./hooks/header");
|
|
33
|
-
const navigate_1 = require("./hooks/navigate");
|
|
34
|
-
const assistant_1 = require("./state/assistant");
|
|
35
|
-
__exportStar(require("./components/runtime/contexts/CurrentAgent"), exports);
|
|
36
|
-
__exportStar(require("./components/runtime/contexts/CurrentMessage"), exports);
|
|
37
|
-
__exportStar(require("./components/runtime/state/runtime"), exports);
|
|
38
|
-
__exportStar(require("./components/runtime/state/session"), exports);
|
|
39
|
-
var runtime_1 = require("./components/runtime");
|
|
40
|
-
Object.defineProperty(exports, "Runtime", { enumerable: true, get: function () { return __importDefault(runtime_1).default; } });
|
|
41
|
-
var SimplePage_1 = require("./components/runtime/components/SimplePage");
|
|
20
|
+
exports.PhotoGalleryItem = exports.ChatOutput = exports.SimpleOutput = exports.AutoForm = exports.PhotoGallery = exports.SimpleChat = exports.SimplePage = exports.ChatBotButton = exports.Runtime = void 0;
|
|
21
|
+
__exportStar(require("./contexts/CurrentAgent"), exports);
|
|
22
|
+
__exportStar(require("./contexts/CurrentMessage"), exports);
|
|
23
|
+
__exportStar(require("./state/runtime"), exports);
|
|
24
|
+
__exportStar(require("./state/session"), exports);
|
|
25
|
+
var Runtime_1 = require("./runtime/Runtime");
|
|
26
|
+
Object.defineProperty(exports, "Runtime", { enumerable: true, get: function () { return __importDefault(Runtime_1).default; } });
|
|
27
|
+
var ChatBotButton_1 = require("./runtime/ChatBotButton");
|
|
28
|
+
Object.defineProperty(exports, "ChatBotButton", { enumerable: true, get: function () { return __importDefault(ChatBotButton_1).default; } });
|
|
29
|
+
var SimplePage_1 = require("./runtime-components/SimplePage");
|
|
42
30
|
Object.defineProperty(exports, "SimplePage", { enumerable: true, get: function () { return __importDefault(SimplePage_1).default; } });
|
|
43
|
-
var SimpleChat_1 = require("./
|
|
31
|
+
var SimpleChat_1 = require("./runtime-components/SimpleChat");
|
|
44
32
|
Object.defineProperty(exports, "SimpleChat", { enumerable: true, get: function () { return __importDefault(SimpleChat_1).default; } });
|
|
45
|
-
var PhotoGallery_1 = require("./
|
|
33
|
+
var PhotoGallery_1 = require("./runtime-components/PhotoGallery");
|
|
46
34
|
Object.defineProperty(exports, "PhotoGallery", { enumerable: true, get: function () { return __importDefault(PhotoGallery_1).default; } });
|
|
47
|
-
var AutoForm_1 = require("./
|
|
35
|
+
var AutoForm_1 = require("./runtime-components/AutoForm");
|
|
48
36
|
Object.defineProperty(exports, "AutoForm", { enumerable: true, get: function () { return __importDefault(AutoForm_1).default; } });
|
|
49
|
-
var SimpleOutput_1 = require("./
|
|
37
|
+
var SimpleOutput_1 = require("./runtime-components/SimpleOutput");
|
|
50
38
|
Object.defineProperty(exports, "SimpleOutput", { enumerable: true, get: function () { return __importDefault(SimpleOutput_1).default; } });
|
|
51
|
-
var ChatOutput_1 = require("./
|
|
39
|
+
var ChatOutput_1 = require("./runtime-components/ChatOutput");
|
|
52
40
|
Object.defineProperty(exports, "ChatOutput", { enumerable: true, get: function () { return __importDefault(ChatOutput_1).default; } });
|
|
53
|
-
var PhotoGalleryItem_1 = require("./
|
|
41
|
+
var PhotoGalleryItem_1 = require("./runtime-components/PhotoGalleryItem");
|
|
54
42
|
Object.defineProperty(exports, "PhotoGalleryItem", { enumerable: true, get: function () { return __importDefault(PhotoGalleryItem_1).default; } });
|
|
55
|
-
function App(props) {
|
|
56
|
-
const cacheId = (0, react_1.useId)();
|
|
57
|
-
return ((0, jsx_runtime_1.jsx)(RuntimeProvider_1.default, { children: (0, jsx_runtime_1.jsx)(AIRuntime, Object.assign({}, props, { cacheId: cacheId })) }));
|
|
58
|
-
}
|
|
59
|
-
exports.default = App;
|
|
60
|
-
function AIRuntime({ cacheId }) {
|
|
61
|
-
var _a;
|
|
62
|
-
const page = (0, navigate_1.useCurrentPage)();
|
|
63
|
-
const { assistantId } = page;
|
|
64
|
-
const [assistant] = (0, assistant_1.useAssistantState)({ assistantId });
|
|
65
|
-
(0, header_1.useSetHeader)({ assistant, assistantId });
|
|
66
|
-
return ((0, jsx_runtime_1.jsx)(CheckSession_1.default, { cacheId: cacheId, page: page, children: (0, jsx_runtime_1.jsx)(ScrollView_1.default, { scroller: "window", initialScrollBehavior: "auto", children: (0, jsx_runtime_1.jsx)(material_1.Stack, { flexGrow: 1, height: "100%", className: "ai-runtime-root", children: ((_a = assistant.release) === null || _a === void 0 ? void 0 : _a.template) === 'form' ? (0, jsx_runtime_1.jsx)(runtime_form_1.default, { page: page }) : (0, jsx_runtime_1.jsx)(runtime_chat_1.default, { page: page }) }) }) }));
|
|
67
|
-
}
|
|
68
|
-
exports.AIRuntime = AIRuntime;
|
|
69
|
-
function ChatBot(props) {
|
|
70
|
-
if (!props.assistantId)
|
|
71
|
-
throw new Error('Missing required parameter assistantId');
|
|
72
|
-
const navigate = (0, react_1.useCallback)((page) => {
|
|
73
|
-
setPage((state) => (Object.assign(Object.assign({}, state), page)));
|
|
74
|
-
}, []);
|
|
75
|
-
const [page, setPage] = (0, react_1.useState)({
|
|
76
|
-
page: 'assistant',
|
|
77
|
-
assistantId: props.assistantId,
|
|
78
|
-
navigate,
|
|
79
|
-
});
|
|
80
|
-
const cacheId = (0, react_1.useId)();
|
|
81
|
-
return ((0, jsx_runtime_1.jsx)(RuntimeProvider_1.default, { children: (0, jsx_runtime_1.jsx)(react_error_boundary_1.ErrorBoundary, { FallbackComponent: ChatBotErrorView, children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { children: (0, jsx_runtime_1.jsx)(common_1.ChatBot, Object.assign({}, props, { children: (0, jsx_runtime_1.jsx)(CheckSession_1.default, { cacheId: cacheId, autoCreateSession: true, page: page, children: (0, jsx_runtime_1.jsx)(runtime_chat_1.default, { page: page }) }) })) }) }) }));
|
|
82
|
-
}
|
|
83
|
-
exports.ChatBot = ChatBot;
|
|
84
|
-
function ChatBotErrorView({ error }) {
|
|
85
|
-
(0, react_1.useEffect)(() => {
|
|
86
|
-
ux_1.Toast.error(error.message);
|
|
87
|
-
}, [error]);
|
|
88
|
-
return null;
|
|
89
|
-
}
|