@blocklet/pages-kit 0.2.286 → 0.2.288
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 +26 -0
- package/lib/cjs/builtin/async/ai-runtime/api/dataset.js +127 -0
- package/lib/cjs/builtin/async/ai-runtime/api/message.js +33 -0
- package/lib/cjs/builtin/async/ai-runtime/api/request.js +55 -0
- package/lib/cjs/builtin/async/ai-runtime/api/session.js +121 -0
- package/lib/cjs/builtin/async/ai-runtime/api/subscription.js +32 -0
- package/lib/cjs/builtin/async/ai-runtime/components/ActionButton.js +63 -0
- package/lib/cjs/builtin/async/ai-runtime/components/GlobalLoading.js +24 -0
- package/lib/cjs/builtin/async/ai-runtime/components/LoadingButton.js +40 -0
- package/lib/cjs/builtin/async/ai-runtime/components/LoadingListItemButton.js +49 -0
- package/lib/cjs/builtin/async/ai-runtime/components/MarkdownRenderer.js +156 -0
- package/lib/cjs/builtin/async/ai-runtime/components/MenuButton.js +43 -0
- package/lib/cjs/builtin/async/ai-runtime/components/PoweredBy.js +30 -0
- package/lib/cjs/builtin/async/ai-runtime/components/RuntimeProvider.js +22 -0
- package/lib/cjs/builtin/async/ai-runtime/components/ScrollView.js +109 -0
- package/lib/cjs/builtin/async/ai-runtime/components/SocialShare.js +102 -0
- package/lib/cjs/builtin/async/ai-runtime/components/ThemeProvider.js +193 -0
- package/lib/cjs/builtin/async/ai-runtime/components/collection/CollectionEditDialog.js +92 -0
- package/lib/cjs/builtin/async/ai-runtime/components/collection/CollectionListView.js +197 -0
- package/lib/cjs/builtin/async/ai-runtime/components/collection/CollectionView.js +122 -0
- package/lib/cjs/builtin/async/ai-runtime/components/collection/DocumentListView.js +152 -0
- package/lib/cjs/builtin/async/ai-runtime/components/collection/DocumentView.js +135 -0
- package/lib/cjs/builtin/async/ai-runtime/components/common/ChatBot.js +104 -0
- package/lib/cjs/builtin/async/ai-runtime/components/common/MessageMetadataRenderer.js +21 -0
- package/lib/cjs/builtin/async/ai-runtime/components/common/MessageSuggestedQuestions.js +35 -0
- package/lib/cjs/builtin/async/ai-runtime/components/common/index.js +12 -0
- package/lib/cjs/builtin/async/ai-runtime/components/form/ParameterForm.js +89 -0
- package/lib/cjs/builtin/async/ai-runtime/components/form/ParameterFormDialog.js +66 -0
- package/lib/cjs/builtin/async/ai-runtime/components/form/ParameterFormFields.js +57 -0
- package/lib/cjs/builtin/async/ai-runtime/components/form/QuestionField.js +44 -0
- package/lib/cjs/builtin/async/ai-runtime/components/form/SettingButton.js +81 -0
- package/lib/cjs/builtin/async/ai-runtime/components/lottie/index.js +34 -0
- package/lib/cjs/builtin/async/ai-runtime/components/message/MessageActions.js +38 -0
- package/lib/cjs/builtin/async/ai-runtime/components/message/MessageErrorView.js +30 -0
- package/lib/cjs/builtin/async/ai-runtime/components/message/MessageItemView.js +129 -0
- package/lib/cjs/builtin/async/ai-runtime/components/message/MessageListView.js +47 -0
- package/lib/cjs/builtin/async/ai-runtime/components/message/ReferenceLinks.js +11 -0
- package/lib/cjs/builtin/async/ai-runtime/components/parameters/LanguageField.js +55 -0
- package/lib/cjs/builtin/async/ai-runtime/components/parameters/NumberField.js +21 -0
- package/lib/cjs/builtin/async/ai-runtime/components/parameters/SelectField.js +24 -0
- package/lib/cjs/builtin/async/ai-runtime/components/parameters/StringField.js +21 -0
- package/lib/cjs/builtin/async/ai-runtime/components/parameters/index.js +37 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-chat/InitialForm.js +111 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-chat/RuntimeChatHeader.js +60 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-chat/RuntimeChatSession.js +52 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-chat/index.js +28 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-form/RuntimeFormForms.js +120 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-form/RuntimeFormHeader.js +22 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-form/RuntimeFormResult.js +72 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-form/RuntimeFormSubmit.js +31 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-form/index.js +22 -0
- package/lib/cjs/builtin/async/ai-runtime/components/session/CheckSession.js +65 -0
- package/lib/cjs/builtin/async/ai-runtime/components/session/SessionListView.js +88 -0
- package/lib/cjs/builtin/async/ai-runtime/constants.js +5 -0
- package/lib/cjs/builtin/async/ai-runtime/error.js +10 -0
- package/lib/cjs/builtin/async/ai-runtime/hooks/header.js +32 -0
- package/lib/cjs/builtin/async/ai-runtime/hooks/navigate.js +38 -0
- package/lib/cjs/builtin/async/ai-runtime/hooks/subscribe.js +35 -0
- package/lib/cjs/builtin/async/ai-runtime/hooks/useAsync.js +32 -0
- package/lib/cjs/builtin/async/ai-runtime/index.js +81 -0
- package/lib/cjs/builtin/async/ai-runtime/locales/index.js +147 -0
- package/lib/cjs/builtin/async/ai-runtime/state/assistant.js +59 -0
- package/lib/cjs/builtin/async/ai-runtime/state/index.js +423 -0
- package/lib/cjs/builtin/async/ai-runtime/state/loading.js +39 -0
- package/lib/cjs/builtin/async/ai-runtime/state/session.js +217 -0
- package/lib/cjs/builtin/async/ai-runtime/state/subscription.js +52 -0
- package/lib/cjs/builtin/async/ai-runtime/utils.js +49 -0
- package/lib/cjs/builtin/async/react-scroll-to-bottom.js +1 -1
- package/lib/cjs/utils/builtin.js +1 -0
- package/lib/cjs/utils/inject-global-components.js +2 -0
- package/lib/esm/builtin/async/ai-runtime/api/assistant.js +22 -0
- package/lib/esm/builtin/async/ai-runtime/api/dataset.js +113 -0
- package/lib/esm/builtin/async/ai-runtime/api/message.js +28 -0
- package/lib/esm/builtin/async/ai-runtime/api/request.js +51 -0
- package/lib/esm/builtin/async/ai-runtime/api/session.js +112 -0
- package/lib/esm/builtin/async/ai-runtime/api/subscription.js +27 -0
- package/lib/esm/builtin/async/ai-runtime/components/ActionButton.js +56 -0
- package/lib/esm/builtin/async/ai-runtime/components/GlobalLoading.js +21 -0
- package/lib/esm/builtin/async/ai-runtime/components/LoadingButton.js +38 -0
- package/lib/esm/builtin/async/ai-runtime/components/LoadingListItemButton.js +46 -0
- package/lib/esm/builtin/async/ai-runtime/components/MarkdownRenderer.js +129 -0
- package/lib/esm/builtin/async/ai-runtime/components/MenuButton.js +40 -0
- package/lib/esm/builtin/async/ai-runtime/components/PoweredBy.js +27 -0
- package/lib/esm/builtin/async/ai-runtime/components/RuntimeProvider.js +16 -0
- package/lib/esm/builtin/async/ai-runtime/components/ScrollView.js +101 -0
- package/lib/esm/builtin/async/ai-runtime/components/SocialShare.js +93 -0
- package/lib/esm/builtin/async/ai-runtime/components/ThemeProvider.js +190 -0
- package/lib/esm/builtin/async/ai-runtime/components/collection/CollectionEditDialog.js +92 -0
- package/lib/esm/builtin/async/ai-runtime/components/collection/CollectionListView.js +197 -0
- package/lib/esm/builtin/async/ai-runtime/components/collection/CollectionView.js +122 -0
- package/lib/esm/builtin/async/ai-runtime/components/collection/DocumentListView.js +152 -0
- package/lib/esm/builtin/async/ai-runtime/components/collection/DocumentView.js +135 -0
- package/lib/esm/builtin/async/ai-runtime/components/common/ChatBot.js +98 -0
- package/lib/esm/builtin/async/ai-runtime/components/common/MessageMetadataRenderer.js +15 -0
- package/lib/esm/builtin/async/ai-runtime/components/common/MessageSuggestedQuestions.js +30 -0
- package/lib/esm/builtin/async/ai-runtime/components/common/index.js +3 -0
- package/lib/esm/builtin/async/ai-runtime/components/form/ParameterForm.js +60 -0
- package/lib/esm/builtin/async/ai-runtime/components/form/ParameterFormDialog.js +59 -0
- package/lib/esm/builtin/async/ai-runtime/components/form/ParameterFormFields.js +50 -0
- package/lib/esm/builtin/async/ai-runtime/components/form/QuestionField.js +38 -0
- package/lib/esm/builtin/async/ai-runtime/components/form/SettingButton.js +75 -0
- package/lib/esm/builtin/async/ai-runtime/components/lottie/index.js +8 -0
- package/lib/esm/builtin/async/ai-runtime/components/message/MessageActions.js +35 -0
- package/lib/esm/builtin/async/ai-runtime/components/message/MessageErrorView.js +24 -0
- package/lib/esm/builtin/async/ai-runtime/components/message/MessageItemView.js +100 -0
- package/lib/esm/builtin/async/ai-runtime/components/message/MessageListView.js +41 -0
- package/lib/esm/builtin/async/ai-runtime/components/message/ReferenceLinks.js +8 -0
- package/lib/esm/builtin/async/ai-runtime/components/parameters/LanguageField.js +53 -0
- package/lib/esm/builtin/async/ai-runtime/components/parameters/NumberField.js +19 -0
- package/lib/esm/builtin/async/ai-runtime/components/parameters/SelectField.js +22 -0
- package/lib/esm/builtin/async/ai-runtime/components/parameters/StringField.js +19 -0
- package/lib/esm/builtin/async/ai-runtime/components/parameters/index.js +31 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime-chat/InitialForm.js +103 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime-chat/RuntimeChatHeader.js +34 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime-chat/RuntimeChatSession.js +46 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime-chat/index.js +22 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime-form/RuntimeFormForms.js +114 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime-form/RuntimeFormHeader.js +19 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime-form/RuntimeFormResult.js +66 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime-form/RuntimeFormSubmit.js +25 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime-form/index.js +16 -0
- package/lib/esm/builtin/async/ai-runtime/components/session/CheckSession.js +59 -0
- package/lib/esm/builtin/async/ai-runtime/components/session/SessionListView.js +88 -0
- package/lib/esm/builtin/async/ai-runtime/constants.js +2 -0
- package/lib/esm/builtin/async/ai-runtime/error.js +6 -0
- package/lib/esm/builtin/async/ai-runtime/hooks/header.js +25 -0
- package/lib/esm/builtin/async/ai-runtime/hooks/navigate.js +32 -0
- package/lib/esm/builtin/async/ai-runtime/hooks/subscribe.js +31 -0
- package/lib/esm/builtin/async/ai-runtime/hooks/useAsync.js +29 -0
- package/lib/esm/builtin/async/ai-runtime/index.js +72 -0
- package/lib/esm/builtin/async/ai-runtime/locales/index.js +144 -0
- package/lib/esm/builtin/async/ai-runtime/state/assistant.js +54 -0
- package/lib/esm/builtin/async/ai-runtime/state/index.js +423 -0
- package/lib/esm/builtin/async/ai-runtime/state/loading.js +36 -0
- package/lib/esm/builtin/async/ai-runtime/state/session.js +209 -0
- package/lib/esm/builtin/async/ai-runtime/state/subscription.js +47 -0
- package/lib/esm/builtin/async/ai-runtime/utils.js +42 -0
- package/lib/esm/builtin/async/react-scroll-to-bottom.js +1 -1
- package/lib/esm/utils/builtin.js +1 -0
- package/lib/esm/utils/inject-global-components.js +2 -0
- package/lib/types/builtin/async/ai-runtime/api/assistant.d.ts +18 -0
- package/lib/types/builtin/async/ai-runtime/api/dataset.d.ts +39 -0
- package/lib/types/builtin/async/ai-runtime/api/message.d.ts +39 -0
- package/lib/types/builtin/async/ai-runtime/api/request.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/api/session.d.ts +54 -0
- package/lib/types/builtin/async/ai-runtime/api/subscription.d.ts +15 -0
- package/lib/types/builtin/async/ai-runtime/components/ActionButton.d.ts +11 -0
- package/lib/types/builtin/async/ai-runtime/components/GlobalLoading.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/components/LoadingButton.d.ts +3 -0
- package/lib/types/builtin/async/ai-runtime/components/LoadingListItemButton.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/components/MarkdownRenderer.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/components/MenuButton.d.ts +9 -0
- package/lib/types/builtin/async/ai-runtime/components/PoweredBy.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/components/RuntimeProvider.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/components/ScrollView.d.ts +61 -0
- package/lib/types/builtin/async/ai-runtime/components/SocialShare.d.ts +17 -0
- package/lib/types/builtin/async/ai-runtime/components/ThemeProvider.d.ts +6 -0
- 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 +13 -0
- package/lib/types/builtin/async/ai-runtime/components/common/MessageMetadataRenderer.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/components/common/MessageSuggestedQuestions.d.ts +7 -0
- package/lib/types/builtin/async/ai-runtime/components/common/index.d.ts +3 -0
- package/lib/types/builtin/async/ai-runtime/components/form/ParameterForm.d.ts +12 -0
- package/lib/types/builtin/async/ai-runtime/components/form/ParameterFormDialog.d.ts +28 -0
- package/lib/types/builtin/async/ai-runtime/components/form/ParameterFormFields.d.ts +11 -0
- package/lib/types/builtin/async/ai-runtime/components/form/QuestionField.d.ts +13 -0
- package/lib/types/builtin/async/ai-runtime/components/form/SettingButton.d.ts +6 -0
- package/lib/types/builtin/async/ai-runtime/components/lottie/index.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/components/message/MessageActions.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/components/message/MessageErrorView.d.ts +6 -0
- package/lib/types/builtin/async/ai-runtime/components/message/MessageItemView.d.ts +8 -0
- package/lib/types/builtin/async/ai-runtime/components/message/MessageListView.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/components/message/ReferenceLinks.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/components/parameters/LanguageField.d.ts +9 -0
- package/lib/types/builtin/async/ai-runtime/components/parameters/NumberField.d.ts +9 -0
- package/lib/types/builtin/async/ai-runtime/components/parameters/SelectField.d.ts +9 -0
- package/lib/types/builtin/async/ai-runtime/components/parameters/StringField.d.ts +9 -0
- package/lib/types/builtin/async/ai-runtime/components/parameters/index.d.ts +7 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime-chat/InitialForm.d.ts +10 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime-chat/RuntimeChatHeader.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime-chat/RuntimeChatSession.d.ts +6 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime-chat/index.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime-form/RuntimeFormForms.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime-form/RuntimeFormHeader.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime-form/RuntimeFormResult.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime-form/RuntimeFormSubmit.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime-form/index.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/components/session/CheckSession.d.ts +8 -0
- package/lib/types/builtin/async/ai-runtime/components/session/SessionListView.d.ts +0 -0
- package/lib/types/builtin/async/ai-runtime/constants.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/error.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/hooks/header.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/hooks/navigate.d.ts +25 -0
- package/lib/types/builtin/async/ai-runtime/hooks/subscribe.d.ts +6 -0
- package/lib/types/builtin/async/ai-runtime/hooks/useAsync.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/index.d.ts +17 -0
- package/lib/types/builtin/async/ai-runtime/locales/index.d.ts +126 -0
- package/lib/types/builtin/async/ai-runtime/state/assistant.d.ts +17 -0
- package/lib/types/builtin/async/ai-runtime/state/index.d.ts +0 -0
- package/lib/types/builtin/async/ai-runtime/state/loading.d.ts +10 -0
- package/lib/types/builtin/async/ai-runtime/state/session.d.ts +40 -0
- package/lib/types/builtin/async/ai-runtime/state/subscription.d.ts +15 -0
- package/lib/types/builtin/async/ai-runtime/utils.d.ts +20 -0
- package/lib/types/builtin/async/react-scroll-to-bottom.d.ts +3 -2
- package/lib/types/builtin/page/header.d.ts +1 -6
- package/lib/types/builtin/session.d.ts +11 -1
- package/lib/types/components/CustomComponentRenderer/state.d.ts +1 -116
- package/lib/types/utils/builtin.d.ts +1 -0
- package/package.json +14 -9
- package/tsconfig.json +5 -1
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type SizeProps = number | string;
|
|
3
|
+
export interface ChatBotProps {
|
|
4
|
+
assistantId: string;
|
|
5
|
+
size?: SizeProps;
|
|
6
|
+
bottom?: SizeProps;
|
|
7
|
+
right?: SizeProps;
|
|
8
|
+
popperHeight?: SizeProps;
|
|
9
|
+
popperWidth?: SizeProps;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export default function ChatBot({ assistantId, size, bottom, right, children, popperWidth, popperHeight, }: ChatBotProps): import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RuntimeOutputVariable, RuntimeOutputVariablesSchema } from '@blocklet/ai-runtime/types';
|
|
2
|
+
import { TypographyProps } from '@mui/material';
|
|
3
|
+
export default function MessageSuggestedQuestions({ dataSource, onClick, }: {
|
|
4
|
+
dataSource: RuntimeOutputVariablesSchema[RuntimeOutputVariable.suggestedQuestions];
|
|
5
|
+
onClick?: (item: NonNullable<typeof dataSource>[number]) => void;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export declare function MessageSuggestedQuestion({ ...props }: TypographyProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Assistant } from '../../api/assistant';
|
|
2
|
+
export default function ParameterForm({ sessionId, disabled, readOnly, onSubmit, defaultValues, hideSubmit, isSubmitting, assistant, submitButtonTitle, }: {
|
|
3
|
+
sessionId?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
readOnly?: boolean;
|
|
6
|
+
onSubmit?: (parameters: any) => any;
|
|
7
|
+
defaultValues?: any;
|
|
8
|
+
hideSubmit?: boolean;
|
|
9
|
+
isSubmitting?: boolean;
|
|
10
|
+
assistant: Assistant;
|
|
11
|
+
submitButtonTitle?: string;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export default function ParameterFormDialog({ assistantId, sessionId, DialogProps, }: {
|
|
2
|
+
assistantId: string;
|
|
3
|
+
sessionId: string;
|
|
4
|
+
DialogProps?: any;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const parameterFormDialogState: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<{
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
callback?: (() => any) | undefined;
|
|
9
|
+
open: () => any;
|
|
10
|
+
close: () => void;
|
|
11
|
+
}>, "setState"> & {
|
|
12
|
+
setState(nextStateOrUpdater: {
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
callback?: (() => any) | undefined;
|
|
15
|
+
open: () => any;
|
|
16
|
+
close: () => void;
|
|
17
|
+
} | Partial<{
|
|
18
|
+
isOpen: boolean;
|
|
19
|
+
callback?: (() => any) | undefined;
|
|
20
|
+
open: () => any;
|
|
21
|
+
close: () => void;
|
|
22
|
+
}> | ((state: import("immer").WritableDraft<{
|
|
23
|
+
isOpen: boolean;
|
|
24
|
+
callback?: (() => any) | undefined;
|
|
25
|
+
open: () => any;
|
|
26
|
+
close: () => void;
|
|
27
|
+
}>) => void), shouldReplace?: boolean | undefined): void;
|
|
28
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Parameter } from '@blocklet/ai-runtime/types';
|
|
2
|
+
import { StackProps } from '@mui/material';
|
|
3
|
+
import { UseFormReturn } from 'react-hook-form';
|
|
4
|
+
export declare const SUPPORTED_PARAMETER_TYPES: NonNullable<Parameter['type']>[];
|
|
5
|
+
export default function ParameterFormFields({ autoFocus, disabled, readOnly, parameters, form, ...props }: {
|
|
6
|
+
autoFocus?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
readOnly?: boolean;
|
|
9
|
+
parameters?: Parameter[];
|
|
10
|
+
form: UseFormReturn;
|
|
11
|
+
} & StackProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UseFormReturn } from 'react-hook-form';
|
|
2
|
+
import { Assistant } from '../../api/assistant';
|
|
3
|
+
export default function QuestionField({ sessionId, assistant, showSettingButton, form, isSubmitting, autoFocus, readOnly, disabled, submitButtonTitle, }: {
|
|
4
|
+
sessionId?: string;
|
|
5
|
+
assistant: Assistant;
|
|
6
|
+
readOnly?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
form: UseFormReturn;
|
|
9
|
+
submitButtonTitle?: string;
|
|
10
|
+
autoFocus?: boolean;
|
|
11
|
+
isSubmitting?: boolean;
|
|
12
|
+
showSettingButton?: boolean;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ButtonProps } from '@mui/material';
|
|
2
|
+
import { UseFormReturn } from 'react-hook-form';
|
|
3
|
+
export default function SettingButton({ sessionId, form, ...props }: {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
form: UseFormReturn<any>;
|
|
6
|
+
} & Omit<ButtonProps, 'form'>): import("react/jsx-runtime").JSX.Element[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Assistant } from '../../api/assistant';
|
|
2
|
+
import { MessageItem } from '../../state/session';
|
|
3
|
+
export default function MessageItemView({ assistantId, assistant, message, hideAvatar, }: {
|
|
4
|
+
assistantId: string;
|
|
5
|
+
assistant: Assistant;
|
|
6
|
+
message: MessageItem;
|
|
7
|
+
hideAvatar?: boolean;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SelectParameter } from '@blocklet/ai-runtime/types';
|
|
3
|
+
import { TextFieldProps } from '@mui/material';
|
|
4
|
+
declare const LanguageField: import("react").ForwardRefExoticComponent<Omit<{
|
|
5
|
+
readOnly?: boolean | undefined;
|
|
6
|
+
parameter?: SelectParameter | undefined;
|
|
7
|
+
onChange: (value: string | undefined) => void;
|
|
8
|
+
} & Omit<TextFieldProps, "onChange">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export default LanguageField;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NumberParameter } from '@blocklet/ai-runtime/types';
|
|
3
|
+
import { TextFieldProps } from '@mui/material';
|
|
4
|
+
declare const NumberField: import("react").ForwardRefExoticComponent<Omit<{
|
|
5
|
+
readOnly?: boolean | undefined;
|
|
6
|
+
parameter?: NumberParameter | undefined;
|
|
7
|
+
onChange: (value: number) => void;
|
|
8
|
+
} & Omit<TextFieldProps, "onChange">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export default NumberField;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SelectParameter } from '@blocklet/ai-runtime/types';
|
|
3
|
+
import { TextFieldProps } from '@mui/material';
|
|
4
|
+
declare const SelectField: import("react").ForwardRefExoticComponent<Omit<{
|
|
5
|
+
readOnly?: boolean | undefined;
|
|
6
|
+
parameter?: SelectParameter | undefined;
|
|
7
|
+
onChange: (value: string) => void;
|
|
8
|
+
} & Omit<TextFieldProps, "onChange">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export default SelectField;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { StringParameter } from '@blocklet/ai-runtime/types';
|
|
3
|
+
import { TextFieldProps } from '@mui/material';
|
|
4
|
+
declare const StringField: import("react").ForwardRefExoticComponent<Omit<{
|
|
5
|
+
readOnly?: boolean | undefined;
|
|
6
|
+
parameter?: StringParameter | undefined;
|
|
7
|
+
onChange: (value: string) => void;
|
|
8
|
+
} & Omit<TextFieldProps, "onChange">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export default StringField;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Parameter } from '@blocklet/ai-runtime/types';
|
|
2
|
+
import { TextFieldProps } from '@mui/material';
|
|
3
|
+
export default function ParameterField({ parameter, ...props }: {
|
|
4
|
+
readOnly?: boolean;
|
|
5
|
+
parameter: Parameter;
|
|
6
|
+
onChange: (value: string | number | undefined) => void;
|
|
7
|
+
} & Omit<TextFieldProps, 'onChange'>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StackProps } from '@mui/material';
|
|
2
|
+
import { Assistant } from '../../api/assistant';
|
|
3
|
+
import { PageState } from '../../hooks/navigate';
|
|
4
|
+
export default function InitialForm({ page }: {
|
|
5
|
+
page: PageState;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export declare function EntryListView({ assistant, onEntryClick, ...props }: {
|
|
8
|
+
assistant: Assistant;
|
|
9
|
+
onEntryClick?: (entry: NonNullable<Assistant['entries']>[number]) => void;
|
|
10
|
+
} & StackProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PageState } from '../../hooks/navigate';
|
|
3
|
+
export default function CheckSession({ cacheId, page, autoCreateSession, children, }: {
|
|
4
|
+
cacheId?: string;
|
|
5
|
+
page: PageState;
|
|
6
|
+
autoCreateSession?: boolean;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}): ReactNode;
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NavigateOptions } from 'react-router-dom';
|
|
2
|
+
export declare function useNavigateTo(): (query: {
|
|
3
|
+
[key: string]: string | number | undefined;
|
|
4
|
+
}) => string;
|
|
5
|
+
export declare function useNavigateWithQuery(): RuntimeNavigate;
|
|
6
|
+
export type Page = 'assistant' | 'session';
|
|
7
|
+
export type CurrentPage = {
|
|
8
|
+
page: 'assistant';
|
|
9
|
+
assistantId: string;
|
|
10
|
+
sessionId?: string;
|
|
11
|
+
} | {
|
|
12
|
+
page: 'session';
|
|
13
|
+
assistantId: string;
|
|
14
|
+
sessionId: string;
|
|
15
|
+
};
|
|
16
|
+
export type PageState = {
|
|
17
|
+
navigate: RuntimeNavigate;
|
|
18
|
+
} & CurrentPage;
|
|
19
|
+
export interface RuntimeNavigate {
|
|
20
|
+
(page: Omit<CurrentPage, 'navigate'>, options?: NavigateOptions): void;
|
|
21
|
+
}
|
|
22
|
+
export declare function useCurrentPage(): PageState;
|
|
23
|
+
export declare function useCurrentPage<P extends Page>(page: P): PageState & {
|
|
24
|
+
page: P;
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useAsync<T>(fn: () => T | Promise<T>, keys: (string | number | undefined | null)[]): T;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Assistant } from './api/assistant';
|
|
2
|
+
import type { ChatBotProps } from './components/common/ChatBot';
|
|
3
|
+
export declare function getServerSideProps(): Promise<{
|
|
4
|
+
props: {
|
|
5
|
+
preload: {
|
|
6
|
+
assistantId: string;
|
|
7
|
+
assistant: Assistant | undefined;
|
|
8
|
+
} | undefined;
|
|
9
|
+
};
|
|
10
|
+
}>;
|
|
11
|
+
export default function App(props: {
|
|
12
|
+
preload?: {
|
|
13
|
+
assistantId: string;
|
|
14
|
+
assistant: Assistant;
|
|
15
|
+
};
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function ChatBot(props: ChatBotProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
export declare const translations: {
|
|
2
|
+
en: {
|
|
3
|
+
socialShare: {
|
|
4
|
+
shareToX: string;
|
|
5
|
+
shareToTelegram: string;
|
|
6
|
+
shareToReddit: string;
|
|
7
|
+
shareToWeibo: string;
|
|
8
|
+
shareToFacebook: string;
|
|
9
|
+
shareToLinkedin: string;
|
|
10
|
+
copyLink: string;
|
|
11
|
+
};
|
|
12
|
+
questionPlaceholder: string;
|
|
13
|
+
parameters: string;
|
|
14
|
+
parametersTitle: string;
|
|
15
|
+
parametersSetting: string;
|
|
16
|
+
clearSession: string;
|
|
17
|
+
generate: string;
|
|
18
|
+
startChat: string;
|
|
19
|
+
collections: string;
|
|
20
|
+
collection: string;
|
|
21
|
+
collectionName: string;
|
|
22
|
+
document: string;
|
|
23
|
+
rename: string;
|
|
24
|
+
delete: string;
|
|
25
|
+
confirmDelete: string;
|
|
26
|
+
noData: string;
|
|
27
|
+
createObject: string;
|
|
28
|
+
title: string;
|
|
29
|
+
titlePlaceholder: string;
|
|
30
|
+
content: string;
|
|
31
|
+
contentPlaceholder: string;
|
|
32
|
+
cancel: string;
|
|
33
|
+
save: string;
|
|
34
|
+
edit: string;
|
|
35
|
+
chat: string;
|
|
36
|
+
subscribeNow: string;
|
|
37
|
+
requireNewSubscription: string;
|
|
38
|
+
requireNewSubscriptionFooter: string;
|
|
39
|
+
thanksForSubscription: string;
|
|
40
|
+
clickTheButton: string;
|
|
41
|
+
cleanSessionTip: string;
|
|
42
|
+
poweredBy: string;
|
|
43
|
+
selectPromptToStart: string;
|
|
44
|
+
history: string;
|
|
45
|
+
unnamed: string;
|
|
46
|
+
newObject: string;
|
|
47
|
+
editObject: string;
|
|
48
|
+
name: string;
|
|
49
|
+
description: string;
|
|
50
|
+
create: string;
|
|
51
|
+
back: string;
|
|
52
|
+
unauthorized: string;
|
|
53
|
+
unauthorizedDescription: string;
|
|
54
|
+
login: string;
|
|
55
|
+
copy: string;
|
|
56
|
+
copied: string;
|
|
57
|
+
copyToClipboard: string;
|
|
58
|
+
saveToNoteTip: string;
|
|
59
|
+
saveToNote: string;
|
|
60
|
+
savedToNote: string;
|
|
61
|
+
uploadFile: string;
|
|
62
|
+
submit: string;
|
|
63
|
+
};
|
|
64
|
+
zh: {
|
|
65
|
+
socialShare: {
|
|
66
|
+
shareToX: string;
|
|
67
|
+
shareToTelegram: string;
|
|
68
|
+
shareToReddit: string;
|
|
69
|
+
shareToWeibo: string;
|
|
70
|
+
shareToFacebook: string;
|
|
71
|
+
shareToLinkedin: string;
|
|
72
|
+
copyLink: string;
|
|
73
|
+
};
|
|
74
|
+
questionPlaceholder: string;
|
|
75
|
+
parameters: string;
|
|
76
|
+
parametersTitle: string;
|
|
77
|
+
parametersSetting: string;
|
|
78
|
+
clearSession: string;
|
|
79
|
+
generate: string;
|
|
80
|
+
startChat: string;
|
|
81
|
+
collections: string;
|
|
82
|
+
collection: string;
|
|
83
|
+
collectionName: string;
|
|
84
|
+
document: string;
|
|
85
|
+
rename: string;
|
|
86
|
+
delete: string;
|
|
87
|
+
confirmDelete: string;
|
|
88
|
+
noData: string;
|
|
89
|
+
createObject: string;
|
|
90
|
+
title: string;
|
|
91
|
+
titlePlaceholder: string;
|
|
92
|
+
content: string;
|
|
93
|
+
contentPlaceholder: string;
|
|
94
|
+
cancel: string;
|
|
95
|
+
save: string;
|
|
96
|
+
edit: string;
|
|
97
|
+
chat: string;
|
|
98
|
+
subscribeNow: string;
|
|
99
|
+
requireNewSubscription: string;
|
|
100
|
+
requireNewSubscriptionFooter: string;
|
|
101
|
+
thanksForSubscription: string;
|
|
102
|
+
clickTheButton: string;
|
|
103
|
+
cleanSessionTip: string;
|
|
104
|
+
poweredBy: string;
|
|
105
|
+
selectPromptToStart: string;
|
|
106
|
+
history: string;
|
|
107
|
+
unnamed: string;
|
|
108
|
+
newObject: string;
|
|
109
|
+
editObject: string;
|
|
110
|
+
name: string;
|
|
111
|
+
description: string;
|
|
112
|
+
create: string;
|
|
113
|
+
back: string;
|
|
114
|
+
unauthorized: string;
|
|
115
|
+
unauthorizedDescription: string;
|
|
116
|
+
login: string;
|
|
117
|
+
copy: string;
|
|
118
|
+
copied: string;
|
|
119
|
+
copyToClipboard: string;
|
|
120
|
+
saveToNoteTip: string;
|
|
121
|
+
saveToNote: string;
|
|
122
|
+
savedToNote: string;
|
|
123
|
+
uploadFile: string;
|
|
124
|
+
submit: string;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StoreApi, UseBoundStore } from 'zustand';
|
|
2
|
+
import { Assistant } from '../api/assistant';
|
|
3
|
+
import { Subscription } from '../api/subscription';
|
|
4
|
+
export interface AssistantState {
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
assistant?: Assistant;
|
|
7
|
+
error?: Error;
|
|
8
|
+
subscription?: Subscription;
|
|
9
|
+
load: () => Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare const createAssistantState: ({ assistantId, assistant }: {
|
|
12
|
+
assistantId: string;
|
|
13
|
+
assistant?: Assistant;
|
|
14
|
+
}) => UseBoundStore<StoreApi<AssistantState>>;
|
|
15
|
+
export declare function useAssistantState({ assistantId }: {
|
|
16
|
+
assistantId: string;
|
|
17
|
+
}): readonly [Assistant, AssistantState];
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface GlobalLoadingState {
|
|
2
|
+
loading: boolean;
|
|
3
|
+
count: number;
|
|
4
|
+
run: <T>(fn: Promise<T> | (() => Promise<T>)) => Promise<T>;
|
|
5
|
+
start: () => void;
|
|
6
|
+
end: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const globalLoadingState: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<GlobalLoadingState>, "setState"> & {
|
|
9
|
+
setState(nextStateOrUpdater: GlobalLoadingState | Partial<GlobalLoadingState> | ((state: import("immer").WritableDraft<GlobalLoadingState>) => void), shouldReplace?: boolean | undefined): void;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { RuntimeOutputVariablesSchema } from '@blocklet/ai-runtime/types';
|
|
2
|
+
import { StoreApi, UseBoundStore } from 'zustand';
|
|
3
|
+
import { Message } from '../api/message';
|
|
4
|
+
import { Session } from '../api/session';
|
|
5
|
+
export interface MessageItem extends Omit<Message, 'id'> {
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SessionState {
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
running?: boolean;
|
|
11
|
+
session?: Session;
|
|
12
|
+
messages?: MessageItem[];
|
|
13
|
+
error?: Error;
|
|
14
|
+
metadata?: RuntimeOutputVariablesSchema;
|
|
15
|
+
updateSession: ({ parameters }: {
|
|
16
|
+
parameters: any;
|
|
17
|
+
}) => Promise<void>;
|
|
18
|
+
clearSession: ({ sessionId }: {
|
|
19
|
+
sessionId: string;
|
|
20
|
+
}) => Promise<void>;
|
|
21
|
+
load: () => Promise<void>;
|
|
22
|
+
execute: (options: {
|
|
23
|
+
assistantId: string;
|
|
24
|
+
parameters: any;
|
|
25
|
+
onResponseStart?: () => void;
|
|
26
|
+
includeSessionParameters?: boolean;
|
|
27
|
+
}) => Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
export declare const createSessionState: ({ sessionId, session }: {
|
|
30
|
+
sessionId: string;
|
|
31
|
+
session?: Session;
|
|
32
|
+
}) => UseBoundStore<StoreApi<SessionState>>;
|
|
33
|
+
export declare function useSessionState(options: {
|
|
34
|
+
sessionId: string;
|
|
35
|
+
required: true;
|
|
36
|
+
}): [Session, SessionState];
|
|
37
|
+
export declare function useSessionState(options: {
|
|
38
|
+
sessionId: string;
|
|
39
|
+
required?: false;
|
|
40
|
+
}): [Session | undefined, SessionState];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StoreApi, UseBoundStore } from 'zustand';
|
|
2
|
+
import { Release, Subscription } from '../api/subscription';
|
|
3
|
+
export interface SubscriptionState {
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
loaded?: boolean;
|
|
6
|
+
subscription?: Subscription;
|
|
7
|
+
release?: Release;
|
|
8
|
+
load: () => Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare const createAssistantState: ({ aid }: {
|
|
11
|
+
aid: string;
|
|
12
|
+
}) => UseBoundStore<StoreApi<SubscriptionState>>;
|
|
13
|
+
export declare function useSubscriptionState({ aid }: {
|
|
14
|
+
aid: string;
|
|
15
|
+
}): readonly [Subscription | undefined, SubscriptionState];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SxProps, Theme } from '@mui/material';
|
|
2
|
+
import type { SystemStyleObject } from '@mui/system';
|
|
3
|
+
export interface Identity {
|
|
4
|
+
projectId: string;
|
|
5
|
+
projectRef: string;
|
|
6
|
+
assistantId: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function parseIdentity(aid: string, options: {
|
|
9
|
+
rejectWhenError: true;
|
|
10
|
+
}): Identity;
|
|
11
|
+
export declare function parseIdentity(aid: string, options?: {
|
|
12
|
+
rejectWhenError?: false;
|
|
13
|
+
}): Identity | undefined;
|
|
14
|
+
export declare function stringifyIdentity({ projectId, projectRef, assistantId, }: {
|
|
15
|
+
projectId: string;
|
|
16
|
+
projectRef: string;
|
|
17
|
+
assistantId: string;
|
|
18
|
+
}): string;
|
|
19
|
+
export declare function deepMerge(target: Record<any, any>, source: Record<any, any>): void;
|
|
20
|
+
export declare const mergeSx: (initial: SystemStyleObject<Theme>, sx?: SxProps<Theme>) => any[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare const _default: () => Promise<{
|
|
3
|
+
Composer: typeof import("react-scroll-to-bottom").default;
|
|
3
4
|
useInternalContext: any;
|
|
4
5
|
default(props: import("react").PropsWithChildren<{
|
|
5
6
|
checkInterval?: number | undefined;
|
|
@@ -8,7 +9,7 @@ declare const _default: () => Promise<{
|
|
|
8
9
|
debug?: boolean | undefined;
|
|
9
10
|
followButtonClassName?: string | undefined;
|
|
10
11
|
initialScrollBehavior?: "auto" | "smooth" | undefined;
|
|
11
|
-
mode?: "
|
|
12
|
+
mode?: "bottom" | "top" | undefined;
|
|
12
13
|
nonce?: string | undefined;
|
|
13
14
|
scroller?: ((values: {
|
|
14
15
|
maxValue: number;
|
|
@@ -33,7 +34,7 @@ declare const _default: () => Promise<{
|
|
|
33
34
|
useAtEnd(): [boolean];
|
|
34
35
|
useAtStart(): [boolean];
|
|
35
36
|
useAtTop(): [boolean];
|
|
36
|
-
useMode(): ["
|
|
37
|
+
useMode(): ["bottom" | "top"];
|
|
37
38
|
useSticky(): [boolean];
|
|
38
39
|
FunctionContext: import("react").Context<{
|
|
39
40
|
scrollTo: (scrollTop: number | "100%") => void;
|