@assistant-ui/react-native 0.1.3 → 0.1.6
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/dist/context/AssistantContext.d.ts +1 -9
- package/dist/context/AssistantContext.d.ts.map +1 -1
- package/dist/context/AssistantContext.js +1 -15
- package/dist/context/AssistantContext.js.map +1 -1
- package/dist/index.d.ts +26 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -19
- package/dist/index.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.d.ts +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.d.ts.map +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.js +1 -1
- package/dist/primitives/actionBar/ActionBarCopy.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.js +1 -1
- package/dist/primitives/actionBar/ActionBarEdit.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackNegative.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js +1 -1
- package/dist/primitives/actionBar/ActionBarFeedbackPositive.js.map +1 -1
- package/dist/primitives/actionBar/ActionBarReload.js +1 -1
- package/dist/primitives/actionBar/ActionBarReload.js.map +1 -1
- package/dist/primitives/{actionBar/index.d.ts → actionBar.d.ts} +6 -6
- package/dist/primitives/actionBar.d.ts.map +1 -0
- package/dist/primitives/actionBar.js +6 -0
- package/dist/primitives/actionBar.js.map +1 -0
- package/dist/primitives/{attachment/index.d.ts → attachment.d.ts} +5 -5
- package/dist/primitives/attachment.d.ts.map +1 -0
- package/dist/primitives/attachment.js +5 -0
- package/dist/primitives/attachment.js.map +1 -0
- package/dist/primitives/branchPicker/BranchPickerNext.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.js +3 -15
- package/dist/primitives/branchPicker/BranchPickerNext.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.js +3 -15
- package/dist/primitives/branchPicker/BranchPickerPrevious.js.map +1 -1
- package/dist/primitives/branchPicker.d.ts +5 -0
- package/dist/primitives/branchPicker.d.ts.map +1 -0
- package/dist/primitives/branchPicker.js +5 -0
- package/dist/primitives/branchPicker.js.map +1 -0
- package/dist/primitives/{chainOfThought/index.d.ts → chainOfThought.d.ts} +3 -3
- package/dist/primitives/chainOfThought.d.ts.map +1 -0
- package/dist/primitives/chainOfThought.js +4 -0
- package/dist/primitives/chainOfThought.js.map +1 -0
- package/dist/primitives/composer/ComposerAddAttachment.d.ts +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.js +4 -6
- package/dist/primitives/composer/ComposerAddAttachment.js.map +1 -1
- package/dist/primitives/composer/ComposerCancel.js +3 -3
- package/dist/primitives/composer/ComposerCancel.js.map +1 -1
- package/dist/primitives/composer/ComposerSend.js +3 -3
- package/dist/primitives/composer/ComposerSend.js.map +1 -1
- package/dist/primitives/composer.d.ts +8 -0
- package/dist/primitives/composer.d.ts.map +1 -0
- package/dist/primitives/composer.js +8 -0
- package/dist/primitives/composer.js.map +1 -0
- package/dist/primitives/error/ErrorMessage.d.ts +10 -0
- package/dist/primitives/error/ErrorMessage.d.ts.map +1 -0
- package/dist/primitives/error/ErrorMessage.js +11 -0
- package/dist/primitives/error/ErrorMessage.js.map +1 -0
- package/dist/primitives/error/ErrorRoot.d.ts +10 -0
- package/dist/primitives/error/ErrorRoot.d.ts.map +1 -0
- package/dist/primitives/error/ErrorRoot.js +11 -0
- package/dist/primitives/error/ErrorRoot.js.map +1 -0
- package/dist/primitives/error/index.d.ts +3 -0
- package/dist/primitives/error/index.d.ts.map +1 -0
- package/dist/primitives/error/index.js +3 -0
- package/dist/primitives/error/index.js.map +1 -0
- package/dist/primitives/message/MessageParts.d.ts.map +1 -1
- package/dist/primitives/message/MessageParts.js +6 -1
- package/dist/primitives/message/MessageParts.js.map +1 -1
- package/dist/primitives/message.d.ts +6 -0
- package/dist/primitives/message.d.ts.map +1 -0
- package/dist/primitives/message.js +6 -0
- package/dist/primitives/message.js.map +1 -0
- package/dist/primitives/suggestion/SuggestionTrigger.d.ts +1 -1
- package/dist/primitives/suggestion/SuggestionTrigger.d.ts.map +1 -1
- package/dist/primitives/suggestion/SuggestionTrigger.js +8 -29
- package/dist/primitives/suggestion/SuggestionTrigger.js.map +1 -1
- package/dist/primitives/suggestion.d.ts +4 -0
- package/dist/primitives/suggestion.d.ts.map +1 -0
- package/dist/primitives/suggestion.js +4 -0
- package/dist/primitives/suggestion.js.map +1 -0
- package/dist/primitives/thread/ThreadEmpty.js +1 -1
- package/dist/primitives/thread/ThreadEmpty.js.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.d.ts +1 -1
- package/dist/primitives/thread/ThreadSuggestion.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.js +7 -29
- package/dist/primitives/thread/ThreadSuggestion.js.map +1 -1
- package/dist/primitives/{thread/index.d.ts → thread.d.ts} +6 -6
- package/dist/primitives/thread.d.ts.map +1 -0
- package/dist/primitives/thread.js +8 -0
- package/dist/primitives/thread.js.map +1 -0
- package/dist/primitives/threadList/ThreadListNew.d.ts +1 -1
- package/dist/primitives/threadList/ThreadListNew.d.ts.map +1 -1
- package/dist/primitives/threadList/ThreadListNew.js +3 -7
- package/dist/primitives/threadList/ThreadListNew.js.map +1 -1
- package/dist/primitives/{threadList/index.d.ts → threadList.d.ts} +4 -4
- package/dist/primitives/threadList.d.ts.map +1 -0
- package/dist/primitives/threadList.js +4 -0
- package/dist/primitives/threadList.js.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts +1 -1
- package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemArchive.js +3 -7
- package/dist/primitives/threadListItem/ThreadListItemArchive.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts +1 -1
- package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemDelete.js +3 -7
- package/dist/primitives/threadListItem/ThreadListItemDelete.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTrigger.js +3 -7
- package/dist/primitives/threadListItem/ThreadListItemTrigger.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts +1 -1
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.js +3 -7
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.js.map +1 -1
- package/dist/primitives/threadListItem.d.ts +7 -0
- package/dist/primitives/threadListItem.d.ts.map +1 -0
- package/dist/primitives/threadListItem.js +7 -0
- package/dist/primitives/threadListItem.js.map +1 -0
- package/dist/runtimes/useLocalRuntime.d.ts +1 -17
- package/dist/runtimes/useLocalRuntime.d.ts.map +1 -1
- package/dist/runtimes/useLocalRuntime.js +1 -61
- package/dist/runtimes/useLocalRuntime.js.map +1 -1
- package/package.json +7 -7
- package/src/context/AssistantContext.tsx +1 -33
- package/src/index.ts +76 -26
- package/src/primitives/actionBar/ActionBarCopy.tsx +1 -1
- package/src/primitives/actionBar/ActionBarEdit.tsx +1 -1
- package/src/primitives/actionBar/ActionBarFeedbackNegative.tsx +1 -1
- package/src/primitives/actionBar/ActionBarFeedbackPositive.tsx +1 -1
- package/src/primitives/actionBar/ActionBarReload.tsx +1 -1
- package/src/primitives/{actionBar/index.ts → actionBar.ts} +5 -5
- package/src/primitives/{attachment/index.ts → attachment.ts} +4 -4
- package/src/primitives/branchPicker/BranchPickerNext.tsx +3 -15
- package/src/primitives/branchPicker/BranchPickerPrevious.tsx +3 -15
- package/src/primitives/{branchPicker/index.ts → branchPicker.ts} +4 -4
- package/src/primitives/{chainOfThought/index.ts → chainOfThought.ts} +2 -2
- package/src/primitives/composer/ComposerAddAttachment.tsx +4 -6
- package/src/primitives/composer/ComposerCancel.tsx +3 -3
- package/src/primitives/composer/ComposerSend.tsx +3 -3
- package/src/primitives/{composer/index.ts → composer.ts} +7 -7
- package/src/primitives/error/ErrorMessage.tsx +17 -0
- package/src/primitives/error/ErrorRoot.tsx +16 -0
- package/src/primitives/error/index.ts +8 -0
- package/src/primitives/message/MessageContent.tsx +1 -1
- package/src/primitives/message/MessageParts.tsx +11 -4
- package/src/primitives/{message/index.ts → message.ts} +8 -5
- package/src/primitives/suggestion/SuggestionTrigger.tsx +10 -30
- package/src/primitives/{suggestion/index.ts → suggestion.ts} +3 -3
- package/src/primitives/thread/ThreadEmpty.tsx +1 -1
- package/src/primitives/thread/ThreadSuggestion.tsx +9 -30
- package/src/primitives/{thread/index.ts → thread.ts} +8 -5
- package/src/primitives/threadList/ThreadListNew.tsx +4 -8
- package/src/primitives/{threadList/index.ts → threadList.ts} +3 -3
- package/src/primitives/threadListItem/ThreadListItemArchive.tsx +4 -8
- package/src/primitives/threadListItem/ThreadListItemDelete.tsx +4 -8
- package/src/primitives/threadListItem/ThreadListItemTrigger.tsx +4 -8
- package/src/primitives/threadListItem/ThreadListItemUnarchive.tsx +4 -8
- package/src/primitives/{threadListItem/index.ts → threadListItem.ts} +5 -5
- package/src/runtimes/useLocalRuntime.ts +4 -105
- package/dist/adapters/LocalStorageThreadListAdapter.d.ts +0 -15
- package/dist/adapters/LocalStorageThreadListAdapter.d.ts.map +0 -1
- package/dist/adapters/LocalStorageThreadListAdapter.js +0 -154
- package/dist/adapters/LocalStorageThreadListAdapter.js.map +0 -1
- package/dist/adapters/TitleGenerationAdapter.d.ts +0 -6
- package/dist/adapters/TitleGenerationAdapter.d.ts.map +0 -1
- package/dist/adapters/TitleGenerationAdapter.js +0 -15
- package/dist/adapters/TitleGenerationAdapter.js.map +0 -1
- package/dist/adapters/index.d.ts +0 -3
- package/dist/adapters/index.d.ts.map +0 -1
- package/dist/adapters/index.js +0 -3
- package/dist/adapters/index.js.map +0 -1
- package/dist/client/index.d.ts +0 -5
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/index.js +0 -7
- package/dist/client/index.js.map +0 -1
- package/dist/context/index.d.ts +0 -2
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js +0 -2
- package/dist/context/index.js.map +0 -1
- package/dist/model-context/index.d.ts +0 -9
- package/dist/model-context/index.d.ts.map +0 -1
- package/dist/model-context/index.js +0 -7
- package/dist/model-context/index.js.map +0 -1
- package/dist/primitive-hooks/index.d.ts +0 -13
- package/dist/primitive-hooks/index.d.ts.map +0 -1
- package/dist/primitive-hooks/index.js +0 -13
- package/dist/primitive-hooks/index.js.map +0 -1
- package/dist/primitive-hooks/useActionBarCopy.d.ts +0 -10
- package/dist/primitive-hooks/useActionBarCopy.d.ts.map +0 -1
- package/dist/primitive-hooks/useActionBarCopy.js +0 -26
- package/dist/primitive-hooks/useActionBarCopy.js.map +0 -1
- package/dist/primitive-hooks/useActionBarEdit.d.ts +0 -5
- package/dist/primitive-hooks/useActionBarEdit.d.ts.map +0 -1
- package/dist/primitive-hooks/useActionBarEdit.js +0 -11
- package/dist/primitive-hooks/useActionBarEdit.js.map +0 -1
- package/dist/primitive-hooks/useActionBarFeedback.d.ts +0 -9
- package/dist/primitive-hooks/useActionBarFeedback.d.ts.map +0 -1
- package/dist/primitive-hooks/useActionBarFeedback.js +0 -19
- package/dist/primitive-hooks/useActionBarFeedback.js.map +0 -1
- package/dist/primitive-hooks/useActionBarReload.d.ts +0 -5
- package/dist/primitive-hooks/useActionBarReload.d.ts.map +0 -1
- package/dist/primitive-hooks/useActionBarReload.js +0 -13
- package/dist/primitive-hooks/useActionBarReload.js.map +0 -1
- package/dist/primitive-hooks/useComposerAddAttachment.d.ts +0 -5
- package/dist/primitive-hooks/useComposerAddAttachment.d.ts.map +0 -1
- package/dist/primitive-hooks/useComposerAddAttachment.js +0 -10
- package/dist/primitive-hooks/useComposerAddAttachment.js.map +0 -1
- package/dist/primitive-hooks/useComposerCancel.d.ts +0 -5
- package/dist/primitive-hooks/useComposerCancel.d.ts.map +0 -1
- package/dist/primitive-hooks/useComposerCancel.js +0 -11
- package/dist/primitive-hooks/useComposerCancel.js.map +0 -1
- package/dist/primitive-hooks/useComposerSend.d.ts +0 -5
- package/dist/primitive-hooks/useComposerSend.d.ts.map +0 -1
- package/dist/primitive-hooks/useComposerSend.js +0 -11
- package/dist/primitive-hooks/useComposerSend.js.map +0 -1
- package/dist/primitive-hooks/useEditComposerCancel.d.ts +0 -4
- package/dist/primitive-hooks/useEditComposerCancel.d.ts.map +0 -1
- package/dist/primitive-hooks/useEditComposerCancel.js +0 -10
- package/dist/primitive-hooks/useEditComposerCancel.js.map +0 -1
- package/dist/primitive-hooks/useEditComposerSend.d.ts +0 -5
- package/dist/primitive-hooks/useEditComposerSend.d.ts.map +0 -1
- package/dist/primitive-hooks/useEditComposerSend.js +0 -11
- package/dist/primitive-hooks/useEditComposerSend.js.map +0 -1
- package/dist/primitive-hooks/useMessageBranching.d.ts +0 -7
- package/dist/primitive-hooks/useMessageBranching.d.ts.map +0 -1
- package/dist/primitive-hooks/useMessageBranching.js +0 -15
- package/dist/primitive-hooks/useMessageBranching.js.map +0 -1
- package/dist/primitive-hooks/useMessageReload.d.ts +0 -5
- package/dist/primitive-hooks/useMessageReload.d.ts.map +0 -1
- package/dist/primitive-hooks/useMessageReload.js +0 -11
- package/dist/primitive-hooks/useMessageReload.js.map +0 -1
- package/dist/primitive-hooks/useThreadIsEmpty.d.ts +0 -2
- package/dist/primitive-hooks/useThreadIsEmpty.d.ts.map +0 -1
- package/dist/primitive-hooks/useThreadIsEmpty.js +0 -5
- package/dist/primitive-hooks/useThreadIsEmpty.js.map +0 -1
- package/dist/primitive-hooks/useThreadIsRunning.d.ts +0 -2
- package/dist/primitive-hooks/useThreadIsRunning.d.ts.map +0 -1
- package/dist/primitive-hooks/useThreadIsRunning.js +0 -5
- package/dist/primitive-hooks/useThreadIsRunning.js.map +0 -1
- package/dist/primitive-hooks/useThreadMessages.d.ts +0 -3
- package/dist/primitive-hooks/useThreadMessages.d.ts.map +0 -1
- package/dist/primitive-hooks/useThreadMessages.js +0 -5
- package/dist/primitive-hooks/useThreadMessages.js.map +0 -1
- package/dist/primitives/actionBar/index.d.ts.map +0 -1
- package/dist/primitives/actionBar/index.js +0 -6
- package/dist/primitives/actionBar/index.js.map +0 -1
- package/dist/primitives/attachment/index.d.ts.map +0 -1
- package/dist/primitives/attachment/index.js +0 -5
- package/dist/primitives/attachment/index.js.map +0 -1
- package/dist/primitives/branchPicker/index.d.ts +0 -5
- package/dist/primitives/branchPicker/index.d.ts.map +0 -1
- package/dist/primitives/branchPicker/index.js +0 -5
- package/dist/primitives/branchPicker/index.js.map +0 -1
- package/dist/primitives/chainOfThought/index.d.ts.map +0 -1
- package/dist/primitives/chainOfThought/index.js +0 -4
- package/dist/primitives/chainOfThought/index.js.map +0 -1
- package/dist/primitives/composer/EditComposerCancel.d.ts +0 -7
- package/dist/primitives/composer/EditComposerCancel.d.ts.map +0 -1
- package/dist/primitives/composer/EditComposerCancel.js +0 -8
- package/dist/primitives/composer/EditComposerCancel.js.map +0 -1
- package/dist/primitives/composer/EditComposerInput.d.ts +0 -4
- package/dist/primitives/composer/EditComposerInput.d.ts.map +0 -1
- package/dist/primitives/composer/EditComposerInput.js +0 -13
- package/dist/primitives/composer/EditComposerInput.js.map +0 -1
- package/dist/primitives/composer/EditComposerSend.d.ts +0 -7
- package/dist/primitives/composer/EditComposerSend.d.ts.map +0 -1
- package/dist/primitives/composer/EditComposerSend.js +0 -8
- package/dist/primitives/composer/EditComposerSend.js.map +0 -1
- package/dist/primitives/composer/index.d.ts +0 -8
- package/dist/primitives/composer/index.d.ts.map +0 -1
- package/dist/primitives/composer/index.js +0 -8
- package/dist/primitives/composer/index.js.map +0 -1
- package/dist/primitives/message/index.d.ts +0 -6
- package/dist/primitives/message/index.d.ts.map +0 -1
- package/dist/primitives/message/index.js +0 -6
- package/dist/primitives/message/index.js.map +0 -1
- package/dist/primitives/suggestion/index.d.ts +0 -4
- package/dist/primitives/suggestion/index.d.ts.map +0 -1
- package/dist/primitives/suggestion/index.js +0 -4
- package/dist/primitives/suggestion/index.js.map +0 -1
- package/dist/primitives/thread/index.d.ts.map +0 -1
- package/dist/primitives/thread/index.js +0 -8
- package/dist/primitives/thread/index.js.map +0 -1
- package/dist/primitives/threadList/index.d.ts.map +0 -1
- package/dist/primitives/threadList/index.js +0 -4
- package/dist/primitives/threadList/index.js.map +0 -1
- package/dist/primitives/threadListItem/index.d.ts +0 -7
- package/dist/primitives/threadListItem/index.d.ts.map +0 -1
- package/dist/primitives/threadListItem/index.js +0 -7
- package/dist/primitives/threadListItem/index.js.map +0 -1
- package/dist/runtimes/index.d.ts +0 -3
- package/dist/runtimes/index.d.ts.map +0 -1
- package/dist/runtimes/index.js +0 -3
- package/dist/runtimes/index.js.map +0 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
- package/dist/types/scopes/index.d.ts +0 -3
- package/dist/types/scopes/index.d.ts.map +0 -1
- package/dist/types/scopes/index.js +0 -2
- package/dist/types/scopes/index.js.map +0 -1
- package/src/adapters/LocalStorageThreadListAdapter.tsx +0 -227
- package/src/adapters/TitleGenerationAdapter.ts +0 -20
- package/src/adapters/index.ts +0 -5
- package/src/client/index.ts +0 -7
- package/src/context/index.ts +0 -4
- package/src/model-context/index.ts +0 -44
- package/src/primitive-hooks/index.ts +0 -18
- package/src/primitive-hooks/useActionBarCopy.ts +0 -38
- package/src/primitive-hooks/useActionBarEdit.ts +0 -13
- package/src/primitive-hooks/useActionBarFeedback.ts +0 -28
- package/src/primitive-hooks/useActionBarReload.ts +0 -18
- package/src/primitive-hooks/useComposerAddAttachment.ts +0 -16
- package/src/primitive-hooks/useComposerCancel.ts +0 -13
- package/src/primitive-hooks/useComposerSend.ts +0 -15
- package/src/primitive-hooks/useEditComposerCancel.ts +0 -12
- package/src/primitive-hooks/useEditComposerSend.ts +0 -13
- package/src/primitive-hooks/useMessageBranching.ts +0 -18
- package/src/primitive-hooks/useMessageReload.ts +0 -13
- package/src/primitive-hooks/useThreadIsEmpty.ts +0 -5
- package/src/primitive-hooks/useThreadIsRunning.ts +0 -5
- package/src/primitive-hooks/useThreadMessages.ts +0 -6
- package/src/primitives/composer/EditComposerCancel.tsx +0 -20
- package/src/primitives/composer/EditComposerInput.tsx +0 -22
- package/src/primitives/composer/EditComposerSend.tsx +0 -25
- package/src/runtimes/index.ts +0 -2
- package/src/types/index.ts +0 -23
- package/src/types/scopes/index.ts +0 -59
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ThreadListItemRoot as Root, type ThreadListItemRootProps as RootProps, } from "./threadListItem/ThreadListItemRoot.js";
|
|
2
|
+
export { ThreadListItemPrimitiveTitle as Title } from "@assistant-ui/core/react";
|
|
3
|
+
export { ThreadListItemTrigger as Trigger, type ThreadListItemTriggerProps as TriggerProps, } from "./threadListItem/ThreadListItemTrigger.js";
|
|
4
|
+
export { ThreadListItemDelete as Delete, type ThreadListItemDeleteProps as DeleteProps, } from "./threadListItem/ThreadListItemDelete.js";
|
|
5
|
+
export { ThreadListItemArchive as Archive, type ThreadListItemArchiveProps as ArchiveProps, } from "./threadListItem/ThreadListItemArchive.js";
|
|
6
|
+
export { ThreadListItemUnarchive as Unarchive, type ThreadListItemUnarchiveProps as UnarchiveProps, } from "./threadListItem/ThreadListItemUnarchive.js";
|
|
7
|
+
//# sourceMappingURL=threadListItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threadListItem.d.ts","sourceRoot":"","sources":["../../src/primitives/threadListItem.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,IAAI,IAAI,EAC1B,KAAK,uBAAuB,IAAI,SAAS,GAC1C,+CAA4C;AAC7C,OAAO,EAAE,4BAA4B,IAAI,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,EACL,qBAAqB,IAAI,OAAO,EAChC,KAAK,0BAA0B,IAAI,YAAY,GAChD,kDAA+C;AAChD,OAAO,EACL,oBAAoB,IAAI,MAAM,EAC9B,KAAK,yBAAyB,IAAI,WAAW,GAC9C,iDAA8C;AAC/C,OAAO,EACL,qBAAqB,IAAI,OAAO,EAChC,KAAK,0BAA0B,IAAI,YAAY,GAChD,kDAA+C;AAChD,OAAO,EACL,uBAAuB,IAAI,SAAS,EACpC,KAAK,4BAA4B,IAAI,cAAc,GACpD,oDAAiD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ThreadListItemRoot as Root, } from "./threadListItem/ThreadListItemRoot.js";
|
|
2
|
+
export { ThreadListItemPrimitiveTitle as Title } from "@assistant-ui/core/react";
|
|
3
|
+
export { ThreadListItemTrigger as Trigger, } from "./threadListItem/ThreadListItemTrigger.js";
|
|
4
|
+
export { ThreadListItemDelete as Delete, } from "./threadListItem/ThreadListItemDelete.js";
|
|
5
|
+
export { ThreadListItemArchive as Archive, } from "./threadListItem/ThreadListItemArchive.js";
|
|
6
|
+
export { ThreadListItemUnarchive as Unarchive, } from "./threadListItem/ThreadListItemUnarchive.js";
|
|
7
|
+
//# sourceMappingURL=threadListItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threadListItem.js","sourceRoot":"","sources":["../../src/primitives/threadListItem.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,IAAI,IAAI,GAE3B,+CAA4C;AAC7C,OAAO,EAAE,4BAA4B,IAAI,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,EACL,qBAAqB,IAAI,OAAO,GAEjC,kDAA+C;AAChD,OAAO,EACL,oBAAoB,IAAI,MAAM,GAE/B,iDAA8C;AAC/C,OAAO,EACL,qBAAqB,IAAI,OAAO,GAEjC,kDAA+C;AAChD,OAAO,EACL,uBAAuB,IAAI,SAAS,GAErC,oDAAiD"}
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { LocalRuntimeOptionsBase } from "@assistant-ui/core/internal";
|
|
3
|
-
import type { TitleGenerationAdapter } from "../adapters/TitleGenerationAdapter.js";
|
|
4
|
-
type AsyncStorageLike = {
|
|
5
|
-
getItem(key: string): Promise<string | null>;
|
|
6
|
-
setItem(key: string, value: string): Promise<void>;
|
|
7
|
-
removeItem(key: string): Promise<void>;
|
|
8
|
-
};
|
|
9
|
-
export type LocalRuntimeOptions = Omit<LocalRuntimeOptionsBase, "adapters"> & {
|
|
10
|
-
adapters?: Omit<LocalRuntimeOptionsBase["adapters"], "chatModel"> | undefined;
|
|
11
|
-
initialMessages?: readonly ThreadMessageLike[] | undefined;
|
|
12
|
-
titleGenerator?: TitleGenerationAdapter | undefined;
|
|
13
|
-
storage?: AsyncStorageLike | undefined;
|
|
14
|
-
storagePrefix?: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
export declare const useLocalRuntime: (chatModel: ChatModelAdapter, options?: LocalRuntimeOptions) => AssistantRuntime;
|
|
17
|
-
export {};
|
|
1
|
+
export { useLocalRuntime, type LocalRuntimeOptions, } from "@assistant-ui/core/react";
|
|
18
2
|
//# sourceMappingURL=useLocalRuntime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocalRuntime.d.ts","sourceRoot":"","sources":["../../src/runtimes/useLocalRuntime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocalRuntime.d.ts","sourceRoot":"","sources":["../../src/runtimes/useLocalRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,mBAAmB,GACzB,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,62 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { InMemoryThreadListAdapter } from "@assistant-ui/core";
|
|
3
|
-
import { AssistantRuntimeImpl, LocalRuntimeCore, } from "@assistant-ui/core/internal";
|
|
4
|
-
import { useAuiState } from "@assistant-ui/store";
|
|
5
|
-
import { useRemoteThreadListRuntime } from "./useRemoteThreadListRuntime.js";
|
|
6
|
-
import { createLocalStorageAdapter } from "../adapters/LocalStorageThreadListAdapter.js";
|
|
7
|
-
import { useRuntimeAdapters } from "../context/providers/RuntimeAdapterProvider.js";
|
|
8
|
-
const useInnerLocalRuntime = (chatModel, options) => {
|
|
9
|
-
const { initialMessages, ...restOptions } = options;
|
|
10
|
-
const { modelContext, ...threadListAdapters } = useRuntimeAdapters() ?? {};
|
|
11
|
-
const opt = {
|
|
12
|
-
...restOptions,
|
|
13
|
-
adapters: {
|
|
14
|
-
...threadListAdapters,
|
|
15
|
-
...restOptions.adapters,
|
|
16
|
-
chatModel,
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
const [runtime] = useState(() => new LocalRuntimeCore(opt, initialMessages));
|
|
20
|
-
const threadIdRef = useRef(undefined);
|
|
21
|
-
threadIdRef.current = useAuiState((s) => s.threadListItem.remoteId);
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
runtime.threads
|
|
24
|
-
.getMainThreadRuntimeCore()
|
|
25
|
-
.__internal_setGetThreadId(() => threadIdRef.current);
|
|
26
|
-
}, [runtime]);
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
return () => {
|
|
29
|
-
runtime.threads.getMainThreadRuntimeCore().detach();
|
|
30
|
-
};
|
|
31
|
-
}, [runtime]);
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
runtime.threads.getMainThreadRuntimeCore().__internal_setOptions(opt);
|
|
34
|
-
runtime.threads.getMainThreadRuntimeCore().__internal_load();
|
|
35
|
-
});
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
if (!modelContext)
|
|
38
|
-
return undefined;
|
|
39
|
-
return runtime.registerModelContextProvider(modelContext);
|
|
40
|
-
}, [modelContext, runtime]);
|
|
41
|
-
return useMemo(() => new AssistantRuntimeImpl(runtime), [runtime]);
|
|
42
|
-
};
|
|
43
|
-
export const useLocalRuntime = (chatModel, options = {}) => {
|
|
44
|
-
const { titleGenerator, storage, storagePrefix, ...innerOptions } = options;
|
|
45
|
-
const adapter = useMemo(() => {
|
|
46
|
-
if (!storage)
|
|
47
|
-
return new InMemoryThreadListAdapter();
|
|
48
|
-
return createLocalStorageAdapter({
|
|
49
|
-
storage,
|
|
50
|
-
prefix: storagePrefix,
|
|
51
|
-
titleGenerator,
|
|
52
|
-
});
|
|
53
|
-
}, [storage, storagePrefix, titleGenerator]);
|
|
54
|
-
return useRemoteThreadListRuntime({
|
|
55
|
-
runtimeHook: function RuntimeHook() {
|
|
56
|
-
return useInnerLocalRuntime(chatModel, innerOptions);
|
|
57
|
-
},
|
|
58
|
-
adapter,
|
|
59
|
-
allowNesting: true,
|
|
60
|
-
});
|
|
61
|
-
};
|
|
1
|
+
export { useLocalRuntime, } from "@assistant-ui/core/react";
|
|
62
2
|
//# sourceMappingURL=useLocalRuntime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocalRuntime.js","sourceRoot":"","sources":["../../src/runtimes/useLocalRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useLocalRuntime.js","sourceRoot":"","sources":["../../src/runtimes/useLocalRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAEhB,MAAM,0BAA0B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-ui/react-native",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "React Native bindings for assistant-ui",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"assistant",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
],
|
|
34
34
|
"sideEffects": false,
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@assistant-ui/core": "^0.1.
|
|
37
|
-
"@assistant-ui/store": "^0.2.
|
|
38
|
-
"@assistant-ui/tap": "^0.5.
|
|
39
|
-
"assistant-stream": "^0.3.
|
|
36
|
+
"@assistant-ui/core": "^0.1.7",
|
|
37
|
+
"@assistant-ui/store": "^0.2.3",
|
|
38
|
+
"@assistant-ui/tap": "^0.5.3",
|
|
39
|
+
"assistant-stream": "^0.3.6",
|
|
40
40
|
"zustand": "^5.0.11"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"@types/react": "^19.2.14",
|
|
54
54
|
"react": "^19.2.4",
|
|
55
55
|
"react-native": "^0.84.1",
|
|
56
|
-
"vitest": "^4.0
|
|
57
|
-
"@assistant-ui/x-buildutils": "0.0.
|
|
56
|
+
"vitest": "^4.1.0",
|
|
57
|
+
"@assistant-ui/x-buildutils": "0.0.3"
|
|
58
58
|
},
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public",
|
|
@@ -1,33 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { useAui, type AssistantClient } from "@assistant-ui/store";
|
|
3
|
-
import type { AssistantRuntime } from "@assistant-ui/core";
|
|
4
|
-
import { AssistantProviderBase } from "@assistant-ui/core/react";
|
|
5
|
-
|
|
6
|
-
export const useAssistantRuntime = (): AssistantRuntime => {
|
|
7
|
-
const aui = useAui();
|
|
8
|
-
const runtime = aui.threads().__internal_getAssistantRuntime?.();
|
|
9
|
-
if (!runtime) {
|
|
10
|
-
throw new Error(
|
|
11
|
-
"useAssistantRuntime must be used within an AssistantProvider",
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
return runtime;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const AssistantRuntimeProvider = memo(
|
|
18
|
-
({
|
|
19
|
-
runtime,
|
|
20
|
-
aui,
|
|
21
|
-
children,
|
|
22
|
-
}: {
|
|
23
|
-
runtime: AssistantRuntime;
|
|
24
|
-
aui?: AssistantClient | null;
|
|
25
|
-
children: ReactNode;
|
|
26
|
-
}) => {
|
|
27
|
-
return (
|
|
28
|
-
<AssistantProviderBase runtime={runtime} aui={aui ?? null}>
|
|
29
|
-
{children}
|
|
30
|
-
</AssistantProviderBase>
|
|
31
|
-
);
|
|
32
|
-
},
|
|
33
|
-
);
|
|
1
|
+
export { AssistantRuntimeProvider } from "@assistant-ui/core/react";
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="@assistant-ui/core/react" />
|
|
2
2
|
|
|
3
3
|
// Re-export core types
|
|
4
4
|
export type {
|
|
@@ -92,32 +92,14 @@ export {
|
|
|
92
92
|
} from "@assistant-ui/store";
|
|
93
93
|
|
|
94
94
|
// Context providers and hooks
|
|
95
|
-
export { AssistantRuntimeProvider
|
|
96
|
-
|
|
97
|
-
// Primitive hooks
|
|
98
|
-
export {
|
|
99
|
-
useThreadMessages,
|
|
100
|
-
useThreadIsRunning,
|
|
101
|
-
useThreadIsEmpty,
|
|
102
|
-
useComposerSend,
|
|
103
|
-
useComposerCancel,
|
|
104
|
-
useMessageReload,
|
|
105
|
-
useMessageBranching,
|
|
106
|
-
useActionBarCopy,
|
|
107
|
-
type UseActionBarCopyOptions,
|
|
108
|
-
useActionBarEdit,
|
|
109
|
-
useActionBarReload,
|
|
110
|
-
useActionBarFeedbackPositive,
|
|
111
|
-
useActionBarFeedbackNegative,
|
|
112
|
-
useComposerAddAttachment,
|
|
113
|
-
} from "./primitive-hooks";
|
|
95
|
+
export { AssistantRuntimeProvider } from "./context/AssistantContext";
|
|
114
96
|
|
|
115
97
|
// Runtime
|
|
116
98
|
export {
|
|
117
99
|
useLocalRuntime,
|
|
118
100
|
type LocalRuntimeOptions,
|
|
119
|
-
|
|
120
|
-
} from "./runtimes";
|
|
101
|
+
} from "./runtimes/useLocalRuntime";
|
|
102
|
+
export { useRemoteThreadListRuntime } from "./runtimes/useRemoteThreadListRuntime";
|
|
121
103
|
|
|
122
104
|
// Primitives
|
|
123
105
|
export * as ThreadPrimitive from "./primitives/thread";
|
|
@@ -130,6 +112,7 @@ export * as AttachmentPrimitive from "./primitives/attachment";
|
|
|
130
112
|
export * as ThreadListItemPrimitive from "./primitives/threadListItem";
|
|
131
113
|
export * as ChainOfThoughtPrimitive from "./primitives/chainOfThought";
|
|
132
114
|
export * as SuggestionPrimitive from "./primitives/suggestion";
|
|
115
|
+
export * as ErrorPrimitive from "./primitives/error";
|
|
133
116
|
|
|
134
117
|
// Re-export shared providers from core/react
|
|
135
118
|
export {
|
|
@@ -142,7 +125,74 @@ export {
|
|
|
142
125
|
SuggestionByIndexProvider,
|
|
143
126
|
} from "@assistant-ui/core/react";
|
|
144
127
|
|
|
145
|
-
// Model context, tools & clients
|
|
146
|
-
export
|
|
147
|
-
|
|
148
|
-
|
|
128
|
+
// Model context, tools & clients (inlined from model-context)
|
|
129
|
+
export {
|
|
130
|
+
makeAssistantTool,
|
|
131
|
+
type AssistantTool,
|
|
132
|
+
makeAssistantToolUI,
|
|
133
|
+
type AssistantToolUI,
|
|
134
|
+
makeAssistantDataUI,
|
|
135
|
+
type AssistantDataUI,
|
|
136
|
+
useAssistantTool,
|
|
137
|
+
type AssistantToolProps,
|
|
138
|
+
useAssistantToolUI,
|
|
139
|
+
type AssistantToolUIProps,
|
|
140
|
+
useAssistantDataUI,
|
|
141
|
+
type AssistantDataUIProps,
|
|
142
|
+
useAssistantInstructions,
|
|
143
|
+
useInlineRender,
|
|
144
|
+
type Toolkit,
|
|
145
|
+
type ToolDefinition,
|
|
146
|
+
Tools,
|
|
147
|
+
DataRenderers,
|
|
148
|
+
} from "@assistant-ui/core/react";
|
|
149
|
+
|
|
150
|
+
export type {
|
|
151
|
+
ModelContext,
|
|
152
|
+
ModelContextProvider,
|
|
153
|
+
LanguageModelConfig,
|
|
154
|
+
LanguageModelV1CallSettings,
|
|
155
|
+
} from "@assistant-ui/core";
|
|
156
|
+
|
|
157
|
+
export { mergeModelContexts } from "@assistant-ui/core";
|
|
158
|
+
|
|
159
|
+
export type { Tool } from "assistant-stream";
|
|
160
|
+
|
|
161
|
+
export { tool } from "@assistant-ui/core";
|
|
162
|
+
|
|
163
|
+
export { Suggestions, type SuggestionConfig } from "@assistant-ui/core/store";
|
|
164
|
+
|
|
165
|
+
export { ModelContextRegistry } from "@assistant-ui/core";
|
|
166
|
+
export type {
|
|
167
|
+
ModelContextRegistryToolHandle,
|
|
168
|
+
ModelContextRegistryInstructionHandle,
|
|
169
|
+
ModelContextRegistryProviderHandle,
|
|
170
|
+
} from "@assistant-ui/core";
|
|
171
|
+
|
|
172
|
+
// Client (inlined from client)
|
|
173
|
+
export { ModelContext as ModelContextClient } from "@assistant-ui/core/store";
|
|
174
|
+
export { ChainOfThoughtClient } from "@assistant-ui/core/store";
|
|
175
|
+
|
|
176
|
+
// Component types (inlined from types)
|
|
177
|
+
export type {
|
|
178
|
+
EmptyMessagePartComponent,
|
|
179
|
+
EmptyMessagePartProps,
|
|
180
|
+
TextMessagePartComponent,
|
|
181
|
+
TextMessagePartProps,
|
|
182
|
+
ReasoningMessagePartComponent,
|
|
183
|
+
ReasoningMessagePartProps,
|
|
184
|
+
ReasoningGroupProps,
|
|
185
|
+
ReasoningGroupComponent,
|
|
186
|
+
SourceMessagePartComponent,
|
|
187
|
+
SourceMessagePartProps,
|
|
188
|
+
ImageMessagePartComponent,
|
|
189
|
+
ImageMessagePartProps,
|
|
190
|
+
FileMessagePartComponent,
|
|
191
|
+
FileMessagePartProps,
|
|
192
|
+
Unstable_AudioMessagePartComponent,
|
|
193
|
+
Unstable_AudioMessagePartProps,
|
|
194
|
+
DataMessagePartComponent,
|
|
195
|
+
DataMessagePartProps,
|
|
196
|
+
ToolCallMessagePartComponent,
|
|
197
|
+
ToolCallMessagePartProps,
|
|
198
|
+
} from "@assistant-ui/core/react";
|
|
@@ -3,7 +3,7 @@ import { Pressable, type PressableProps } from "react-native";
|
|
|
3
3
|
import {
|
|
4
4
|
useActionBarCopy,
|
|
5
5
|
type UseActionBarCopyOptions,
|
|
6
|
-
} from "
|
|
6
|
+
} from "@assistant-ui/core/react";
|
|
7
7
|
|
|
8
8
|
export type ActionBarCopyProps = Omit<PressableProps, "onPress" | "children"> &
|
|
9
9
|
UseActionBarCopyOptions & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import { Pressable, type PressableProps } from "react-native";
|
|
3
|
-
import { useActionBarEdit } from "
|
|
3
|
+
import { useActionBarEdit } from "@assistant-ui/core/react";
|
|
4
4
|
|
|
5
5
|
export type ActionBarEditProps = Omit<PressableProps, "onPress"> & {
|
|
6
6
|
children: ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import { Pressable, type PressableProps } from "react-native";
|
|
3
|
-
import { useActionBarFeedbackNegative } from "
|
|
3
|
+
import { useActionBarFeedbackNegative } from "@assistant-ui/core/react";
|
|
4
4
|
|
|
5
5
|
export type ActionBarFeedbackNegativeProps = Omit<
|
|
6
6
|
PressableProps,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import { Pressable, type PressableProps } from "react-native";
|
|
3
|
-
import { useActionBarFeedbackPositive } from "
|
|
3
|
+
import { useActionBarFeedbackPositive } from "@assistant-ui/core/react";
|
|
4
4
|
|
|
5
5
|
export type ActionBarFeedbackPositiveProps = Omit<
|
|
6
6
|
PressableProps,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import { Pressable, type PressableProps } from "react-native";
|
|
3
|
-
import { useActionBarReload } from "
|
|
3
|
+
import { useActionBarReload } from "@assistant-ui/core/react";
|
|
4
4
|
|
|
5
5
|
export type ActionBarReloadProps = Omit<PressableProps, "onPress"> & {
|
|
6
6
|
children: ReactNode;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
export {
|
|
2
2
|
ActionBarCopy as Copy,
|
|
3
3
|
type ActionBarCopyProps as CopyProps,
|
|
4
|
-
} from "./ActionBarCopy";
|
|
4
|
+
} from "./actionBar/ActionBarCopy";
|
|
5
5
|
export {
|
|
6
6
|
ActionBarEdit as Edit,
|
|
7
7
|
type ActionBarEditProps as EditProps,
|
|
8
|
-
} from "./ActionBarEdit";
|
|
8
|
+
} from "./actionBar/ActionBarEdit";
|
|
9
9
|
export {
|
|
10
10
|
ActionBarReload as Reload,
|
|
11
11
|
type ActionBarReloadProps as ReloadProps,
|
|
12
|
-
} from "./ActionBarReload";
|
|
12
|
+
} from "./actionBar/ActionBarReload";
|
|
13
13
|
export {
|
|
14
14
|
ActionBarFeedbackPositive as FeedbackPositive,
|
|
15
15
|
type ActionBarFeedbackPositiveProps as FeedbackPositiveProps,
|
|
16
|
-
} from "./ActionBarFeedbackPositive";
|
|
16
|
+
} from "./actionBar/ActionBarFeedbackPositive";
|
|
17
17
|
export {
|
|
18
18
|
ActionBarFeedbackNegative as FeedbackNegative,
|
|
19
19
|
type ActionBarFeedbackNegativeProps as FeedbackNegativeProps,
|
|
20
|
-
} from "./ActionBarFeedbackNegative";
|
|
20
|
+
} from "./actionBar/ActionBarFeedbackNegative";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export {
|
|
2
2
|
AttachmentRoot as Root,
|
|
3
3
|
type AttachmentRootProps as RootProps,
|
|
4
|
-
} from "./AttachmentRoot";
|
|
4
|
+
} from "./attachment/AttachmentRoot";
|
|
5
5
|
export {
|
|
6
6
|
AttachmentName as Name,
|
|
7
7
|
type AttachmentNameProps as NameProps,
|
|
8
|
-
} from "./AttachmentName";
|
|
8
|
+
} from "./attachment/AttachmentName";
|
|
9
9
|
export {
|
|
10
10
|
AttachmentThumb as Thumb,
|
|
11
11
|
type AttachmentThumbProps as ThumbProps,
|
|
12
|
-
} from "./AttachmentThumb";
|
|
12
|
+
} from "./attachment/AttachmentThumb";
|
|
13
13
|
export {
|
|
14
14
|
AttachmentRemove as Remove,
|
|
15
15
|
type AttachmentRemoveProps as RemoveProps,
|
|
16
|
-
} from "./AttachmentRemove";
|
|
16
|
+
} from "./attachment/AttachmentRemove";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import { Pressable, type PressableProps } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import { useAui, useAuiState } from "@assistant-ui/store";
|
|
3
|
+
import { useBranchPickerNext } from "@assistant-ui/core/react";
|
|
5
4
|
|
|
6
5
|
export type BranchPickerNextProps = Omit<PressableProps, "onPress"> & {
|
|
7
6
|
children: ReactNode;
|
|
@@ -12,22 +11,11 @@ export const BranchPickerNext = ({
|
|
|
12
11
|
disabled: disabledProp,
|
|
13
12
|
...pressableProps
|
|
14
13
|
}: BranchPickerNextProps) => {
|
|
15
|
-
const
|
|
16
|
-
const disabled = useAuiState((s) => {
|
|
17
|
-
if (s.message.branchNumber >= s.message.branchCount) return true;
|
|
18
|
-
if (s.thread.isRunning && !s.thread.capabilities.switchBranchDuringRun) {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
return false;
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const goToNext = useCallback(() => {
|
|
25
|
-
aui.message().switchToBranch({ position: "next" });
|
|
26
|
-
}, [aui]);
|
|
14
|
+
const { next, disabled } = useBranchPickerNext();
|
|
27
15
|
|
|
28
16
|
return (
|
|
29
17
|
<Pressable
|
|
30
|
-
onPress={
|
|
18
|
+
onPress={next}
|
|
31
19
|
disabled={disabledProp ?? disabled}
|
|
32
20
|
{...pressableProps}
|
|
33
21
|
>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import { Pressable, type PressableProps } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import { useAui, useAuiState } from "@assistant-ui/store";
|
|
3
|
+
import { useBranchPickerPrevious } from "@assistant-ui/core/react";
|
|
5
4
|
|
|
6
5
|
export type BranchPickerPreviousProps = Omit<PressableProps, "onPress"> & {
|
|
7
6
|
children: ReactNode;
|
|
@@ -12,22 +11,11 @@ export const BranchPickerPrevious = ({
|
|
|
12
11
|
disabled: disabledProp,
|
|
13
12
|
...pressableProps
|
|
14
13
|
}: BranchPickerPreviousProps) => {
|
|
15
|
-
const
|
|
16
|
-
const disabled = useAuiState((s) => {
|
|
17
|
-
if (s.message.branchNumber <= 1) return true;
|
|
18
|
-
if (s.thread.isRunning && !s.thread.capabilities.switchBranchDuringRun) {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
return false;
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const goToPrevious = useCallback(() => {
|
|
25
|
-
aui.message().switchToBranch({ position: "previous" });
|
|
26
|
-
}, [aui]);
|
|
14
|
+
const { previous, disabled } = useBranchPickerPrevious();
|
|
27
15
|
|
|
28
16
|
return (
|
|
29
17
|
<Pressable
|
|
30
|
-
onPress={
|
|
18
|
+
onPress={previous}
|
|
31
19
|
disabled={disabledProp ?? disabled}
|
|
32
20
|
{...pressableProps}
|
|
33
21
|
>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export {
|
|
2
2
|
BranchPickerPrevious as Previous,
|
|
3
3
|
type BranchPickerPreviousProps as PreviousProps,
|
|
4
|
-
} from "./BranchPickerPrevious";
|
|
4
|
+
} from "./branchPicker/BranchPickerPrevious";
|
|
5
5
|
export {
|
|
6
6
|
BranchPickerNext as Next,
|
|
7
7
|
type BranchPickerNextProps as NextProps,
|
|
8
|
-
} from "./BranchPickerNext";
|
|
8
|
+
} from "./branchPicker/BranchPickerNext";
|
|
9
9
|
export {
|
|
10
10
|
BranchPickerNumber as Number,
|
|
11
11
|
type BranchPickerNumberProps as NumberProps,
|
|
12
|
-
} from "./BranchPickerNumber";
|
|
12
|
+
} from "./branchPicker/BranchPickerNumber";
|
|
13
13
|
export {
|
|
14
14
|
BranchPickerCount as Count,
|
|
15
15
|
type BranchPickerCountProps as CountProps,
|
|
16
|
-
} from "./BranchPickerCount";
|
|
16
|
+
} from "./branchPicker/BranchPickerCount";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export {
|
|
2
2
|
ChainOfThoughtRoot as Root,
|
|
3
3
|
type ChainOfThoughtRootProps as RootProps,
|
|
4
|
-
} from "./ChainOfThoughtRoot";
|
|
4
|
+
} from "./chainOfThought/ChainOfThoughtRoot";
|
|
5
5
|
export {
|
|
6
6
|
ChainOfThoughtAccordionTrigger as AccordionTrigger,
|
|
7
7
|
type ChainOfThoughtAccordionTriggerProps as AccordionTriggerProps,
|
|
8
|
-
} from "./ChainOfThoughtAccordionTrigger";
|
|
8
|
+
} from "./chainOfThought/ChainOfThoughtAccordionTrigger";
|
|
9
9
|
export { ChainOfThoughtPrimitiveParts as Parts } from "@assistant-ui/core/react";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import { Pressable, type PressableProps } from "react-native";
|
|
3
|
-
import { useComposerAddAttachment } from "
|
|
4
|
-
import { useAuiState } from "@assistant-ui/store";
|
|
3
|
+
import { useComposerAddAttachment } from "@assistant-ui/core/react";
|
|
5
4
|
|
|
6
5
|
export type ComposerAddAttachmentProps = Omit<PressableProps, "onPress"> & {
|
|
7
6
|
children: ReactNode;
|
|
@@ -11,7 +10,7 @@ export type ComposerAddAttachmentProps = Omit<PressableProps, "onPress"> & {
|
|
|
11
10
|
* A button that triggers the attachment adding flow.
|
|
12
11
|
*
|
|
13
12
|
* Note: The actual file picker implementation is platform-specific.
|
|
14
|
-
* This component calls `useComposerAddAttachment()` from
|
|
13
|
+
* This component calls `useComposerAddAttachment()` from `@assistant-ui/core/react`.
|
|
15
14
|
* You must handle the file selection in your own component using the returned `addAttachment` callback.
|
|
16
15
|
*/
|
|
17
16
|
export const ComposerAddAttachment = ({
|
|
@@ -19,11 +18,10 @@ export const ComposerAddAttachment = ({
|
|
|
19
18
|
disabled: disabledProp,
|
|
20
19
|
...pressableProps
|
|
21
20
|
}: ComposerAddAttachmentProps) => {
|
|
22
|
-
const
|
|
23
|
-
const { addAttachment: _addAttachment } = useComposerAddAttachment();
|
|
21
|
+
const { disabled } = useComposerAddAttachment();
|
|
24
22
|
|
|
25
23
|
return (
|
|
26
|
-
<Pressable disabled={disabledProp ??
|
|
24
|
+
<Pressable disabled={disabledProp ?? disabled} {...pressableProps}>
|
|
27
25
|
{children}
|
|
28
26
|
</Pressable>
|
|
29
27
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import { Pressable, type PressableProps } from "react-native";
|
|
3
|
-
import { useComposerCancel } from "
|
|
3
|
+
import { useComposerCancel } from "@assistant-ui/core/react";
|
|
4
4
|
|
|
5
5
|
export type ComposerCancelProps = Omit<PressableProps, "onPress"> & {
|
|
6
6
|
children: ReactNode;
|
|
@@ -11,12 +11,12 @@ export const ComposerCancel = ({
|
|
|
11
11
|
disabled,
|
|
12
12
|
...pressableProps
|
|
13
13
|
}: ComposerCancelProps) => {
|
|
14
|
-
const { cancel,
|
|
14
|
+
const { cancel, disabled: hookDisabled } = useComposerCancel();
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
17
|
<Pressable
|
|
18
18
|
onPress={cancel}
|
|
19
|
-
disabled={disabled ??
|
|
19
|
+
disabled={disabled ?? hookDisabled}
|
|
20
20
|
{...pressableProps}
|
|
21
21
|
>
|
|
22
22
|
{children}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import { Pressable, type PressableProps } from "react-native";
|
|
3
|
-
import { useComposerSend } from "
|
|
3
|
+
import { useComposerSend } from "@assistant-ui/core/react";
|
|
4
4
|
|
|
5
5
|
export type ComposerSendProps = Omit<PressableProps, "onPress"> & {
|
|
6
6
|
children: ReactNode;
|
|
@@ -11,12 +11,12 @@ export const ComposerSend = ({
|
|
|
11
11
|
disabled,
|
|
12
12
|
...pressableProps
|
|
13
13
|
}: ComposerSendProps) => {
|
|
14
|
-
const { send,
|
|
14
|
+
const { send, disabled: hookDisabled } = useComposerSend();
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
17
|
<Pressable
|
|
18
18
|
onPress={send}
|
|
19
|
-
disabled={disabled ??
|
|
19
|
+
disabled={disabled ?? hookDisabled}
|
|
20
20
|
{...pressableProps}
|
|
21
21
|
>
|
|
22
22
|
{children}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
export {
|
|
2
2
|
ComposerRoot as Root,
|
|
3
3
|
type ComposerRootProps as RootProps,
|
|
4
|
-
} from "./ComposerRoot";
|
|
4
|
+
} from "./composer/ComposerRoot";
|
|
5
5
|
export {
|
|
6
6
|
ComposerAttachments as Attachments,
|
|
7
7
|
ComposerAttachmentByIndex as AttachmentByIndex,
|
|
8
|
-
} from "./ComposerAttachments";
|
|
8
|
+
} from "./composer/ComposerAttachments";
|
|
9
9
|
export {
|
|
10
10
|
ComposerInput as Input,
|
|
11
11
|
type ComposerInputProps as InputProps,
|
|
12
|
-
} from "./ComposerInput";
|
|
12
|
+
} from "./composer/ComposerInput";
|
|
13
13
|
export {
|
|
14
14
|
ComposerSend as Send,
|
|
15
15
|
type ComposerSendProps as SendProps,
|
|
16
|
-
} from "./ComposerSend";
|
|
16
|
+
} from "./composer/ComposerSend";
|
|
17
17
|
export {
|
|
18
18
|
ComposerCancel as Cancel,
|
|
19
19
|
type ComposerCancelProps as CancelProps,
|
|
20
|
-
} from "./ComposerCancel";
|
|
20
|
+
} from "./composer/ComposerCancel";
|
|
21
21
|
export {
|
|
22
22
|
ComposerAddAttachment as AddAttachment,
|
|
23
23
|
type ComposerAddAttachmentProps as AddAttachmentProps,
|
|
24
|
-
} from "./ComposerAddAttachment";
|
|
25
|
-
export { ComposerIf as If } from "./ComposerIf";
|
|
24
|
+
} from "./composer/ComposerAddAttachment";
|
|
25
|
+
export { ComposerIf as If } from "./composer/ComposerIf";
|