@assistant-ui/core 0.3.17 → 0.3.19
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.map +1 -1
- package/dist/adapters/attachment.js +5 -4
- package/dist/adapters/attachment.js.map +1 -1
- package/dist/adapters/speech.d.ts.map +1 -1
- package/dist/adapters/speech.js +13 -3
- package/dist/adapters/speech.js.map +1 -1
- package/dist/adapters/thread-history.d.ts +4 -0
- package/dist/adapters/thread-history.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +4 -3
- package/dist/internal.js +3 -2
- package/dist/model-context/frame/host.d.ts.map +1 -1
- package/dist/model-context/frame/host.js +35 -14
- package/dist/model-context/frame/host.js.map +1 -1
- package/dist/model-context/frame/provider.d.ts +2 -0
- package/dist/model-context/frame/provider.d.ts.map +1 -1
- package/dist/model-context/frame/provider.js +30 -7
- package/dist/model-context/frame/provider.js.map +1 -1
- package/dist/model-context/interactable-composer-metadata.d.ts.map +1 -1
- package/dist/model-context/interactable-composer-metadata.js +27 -18
- package/dist/model-context/interactable-composer-metadata.js.map +1 -1
- package/dist/model-context/registry.d.ts.map +1 -1
- package/dist/model-context/registry.js +3 -5
- package/dist/model-context/registry.js.map +1 -1
- package/dist/model-context/types.d.ts.map +1 -1
- package/dist/model-context/types.js +5 -4
- package/dist/model-context/types.js.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.d.ts.map +1 -1
- package/dist/react/adapters/LocalStorageThreadListAdapter.js +45 -7
- package/dist/react/adapters/LocalStorageThreadListAdapter.js.map +1 -1
- package/dist/react/client/DataRenderers.d.ts.map +1 -1
- package/dist/react/client/DataRenderers.js +20 -15
- package/dist/react/client/DataRenderers.js.map +1 -1
- package/dist/react/client/InMemoryThreadList.d.ts.map +1 -1
- package/dist/react/client/InMemoryThreadList.js +62 -56
- package/dist/react/client/InMemoryThreadList.js.map +1 -1
- package/dist/react/client/Interactables.d.ts.map +1 -1
- package/dist/react/client/Interactables.js +35 -32
- package/dist/react/client/Interactables.js.map +1 -1
- package/dist/react/client/RemoteThreadList.d.ts +1 -0
- package/dist/react/client/RemoteThreadList.d.ts.map +1 -1
- package/dist/react/client/RemoteThreadList.js +154 -143
- package/dist/react/client/RemoteThreadList.js.map +1 -1
- package/dist/react/client/Tools.d.ts.map +1 -1
- package/dist/react/client/Tools.js +18 -16
- package/dist/react/client/Tools.js.map +1 -1
- package/dist/react/client/interactable-model-context.d.ts.map +1 -1
- package/dist/react/client/interactable-model-context.js +3 -2
- package/dist/react/client/interactable-model-context.js.map +1 -1
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -2
- package/dist/react/interactables-legacy/Interactables.js +242 -121
- package/dist/react/interactables-legacy/Interactables.js.map +1 -1
- package/dist/react/interactables-legacy/useAssistantInteractable.d.ts.map +1 -1
- package/dist/react/interactables-legacy/useAssistantInteractable.js +3 -0
- package/dist/react/interactables-legacy/useAssistantInteractable.js.map +1 -1
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.d.ts.map +1 -1
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.js +11 -9
- package/dist/react/interactables-shared/useInteractablePersistenceQueue.js.map +1 -1
- package/dist/react/model-context/makeAssistantTool.d.ts +2 -2
- package/dist/react/model-context/makeAssistantTool.js +1 -1
- package/dist/react/model-context/makeAssistantTool.js.map +1 -1
- package/dist/react/model-context/useAssistantTool.d.ts +2 -2
- package/dist/react/model-context/useAssistantTool.js +1 -1
- package/dist/react/model-context/useAssistantTool.js.map +1 -1
- package/dist/react/model-context/useInteractable.d.ts.map +1 -1
- package/dist/react/model-context/useInteractable.js +4 -1
- package/dist/react/model-context/useInteractable.js.map +1 -1
- package/dist/react/model-context/useInteractableVersions.js +1 -1
- package/dist/react/model-context/useToolArgsStatus.d.ts.map +1 -1
- package/dist/react/model-context/useToolArgsStatus.js +2 -1
- package/dist/react/model-context/useToolArgsStatus.js.map +1 -1
- package/dist/react/primitives/message/MessageGroupedParts.d.ts +11 -2
- package/dist/react/primitives/message/MessageGroupedParts.d.ts.map +1 -1
- package/dist/react/primitives/message/MessageGroupedParts.js +3 -2
- package/dist/react/primitives/message/MessageGroupedParts.js.map +1 -1
- package/dist/react/primitives/part/PartMessages.d.ts +1 -0
- package/dist/react/primitives/part/PartMessages.d.ts.map +1 -1
- package/dist/react/primitives/part/PartMessages.js +1 -0
- package/dist/react/primitives/part/PartMessages.js.map +1 -1
- package/dist/react/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/react/primitives/thread/ThreadMessages.js +6 -5
- package/dist/react/primitives/thread/ThreadMessages.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.js +16 -8
- 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 +105 -104
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadResource.d.ts +1 -0
- package/dist/react/runtimes/RemoteThreadResource.d.ts.map +1 -1
- package/dist/react/runtimes/RemoteThreadResource.js +13 -11
- package/dist/react/runtimes/RemoteThreadResource.js.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts +5 -24
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js +354 -226
- package/dist/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts +1 -0
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js +22 -2
- package/dist/react/runtimes/cloud/CloudFileAttachmentAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.d.ts +40 -15
- package/dist/react/runtimes/cloud/auiV0.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/auiV0.js +62 -15
- package/dist/react/runtimes/cloud/auiV0.js.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts +2 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.d.ts.map +1 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.js +6 -1
- package/dist/react/runtimes/cloud/createCloudThreadListAdapter.js.map +1 -1
- package/dist/react/runtimes/cloud/sdkIdentity.d.ts +6 -0
- package/dist/react/runtimes/cloud/sdkIdentity.d.ts.map +1 -0
- package/dist/react/runtimes/cloud/sdkIdentity.js +9 -0
- package/dist/react/runtimes/cloud/sdkIdentity.js.map +1 -0
- package/dist/react/runtimes/external-message-converter.d.ts +12 -2
- package/dist/react/runtimes/external-message-converter.d.ts.map +1 -1
- package/dist/react/runtimes/external-message-converter.js +26 -61
- package/dist/react/runtimes/external-message-converter.js.map +1 -1
- package/dist/react/runtimes/useExternalStoreRuntime.js +75 -46
- package/dist/react/runtimes/useExternalStoreRuntime.js.map +1 -1
- package/dist/react/runtimes/useRemoteThreadListRuntime.d.ts.map +1 -1
- package/dist/react/runtimes/useRemoteThreadListRuntime.js +64 -24
- package/dist/react/runtimes/useRemoteThreadListRuntime.js.map +1 -1
- package/dist/react/utils/groupParts.d.ts +6 -1
- package/dist/react/utils/groupParts.d.ts.map +1 -1
- package/dist/react/utils/groupParts.js +6 -0
- package/dist/react/utils/groupParts.js.map +1 -1
- package/dist/react/utils/useJSONEqual.d.ts +3 -1
- package/dist/react/utils/useJSONEqual.d.ts.map +1 -1
- package/dist/react/utils/useJSONEqual.js +6 -1
- package/dist/react/utils/useJSONEqual.js.map +1 -1
- package/dist/react/utils/useJSONSchemaDependency.d.ts +7 -0
- package/dist/react/utils/useJSONSchemaDependency.d.ts.map +1 -0
- package/dist/react/utils/useJSONSchemaDependency.js +20 -0
- package/dist/react/utils/useJSONSchemaDependency.js.map +1 -0
- package/dist/runtime/api/thread-list-item-runtime.d.ts +7 -3
- package/dist/runtime/api/thread-list-item-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-item-runtime.js +2 -2
- package/dist/runtime/api/thread-list-item-runtime.js.map +1 -1
- package/dist/runtime/api/thread-list-runtime.d.ts +3 -0
- package/dist/runtime/api/thread-list-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-list-runtime.js +18 -14
- package/dist/runtime/api/thread-list-runtime.js.map +1 -1
- package/dist/runtime/api/thread-runtime.d.ts +4 -0
- package/dist/runtime/api/thread-runtime.d.ts.map +1 -1
- package/dist/runtime/api/thread-runtime.js +3 -6
- package/dist/runtime/api/thread-runtime.js.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.d.ts +1 -0
- package/dist/runtime/base/base-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.js +62 -22
- package/dist/runtime/base/base-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.d.ts +2 -0
- package/dist/runtime/base/base-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-thread-runtime-core.js +161 -69
- package/dist/runtime/base/base-thread-runtime-core.js.map +1 -1
- package/dist/runtime/interfaces/composer-runtime-core.d.ts +12 -5
- package/dist/runtime/interfaces/composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts +4 -1
- package/dist/runtime/interfaces/thread-list-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-runtime-core.d.ts +6 -0
- package/dist/runtime/interfaces/thread-runtime-core.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.d.ts +5 -0
- package/dist/runtime/queue/message-queue.d.ts.map +1 -1
- package/dist/runtime/queue/message-queue.js +61 -6
- package/dist/runtime/queue/message-queue.js.map +1 -1
- package/dist/runtime/utils/auto-status.d.ts +6 -2
- package/dist/runtime/utils/auto-status.d.ts.map +1 -1
- package/dist/runtime/utils/auto-status.js +12 -4
- package/dist/runtime/utils/auto-status.js.map +1 -1
- package/dist/runtime/utils/external-message-conversion.d.ts +16 -4
- package/dist/runtime/utils/external-message-conversion.d.ts.map +1 -1
- package/dist/runtime/utils/external-message-conversion.js +49 -13
- package/dist/runtime/utils/external-message-conversion.js.map +1 -1
- package/dist/runtime/utils/message-repository.d.ts +1 -0
- package/dist/runtime/utils/message-repository.d.ts.map +1 -1
- package/dist/runtime/utils/message-repository.js +18 -9
- package/dist/runtime/utils/message-repository.js.map +1 -1
- package/dist/runtime/utils/thread-message-like.d.ts +2 -1
- package/dist/runtime/utils/thread-message-like.d.ts.map +1 -1
- package/dist/runtime/utils/thread-message-like.js +5 -3
- package/dist/runtime/utils/thread-message-like.js.map +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 +21 -27
- 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.map +1 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js +8 -1
- package/dist/runtimes/external-store/external-store-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/internal.d.ts +3 -3
- package/dist/runtimes/internal.js +2 -2
- package/dist/runtimes/local/local-thread-runtime-core.d.ts +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.d.ts.map +1 -1
- package/dist/runtimes/local/local-thread-runtime-core.js +4 -1
- package/dist/runtimes/local/local-thread-runtime-core.js.map +1 -1
- package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts +18 -1
- package/dist/runtimes/remote-thread-list/remote-thread-state.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/remote-thread-state.js +130 -42
- package/dist/runtimes/remote-thread-list/remote-thread-state.js.map +1 -1
- package/dist/runtimes/remote-thread-list/title-generation.d.ts +49 -0
- package/dist/runtimes/remote-thread-list/title-generation.d.ts.map +1 -0
- package/dist/runtimes/remote-thread-list/title-generation.js +197 -0
- package/dist/runtimes/remote-thread-list/title-generation.js.map +1 -0
- package/dist/runtimes/remote-thread-list/title.d.ts +3 -1
- package/dist/runtimes/remote-thread-list/title.d.ts.map +1 -1
- package/dist/runtimes/remote-thread-list/title.js +9 -1
- package/dist/runtimes/remote-thread-list/title.js.map +1 -1
- package/dist/runtimes/remote-thread-list/types.d.ts +10 -0
- package/dist/runtimes/remote-thread-list/types.d.ts.map +1 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.d.ts.map +1 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.js +2 -1
- package/dist/runtimes/tool-invocations/ToolInvocationTracker.js.map +1 -1
- package/dist/store/clients/external-thread.d.ts.map +1 -1
- package/dist/store/clients/external-thread.js +260 -203
- package/dist/store/clients/external-thread.js.map +1 -1
- package/dist/store/clients/model-context-client.d.ts.map +1 -1
- package/dist/store/clients/model-context-client.js +2 -1
- package/dist/store/clients/model-context-client.js.map +1 -1
- package/dist/store/clients/single-thread-list.d.ts.map +1 -1
- package/dist/store/clients/single-thread-list.js +1 -0
- package/dist/store/clients/single-thread-list.js.map +1 -1
- package/dist/store/clients/suggestions.d.ts.map +1 -1
- package/dist/store/clients/suggestions.js +5 -4
- package/dist/store/clients/suggestions.js.map +1 -1
- package/dist/store/clients/thread-tasks.d.ts +13 -0
- package/dist/store/clients/thread-tasks.d.ts.map +1 -0
- package/dist/store/clients/thread-tasks.js +69 -0
- package/dist/store/clients/thread-tasks.js.map +1 -0
- package/dist/store/index.d.ts +3 -2
- package/dist/store/index.js +3 -3
- package/dist/store/primitive-predicates.d.ts.map +1 -1
- package/dist/store/primitive-predicates.js +4 -4
- package/dist/store/primitive-predicates.js.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.d.ts +1 -0
- package/dist/store/runtime-clients/composer-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/composer-runtime-client.js +97 -61
- package/dist/store/runtime-clients/composer-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.d.ts +1 -0
- package/dist/store/runtime-clients/message-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/message-runtime-client.js +221 -144
- package/dist/store/runtime-clients/message-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.js +1 -1
- package/dist/store/runtime-clients/thread-list-item-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/thread-list-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-list-runtime-client.js +54 -52
- package/dist/store/runtime-clients/thread-list-runtime-client.js.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.d.ts.map +1 -1
- package/dist/store/runtime-clients/thread-runtime-client.js +246 -126
- package/dist/store/runtime-clients/thread-runtime-client.js.map +1 -1
- package/dist/store/scope-registration.d.ts +2 -0
- package/dist/store/scope-registration.d.ts.map +1 -1
- package/dist/store/scopes/composer.d.ts +10 -2
- package/dist/store/scopes/composer.d.ts.map +1 -1
- package/dist/store/scopes/message.d.ts +30 -1
- package/dist/store/scopes/message.d.ts.map +1 -1
- package/dist/store/scopes/task.d.ts +36 -0
- package/dist/store/scopes/task.d.ts.map +1 -0
- package/dist/store/scopes/task.js +0 -0
- package/dist/store/scopes/thread-list-item.d.ts +2 -2
- package/dist/store/scopes/thread-list-item.d.ts.map +1 -1
- package/dist/store/scopes/thread.d.ts +28 -0
- package/dist/store/scopes/thread.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 +2 -1
- package/dist/subscribable/subscribable.d.ts.map +1 -1
- package/dist/subscribable/subscribable.js +23 -15
- package/dist/subscribable/subscribable.js.map +1 -1
- package/dist/types/attachment.d.ts +2 -1
- package/dist/types/attachment.d.ts.map +1 -1
- package/dist/types/attachment.js +2 -1
- package/dist/types/attachment.js.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/message.d.ts +8 -1
- package/dist/types/message.d.ts.map +1 -1
- package/dist/types/message.js.map +1 -1
- package/dist/utils/abortable-iterable.d.ts +19 -0
- package/dist/utils/abortable-iterable.d.ts.map +1 -0
- package/dist/utils/abortable-iterable.js +88 -0
- package/dist/utils/abortable-iterable.js.map +1 -0
- package/dist/utils/composite-context-provider.d.ts.map +1 -1
- package/dist/utils/composite-context-provider.js +20 -2
- package/dist/utils/composite-context-provider.js.map +1 -1
- package/dist/utils/getGroupStatus.d.ts +18 -2
- package/dist/utils/getGroupStatus.d.ts.map +1 -1
- package/dist/utils/getGroupStatus.js +32 -7
- package/dist/utils/getGroupStatus.js.map +1 -1
- package/dist/utils/record.d.ts +11 -0
- package/dist/utils/record.d.ts.map +1 -0
- package/dist/utils/record.js +12 -0
- package/dist/utils/record.js.map +1 -0
- package/dist/utils/wire-media.d.ts.map +1 -1
- package/dist/utils/wire-media.js +2 -2
- package/dist/utils/wire-media.js.map +1 -1
- package/package.json +11 -11
- package/src/adapters/attachment.test.ts +50 -1
- package/src/adapters/attachment.ts +7 -4
- package/src/adapters/speech.test.ts +236 -0
- package/src/adapters/speech.ts +17 -10
- package/src/adapters/thread-history.ts +3 -0
- package/src/index.ts +2 -0
- package/src/internal.ts +4 -0
- package/src/model-context/frame/host.test.ts +137 -1
- package/src/model-context/frame/host.ts +49 -16
- package/src/model-context/frame/provider.test.ts +71 -0
- package/src/model-context/frame/provider.ts +37 -7
- package/src/model-context/interactable-composer-metadata.test.ts +58 -0
- package/src/model-context/interactable-composer-metadata.ts +19 -13
- package/src/model-context/registry.test.ts +12 -0
- package/src/model-context/registry.ts +3 -2
- package/src/model-context/types.test.ts +25 -0
- package/src/model-context/types.ts +9 -4
- package/src/react/RuntimeAdapter.test.ts +34 -0
- package/src/react/adapters/LocalStorageThreadListAdapter.test.ts +244 -0
- package/src/react/adapters/LocalStorageThreadListAdapter.tsx +104 -7
- package/src/react/client/DataRenderers.test.tsx +45 -0
- package/src/react/client/DataRenderers.ts +13 -9
- package/src/react/client/InMemoryThreadList.ts +1 -0
- package/src/react/client/Interactables.test.ts +72 -1
- package/src/react/client/Interactables.ts +22 -14
- package/src/react/client/RemoteThreadList.background.test.ts +148 -6
- package/src/react/client/RemoteThreadList.concurrent.test.tsx +42 -1
- package/src/react/client/RemoteThreadList.test.ts +386 -4
- package/src/react/client/RemoteThreadList.ts +181 -112
- package/src/react/client/Tools.ts +22 -11
- package/src/react/client/interactable-model-context.test.ts +44 -0
- package/src/react/client/interactable-model-context.ts +3 -2
- package/src/react/index.ts +5 -1
- package/src/react/interactables-legacy/Interactables.ts +16 -16
- package/src/react/interactables-legacy/useAssistantInteractable.test.tsx +132 -0
- package/src/react/interactables-legacy/useAssistantInteractable.ts +10 -1
- package/src/react/interactables-shared/useInteractablePersistenceQueue.ts +9 -10
- package/src/react/model-context/makeAssistantTool.ts +2 -2
- package/src/react/model-context/useAssistantTool.ts +2 -2
- package/src/react/model-context/useInteractable.test.tsx +177 -0
- package/src/react/model-context/useInteractable.ts +3 -0
- package/src/react/model-context/useToolArgsStatus.test.tsx +30 -0
- package/src/react/model-context/useToolArgsStatus.ts +2 -1
- package/src/react/primitive-hooks/useActionBarCopy.test.ts +0 -1
- package/src/react/primitive-hooks/useSuggestionTrigger.test.ts +0 -1
- package/src/react/primitives/message/MessageGroupedParts.test.tsx +96 -0
- package/src/react/primitives/message/MessageGroupedParts.tsx +15 -4
- package/src/react/primitives/part/PartMessages.test.tsx +104 -1
- package/src/react/primitives/part/PartMessages.tsx +1 -0
- package/src/react/primitives/thread/ThreadMessages.test.tsx +142 -0
- package/src/react/primitives/thread/ThreadMessages.tsx +8 -5
- package/src/react/providers/ReadonlyThreadProvider.test.tsx +56 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.destroy.test.tsx +172 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.running.test.tsx +33 -0
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.test.tsx +7 -1
- package/src/react/runtimes/RemoteThreadListHookInstanceManager.tsx +28 -5
- package/src/react/runtimes/RemoteThreadListThreadListRuntimeCore.load-error.test.ts +132 -0
- package/src/react/runtimes/RemoteThreadListThreadListRuntimeCore.switch-delete.test.ts +105 -0
- package/src/react/runtimes/RemoteThreadListThreadListRuntimeCore.tsx +143 -112
- package/src/react/runtimes/RemoteThreadResource.test.ts +9 -0
- package/src/react/runtimes/RemoteThreadResource.ts +19 -12
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.test.ts +20 -14
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.test.tsx +703 -6
- package/src/react/runtimes/cloud/AssistantCloudThreadHistoryAdapter.ts +492 -402
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.test.ts +77 -0
- package/src/react/runtimes/cloud/CloudFileAttachmentAdapter.ts +27 -1
- package/src/react/runtimes/cloud/auiV0.ts +160 -25
- package/src/react/runtimes/cloud/createCloudThreadListAdapter.test.ts +36 -0
- package/src/react/runtimes/cloud/createCloudThreadListAdapter.ts +8 -1
- package/src/react/runtimes/cloud/sdkIdentity.ts +9 -0
- package/src/react/runtimes/cloud/useCloudThreadListAdapter.test.tsx +18 -4
- package/src/react/runtimes/external-message-converter.test.ts +136 -1
- package/src/react/runtimes/external-message-converter.ts +39 -93
- package/src/react/runtimes/useExternalStoreRuntime.lifecycle.test.tsx +41 -0
- package/src/react/runtimes/useExternalStoreRuntime.ts +10 -4
- package/src/react/runtimes/useLocalRuntime.test.tsx +20 -0
- package/src/react/runtimes/useRemoteThreadListRuntime.load-error.test.tsx +108 -0
- package/src/react/runtimes/useRemoteThreadListRuntime.ts +34 -1
- package/src/react/utils/groupParts.ts +12 -1
- package/src/react/utils/useJSONEqual.ts +9 -0
- package/src/react/utils/useJSONSchemaDependency.ts +22 -0
- package/src/runtime/api/message-runtime.test.ts +75 -0
- package/src/runtime/api/thread-list-item-runtime.ts +10 -3
- package/src/runtime/api/thread-list-runtime.ts +21 -11
- package/src/runtime/api/thread-runtime.test.ts +136 -0
- package/src/runtime/api/thread-runtime.ts +10 -5
- package/src/runtime/base/base-composer-runtime-core.ts +105 -24
- package/src/runtime/base/base-thread-runtime-core.test.ts +1063 -2
- package/src/runtime/base/base-thread-runtime-core.ts +228 -87
- package/src/runtime/interfaces/composer-runtime-core.ts +10 -5
- package/src/runtime/interfaces/thread-list-runtime-core.ts +5 -1
- package/src/runtime/interfaces/thread-runtime-core.ts +6 -0
- package/src/runtime/queue/message-queue.ts +68 -6
- package/src/runtime/utils/auto-status.test.ts +112 -1
- package/src/runtime/utils/auto-status.ts +31 -5
- package/src/runtime/utils/external-message-conversion.test.ts +202 -0
- package/src/runtime/utils/external-message-conversion.ts +123 -32
- package/src/runtime/utils/message-repository.test.ts +49 -0
- package/src/runtime/utils/message-repository.ts +32 -20
- package/src/runtime/utils/thread-message-like.test.ts +52 -0
- package/src/runtime/utils/thread-message-like.ts +5 -1
- package/src/runtimes/external-store/external-store-thread-list-runtime-core.ts +18 -13
- package/src/runtimes/external-store/external-store-thread-runtime-core.ts +31 -1
- package/src/runtimes/internal.ts +1 -0
- package/src/runtimes/local/local-thread-runtime-core.test.ts +21 -0
- package/src/runtimes/local/local-thread-runtime-core.ts +11 -1
- package/src/runtimes/remote-thread-list/remote-thread-state.test.ts +128 -2
- package/src/runtimes/remote-thread-list/remote-thread-state.ts +182 -42
- package/src/runtimes/remote-thread-list/title-generation.test.ts +602 -0
- package/src/runtimes/remote-thread-list/title-generation.ts +329 -0
- package/src/runtimes/remote-thread-list/title.test.ts +62 -0
- package/src/runtimes/remote-thread-list/title.ts +13 -0
- package/src/runtimes/remote-thread-list/types.ts +10 -0
- package/src/runtimes/tool-invocations/EDGE_CASES.md +2 -6
- package/src/runtimes/tool-invocations/ToolInvocationTracker.test.ts +133 -0
- package/src/runtimes/tool-invocations/ToolInvocationTracker.ts +10 -6
- package/src/store/clients/external-thread.ts +67 -4
- package/src/store/clients/model-context-client.ts +5 -1
- package/src/store/clients/single-thread-list.ts +1 -0
- package/src/store/clients/suggestions.test.ts +40 -0
- package/src/store/clients/suggestions.ts +13 -10
- package/src/store/clients/thread-tasks.test.ts +274 -0
- package/src/store/clients/thread-tasks.ts +138 -0
- package/src/store/index.ts +8 -0
- package/src/store/primitive-predicates.test.ts +48 -5
- package/src/store/primitive-predicates.ts +7 -2
- package/src/store/runtime-clients/composer-runtime-client.ts +42 -9
- package/src/store/runtime-clients/message-runtime-client.ts +54 -6
- package/src/store/runtime-clients/thread-list-item-runtime-client.ts +4 -2
- package/src/store/runtime-clients/thread-list-runtime-client.ts +1 -0
- package/src/store/runtime-clients/thread-runtime-client.ts +89 -11
- package/src/store/scope-registration.ts +2 -0
- package/src/store/scopes/composer.ts +16 -4
- package/src/store/scopes/message.ts +14 -0
- package/src/store/scopes/task.ts +34 -0
- package/src/store/scopes/thread-list-item.ts +5 -2
- package/src/store/scopes/thread.ts +20 -0
- package/src/store/scopes/threads.ts +1 -0
- package/src/store/thread-tasks.test.tsx +209 -0
- package/src/subscribable/subscribable.test.ts +156 -1
- package/src/subscribable/subscribable.ts +25 -15
- package/src/tests/MessageRepository.test.ts +117 -5
- package/src/tests/OptimisticState-list-race.test.ts +1 -0
- package/src/tests/RemoteThreadListThreadListRuntimeCore-initialize-adapter-change.test.ts +38 -0
- package/src/tests/RemoteThreadListThreadListRuntimeCore-load-race.test.ts +47 -0
- package/src/tests/RemoteThreadListThreadListRuntimeCore-title-race.test.ts +89 -0
- package/src/tests/attachment-adapters.test.ts +14 -0
- package/src/tests/auiV0Encode.test.ts +300 -0
- package/src/tests/base-composer-runtime-core-send.test.ts +51 -0
- package/src/tests/base-composer-runtime-core.test.ts +353 -2
- package/src/tests/external-store-thread-list-runtime-core.test.ts +83 -0
- package/src/tests/external-store-thread-runtime-core-adapter.test.ts +178 -18
- package/src/tests/external-thread-attachments.test.tsx +208 -0
- package/src/tests/external-thread-parity.test.tsx +57 -0
- package/src/tests/groupParts.test.ts +71 -0
- package/src/tests/message-queue.test.ts +253 -0
- package/src/tests/remote-thread-list-isLoading.test.ts +1 -0
- package/src/tests/remote-thread-list-reactive-threadId.test.ts +51 -0
- package/src/tests/thread-list-runtime-getLoadThreadsPromise.test.ts +1 -0
- package/src/tests/thread-switch-events.test.tsx +78 -0
- package/src/tests/tools-scope-migration.test.tsx +28 -0
- package/src/tests/useRemoteThreadListRuntime-controlled.test.tsx +43 -0
- package/src/types/attachment.ts +4 -0
- package/src/types/index.ts +1 -0
- package/src/types/message.ts +8 -0
- package/src/utils/abortable-iterable.test.ts +328 -0
- package/src/utils/abortable-iterable.ts +104 -0
- package/src/utils/composite-context-provider.test.ts +25 -0
- package/src/utils/composite-context-provider.ts +23 -2
- package/src/utils/getGroupStatus.test.ts +70 -4
- package/src/utils/getGroupStatus.ts +35 -12
- package/src/utils/record.test.ts +48 -0
- package/src/utils/record.ts +11 -0
- package/src/utils/wire-media.test.ts +10 -0
- package/src/utils/wire-media.ts +6 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestions.js","names":["useMemo","resource","withKey","ClientOutput","useClientLookup","shallowEqual","SuggestionsState","SuggestionState","ThreadSuggestion","SuggestionConfig","title","label","prompt","useStableSuggestionsState","next","cell","state","previous","suggestions","
|
|
1
|
+
{"version":3,"file":"suggestions.js","names":["useMemo","resource","withKey","ClientOutput","useClientLookup","shallowEqual","SuggestionsState","SuggestionState","ThreadSuggestion","SuggestionConfig","title","label","prompt","useStableSuggestionsState","next","cell","state","previous","suggestions","forEach","suggestion","previousSuggestion","length","push","useSuggestionClient","getState","SuggestionClient","useSuggestionsClient","nextState","$","_c","t0","map","_temp","suggestionClients","t1","t2","t3","index","index_0","get","useStaticSuggestions","_temp2","Suggestions","useThreadSuggestions","_temp3","ThreadSuggestions","s"],"sources":["../../../src/store/clients/suggestions.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { resource, withKey } from \"@assistant-ui/tap\";\nimport type { ClientOutput } from \"@assistant-ui/store\";\nimport { useClientLookup } from \"@assistant-ui/store/client\";\nimport { shallowEqual } from \"@assistant-ui/store/internal\";\nimport type { SuggestionsState } from \"../scopes/suggestions\";\nimport type { SuggestionState } from \"../scopes/suggestion\";\nimport type { ThreadSuggestion } from \"../../runtime/interfaces/thread-runtime-core\";\n\nexport type SuggestionConfig =\n | string\n | { title: string; label: string; prompt: string };\n\nconst useStableSuggestionsState = (\n next: SuggestionsState,\n): SuggestionsState => {\n const cell = useMemo(() => ({}) as { state?: SuggestionsState }, []);\n const previous = cell.state;\n\n // forEach skips array holes, so a sparse caller array normalizes to a dense\n // list here, before the per-suggestion resource lookup indexes every slot.\n const suggestions: SuggestionState[] = [];\n next.suggestions.forEach((suggestion) => {\n // Probed at the compacted destination index, not the sparse source index,\n // so an equivalent hole-containing update keeps reusing prior identities.\n const previousSuggestion = previous?.suggestions[suggestions.length];\n suggestions.push(\n previousSuggestion && shallowEqual(previousSuggestion, suggestion)\n ? previousSuggestion\n : suggestion,\n );\n });\n const state =\n previous && shallowEqual(suggestions, previous.suggestions)\n ? previous\n : { suggestions };\n\n cell.state = state;\n return state;\n};\n\nconst useSuggestionClient = (\n state: SuggestionState,\n): ClientOutput<\"suggestion\"> => {\n return {\n getState: () => state,\n };\n};\n\nconst SuggestionClient = resource(useSuggestionClient);\n\nconst useSuggestionsClient = (\n nextState: SuggestionsState,\n): ClientOutput<\"suggestions\"> => {\n const state = useStableSuggestionsState(nextState);\n const suggestionClients = useClientLookup(\n state.suggestions.map((suggestion, index) =>\n withKey(index, SuggestionClient(suggestion), [suggestion]),\n ),\n );\n\n return {\n getState: () => state,\n suggestion: ({ index }: { index: number }) => {\n return suggestionClients.get({ index });\n },\n };\n};\n\nconst useStaticSuggestions = (\n suggestions?: SuggestionConfig[],\n): ClientOutput<\"suggestions\"> => {\n return useSuggestionsClient({\n suggestions: (suggestions ?? []).map((s) =>\n typeof s === \"string\"\n ? { title: s, label: \"\", prompt: s }\n : { title: s.title, label: s.label, prompt: s.prompt },\n ),\n });\n};\n\nexport const Suggestions = resource(useStaticSuggestions);\n\nconst useThreadSuggestions = (\n suggestions: readonly ThreadSuggestion[],\n): ClientOutput<\"suggestions\"> => {\n return useSuggestionsClient({\n suggestions: suggestions.map((s) => ({\n title: s.title ?? s.prompt,\n label: s.label ?? \"\",\n prompt: s.prompt,\n })),\n });\n};\n\nexport const ThreadSuggestions = resource(useThreadSuggestions);\n"],"mappings":";;;;;;AAaA,MAAMa,6BACJC,SACqB;CACrB,MAAMC,OAAOf,eAAe,CAAC,IAAoC,CAAA,CAAE;CACnE,MAAMiB,WAAWF,KAAKC;CAItB,MAAME,cAAiC,CAAA;CACvCJ,KAAKI,YAAYC,SAASC,eAAe;EAGvC,MAAMC,qBAAqBJ,UAAUC,YAAYA,YAAYI;EAC7DJ,YAAYK,KACVF,sBAAsBhB,eAAagB,oBAAoBD,UAAU,IAC7DC,qBACAD,UACN;CACF,CAAC;CACD,MAAMJ,QACJC,YAAYZ,eAAaa,aAAaD,SAASC,WAAW,IACtDD,WACA,EAAEC,YAAY;CAEpBH,KAAKC,QAAQA;CACb,OAAOA;AACT;AAEA,MAAMQ,uBACJR,UAC+B;CAC/B,OAAO,EACLS,gBAAgBT,MAClB;AACF;AAEA,MAAMU,mBAAmBzB,SAASuB,mBAAmB;AAErD,MAAMG,wBAAuBC,cAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAG3B,MAAAd,QAAcH,0BAA0Be,SAAS;CAAE,IAAAG;CAAA,IAAAF,EAAA,OAAAb,MAAAE,aAAA;EAEjDa,KAAAf,MAAKE,YAAYc,IAAKC,KAEtB;EAACJ,EAAA,KAAAb,MAAAE;EAAAW,EAAA,KAAAE;CAAA,OAAAA,KAAAF,E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;CAAA,MAAAW,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAX,aAAA;EAIZa,KAAAb,YAAWc,IAAKa,MAI3B;EAAChB,EAAA,KAAAX;EAAAW,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAE,IAAA;EALuBI,KAAA,EAAAjB,aACba,GAKf;EAACF,EAAA,KAAAE;EAAAF,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OANMF,qBAAqBQ,EAM3B;AAAC;AAGJ,MAAaW,oBAAoB7C,SAAS2C,oBAAoB;AA5CjC,SAAAX,MAAAb,YAAAkB,OAAA;CAAA,OAMvBpC,QAAQoC,OAAOZ,iBAAiBN,UAAU,GAAG,CAACA,UAAU,CAAC;AAAC;AAYnC,SAAAsB,OAAAK,GAAA;CAAA,OAKvB,OAAOA,MAAM,WAAb;EAAArC,OACaqC;EAACpC,OAAS;EAAEC,QAAUmC;CACoB,IAFvD;EAAArC,OAEaqC,EAACrC;EAAMC,OAASoC,EAACpC;EAAMC,QAAUmC,EAACnC;CAAQ;AAAC;AAOjC,SAAAiC,OAAAE,GAAA;CAAA,OAIY;EAAArC,OAC5BqC,EAACrC,SAAUqC,EAACnC;EAAOD,OACnBoC,EAACpC,SAAD;EAAaC,QACZmC,EAACnC;CACX;AAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ThreadMessage } from "../../types/message.js";
|
|
2
|
+
import { TaskState } from "../scopes/task.js";
|
|
3
|
+
import { ClientOutput } from "@assistant-ui/store";
|
|
4
|
+
//#region src/store/clients/thread-tasks.d.ts
|
|
5
|
+
/** Lookup key for a task client: its document-order index path, unique by construction where ids from nested payloads are not. */
|
|
6
|
+
declare const getTaskKey: (task: TaskState) => string;
|
|
7
|
+
declare const createTaskDeriver: () => (messages: readonly ThreadMessage[]) => readonly TaskState[];
|
|
8
|
+
declare const TaskClient: import("@assistant-ui/tap").Resource<ClientOutput<"task">, [{
|
|
9
|
+
task: TaskState;
|
|
10
|
+
}]>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { TaskClient, createTaskDeriver, getTaskKey };
|
|
13
|
+
//# sourceMappingURL=thread-tasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread-tasks.d.ts","names":[],"sources":["../../../src/store/clients/thread-tasks.ts"],"mappings":";;;;;cAiCa,aAAc,MAAM;cAWpB,0BAIH,mBAAmB,6BAA2B;cAyF3C,wCAAU,SAAA;EALf,MAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { COMPLETE_STATUS, toMessagePartStatus } from "../../utils/normalizePartStatus.js";
|
|
2
|
+
import { resource } from "@assistant-ui/tap";
|
|
3
|
+
//#region src/store/clients/thread-tasks.ts
|
|
4
|
+
const getStatusReason = (status) => "reason" in status ? status.reason : void 0;
|
|
5
|
+
const getStatusError = (status) => "error" in status ? status.error : void 0;
|
|
6
|
+
const MAX_TASK_DEPTH = 32;
|
|
7
|
+
const taskKeys = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
/** Lookup key for a task client: its document-order index path, unique by construction where ids from nested payloads are not. */
|
|
9
|
+
const getTaskKey = (task) => taskKeys.get(task) ?? task.id;
|
|
10
|
+
const resolveStatus = (message, partIndex, part) => "status" in message && message.status ? toMessagePartStatus(message, partIndex, part) : COMPLETE_STATUS;
|
|
11
|
+
const createTaskDeriver = () => {
|
|
12
|
+
let previous = [];
|
|
13
|
+
let previousEntries = /* @__PURE__ */ new Map();
|
|
14
|
+
return (messages) => {
|
|
15
|
+
const tasks = [];
|
|
16
|
+
const entries = /* @__PURE__ */ new Map();
|
|
17
|
+
let allEntriesReused = true;
|
|
18
|
+
const visit = (threadMessages, parentTaskId, depth, path) => {
|
|
19
|
+
if (depth > MAX_TASK_DEPTH) return;
|
|
20
|
+
for (const [messageIndex, message] of threadMessages.entries()) for (const [partIndex, part] of message.content.entries()) {
|
|
21
|
+
if (part.type !== "tool-call" || part.messages === void 0) continue;
|
|
22
|
+
const nestedMessages = part.messages;
|
|
23
|
+
const status = resolveStatus(message, partIndex, part);
|
|
24
|
+
const statusReason = getStatusReason(status);
|
|
25
|
+
const statusError = getStatusError(status);
|
|
26
|
+
const entryKey = `${path}${messageIndex}.${partIndex}`;
|
|
27
|
+
const previousEntry = previousEntries.get(entryKey);
|
|
28
|
+
const task = previousEntry?.part === part && previousEntry.statusType === status.type && previousEntry.statusReason === statusReason && Object.is(previousEntry.statusError, statusError) && previousEntry.messages === nestedMessages && previousEntry.task.messageId === message.id && previousEntry.task.parentTaskId === parentTaskId && previousEntry.task.depth === depth ? previousEntry.task : {
|
|
29
|
+
id: part.toolCallId,
|
|
30
|
+
toolName: part.toolName,
|
|
31
|
+
args: part.args,
|
|
32
|
+
result: part.result,
|
|
33
|
+
...part.isError === void 0 ? void 0 : { isError: part.isError },
|
|
34
|
+
status,
|
|
35
|
+
timing: part.timing,
|
|
36
|
+
messageId: message.id,
|
|
37
|
+
parentTaskId,
|
|
38
|
+
depth,
|
|
39
|
+
messages: nestedMessages
|
|
40
|
+
};
|
|
41
|
+
if (task !== previousEntry?.task) {
|
|
42
|
+
allEntriesReused = false;
|
|
43
|
+
taskKeys.set(task, entryKey);
|
|
44
|
+
}
|
|
45
|
+
tasks.push(task);
|
|
46
|
+
entries.set(entryKey, {
|
|
47
|
+
task,
|
|
48
|
+
part,
|
|
49
|
+
statusType: status.type,
|
|
50
|
+
statusReason,
|
|
51
|
+
statusError,
|
|
52
|
+
messages: nestedMessages
|
|
53
|
+
});
|
|
54
|
+
visit(nestedMessages, task.id, depth + 1, `${entryKey}.`);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
visit(messages, null, 0, "");
|
|
58
|
+
const result = allEntriesReused && tasks.length === previous.length && tasks.every((task, index) => task === previous[index]) ? previous : tasks;
|
|
59
|
+
previous = result;
|
|
60
|
+
previousEntries = entries;
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
const useTaskClient = ({ task }) => ({ getState: () => task });
|
|
65
|
+
const TaskClient = resource(useTaskClient);
|
|
66
|
+
//#endregion
|
|
67
|
+
export { TaskClient, createTaskDeriver, getTaskKey };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=thread-tasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread-tasks.js","names":["resource","ClientOutput","ThreadMessage","ToolCallMessagePart","ToolCallMessagePartStatus","COMPLETE_STATUS","toMessagePartStatus","TaskState","TaskEntry","task","part","statusType","statusReason","statusError","messages","getStatusReason","status","reason","undefined","getStatusError","error","MAX_TASK_DEPTH","taskKeys","WeakMap","getTaskKey","get","id","resolveStatus","message","partIndex","createTaskDeriver","previous","previousEntries","Map","tasks","entries","allEntriesReused","visit","threadMessages","parentTaskId","depth","path","messageIndex","content","type","nestedMessages","entryKey","previousEntry","Object","is","messageId","toolCallId","toolName","args","result","isError","timing","set","push","length","every","index","useTaskClient","getState","TaskClient"],"sources":["../../../src/store/clients/thread-tasks.ts"],"sourcesContent":["import { resource } from \"@assistant-ui/tap\";\nimport type { ClientOutput } from \"@assistant-ui/store\";\nimport type {\n ThreadMessage,\n ToolCallMessagePart,\n ToolCallMessagePartStatus,\n} from \"../../types/message\";\nimport {\n COMPLETE_STATUS,\n toMessagePartStatus,\n} from \"../../utils/normalizePartStatus\";\nimport type { TaskState } from \"../scopes/task\";\n\ntype TaskEntry = {\n readonly task: TaskState;\n readonly part: ToolCallMessagePart;\n readonly statusType: ToolCallMessagePartStatus[\"type\"];\n readonly statusReason: string | undefined;\n readonly statusError: unknown;\n readonly messages: readonly ThreadMessage[];\n};\n\nconst getStatusReason = (status: ToolCallMessagePartStatus) =>\n \"reason\" in status ? status.reason : undefined;\n\nconst getStatusError = (status: ToolCallMessagePartStatus) =>\n \"error\" in status ? status.error : undefined;\n\nconst MAX_TASK_DEPTH = 32;\n\nconst taskKeys = new WeakMap<TaskState, string>();\n\n/** Lookup key for a task client: its document-order index path, unique by construction where ids from nested payloads are not. */\nexport const getTaskKey = (task: TaskState) => taskKeys.get(task) ?? task.id;\n\nconst resolveStatus = (\n message: ThreadMessage,\n partIndex: number,\n part: ToolCallMessagePart,\n): ToolCallMessagePartStatus =>\n \"status\" in message && message.status\n ? toMessagePartStatus(message, partIndex, part)\n : COMPLETE_STATUS;\n\nexport const createTaskDeriver = () => {\n let previous: readonly TaskState[] = [];\n let previousEntries = new Map<string, TaskEntry>();\n\n return (messages: readonly ThreadMessage[]): readonly TaskState[] => {\n const tasks: TaskState[] = [];\n const entries = new Map<string, TaskEntry>();\n let allEntriesReused = true;\n\n const visit = (\n threadMessages: readonly ThreadMessage[],\n parentTaskId: string | null,\n depth: number,\n path: string,\n ) => {\n if (depth > MAX_TASK_DEPTH) return;\n for (const [messageIndex, message] of threadMessages.entries()) {\n for (const [partIndex, part] of message.content.entries()) {\n if (part.type !== \"tool-call\" || part.messages === undefined)\n continue;\n\n const nestedMessages = part.messages;\n const status = resolveStatus(message, partIndex, part);\n const statusReason = getStatusReason(status);\n const statusError = getStatusError(status);\n const entryKey = `${path}${messageIndex}.${partIndex}`;\n const previousEntry = previousEntries.get(entryKey);\n const task =\n previousEntry?.part === part &&\n previousEntry.statusType === status.type &&\n previousEntry.statusReason === statusReason &&\n Object.is(previousEntry.statusError, statusError) &&\n previousEntry.messages === nestedMessages &&\n previousEntry.task.messageId === message.id &&\n previousEntry.task.parentTaskId === parentTaskId &&\n previousEntry.task.depth === depth\n ? previousEntry.task\n : {\n id: part.toolCallId,\n toolName: part.toolName,\n args: part.args,\n result: part.result,\n ...(part.isError === undefined\n ? undefined\n : { isError: part.isError }),\n status,\n timing: part.timing,\n messageId: message.id,\n parentTaskId,\n depth,\n messages: nestedMessages,\n };\n\n if (task !== previousEntry?.task) {\n allEntriesReused = false;\n taskKeys.set(task, entryKey);\n }\n tasks.push(task);\n entries.set(entryKey, {\n task,\n part,\n statusType: status.type,\n statusReason,\n statusError,\n messages: nestedMessages,\n });\n visit(nestedMessages, task.id, depth + 1, `${entryKey}.`);\n }\n }\n };\n\n visit(messages, null, 0, \"\");\n\n const result =\n allEntriesReused &&\n tasks.length === previous.length &&\n tasks.every((task, index) => task === previous[index])\n ? previous\n : tasks;\n previous = result;\n previousEntries = entries;\n return result;\n };\n};\n\nconst useTaskClient = ({\n task,\n}: {\n task: TaskState;\n}): ClientOutput<\"task\"> => ({\n getState: () => task,\n});\n\nexport const TaskClient = resource(useTaskClient);\n"],"mappings":";;;AAsBA,MAAMe,mBAAmBC,WACvB,YAAYA,SAASA,OAAOC,SAASC,KAAAA;AAEvC,MAAMC,kBAAkBH,WACtB,WAAWA,SAASA,OAAOI,QAAQF,KAAAA;AAErC,MAAMG,iBAAiB;AAEvB,MAAMC,2BAAW,IAAIC,QAA2B;;AAGhD,MAAaC,cAAcf,SAAoBa,SAASG,IAAIhB,IAAI,KAAKA,KAAKiB;AAE1E,MAAMC,iBACJC,SACAC,WACAnB,SAEA,YAAYkB,WAAWA,QAAQZ,SAC3BV,oBAAoBsB,SAASC,WAAWnB,IAAI,IAC5CL;AAEN,MAAayB,0BAA0B;CACrC,IAAIC,WAAiC,CAAA;CACrC,IAAIC,kCAAkB,IAAIC,IAAuB;CAEjD,QAAQnB,aAA6D;EACnE,MAAMoB,QAAqB,CAAA;EAC3B,MAAMC,0BAAU,IAAIF,IAAuB;EAC3C,IAAIG,mBAAmB;EAEvB,MAAMC,SACJC,gBACAC,cACAC,OACAC,SACG;GACH,IAAID,QAAQnB,gBAAgB;GAC5B,KAAK,MAAM,CAACqB,cAAcd,YAAYU,eAAeH,QAAQ,GAC3D,KAAK,MAAM,CAACN,WAAWnB,SAASkB,QAAQe,QAAQR,QAAQ,GAAG;IACzD,IAAIzB,KAAKkC,SAAS,eAAelC,KAAKI,aAAaI,KAAAA,GACjD;IAEF,MAAM2B,iBAAiBnC,KAAKI;IAC5B,MAAME,SAASW,cAAcC,SAASC,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ACAG;EACNH,WAAWuB;EACXtB,kBAAkBG;EAClB,OAAOmB;CACT;AACF;AAEA,MAAMQ,iBAAiB,EACrBrD,YAG2B,EAC3BsD,gBAAgBtD,KAClB;AAEA,MAAauD,aAAahE,SAAS8D,aAAa"}
|
package/dist/store/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { PartClientSchema, PartMeta, PartMethods, PartState } from "./scopes/par
|
|
|
9
9
|
import { MessageClientSchema, MessageMeta, MessageMethods, MessageState } from "./scopes/message.js";
|
|
10
10
|
import { SuggestionClientSchema, SuggestionMeta, SuggestionMethods, SuggestionState } from "./scopes/suggestion.js";
|
|
11
11
|
import { Suggestion, SuggestionsClientSchema, SuggestionsMethods, SuggestionsState } from "./scopes/suggestions.js";
|
|
12
|
+
import { TaskClientSchema, TaskMeta, TaskMethods, TaskState } from "./scopes/task.js";
|
|
12
13
|
import { ThreadClientSchema, ThreadEvents, ThreadMeta, ThreadMethods, ThreadState } from "./scopes/thread.js";
|
|
13
14
|
import { ThreadsClientSchema, ThreadsEvents, ThreadsMethods, ThreadsState } from "./scopes/threads.js";
|
|
14
15
|
import { ModelContextClientSchema, ModelContextMethods, ModelContextState } from "./scopes/model-context.js";
|
|
@@ -17,7 +18,7 @@ import { RuntimeAdapter, runtimeAdapterTransformScopes } from "../react/RuntimeA
|
|
|
17
18
|
import { InMemoryThreadList, InMemoryThreadListProps, inMemoryThreadListTransformScopes } from "../react/client/InMemoryThreadList.js";
|
|
18
19
|
import { RemoteThreadList, RemoteThreadListProps } from "../react/client/RemoteThreadList.js";
|
|
19
20
|
import { JoinStrategy } from "../runtime/utils/external-message-conversion.js";
|
|
20
|
-
import { convertExternalMessages, useExternalMessageConverter } from "../react/runtimes/external-message-converter.js";
|
|
21
|
+
import { ExternalMessageConversionCache, convertExternalMessages, createExternalMessageConversionCache, useExternalMessageConverter } from "../react/runtimes/external-message-converter.js";
|
|
21
22
|
import { StreamingTimingAccessors, StreamingTimingOptions, StreamingTimingState } from "../runtime/utils/streaming-timing.js";
|
|
22
23
|
import { useStreamingTiming } from "../react/runtimes/useStreamingTiming.js";
|
|
23
24
|
import { RuntimeExtrasBrand, createRuntimeExtrasBrand } from "../runtime/utils/runtime-extras-brand.js";
|
|
@@ -32,4 +33,4 @@ import { SuggestionConfig, Suggestions } from "./clients/suggestions.js";
|
|
|
32
33
|
import { ChainOfThoughtClient } from "./clients/chain-of-thought-client.js";
|
|
33
34
|
import { ThreadMessageClient, ThreadMessageClientProps } from "./clients/thread-message-client.js";
|
|
34
35
|
import { ModelContext } from "./clients/model-context-client.js";
|
|
35
|
-
export { type AttachmentClientSchema, type AttachmentMeta, type AttachmentMethods, type AttachmentState, ChainOfThoughtClient, type ChainOfThoughtClientSchema, type ChainOfThoughtMeta, type ChainOfThoughtMethods, type ChainOfThoughtPart, type ChainOfThoughtState, type ComposerClientSchema, type ComposerEvents, type ComposerMeta, type ComposerMethods, type ComposerSendOptions, type ComposerState, ExternalThread, type ExternalThreadMessage, type ExternalThreadProps, InMemoryThreadList, type InMemoryThreadListProps, type JoinStrategy, type McpToolkitDefinition, type McpToolkitEntry, type McpToolkitToolConfig, type MessageClientSchema, type MessageMeta, type MessageMethods, type MessageState, ModelContext, type ModelContextClientSchema, type ModelContextMethods, type ModelContextState, NoOpComposerClient, type PartClientSchema, type PartMeta, type PartMethods, type PartState, type QueueItemClientSchema, type QueueItemMeta, type QueueItemMethods, type QueueItemState, RemoteThreadList, type RemoteThreadListProps, RuntimeAdapter, type RuntimeExtrasBrand, SingleThreadList, type StreamingTimingAccessors, type StreamingTimingOptions, type StreamingTimingState, type Suggestion, type SuggestionClientSchema, type SuggestionConfig, type SuggestionMeta, type SuggestionMethods, type SuggestionState, Suggestions, type SuggestionsClientSchema, type SuggestionsMethods, type SuggestionsState, type ThreadClientSchema, type ThreadEvents, type ThreadListItemClientSchema, type ThreadListItemEvents, type ThreadListItemMeta, type ThreadListItemMethods, type ThreadListItemState, ThreadMessageClient, type ThreadMessageClientProps, type ThreadMeta, type ThreadMethods, type ThreadState, type ThreadsClientSchema, type ThreadsEvents, type ThreadsMethods, type ThreadsState, type ToolCallText, type Toolkit, type ToolkitDefinition, type ToolkitDefinitionEntry, convertExternalMessages, createRuntimeExtrasBrand, defineMcpToolkit, defineToolkit, inMemoryThreadListTransformScopes, resolveToolCallText, runtimeAdapterTransformScopes, useExternalMessageConverter, useStreamingTiming };
|
|
36
|
+
export { type AttachmentClientSchema, type AttachmentMeta, type AttachmentMethods, type AttachmentState, ChainOfThoughtClient, type ChainOfThoughtClientSchema, type ChainOfThoughtMeta, type ChainOfThoughtMethods, type ChainOfThoughtPart, type ChainOfThoughtState, type ComposerClientSchema, type ComposerEvents, type ComposerMeta, type ComposerMethods, type ComposerSendOptions, type ComposerState, type ExternalMessageConversionCache, ExternalThread, type ExternalThreadMessage, type ExternalThreadProps, InMemoryThreadList, type InMemoryThreadListProps, type JoinStrategy, type McpToolkitDefinition, type McpToolkitEntry, type McpToolkitToolConfig, type MessageClientSchema, type MessageMeta, type MessageMethods, type MessageState, ModelContext, type ModelContextClientSchema, type ModelContextMethods, type ModelContextState, NoOpComposerClient, type PartClientSchema, type PartMeta, type PartMethods, type PartState, type QueueItemClientSchema, type QueueItemMeta, type QueueItemMethods, type QueueItemState, RemoteThreadList, type RemoteThreadListProps, RuntimeAdapter, type RuntimeExtrasBrand, SingleThreadList, type StreamingTimingAccessors, type StreamingTimingOptions, type StreamingTimingState, type Suggestion, type SuggestionClientSchema, type SuggestionConfig, type SuggestionMeta, type SuggestionMethods, type SuggestionState, Suggestions, type SuggestionsClientSchema, type SuggestionsMethods, type SuggestionsState, type TaskClientSchema, type TaskMeta, type TaskMethods, type TaskState, type ThreadClientSchema, type ThreadEvents, type ThreadListItemClientSchema, type ThreadListItemEvents, type ThreadListItemMeta, type ThreadListItemMethods, type ThreadListItemState, ThreadMessageClient, type ThreadMessageClientProps, type ThreadMeta, type ThreadMethods, type ThreadState, type ThreadsClientSchema, type ThreadsEvents, type ThreadsMethods, type ThreadsState, type ToolCallText, type Toolkit, type ToolkitDefinition, type ToolkitDefinitionEntry, convertExternalMessages, createExternalMessageConversionCache, createRuntimeExtrasBrand, defineMcpToolkit, defineToolkit, inMemoryThreadListTransformScopes, resolveToolCallText, runtimeAdapterTransformScopes, useExternalMessageConverter, useStreamingTiming };
|
package/dist/store/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { resolveToolCallText } from "../model-context/tool-call-text.js";
|
|
2
1
|
import { Suggestions } from "./clients/suggestions.js";
|
|
3
2
|
import { ModelContext } from "./clients/model-context-client.js";
|
|
3
|
+
import { resolveToolCallText } from "../model-context/tool-call-text.js";
|
|
4
4
|
import { RuntimeAdapter, runtimeAdapterTransformScopes } from "../react/RuntimeAdapter.js";
|
|
5
5
|
import { defineToolkit } from "../react/model-context/define-toolkit.js";
|
|
6
6
|
import { defineMcpToolkit } from "../react/model-context/define-mcp-toolkit.js";
|
|
7
7
|
import { InMemoryThreadList, inMemoryThreadListTransformScopes } from "../react/client/InMemoryThreadList.js";
|
|
8
8
|
import { RemoteThreadList } from "../react/client/RemoteThreadList.js";
|
|
9
|
-
import { convertExternalMessages, useExternalMessageConverter } from "../react/runtimes/external-message-converter.js";
|
|
9
|
+
import { convertExternalMessages, createExternalMessageConversionCache, useExternalMessageConverter } from "../react/runtimes/external-message-converter.js";
|
|
10
10
|
import { useStreamingTiming } from "../react/runtimes/useStreamingTiming.js";
|
|
11
11
|
import { createRuntimeExtrasBrand } from "../runtime/utils/runtime-extras-brand.js";
|
|
12
12
|
import { SingleThreadList } from "./clients/single-thread-list.js";
|
|
@@ -14,4 +14,4 @@ import { ExternalThread } from "./clients/external-thread.js";
|
|
|
14
14
|
import { NoOpComposerClient } from "./clients/no-op-composer-client.js";
|
|
15
15
|
import { ChainOfThoughtClient } from "./clients/chain-of-thought-client.js";
|
|
16
16
|
import { ThreadMessageClient } from "./clients/thread-message-client.js";
|
|
17
|
-
export { ChainOfThoughtClient, ExternalThread, InMemoryThreadList, ModelContext, NoOpComposerClient, RemoteThreadList, RuntimeAdapter, SingleThreadList, Suggestions, ThreadMessageClient, convertExternalMessages, createRuntimeExtrasBrand, defineMcpToolkit, defineToolkit, inMemoryThreadListTransformScopes, resolveToolCallText, runtimeAdapterTransformScopes, useExternalMessageConverter, useStreamingTiming };
|
|
17
|
+
export { ChainOfThoughtClient, ExternalThread, InMemoryThreadList, ModelContext, NoOpComposerClient, RemoteThreadList, RuntimeAdapter, SingleThreadList, Suggestions, ThreadMessageClient, convertExternalMessages, createExternalMessageConversionCache, createRuntimeExtrasBrand, defineMcpToolkit, defineToolkit, inMemoryThreadListTransformScopes, resolveToolCallText, runtimeAdapterTransformScopes, useExternalMessageConverter, useStreamingTiming };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitive-predicates.d.ts","names":[],"sources":["../../src/store/primitive-predicates.ts"],"mappings":";;;;;;;;cAYa,uBAAwB,GAAG;cAG3B,yBAA0B,GAAG;cAG7B,wBAAyB,GAAG;cAG5B,wBAAyB,GAAG;cAG5B,0BAA2B,GAAG;
|
|
1
|
+
{"version":3,"file":"primitive-predicates.d.ts","names":[],"sources":["../../src/store/primitive-predicates.ts"],"mappings":";;;;;;;;cAYa,uBAAwB,GAAG;cAG3B,yBAA0B,GAAG;cAG7B,wBAAyB,GAAG;cAG5B,wBAAyB,GAAG;cAG5B,0BAA2B,GAAG;cAM9B,wBAAyB,GAAG;cAM5B,+BAAgC,GAAG;cAKnC,2BAA4B,GAAG;cAK/B,4BACX,GAAG,gBACH;cAKW,mBACX,GAAG,+CAKD,qBACA;cAqBS,6BAA8B,GAAG"}
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
const composerSendDisabled = (s) => !s.composer.canSend || s.thread.isRunning && !s.thread.capabilities.queue;
|
|
8
8
|
const composerCancelDisabled = (s) => !s.composer.canCancel;
|
|
9
9
|
const composerInputDisabled = (s) => s.thread.isDisabled || s.composer.dictation?.inputDisabled === true;
|
|
10
|
-
const actionBarEditDisabled = (s) => s.composer.isEditing;
|
|
11
|
-
const actionBarReloadDisabled = (s) => s.thread.isRunning || s.thread.isDisabled || s.message.role !== "assistant";
|
|
10
|
+
const actionBarEditDisabled = (s) => s.composer.isEditing || s.optional.thread?.capabilities.edit === false;
|
|
11
|
+
const actionBarReloadDisabled = (s) => s.thread.isRunning || s.thread.isDisabled || s.message.role !== "assistant" || !s.thread.capabilities.reload;
|
|
12
12
|
const actionBarCopyDisabled = (s) => !((s.message.role !== "assistant" || s.message.status?.type !== "running") && s.message.parts.some((part) => part.type === "text" && part.text.length > 0));
|
|
13
|
-
const branchPickerPreviousDisabled = (s) => s.message.branchNumber <= 1 || s.thread.isRunning && !s.thread.capabilities.switchBranchDuringRun;
|
|
14
|
-
const branchPickerNextDisabled = (s) => s.message.branchNumber >= s.message.branchCount || s.thread.isRunning && !s.thread.capabilities.switchBranchDuringRun;
|
|
13
|
+
const branchPickerPreviousDisabled = (s) => s.message.branchNumber <= 1 || !s.thread.capabilities.switchToBranch || s.thread.isRunning && !s.thread.capabilities.switchBranchDuringRun;
|
|
14
|
+
const branchPickerNextDisabled = (s) => s.message.branchNumber >= s.message.branchCount || !s.thread.capabilities.switchToBranch || s.thread.isRunning && !s.thread.capabilities.switchBranchDuringRun;
|
|
15
15
|
const suggestionTriggerDisabled = (s, send) => s.thread.isDisabled || send && s.thread.isRunning && !s.thread.capabilities.queue;
|
|
16
16
|
const messageErrorText = (s) => {
|
|
17
17
|
if (s.message.status?.type !== "incomplete" || s.message.status.reason !== "error") return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitive-predicates.js","names":["ReadonlyJSONArray","ReadonlyJSONObject","AssistantState","composerSendDisabled","s","composer","canSend","thread","isRunning","capabilities","queue","composerCancelDisabled","canCancel","composerInputDisabled","isDisabled","dictation","inputDisabled","actionBarEditDisabled","isEditing","actionBarReloadDisabled","message","role","actionBarCopyDisabled","status","type","parts","some","part","text","length","branchPickerPreviousDisabled","branchNumber","switchBranchDuringRun","branchPickerNextDisabled","branchCount","suggestionTriggerDisabled","send","messageErrorText","reason","undefined","error","threadListLoadMoreDisabled","threads","hasMore","isLoading","isLoadingMore"],"sources":["../../src/store/primitive-predicates.ts"],"sourcesContent":["import type {\n ReadonlyJSONArray,\n ReadonlyJSONObject,\n} from \"assistant-stream/utils\";\nimport type { AssistantState } from \"@assistant-ui/store\";\n\n/**\n * Disabled predicates shared by every binding's primitive layer. Each binding\n * consumes these as state selectors so the disabled semantics of a primitive\n * cannot drift between frameworks.\n */\n\nexport const composerSendDisabled = (s: AssistantState): boolean =>\n !s.composer.canSend || (s.thread.isRunning && !s.thread.capabilities.queue);\n\nexport const composerCancelDisabled = (s: AssistantState): boolean =>\n !s.composer.canCancel;\n\nexport const composerInputDisabled = (s: AssistantState): boolean =>\n s.thread.isDisabled || s.composer.dictation?.inputDisabled === true;\n\nexport const actionBarEditDisabled = (s: AssistantState): boolean =>\n s.composer.isEditing;\n\nexport const actionBarReloadDisabled = (s: AssistantState): boolean =>\n s.thread.isRunning
|
|
1
|
+
{"version":3,"file":"primitive-predicates.js","names":["ReadonlyJSONArray","ReadonlyJSONObject","AssistantState","composerSendDisabled","s","composer","canSend","thread","isRunning","capabilities","queue","composerCancelDisabled","canCancel","composerInputDisabled","isDisabled","dictation","inputDisabled","actionBarEditDisabled","isEditing","optional","edit","actionBarReloadDisabled","message","role","reload","actionBarCopyDisabled","status","type","parts","some","part","text","length","branchPickerPreviousDisabled","branchNumber","switchToBranch","switchBranchDuringRun","branchPickerNextDisabled","branchCount","suggestionTriggerDisabled","send","messageErrorText","reason","undefined","error","threadListLoadMoreDisabled","threads","hasMore","isLoading","isLoadingMore"],"sources":["../../src/store/primitive-predicates.ts"],"sourcesContent":["import type {\n ReadonlyJSONArray,\n ReadonlyJSONObject,\n} from \"assistant-stream/utils\";\nimport type { AssistantState } from \"@assistant-ui/store\";\n\n/**\n * Disabled predicates shared by every binding's primitive layer. Each binding\n * consumes these as state selectors so the disabled semantics of a primitive\n * cannot drift between frameworks.\n */\n\nexport const composerSendDisabled = (s: AssistantState): boolean =>\n !s.composer.canSend || (s.thread.isRunning && !s.thread.capabilities.queue);\n\nexport const composerCancelDisabled = (s: AssistantState): boolean =>\n !s.composer.canCancel;\n\nexport const composerInputDisabled = (s: AssistantState): boolean =>\n s.thread.isDisabled || s.composer.dictation?.inputDisabled === true;\n\nexport const actionBarEditDisabled = (s: AssistantState): boolean =>\n s.composer.isEditing || s.optional.thread?.capabilities.edit === false;\n\nexport const actionBarReloadDisabled = (s: AssistantState): boolean =>\n s.thread.isRunning ||\n s.thread.isDisabled ||\n s.message.role !== \"assistant\" ||\n !s.thread.capabilities.reload;\n\nexport const actionBarCopyDisabled = (s: AssistantState): boolean =>\n !(\n (s.message.role !== \"assistant\" || s.message.status?.type !== \"running\") &&\n s.message.parts.some((part) => part.type === \"text\" && part.text.length > 0)\n );\n\nexport const branchPickerPreviousDisabled = (s: AssistantState): boolean =>\n s.message.branchNumber <= 1 ||\n !s.thread.capabilities.switchToBranch ||\n (s.thread.isRunning && !s.thread.capabilities.switchBranchDuringRun);\n\nexport const branchPickerNextDisabled = (s: AssistantState): boolean =>\n s.message.branchNumber >= s.message.branchCount ||\n !s.thread.capabilities.switchToBranch ||\n (s.thread.isRunning && !s.thread.capabilities.switchBranchDuringRun);\n\nexport const suggestionTriggerDisabled = (\n s: AssistantState,\n send: boolean,\n): boolean =>\n s.thread.isDisabled ||\n (send && s.thread.isRunning && !s.thread.capabilities.queue);\n\nexport const messageErrorText = (\n s: AssistantState,\n):\n | string\n | number\n | boolean\n | ReadonlyJSONObject\n | ReadonlyJSONArray\n | undefined => {\n if (\n s.message.status?.type !== \"incomplete\" ||\n s.message.status.reason !== \"error\"\n ) {\n return undefined;\n }\n const error = s.message.status.error;\n if (typeof error === \"string\") return error;\n if (\n typeof error === \"object\" &&\n error !== null &&\n \"message\" in error &&\n typeof error.message === \"string\"\n ) {\n return error.message;\n }\n return error ?? \"An error occurred\";\n};\n\nexport const threadListLoadMoreDisabled = (s: AssistantState): boolean =>\n !s.threads.hasMore || s.threads.isLoading || s.threads.isLoadingMore;\n"],"mappings":";;;;;;AAYA,MAAaG,wBAAwBC,MACnC,CAACA,EAAEC,SAASC,WAAYF,EAAEG,OAAOC,aAAa,CAACJ,EAAEG,OAAOE,aAAaC;AAEvE,MAAaC,0BAA0BP,MACrC,CAACA,EAAEC,SAASO;AAEd,MAAaC,yBAAyBT,MACpCA,EAAEG,OAAOO,cAAcV,EAAEC,SAASU,WAAWC,kBAAkB;AAEjE,MAAaC,yBAAyBb,MACpCA,EAAEC,SAASa,aAAad,EAAEe,SAASZ,QAAQE,aAAaW,SAAS;AAEnE,MAAaC,2BAA2BjB,MACtCA,EAAEG,OAAOC,aACTJ,EAAEG,OAAOO,cACTV,EAAEkB,QAAQC,SAAS,eACnB,CAACnB,EAAEG,OAAOE,aAAae;AAEzB,MAAaC,yBAAyBrB,MACpC,GACGA,EAAEkB,QAAQC,SAAS,eAAenB,EAAEkB,QAAQI,QAAQC,SAAS,cAC9DvB,EAAEkB,QAAQM,MAAMC,MAAMC,SAASA,KAAKH,SAAS,UAAUG,KAAKC,KAAKC,SAAS,CAAC;AAG/E,MAAaC,gCAAgC7B,MAC3CA,EAAEkB,QAAQY,gBAAgB,KAC1B,CAAC9B,EAAEG,OAAOE,aAAa0B,kBACtB/B,EAAEG,OAAOC,aAAa,CAACJ,EAAEG,OAAOE,aAAa2B;AAEhD,MAAaC,4BAA4BjC,MACvCA,EAAEkB,QAAQY,gBAAgB9B,EAAEkB,QAAQgB,eACpC,CAAClC,EAAEG,OAAOE,aAAa0B,kBACtB/B,EAAEG,OAAOC,aAAa,CAACJ,EAAEG,OAAOE,aAAa2B;AAEhD,MAAaG,6BACXnC,GACAoC,SAEApC,EAAEG,OAAOO,cACR0B,QAAQpC,EAAEG,OAAOC,aAAa,CAACJ,EAAEG,OAAOE,aAAaC;AAExD,MAAa+B,oBACXrC,MAOe;CACf,IACEA,EAAEkB,QAAQI,QAAQC,SAAS,gBAC3BvB,EAAEkB,QAAQI,OAAOgB,WAAW,SAE5B;CAEF,MAAME,QAAQxC,EAAEkB,QAAQI,OAAOkB;CAC/B,IAAI,OAAOA,UAAU,UAAU,OAAOA;CACtC,IACE,OAAOA,UAAU,YACjBA,UAAU,QACV,aAAaA,SACb,OAAOA,MAAMtB,YAAY,UAEzB,OAAOsB,MAAMtB;CAEf,OAAOsB,SAAS;AAClB;AAEA,MAAaC,8BAA8BzC,MACzC,CAACA,EAAE0C,QAAQC,WAAW3C,EAAE0C,QAAQE,aAAa5C,EAAE0C,QAAQG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composer-runtime-client.d.ts","names":[],"sources":["../../../src/store/runtime-clients/composer-runtime-client.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"composer-runtime-client.d.ts","names":[],"sources":["../../../src/store/runtime-clients/composer-runtime-client.ts"],"mappings":";;;cAwNa,4CAAc,SAAA;EAzJZ;IAAE;;EACA;IAAE;;EACR,SAAA;EACM,iBAAE"}
|
|
@@ -2,7 +2,7 @@ import { useSubscribable } from "./useSubscribable.js";
|
|
|
2
2
|
import { AttachmentRuntimeClient } from "./attachment-runtime-client.js";
|
|
3
3
|
import { useAssistantEmit, useClientLookup } from "@assistant-ui/store/client";
|
|
4
4
|
import { c } from "@assistant-ui/tap/react-shim/compiler-runtime";
|
|
5
|
-
import { useEffect } from "@assistant-ui/tap/react-shim";
|
|
5
|
+
import { useEffect, useRef } from "@assistant-ui/tap/react-shim";
|
|
6
6
|
import { resource, useResource, withKey } from "@assistant-ui/tap";
|
|
7
7
|
//#region src/store/runtime-clients/composer-runtime-client.ts
|
|
8
8
|
const useComposerAttachmentClientByIndex = (t0) => {
|
|
@@ -38,31 +38,44 @@ const useQueueItemClient = ({ item, onMove, onRemove }) => {
|
|
|
38
38
|
};
|
|
39
39
|
const QueueItemClient = resource(useQueueItemClient);
|
|
40
40
|
const useComposerClient = (t0) => {
|
|
41
|
-
const $ = c(
|
|
42
|
-
const { threadIdRef, messageIdRef, runtime } = t0;
|
|
41
|
+
const $ = c(63);
|
|
42
|
+
const { threadIdRef, messageIdRef, runtime, isSuggestion } = t0;
|
|
43
43
|
const runtimeState = useSubscribable(runtime);
|
|
44
44
|
const emit = useAssistantEmit();
|
|
45
|
+
const pendingSuggestion = useRef(false);
|
|
45
46
|
let t1;
|
|
46
47
|
let t2;
|
|
47
48
|
if ($[0] !== emit || $[1] !== messageIdRef || $[2] !== runtime || $[3] !== threadIdRef) {
|
|
48
49
|
t1 = () => {
|
|
49
50
|
const unsubscribers = [];
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
51
|
+
const sendUnsubscribe = runtime.unstable_on("send", (payload) => {
|
|
52
|
+
const suggestion = pendingSuggestion.current;
|
|
53
|
+
pendingSuggestion.current = false;
|
|
54
|
+
emit("composer.send", {
|
|
55
|
+
threadId: threadIdRef.current,
|
|
56
|
+
...messageIdRef && { messageId: messageIdRef.current },
|
|
57
|
+
chars: payload.chars,
|
|
58
|
+
attachments: payload.attachments,
|
|
59
|
+
...suggestion ? { suggestion: true } : void 0
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
unsubscribers.push(sendUnsubscribe);
|
|
63
|
+
const attachmentUnsubscribe = runtime.unstable_on("attachmentAdd", (payload_0) => {
|
|
64
|
+
emit("composer.attachmentAdd", {
|
|
65
|
+
threadId: threadIdRef.current,
|
|
66
|
+
...messageIdRef && { messageId: messageIdRef.current },
|
|
67
|
+
...payload_0.contentType ? { contentType: payload_0.contentType } : void 0
|
|
56
68
|
});
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
unsubscribers.push(runtime.unstable_on("attachmentAddError", (
|
|
69
|
+
});
|
|
70
|
+
unsubscribers.push(attachmentUnsubscribe);
|
|
71
|
+
unsubscribers.push(runtime.unstable_on("attachmentAddError", (payload_1) => {
|
|
60
72
|
emit("composer.attachmentAddError", {
|
|
61
73
|
threadId: threadIdRef.current,
|
|
62
74
|
...messageIdRef && { messageId: messageIdRef.current },
|
|
63
|
-
...
|
|
64
|
-
reason:
|
|
65
|
-
message:
|
|
75
|
+
...payload_1.attachmentId && { attachmentId: payload_1.attachmentId },
|
|
76
|
+
reason: payload_1.reason,
|
|
77
|
+
message: payload_1.message,
|
|
78
|
+
...payload_1.contentType ? { contentType: payload_1.contentType } : void 0
|
|
66
79
|
});
|
|
67
80
|
}));
|
|
68
81
|
return () => {
|
|
@@ -162,34 +175,57 @@ const useComposerClient = (t0) => {
|
|
|
162
175
|
$[30] = state;
|
|
163
176
|
$[31] = t7;
|
|
164
177
|
} else t7 = $[31];
|
|
165
|
-
|
|
178
|
+
let t8;
|
|
179
|
+
if ($[32] !== isSuggestion || $[33] !== runtime) {
|
|
180
|
+
t8 = (options) => {
|
|
181
|
+
const state_0 = runtime.getState();
|
|
182
|
+
pendingSuggestion.current = state_0.canSend && (isSuggestion?.(state_0.text) ?? false);
|
|
183
|
+
runtime.send(options);
|
|
184
|
+
};
|
|
185
|
+
$[32] = isSuggestion;
|
|
186
|
+
$[33] = runtime;
|
|
187
|
+
$[34] = t8;
|
|
188
|
+
} else t8 = $[34];
|
|
166
189
|
let t9;
|
|
167
|
-
if ($[
|
|
168
|
-
t9 = (
|
|
190
|
+
if ($[35] !== emit || $[36] !== messageIdRef || $[37] !== runtime || $[38] !== threadIdRef) {
|
|
191
|
+
t9 = () => {
|
|
192
|
+
if (!messageIdRef && runtime.getState().canCancel) emit("composer.cancel", { threadId: threadIdRef.current });
|
|
193
|
+
runtime.cancel();
|
|
194
|
+
};
|
|
195
|
+
$[35] = emit;
|
|
196
|
+
$[36] = messageIdRef;
|
|
197
|
+
$[37] = runtime;
|
|
198
|
+
$[38] = threadIdRef;
|
|
199
|
+
$[39] = t9;
|
|
200
|
+
} else t9 = $[39];
|
|
201
|
+
const t10 = runtime.beginEdit ?? _temp;
|
|
202
|
+
let t11;
|
|
203
|
+
if ($[40] !== attachments) {
|
|
204
|
+
t11 = (selector) => {
|
|
169
205
|
if ("id" in selector) return attachments.get({ key: selector.id });
|
|
170
206
|
else return attachments.get(selector);
|
|
171
207
|
};
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
} else
|
|
175
|
-
let
|
|
176
|
-
if ($[
|
|
177
|
-
|
|
208
|
+
$[40] = attachments;
|
|
209
|
+
$[41] = t11;
|
|
210
|
+
} else t11 = $[41];
|
|
211
|
+
let t12;
|
|
212
|
+
if ($[42] !== queueItems) {
|
|
213
|
+
t12 = (selector_0) => {
|
|
178
214
|
if ("id" in selector_0) return queueItems.get({ key: selector_0.id });
|
|
179
215
|
else return queueItems.get(selector_0);
|
|
180
216
|
};
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
} else
|
|
184
|
-
let
|
|
185
|
-
if ($[
|
|
186
|
-
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
} else
|
|
190
|
-
let
|
|
191
|
-
if ($[
|
|
192
|
-
|
|
217
|
+
$[42] = queueItems;
|
|
218
|
+
$[43] = t12;
|
|
219
|
+
} else t12 = $[43];
|
|
220
|
+
let t13;
|
|
221
|
+
if ($[44] !== runtime) {
|
|
222
|
+
t13 = () => runtime;
|
|
223
|
+
$[44] = runtime;
|
|
224
|
+
$[45] = t13;
|
|
225
|
+
} else t13 = $[45];
|
|
226
|
+
let t14;
|
|
227
|
+
if ($[46] !== runtime.addAttachment || $[47] !== runtime.clearAttachments || $[48] !== runtime.reset || $[49] !== runtime.setQuote || $[50] !== runtime.setRole || $[51] !== runtime.setRunConfig || $[52] !== runtime.setText || $[53] !== runtime.startDictation || $[54] !== runtime.stopDictation || $[55] !== t10 || $[56] !== t11 || $[57] !== t12 || $[58] !== t13 || $[59] !== t7 || $[60] !== t8 || $[61] !== t9) {
|
|
228
|
+
t14 = {
|
|
193
229
|
getState: t7,
|
|
194
230
|
setText: runtime.setText,
|
|
195
231
|
setRole: runtime.setRole,
|
|
@@ -197,35 +233,35 @@ const useComposerClient = (t0) => {
|
|
|
197
233
|
addAttachment: runtime.addAttachment,
|
|
198
234
|
reset: runtime.reset,
|
|
199
235
|
clearAttachments: runtime.clearAttachments,
|
|
200
|
-
send:
|
|
201
|
-
cancel:
|
|
202
|
-
beginEdit:
|
|
236
|
+
send: t8,
|
|
237
|
+
cancel: t9,
|
|
238
|
+
beginEdit: t10,
|
|
203
239
|
startDictation: runtime.startDictation,
|
|
204
240
|
stopDictation: runtime.stopDictation,
|
|
205
241
|
setQuote: runtime.setQuote,
|
|
206
|
-
attachment:
|
|
207
|
-
queueItem:
|
|
208
|
-
__internal_getRuntime:
|
|
242
|
+
attachment: t11,
|
|
243
|
+
queueItem: t12,
|
|
244
|
+
__internal_getRuntime: t13
|
|
209
245
|
};
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
$[
|
|
213
|
-
$[
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
227
|
-
} else
|
|
228
|
-
return
|
|
246
|
+
$[46] = runtime.addAttachment;
|
|
247
|
+
$[47] = runtime.clearAttachments;
|
|
248
|
+
$[48] = runtime.reset;
|
|
249
|
+
$[49] = runtime.setQuote;
|
|
250
|
+
$[50] = runtime.setRole;
|
|
251
|
+
$[51] = runtime.setRunConfig;
|
|
252
|
+
$[52] = runtime.setText;
|
|
253
|
+
$[53] = runtime.startDictation;
|
|
254
|
+
$[54] = runtime.stopDictation;
|
|
255
|
+
$[55] = t10;
|
|
256
|
+
$[56] = t11;
|
|
257
|
+
$[57] = t12;
|
|
258
|
+
$[58] = t13;
|
|
259
|
+
$[59] = t7;
|
|
260
|
+
$[60] = t8;
|
|
261
|
+
$[61] = t9;
|
|
262
|
+
$[62] = t14;
|
|
263
|
+
} else t14 = $[62];
|
|
264
|
+
return t14;
|
|
229
265
|
};
|
|
230
266
|
const ComposerClient = resource(useComposerClient);
|
|
231
267
|
function _temp() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composer-runtime-client.js","names":["Unsubscribe","useMemo","useEffect","useResource","resource","withKey","ClientOutput","useAssistantEmit","useClientLookup","ComposerRuntime","EditComposerRuntime","ComposerState","QueueItemState","QueuePlacement","AttachmentRuntimeClient","useSubscribable","useComposerAttachmentClientByIndex","t0","$","_c","runtime","index","t1","getAttachmentByIndex","attachmentRuntime","t2","ComposerAttachmentClientByIndex","useQueueItemClient","item","onMove","onRemove","placement","getState","steer","lane","insertAfter","move","remove","QueueItemClient","useComposerClient","threadIdRef","messageIdRef","runtimeState","emit","unsubscribers","event","const","unsubscribe","unstable_on","threadId","current","messageId","push","payload","attachmentId","reason","message","unsub","t3","attachments","t4","attachment","idx","id","map","queue","t5","moveQueueItem","removeQueueItem","queueItems","type","t6","state","attachmentAccept","canCancel","canSend","dictation","isEditing","isEmpty","quote","role","runConfig","text","t7","t8","beginEdit","_temp","t9","selector","get","key","t10","selector_0","t11","t12","addAttachment","cancel","clearAttachments","reset","send","setQuote","setRole","setRunConfig","setText","startDictation","stopDictation","queueItem","__internal_getRuntime","ComposerClient","Error"],"sources":["../../../src/store/runtime-clients/composer-runtime-client.ts"],"sourcesContent":["import type { Unsubscribe } from \"../../types/unsubscribe\";\nimport { useMemo, useEffect } from \"react\";\nimport { useResource, resource, withKey } from \"@assistant-ui/tap\";\nimport type { ClientOutput } from \"@assistant-ui/store\";\nimport { useAssistantEmit, useClientLookup } from \"@assistant-ui/store/client\";\nimport type {\n ComposerRuntime,\n EditComposerRuntime,\n} from \"../../runtime/api/composer-runtime\";\nimport type { ComposerState } from \"../scopes/composer\";\nimport type { QueueItemState } from \"../scopes/queue-item\";\nimport type { QueuePlacement } from \"../../runtime/queue/external-thread-queue-adapter\";\nimport { AttachmentRuntimeClient } from \"./attachment-runtime-client\";\nimport { useSubscribable } from \"./useSubscribable\";\n\nconst useComposerAttachmentClientByIndex = ({\n runtime,\n index,\n}: {\n runtime: ComposerRuntime;\n index: number;\n}) => {\n const attachmentRuntime = useMemo(\n () => runtime.getAttachmentByIndex(index),\n [runtime, index],\n );\n\n return useResource(\n AttachmentRuntimeClient({\n runtime: attachmentRuntime,\n }),\n );\n};\n\nconst ComposerAttachmentClientByIndex = resource(\n useComposerAttachmentClientByIndex,\n);\n\nconst useQueueItemClient = ({\n item,\n onMove,\n onRemove,\n}: {\n item: QueueItemState;\n onMove: (placement: QueuePlacement) => void;\n onRemove: () => void;\n}): ClientOutput<\"queueItem\"> => {\n return {\n getState: () => item,\n steer: () => onMove({ lane: \"steer\", insertAfter: null }),\n move: onMove,\n remove: onRemove,\n };\n};\n\nconst QueueItemClient = resource(useQueueItemClient);\n\nconst useComposerClient = ({\n threadIdRef,\n messageIdRef,\n runtime,\n}: {\n threadIdRef: { current: string };\n messageIdRef?: { current: string };\n runtime: ComposerRuntime;\n}): ClientOutput<\"composer\"> => {\n const runtimeState = useSubscribable(runtime);\n const emit = useAssistantEmit();\n\n // Bind composer events to event manager\n useEffect(() => {\n const unsubscribers: Unsubscribe[] = [];\n\n // Subscribe to composer events\n for (const event of [\"send\", \"attachmentAdd\"] as const) {\n const unsubscribe = runtime.unstable_on(event, () => {\n emit(`composer.${event}`, {\n threadId: threadIdRef.current,\n ...(messageIdRef && { messageId: messageIdRef.current }),\n });\n });\n unsubscribers.push(unsubscribe);\n }\n\n unsubscribers.push(\n runtime.unstable_on(\"attachmentAddError\", (payload) => {\n // payload.error omitted: raw Error is not store-serializable; use runtime.unstable_on for it.\n emit(\"composer.attachmentAddError\", {\n threadId: threadIdRef.current,\n ...(messageIdRef && { messageId: messageIdRef.current }),\n ...(payload.attachmentId && { attachmentId: payload.attachmentId }),\n reason: payload.reason,\n message: payload.message,\n });\n }),\n );\n\n return () => {\n for (const unsub of unsubscribers) unsub();\n };\n }, [runtime, emit, threadIdRef, messageIdRef]);\n\n const attachments = useClientLookup(\n runtimeState.attachments.map((attachment, idx) =>\n withKey(\n attachment.id,\n ComposerAttachmentClientByIndex({\n runtime,\n index: idx,\n }),\n [runtime, idx],\n ),\n ),\n );\n\n const queue = runtimeState.queue;\n const queueItems = useClientLookup(\n queue.map((item) =>\n withKey(\n item.id,\n QueueItemClient({\n item,\n onMove: (placement) => runtime.moveQueueItem(item.id, placement),\n onRemove: () => runtime.removeQueueItem(item.id),\n }),\n ),\n ),\n );\n\n const state = useMemo<ComposerState>(() => {\n return {\n text: runtimeState.text,\n role: runtimeState.role,\n attachments: attachments.state,\n runConfig: runtimeState.runConfig,\n isEditing: runtimeState.isEditing,\n canCancel: runtimeState.canCancel,\n canSend: runtimeState.canSend,\n attachmentAccept: runtimeState.attachmentAccept,\n isEmpty: runtimeState.isEmpty,\n type: runtimeState.type ?? \"thread\",\n dictation: runtimeState.dictation,\n quote: runtimeState.quote,\n queue,\n };\n }, [runtimeState, attachments.state, queue]);\n\n return {\n getState: () => state,\n setText: runtime.setText,\n setRole: runtime.setRole,\n setRunConfig: runtime.setRunConfig,\n addAttachment: runtime.addAttachment,\n reset: runtime.reset,\n clearAttachments: runtime.clearAttachments,\n send: runtime.send,\n cancel: runtime.cancel,\n beginEdit:\n (runtime as EditComposerRuntime).beginEdit ??\n (() => {\n throw new Error(\"beginEdit is not supported in this runtime\");\n }),\n startDictation: runtime.startDictation,\n stopDictation: runtime.stopDictation,\n setQuote: runtime.setQuote,\n attachment: (selector) => {\n if (\"id\" in selector) {\n return attachments.get({ key: selector.id });\n } else {\n return attachments.get(selector);\n }\n },\n queueItem: (selector) => {\n if (\"id\" in selector) {\n return queueItems.get({ key: selector.id });\n } else {\n return queueItems.get(selector);\n }\n },\n __internal_getRuntime: () => runtime,\n };\n};\n\nexport const ComposerClient = resource(useComposerClient);\n"],"mappings":";;;;;;;AAeA,MAAMgB,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F,EAAA,MAAAE,QAAAkF;EAAApF,EAAA,MAAAE,QAAAmF;EAAArF,EAAA,MAAAE,QAAAoF;EAAAtF,EAAA,MAAAE,QAAAqF;EAAAvF,EAAA,MAAAyE;EAAAzE,EAAA,MAAA2E;EAAA3E,EAAA,MAAAiE;EAAAjE,EAAA,MAAAkE;EAAAlE,EAAA,MAAAqE;EAAArE,EAAA,MAAA4E;CAAA,OAAAA,MAAA5E,EAAA;CAAA,OAjCM4E;AAiCN;AAGH,MAAac,iBAAiBxG,SAASmC,iBAAiB;AA9H9B,SAAA+C,QAAA;CAuGlB,MAAM,IAAIuB,MAAM,4CAA4C;AAAE"}
|
|
1
|
+
{"version":3,"file":"composer-runtime-client.js","names":["Unsubscribe","useMemo","useEffect","useRef","useResource","resource","withKey","ClientOutput","useAssistantEmit","useClientLookup","ComposerRuntime","EditComposerRuntime","ComposerState","QueueItemState","QueuePlacement","AttachmentRuntimeClient","useSubscribable","useComposerAttachmentClientByIndex","t0","$","_c","runtime","index","t1","getAttachmentByIndex","attachmentRuntime","t2","ComposerAttachmentClientByIndex","useQueueItemClient","item","onMove","onRemove","placement","getState","steer","lane","insertAfter","move","remove","QueueItemClient","useComposerClient","threadIdRef","messageIdRef","isSuggestion","runtimeState","emit","pendingSuggestion","unsubscribers","sendUnsubscribe","unstable_on","payload","suggestion","current","threadId","messageId","chars","attachments","undefined","push","attachmentUnsubscribe","payload_0","contentType","payload_1","attachmentId","reason","message","unsub","t3","t4","attachment","idx","id","map","queue","t5","moveQueueItem","removeQueueItem","queueItems","type","t6","state","attachmentAccept","canCancel","canSend","dictation","isEditing","isEmpty","quote","role","runConfig","text","t7","t8","options","state_0","send","t9","cancel","t10","beginEdit","_temp","t11","selector","get","key","t12","selector_0","t13","t14","addAttachment","clearAttachments","reset","setQuote","setRole","setRunConfig","setText","startDictation","stopDictation","queueItem","__internal_getRuntime","ComposerClient","Error"],"sources":["../../../src/store/runtime-clients/composer-runtime-client.ts"],"sourcesContent":["import type { Unsubscribe } from \"../../types/unsubscribe\";\nimport { useMemo, useEffect, useRef } from \"react\";\nimport { useResource, resource, withKey } from \"@assistant-ui/tap\";\nimport type { ClientOutput } from \"@assistant-ui/store\";\nimport { useAssistantEmit, useClientLookup } from \"@assistant-ui/store/client\";\nimport type {\n ComposerRuntime,\n EditComposerRuntime,\n} from \"../../runtime/api/composer-runtime\";\nimport type { ComposerState } from \"../scopes/composer\";\nimport type { QueueItemState } from \"../scopes/queue-item\";\nimport type { QueuePlacement } from \"../../runtime/queue/external-thread-queue-adapter\";\nimport { AttachmentRuntimeClient } from \"./attachment-runtime-client\";\nimport { useSubscribable } from \"./useSubscribable\";\n\nconst useComposerAttachmentClientByIndex = ({\n runtime,\n index,\n}: {\n runtime: ComposerRuntime;\n index: number;\n}) => {\n const attachmentRuntime = useMemo(\n () => runtime.getAttachmentByIndex(index),\n [runtime, index],\n );\n\n return useResource(\n AttachmentRuntimeClient({\n runtime: attachmentRuntime,\n }),\n );\n};\n\nconst ComposerAttachmentClientByIndex = resource(\n useComposerAttachmentClientByIndex,\n);\n\nconst useQueueItemClient = ({\n item,\n onMove,\n onRemove,\n}: {\n item: QueueItemState;\n onMove: (placement: QueuePlacement) => void;\n onRemove: () => void;\n}): ClientOutput<\"queueItem\"> => {\n return {\n getState: () => item,\n steer: () => onMove({ lane: \"steer\", insertAfter: null }),\n move: onMove,\n remove: onRemove,\n };\n};\n\nconst QueueItemClient = resource(useQueueItemClient);\n\nconst useComposerClient = ({\n threadIdRef,\n messageIdRef,\n runtime,\n isSuggestion,\n}: {\n threadIdRef: { current: string };\n messageIdRef?: { current: string };\n runtime: ComposerRuntime;\n isSuggestion?: ((text: string) => boolean) | undefined;\n}): ClientOutput<\"composer\"> => {\n const runtimeState = useSubscribable(runtime);\n const emit = useAssistantEmit();\n const pendingSuggestion = useRef(false);\n\n // Bind composer events to event manager\n useEffect(() => {\n const unsubscribers: Unsubscribe[] = [];\n\n // Subscribe to composer events\n const sendUnsubscribe = runtime.unstable_on(\"send\", (payload) => {\n const suggestion = pendingSuggestion.current;\n pendingSuggestion.current = false;\n emit(\"composer.send\", {\n threadId: threadIdRef.current,\n ...(messageIdRef && { messageId: messageIdRef.current }),\n chars: payload.chars,\n attachments: payload.attachments,\n ...(suggestion ? { suggestion: true } : undefined),\n });\n });\n unsubscribers.push(sendUnsubscribe);\n\n const attachmentUnsubscribe = runtime.unstable_on(\n \"attachmentAdd\",\n (payload) => {\n emit(\"composer.attachmentAdd\", {\n threadId: threadIdRef.current,\n ...(messageIdRef && { messageId: messageIdRef.current }),\n ...(payload.contentType\n ? { contentType: payload.contentType }\n : undefined),\n });\n },\n );\n unsubscribers.push(attachmentUnsubscribe);\n\n unsubscribers.push(\n runtime.unstable_on(\"attachmentAddError\", (payload) => {\n // payload.error omitted: raw Error is not store-serializable; use runtime.unstable_on for it.\n emit(\"composer.attachmentAddError\", {\n threadId: threadIdRef.current,\n ...(messageIdRef && { messageId: messageIdRef.current }),\n ...(payload.attachmentId && { attachmentId: payload.attachmentId }),\n reason: payload.reason,\n message: payload.message,\n ...(payload.contentType\n ? { contentType: payload.contentType }\n : undefined),\n });\n }),\n );\n\n return () => {\n for (const unsub of unsubscribers) unsub();\n };\n }, [runtime, emit, threadIdRef, messageIdRef]);\n\n const attachments = useClientLookup(\n runtimeState.attachments.map((attachment, idx) =>\n withKey(\n attachment.id,\n ComposerAttachmentClientByIndex({\n runtime,\n index: idx,\n }),\n [runtime, idx],\n ),\n ),\n );\n\n const queue = runtimeState.queue;\n const queueItems = useClientLookup(\n queue.map((item) =>\n withKey(\n item.id,\n QueueItemClient({\n item,\n onMove: (placement) => runtime.moveQueueItem(item.id, placement),\n onRemove: () => runtime.removeQueueItem(item.id),\n }),\n ),\n ),\n );\n\n const state = useMemo<ComposerState>(() => {\n return {\n text: runtimeState.text,\n role: runtimeState.role,\n attachments: attachments.state,\n runConfig: runtimeState.runConfig,\n isEditing: runtimeState.isEditing,\n canCancel: runtimeState.canCancel,\n canSend: runtimeState.canSend,\n attachmentAccept: runtimeState.attachmentAccept,\n isEmpty: runtimeState.isEmpty,\n type: runtimeState.type ?? \"thread\",\n dictation: runtimeState.dictation,\n quote: runtimeState.quote,\n queue,\n };\n }, [runtimeState, attachments.state, queue]);\n\n return {\n getState: () => state,\n setText: runtime.setText,\n setRole: runtime.setRole,\n setRunConfig: runtime.setRunConfig,\n addAttachment: runtime.addAttachment,\n reset: runtime.reset,\n clearAttachments: runtime.clearAttachments,\n send: (options) => {\n const state = runtime.getState();\n pendingSuggestion.current =\n state.canSend && (isSuggestion?.(state.text) ?? false);\n runtime.send(options);\n },\n cancel: () => {\n if (!messageIdRef && runtime.getState().canCancel) {\n emit(\"composer.cancel\", { threadId: threadIdRef.current });\n }\n runtime.cancel();\n },\n beginEdit:\n (runtime as EditComposerRuntime).beginEdit ??\n (() => {\n throw new Error(\"beginEdit is not supported in this runtime\");\n }),\n startDictation: runtime.startDictation,\n stopDictation: runtime.stopDictation,\n setQuote: runtime.setQuote,\n attachment: (selector) => {\n if (\"id\" in selector) {\n return attachments.get({ key: selector.id });\n } else {\n return attachments.get(selector);\n }\n },\n queueItem: (selector) => {\n if (\"id\" in selector) {\n return queueItems.get({ key: selector.id });\n } else {\n return queueItems.get(selector);\n }\n },\n __internal_getRuntime: () => runtime,\n };\n};\n\nexport const ComposerClient = resource(useComposerClient);\n"],"mappings":";;;;;;;AAeA,MAAMiB,sCAAqCC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAC,MAAA,EAAAC,SAAAC,UAAAJ;CAM3C,IAAAK;CAAA,IAAAJ,EAAA,OAAAG,SAAAH,EAAA,OAAAE,SAAA;EAESE,KAAAF,QAAOG,qBAAsBF,KAAK;EAACH,EAAA,KAAAG;EAAAH,EAAA,KAAAE;EAAAF,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAD3C,MAAAM,oBACQF;CAEN,IAAAG;CAAA,IAAAP,EAAA,OAAAM,mBAAA;EAGAC,KAAAX,wBAAwB,E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E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-runtime-client.d.ts","names":[],"sources":["../../../src/store/runtime-clients/message-runtime-client.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"message-runtime-client.d.ts","names":[],"sources":["../../../src/store/runtime-clients/message-runtime-client.ts"],"mappings":";;;cAiMa,2CAAa,SAAA;EA1If,SAAA;EACI;IAAE;;EACL"}
|