@assistant-ui/react-native 0.1.0 → 0.1.2
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/LICENSE +21 -0
- package/README.md +2 -6
- package/dist/client/index.d.ts +5 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +7 -0
- package/dist/client/index.js.map +1 -0
- package/dist/context/AssistantContext.d.ts.map +1 -1
- package/dist/context/AssistantContext.js +4 -9
- package/dist/context/AssistantContext.js.map +1 -1
- package/dist/context/providers/AttachmentByIndexProvider.d.ts +2 -0
- package/dist/context/providers/AttachmentByIndexProvider.d.ts.map +1 -0
- package/dist/context/providers/AttachmentByIndexProvider.js +2 -0
- package/dist/context/providers/AttachmentByIndexProvider.js.map +1 -0
- package/dist/context/providers/RuntimeAdapterProvider.d.ts +2 -1
- package/dist/context/providers/RuntimeAdapterProvider.d.ts.map +1 -1
- package/dist/context/providers/RuntimeAdapterProvider.js.map +1 -1
- package/dist/context/providers/ThreadListItemRuntimeProvider.d.ts +1 -5
- package/dist/context/providers/ThreadListItemRuntimeProvider.d.ts.map +1 -1
- package/dist/context/providers/ThreadListItemRuntimeProvider.js +1 -9
- package/dist/context/providers/ThreadListItemRuntimeProvider.js.map +1 -1
- package/dist/index.d.ts +15 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -6
- package/dist/index.js.map +1 -1
- package/dist/model-context/index.d.ts +9 -0
- package/dist/model-context/index.d.ts.map +1 -0
- package/dist/model-context/index.js +7 -0
- package/dist/model-context/index.js.map +1 -0
- package/dist/primitive-hooks/index.d.ts +1 -0
- package/dist/primitive-hooks/index.d.ts.map +1 -1
- package/dist/primitive-hooks/index.js +1 -0
- package/dist/primitive-hooks/index.js.map +1 -1
- package/dist/primitive-hooks/useComposerAddAttachment.d.ts +5 -0
- package/dist/primitive-hooks/useComposerAddAttachment.d.ts.map +1 -0
- package/dist/primitive-hooks/useComposerAddAttachment.js +10 -0
- package/dist/primitive-hooks/useComposerAddAttachment.js.map +1 -0
- package/dist/primitive-hooks/useThreadIsRunning.js +2 -2
- package/dist/primitive-hooks/useThreadIsRunning.js.map +1 -1
- package/dist/primitives/attachment/AttachmentName.d.ts +5 -0
- package/dist/primitives/attachment/AttachmentName.d.ts.map +1 -0
- package/dist/primitives/attachment/AttachmentName.js +8 -0
- package/dist/primitives/attachment/AttachmentName.js.map +1 -0
- package/dist/primitives/attachment/AttachmentRemove.d.ts +7 -0
- package/dist/primitives/attachment/AttachmentRemove.d.ts.map +1 -0
- package/dist/primitives/attachment/AttachmentRemove.js +12 -0
- package/dist/primitives/attachment/AttachmentRemove.js.map +1 -0
- package/dist/primitives/attachment/AttachmentRoot.d.ts +7 -0
- package/dist/primitives/attachment/AttachmentRoot.d.ts.map +1 -0
- package/dist/primitives/attachment/AttachmentRoot.js +6 -0
- package/dist/primitives/attachment/AttachmentRoot.js.map +1 -0
- package/dist/primitives/attachment/AttachmentThumb.d.ts +5 -0
- package/dist/primitives/attachment/AttachmentThumb.d.ts.map +1 -0
- package/dist/primitives/attachment/AttachmentThumb.js +11 -0
- package/dist/primitives/attachment/AttachmentThumb.js.map +1 -0
- package/dist/primitives/attachment/index.d.ts +5 -0
- package/dist/primitives/attachment/index.d.ts.map +1 -0
- package/dist/primitives/attachment/index.js +5 -0
- package/dist/primitives/attachment/index.js.map +1 -0
- package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.d.ts +7 -0
- package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.d.ts.map +1 -0
- package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.js +13 -0
- package/dist/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.js.map +1 -0
- package/dist/primitives/chainOfThought/ChainOfThoughtRoot.d.ts +7 -0
- package/dist/primitives/chainOfThought/ChainOfThoughtRoot.d.ts.map +1 -0
- package/dist/primitives/chainOfThought/ChainOfThoughtRoot.js +6 -0
- package/dist/primitives/chainOfThought/ChainOfThoughtRoot.js.map +1 -0
- package/dist/primitives/chainOfThought/index.d.ts +4 -0
- package/dist/primitives/chainOfThought/index.d.ts.map +1 -0
- package/dist/primitives/chainOfThought/index.js +4 -0
- package/dist/primitives/chainOfThought/index.js.map +1 -0
- package/dist/primitives/composer/ComposerAddAttachment.d.ts +14 -0
- package/dist/primitives/composer/ComposerAddAttachment.d.ts.map +1 -0
- package/dist/primitives/composer/ComposerAddAttachment.js +17 -0
- package/dist/primitives/composer/ComposerAddAttachment.js.map +1 -0
- package/dist/primitives/composer/ComposerAttachments.d.ts +18 -0
- package/dist/primitives/composer/ComposerAttachments.d.ts.map +1 -0
- package/dist/primitives/composer/ComposerAttachments.js +4 -0
- package/dist/primitives/composer/ComposerAttachments.js.map +1 -0
- package/dist/primitives/composer/ComposerIf.d.ts +2 -0
- package/dist/primitives/composer/ComposerIf.d.ts.map +1 -0
- package/dist/primitives/composer/ComposerIf.js +2 -0
- package/dist/primitives/composer/ComposerIf.js.map +1 -0
- package/dist/primitives/composer/index.d.ts +3 -0
- package/dist/primitives/composer/index.d.ts.map +1 -1
- package/dist/primitives/composer/index.js +3 -0
- package/dist/primitives/composer/index.js.map +1 -1
- package/dist/primitives/message/MessageAttachments.d.ts +12 -0
- package/dist/primitives/message/MessageAttachments.d.ts.map +1 -0
- package/dist/primitives/message/MessageAttachments.js +4 -0
- package/dist/primitives/message/MessageAttachments.js.map +1 -0
- package/dist/primitives/message/MessageContent.d.ts.map +1 -1
- package/dist/primitives/message/MessageContent.js +34 -9
- package/dist/primitives/message/MessageContent.js.map +1 -1
- package/dist/primitives/message/MessageIf.js +2 -2
- package/dist/primitives/message/MessageIf.js.map +1 -1
- package/dist/primitives/message/MessageParts.d.ts +11 -0
- package/dist/primitives/message/MessageParts.d.ts.map +1 -0
- package/dist/primitives/message/MessageParts.js +37 -0
- package/dist/primitives/message/MessageParts.js.map +1 -0
- package/dist/primitives/message/index.d.ts +2 -0
- package/dist/primitives/message/index.d.ts.map +1 -1
- package/dist/primitives/message/index.js +2 -0
- package/dist/primitives/message/index.js.map +1 -1
- package/dist/primitives/suggestion/SuggestionDescription.d.ts +7 -0
- package/dist/primitives/suggestion/SuggestionDescription.d.ts.map +1 -0
- package/dist/primitives/suggestion/SuggestionDescription.js +8 -0
- package/dist/primitives/suggestion/SuggestionDescription.js.map +1 -0
- package/dist/primitives/suggestion/SuggestionTitle.d.ts +7 -0
- package/dist/primitives/suggestion/SuggestionTitle.d.ts.map +1 -0
- package/dist/primitives/suggestion/SuggestionTitle.js +8 -0
- package/dist/primitives/suggestion/SuggestionTitle.js.map +1 -0
- package/dist/primitives/suggestion/SuggestionTrigger.d.ts +18 -0
- package/dist/primitives/suggestion/SuggestionTrigger.d.ts.map +1 -0
- package/dist/primitives/suggestion/SuggestionTrigger.js +35 -0
- package/dist/primitives/suggestion/SuggestionTrigger.js.map +1 -0
- package/dist/primitives/suggestion/index.d.ts +4 -0
- package/dist/primitives/suggestion/index.d.ts.map +1 -0
- package/dist/primitives/suggestion/index.js +4 -0
- package/dist/primitives/suggestion/index.js.map +1 -0
- package/dist/primitives/thread/ThreadIf.js +2 -2
- package/dist/primitives/thread/ThreadIf.js.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.d.ts +20 -0
- package/dist/primitives/thread/ThreadSuggestion.d.ts.map +1 -0
- package/dist/primitives/thread/ThreadSuggestion.js +34 -0
- package/dist/primitives/thread/ThreadSuggestion.js.map +1 -0
- package/dist/primitives/thread/index.d.ts +3 -0
- package/dist/primitives/thread/index.d.ts.map +1 -1
- package/dist/primitives/thread/index.js +3 -0
- package/dist/primitives/thread/index.js.map +1 -1
- package/dist/primitives/threadList/ThreadListItems.js +2 -2
- package/dist/primitives/threadList/ThreadListItems.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts +7 -0
- package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemArchive.js +12 -0
- package/dist/primitives/threadListItem/ThreadListItemArchive.js.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts +7 -0
- package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemDelete.js +12 -0
- package/dist/primitives/threadListItem/ThreadListItemDelete.js.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts +7 -0
- package/dist/primitives/threadListItem/ThreadListItemRoot.d.ts.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemRoot.js +6 -0
- package/dist/primitives/threadListItem/ThreadListItemRoot.js.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts +7 -0
- package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemTrigger.js +12 -0
- package/dist/primitives/threadListItem/ThreadListItemTrigger.js.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts +7 -0
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.js +12 -0
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.js.map +1 -0
- package/dist/primitives/threadListItem/index.d.ts +7 -0
- package/dist/primitives/threadListItem/index.d.ts.map +1 -0
- package/dist/primitives/threadListItem/index.js +7 -0
- package/dist/primitives/threadListItem/index.js.map +1 -0
- package/dist/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts +2 -1
- package/dist/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/RemoteThreadListThreadListRuntimeCore.js +8 -2
- package/dist/runtimes/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/runtimes/useLocalRuntime.d.ts.map +1 -1
- package/dist/runtimes/useLocalRuntime.js +7 -2
- package/dist/runtimes/useLocalRuntime.js.map +1 -1
- package/dist/runtimes/useRemoteThreadListRuntime.d.ts.map +1 -1
- package/dist/runtimes/useRemoteThreadListRuntime.js +14 -4
- package/dist/runtimes/useRemoteThreadListRuntime.js.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/scopes/index.d.ts +3 -0
- package/dist/types/scopes/index.d.ts.map +1 -0
- package/dist/types/scopes/index.js +2 -0
- package/dist/types/scopes/index.js.map +1 -0
- package/package.json +14 -14
- package/src/client/index.ts +7 -0
- package/src/context/AssistantContext.tsx +6 -19
- package/src/context/providers/AttachmentByIndexProvider.tsx +4 -0
- package/src/context/providers/RuntimeAdapterProvider.tsx +2 -0
- package/src/context/providers/ThreadListItemRuntimeProvider.tsx +1 -16
- package/src/index.ts +52 -17
- package/src/model-context/index.ts +44 -0
- package/src/primitive-hooks/index.ts +1 -0
- package/src/primitive-hooks/useComposerAddAttachment.ts +16 -0
- package/src/primitive-hooks/useThreadIsRunning.ts +2 -2
- package/src/primitives/attachment/AttachmentName.tsx +10 -0
- package/src/primitives/attachment/AttachmentRemove.tsx +25 -0
- package/src/primitives/attachment/AttachmentRoot.tsx +13 -0
- package/src/primitives/attachment/AttachmentThumb.tsx +13 -0
- package/src/primitives/attachment/index.ts +7 -0
- package/src/primitives/chainOfThought/ChainOfThoughtAccordionTrigger.tsx +28 -0
- package/src/primitives/chainOfThought/ChainOfThoughtRoot.tsx +13 -0
- package/src/primitives/chainOfThought/index.ts +9 -0
- package/src/primitives/composer/ComposerAddAttachment.tsx +30 -0
- package/src/primitives/composer/ComposerAttachments.tsx +25 -0
- package/src/primitives/composer/ComposerIf.tsx +1 -0
- package/src/primitives/composer/index.ts +9 -0
- package/src/primitives/message/MessageAttachments.tsx +18 -0
- package/src/primitives/message/MessageContent.tsx +82 -7
- package/src/primitives/message/MessageIf.tsx +2 -2
- package/src/primitives/message/MessageParts.tsx +60 -0
- package/src/primitives/message/index.ts +8 -0
- package/src/primitives/suggestion/SuggestionDescription.tsx +16 -0
- package/src/primitives/suggestion/SuggestionTitle.tsx +16 -0
- package/src/primitives/suggestion/SuggestionTrigger.tsx +64 -0
- package/src/primitives/suggestion/index.ts +12 -0
- package/src/primitives/thread/ThreadIf.tsx +2 -2
- package/src/primitives/thread/ThreadSuggestion.tsx +66 -0
- package/src/primitives/thread/index.ts +12 -0
- package/src/primitives/threadList/ThreadListItems.tsx +2 -2
- package/src/primitives/threadListItem/ThreadListItemArchive.tsx +24 -0
- package/src/primitives/threadListItem/ThreadListItemDelete.tsx +24 -0
- package/src/primitives/threadListItem/ThreadListItemRoot.tsx +13 -0
- package/src/primitives/threadListItem/ThreadListItemTrigger.tsx +24 -0
- package/src/primitives/threadListItem/ThreadListItemUnarchive.tsx +24 -0
- package/src/primitives/threadListItem/index.ts +21 -0
- package/src/runtimes/RemoteThreadListThreadListRuntimeCore.tsx +14 -4
- package/src/runtimes/useLocalRuntime.ts +7 -2
- package/src/runtimes/useRemoteThreadListRuntime.ts +20 -4
- package/src/types/index.ts +23 -0
- package/src/types/scopes/index.ts +59 -0
- package/dist/hooks/index.d.ts +0 -6
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js +0 -6
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/useComposer.d.ts +0 -4
- package/dist/hooks/useComposer.d.ts.map +0 -1
- package/dist/hooks/useComposer.js +0 -5
- package/dist/hooks/useComposer.js.map +0 -1
- package/dist/hooks/useContentPart.d.ts +0 -2
- package/dist/hooks/useContentPart.d.ts.map +0 -1
- package/dist/hooks/useContentPart.js +0 -5
- package/dist/hooks/useContentPart.js.map +0 -1
- package/dist/hooks/useMessage.d.ts +0 -4
- package/dist/hooks/useMessage.d.ts.map +0 -1
- package/dist/hooks/useMessage.js +0 -5
- package/dist/hooks/useMessage.js.map +0 -1
- package/dist/hooks/useThread.d.ts +0 -4
- package/dist/hooks/useThread.d.ts.map +0 -1
- package/dist/hooks/useThread.js +0 -5
- package/dist/hooks/useThread.js.map +0 -1
- package/dist/hooks/useThreadList.d.ts +0 -4
- package/dist/hooks/useThreadList.d.ts.map +0 -1
- package/dist/hooks/useThreadList.js +0 -5
- package/dist/hooks/useThreadList.js.map +0 -1
- package/dist/runtimes/runtime-adapter.d.ts +0 -3
- package/dist/runtimes/runtime-adapter.d.ts.map +0 -1
- package/dist/runtimes/runtime-adapter.js +0 -44
- package/dist/runtimes/runtime-adapter.js.map +0 -1
- package/src/hooks/index.ts +0 -5
- package/src/hooks/useComposer.ts +0 -14
- package/src/hooks/useContentPart.ts +0 -5
- package/src/hooks/useMessage.ts +0 -14
- package/src/hooks/useThread.ts +0 -14
- package/src/hooks/useThreadList.ts +0 -14
- package/src/runtimes/runtime-adapter.ts +0 -63
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
import { Text } from "react-native";
|
|
3
|
+
import {
|
|
4
|
+
MessagePrimitiveParts as MessagePrimitivePartsBase,
|
|
5
|
+
MessagePartComponent as MessagePartComponentBase,
|
|
6
|
+
MessagePrimitivePartByIndex as MessagePrimitivePartByIndexBase,
|
|
7
|
+
messagePartsDefaultComponents,
|
|
8
|
+
} from "@assistant-ui/core/react";
|
|
9
|
+
|
|
10
|
+
const rnDefaultComponents = {
|
|
11
|
+
...messagePartsDefaultComponents,
|
|
12
|
+
Text: ({ text }: { text: string }) => <Text>{text}</Text>,
|
|
13
|
+
} satisfies MessagePrimitiveParts.Props["components"];
|
|
14
|
+
|
|
15
|
+
export namespace MessagePrimitiveParts {
|
|
16
|
+
export type Props = MessagePrimitivePartsBase.Props;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Renders the parts of a message with React Native-specific default components.
|
|
21
|
+
*/
|
|
22
|
+
export const MessagePrimitiveParts: FC<MessagePrimitiveParts.Props> = ({
|
|
23
|
+
components,
|
|
24
|
+
...rest
|
|
25
|
+
}) => {
|
|
26
|
+
const merged = components
|
|
27
|
+
? {
|
|
28
|
+
Text: components.Text ?? rnDefaultComponents.Text,
|
|
29
|
+
Image: components.Image ?? messagePartsDefaultComponents.Image,
|
|
30
|
+
Reasoning:
|
|
31
|
+
components.Reasoning ?? messagePartsDefaultComponents.Reasoning,
|
|
32
|
+
Source: components.Source ?? messagePartsDefaultComponents.Source,
|
|
33
|
+
File: components.File ?? messagePartsDefaultComponents.File,
|
|
34
|
+
Unstable_Audio:
|
|
35
|
+
components.Unstable_Audio ??
|
|
36
|
+
messagePartsDefaultComponents.Unstable_Audio,
|
|
37
|
+
...("ChainOfThought" in components
|
|
38
|
+
? { ChainOfThought: components.ChainOfThought }
|
|
39
|
+
: {
|
|
40
|
+
tools: components.tools,
|
|
41
|
+
data: components.data,
|
|
42
|
+
ToolGroup:
|
|
43
|
+
components.ToolGroup ?? messagePartsDefaultComponents.ToolGroup,
|
|
44
|
+
ReasoningGroup:
|
|
45
|
+
components.ReasoningGroup ??
|
|
46
|
+
messagePartsDefaultComponents.ReasoningGroup,
|
|
47
|
+
}),
|
|
48
|
+
Empty: components.Empty,
|
|
49
|
+
}
|
|
50
|
+
: rnDefaultComponents;
|
|
51
|
+
|
|
52
|
+
return <MessagePrimitivePartsBase components={merged as any} {...rest} />;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
MessagePrimitiveParts.displayName = "MessagePrimitive.Parts";
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
MessagePartComponentBase as MessagePartComponent,
|
|
59
|
+
MessagePrimitivePartByIndexBase as MessagePrimitivePartByIndex,
|
|
60
|
+
};
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
export { MessageRoot, type MessageRootProps } from "./MessageRoot";
|
|
2
2
|
export { MessageContent, type MessageContentProps } from "./MessageContent";
|
|
3
|
+
export {
|
|
4
|
+
MessagePrimitiveParts,
|
|
5
|
+
MessagePrimitivePartByIndex,
|
|
6
|
+
} from "./MessageParts";
|
|
3
7
|
export { MessageIf, type MessageIfProps } from "./MessageIf";
|
|
8
|
+
export {
|
|
9
|
+
MessageAttachments,
|
|
10
|
+
MessageAttachmentByIndex,
|
|
11
|
+
} from "./MessageAttachments";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { Text, type TextProps } from "react-native";
|
|
3
|
+
import { useAuiState } from "@assistant-ui/store";
|
|
4
|
+
|
|
5
|
+
export type SuggestionDescriptionProps = TextProps & {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const SuggestionDescription = ({
|
|
10
|
+
children,
|
|
11
|
+
...textProps
|
|
12
|
+
}: SuggestionDescriptionProps) => {
|
|
13
|
+
const label = useAuiState((s) => s.suggestion.label);
|
|
14
|
+
|
|
15
|
+
return <Text {...textProps}>{children ?? label}</Text>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { Text, type TextProps } from "react-native";
|
|
3
|
+
import { useAuiState } from "@assistant-ui/store";
|
|
4
|
+
|
|
5
|
+
export type SuggestionTitleProps = TextProps & {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const SuggestionTitle = ({
|
|
10
|
+
children,
|
|
11
|
+
...textProps
|
|
12
|
+
}: SuggestionTitleProps) => {
|
|
13
|
+
const title = useAuiState((s) => s.suggestion.title);
|
|
14
|
+
|
|
15
|
+
return <Text {...textProps}>{children ?? title}</Text>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useCallback, type ReactNode } from "react";
|
|
2
|
+
import { Pressable, type PressableProps } from "react-native";
|
|
3
|
+
import { useAuiState, useAui } from "@assistant-ui/store";
|
|
4
|
+
|
|
5
|
+
export type SuggestionTriggerProps = Omit<PressableProps, "onPress"> & {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* When true, automatically sends the message.
|
|
9
|
+
* When false, replaces or appends the composer text with the suggestion.
|
|
10
|
+
*/
|
|
11
|
+
send?: boolean | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Whether to clear the composer. When send is false, determines if composer
|
|
14
|
+
* text is replaced (true) or appended (false).
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
clearComposer?: boolean | undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const SuggestionTrigger = ({
|
|
21
|
+
children,
|
|
22
|
+
send,
|
|
23
|
+
clearComposer = true,
|
|
24
|
+
disabled: disabledProp,
|
|
25
|
+
...pressableProps
|
|
26
|
+
}: SuggestionTriggerProps) => {
|
|
27
|
+
const aui = useAui();
|
|
28
|
+
const isDisabled = useAuiState((s) => s.thread.isDisabled);
|
|
29
|
+
const prompt = useAuiState((s) => s.suggestion.prompt);
|
|
30
|
+
const resolvedSend = send ?? false;
|
|
31
|
+
|
|
32
|
+
const onPress = useCallback(() => {
|
|
33
|
+
const isRunning = aui.thread().getState().isRunning;
|
|
34
|
+
|
|
35
|
+
if (resolvedSend && !isRunning) {
|
|
36
|
+
aui.thread().append({
|
|
37
|
+
content: [{ type: "text", text: prompt }],
|
|
38
|
+
runConfig: aui.composer().getState().runConfig,
|
|
39
|
+
});
|
|
40
|
+
if (clearComposer) {
|
|
41
|
+
aui.composer().setText("");
|
|
42
|
+
}
|
|
43
|
+
} else {
|
|
44
|
+
if (clearComposer) {
|
|
45
|
+
aui.composer().setText(prompt);
|
|
46
|
+
} else {
|
|
47
|
+
const currentText = aui.composer().getState().text;
|
|
48
|
+
aui
|
|
49
|
+
.composer()
|
|
50
|
+
.setText(currentText.trim() ? `${currentText} ${prompt}` : prompt);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}, [aui, resolvedSend, clearComposer, prompt]);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<Pressable
|
|
57
|
+
onPress={onPress}
|
|
58
|
+
disabled={disabledProp ?? isDisabled}
|
|
59
|
+
{...pressableProps}
|
|
60
|
+
>
|
|
61
|
+
{children}
|
|
62
|
+
</Pressable>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export {
|
|
2
|
+
SuggestionTitle,
|
|
3
|
+
type SuggestionTitleProps,
|
|
4
|
+
} from "./SuggestionTitle";
|
|
5
|
+
export {
|
|
6
|
+
SuggestionDescription,
|
|
7
|
+
type SuggestionDescriptionProps,
|
|
8
|
+
} from "./SuggestionDescription";
|
|
9
|
+
export {
|
|
10
|
+
SuggestionTrigger,
|
|
11
|
+
type SuggestionTriggerProps,
|
|
12
|
+
} from "./SuggestionTrigger";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { useAuiState } from "@assistant-ui/store";
|
|
3
3
|
|
|
4
4
|
export type ThreadIfProps = {
|
|
5
5
|
children: ReactNode;
|
|
@@ -8,7 +8,7 @@ export type ThreadIfProps = {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export const ThreadIf = ({ children, empty, running }: ThreadIfProps) => {
|
|
11
|
-
const thread =
|
|
11
|
+
const thread = useAuiState((s) => s.thread);
|
|
12
12
|
|
|
13
13
|
if (empty !== undefined) {
|
|
14
14
|
const isEmpty = thread.messages.length === 0;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useCallback, type ReactNode } from "react";
|
|
2
|
+
import { Pressable, type PressableProps } from "react-native";
|
|
3
|
+
import { useAuiState, useAui } from "@assistant-ui/store";
|
|
4
|
+
|
|
5
|
+
export type ThreadSuggestionProps = Omit<PressableProps, "onPress"> & {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** The suggestion prompt. */
|
|
8
|
+
prompt: string;
|
|
9
|
+
/**
|
|
10
|
+
* When true, automatically sends the message.
|
|
11
|
+
* When false, replaces or appends the composer text with the suggestion.
|
|
12
|
+
*/
|
|
13
|
+
send?: boolean | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Whether to clear the composer. When send is false, determines if composer
|
|
16
|
+
* text is replaced (true) or appended (false).
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
clearComposer?: boolean | undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const ThreadSuggestion = ({
|
|
23
|
+
children,
|
|
24
|
+
prompt,
|
|
25
|
+
send,
|
|
26
|
+
clearComposer = true,
|
|
27
|
+
disabled: disabledProp,
|
|
28
|
+
...pressableProps
|
|
29
|
+
}: ThreadSuggestionProps) => {
|
|
30
|
+
const aui = useAui();
|
|
31
|
+
const isDisabled = useAuiState((s) => s.thread.isDisabled);
|
|
32
|
+
const resolvedSend = send ?? false;
|
|
33
|
+
|
|
34
|
+
const onPress = useCallback(() => {
|
|
35
|
+
const isRunning = aui.thread().getState().isRunning;
|
|
36
|
+
|
|
37
|
+
if (resolvedSend && !isRunning) {
|
|
38
|
+
aui.thread().append({
|
|
39
|
+
content: [{ type: "text", text: prompt }],
|
|
40
|
+
runConfig: aui.composer().getState().runConfig,
|
|
41
|
+
});
|
|
42
|
+
if (clearComposer) {
|
|
43
|
+
aui.composer().setText("");
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
if (clearComposer) {
|
|
47
|
+
aui.composer().setText(prompt);
|
|
48
|
+
} else {
|
|
49
|
+
const currentText = aui.composer().getState().text;
|
|
50
|
+
aui
|
|
51
|
+
.composer()
|
|
52
|
+
.setText(currentText.trim() ? `${currentText} ${prompt}` : prompt);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}, [aui, resolvedSend, clearComposer, prompt]);
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Pressable
|
|
59
|
+
onPress={onPress}
|
|
60
|
+
disabled={disabledProp ?? isDisabled}
|
|
61
|
+
{...pressableProps}
|
|
62
|
+
>
|
|
63
|
+
{children}
|
|
64
|
+
</Pressable>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
export { ThreadRoot, type ThreadRootProps } from "./ThreadRoot";
|
|
2
2
|
export { ThreadMessages, type ThreadMessagesProps } from "./ThreadMessages";
|
|
3
|
+
export {
|
|
4
|
+
ThreadPrimitiveMessages,
|
|
5
|
+
ThreadPrimitiveMessageByIndex,
|
|
6
|
+
} from "@assistant-ui/core/react";
|
|
3
7
|
export { ThreadEmpty, type ThreadEmptyProps } from "./ThreadEmpty";
|
|
4
8
|
export { ThreadIf, type ThreadIfProps } from "./ThreadIf";
|
|
9
|
+
export {
|
|
10
|
+
ThreadSuggestion,
|
|
11
|
+
type ThreadSuggestionProps,
|
|
12
|
+
} from "./ThreadSuggestion";
|
|
13
|
+
export {
|
|
14
|
+
ThreadPrimitiveSuggestions,
|
|
15
|
+
ThreadPrimitiveSuggestionByIndex,
|
|
16
|
+
} from "@assistant-ui/core/react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactElement, useCallback } from "react";
|
|
2
2
|
import { FlatList, type FlatListProps } from "react-native";
|
|
3
|
-
import {
|
|
3
|
+
import { useAuiState } from "@assistant-ui/store";
|
|
4
4
|
|
|
5
5
|
export type ThreadListItemsProps = Omit<
|
|
6
6
|
FlatListProps<string>,
|
|
@@ -13,7 +13,7 @@ export const ThreadListItems = ({
|
|
|
13
13
|
renderItem,
|
|
14
14
|
...flatListProps
|
|
15
15
|
}: ThreadListItemsProps) => {
|
|
16
|
-
const threadIds =
|
|
16
|
+
const threadIds = useAuiState((s) => s.threads.threadIds);
|
|
17
17
|
|
|
18
18
|
const renderFlatListItem = useCallback(
|
|
19
19
|
({ item, index }: { item: string; index: number }) => {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useCallback, type ReactNode } from "react";
|
|
2
|
+
import { Pressable, type PressableProps } from "react-native";
|
|
3
|
+
import { useAui } from "@assistant-ui/store";
|
|
4
|
+
|
|
5
|
+
export type ThreadListItemArchiveProps = Omit<PressableProps, "onPress"> & {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const ThreadListItemArchive = ({
|
|
10
|
+
children,
|
|
11
|
+
...pressableProps
|
|
12
|
+
}: ThreadListItemArchiveProps) => {
|
|
13
|
+
const aui = useAui();
|
|
14
|
+
|
|
15
|
+
const onPress = useCallback(() => {
|
|
16
|
+
aui.threadListItem().archive();
|
|
17
|
+
}, [aui]);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Pressable onPress={onPress} {...pressableProps}>
|
|
21
|
+
{children}
|
|
22
|
+
</Pressable>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useCallback, type ReactNode } from "react";
|
|
2
|
+
import { Pressable, type PressableProps } from "react-native";
|
|
3
|
+
import { useAui } from "@assistant-ui/store";
|
|
4
|
+
|
|
5
|
+
export type ThreadListItemDeleteProps = Omit<PressableProps, "onPress"> & {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const ThreadListItemDelete = ({
|
|
10
|
+
children,
|
|
11
|
+
...pressableProps
|
|
12
|
+
}: ThreadListItemDeleteProps) => {
|
|
13
|
+
const aui = useAui();
|
|
14
|
+
|
|
15
|
+
const onPress = useCallback(() => {
|
|
16
|
+
aui.threadListItem().delete();
|
|
17
|
+
}, [aui]);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Pressable onPress={onPress} {...pressableProps}>
|
|
21
|
+
{children}
|
|
22
|
+
</Pressable>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { View, type ViewProps } from "react-native";
|
|
3
|
+
|
|
4
|
+
export type ThreadListItemRootProps = ViewProps & {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const ThreadListItemRoot = ({
|
|
9
|
+
children,
|
|
10
|
+
...viewProps
|
|
11
|
+
}: ThreadListItemRootProps) => {
|
|
12
|
+
return <View {...viewProps}>{children}</View>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useCallback, type ReactNode } from "react";
|
|
2
|
+
import { Pressable, type PressableProps } from "react-native";
|
|
3
|
+
import { useAui } from "@assistant-ui/store";
|
|
4
|
+
|
|
5
|
+
export type ThreadListItemTriggerProps = Omit<PressableProps, "onPress"> & {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const ThreadListItemTrigger = ({
|
|
10
|
+
children,
|
|
11
|
+
...pressableProps
|
|
12
|
+
}: ThreadListItemTriggerProps) => {
|
|
13
|
+
const aui = useAui();
|
|
14
|
+
|
|
15
|
+
const onPress = useCallback(() => {
|
|
16
|
+
aui.threadListItem().switchTo();
|
|
17
|
+
}, [aui]);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Pressable onPress={onPress} {...pressableProps}>
|
|
21
|
+
{children}
|
|
22
|
+
</Pressable>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useCallback, type ReactNode } from "react";
|
|
2
|
+
import { Pressable, type PressableProps } from "react-native";
|
|
3
|
+
import { useAui } from "@assistant-ui/store";
|
|
4
|
+
|
|
5
|
+
export type ThreadListItemUnarchiveProps = Omit<PressableProps, "onPress"> & {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const ThreadListItemUnarchive = ({
|
|
10
|
+
children,
|
|
11
|
+
...pressableProps
|
|
12
|
+
}: ThreadListItemUnarchiveProps) => {
|
|
13
|
+
const aui = useAui();
|
|
14
|
+
|
|
15
|
+
const onPress = useCallback(() => {
|
|
16
|
+
aui.threadListItem().unarchive();
|
|
17
|
+
}, [aui]);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Pressable onPress={onPress} {...pressableProps}>
|
|
21
|
+
{children}
|
|
22
|
+
</Pressable>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export {
|
|
2
|
+
ThreadListItemRoot,
|
|
3
|
+
type ThreadListItemRootProps,
|
|
4
|
+
} from "./ThreadListItemRoot";
|
|
5
|
+
export { ThreadListItemPrimitiveTitle as ThreadListItemTitle } from "@assistant-ui/core/react";
|
|
6
|
+
export {
|
|
7
|
+
ThreadListItemTrigger,
|
|
8
|
+
type ThreadListItemTriggerProps,
|
|
9
|
+
} from "./ThreadListItemTrigger";
|
|
10
|
+
export {
|
|
11
|
+
ThreadListItemDelete,
|
|
12
|
+
type ThreadListItemDeleteProps,
|
|
13
|
+
} from "./ThreadListItemDelete";
|
|
14
|
+
export {
|
|
15
|
+
ThreadListItemArchive,
|
|
16
|
+
type ThreadListItemArchiveProps,
|
|
17
|
+
} from "./ThreadListItemArchive";
|
|
18
|
+
export {
|
|
19
|
+
ThreadListItemUnarchive,
|
|
20
|
+
type ThreadListItemUnarchiveProps,
|
|
21
|
+
} from "./ThreadListItemUnarchive";
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
import { create } from "zustand";
|
|
25
25
|
import { AssistantMessageStream } from "assistant-stream";
|
|
26
26
|
import type { ModelContextProvider } from "@assistant-ui/core";
|
|
27
|
+
import { RuntimeAdapterProvider } from "../context/providers/RuntimeAdapterProvider";
|
|
27
28
|
|
|
28
29
|
export class RemoteThreadListThreadListRuntimeCore
|
|
29
30
|
extends BaseSubscribable
|
|
@@ -118,11 +119,14 @@ export class RemoteThreadListThreadListRuntimeCore
|
|
|
118
119
|
return this._loadThreadsPromise;
|
|
119
120
|
}
|
|
120
121
|
|
|
122
|
+
private readonly contextProvider: ModelContextProvider;
|
|
123
|
+
|
|
121
124
|
constructor(
|
|
122
125
|
options: RemoteThreadListOptions,
|
|
123
|
-
|
|
126
|
+
contextProvider: ModelContextProvider,
|
|
124
127
|
) {
|
|
125
128
|
super();
|
|
129
|
+
this.contextProvider = contextProvider;
|
|
126
130
|
|
|
127
131
|
this._state.subscribe(() => this._notifySubscribers());
|
|
128
132
|
this._hookManager = new RemoteThreadListHookInstanceManager(
|
|
@@ -516,12 +520,18 @@ export class RemoteThreadListThreadListRuntimeCore
|
|
|
516
520
|
const boundIds = this.useBoundIds();
|
|
517
521
|
const { Provider } = this.useProvider();
|
|
518
522
|
|
|
523
|
+
const adapters = {
|
|
524
|
+
modelContext: this.contextProvider,
|
|
525
|
+
};
|
|
526
|
+
|
|
519
527
|
return (
|
|
520
528
|
(boundIds.length === 0 || boundIds[0] === id) && (
|
|
521
529
|
// only render if the component is the first one mounted
|
|
522
|
-
<
|
|
523
|
-
|
|
524
|
-
|
|
530
|
+
<RuntimeAdapterProvider adapters={adapters}>
|
|
531
|
+
<this._hookManager.__internal_RenderThreadRuntimes
|
|
532
|
+
provider={Provider}
|
|
533
|
+
/>
|
|
534
|
+
</RuntimeAdapterProvider>
|
|
525
535
|
)
|
|
526
536
|
);
|
|
527
537
|
};
|
|
@@ -39,12 +39,12 @@ const useInnerLocalRuntime = (
|
|
|
39
39
|
>,
|
|
40
40
|
): AssistantRuntime => {
|
|
41
41
|
const { initialMessages, ...restOptions } = options;
|
|
42
|
-
const
|
|
42
|
+
const { modelContext, ...threadListAdapters } = useRuntimeAdapters() ?? {};
|
|
43
43
|
|
|
44
44
|
const opt: LocalRuntimeOptionsBase = {
|
|
45
45
|
...restOptions,
|
|
46
46
|
adapters: {
|
|
47
|
-
...
|
|
47
|
+
...threadListAdapters,
|
|
48
48
|
...restOptions.adapters,
|
|
49
49
|
chatModel,
|
|
50
50
|
},
|
|
@@ -72,6 +72,11 @@ const useInnerLocalRuntime = (
|
|
|
72
72
|
runtime.threads.getMainThreadRuntimeCore().__internal_load();
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (!modelContext) return undefined;
|
|
77
|
+
return runtime.registerModelContextProvider(modelContext);
|
|
78
|
+
}, [modelContext, runtime]);
|
|
79
|
+
|
|
75
80
|
return useMemo(() => new AssistantRuntimeImpl(runtime), [runtime]);
|
|
76
81
|
};
|
|
77
82
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState, useEffect, useMemo } from "react";
|
|
1
|
+
import { useState, useEffect, useMemo, useRef, useCallback } from "react";
|
|
2
2
|
import {
|
|
3
3
|
BaseAssistantRuntimeCore,
|
|
4
4
|
AssistantRuntimeImpl,
|
|
@@ -44,11 +44,27 @@ const useRemoteThreadListRuntimeImpl = (
|
|
|
44
44
|
export const useRemoteThreadListRuntime = (
|
|
45
45
|
options: RemoteThreadListOptions,
|
|
46
46
|
): AssistantRuntime => {
|
|
47
|
+
const runtimeHookRef = useRef(options.runtimeHook);
|
|
48
|
+
runtimeHookRef.current = options.runtimeHook;
|
|
49
|
+
|
|
50
|
+
const stableRuntimeHook = useCallback(() => {
|
|
51
|
+
return runtimeHookRef.current();
|
|
52
|
+
}, []);
|
|
53
|
+
|
|
54
|
+
const stableOptions = useMemo<RemoteThreadListOptions>(
|
|
55
|
+
() => ({
|
|
56
|
+
adapter: options.adapter,
|
|
57
|
+
allowNesting: options.allowNesting,
|
|
58
|
+
runtimeHook: stableRuntimeHook,
|
|
59
|
+
}),
|
|
60
|
+
[options.adapter, options.allowNesting, stableRuntimeHook],
|
|
61
|
+
);
|
|
62
|
+
|
|
47
63
|
const aui = useAui();
|
|
48
64
|
const isNested = aui.threadListItem.source !== null;
|
|
49
65
|
|
|
50
66
|
if (isNested) {
|
|
51
|
-
if (!
|
|
67
|
+
if (!stableOptions.allowNesting) {
|
|
52
68
|
throw new Error(
|
|
53
69
|
"useRemoteThreadListRuntime cannot be nested inside another RemoteThreadListRuntime. " +
|
|
54
70
|
"Set allowNesting: true to allow nesting (the inner runtime will become a no-op).",
|
|
@@ -57,8 +73,8 @@ export const useRemoteThreadListRuntime = (
|
|
|
57
73
|
|
|
58
74
|
// If allowNesting is true and already inside a thread list context,
|
|
59
75
|
// just call the runtimeHook directly (no-op behavior)
|
|
60
|
-
return
|
|
76
|
+
return stableRuntimeHook();
|
|
61
77
|
}
|
|
62
78
|
|
|
63
|
-
return useRemoteThreadListRuntimeImpl(
|
|
79
|
+
return useRemoteThreadListRuntimeImpl(stableOptions);
|
|
64
80
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// React component types (from core/react)
|
|
2
|
+
export type {
|
|
3
|
+
EmptyMessagePartComponent,
|
|
4
|
+
EmptyMessagePartProps,
|
|
5
|
+
TextMessagePartComponent,
|
|
6
|
+
TextMessagePartProps,
|
|
7
|
+
ReasoningMessagePartComponent,
|
|
8
|
+
ReasoningMessagePartProps,
|
|
9
|
+
ReasoningGroupProps,
|
|
10
|
+
ReasoningGroupComponent,
|
|
11
|
+
SourceMessagePartComponent,
|
|
12
|
+
SourceMessagePartProps,
|
|
13
|
+
ImageMessagePartComponent,
|
|
14
|
+
ImageMessagePartProps,
|
|
15
|
+
FileMessagePartComponent,
|
|
16
|
+
FileMessagePartProps,
|
|
17
|
+
Unstable_AudioMessagePartComponent,
|
|
18
|
+
Unstable_AudioMessagePartProps,
|
|
19
|
+
DataMessagePartComponent,
|
|
20
|
+
DataMessagePartProps,
|
|
21
|
+
ToolCallMessagePartComponent,
|
|
22
|
+
ToolCallMessagePartProps,
|
|
23
|
+
} from "@assistant-ui/core/react";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Re-export core scope types
|
|
2
|
+
export type {
|
|
3
|
+
ThreadsState,
|
|
4
|
+
ThreadsMethods,
|
|
5
|
+
ThreadsClientSchema,
|
|
6
|
+
ThreadListItemState,
|
|
7
|
+
ThreadListItemMethods,
|
|
8
|
+
ThreadListItemMeta,
|
|
9
|
+
ThreadListItemEvents,
|
|
10
|
+
ThreadListItemClientSchema,
|
|
11
|
+
ThreadState,
|
|
12
|
+
ThreadMethods,
|
|
13
|
+
ThreadMeta,
|
|
14
|
+
ThreadEvents,
|
|
15
|
+
ThreadClientSchema,
|
|
16
|
+
MessageState,
|
|
17
|
+
MessageMethods,
|
|
18
|
+
MessageMeta,
|
|
19
|
+
MessageClientSchema,
|
|
20
|
+
PartState,
|
|
21
|
+
PartMethods,
|
|
22
|
+
PartMeta,
|
|
23
|
+
PartClientSchema,
|
|
24
|
+
ComposerState,
|
|
25
|
+
ComposerMethods,
|
|
26
|
+
ComposerMeta,
|
|
27
|
+
ComposerEvents,
|
|
28
|
+
ComposerClientSchema,
|
|
29
|
+
AttachmentState,
|
|
30
|
+
AttachmentMethods,
|
|
31
|
+
AttachmentMeta,
|
|
32
|
+
AttachmentClientSchema,
|
|
33
|
+
SuggestionsState,
|
|
34
|
+
SuggestionsMethods,
|
|
35
|
+
SuggestionsClientSchema,
|
|
36
|
+
Suggestion,
|
|
37
|
+
SuggestionState,
|
|
38
|
+
SuggestionMethods,
|
|
39
|
+
SuggestionMeta,
|
|
40
|
+
SuggestionClientSchema,
|
|
41
|
+
ModelContextState,
|
|
42
|
+
ModelContextMethods,
|
|
43
|
+
ModelContextClientSchema,
|
|
44
|
+
ChainOfThoughtState,
|
|
45
|
+
ChainOfThoughtMethods,
|
|
46
|
+
ChainOfThoughtMeta,
|
|
47
|
+
ChainOfThoughtClientSchema,
|
|
48
|
+
ChainOfThoughtPart,
|
|
49
|
+
} from "@assistant-ui/core/store";
|
|
50
|
+
|
|
51
|
+
// Scope types from core/react
|
|
52
|
+
export type {
|
|
53
|
+
ToolsState,
|
|
54
|
+
ToolsMethods,
|
|
55
|
+
ToolsClientSchema,
|
|
56
|
+
DataRenderersState,
|
|
57
|
+
DataRenderersMethods,
|
|
58
|
+
DataRenderersClientSchema,
|
|
59
|
+
} from "@assistant-ui/core/react";
|
package/dist/hooks/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { useThread } from "./useThread.js";
|
|
2
|
-
export { useMessage } from "./useMessage.js";
|
|
3
|
-
export { useComposer } from "./useComposer.js";
|
|
4
|
-
export { useContentPart } from "./useContentPart.js";
|
|
5
|
-
export { useThreadList } from "./useThreadList.js";
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,uBAAoB;AACxC,OAAO,EAAE,UAAU,EAAE,wBAAqB;AAC1C,OAAO,EAAE,WAAW,EAAE,yBAAsB;AAC5C,OAAO,EAAE,cAAc,EAAE,4BAAyB;AAClD,OAAO,EAAE,aAAa,EAAE,2BAAwB"}
|
package/dist/hooks/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { useThread } from "./useThread.js";
|
|
2
|
-
export { useMessage } from "./useMessage.js";
|
|
3
|
-
export { useComposer } from "./useComposer.js";
|
|
4
|
-
export { useContentPart } from "./useContentPart.js";
|
|
5
|
-
export { useThreadList } from "./useThreadList.js";
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
package/dist/hooks/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,uBAAoB;AACxC,OAAO,EAAE,UAAU,EAAE,wBAAqB;AAC1C,OAAO,EAAE,WAAW,EAAE,yBAAsB;AAC5C,OAAO,EAAE,cAAc,EAAE,4BAAyB;AAClD,OAAO,EAAE,aAAa,EAAE,2BAAwB"}
|