@ai-matrx/chat 0.6.5 → 0.7.0
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/CHANGELOG.md +89 -0
- package/README.md +1 -1
- package/dist/agents/components/agent-widgets/AgentChatHistorySidebar.js +16 -55
- package/dist/agents/components/chat/ChatHistorySidebar.d.ts +4 -4
- package/dist/agents/components/chat/ChatHistorySidebar.js +2 -2
- package/dist/agents/components/chat/ChatSidebarMenu.js +1 -1
- package/dist/agents/components/chat/chat-door.d.ts +67 -0
- package/dist/agents/components/chat/chat-door.js +100 -0
- package/dist/agents/components/conversation-actions/conversationActionRegistry.d.ts +8 -0
- package/dist/agents/components/conversation-actions/conversationActionRegistry.js +11 -4
- package/dist/agents/components/conversation-history/AgentConversationList.d.ts +83 -0
- package/dist/agents/components/conversation-history/AgentConversationList.js +252 -0
- package/dist/agents/components/conversation-history/ConversationArchiveSection.d.ts +11 -0
- package/dist/agents/components/conversation-history/{ConversationTrashSection.js → ConversationArchiveSection.js} +41 -23
- package/dist/agents/components/conversation-history/ConversationHistorySidebar.d.ts +29 -10
- package/dist/agents/components/conversation-history/ConversationHistorySidebar.js +94 -141
- package/dist/agents/components/conversation-history/ConversationPickerWindow.js +1 -2
- package/dist/agents/components/inputs/input-components/TextareaInput.js +2 -0
- package/dist/agents/components/inputs/input-components/VariableInputComponent.js +7 -6
- package/dist/agents/components/inputs/smart-input/ConversationCompanionPills.d.ts +3 -0
- package/dist/agents/components/inputs/smart-input/ConversationCompanionPills.js +40 -0
- package/dist/agents/components/inputs/smart-input/ConversationContextRail.js +6 -29
- package/dist/agents/components/inputs/smart-input/DeviceToolsModeRow.d.ts +3 -0
- package/dist/agents/components/inputs/smart-input/DeviceToolsModeRow.js +35 -0
- package/dist/agents/components/inputs/smart-input/InboxQueueStrip.js +0 -8
- package/dist/agents/components/inputs/smart-input/RunControlsTabPanel.d.ts +2 -0
- package/dist/agents/components/inputs/smart-input/RunControlsTabPanel.js +8 -1
- package/dist/agents/components/inputs/smart-input/RunToolPicker.js +17 -12
- package/dist/agents/components/inputs/smart-input/composer/ComposerPlusMenu.js +22 -0
- package/dist/agents/components/inputs/smart-input/rail-pill.d.ts +35 -0
- package/dist/agents/components/inputs/smart-input/rail-pill.js +30 -0
- package/dist/agents/components/inputs/variable-input-variations/AgentVariableForm.js +52 -48
- package/dist/agents/components/run/AgentRunHeader.js +11 -5
- package/dist/agents/components/run-controls/panels/shared.d.ts +1 -1
- package/dist/agents/components/shared/AgentHeaderMobile.js +1 -0
- package/dist/agents/components/shared/AgentModeController.js +91 -27
- package/dist/agents/components/shared/AgentSelectorIsland.js +2 -1
- package/dist/agents/components/shell/AgentRunSidebarMenu.js +15 -54
- package/dist/agents/components/working-document/documents-workspace/DocumentsListRail.js +1 -2
- package/dist/agents/engine.d.ts +15 -0
- package/dist/agents/engine.js +17 -0
- package/dist/agents/hooks/useModelControls.js +3 -175
- package/dist/agents/redux/agent-definition/run-tier-record.js +1 -0
- package/dist/agents/redux/agent-definition/selectors.d.ts +237 -237
- package/dist/agents/redux/agent-shortcut-categories/selectors.d.ts +50 -50
- package/dist/agents/redux/agent-shortcuts/selectors.d.ts +147 -147
- package/dist/agents/redux/conversation-history/history-filters.d.ts +6 -0
- package/dist/agents/redux/conversation-history/history-filters.js +4 -1
- package/dist/agents/redux/conversation-history/selectors.js +2 -3
- package/dist/agents/redux/conversation-history/slice.d.ts +6 -9
- package/dist/agents/redux/conversation-history/slice.js +14 -23
- package/dist/agents/redux/conversation-history/thunks.js +7 -41
- package/dist/agents/redux/conversation-history/types.d.ts +12 -12
- package/dist/agents/redux/conversation-history/types.js +4 -6
- package/dist/agents/redux/conversation-list/conversation-list.selectors.d.ts +7 -73
- package/dist/agents/redux/conversation-list/conversation-list.selectors.js +12 -36
- package/dist/agents/redux/conversation-list/conversation-list.slice.d.ts +7 -22
- package/dist/agents/redux/conversation-list/conversation-list.slice.js +7 -62
- package/dist/agents/redux/conversation-list/conversation-list.thunks.d.ts +0 -25
- package/dist/agents/redux/conversation-list/conversation-list.thunks.js +2 -58
- package/dist/agents/redux/conversation-list/conversation-list.types.d.ts +6 -5
- package/dist/agents/redux/conversation-list/conversation-row-actions.thunks.js +11 -2
- package/dist/agents/redux/conversation-list/conversation-rows.d.ts +16 -0
- package/dist/agents/redux/conversation-list/conversation-rows.js +24 -0
- package/dist/agents/redux/conversation-list/conversation-trash.thunks.d.ts +12 -4
- package/dist/agents/redux/conversation-list/conversation-trash.thunks.js +52 -36
- package/dist/agents/redux/execution-system/active-requests/active-requests.selectors.d.ts +54 -54
- package/dist/agents/redux/execution-system/context-state/context-state.selectors.d.ts +14 -14
- package/dist/agents/redux/execution-system/conversations/conversations.selectors.d.ts +5 -5
- package/dist/agents/redux/execution-system/instance-context/instance-context.selectors.d.ts +3 -3
- package/dist/agents/redux/execution-system/instance-resources/instance-resources.selectors.d.ts +8 -8
- package/dist/agents/redux/execution-system/instance-ui-state/instance-ui-state.selectors.d.ts +5 -5
- package/dist/agents/redux/execution-system/instance-variable-values/instance-variable-values.selectors.d.ts +7 -7
- package/dist/agents/redux/execution-system/message-crud/soft-delete-conversation.thunk.js +5 -2
- package/dist/agents/redux/execution-system/messages/messages.selectors.d.ts +1 -1
- package/dist/agents/redux/execution-system/observability/observability.selectors.d.ts +7 -7
- package/dist/agents/redux/execution-system/observational-memory/observational-memory.selectors.d.ts +1 -1
- package/dist/agents/redux/execution-system/selectors/aggregate.selectors.d.ts +14 -14
- package/dist/agents/redux/execution-system/thunks/create-instance.thunk.d.ts +10 -1
- package/dist/agents/redux/execution-system/thunks/create-instance.thunk.js +114 -265
- package/dist/agents/redux/execution-system/thunks/dispatch-matrx-extend-tool.thunk.js +18 -2
- package/dist/agents/redux/execution-system/thunks/dispatch-surface-client-tool.thunk.js +10 -28
- package/dist/agents/redux/execution-system/thunks/dispatch-surface-write.thunk.js +10 -25
- package/dist/agents/redux/execution-system/thunks/execute-instance.thunk.js +20 -0
- package/dist/agents/redux/execution-system/thunks/execute-manual-instance.thunk.js +6 -1
- package/dist/agents/redux/execution-system/thunks/notify-and-play-dispatcher.d.ts +58 -0
- package/dist/agents/redux/execution-system/thunks/notify-and-play-dispatcher.js +62 -0
- package/dist/agents/redux/execution-system/thunks/post-delegated-tool-outcome.d.ts +23 -0
- package/dist/agents/redux/execution-system/thunks/post-delegated-tool-outcome.js +37 -0
- package/dist/agents/redux/execution-system/thunks/resume-instance.thunk.js +10 -2
- package/dist/agents/redux/execution-system/utils/build-tool-injection.d.ts +7 -0
- package/dist/agents/redux/execution-system/utils/build-tool-injection.js +18 -6
- package/dist/agents/redux/execution-system/utils/host-turn.d.ts +45 -0
- package/dist/agents/redux/execution-system/utils/host-turn.js +119 -0
- package/dist/agents/redux/proposed-directives/proposedDirectivesSlice.d.ts +1 -1
- package/dist/agents/scribe-tools/dispatcher/dispatch-scribe-tool.thunk.d.ts +50 -20
- package/dist/agents/scribe-tools/dispatcher/dispatch-scribe-tool.thunk.js +9 -101
- package/dist/agents/types/tool-injection.types.d.ts +18 -2
- package/dist/agents/ui-first-tools/redux/agent-lists.selectors.d.ts +2 -2
- package/dist/agents/ui-first-tools/redux/pending-asks.slice.d.ts +2 -1
- package/dist/agents/ui-first-tools/redux/resolve-asks-with-input.thunk.js +1 -1
- package/dist/agents/ui-first-tools/tools/ask-response.d.ts +29 -0
- package/dist/agents/ui-first-tools/tools/ask-response.js +15 -0
- package/dist/agents/ui-first-tools/tools/schemas.d.ts +3 -25
- package/dist/agents/ui-first-tools/tools/schemas.js +1 -12
- package/dist/agents/ui-first-tools/ui/ApprovalCard.js +1 -1
- package/dist/agents/ui-first-tools/ui/AskWizard.d.ts +1 -1
- package/dist/agents/ui-first-tools/ui/AskWizard.js +1 -1
- package/dist/cx-chat/_legacy-stubs.d.ts +5 -5
- package/dist/cx-chat/components/SsrSidebarChats.js +13 -15
- package/dist/cx-chat/components/messages/UserMessage.d.ts +2 -2
- package/dist/cx-chat/types/conversation.d.ts +6 -6
- package/dist/cx-chat/utils/buildContentBlocksForSave.d.ts +1 -1
- package/dist/cx-chat/utils/cx-content-converter.d.ts +1 -1
- package/dist/host/bare-host-chrome.js +9 -3
- package/dist/host/composer-extensions.d.ts +75 -0
- package/dist/host/composer-extensions.js +92 -0
- package/dist/host/configure.js +1 -0
- package/dist/host/contract.d.ts +105 -13
- package/dist/host/defaults/confirm.d.ts +15 -0
- package/dist/host/defaults/confirm.js +25 -0
- package/dist/host/defaults/files-ui.d.ts +85 -0
- package/dist/host/defaults/files-ui.js +158 -0
- package/dist/host/defaults/gates.d.ts +27 -0
- package/dist/host/defaults/gates.js +72 -0
- package/dist/host/defaults/media-client.d.ts +15 -0
- package/dist/host/defaults/media-client.js +40 -0
- package/dist/host/defaults/voice.d.ts +81 -0
- package/dist/host/defaults/voice.js +239 -0
- package/dist/host/device-tool-handoff.d.ts +26 -0
- package/dist/host/device-tool-handoff.js +45 -0
- package/dist/host/index.d.ts +1 -0
- package/dist/host/index.js +4 -1
- package/dist/host/microphone.d.ts +11 -0
- package/dist/host/microphone.js +17 -0
- package/dist/host/ui-slots.d.ts +29 -74
- package/dist/host/ui-slots.js +40 -42
- package/dist/store/create-chat-store.d.ts +2 -2
- package/dist/store/middlewares.d.ts +5 -5
- package/dist/store/slices.d.ts +1 -1
- package/dist/surfaces/redux/selectors.d.ts +2 -2
- package/dist/tool-call-visualization/components/ToolCallVisualization.js +3 -2
- package/dist/tool-call-visualization/configured-rows/ConfiguredRowRenderer.d.ts +15 -0
- package/dist/tool-call-visualization/configured-rows/ConfiguredRowRenderer.js +36 -0
- package/dist/tool-call-visualization/configured-rows/ConfiguredToolRow.d.ts +40 -0
- package/dist/tool-call-visualization/configured-rows/ConfiguredToolRow.js +296 -0
- package/dist/tool-call-visualization/configured-rows/CopyToolButton.d.ts +23 -0
- package/dist/tool-call-visualization/configured-rows/CopyToolButton.js +62 -0
- package/dist/tool-call-visualization/configured-rows/ToolProgressView.d.ts +23 -0
- package/dist/tool-call-visualization/configured-rows/ToolProgressView.js +147 -0
- package/dist/tool-call-visualization/configured-rows/field-components.d.ts +15 -0
- package/dist/tool-call-visualization/configured-rows/field-components.js +244 -0
- package/dist/tool-call-visualization/configured-rows/helpers.d.ts +39 -0
- package/dist/tool-call-visualization/configured-rows/helpers.js +110 -0
- package/dist/tool-call-visualization/configured-rows/register.d.ts +25 -0
- package/dist/tool-call-visualization/configured-rows/register.js +51 -0
- package/dist/tool-call-visualization/configured-rows/registries.d.ts +27 -0
- package/dist/tool-call-visualization/configured-rows/registries.js +14 -0
- package/dist/tool-call-visualization/configured-rows/to-row-entry.d.ts +8 -0
- package/dist/tool-call-visualization/configured-rows/to-row-entry.js +38 -0
- package/dist/tool-call-visualization/configured-rows/transforms.d.ts +14 -0
- package/dist/tool-call-visualization/configured-rows/transforms.js +30 -0
- package/dist/tool-call-visualization/configured-rows/types.d.ts +140 -0
- package/dist/tool-call-visualization/redux/selectors.d.ts +1 -1
- package/dist/tool-call-visualization/registry/registry.d.ts +1 -1
- package/dist/tool-call-visualization/registry/registry.js +8 -1
- package/dist/tool-call-visualization/types.d.ts +1 -1
- package/dist/ui/chat-protocol-types.d.ts +0 -1
- package/dist/ui/ownership.d.ts +25 -0
- package/dist/ui/ownership.js +18 -0
- package/dist/voice-agent/audio/audioCapture.js +11 -6
- package/dist/window-panels/windows/agents/AgentRunHistoryWindow.d.ts +1 -2
- package/dist/window-panels/windows/agents/AgentRunHistoryWindow.js +21 -181
- package/dist/window-panels/windows/agents/AgentRunWindow.d.ts +1 -1
- package/dist/window-panels/windows/agents/AgentRunWindow.js +27 -21
- package/dist/window-panels/windows/agents/RunControlsWindow.js +1 -0
- package/package.json +4583 -121
- package/dist/agents/components/agent-widgets/chat-assistant/AssistantMessageCard.d.ts +0 -7
- package/dist/agents/components/agent-widgets/chat-assistant/AssistantMessageCard.js +0 -33
- package/dist/agents/components/agent-widgets/chat-assistant/StatusCard.d.ts +0 -6
- package/dist/agents/components/agent-widgets/chat-assistant/StatusCard.js +0 -21
- package/dist/agents/components/agent-widgets/chat-assistant/UserMessageCard.d.ts +0 -6
- package/dist/agents/components/agent-widgets/chat-assistant/UserMessageCard.js +0 -11
- package/dist/agents/components/agent-widgets/chat-assistant/VariableInputCard.d.ts +0 -12
- package/dist/agents/components/agent-widgets/chat-assistant/VariableInputCard.js +0 -7
- package/dist/agents/components/agent-widgets/execution-gates/PreExecutionCard.d.ts +0 -4
- package/dist/agents/components/agent-widgets/execution-gates/PreExecutionCard.js +0 -81
- package/dist/agents/components/conversation-history/ConversationTrashSection.d.ts +0 -7
- package/dist/agents/components/run/run-sidebar/SidebarHeader.d.ts +0 -21
- package/dist/agents/components/run/run-sidebar/SidebarHeader.js +0 -50
- package/dist/agents/components/run-controls/AdvancedRunSettings/index.d.ts +0 -6
- package/dist/agents/components/run-controls/AdvancedRunSettings/index.js +0 -32
- package/dist/agents/components/run-controls/RunSettingsModal.d.ts +0 -5
- package/dist/agents/components/run-controls/RunSettingsModal.js +0 -22
- package/dist/agents/components/shell/AgentBuildSidebarExtras.d.ts +0 -6
- package/dist/agents/components/shell/AgentBuildSidebarExtras.js +0 -30
- package/dist/agents/constants/agent-system-competitors.d.ts +0 -9
- package/dist/agents/constants/agent-system-competitors.js +0 -125
- package/dist/agents/hooks/message-crud/useMessageActions.d.ts +0 -29
- package/dist/agents/hooks/message-crud/useMessageActions.js +0 -119
- package/dist/agents/hooks/useConversationPendingCalls.d.ts +0 -30
- package/dist/agents/hooks/useConversationPendingCalls.js +0 -42
- package/dist/agents/model-registry/model-classes.d.ts +0 -1
- package/dist/agents/model-registry/model-classes.js +0 -1
- package/dist/agents/redux/conversation-history/index.d.ts +0 -18
- package/dist/agents/redux/conversation-history/index.js +0 -4
- package/dist/agents/redux/execution-system/instance-variable-values/instance-variable-values.thunks.d.ts +0 -38
- package/dist/agents/redux/execution-system/instance-variable-values/instance-variable-values.thunks.js +0 -42
- package/dist/agents/redux/execution-system/message-crud/server/compact-turns.thunk.d.ts +0 -58
- package/dist/agents/redux/execution-system/message-crud/server/compact-turns.thunk.js +0 -50
- package/dist/agents/redux/execution-system/message-crud/server/fork-and-run-server.thunk.d.ts +0 -76
- package/dist/agents/redux/execution-system/message-crud/server/fork-and-run-server.thunk.js +0 -101
- package/dist/agents/redux/execution-system/thunks/attach-workflow-run.d.ts +0 -38
- package/dist/agents/redux/execution-system/thunks/attach-workflow-run.js +0 -25
- package/dist/agents/redux/execution-system/utils/source-slice-helpers.d.ts +0 -45
- package/dist/agents/redux/execution-system/utils/source-slice-helpers.js +0 -50
- package/dist/agents/runtime/realtime/launchRealtimeSession.thunk.d.ts +0 -25
- package/dist/agents/runtime/realtime/launchRealtimeSession.thunk.js +0 -15
- package/dist/agents/services/agentService.d.ts +0 -12
- package/dist/agents/services/agentService.js +0 -92
- package/dist/agents/utils/escape-code-fences.d.ts +0 -15
- package/dist/agents/utils/escape-code-fences.js +0 -9
- package/dist/agents/utils/normalize-managed-options.d.ts +0 -30
- package/dist/agents/utils/normalize-managed-options.js +0 -29
- package/dist/agents/utils/processedDocumentContext.d.ts +0 -51
- package/dist/agents/utils/processedDocumentContext.js +0 -51
- package/dist/agents/utils/variable-validation.d.ts +0 -28
- package/dist/agents/utils/variable-validation.js +0 -54
- package/dist/cx-chat/components/ChatConversationSkeleton.d.ts +0 -9
- package/dist/cx-chat/components/ChatConversationSkeleton.js +0 -45
- package/dist/cx-chat/components/ChatPanelBackButton.d.ts +0 -1
- package/dist/cx-chat/components/ChatPanelBackButton.js +0 -26
- package/dist/cx-chat/components/messages/MessageErrorBoundary.d.ts +0 -20
- package/dist/cx-chat/components/messages/MessageErrorBoundary.js +0 -40
- package/dist/cx-chat/components/variable-inputs/CheckboxGroupInput.d.ts +0 -14
- package/dist/cx-chat/components/variable-inputs/CheckboxGroupInput.js +0 -160
- package/dist/cx-chat/components/variable-inputs/NumberInput.d.ts +0 -15
- package/dist/cx-chat/components/variable-inputs/NumberInput.js +0 -79
- package/dist/cx-chat/components/variable-inputs/RadioGroupInput.d.ts +0 -14
- package/dist/cx-chat/components/variable-inputs/RadioGroupInput.js +0 -125
- package/dist/cx-chat/components/variable-inputs/SelectInput.d.ts +0 -14
- package/dist/cx-chat/components/variable-inputs/SelectInput.js +0 -92
- package/dist/cx-chat/components/variable-inputs/TextareaInput.d.ts +0 -14
- package/dist/cx-chat/components/variable-inputs/TextareaInput.js +0 -46
- package/dist/cx-chat/components/variable-inputs/ToggleInput.d.ts +0 -14
- package/dist/cx-chat/components/variable-inputs/ToggleInput.js +0 -46
- package/dist/cx-chat/hooks/useChatPersistence.d.ts +0 -28
- package/dist/cx-chat/hooks/useChatPersistence.js +0 -180
- package/dist/cx-chat/hooks/useInstanceBootstrap.d.ts +0 -1
- package/dist/cx-chat/hooks/useInstanceBootstrap.js +0 -115
- package/dist/cx-chat/types/content.d.ts +0 -184
- package/dist/cx-chat/types/content.js +0 -91
- package/dist/cx-chat/types/cx-tables.d.ts +0 -176
- package/dist/cx-chat/utils/settings-diff.d.ts +0 -13
- package/dist/cx-chat/utils/settings-diff.js +0 -25
- package/dist/public-chat/components/AgentSelector.d.ts +0 -22
- package/dist/public-chat/components/AgentSelector.js +0 -80
- package/dist/public-chat/components/GuidedVariableInputs.d.ts +0 -25
- package/dist/public-chat/components/GuidedVariableInputs.js +0 -623
- package/dist/public-chat/components/PublicVariableInputs.d.ts +0 -29
- package/dist/public-chat/components/PublicVariableInputs.js +0 -172
- package/dist/public-chat/types/content.d.ts +0 -184
- package/dist/public-chat/types/content.js +0 -91
- package/dist/tool-call-visualization/renderers/_shared-entity/EntityOpenActions.d.ts +0 -15
- package/dist/tool-call-visualization/renderers/_shared-entity/EntityOpenActions.js +0 -31
- package/dist/tool-call-visualization/utils/toolCallBlockToLifecycleEntry.d.ts +0 -24
- package/dist/tool-call-visualization/utils/toolCallBlockToLifecycleEntry.js +0 -26
- package/dist/ui/AudioOutputBlockSkeleton.d.ts +0 -17
- package/dist/ui/AudioOutputBlockSkeleton.js +0 -78
- package/dist/ui/lazy/PublicChatVariableInputs.d.ts +0 -2
- package/dist/ui/lazy/PublicChatVariableInputs.js +0 -16
- package/dist/utils/xml/readXmlTag.d.ts +0 -12
- package/dist/utils/xml/readXmlTag.js +0 -66
- /package/dist/{cx-chat/types/cx-tables.js → tool-call-visualization/configured-rows/types.js} +0 -0
|
@@ -15,6 +15,12 @@ export interface HistoryFilterInput {
|
|
|
15
15
|
includeOriginClasses: string[];
|
|
16
16
|
/** Lane gate. `null` = no gate; `[]` = every lane off. */
|
|
17
17
|
includeLanes: ConversationLane[] | null;
|
|
18
|
+
/**
|
|
19
|
+
* Only these conversations (`id in (...)`): a surface whose list is "the
|
|
20
|
+
* conversations that belong to THIS thing" (a board's). `null`/absent = no
|
|
21
|
+
* restriction; `[]` = none belong, so nothing is fetched.
|
|
22
|
+
*/
|
|
23
|
+
onlyConversationIds?: string[] | null;
|
|
18
24
|
}
|
|
19
25
|
/** The slice of the PostgREST filter builder the history filters use. */
|
|
20
26
|
export interface HistoryFilterable<Q> {
|
|
@@ -4,7 +4,9 @@ function excludeHiddenLane(query) {
|
|
|
4
4
|
}
|
|
5
5
|
function applyHistoryFilters(query, f) {
|
|
6
6
|
if (f.includeLanes !== null && f.includeLanes.length === 0) return null;
|
|
7
|
+
if (f.onlyConversationIds && f.onlyConversationIds.length === 0) return null;
|
|
7
8
|
let q = query;
|
|
9
|
+
if (f.onlyConversationIds) q = q.in("id", f.onlyConversationIds);
|
|
8
10
|
if (f.includeLanes !== null) {
|
|
9
11
|
q = q.in("lane", f.includeLanes);
|
|
10
12
|
} else {
|
|
@@ -39,7 +41,8 @@ function historyFilterInputFromScope(scope, overrides = {}) {
|
|
|
39
41
|
includeSourceApps: overrides.includeSourceApps ?? scope.includeSourceApps,
|
|
40
42
|
includeEmptySource: overrides.includeEmptySource ?? scope.includeEmptySource,
|
|
41
43
|
includeOriginClasses: scope.includeOriginClasses ?? [],
|
|
42
|
-
includeLanes: scope.includeLanes ?? null
|
|
44
|
+
includeLanes: scope.includeLanes ?? null,
|
|
45
|
+
onlyConversationIds: scope.onlyConversationIds ?? null
|
|
43
46
|
};
|
|
44
47
|
}
|
|
45
48
|
export {
|
|
@@ -2,7 +2,7 @@ import { createSelector } from "@reduxjs/toolkit";
|
|
|
2
2
|
import { idMatchesQuery } from "@ai-matrx/kit/search-scoring";
|
|
3
3
|
import {
|
|
4
4
|
defaultScopeState,
|
|
5
|
-
|
|
5
|
+
isLiveConversationRow
|
|
6
6
|
} from "./types.js";
|
|
7
7
|
import {
|
|
8
8
|
CONVERSATION_LANES,
|
|
@@ -35,9 +35,8 @@ const makeSelectConversationHistoryScope = (scopeId) => createSelector(selectCon
|
|
|
35
35
|
const makeSelectConversationHistoryItems = (scopeId) => {
|
|
36
36
|
const selectScope = makeSelectConversationHistoryScope(scopeId);
|
|
37
37
|
return createSelector(selectScope, (scope) => {
|
|
38
|
-
const view = scope.archiveView ?? "active";
|
|
39
38
|
const inView = scope.items.filter(
|
|
40
|
-
(item) =>
|
|
39
|
+
(item) => isLiveConversationRow(item.status)
|
|
41
40
|
);
|
|
42
41
|
const term = scope.searchTerm.trim().toLowerCase();
|
|
43
42
|
if (!term) return inView;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ConversationListItem } from "../conversation-list/conversation-list.types.js";
|
|
2
|
-
import { type ConversationHistoryState, type HistoryGrouping, type
|
|
2
|
+
import { type ConversationHistoryState, type HistoryGrouping, type HistoryStatus, type SourceFacet, type SourceFacetsStatus } from "./types.js";
|
|
3
3
|
import { type ConversationLane } from "./lanes.js";
|
|
4
4
|
export declare const configureScope: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
5
5
|
scopeId: string;
|
|
@@ -21,7 +21,10 @@ export declare const configureScope: import("@reduxjs/toolkit").ActionCreatorWit
|
|
|
21
21
|
}, "conversationHistory/configureScope">, setScopeAgentIds: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
22
22
|
scopeId: string;
|
|
23
23
|
agentIds: string[];
|
|
24
|
-
}, "conversationHistory/setScopeAgentIds">,
|
|
24
|
+
}, "conversationHistory/setScopeAgentIds">, setScopeOnlyConversationIds: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
25
|
+
scopeId: string;
|
|
26
|
+
ids: string[] | null;
|
|
27
|
+
}, "conversationHistory/setScopeOnlyConversationIds">, setScopeSourceFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
25
28
|
scopeId: string;
|
|
26
29
|
includeSourceFeatures: string[];
|
|
27
30
|
includeSourceApps: string[];
|
|
@@ -58,13 +61,7 @@ export declare const configureScope: import("@reduxjs/toolkit").ActionCreatorWit
|
|
|
58
61
|
}, "conversationHistory/setScopePageSuccess">, patchConversationInScopes: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
59
62
|
conversationId: string;
|
|
60
63
|
patch: Partial<ConversationListItem>;
|
|
61
|
-
}, "conversationHistory/patchConversationInScopes">,
|
|
62
|
-
scopeId: string;
|
|
63
|
-
view: HistoryArchiveView;
|
|
64
|
-
}, "conversationHistory/setScopeArchiveView">, setScopeArchivedCount: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
65
|
-
scopeId: string;
|
|
66
|
-
count: number | null;
|
|
67
|
-
}, "conversationHistory/setScopeArchivedCount">, removeConversationFromScopes: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
64
|
+
}, "conversationHistory/patchConversationInScopes">, removeConversationFromScopes: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
68
65
|
conversationId: string;
|
|
69
66
|
}, "conversationHistory/removeConversationFromScopes">, upsertConversationIntoScopes: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
70
67
|
row: ConversationListItem;
|
|
@@ -32,8 +32,6 @@ function ensureScope(state, scopeId) {
|
|
|
32
32
|
}
|
|
33
33
|
if (scope.includeOriginClasses === void 0) scope.includeOriginClasses = [];
|
|
34
34
|
if (scope.includeLanes === void 0) scope.includeLanes = null;
|
|
35
|
-
if (scope.archiveView === void 0) scope.archiveView = "active";
|
|
36
|
-
if (scope.archivedCount === void 0) scope.archivedCount = null;
|
|
37
35
|
return scope;
|
|
38
36
|
}
|
|
39
37
|
function sortByUpdated(items) {
|
|
@@ -152,6 +150,15 @@ const slice = createSlice({
|
|
|
152
150
|
scope.includeLanes = lanes === null ? null : [...lanes];
|
|
153
151
|
invalidateScopeWindow(scope);
|
|
154
152
|
},
|
|
153
|
+
setScopeOnlyConversationIds(state, action) {
|
|
154
|
+
const { scopeId, ids } = action.payload;
|
|
155
|
+
const scope = ensureScope(state, scopeId);
|
|
156
|
+
const current = scope.onlyConversationIds ?? null;
|
|
157
|
+
const unchanged = current === ids || current !== null && ids !== null && sameStringArray(current, ids);
|
|
158
|
+
if (unchanged) return;
|
|
159
|
+
scope.onlyConversationIds = ids === null ? null : [...ids];
|
|
160
|
+
invalidateScopeWindow(scope);
|
|
161
|
+
},
|
|
155
162
|
setScopeAgentIds(state, action) {
|
|
156
163
|
const scope = ensureScope(state, action.payload.scopeId);
|
|
157
164
|
const sameLen = scope.agentIds.length === action.payload.agentIds.length;
|
|
@@ -168,16 +175,6 @@ const slice = createSlice({
|
|
|
168
175
|
setScopeSearch(state, action) {
|
|
169
176
|
ensureScope(state, action.payload.scopeId).searchTerm = action.payload.searchTerm;
|
|
170
177
|
},
|
|
171
|
-
/** "Archived (N)" ⇄ back: switches which half the list shows and refetches. */
|
|
172
|
-
setScopeArchiveView(state, action) {
|
|
173
|
-
const scope = ensureScope(state, action.payload.scopeId);
|
|
174
|
-
if (scope.archiveView === action.payload.view) return;
|
|
175
|
-
scope.archiveView = action.payload.view;
|
|
176
|
-
invalidateScopeWindow(scope);
|
|
177
|
-
},
|
|
178
|
-
setScopeArchivedCount(state, action) {
|
|
179
|
-
ensureScope(state, action.payload.scopeId).archivedCount = action.payload.count;
|
|
180
|
-
},
|
|
181
178
|
setScopeGrouping(state, action) {
|
|
182
179
|
ensureScope(state, action.payload.scopeId).grouping = action.payload.grouping;
|
|
183
180
|
},
|
|
@@ -222,14 +219,7 @@ const slice = createSlice({
|
|
|
222
219
|
(i) => i.conversationId === conversationId
|
|
223
220
|
);
|
|
224
221
|
if (idx === -1) continue;
|
|
225
|
-
const before = scope.items[idx].status;
|
|
226
222
|
scope.items[idx] = { ...scope.items[idx], ...patch };
|
|
227
|
-
if (patch.status !== void 0 && scope.archivedCount !== null && scope.archivedCount !== void 0 && before === "archived" !== (patch.status === "archived")) {
|
|
228
|
-
scope.archivedCount = Math.max(
|
|
229
|
-
0,
|
|
230
|
-
scope.archivedCount + (patch.status === "archived" ? 1 : -1)
|
|
231
|
-
);
|
|
232
|
-
}
|
|
233
223
|
}
|
|
234
224
|
},
|
|
235
225
|
/**
|
|
@@ -247,6 +237,9 @@ const slice = createSlice({
|
|
|
247
237
|
if (scope.agentIds.length > 0 && !scope.agentIds.includes(agentId)) {
|
|
248
238
|
continue;
|
|
249
239
|
}
|
|
240
|
+
if (scope.onlyConversationIds && !scope.onlyConversationIds.includes(row.conversationId)) {
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
250
243
|
const feature = row.sourceFeature ?? "";
|
|
251
244
|
if (scope.excludeSourceFeatures.includes(feature)) continue;
|
|
252
245
|
const hasAllowList = scope.includeSourceFeatures.length > 0 || scope.includeSourceApps.length > 0 || scope.includeEmptySource;
|
|
@@ -305,6 +298,7 @@ const slice = createSlice({
|
|
|
305
298
|
const {
|
|
306
299
|
configureScope,
|
|
307
300
|
setScopeAgentIds,
|
|
301
|
+
setScopeOnlyConversationIds,
|
|
308
302
|
setScopeSourceFilter,
|
|
309
303
|
seedScopeSourceFilter,
|
|
310
304
|
setScopeLanes,
|
|
@@ -313,8 +307,6 @@ const {
|
|
|
313
307
|
setScopeStatus,
|
|
314
308
|
setScopePageSuccess,
|
|
315
309
|
patchConversationInScopes,
|
|
316
|
-
setScopeArchiveView,
|
|
317
|
-
setScopeArchivedCount,
|
|
318
310
|
removeConversationFromScopes,
|
|
319
311
|
upsertConversationIntoScopes,
|
|
320
312
|
clearScope,
|
|
@@ -332,10 +324,9 @@ export {
|
|
|
332
324
|
removeConversationFromScopes,
|
|
333
325
|
seedScopeSourceFilter,
|
|
334
326
|
setScopeAgentIds,
|
|
335
|
-
setScopeArchiveView,
|
|
336
|
-
setScopeArchivedCount,
|
|
337
327
|
setScopeGrouping,
|
|
338
328
|
setScopeLanes,
|
|
329
|
+
setScopeOnlyConversationIds,
|
|
339
330
|
setScopePageSuccess,
|
|
340
331
|
setScopeSearch,
|
|
341
332
|
setScopeSourceFilter,
|
|
@@ -2,7 +2,10 @@ import { createAsyncThunk } from "@reduxjs/toolkit";
|
|
|
2
2
|
import { supabase } from "../../../host/db.js";
|
|
3
3
|
import { applyFavoritesFromUes } from "../conversation-list/conversation-list.thunks.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
CONVERSATION_ROW_COLUMNS,
|
|
6
|
+
mapConversationDbRow
|
|
7
|
+
} from "../conversation-list/conversation-rows.js";
|
|
8
|
+
import {
|
|
6
9
|
setScopePageSuccess,
|
|
7
10
|
setScopeStatus,
|
|
8
11
|
configureScope,
|
|
@@ -21,7 +24,6 @@ import {
|
|
|
21
24
|
} from "./types.js";
|
|
22
25
|
import { readListRpc } from "../../../host/ui-slots.js";
|
|
23
26
|
import { getUserId, hasBrowserSession } from "../../../host/identity.js";
|
|
24
|
-
const HISTORY_COLUMNS = "id, title, description, status, message_count, initial_agent_id, last_model_id, source_app, source_feature, origin_class, created_at, updated_at, exclude_from_kg";
|
|
25
27
|
const fetchConversationHistory = createAsyncThunk(
|
|
26
28
|
"conversationHistory/fetchPage",
|
|
27
29
|
async (args, { dispatch, getState, rejectWithValue }) => {
|
|
@@ -63,15 +65,14 @@ const fetchConversationHistory = createAsyncThunk(
|
|
|
63
65
|
);
|
|
64
66
|
return { scopeId: args.scopeId, items: [], hasMore: false, nextOffset: 0, replace };
|
|
65
67
|
}
|
|
66
|
-
let query = supabase.schema("chat").from("conversation").select(
|
|
68
|
+
let query = supabase.schema("chat").from("conversation").select(CONVERSATION_ROW_COLUMNS).is("deleted_at", null).eq("is_ephemeral", false).order("updated_at", { ascending: false }).range(offset, offset + pageSize - 1);
|
|
67
69
|
if (viewerId) {
|
|
68
70
|
query = query.eq("created_by", viewerId);
|
|
69
71
|
}
|
|
70
72
|
if (agentIds.length > 0) {
|
|
71
73
|
query = query.in("initial_agent_id", agentIds);
|
|
72
74
|
}
|
|
73
|
-
|
|
74
|
-
query = archiveView === "archived" ? query.eq("status", "archived") : query.neq("status", "archived");
|
|
75
|
+
query = query.neq("status", "archived");
|
|
75
76
|
const filterInput = historyFilterInputFromScope(scope, {
|
|
76
77
|
excludeSourceFeatures,
|
|
77
78
|
includeSourceFeatures,
|
|
@@ -79,26 +80,6 @@ const fetchConversationHistory = createAsyncThunk(
|
|
|
79
80
|
includeEmptySource
|
|
80
81
|
});
|
|
81
82
|
const filtered = applyHistoryFilters(query, filterInput);
|
|
82
|
-
if (replace) {
|
|
83
|
-
let countQuery = supabase.schema("chat").from("conversation").select("id", { count: "exact", head: true }).is("deleted_at", null).eq("is_ephemeral", false).eq("status", "archived");
|
|
84
|
-
if (viewerId) countQuery = countQuery.eq("created_by", viewerId);
|
|
85
|
-
if (agentIds.length > 0) {
|
|
86
|
-
countQuery = countQuery.in("initial_agent_id", agentIds);
|
|
87
|
-
}
|
|
88
|
-
const countFiltered = applyHistoryFilters(countQuery, filterInput);
|
|
89
|
-
if (countFiltered === null) {
|
|
90
|
-
dispatch(setScopeArchivedCount({ scopeId: args.scopeId, count: 0 }));
|
|
91
|
-
} else {
|
|
92
|
-
void Promise.resolve(countFiltered).then(({ count, error: countError }) => {
|
|
93
|
-
dispatch(
|
|
94
|
-
setScopeArchivedCount({
|
|
95
|
-
scopeId: args.scopeId,
|
|
96
|
-
count: countError ? null : count ?? 0
|
|
97
|
-
})
|
|
98
|
-
);
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
83
|
if (filtered === null) {
|
|
103
84
|
dispatch(
|
|
104
85
|
setScopePageSuccess({
|
|
@@ -129,22 +110,7 @@ const fetchConversationHistory = createAsyncThunk(
|
|
|
129
110
|
return rejectWithValue(error.message);
|
|
130
111
|
}
|
|
131
112
|
const rows = data ?? [];
|
|
132
|
-
const mapped = rows.map(
|
|
133
|
-
conversationId: row.id,
|
|
134
|
-
title: row.title ?? null,
|
|
135
|
-
description: row.description ?? null,
|
|
136
|
-
updatedAt: row.updated_at,
|
|
137
|
-
createdAt: row.created_at,
|
|
138
|
-
status: row.status,
|
|
139
|
-
messageCount: row.message_count ?? 0,
|
|
140
|
-
isFavorite: false,
|
|
141
|
-
excludeFromKg: row.exclude_from_kg ?? false,
|
|
142
|
-
agentId: row.initial_agent_id ?? null,
|
|
143
|
-
lastModelId: row.last_model_id ?? null,
|
|
144
|
-
sourceApp: row.source_app ?? void 0,
|
|
145
|
-
sourceFeature: row.source_feature ?? void 0,
|
|
146
|
-
originClass: row.origin_class ?? void 0
|
|
147
|
-
}));
|
|
113
|
+
const mapped = rows.map(mapConversationDbRow);
|
|
148
114
|
const items = await applyFavoritesFromUes(mapped);
|
|
149
115
|
const hasMore = items.length === pageSize;
|
|
150
116
|
const nextOffset = offset + items.length;
|
|
@@ -33,6 +33,11 @@ export type HistoryStatus = "idle" | "loading" | "loading-more" | "succeeded" |
|
|
|
33
33
|
export interface ConversationHistoryScopeState {
|
|
34
34
|
/** Agent ids whose conversations should appear in this scope. Empty = all. */
|
|
35
35
|
agentIds: string[];
|
|
36
|
+
/**
|
|
37
|
+
* Restrict the list to these conversations (a board's own). `null` = no
|
|
38
|
+
* restriction (the default); `[]` = the list is empty without a read.
|
|
39
|
+
*/
|
|
40
|
+
onlyConversationIds?: string[] | null;
|
|
36
41
|
/**
|
|
37
42
|
* `cx_conversation.source_feature` values to hide from this scope.
|
|
38
43
|
* Empty = no filtering. Used by `/chat` to hide voice-agent transcripts
|
|
@@ -102,19 +107,14 @@ export interface ConversationHistoryScopeState {
|
|
|
102
107
|
error: string | null;
|
|
103
108
|
/** Last `Date.now()` at which a fresh fetch completed. */
|
|
104
109
|
lastFetchedAt: number | null;
|
|
105
|
-
/**
|
|
106
|
-
* THE ARCHIVED-ITEMS LAW (common-docs/policies/archived-items.md): the list
|
|
107
|
-
* hides archived conversations by default; "Archived (N)" switches this to
|
|
108
|
-
* `"archived"` in one click. The server query and the client view both obey
|
|
109
|
-
* it, so a conversation archived from any ⋯ leaves the list at once.
|
|
110
|
-
*/
|
|
111
|
-
archiveView: HistoryArchiveView;
|
|
112
|
-
/** Archived conversations under this scope's filters; null = not known yet. */
|
|
113
|
-
archivedCount: number | null;
|
|
114
110
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
111
|
+
/**
|
|
112
|
+
* Does this row belong in a live conversation list? Archived conversations
|
|
113
|
+
* never sit beside live ones: they live in the ONE "Archived" section at the
|
|
114
|
+
* foot of every conversation list, together with deleted ones (Arman,
|
|
115
|
+
* 2026-10-08: one place, called Archived). The one test, shared.
|
|
116
|
+
*/
|
|
117
|
+
export declare function isLiveConversationRow(status: string | null | undefined): boolean;
|
|
118
118
|
/**
|
|
119
119
|
* A distinct (lane, source_app, source_feature) grouping with the user's
|
|
120
120
|
* conversation count. Returned by `get_cx_conversation_lane_facets` and
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function
|
|
2
|
-
return status
|
|
1
|
+
function isLiveConversationRow(status) {
|
|
2
|
+
return status !== "archived";
|
|
3
3
|
}
|
|
4
4
|
const defaultScopeState = {
|
|
5
5
|
agentIds: [],
|
|
@@ -18,9 +18,7 @@ const defaultScopeState = {
|
|
|
18
18
|
hasMore: false,
|
|
19
19
|
status: "idle",
|
|
20
20
|
error: null,
|
|
21
|
-
lastFetchedAt: null
|
|
22
|
-
archiveView: "active",
|
|
23
|
-
archivedCount: null
|
|
21
|
+
lastFetchedAt: null
|
|
24
22
|
};
|
|
25
23
|
const CONVERSATION_HISTORY_TTL_MS = 6e4;
|
|
26
24
|
const SOURCE_FACETS_TTL_MS = 5 * 6e4;
|
|
@@ -28,5 +26,5 @@ export {
|
|
|
28
26
|
CONVERSATION_HISTORY_TTL_MS,
|
|
29
27
|
SOURCE_FACETS_TTL_MS,
|
|
30
28
|
defaultScopeState,
|
|
31
|
-
|
|
29
|
+
isLiveConversationRow
|
|
32
30
|
};
|
|
@@ -1,76 +1,5 @@
|
|
|
1
1
|
import type { ChatRootState } from "../../../store/root-state.js";
|
|
2
2
|
import type { ConversationListItem, ConversationListAgentCacheEntry, ConversationListLoadStatus } from "./conversation-list.types.js";
|
|
3
|
-
declare const selectSlice: (state: ChatRootState) => import("./conversation-list.types.js").ConversationListState;
|
|
4
|
-
export declare const selectGlobalConversationList: ((state: {
|
|
5
|
-
voiceAgent: import("../../../voice-agent/types.js").VoiceAgentState;
|
|
6
|
-
agentDefinition: import("../../types/agent-definition.types.js").AgentDefinitionSliceState;
|
|
7
|
-
conversationList: import("./conversation-list.types.js").ConversationListState;
|
|
8
|
-
conversationHistory: import("../conversation-history/index.js").ConversationHistoryState;
|
|
9
|
-
agentShortcut: import("../agent-shortcuts/types.js").AgentShortcutSliceState;
|
|
10
|
-
agentShortcutCategory: import("../agent-shortcut-categories/types.js").AgentShortcutCategorySliceState;
|
|
11
|
-
surfaceUserState: import("../../../surfaces/redux/userStateSlice.js").SurfaceUserStateSlice;
|
|
12
|
-
conversations: import("../execution-system/conversations/conversations.slice.js").ConversationsState;
|
|
13
|
-
chatIncognito: import("../chat/chat-incognito.slice.js").ChatIncognitoState;
|
|
14
|
-
chatRoute: import("../chat/chat-route.slice.js").ChatRouteState;
|
|
15
|
-
instanceModelOverrides: import("../execution-system/instance-model-overrides/instance-model-overrides.slice.js").InstanceModelOverridesState;
|
|
16
|
-
instanceInputCapabilities: import("../execution-system/instance-input-capabilities/instance-input-capabilities.slice.js").InstanceInputCapabilitiesState;
|
|
17
|
-
instanceVariableValues: import("../execution-system/instance-variable-values/instance-variable-values.slice.js").InstanceVariableValuesState;
|
|
18
|
-
instanceResources: import("../execution-system/instance-resources/instance-resources.slice.js").InstanceResourcesState;
|
|
19
|
-
instanceContext: import("../execution-system/instance-context/instance-context.slice.js").InstanceContextState;
|
|
20
|
-
instanceWorkingDocument: import("../execution-system/instance-working-document/instance-working-document.slice.js").InstanceWorkingDocumentSliceState;
|
|
21
|
-
instanceUserInput: import("../execution-system/instance-user-input/instance-user-input.slice.js").InstanceUserInputSliceState;
|
|
22
|
-
instanceClientTools: import("../execution-system/instance-client-tools/instance-client-tools.slice.js").InstanceClientToolsState;
|
|
23
|
-
pendingAsks: import("../../ui-first-tools/redux/pending-asks.slice.js").PendingAsksState;
|
|
24
|
-
conversationInbox: import("../execution-system/inbox/inbox.slice.js").ConversationInboxState;
|
|
25
|
-
agentLists: import("../../ui-first-tools/redux/agent-lists.slice.js").AgentListsState;
|
|
26
|
-
instanceUIState: import("../execution-system/instance-ui-state/instance-ui-state.slice.js").InstanceUIStateSlice;
|
|
27
|
-
activeTools: import("../execution-system/active-tools/active-tools.slice.js").ActiveToolsState;
|
|
28
|
-
activeRequests: import("../execution-system/active-requests/active-requests.slice.js").ActiveRequestsState;
|
|
29
|
-
runSets: import("../execution-system/run-sets/run-sets.slice.js").RunSetsState;
|
|
30
|
-
messages: import("../execution-system/messages/messages.slice.js").MessagesState;
|
|
31
|
-
observability: import("../execution-system/observability/observability.slice.js").ObservabilityState;
|
|
32
|
-
contextState: import("../execution-system/context-state/context-state.slice.js").ContextStateSliceState;
|
|
33
|
-
observationalMemory: import("../execution-system/observational-memory/observational-memory.slice.js").ObservationalMemoryState;
|
|
34
|
-
cacheBypass: import("../execution-system/message-crud/cache-bypass.slice.js").CacheBypassState;
|
|
35
|
-
conversationFocus: import("../execution-system/conversation-focus/conversation-focus.slice.js").ConversationFocusState;
|
|
36
|
-
surfaces: import("../surfaces/surfaces.slice.js").SurfacesState;
|
|
37
|
-
surfacesCatalog: import("../../../surfaces/redux/surfacesCatalogSlice.js").SurfacesCatalogSliceState;
|
|
38
|
-
agentSurfaceBindings: import("../../../surfaces/redux/agentSurfaceBindingsSlice.js").AgentSurfaceBindingsSliceState;
|
|
39
|
-
surfaceConfig: import("../../../surfaces/redux/surfaceConfigSlice.js").SurfaceConfigSliceState;
|
|
40
|
-
agentAssistantMarkdownDraft: import("../agent-assistant-markdown-draft.slice.js").AgentAssistantMarkdownDraftState;
|
|
41
|
-
mcp: import("../mcp/mcp.slice.js").McpSliceState;
|
|
42
|
-
proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
|
|
43
|
-
conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
|
|
44
|
-
chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
|
|
45
|
-
hostConversations: import("../execution-system/host-conversations/host-conversations.slice.js").HostConversationsState;
|
|
46
|
-
} & import("../../../store/root-state.js").ChatHostReadSlices) => ConversationListItem[]) & {
|
|
47
|
-
clearCache: () => void;
|
|
48
|
-
resultsCount: () => number;
|
|
49
|
-
resetResultsCount: () => void;
|
|
50
|
-
} & {
|
|
51
|
-
resultFunc: (resultFuncArgs_0: import("./conversation-list.types.js").ConversationListState) => ConversationListItem[];
|
|
52
|
-
memoizedResultFunc: ((resultFuncArgs_0: import("./conversation-list.types.js").ConversationListState) => ConversationListItem[]) & {
|
|
53
|
-
clearCache: () => void;
|
|
54
|
-
resultsCount: () => number;
|
|
55
|
-
resetResultsCount: () => void;
|
|
56
|
-
};
|
|
57
|
-
lastResult: () => ConversationListItem[];
|
|
58
|
-
dependencies: [typeof selectSlice];
|
|
59
|
-
recomputations: () => number;
|
|
60
|
-
resetRecomputations: () => void;
|
|
61
|
-
dependencyRecomputations: () => number;
|
|
62
|
-
resetDependencyRecomputations: () => void;
|
|
63
|
-
} & {
|
|
64
|
-
memoize: typeof import("reselect").weakMapMemoize;
|
|
65
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
66
|
-
};
|
|
67
|
-
export declare const selectGlobalConversationIds: (state: ChatRootState) => string[];
|
|
68
|
-
export declare const selectGlobalListStatus: (state: ChatRootState) => ConversationListLoadStatus;
|
|
69
|
-
export declare const selectGlobalListError: (state: ChatRootState) => string | null;
|
|
70
|
-
export declare const selectGlobalListHasMore: (state: ChatRootState) => boolean;
|
|
71
|
-
export declare const selectGlobalListLastFetchedAt: (state: ChatRootState) => number | null;
|
|
72
|
-
/** True when the global list is fresh (no refetch needed). */
|
|
73
|
-
export declare const selectGlobalListIsFresh: (ttlMs?: number) => (state: ChatRootState) => boolean;
|
|
74
3
|
export declare const selectConversationListItemById: (conversationId: string) => (state: ChatRootState) => ConversationListItem | null;
|
|
75
4
|
export declare const selectConversationIsPending: (conversationId: string) => (state: ChatRootState) => boolean;
|
|
76
5
|
export declare const selectAgentConversationsCache: (agentId: string, versionFilter: number | null) => (state: ChatRootState) => ConversationListAgentCacheEntry | undefined;
|
|
@@ -82,7 +11,7 @@ export declare function makeSelectAgentConversationList(agentId: string, version
|
|
|
82
11
|
voiceAgent: import("../../../voice-agent/types.js").VoiceAgentState;
|
|
83
12
|
agentDefinition: import("../../types/agent-definition.types.js").AgentDefinitionSliceState;
|
|
84
13
|
conversationList: import("./conversation-list.types.js").ConversationListState;
|
|
85
|
-
conversationHistory: import("../conversation-history/
|
|
14
|
+
conversationHistory: import("../conversation-history/types.js").ConversationHistoryState;
|
|
86
15
|
agentShortcut: import("../agent-shortcuts/types.js").AgentShortcutSliceState;
|
|
87
16
|
agentShortcutCategory: import("../agent-shortcut-categories/types.js").AgentShortcutCategorySliceState;
|
|
88
17
|
surfaceUserState: import("../../../surfaces/redux/userStateSlice.js").SurfaceUserStateSlice;
|
|
@@ -190,4 +119,9 @@ export declare function selectAgentConversationsEntry(state: ChatRootState, agen
|
|
|
190
119
|
* instance → agent map key → canonical agent id, then reads the cache.
|
|
191
120
|
*/
|
|
192
121
|
export declare function selectAgentConversationsEntryForInstance(state: ChatRootState, instanceId: string, versionFilter: number | null): ConversationListAgentCacheEntry | undefined;
|
|
193
|
-
|
|
122
|
+
/**
|
|
123
|
+
* The row for a conversation from whichever store holds it — the global list
|
|
124
|
+
* or any mounted sidebar scope. The Archived section needs a title for a row
|
|
125
|
+
* that was archived or deleted from a list only one of them had loaded.
|
|
126
|
+
*/
|
|
127
|
+
export declare function findConversationRow(state: ChatRootState, conversationId: string): ConversationListItem | null;
|
|
@@ -1,37 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { selectAgentById } from "../agent-definition/selectors.js";
|
|
3
3
|
import { createSelector } from "@reduxjs/toolkit";
|
|
4
|
-
import {
|
|
5
|
-
CONVERSATION_LIST_TTL_MS,
|
|
6
|
-
conversationListCacheKey
|
|
7
|
-
} from "./conversation-list.types.js";
|
|
4
|
+
import { conversationListCacheKey } from "./conversation-list.types.js";
|
|
8
5
|
import { selectAgentIdFromInstance } from "../execution-system/conversations/conversations.selectors.js";
|
|
9
6
|
const EMPTY_ITEMS = [];
|
|
10
7
|
const EMPTY_IDS = [];
|
|
11
|
-
const selectSlice = (state) => state.conversationList;
|
|
12
|
-
const selectGlobalConversationList = createSelector(
|
|
13
|
-
[selectSlice],
|
|
14
|
-
(slice) => {
|
|
15
|
-
if (slice.allConversationIds.length === 0) return EMPTY_ITEMS;
|
|
16
|
-
const out = [];
|
|
17
|
-
for (const id of slice.allConversationIds) {
|
|
18
|
-
const item = slice.byConversationId[id];
|
|
19
|
-
if (item) out.push(item);
|
|
20
|
-
}
|
|
21
|
-
return out.length === 0 ? EMPTY_ITEMS : out;
|
|
22
|
-
}
|
|
23
|
-
);
|
|
24
|
-
const selectGlobalConversationIds = (state) => state.conversationList.allConversationIds;
|
|
25
|
-
const selectGlobalListStatus = (state) => state.conversationList.globalStatus;
|
|
26
|
-
const selectGlobalListError = (state) => state.conversationList.globalError;
|
|
27
|
-
const selectGlobalListHasMore = (state) => state.conversationList.globalHasMore;
|
|
28
|
-
const selectGlobalListLastFetchedAt = (state) => state.conversationList.globalLastFetchedAt;
|
|
29
|
-
const selectGlobalListIsFresh = (ttlMs = CONVERSATION_LIST_TTL_MS) => (state) => {
|
|
30
|
-
const { globalLastFetchedAt, globalStatus } = state.conversationList;
|
|
31
|
-
if (globalStatus === "loading") return true;
|
|
32
|
-
if (!globalLastFetchedAt) return false;
|
|
33
|
-
return Date.now() - globalLastFetchedAt < ttlMs;
|
|
34
|
-
};
|
|
35
8
|
const selectConversationListItemById = (conversationId) => (state) => state.conversationList.byConversationId[conversationId] ?? null;
|
|
36
9
|
const selectConversationIsPending = (conversationId) => (state) => state.conversationList.pendingOperations.includes(conversationId);
|
|
37
10
|
const selectAgentConversationsCache = (agentId, versionFilter) => (state) => state.conversationList.agentCaches[conversationListCacheKey(agentId, versionFilter)];
|
|
@@ -80,7 +53,17 @@ function selectAgentConversationsEntryForInstance(state, instanceId, versionFilt
|
|
|
80
53
|
const canonicalAgentId = agent?.parentAgentId ?? agent?.id ?? mapKey;
|
|
81
54
|
return selectAgentConversationsEntry(state, canonicalAgentId, versionFilter);
|
|
82
55
|
}
|
|
56
|
+
function findConversationRow(state, conversationId) {
|
|
57
|
+
const fromList = state.conversationList.byConversationId[conversationId];
|
|
58
|
+
if (fromList) return fromList;
|
|
59
|
+
for (const scope of Object.values(state.conversationHistory.scopes)) {
|
|
60
|
+
const row = scope.items.find((i) => i.conversationId === conversationId);
|
|
61
|
+
if (row) return row;
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
83
65
|
export {
|
|
66
|
+
findConversationRow,
|
|
84
67
|
makeSelectAgentConversationList,
|
|
85
68
|
makeSelectAgentConversations,
|
|
86
69
|
selectAgentConversationIds,
|
|
@@ -88,12 +71,5 @@ export {
|
|
|
88
71
|
selectAgentConversationsEntry,
|
|
89
72
|
selectAgentConversationsEntryForInstance,
|
|
90
73
|
selectConversationIsPending,
|
|
91
|
-
selectConversationListItemById
|
|
92
|
-
selectGlobalConversationIds,
|
|
93
|
-
selectGlobalConversationList,
|
|
94
|
-
selectGlobalListError,
|
|
95
|
-
selectGlobalListHasMore,
|
|
96
|
-
selectGlobalListIsFresh,
|
|
97
|
-
selectGlobalListLastFetchedAt,
|
|
98
|
-
selectGlobalListStatus
|
|
74
|
+
selectConversationListItemById
|
|
99
75
|
};
|
|
@@ -14,13 +14,6 @@ import { type PayloadAction } from "@reduxjs/toolkit";
|
|
|
14
14
|
import type { ConversationListItem, ConversationListState, ConversationListLoadStatus } from "./conversation-list.types.js";
|
|
15
15
|
export { CONVERSATION_LIST_TTL_MS, CONVERSATION_LIST_PAGE_SIZE, } from "./conversation-list.types.js";
|
|
16
16
|
export declare const conversationListActions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
17
|
-
setGlobalListLoading(state: ConversationListState): void;
|
|
18
|
-
setGlobalListSuccess(state: ConversationListState, action: PayloadAction<{
|
|
19
|
-
items: ConversationListItem[];
|
|
20
|
-
hasMore: boolean;
|
|
21
|
-
replace?: boolean;
|
|
22
|
-
}>): void;
|
|
23
|
-
setGlobalListError(state: ConversationListState, action: PayloadAction<string>): void;
|
|
24
17
|
setTrashLoading(state: ConversationListState): void;
|
|
25
18
|
setTrashSuccess(state: ConversationListState, action: PayloadAction<{
|
|
26
19
|
items: ConversationListItem[];
|
|
@@ -35,7 +28,11 @@ export declare const conversationListActions: import("@reduxjs/toolkit").CaseRed
|
|
|
35
28
|
conversationId: string;
|
|
36
29
|
patch: Partial<ConversationListItem>;
|
|
37
30
|
}>): void;
|
|
38
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Put a (restored / newly created) row into the entity store. Which LIST it
|
|
33
|
+
* appears in is the conversation-history scopes' business
|
|
34
|
+
* (`upsertConversationIntoScopes`), not this slice's.
|
|
35
|
+
*/
|
|
39
36
|
prependConversation(state: ConversationListState, action: PayloadAction<ConversationListItem>): void;
|
|
40
37
|
/** Optimistic rename — pair with `revertRename` on failure. */
|
|
41
38
|
renameConversation(state: ConversationListState, action: PayloadAction<{
|
|
@@ -48,11 +45,6 @@ export declare const conversationListActions: import("@reduxjs/toolkit").CaseRed
|
|
|
48
45
|
}>): void;
|
|
49
46
|
/** Optimistic remove — no matching revert yet (caller re-fetches on error). */
|
|
50
47
|
removeConversation(state: ConversationListState, action: PayloadAction<string>): void;
|
|
51
|
-
/** Bump to top by updatedAt (global list only — agent caches are order-preserving). */
|
|
52
|
-
touchConversation(state: ConversationListState, action: PayloadAction<{
|
|
53
|
-
conversationId: string;
|
|
54
|
-
updatedAt?: string;
|
|
55
|
-
}>): void;
|
|
56
48
|
markPending(state: ConversationListState, action: PayloadAction<string>): void;
|
|
57
49
|
clearPending(state: ConversationListState, action: PayloadAction<string>): void;
|
|
58
50
|
setAgentCacheLoading(state: ConversationListState, action: PayloadAction<{
|
|
@@ -107,11 +99,7 @@ export declare const conversationListActions: import("@reduxjs/toolkit").CaseRed
|
|
|
107
99
|
clearAllAgentCaches(state: ConversationListState): void;
|
|
108
100
|
resetConversationList(): ConversationListState;
|
|
109
101
|
}, "conversationList">;
|
|
110
|
-
export declare const
|
|
111
|
-
items: ConversationListItem[];
|
|
112
|
-
hasMore: boolean;
|
|
113
|
-
replace?: boolean;
|
|
114
|
-
}, "conversationList/setGlobalListSuccess">, setGlobalListError: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "conversationList/setGlobalListError">, setTrashLoading: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"conversationList/setTrashLoading">, setTrashSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
102
|
+
export declare const setTrashLoading: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"conversationList/setTrashLoading">, setTrashSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
115
103
|
items: ConversationListItem[];
|
|
116
104
|
}, "conversationList/setTrashSuccess">, setTrashError: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "conversationList/setTrashError">, removeFromTrash: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "conversationList/removeFromTrash">, addToTrash: import("@reduxjs/toolkit").ActionCreatorWithPayload<ConversationListItem, "conversationList/addToTrash">, upsertConversation: import("@reduxjs/toolkit").ActionCreatorWithPayload<ConversationListItem, "conversationList/upsertConversation">, patchConversation: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
117
105
|
conversationId: string;
|
|
@@ -122,10 +110,7 @@ export declare const setGlobalListLoading: import("@reduxjs/toolkit").ActionCrea
|
|
|
122
110
|
}, "conversationList/renameConversation">, revertRename: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
123
111
|
conversationId: string;
|
|
124
112
|
previousTitle: string | null;
|
|
125
|
-
}, "conversationList/revertRename">, removeConversation: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "conversationList/removeConversation">,
|
|
126
|
-
conversationId: string;
|
|
127
|
-
updatedAt?: string;
|
|
128
|
-
}, "conversationList/touchConversation">, markPending: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "conversationList/markPending">, clearPending: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "conversationList/clearPending">, setAgentCacheLoading: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
113
|
+
}, "conversationList/revertRename">, removeConversation: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "conversationList/removeConversation">, markPending: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "conversationList/markPending">, clearPending: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "conversationList/clearPending">, setAgentCacheLoading: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
129
114
|
cacheKey: string;
|
|
130
115
|
agentId: string;
|
|
131
116
|
versionFilter: number | null;
|