@assistant-ui/core 0.1.13 → 0.1.15
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/adapters/attachment.d.ts +6 -0
- package/dist/adapters/attachment.d.ts.map +1 -1
- package/dist/adapters/attachment.js +54 -9
- package/dist/adapters/attachment.js.map +1 -1
- package/dist/adapters/{mention.d.ts → directive-formatter.d.ts} +2 -4
- package/dist/adapters/directive-formatter.d.ts.map +1 -0
- package/dist/adapters/{mention.js → directive-formatter.js} +4 -9
- package/dist/adapters/directive-formatter.js.map +1 -0
- package/dist/adapters/index.d.ts +1 -3
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +2 -1
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/speech.d.ts.map +1 -1
- package/dist/adapters/speech.js +1 -3
- package/dist/adapters/speech.js.map +1 -1
- package/dist/adapters/thread-history.d.ts +1 -0
- package/dist/adapters/thread-history.d.ts.map +1 -1
- package/dist/adapters/trigger.d.ts +1 -18
- package/dist/adapters/trigger.d.ts.map +1 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/model-context/frame/host.d.ts +1 -1
- package/dist/model-context/frame/host.d.ts.map +1 -1
- package/dist/model-context/frame/host.js +1 -0
- package/dist/model-context/frame/host.js.map +1 -1
- package/dist/model-context/frame/provider.d.ts +1 -1
- package/dist/model-context/frame/provider.d.ts.map +1 -1
- package/dist/model-context/frame/provider.js +1 -0
- package/dist/model-context/frame/provider.js.map +1 -1
- package/dist/model-context/registry.d.ts +2 -2
- package/dist/model-context/registry.d.ts.map +1 -1
- package/dist/model-context/tool.d.ts +1 -1
- package/dist/model-context/tool.d.ts.map +1 -1
- package/dist/model-context/types.d.ts +1 -1
- package/dist/model-context/types.d.ts.map +1 -1
- package/dist/model-context/types.js +0 -3
- package/dist/model-context/types.js.map +1 -1
- package/dist/react/AssistantRuntimeProvider.d.ts +1 -1
- package/dist/react/AssistantRuntimeProvider.d.ts.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.js.map +1 -1
- package/dist/react/client/DataRenderers.d.ts +1 -1
- package/dist/react/client/DataRenderers.d.ts.map +1 -1
- package/dist/react/client/DataRenderers.js +14 -0
- package/dist/react/client/DataRenderers.js.map +1 -1
- package/dist/react/client/Tools.d.ts +1 -1
- package/dist/react/client/Tools.d.ts.map +1 -1
- package/dist/react/client/Tools.js +1 -0
- package/dist/react/client/Tools.js.map +1 -1
- package/dist/react/model-context/makeAssistantTool.d.ts +1 -1
- package/dist/react/model-context/makeAssistantTool.d.ts.map +1 -1
- package/dist/react/model-context/makeAssistantToolUI.d.ts +1 -1
- package/dist/react/model-context/makeAssistantToolUI.d.ts.map +1 -1
- package/dist/react/model-context/useInlineRender.d.ts +2 -2
- package/dist/react/model-context/useInlineRender.d.ts.map +1 -1
- package/dist/react/model-context/useInlineRender.js +1 -0
- package/dist/react/model-context/useInlineRender.js.map +1 -1
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.d.ts.map +1 -1
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.js +1 -0
- package/dist/react/primitives/chainOfThought/ChainOfThoughtParts.js.map +1 -1
- package/dist/react/primitives/composer/ComposerAttachments.d.ts +1 -1
- package/dist/react/primitives/composer/ComposerAttachments.d.ts.map +1 -1
- package/dist/react/primitives/composer/ComposerAttachments.js +1 -1
- package/dist/react/primitives/composer/ComposerAttachments.js.map +1 -1
- package/dist/react/primitives/message/MessageAttachments.d.ts +1 -1
- package/dist/react/primitives/message/MessageAttachments.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageAttachments.js +1 -1
- package/dist/react/primitives/message/MessageAttachments.js.map +1 -1
- package/dist/react/primitives/message/MessageParts.d.ts +1 -1
- package/dist/react/primitives/message/MessageParts.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageParts.js +16 -17
- package/dist/react/primitives/message/MessageParts.js.map +1 -1
- package/dist/react/primitives/part/PartMessages.d.ts +1 -1
- package/dist/react/primitives/part/PartMessages.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadMessages.d.ts +1 -1
- package/dist/react/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadMessages.js +2 -1
- package/dist/react/primitives/thread/ThreadMessages.js.map +1 -1
- package/dist/react/primitives/threadList/ThreadListItems.d.ts +1 -1
- package/dist/react/primitives/threadList/ThreadListItems.d.ts.map +1 -1
- package/dist/react/primitives/threadList/ThreadListItems.js +1 -1
- package/dist/react/primitives/threadList/ThreadListItems.js.map +1 -1
- package/dist/react/providers/AttachmentByIndexProvider.d.ts +1 -1
- package/dist/react/providers/AttachmentByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts +1 -1
- package/dist/react/providers/ChainOfThoughtByIndicesProvider.d.ts.map +1 -1
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts +1 -1
- package/dist/react/providers/ChainOfThoughtPartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/MessageByIndexProvider.d.ts +1 -1
- package/dist/react/providers/MessageByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/PartByIndexProvider.d.ts +1 -1
- package/dist/react/providers/PartByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/QueueItemByIndexProvider.d.ts +1 -1
- package/dist/react/providers/QueueItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/SuggestionByIndexProvider.d.ts +1 -1
- package/dist/react/providers/SuggestionByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/TextMessagePartProvider.d.ts +1 -1
- package/dist/react/providers/TextMessagePartProvider.d.ts.map +1 -1
- package/dist/react/providers/ThreadListItemByIndexProvider.d.ts +1 -1
- package/dist/react/providers/ThreadListItemByIndexProvider.d.ts.map +1 -1
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts +1 -1
- package/dist/react/providers/ThreadListItemRuntimeProvider.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts +3 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js +2 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts +5 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js +22 -7
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/react/runtimes/RuntimeAdapterProvider.d.ts +1 -1
- package/dist/react/runtimes/RuntimeAdapterProvider.d.ts.map +1 -1
- package/dist/react/runtimes/RuntimeAdapterProvider.js.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts +2 -2
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.d.ts +2 -2
- package/dist/react/runtimes/cloud/auiV0.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.js.map +1 -1
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.js +4 -1
- package/dist/react/runtimes/cloud/useCloudThreadListAdapter.js.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useLocalRuntime.js +10 -0
- package/dist/react/runtimes/useLocalRuntime.js.map +1 -1
- package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useRemoteThreadListRuntime.js +6 -0
- package/dist/react/runtimes/useRemoteThreadListRuntime.js.map +1 -1
- package/dist/react/runtimes/useToolInvocations.d.ts.map +1 -1
- package/dist/react/runtimes/useToolInvocations.js +2 -0
- package/dist/react/runtimes/useToolInvocations.js.map +1 -1
- package/dist/react/types/MessagePartComponentTypes.d.ts +1 -1
- package/dist/react/types/MessagePartComponentTypes.d.ts.map +1 -1
- package/dist/react/types/scopes/dataRenderers.d.ts +2 -0
- package/dist/react/types/scopes/dataRenderers.d.ts.map +1 -1
- package/dist/runtime/api/assistant-runtime.d.ts +1 -1
- package/dist/runtime/api/assistant-runtime.d.ts.map +1 -1
- package/dist/runtime/api/attachment-runtime.d.ts +0 -1
- package/dist/runtime/api/attachment-runtime.d.ts.map +1 -1
- package/dist/runtime/api/attachment-runtime.js +0 -3
- package/dist/runtime/api/attachment-runtime.js.map +1 -1
- package/dist/runtime/api/message-runtime.d.ts +6 -6
- package/dist/runtime/api/message-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-runtime.d.ts +4 -2
- package/dist/runtime/api/thread-list-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-runtime.js +5 -0
- package/dist/runtime/api/thread-list-runtime.js.map +1 -1
- package/dist/runtime/api/thread-runtime.d.ts +10 -9
- package/dist/runtime/api/thread-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-runtime.js +4 -3
- package/dist/runtime/api/thread-runtime.js.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts +2 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.js +26 -5
- package/dist/runtime/base/default-edit-composer-runtime-core.js.map +1 -1
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts +1 -0
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-runtime-core.d.ts +7 -0
- package/dist/runtime/interfaces/thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/internal.js +1 -4
- package/dist/runtime/internal.js.map +1 -1
- package/dist/runtime/utils/auto-status.d.ts +1 -1
- package/dist/runtime/utils/auto-status.d.ts.map +1 -1
- package/dist/runtime/utils/chat-model-adapter.d.ts +1 -1
- package/dist/runtime/utils/chat-model-adapter.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.d.ts +6 -0
- package/dist/runtime/utils/message-repository.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.js +17 -0
- package/dist/runtime/utils/message-repository.js.map +1 -1
- package/dist/runtime/utils/thread-message-like.d.ts +1 -1
- package/dist/runtime/utils/thread-message-like.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.js.map +1 -1
- package/dist/runtimes/assistant-transport/utils.d.ts +1 -1
- package/dist/runtimes/assistant-transport/utils.d.ts.map +1 -1
- package/dist/runtimes/assistant-transport/utils.js +1 -1
- package/dist/runtimes/assistant-transport/utils.js.map +1 -1
- package/dist/runtimes/external-store/external-store-adapter.d.ts +8 -0
- package/dist/runtimes/external-store/external-store-adapter.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.d.ts +1 -1
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.js +27 -25
- package/dist/runtimes/external-store/external-store-thread-list-runtime-core.js.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts +1 -0
- package/dist/runtimes/external-store/external-store-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js +4 -0
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts +2 -2
- package/dist/runtimes/remote-thread-list/adapter/in-memory.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/types.d.ts +1 -1
- package/dist/runtimes/remote-thread-list/types.d.ts.map +1 -1
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts +2 -2
- package/dist/store/runtime-clients/attachment-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.d.ts +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts +2 -2
- package/dist/store/runtime-clients/message-part-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.d.ts +1 -1
- package/dist/store/runtime-clients/message-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts +2 -2
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-runtime-client.js +1 -0
- package/dist/store/runtime-clients/thread-list-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.d.ts +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.d.ts.map +1 -1
- package/dist/store/scopes/threads.d.ts +1 -0
- package/dist/store/scopes/threads.d.ts.map +1 -1
- package/dist/subscribable/subscribable.d.ts.map +1 -1
- package/dist/subscribable/subscribable.js +1 -15
- package/dist/subscribable/subscribable.js.map +1 -1
- package/dist/tests/remote-thread-list-test-helpers.d.ts +12 -0
- package/dist/tests/remote-thread-list-test-helpers.d.ts.map +1 -0
- package/dist/tests/remote-thread-list-test-helpers.js +48 -0
- package/dist/tests/remote-thread-list-test-helpers.js.map +1 -0
- package/dist/types/directive.d.ts +19 -0
- package/dist/types/directive.d.ts.map +1 -0
- package/dist/types/directive.js +2 -0
- package/dist/types/directive.js.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/message.d.ts.map +1 -1
- package/dist/types/trigger.d.ts +2 -2
- package/dist/types/trigger.d.ts.map +1 -1
- package/dist/utils/json/is-json.d.ts +1 -1
- package/dist/utils/json/is-json.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/adapters/attachment.ts +68 -16
- package/src/adapters/{mention.ts → directive-formatter.ts} +8 -20
- package/src/adapters/index.ts +2 -9
- package/src/adapters/speech.ts +1 -16
- package/src/adapters/thread-history.ts +1 -8
- package/src/adapters/trigger.ts +1 -37
- package/src/index.ts +3 -24
- package/src/model-context/frame/host.ts +6 -5
- package/src/model-context/frame/provider.ts +6 -5
- package/src/model-context/registry.ts +6 -6
- package/src/model-context/tool.ts +1 -1
- package/src/model-context/types.ts +1 -17
- package/src/react/AssistantRuntimeProvider.tsx +1 -1
- package/src/react/adapters/LocalStorageThreadListAdapter.tsx +1 -1
- package/src/react/client/DataRenderers.ts +19 -3
- package/src/react/client/Tools.ts +4 -3
- package/src/react/model-context/makeAssistantTool.ts +1 -1
- package/src/react/model-context/makeAssistantToolUI.ts +1 -1
- package/src/react/model-context/useInlineRender.ts +3 -2
- package/src/react/primitives/chainOfThought/ChainOfThoughtParts.tsx +1 -0
- package/src/react/primitives/composer/ComposerAttachments.tsx +7 -1
- package/src/react/primitives/message/MessageAttachments.tsx +7 -1
- package/src/react/primitives/message/MessageParts.tsx +27 -17
- package/src/react/primitives/part/PartMessages.tsx +1 -1
- package/src/react/primitives/thread/ThreadMessages.tsx +3 -2
- package/src/react/primitives/threadList/ThreadListItems.tsx +7 -1
- package/src/react/providers/AttachmentByIndexProvider.tsx +1 -1
- package/src/react/providers/ChainOfThoughtByIndicesProvider.tsx +1 -1
- package/src/react/providers/ChainOfThoughtPartByIndexProvider.tsx +1 -1
- package/src/react/providers/MessageByIndexProvider.tsx +1 -1
- package/src/react/providers/PartByIndexProvider.tsx +1 -1
- package/src/react/providers/QueueItemByIndexProvider.tsx +1 -1
- package/src/react/providers/SuggestionByIndexProvider.tsx +1 -1
- package/src/react/providers/TextMessagePartProvider.tsx +1 -1
- package/src/react/providers/ThreadListItemByIndexProvider.tsx +1 -1
- package/src/react/providers/ThreadListItemRuntimeProvider.tsx +1 -1
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.tsx +7 -8
- package/src/react/runtimes/RemoteThreadListThreadListRuntimeCore.tsx +28 -8
- package/src/react/runtimes/RuntimeAdapterProvider.tsx +1 -1
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.ts +3 -3
- package/src/react/runtimes/cloud/auiV0.ts +5 -2
- package/src/react/runtimes/cloud/useCloudThreadListAdapter.tsx +6 -3
- package/src/react/runtimes/useLocalRuntime.ts +10 -0
- package/src/react/runtimes/useRemoteThreadListRuntime.ts +6 -0
- package/src/react/runtimes/useToolInvocations.ts +2 -0
- package/src/react/types/MessagePartComponentTypes.ts +1 -1
- package/src/react/types/scopes/dataRenderers.ts +2 -0
- package/src/runtime/api/assistant-runtime.ts +1 -1
- package/src/runtime/api/attachment-runtime.ts +0 -4
- package/src/runtime/api/message-runtime.ts +8 -8
- package/src/runtime/api/thread-list-runtime.ts +13 -5
- package/src/runtime/api/thread-runtime.ts +13 -12
- package/src/runtime/base/base-thread-runtime-core.ts +1 -1
- package/src/runtime/base/default-edit-composer-runtime-core.ts +35 -5
- package/src/runtime/interfaces/thread-list-runtime-core.ts +1 -0
- package/src/runtime/interfaces/thread-runtime-core.ts +7 -0
- package/src/runtime/internal.ts +1 -4
- package/src/runtime/utils/auto-status.ts +1 -1
- package/src/runtime/utils/chat-model-adapter.ts +1 -1
- package/src/runtime/utils/message-repository.ts +26 -0
- package/src/runtime/utils/thread-message-like.ts +4 -1
- package/src/runtimes/assistant-transport/utils.ts +5 -1
- package/src/runtimes/external-store/external-store-adapter.ts +8 -0
- package/src/runtimes/external-store/external-store-thread-list-runtime-core.ts +35 -29
- package/src/runtimes/external-store/external-store-thread-runtime-core.ts +4 -0
- package/src/runtimes/remote-thread-list/adapter/in-memory.ts +2 -2
- package/src/runtimes/remote-thread-list/types.ts +1 -1
- package/src/store/runtime-clients/attachment-runtime-client.ts +2 -2
- package/src/store/runtime-clients/composer-runtime-client.ts +2 -2
- package/src/store/runtime-clients/message-part-runtime-client.ts +2 -2
- package/src/store/runtime-clients/message-runtime-client.ts +2 -2
- package/src/store/runtime-clients/thread-list-item-runtime-client.ts +1 -1
- package/src/store/runtime-clients/thread-list-runtime-client.ts +4 -3
- package/src/store/runtime-clients/thread-runtime-client.ts +3 -3
- package/src/store/scopes/threads.ts +1 -0
- package/src/subscribable/subscribable.ts +1 -24
- package/src/tests/MessageRepository.test.ts +141 -0
- package/src/tests/OptimisticState-list-race.test.ts +5 -9
- package/src/tests/RemoteThreadListThreadListRuntimeCore-reload.test.ts +209 -0
- package/src/tests/RemoteThreadListThreadListRuntimeCore-switchToThread-dedupe.test.ts +139 -0
- package/src/tests/attachment.test.ts +180 -0
- package/src/tests/default-edit-composer-runtime-core.test.ts +312 -0
- package/src/tests/{mention-formatter.test.ts → directive-formatter.test.ts} +26 -1
- package/src/tests/external-store-thread-list-runtime-core.test.ts +212 -0
- package/src/tests/get-thread-state-isRunning.test.ts +93 -0
- package/src/tests/remote-thread-list-isLoading.test.ts +6 -10
- package/src/tests/remote-thread-list-test-helpers.ts +70 -0
- package/src/tests/thread-list-runtime-getLoadThreadsPromise.test.ts +17 -1
- package/src/types/directive.ts +19 -0
- package/src/types/index.ts +1 -3
- package/src/types/message.ts +0 -12
- package/src/types/trigger.ts +2 -10
- package/src/utils/json/is-json.ts +1 -1
- package/dist/adapters/mention.d.ts.map +0 -1
- package/dist/adapters/mention.js.map +0 -1
- package/dist/types/mention.d.ts +0 -21
- package/dist/types/mention.d.ts.map +0 -1
- package/dist/types/mention.js +0 -2
- package/dist/types/mention.js.map +0 -1
- package/src/types/mention.ts +0 -39
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/types/message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,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AAEF,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG;IACtD,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC"}
|
package/dist/types/trigger.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { ReadonlyJSONObject } from "assistant-stream/utils";
|
|
2
|
+
/** A selectable item displayed inside a trigger popover (e.g. mention, slash command). */
|
|
2
3
|
export type Unstable_TriggerItem = {
|
|
3
4
|
readonly id: string;
|
|
4
5
|
readonly type: string;
|
|
5
6
|
readonly label: string;
|
|
6
|
-
readonly icon?: string | undefined;
|
|
7
7
|
readonly description?: string | undefined;
|
|
8
8
|
readonly metadata?: ReadonlyJSONObject | undefined;
|
|
9
9
|
};
|
|
10
|
+
/** A grouping of trigger items shown in a trigger popover. */
|
|
10
11
|
export type Unstable_TriggerCategory = {
|
|
11
12
|
readonly id: string;
|
|
12
13
|
readonly label: string;
|
|
13
|
-
readonly icon?: string | undefined;
|
|
14
14
|
};
|
|
15
15
|
//# sourceMappingURL=trigger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../src/types/trigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../src/types/trigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,0FAA0F;AAC1F,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;CACpD,CAAC;AAEF,8DAA8D;AAC9D,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReadonlyJSONArray, ReadonlyJSONObject, ReadonlyJSONValue } from "assistant-stream/utils";
|
|
1
|
+
import type { ReadonlyJSONArray, ReadonlyJSONObject, ReadonlyJSONValue } from "assistant-stream/utils";
|
|
2
2
|
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
3
3
|
export declare function isJSONValue(value: unknown, currentDepth?: number): value is ReadonlyJSONValue;
|
|
4
4
|
export declare function isJSONArray(value: unknown): value is ReadonlyJSONArray;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-json.d.ts","sourceRoot":"","sources":["../../../src/utils/json/is-json.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"is-json.d.ts","sourceRoot":"","sources":["../../../src/utils/json/is-json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,OAAO,EACd,YAAY,GAAE,MAAU,GACvB,KAAK,IAAI,iBAAiB,CA+B5B;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAEtE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB,CAOxE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-ui/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "Framework-agnostic core runtime for assistant-ui",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"assistant",
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
],
|
|
48
48
|
"sideEffects": false,
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"assistant-stream": "^0.3.
|
|
51
|
-
"nanoid": "^5.1.
|
|
50
|
+
"assistant-stream": "^0.3.12",
|
|
51
|
+
"nanoid": "^5.1.9"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@assistant-ui/store": "^0.2.
|
|
55
|
-
"@assistant-ui/tap": "^0.5.
|
|
54
|
+
"@assistant-ui/store": "^0.2.8",
|
|
55
|
+
"@assistant-ui/tap": "^0.5.9",
|
|
56
56
|
"@types/react": "*",
|
|
57
57
|
"react": "^18 || ^19",
|
|
58
|
-
"assistant-cloud": "^0.1.
|
|
58
|
+
"assistant-cloud": "^0.1.27",
|
|
59
59
|
"zustand": "^5.0.11"
|
|
60
60
|
},
|
|
61
61
|
"peerDependenciesMeta": {
|
|
@@ -74,13 +74,13 @@
|
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@types/react": "^19.2.14",
|
|
77
|
-
"react": "^19.2.
|
|
78
|
-
"vitest": "^4.1.
|
|
77
|
+
"react": "^19.2.5",
|
|
78
|
+
"vitest": "^4.1.5",
|
|
79
79
|
"zustand": "^5.0.12",
|
|
80
|
-
"@assistant-ui/store": "0.2.
|
|
81
|
-
"@assistant-ui/tap": "0.5.
|
|
82
|
-
"@assistant-ui/x-buildutils": "0.0.
|
|
83
|
-
"assistant-cloud": "0.1.
|
|
80
|
+
"@assistant-ui/store": "0.2.8",
|
|
81
|
+
"@assistant-ui/tap": "0.5.9",
|
|
82
|
+
"@assistant-ui/x-buildutils": "0.0.6",
|
|
83
|
+
"assistant-cloud": "0.1.27"
|
|
84
84
|
},
|
|
85
85
|
"publishConfig": {
|
|
86
86
|
"access": "public",
|
|
@@ -3,10 +3,8 @@ import type {
|
|
|
3
3
|
PendingAttachment,
|
|
4
4
|
CompleteAttachment,
|
|
5
5
|
} from "../types/attachment";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// Adapter Type
|
|
9
|
-
// =============================================================================
|
|
6
|
+
import type { ThreadUserMessagePart } from "../types/message";
|
|
7
|
+
import { generateId } from "../utils/id";
|
|
10
8
|
|
|
11
9
|
export type AttachmentAdapter = {
|
|
12
10
|
accept: string;
|
|
@@ -17,10 +15,6 @@ export type AttachmentAdapter = {
|
|
|
17
15
|
send(attachment: PendingAttachment): Promise<CompleteAttachment>;
|
|
18
16
|
};
|
|
19
17
|
|
|
20
|
-
// =============================================================================
|
|
21
|
-
// Simple Image Attachment Adapter
|
|
22
|
-
// =============================================================================
|
|
23
|
-
|
|
24
18
|
export class SimpleImageAttachmentAdapter implements AttachmentAdapter {
|
|
25
19
|
public accept = "image/*";
|
|
26
20
|
|
|
@@ -63,10 +57,6 @@ const getFileDataURL = (file: File) =>
|
|
|
63
57
|
reader.readAsDataURL(file);
|
|
64
58
|
});
|
|
65
59
|
|
|
66
|
-
// =============================================================================
|
|
67
|
-
// Simple Text Attachment Adapter
|
|
68
|
-
// =============================================================================
|
|
69
|
-
|
|
70
60
|
export class SimpleTextAttachmentAdapter implements AttachmentAdapter {
|
|
71
61
|
public accept =
|
|
72
62
|
"text/plain,text/html,text/markdown,text/csv,text/xml,text/json,text/css";
|
|
@@ -110,10 +100,6 @@ const getFileText = (file: File) =>
|
|
|
110
100
|
reader.readAsText(file);
|
|
111
101
|
});
|
|
112
102
|
|
|
113
|
-
// =============================================================================
|
|
114
|
-
// Composite Attachment Adapter
|
|
115
|
-
// =============================================================================
|
|
116
|
-
|
|
117
103
|
export function fileMatchesAccept(
|
|
118
104
|
file: { name: string; type: string },
|
|
119
105
|
acceptString: string,
|
|
@@ -149,6 +135,72 @@ export function fileMatchesAccept(
|
|
|
149
135
|
return false;
|
|
150
136
|
}
|
|
151
137
|
|
|
138
|
+
export function attachmentsEqual(
|
|
139
|
+
a: readonly CompleteAttachment[],
|
|
140
|
+
b: readonly CompleteAttachment[],
|
|
141
|
+
): boolean {
|
|
142
|
+
if (a.length !== b.length) return false;
|
|
143
|
+
return a.every((att, i) => att.id === b[i]!.id);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export function partToCompleteAttachment(
|
|
147
|
+
part: Exclude<ThreadUserMessagePart, { type: "text" }>,
|
|
148
|
+
): CompleteAttachment {
|
|
149
|
+
const id = generateId();
|
|
150
|
+
|
|
151
|
+
if (part.type === "image") {
|
|
152
|
+
return {
|
|
153
|
+
id,
|
|
154
|
+
type: "image",
|
|
155
|
+
name: part.filename ?? "image",
|
|
156
|
+
content: [part],
|
|
157
|
+
status: { type: "complete" },
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (part.type === "file") {
|
|
162
|
+
return {
|
|
163
|
+
id,
|
|
164
|
+
type: "document",
|
|
165
|
+
name: part.filename ?? "document",
|
|
166
|
+
contentType: part.mimeType,
|
|
167
|
+
content: [part],
|
|
168
|
+
status: { type: "complete" },
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (part.type === "audio") {
|
|
173
|
+
return {
|
|
174
|
+
id,
|
|
175
|
+
type: "audio",
|
|
176
|
+
name: `audio.${part.audio.format}`,
|
|
177
|
+
contentType: `audio/${part.audio.format}`,
|
|
178
|
+
content: [part],
|
|
179
|
+
status: { type: "complete" },
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
id,
|
|
185
|
+
type: "data",
|
|
186
|
+
name: part.name,
|
|
187
|
+
content: [part],
|
|
188
|
+
status: { type: "complete" },
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export function liftNonTextParts(
|
|
193
|
+
content: readonly ThreadUserMessagePart[],
|
|
194
|
+
): CompleteAttachment[] {
|
|
195
|
+
const result: CompleteAttachment[] = [];
|
|
196
|
+
for (const part of content) {
|
|
197
|
+
if (part.type !== "text") {
|
|
198
|
+
result.push(partToCompleteAttachment(part));
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return result;
|
|
202
|
+
}
|
|
203
|
+
|
|
152
204
|
export class CompositeAttachmentAdapter implements AttachmentAdapter {
|
|
153
205
|
private _adapters: AttachmentAdapter[];
|
|
154
206
|
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
Unstable_MentionItem,
|
|
3
|
-
Unstable_DirectiveSegment,
|
|
4
2
|
Unstable_DirectiveFormatter,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// =============================================================================
|
|
9
|
-
// Mention Adapter — alias of the generic TriggerAdapter
|
|
10
|
-
// =============================================================================
|
|
11
|
-
|
|
12
|
-
export type Unstable_MentionAdapter = Unstable_TriggerAdapter;
|
|
13
|
-
|
|
14
|
-
// =============================================================================
|
|
15
|
-
// Default Directive Formatter
|
|
16
|
-
// =============================================================================
|
|
3
|
+
Unstable_DirectiveSegment,
|
|
4
|
+
} from "../types/directive";
|
|
5
|
+
import type { Unstable_TriggerItem } from "../types/trigger";
|
|
17
6
|
|
|
18
|
-
const DIRECTIVE_RE =
|
|
7
|
+
const DIRECTIVE_RE =
|
|
8
|
+
/:([\w-]{1,64})\[([^\]\n]{1,1024})\](?:\{name=([^}\n]{1,1024})\})?/gu;
|
|
19
9
|
|
|
20
10
|
/**
|
|
21
11
|
* Default directive formatter using the `:type[label]{name=id}` syntax.
|
|
@@ -23,7 +13,7 @@ const DIRECTIVE_RE = /:([\w-]+)\[([^\]]+)\](?:\{name=([^}]+)\})?/g;
|
|
|
23
13
|
* When `id` equals `label`, the `{name=…}` attribute is omitted for brevity.
|
|
24
14
|
*/
|
|
25
15
|
export const unstable_defaultDirectiveFormatter: Unstable_DirectiveFormatter = {
|
|
26
|
-
serialize(item:
|
|
16
|
+
serialize(item: Unstable_TriggerItem): string {
|
|
27
17
|
const attrs = item.id !== item.label ? `{name=${item.id}}` : "";
|
|
28
18
|
return `:${item.type}[${item.label}]${attrs}`;
|
|
29
19
|
},
|
|
@@ -32,9 +22,7 @@ export const unstable_defaultDirectiveFormatter: Unstable_DirectiveFormatter = {
|
|
|
32
22
|
const segments: Unstable_DirectiveSegment[] = [];
|
|
33
23
|
let lastIndex = 0;
|
|
34
24
|
|
|
35
|
-
DIRECTIVE_RE
|
|
36
|
-
let match: RegExpExecArray | null;
|
|
37
|
-
while ((match = DIRECTIVE_RE.exec(text)) !== null) {
|
|
25
|
+
for (const match of text.matchAll(DIRECTIVE_RE)) {
|
|
38
26
|
if (match.index > lastIndex) {
|
|
39
27
|
segments.push({
|
|
40
28
|
kind: "text",
|
|
@@ -48,7 +36,7 @@ export const unstable_defaultDirectiveFormatter: Unstable_DirectiveFormatter = {
|
|
|
48
36
|
label,
|
|
49
37
|
id: match[3] ?? label,
|
|
50
38
|
});
|
|
51
|
-
lastIndex =
|
|
39
|
+
lastIndex = match.index + match[0].length;
|
|
52
40
|
}
|
|
53
41
|
|
|
54
42
|
if (lastIndex < text.length) {
|
package/src/adapters/index.ts
CHANGED
|
@@ -27,15 +27,8 @@ export type { SuggestionAdapter } from "./suggestion";
|
|
|
27
27
|
// Trigger adapter (generic)
|
|
28
28
|
export type { Unstable_TriggerAdapter } from "./trigger";
|
|
29
29
|
|
|
30
|
-
//
|
|
31
|
-
export
|
|
32
|
-
Unstable_SlashCommandAdapter,
|
|
33
|
-
Unstable_SlashCommandItem,
|
|
34
|
-
} from "./trigger";
|
|
35
|
-
|
|
36
|
-
// Mention adapter
|
|
37
|
-
export type { Unstable_MentionAdapter } from "./mention";
|
|
38
|
-
export { unstable_defaultDirectiveFormatter } from "./mention";
|
|
30
|
+
// Directive formatter
|
|
31
|
+
export { unstable_defaultDirectiveFormatter } from "./directive-formatter";
|
|
39
32
|
|
|
40
33
|
// Thread history adapters
|
|
41
34
|
export type {
|
package/src/adapters/speech.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { Unsubscribe } from "../types/unsubscribe";
|
|
2
2
|
|
|
3
|
-
// =============================================================================
|
|
4
|
-
// Speech Synthesis Adapter
|
|
5
|
-
// =============================================================================
|
|
6
|
-
|
|
7
3
|
export namespace SpeechSynthesisAdapter {
|
|
8
4
|
export type Status =
|
|
9
5
|
| {
|
|
@@ -26,10 +22,6 @@ export type SpeechSynthesisAdapter = {
|
|
|
26
22
|
speak: (text: string) => SpeechSynthesisAdapter.Utterance;
|
|
27
23
|
};
|
|
28
24
|
|
|
29
|
-
// =============================================================================
|
|
30
|
-
// Dictation Adapter
|
|
31
|
-
// =============================================================================
|
|
32
|
-
|
|
33
25
|
export namespace DictationAdapter {
|
|
34
26
|
export type Status =
|
|
35
27
|
| {
|
|
@@ -60,10 +52,6 @@ export type DictationAdapter = {
|
|
|
60
52
|
disableInputDuringDictation?: boolean;
|
|
61
53
|
};
|
|
62
54
|
|
|
63
|
-
// =============================================================================
|
|
64
|
-
// Web Speech Synthesis Adapter
|
|
65
|
-
// =============================================================================
|
|
66
|
-
|
|
67
55
|
export class WebSpeechSynthesisAdapter implements SpeechSynthesisAdapter {
|
|
68
56
|
speak(text: string): SpeechSynthesisAdapter.Utterance {
|
|
69
57
|
const utterance = new SpeechSynthesisUtterance(text);
|
|
@@ -76,6 +64,7 @@ export class WebSpeechSynthesisAdapter implements SpeechSynthesisAdapter {
|
|
|
76
64
|
if (res.status.type === "ended") return;
|
|
77
65
|
|
|
78
66
|
res.status = { type: "ended", reason, error };
|
|
67
|
+
// biome-ignore lint/suspicious/useIterableCallbackReturn: forEach callback intentionally has no return
|
|
79
68
|
subscribers.forEach((handler) => handler());
|
|
80
69
|
};
|
|
81
70
|
|
|
@@ -111,10 +100,6 @@ export class WebSpeechSynthesisAdapter implements SpeechSynthesisAdapter {
|
|
|
111
100
|
}
|
|
112
101
|
}
|
|
113
102
|
|
|
114
|
-
// =============================================================================
|
|
115
|
-
// Web Speech Dictation Adapter
|
|
116
|
-
// =============================================================================
|
|
117
|
-
|
|
118
103
|
interface SpeechRecognitionResultItem {
|
|
119
104
|
transcript: string;
|
|
120
105
|
confidence: number;
|
|
@@ -7,10 +7,6 @@ import type {
|
|
|
7
7
|
ExportedMessageRepositoryItem,
|
|
8
8
|
} from "../runtime/utils/message-repository";
|
|
9
9
|
|
|
10
|
-
// =============================================================================
|
|
11
|
-
// Message Format Adapter
|
|
12
|
-
// =============================================================================
|
|
13
|
-
|
|
14
10
|
export interface MessageStorageEntry<TPayload> {
|
|
15
11
|
id: string;
|
|
16
12
|
parent_id: string | null;
|
|
@@ -40,10 +36,6 @@ export interface MessageFormatAdapter<
|
|
|
40
36
|
getId(message: TMessage): string;
|
|
41
37
|
}
|
|
42
38
|
|
|
43
|
-
// =============================================================================
|
|
44
|
-
// Thread History Adapter
|
|
45
|
-
// =============================================================================
|
|
46
|
-
|
|
47
39
|
export type GenericThreadHistoryAdapter<TMessage> = {
|
|
48
40
|
load(): Promise<MessageFormatRepository<TMessage>>;
|
|
49
41
|
append(item: MessageFormatItem<TMessage>): Promise<void>;
|
|
@@ -66,6 +58,7 @@ export type ThreadHistoryAdapter = {
|
|
|
66
58
|
options: ChatModelRunOptions,
|
|
67
59
|
): AsyncGenerator<ChatModelRunResult, void, unknown>;
|
|
68
60
|
append(item: ExportedMessageRepositoryItem): Promise<void>;
|
|
61
|
+
/** Required when used with `useAISDKRuntime` / `useChatRuntime`. */
|
|
69
62
|
withFormat?<TMessage, TStorageFormat extends Record<string, unknown>>(
|
|
70
63
|
formatAdapter: MessageFormatAdapter<TMessage, TStorageFormat>,
|
|
71
64
|
): GenericThreadHistoryAdapter<TMessage>;
|
package/src/adapters/trigger.ts
CHANGED
|
@@ -3,18 +3,7 @@ import type {
|
|
|
3
3
|
Unstable_TriggerItem,
|
|
4
4
|
} from "../types/trigger";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
// Trigger Adapter — generic adapter for any trigger-based popover
|
|
8
|
-
// =============================================================================
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Adapter for providing categories and items to a trigger popover.
|
|
12
|
-
*
|
|
13
|
-
* All methods are synchronous by design — the adapter drives UI display and
|
|
14
|
-
* must return data immediately. Use external state management (e.g. React
|
|
15
|
-
* Query, SWR, or local state) to handle async data fetching, then expose
|
|
16
|
-
* the loaded results synchronously through this adapter.
|
|
17
|
-
*/
|
|
6
|
+
/** Adapter providing synchronous categories and items to a trigger popover. */
|
|
18
7
|
export type Unstable_TriggerAdapter = {
|
|
19
8
|
/** Return the top-level categories for the trigger popover. */
|
|
20
9
|
categories(): readonly Unstable_TriggerCategory[];
|
|
@@ -25,28 +14,3 @@ export type Unstable_TriggerAdapter = {
|
|
|
25
14
|
/** Global search across all categories (optional). */
|
|
26
15
|
search?(query: string): readonly Unstable_TriggerItem[];
|
|
27
16
|
};
|
|
28
|
-
|
|
29
|
-
// =============================================================================
|
|
30
|
-
// Slash Command Item — extends TriggerItem with an execute callback
|
|
31
|
-
// =============================================================================
|
|
32
|
-
|
|
33
|
-
export type Unstable_SlashCommandItem = Unstable_TriggerItem & {
|
|
34
|
-
/** Action to execute when the command is selected. */
|
|
35
|
-
readonly execute?: (() => void) | undefined;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
// =============================================================================
|
|
39
|
-
// Slash Command Adapter — extends TriggerAdapter with narrower return types
|
|
40
|
-
// so consumers get SlashCommandItem directly without casting.
|
|
41
|
-
// =============================================================================
|
|
42
|
-
|
|
43
|
-
export type Unstable_SlashCommandAdapter = Omit<
|
|
44
|
-
Unstable_TriggerAdapter,
|
|
45
|
-
"categoryItems" | "search"
|
|
46
|
-
> & {
|
|
47
|
-
/** Return commands within a category. */
|
|
48
|
-
categoryItems(categoryId: string): readonly Unstable_SlashCommandItem[];
|
|
49
|
-
|
|
50
|
-
/** Global search across all categories (optional). */
|
|
51
|
-
search?(query: string): readonly Unstable_SlashCommandItem[];
|
|
52
|
-
};
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
// @assistant-ui/core - Framework-agnostic core runtime (public API)
|
|
2
2
|
|
|
3
|
-
// === types ===
|
|
4
|
-
|
|
5
3
|
export type {
|
|
6
4
|
// Message parts
|
|
7
5
|
TextMessagePart,
|
|
@@ -44,23 +42,17 @@ export type { Unsubscribe } from "./types/unsubscribe";
|
|
|
44
42
|
export type { QuoteInfo } from "./types/quote";
|
|
45
43
|
|
|
46
44
|
export type {
|
|
47
|
-
Unstable_MentionItem,
|
|
48
|
-
Unstable_MentionCategory,
|
|
49
45
|
Unstable_DirectiveSegment,
|
|
50
46
|
Unstable_DirectiveFormatter,
|
|
51
|
-
} from "./types/
|
|
47
|
+
} from "./types/directive";
|
|
52
48
|
|
|
53
49
|
export type {
|
|
54
50
|
Unstable_TriggerItem,
|
|
55
51
|
Unstable_TriggerCategory,
|
|
56
52
|
} from "./types/trigger";
|
|
57
53
|
|
|
58
|
-
// === trigger adapter ===
|
|
59
|
-
|
|
60
54
|
export type { Unstable_TriggerAdapter } from "./adapters/trigger";
|
|
61
55
|
|
|
62
|
-
// === model-context ===
|
|
63
|
-
|
|
64
56
|
export type {
|
|
65
57
|
// Language model settings
|
|
66
58
|
LanguageModelV1CallSettings,
|
|
@@ -94,8 +86,6 @@ export type {
|
|
|
94
86
|
} from "./model-context/frame/types";
|
|
95
87
|
export { FRAME_MESSAGE_CHANNEL } from "./model-context/frame/types";
|
|
96
88
|
|
|
97
|
-
// === adapters ===
|
|
98
|
-
|
|
99
89
|
// Attachment adapters
|
|
100
90
|
export type { AttachmentAdapter } from "./adapters/attachment";
|
|
101
91
|
export {
|
|
@@ -128,15 +118,8 @@ export type { FeedbackAdapter } from "./adapters/feedback";
|
|
|
128
118
|
// Suggestion adapter
|
|
129
119
|
export type { SuggestionAdapter } from "./adapters/suggestion";
|
|
130
120
|
|
|
131
|
-
//
|
|
132
|
-
export
|
|
133
|
-
export { unstable_defaultDirectiveFormatter } from "./adapters/mention";
|
|
134
|
-
|
|
135
|
-
// Slash command adapter
|
|
136
|
-
export type {
|
|
137
|
-
Unstable_SlashCommandAdapter,
|
|
138
|
-
Unstable_SlashCommandItem,
|
|
139
|
-
} from "./adapters/trigger";
|
|
121
|
+
// Directive formatter
|
|
122
|
+
export { unstable_defaultDirectiveFormatter } from "./adapters/directive-formatter";
|
|
140
123
|
|
|
141
124
|
// Thread history adapters
|
|
142
125
|
export type {
|
|
@@ -148,8 +131,6 @@ export type {
|
|
|
148
131
|
MessageStorageEntry,
|
|
149
132
|
} from "./adapters/thread-history";
|
|
150
133
|
|
|
151
|
-
// === runtime ===
|
|
152
|
-
|
|
153
134
|
// Path Types
|
|
154
135
|
export type {
|
|
155
136
|
ThreadListItemRuntimePath,
|
|
@@ -262,8 +243,6 @@ export {
|
|
|
262
243
|
export type { ExportedMessageRepositoryItem } from "./runtime/utils/message-repository";
|
|
263
244
|
export { ExportedMessageRepository } from "./runtime/utils/message-repository";
|
|
264
245
|
|
|
265
|
-
// === runtimes ===
|
|
266
|
-
|
|
267
246
|
// Local Runtime Options
|
|
268
247
|
export type { LocalRuntimeOptionsBase } from "./runtimes/local/local-runtime-options";
|
|
269
248
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ModelContextProvider, ModelContext } from "../types";
|
|
1
|
+
import type { ModelContextProvider, ModelContext } from "../types";
|
|
2
2
|
import type { Unsubscribe } from "../../types/unsubscribe";
|
|
3
|
-
import { Tool } from "assistant-stream";
|
|
3
|
+
import type { Tool } from "assistant-stream";
|
|
4
4
|
import {
|
|
5
|
-
FrameMessage,
|
|
5
|
+
type FrameMessage,
|
|
6
6
|
FRAME_MESSAGE_CHANNEL,
|
|
7
|
-
SerializedModelContext,
|
|
8
|
-
SerializedTool,
|
|
7
|
+
type SerializedModelContext,
|
|
8
|
+
type SerializedTool,
|
|
9
9
|
} from "./types";
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -175,6 +175,7 @@ export class AssistantFrameHost implements ModelContextProvider {
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
private notifySubscribers() {
|
|
178
|
+
// biome-ignore lint/suspicious/useIterableCallbackReturn: forEach callback intentionally has no return
|
|
178
179
|
this._subscribers.forEach((callback) => callback());
|
|
179
180
|
}
|
|
180
181
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ModelContextProvider, ModelContext } from "../types";
|
|
1
|
+
import type { ModelContextProvider, ModelContext } from "../types";
|
|
2
2
|
import type { Unsubscribe } from "../../types/unsubscribe";
|
|
3
|
-
import { Tool, toJSONSchema } from "assistant-stream";
|
|
3
|
+
import { type Tool, toJSONSchema } from "assistant-stream";
|
|
4
4
|
import {
|
|
5
|
-
FrameMessage,
|
|
5
|
+
type FrameMessage,
|
|
6
6
|
FRAME_MESSAGE_CHANNEL,
|
|
7
|
-
SerializedModelContext,
|
|
8
|
-
SerializedTool,
|
|
7
|
+
type SerializedModelContext,
|
|
8
|
+
type SerializedTool,
|
|
9
9
|
} from "./types";
|
|
10
10
|
|
|
11
11
|
const serializeTool = (tool: Tool<any, any>): SerializedTool => ({
|
|
@@ -179,6 +179,7 @@ export class AssistantFrameProvider {
|
|
|
179
179
|
const instance = AssistantFrameProvider._instance;
|
|
180
180
|
window.removeEventListener("message", instance.handleMessage);
|
|
181
181
|
|
|
182
|
+
// biome-ignore lint/suspicious/useIterableCallbackReturn: forEach callback intentionally has no return
|
|
182
183
|
instance._providerUnsubscribes.forEach((unsubscribe) => unsubscribe?.());
|
|
183
184
|
instance._providerUnsubscribes.clear();
|
|
184
185
|
instance._providers.clear();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Tool } from "assistant-stream";
|
|
1
|
+
import type { Tool } from "assistant-stream";
|
|
2
2
|
import {
|
|
3
|
-
ModelContext,
|
|
4
|
-
ModelContextProvider,
|
|
3
|
+
type ModelContext,
|
|
4
|
+
type ModelContextProvider,
|
|
5
5
|
mergeModelContexts,
|
|
6
|
-
AssistantToolProps,
|
|
7
|
-
AssistantInstructionsConfig,
|
|
6
|
+
type AssistantToolProps,
|
|
7
|
+
type AssistantInstructionsConfig,
|
|
8
8
|
} from "./types";
|
|
9
9
|
import type { Unsubscribe } from "../types/unsubscribe";
|
|
10
|
-
import {
|
|
10
|
+
import type {
|
|
11
11
|
ModelContextRegistryToolHandle,
|
|
12
12
|
ModelContextRegistryInstructionHandle,
|
|
13
13
|
ModelContextRegistryProviderHandle,
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { Unsubscribe } from "../types/unsubscribe";
|
|
2
|
-
import { Tool } from "assistant-stream";
|
|
3
|
-
|
|
4
|
-
// =============================================================================
|
|
5
|
-
// Language Model Settings
|
|
6
|
-
// =============================================================================
|
|
2
|
+
import type { Tool } from "assistant-stream";
|
|
7
3
|
|
|
8
4
|
export type LanguageModelV1CallSettings = {
|
|
9
5
|
maxTokens?: number;
|
|
@@ -21,10 +17,6 @@ export type LanguageModelConfig = {
|
|
|
21
17
|
modelName?: string;
|
|
22
18
|
};
|
|
23
19
|
|
|
24
|
-
// =============================================================================
|
|
25
|
-
// Model Context
|
|
26
|
-
// =============================================================================
|
|
27
|
-
|
|
28
20
|
export type ModelContext = {
|
|
29
21
|
priority?: number | undefined;
|
|
30
22
|
system?: string | undefined;
|
|
@@ -38,10 +30,6 @@ export type ModelContextProvider = {
|
|
|
38
30
|
subscribe?: (callback: () => void) => Unsubscribe;
|
|
39
31
|
};
|
|
40
32
|
|
|
41
|
-
// =============================================================================
|
|
42
|
-
// Tool & Instruction Config
|
|
43
|
-
// =============================================================================
|
|
44
|
-
|
|
45
33
|
export type AssistantToolProps<
|
|
46
34
|
TArgs extends Record<string, unknown>,
|
|
47
35
|
TResult,
|
|
@@ -60,10 +48,6 @@ export type AssistantContextConfig = {
|
|
|
60
48
|
disabled?: boolean | undefined;
|
|
61
49
|
};
|
|
62
50
|
|
|
63
|
-
// =============================================================================
|
|
64
|
-
// Merging
|
|
65
|
-
// =============================================================================
|
|
66
|
-
|
|
67
51
|
export const mergeModelContexts = (
|
|
68
52
|
configSet: Set<ModelContextProvider>,
|
|
69
53
|
): ModelContext => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode, memo } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import type { AssistantClient } from "@assistant-ui/store";
|
|
3
3
|
import type { AssistantRuntime } from "../runtime/api/assistant-runtime";
|
|
4
4
|
import { AssistantProviderBase } from "./AssistantProvider";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AssistantStream, createAssistantStream } from "assistant-stream";
|
|
2
|
-
import { FC, PropsWithChildren, useMemo } from "react";
|
|
2
|
+
import { type FC, type PropsWithChildren, useMemo } from "react";
|
|
3
3
|
import { useAui } from "@assistant-ui/store";
|
|
4
4
|
import type {
|
|
5
5
|
RemoteThreadInitializeResponse,
|