@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.
Files changed (274) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/README.md +1 -1
  3. package/dist/agents/components/agent-widgets/AgentChatHistorySidebar.js +16 -55
  4. package/dist/agents/components/chat/ChatHistorySidebar.d.ts +4 -4
  5. package/dist/agents/components/chat/ChatHistorySidebar.js +2 -2
  6. package/dist/agents/components/chat/ChatSidebarMenu.js +1 -1
  7. package/dist/agents/components/chat/chat-door.d.ts +67 -0
  8. package/dist/agents/components/chat/chat-door.js +100 -0
  9. package/dist/agents/components/conversation-actions/conversationActionRegistry.d.ts +8 -0
  10. package/dist/agents/components/conversation-actions/conversationActionRegistry.js +11 -4
  11. package/dist/agents/components/conversation-history/AgentConversationList.d.ts +83 -0
  12. package/dist/agents/components/conversation-history/AgentConversationList.js +252 -0
  13. package/dist/agents/components/conversation-history/ConversationArchiveSection.d.ts +11 -0
  14. package/dist/agents/components/conversation-history/{ConversationTrashSection.js → ConversationArchiveSection.js} +41 -23
  15. package/dist/agents/components/conversation-history/ConversationHistorySidebar.d.ts +29 -10
  16. package/dist/agents/components/conversation-history/ConversationHistorySidebar.js +94 -141
  17. package/dist/agents/components/conversation-history/ConversationPickerWindow.js +1 -2
  18. package/dist/agents/components/inputs/input-components/TextareaInput.js +2 -0
  19. package/dist/agents/components/inputs/input-components/VariableInputComponent.js +7 -6
  20. package/dist/agents/components/inputs/smart-input/ConversationCompanionPills.d.ts +3 -0
  21. package/dist/agents/components/inputs/smart-input/ConversationCompanionPills.js +40 -0
  22. package/dist/agents/components/inputs/smart-input/ConversationContextRail.js +6 -29
  23. package/dist/agents/components/inputs/smart-input/DeviceToolsModeRow.d.ts +3 -0
  24. package/dist/agents/components/inputs/smart-input/DeviceToolsModeRow.js +35 -0
  25. package/dist/agents/components/inputs/smart-input/InboxQueueStrip.js +0 -8
  26. package/dist/agents/components/inputs/smart-input/RunControlsTabPanel.d.ts +2 -0
  27. package/dist/agents/components/inputs/smart-input/RunControlsTabPanel.js +8 -1
  28. package/dist/agents/components/inputs/smart-input/RunToolPicker.js +17 -12
  29. package/dist/agents/components/inputs/smart-input/composer/ComposerPlusMenu.js +22 -0
  30. package/dist/agents/components/inputs/smart-input/rail-pill.d.ts +35 -0
  31. package/dist/agents/components/inputs/smart-input/rail-pill.js +30 -0
  32. package/dist/agents/components/inputs/variable-input-variations/AgentVariableForm.js +52 -48
  33. package/dist/agents/components/run/AgentRunHeader.js +11 -5
  34. package/dist/agents/components/run-controls/panels/shared.d.ts +1 -1
  35. package/dist/agents/components/shared/AgentHeaderMobile.js +1 -0
  36. package/dist/agents/components/shared/AgentModeController.js +91 -27
  37. package/dist/agents/components/shared/AgentSelectorIsland.js +2 -1
  38. package/dist/agents/components/shell/AgentRunSidebarMenu.js +15 -54
  39. package/dist/agents/components/working-document/documents-workspace/DocumentsListRail.js +1 -2
  40. package/dist/agents/engine.d.ts +15 -0
  41. package/dist/agents/engine.js +17 -0
  42. package/dist/agents/hooks/useModelControls.js +3 -175
  43. package/dist/agents/redux/agent-definition/run-tier-record.js +1 -0
  44. package/dist/agents/redux/agent-definition/selectors.d.ts +237 -237
  45. package/dist/agents/redux/agent-shortcut-categories/selectors.d.ts +50 -50
  46. package/dist/agents/redux/agent-shortcuts/selectors.d.ts +147 -147
  47. package/dist/agents/redux/conversation-history/history-filters.d.ts +6 -0
  48. package/dist/agents/redux/conversation-history/history-filters.js +4 -1
  49. package/dist/agents/redux/conversation-history/selectors.js +2 -3
  50. package/dist/agents/redux/conversation-history/slice.d.ts +6 -9
  51. package/dist/agents/redux/conversation-history/slice.js +14 -23
  52. package/dist/agents/redux/conversation-history/thunks.js +7 -41
  53. package/dist/agents/redux/conversation-history/types.d.ts +12 -12
  54. package/dist/agents/redux/conversation-history/types.js +4 -6
  55. package/dist/agents/redux/conversation-list/conversation-list.selectors.d.ts +7 -73
  56. package/dist/agents/redux/conversation-list/conversation-list.selectors.js +12 -36
  57. package/dist/agents/redux/conversation-list/conversation-list.slice.d.ts +7 -22
  58. package/dist/agents/redux/conversation-list/conversation-list.slice.js +7 -62
  59. package/dist/agents/redux/conversation-list/conversation-list.thunks.d.ts +0 -25
  60. package/dist/agents/redux/conversation-list/conversation-list.thunks.js +2 -58
  61. package/dist/agents/redux/conversation-list/conversation-list.types.d.ts +6 -5
  62. package/dist/agents/redux/conversation-list/conversation-row-actions.thunks.js +11 -2
  63. package/dist/agents/redux/conversation-list/conversation-rows.d.ts +16 -0
  64. package/dist/agents/redux/conversation-list/conversation-rows.js +24 -0
  65. package/dist/agents/redux/conversation-list/conversation-trash.thunks.d.ts +12 -4
  66. package/dist/agents/redux/conversation-list/conversation-trash.thunks.js +52 -36
  67. package/dist/agents/redux/execution-system/active-requests/active-requests.selectors.d.ts +54 -54
  68. package/dist/agents/redux/execution-system/context-state/context-state.selectors.d.ts +14 -14
  69. package/dist/agents/redux/execution-system/conversations/conversations.selectors.d.ts +5 -5
  70. package/dist/agents/redux/execution-system/instance-context/instance-context.selectors.d.ts +3 -3
  71. package/dist/agents/redux/execution-system/instance-resources/instance-resources.selectors.d.ts +8 -8
  72. package/dist/agents/redux/execution-system/instance-ui-state/instance-ui-state.selectors.d.ts +5 -5
  73. package/dist/agents/redux/execution-system/instance-variable-values/instance-variable-values.selectors.d.ts +7 -7
  74. package/dist/agents/redux/execution-system/message-crud/soft-delete-conversation.thunk.js +5 -2
  75. package/dist/agents/redux/execution-system/messages/messages.selectors.d.ts +1 -1
  76. package/dist/agents/redux/execution-system/observability/observability.selectors.d.ts +7 -7
  77. package/dist/agents/redux/execution-system/observational-memory/observational-memory.selectors.d.ts +1 -1
  78. package/dist/agents/redux/execution-system/selectors/aggregate.selectors.d.ts +14 -14
  79. package/dist/agents/redux/execution-system/thunks/create-instance.thunk.d.ts +10 -1
  80. package/dist/agents/redux/execution-system/thunks/create-instance.thunk.js +114 -265
  81. package/dist/agents/redux/execution-system/thunks/dispatch-matrx-extend-tool.thunk.js +18 -2
  82. package/dist/agents/redux/execution-system/thunks/dispatch-surface-client-tool.thunk.js +10 -28
  83. package/dist/agents/redux/execution-system/thunks/dispatch-surface-write.thunk.js +10 -25
  84. package/dist/agents/redux/execution-system/thunks/execute-instance.thunk.js +20 -0
  85. package/dist/agents/redux/execution-system/thunks/execute-manual-instance.thunk.js +6 -1
  86. package/dist/agents/redux/execution-system/thunks/notify-and-play-dispatcher.d.ts +58 -0
  87. package/dist/agents/redux/execution-system/thunks/notify-and-play-dispatcher.js +62 -0
  88. package/dist/agents/redux/execution-system/thunks/post-delegated-tool-outcome.d.ts +23 -0
  89. package/dist/agents/redux/execution-system/thunks/post-delegated-tool-outcome.js +37 -0
  90. package/dist/agents/redux/execution-system/thunks/resume-instance.thunk.js +10 -2
  91. package/dist/agents/redux/execution-system/utils/build-tool-injection.d.ts +7 -0
  92. package/dist/agents/redux/execution-system/utils/build-tool-injection.js +18 -6
  93. package/dist/agents/redux/execution-system/utils/host-turn.d.ts +45 -0
  94. package/dist/agents/redux/execution-system/utils/host-turn.js +119 -0
  95. package/dist/agents/redux/proposed-directives/proposedDirectivesSlice.d.ts +1 -1
  96. package/dist/agents/scribe-tools/dispatcher/dispatch-scribe-tool.thunk.d.ts +50 -20
  97. package/dist/agents/scribe-tools/dispatcher/dispatch-scribe-tool.thunk.js +9 -101
  98. package/dist/agents/types/tool-injection.types.d.ts +18 -2
  99. package/dist/agents/ui-first-tools/redux/agent-lists.selectors.d.ts +2 -2
  100. package/dist/agents/ui-first-tools/redux/pending-asks.slice.d.ts +2 -1
  101. package/dist/agents/ui-first-tools/redux/resolve-asks-with-input.thunk.js +1 -1
  102. package/dist/agents/ui-first-tools/tools/ask-response.d.ts +29 -0
  103. package/dist/agents/ui-first-tools/tools/ask-response.js +15 -0
  104. package/dist/agents/ui-first-tools/tools/schemas.d.ts +3 -25
  105. package/dist/agents/ui-first-tools/tools/schemas.js +1 -12
  106. package/dist/agents/ui-first-tools/ui/ApprovalCard.js +1 -1
  107. package/dist/agents/ui-first-tools/ui/AskWizard.d.ts +1 -1
  108. package/dist/agents/ui-first-tools/ui/AskWizard.js +1 -1
  109. package/dist/cx-chat/_legacy-stubs.d.ts +5 -5
  110. package/dist/cx-chat/components/SsrSidebarChats.js +13 -15
  111. package/dist/cx-chat/components/messages/UserMessage.d.ts +2 -2
  112. package/dist/cx-chat/types/conversation.d.ts +6 -6
  113. package/dist/cx-chat/utils/buildContentBlocksForSave.d.ts +1 -1
  114. package/dist/cx-chat/utils/cx-content-converter.d.ts +1 -1
  115. package/dist/host/bare-host-chrome.js +9 -3
  116. package/dist/host/composer-extensions.d.ts +75 -0
  117. package/dist/host/composer-extensions.js +92 -0
  118. package/dist/host/configure.js +1 -0
  119. package/dist/host/contract.d.ts +105 -13
  120. package/dist/host/defaults/confirm.d.ts +15 -0
  121. package/dist/host/defaults/confirm.js +25 -0
  122. package/dist/host/defaults/files-ui.d.ts +85 -0
  123. package/dist/host/defaults/files-ui.js +158 -0
  124. package/dist/host/defaults/gates.d.ts +27 -0
  125. package/dist/host/defaults/gates.js +72 -0
  126. package/dist/host/defaults/media-client.d.ts +15 -0
  127. package/dist/host/defaults/media-client.js +40 -0
  128. package/dist/host/defaults/voice.d.ts +81 -0
  129. package/dist/host/defaults/voice.js +239 -0
  130. package/dist/host/device-tool-handoff.d.ts +26 -0
  131. package/dist/host/device-tool-handoff.js +45 -0
  132. package/dist/host/index.d.ts +1 -0
  133. package/dist/host/index.js +4 -1
  134. package/dist/host/microphone.d.ts +11 -0
  135. package/dist/host/microphone.js +17 -0
  136. package/dist/host/ui-slots.d.ts +29 -74
  137. package/dist/host/ui-slots.js +40 -42
  138. package/dist/store/create-chat-store.d.ts +2 -2
  139. package/dist/store/middlewares.d.ts +5 -5
  140. package/dist/store/slices.d.ts +1 -1
  141. package/dist/surfaces/redux/selectors.d.ts +2 -2
  142. package/dist/tool-call-visualization/components/ToolCallVisualization.js +3 -2
  143. package/dist/tool-call-visualization/configured-rows/ConfiguredRowRenderer.d.ts +15 -0
  144. package/dist/tool-call-visualization/configured-rows/ConfiguredRowRenderer.js +36 -0
  145. package/dist/tool-call-visualization/configured-rows/ConfiguredToolRow.d.ts +40 -0
  146. package/dist/tool-call-visualization/configured-rows/ConfiguredToolRow.js +296 -0
  147. package/dist/tool-call-visualization/configured-rows/CopyToolButton.d.ts +23 -0
  148. package/dist/tool-call-visualization/configured-rows/CopyToolButton.js +62 -0
  149. package/dist/tool-call-visualization/configured-rows/ToolProgressView.d.ts +23 -0
  150. package/dist/tool-call-visualization/configured-rows/ToolProgressView.js +147 -0
  151. package/dist/tool-call-visualization/configured-rows/field-components.d.ts +15 -0
  152. package/dist/tool-call-visualization/configured-rows/field-components.js +244 -0
  153. package/dist/tool-call-visualization/configured-rows/helpers.d.ts +39 -0
  154. package/dist/tool-call-visualization/configured-rows/helpers.js +110 -0
  155. package/dist/tool-call-visualization/configured-rows/register.d.ts +25 -0
  156. package/dist/tool-call-visualization/configured-rows/register.js +51 -0
  157. package/dist/tool-call-visualization/configured-rows/registries.d.ts +27 -0
  158. package/dist/tool-call-visualization/configured-rows/registries.js +14 -0
  159. package/dist/tool-call-visualization/configured-rows/to-row-entry.d.ts +8 -0
  160. package/dist/tool-call-visualization/configured-rows/to-row-entry.js +38 -0
  161. package/dist/tool-call-visualization/configured-rows/transforms.d.ts +14 -0
  162. package/dist/tool-call-visualization/configured-rows/transforms.js +30 -0
  163. package/dist/tool-call-visualization/configured-rows/types.d.ts +140 -0
  164. package/dist/tool-call-visualization/redux/selectors.d.ts +1 -1
  165. package/dist/tool-call-visualization/registry/registry.d.ts +1 -1
  166. package/dist/tool-call-visualization/registry/registry.js +8 -1
  167. package/dist/tool-call-visualization/types.d.ts +1 -1
  168. package/dist/ui/chat-protocol-types.d.ts +0 -1
  169. package/dist/ui/ownership.d.ts +25 -0
  170. package/dist/ui/ownership.js +18 -0
  171. package/dist/voice-agent/audio/audioCapture.js +11 -6
  172. package/dist/window-panels/windows/agents/AgentRunHistoryWindow.d.ts +1 -2
  173. package/dist/window-panels/windows/agents/AgentRunHistoryWindow.js +21 -181
  174. package/dist/window-panels/windows/agents/AgentRunWindow.d.ts +1 -1
  175. package/dist/window-panels/windows/agents/AgentRunWindow.js +27 -21
  176. package/dist/window-panels/windows/agents/RunControlsWindow.js +1 -0
  177. package/package.json +4583 -121
  178. package/dist/agents/components/agent-widgets/chat-assistant/AssistantMessageCard.d.ts +0 -7
  179. package/dist/agents/components/agent-widgets/chat-assistant/AssistantMessageCard.js +0 -33
  180. package/dist/agents/components/agent-widgets/chat-assistant/StatusCard.d.ts +0 -6
  181. package/dist/agents/components/agent-widgets/chat-assistant/StatusCard.js +0 -21
  182. package/dist/agents/components/agent-widgets/chat-assistant/UserMessageCard.d.ts +0 -6
  183. package/dist/agents/components/agent-widgets/chat-assistant/UserMessageCard.js +0 -11
  184. package/dist/agents/components/agent-widgets/chat-assistant/VariableInputCard.d.ts +0 -12
  185. package/dist/agents/components/agent-widgets/chat-assistant/VariableInputCard.js +0 -7
  186. package/dist/agents/components/agent-widgets/execution-gates/PreExecutionCard.d.ts +0 -4
  187. package/dist/agents/components/agent-widgets/execution-gates/PreExecutionCard.js +0 -81
  188. package/dist/agents/components/conversation-history/ConversationTrashSection.d.ts +0 -7
  189. package/dist/agents/components/run/run-sidebar/SidebarHeader.d.ts +0 -21
  190. package/dist/agents/components/run/run-sidebar/SidebarHeader.js +0 -50
  191. package/dist/agents/components/run-controls/AdvancedRunSettings/index.d.ts +0 -6
  192. package/dist/agents/components/run-controls/AdvancedRunSettings/index.js +0 -32
  193. package/dist/agents/components/run-controls/RunSettingsModal.d.ts +0 -5
  194. package/dist/agents/components/run-controls/RunSettingsModal.js +0 -22
  195. package/dist/agents/components/shell/AgentBuildSidebarExtras.d.ts +0 -6
  196. package/dist/agents/components/shell/AgentBuildSidebarExtras.js +0 -30
  197. package/dist/agents/constants/agent-system-competitors.d.ts +0 -9
  198. package/dist/agents/constants/agent-system-competitors.js +0 -125
  199. package/dist/agents/hooks/message-crud/useMessageActions.d.ts +0 -29
  200. package/dist/agents/hooks/message-crud/useMessageActions.js +0 -119
  201. package/dist/agents/hooks/useConversationPendingCalls.d.ts +0 -30
  202. package/dist/agents/hooks/useConversationPendingCalls.js +0 -42
  203. package/dist/agents/model-registry/model-classes.d.ts +0 -1
  204. package/dist/agents/model-registry/model-classes.js +0 -1
  205. package/dist/agents/redux/conversation-history/index.d.ts +0 -18
  206. package/dist/agents/redux/conversation-history/index.js +0 -4
  207. package/dist/agents/redux/execution-system/instance-variable-values/instance-variable-values.thunks.d.ts +0 -38
  208. package/dist/agents/redux/execution-system/instance-variable-values/instance-variable-values.thunks.js +0 -42
  209. package/dist/agents/redux/execution-system/message-crud/server/compact-turns.thunk.d.ts +0 -58
  210. package/dist/agents/redux/execution-system/message-crud/server/compact-turns.thunk.js +0 -50
  211. package/dist/agents/redux/execution-system/message-crud/server/fork-and-run-server.thunk.d.ts +0 -76
  212. package/dist/agents/redux/execution-system/message-crud/server/fork-and-run-server.thunk.js +0 -101
  213. package/dist/agents/redux/execution-system/thunks/attach-workflow-run.d.ts +0 -38
  214. package/dist/agents/redux/execution-system/thunks/attach-workflow-run.js +0 -25
  215. package/dist/agents/redux/execution-system/utils/source-slice-helpers.d.ts +0 -45
  216. package/dist/agents/redux/execution-system/utils/source-slice-helpers.js +0 -50
  217. package/dist/agents/runtime/realtime/launchRealtimeSession.thunk.d.ts +0 -25
  218. package/dist/agents/runtime/realtime/launchRealtimeSession.thunk.js +0 -15
  219. package/dist/agents/services/agentService.d.ts +0 -12
  220. package/dist/agents/services/agentService.js +0 -92
  221. package/dist/agents/utils/escape-code-fences.d.ts +0 -15
  222. package/dist/agents/utils/escape-code-fences.js +0 -9
  223. package/dist/agents/utils/normalize-managed-options.d.ts +0 -30
  224. package/dist/agents/utils/normalize-managed-options.js +0 -29
  225. package/dist/agents/utils/processedDocumentContext.d.ts +0 -51
  226. package/dist/agents/utils/processedDocumentContext.js +0 -51
  227. package/dist/agents/utils/variable-validation.d.ts +0 -28
  228. package/dist/agents/utils/variable-validation.js +0 -54
  229. package/dist/cx-chat/components/ChatConversationSkeleton.d.ts +0 -9
  230. package/dist/cx-chat/components/ChatConversationSkeleton.js +0 -45
  231. package/dist/cx-chat/components/ChatPanelBackButton.d.ts +0 -1
  232. package/dist/cx-chat/components/ChatPanelBackButton.js +0 -26
  233. package/dist/cx-chat/components/messages/MessageErrorBoundary.d.ts +0 -20
  234. package/dist/cx-chat/components/messages/MessageErrorBoundary.js +0 -40
  235. package/dist/cx-chat/components/variable-inputs/CheckboxGroupInput.d.ts +0 -14
  236. package/dist/cx-chat/components/variable-inputs/CheckboxGroupInput.js +0 -160
  237. package/dist/cx-chat/components/variable-inputs/NumberInput.d.ts +0 -15
  238. package/dist/cx-chat/components/variable-inputs/NumberInput.js +0 -79
  239. package/dist/cx-chat/components/variable-inputs/RadioGroupInput.d.ts +0 -14
  240. package/dist/cx-chat/components/variable-inputs/RadioGroupInput.js +0 -125
  241. package/dist/cx-chat/components/variable-inputs/SelectInput.d.ts +0 -14
  242. package/dist/cx-chat/components/variable-inputs/SelectInput.js +0 -92
  243. package/dist/cx-chat/components/variable-inputs/TextareaInput.d.ts +0 -14
  244. package/dist/cx-chat/components/variable-inputs/TextareaInput.js +0 -46
  245. package/dist/cx-chat/components/variable-inputs/ToggleInput.d.ts +0 -14
  246. package/dist/cx-chat/components/variable-inputs/ToggleInput.js +0 -46
  247. package/dist/cx-chat/hooks/useChatPersistence.d.ts +0 -28
  248. package/dist/cx-chat/hooks/useChatPersistence.js +0 -180
  249. package/dist/cx-chat/hooks/useInstanceBootstrap.d.ts +0 -1
  250. package/dist/cx-chat/hooks/useInstanceBootstrap.js +0 -115
  251. package/dist/cx-chat/types/content.d.ts +0 -184
  252. package/dist/cx-chat/types/content.js +0 -91
  253. package/dist/cx-chat/types/cx-tables.d.ts +0 -176
  254. package/dist/cx-chat/utils/settings-diff.d.ts +0 -13
  255. package/dist/cx-chat/utils/settings-diff.js +0 -25
  256. package/dist/public-chat/components/AgentSelector.d.ts +0 -22
  257. package/dist/public-chat/components/AgentSelector.js +0 -80
  258. package/dist/public-chat/components/GuidedVariableInputs.d.ts +0 -25
  259. package/dist/public-chat/components/GuidedVariableInputs.js +0 -623
  260. package/dist/public-chat/components/PublicVariableInputs.d.ts +0 -29
  261. package/dist/public-chat/components/PublicVariableInputs.js +0 -172
  262. package/dist/public-chat/types/content.d.ts +0 -184
  263. package/dist/public-chat/types/content.js +0 -91
  264. package/dist/tool-call-visualization/renderers/_shared-entity/EntityOpenActions.d.ts +0 -15
  265. package/dist/tool-call-visualization/renderers/_shared-entity/EntityOpenActions.js +0 -31
  266. package/dist/tool-call-visualization/utils/toolCallBlockToLifecycleEntry.d.ts +0 -24
  267. package/dist/tool-call-visualization/utils/toolCallBlockToLifecycleEntry.js +0 -26
  268. package/dist/ui/AudioOutputBlockSkeleton.d.ts +0 -17
  269. package/dist/ui/AudioOutputBlockSkeleton.js +0 -78
  270. package/dist/ui/lazy/PublicChatVariableInputs.d.ts +0 -2
  271. package/dist/ui/lazy/PublicChatVariableInputs.js +0 -16
  272. package/dist/utils/xml/readXmlTag.d.ts +0 -12
  273. package/dist/utils/xml/readXmlTag.js +0 -66
  274. /package/dist/{cx-chat/types/cx-tables.js → tool-call-visualization/configured-rows/types.js} +0 -0
@@ -16,8 +16,7 @@ import {
16
16
  Loader2,
17
17
  Search,
18
18
  Star,
19
- StarOff,
20
- X
19
+ StarOff
21
20
  } from "lucide-react";
22
21
  import { cn } from "@ai-matrx/design-system";
23
22
  import { useAppDispatch, useAppSelector } from "../../../store/hooks.js";
@@ -38,8 +37,8 @@ import { selectIsStreaming } from "../../redux/execution-system/selectors/aggreg
38
37
  import {
39
38
  seedScopeSourceFilter,
40
39
  setScopeAgentIds,
41
- setScopeArchiveView,
42
40
  setScopeLanes,
41
+ setScopeOnlyConversationIds,
43
42
  setScopeGrouping,
44
43
  setScopeSearch,
45
44
  setScopeSourceFilter
@@ -51,24 +50,18 @@ import {
51
50
  sourceKey
52
51
  } from "../../redux/conversation-history/source-registry.js";
53
52
  import {
54
- rowMatchesArchiveView
53
+ CONVERSATION_HISTORY_TTL_MS,
54
+ isLiveConversationRow
55
55
  } from "../../redux/conversation-history/types.js";
56
56
  import { useSurfaceSourceFilter } from "../../redux/conversation-history/useSurfaceSourceFilter.js";
57
- import {
58
- renameConversation,
59
- setConversationFavorite
60
- } from "../../redux/conversation-list/conversation-row-actions.thunks.js";
61
- import {
62
- buildConversationMenu
63
- } from "../conversation-actions/conversationActionRegistry.js";
57
+ import { setConversationFavorite } from "../../redux/conversation-list/conversation-row-actions.thunks.js";
64
58
  import { selectAgentById } from "../../redux/agent-definition/selectors.js";
65
59
  import { EntityDoorControls } from "../../../host/ui-slots.js";
60
+ import { ConversationListRow } from "./AgentConversationList.js";
66
61
  import { ConversationSourceFilterTree } from "./ConversationSourceFilterTree.js";
67
62
  import { AllLanesOffNotice } from "./ConversationLaneToggles.js";
68
- import { ConversationTrashSection } from "./ConversationTrashSection.js";
69
- import { ArchivedDisclosure } from "@ai-matrx/design-system";
70
- import { SegmentedControl, Button, DisclosureHeader } from "@ai-matrx/design-system/controls";
71
- import { ItemRow } from "../../../host/ui-slots.js";
63
+ import { ConversationArchiveSection } from "./ConversationArchiveSection.js";
64
+ import { SegmentedControl, Button, DisclosureHeader, SearchField } from "@ai-matrx/design-system/controls";
72
65
  import { toast } from "../../../host/notify.js";
73
66
  import {
74
67
  LoadingTapButton,
@@ -89,9 +82,13 @@ function useConversationHistoryController(props) {
89
82
  isFavorite,
90
83
  onToggleFavorite,
91
84
  getConversationHref,
92
- serverSearch = true
85
+ serverSearch = true,
86
+ keepLoaded = false,
87
+ onlyConversationIds = null,
88
+ removeFromList
93
89
  } = props;
94
90
  const dispatch = useAppDispatch();
91
+ const readFor = useRef(null);
95
92
  const selectScope = useMemo(
96
93
  () => makeSelectConversationHistoryScope(scopeId),
97
94
  [scopeId]
@@ -120,6 +117,7 @@ function useConversationHistoryController(props) {
120
117
  [agentIds]
121
118
  );
122
119
  const excludeKey = JSON.stringify(excludeSourceFeatures ?? []);
120
+ const onlyKey = onlyConversationIds ? onlyConversationIds.slice().sort().join(",") : null;
123
121
  const resolvedKey = surfaceId ? JSON.stringify(resolvedSource) : "";
124
122
  const enabledLanes = useAppSelector(selectConversationLanes);
125
123
  const lanesKey = surfaceId ? enabledLanes.join(",") : "none";
@@ -136,6 +134,12 @@ function useConversationHistoryController(props) {
136
134
  });
137
135
  useEffect(() => {
138
136
  dispatch(setScopeAgentIds({ scopeId, agentIds: agentIds.slice() }));
137
+ dispatch(
138
+ setScopeOnlyConversationIds({
139
+ scopeId,
140
+ ids: onlyConversationIds ? onlyConversationIds.slice() : null
141
+ })
142
+ );
139
143
  dispatch(
140
144
  setScopeLanes({ scopeId, lanes: surfaceId ? enabledLanes : null })
141
145
  );
@@ -159,6 +163,19 @@ function useConversationHistoryController(props) {
159
163
  if (excludeSourceFeatures !== void 0) {
160
164
  fetchArgs.excludeSourceFeatures = excludeSourceFeatures;
161
165
  }
166
+ const readKey = [scopeId, agentIdsKey, pageSize, excludeKey, resolvedKey, lanesKey, onlyKey].join("|");
167
+ if (keepLoaded) {
168
+ if (readFor.current === readKey) return;
169
+ const fresh = dispatch((_d, getState) => {
170
+ const held = getState().conversationHistory.scopes[scopeId];
171
+ return !!held && held.status === "succeeded" && held.lastFetchedAt !== null && Date.now() - held.lastFetchedAt < CONVERSATION_HISTORY_TTL_MS;
172
+ });
173
+ if (fresh) {
174
+ readFor.current = readKey;
175
+ return;
176
+ }
177
+ }
178
+ readFor.current = readKey;
162
179
  void dispatch(fetchConversationHistory(fetchArgs));
163
180
  }, [
164
181
  dispatch,
@@ -168,7 +185,9 @@ function useConversationHistoryController(props) {
168
185
  excludeKey,
169
186
  resolvedKey,
170
187
  lanesKey,
171
- surfaceId
188
+ surfaceId,
189
+ keepLoaded,
190
+ onlyKey
172
191
  ]);
173
192
  const onSearchChange = useCallback(
174
193
  (value) => {
@@ -186,12 +205,6 @@ function useConversationHistoryController(props) {
186
205
  if (!hasMore || status === "loading" || status === "loading-more") return;
187
206
  void dispatch(fetchConversationHistory({ scopeId, replace: false }));
188
207
  }, [dispatch, scopeId, hasMore, status]);
189
- const onArchiveViewChange = (open) => {
190
- dispatch(
191
- setScopeArchiveView({ scopeId, view: open ? "archived" : "active" })
192
- );
193
- void dispatch(fetchConversationHistory({ scopeId, replace: true }));
194
- };
195
208
  const onRefresh = () => {
196
209
  void dispatch(fetchConversationHistory({ scopeId, replace: true }));
197
210
  if (surfaceId) {
@@ -228,9 +241,9 @@ function useConversationHistoryController(props) {
228
241
  );
229
242
  const favorites = useMemo(() => {
230
243
  return scope.items.filter(
231
- (i) => isFavoriteResolved(i.conversationId) && rowMatchesArchiveView(i.status, scope.archiveView ?? "active")
244
+ (i) => isFavoriteResolved(i.conversationId) && isLiveConversationRow(i.status)
232
245
  );
233
- }, [scope.items, scope.archiveView, isFavoriteResolved]);
246
+ }, [scope.items, isFavoriteResolved]);
234
247
  const resolveHref = useCallback(
235
248
  (conv) => getConversationHref ? getConversationHref(conv) : `/chat/${conv.conversationId}`,
236
249
  [getConversationHref]
@@ -252,7 +265,7 @@ function useConversationHistoryController(props) {
252
265
  },
253
266
  [dispatch, scopeId]
254
267
  );
255
- const getSourceMenuCtx = useCallback(
268
+ const getSourceMenuBase = useCallback(
256
269
  (conv) => {
257
270
  if (!surfaceId) {
258
271
  return {
@@ -309,6 +322,20 @@ function useConversationHistoryController(props) {
309
322
  },
310
323
  [surfaceId, scope, facets, commitSourceFilter]
311
324
  );
325
+ const getSourceMenuCtx = useCallback(
326
+ (conv) => {
327
+ const base = getSourceMenuBase(conv);
328
+ if (!removeFromList) return base;
329
+ return {
330
+ ...base,
331
+ removeFromList: {
332
+ label: removeFromList.label,
333
+ run: () => removeFromList.onRemove(conv)
334
+ }
335
+ };
336
+ },
337
+ [getSourceMenuBase, removeFromList]
338
+ );
312
339
  return {
313
340
  scope,
314
341
  byDate,
@@ -323,7 +350,6 @@ function useConversationHistoryController(props) {
323
350
  onGroupingChange,
324
351
  onLoadMore,
325
352
  onRefresh,
326
- onArchiveViewChange,
327
353
  isFavoriteResolved,
328
354
  onToggleFavoriteResolved,
329
355
  favorites,
@@ -383,7 +409,7 @@ const DenseView = ({
383
409
  const cachedSearchItems = byDate.flatMap((bucket) => bucket.items);
384
410
  const hasAuthoritativeResults = serverSearchState.isSettled && (serverSearchState.status === "succeeded" || serverSearchState.status === "loading-more" || serverSearchState.status === "failed" && serverSearchState.items.length > 0);
385
411
  const searchItems = hasAuthoritativeResults ? serverSearchState.items.filter(
386
- (item) => rowMatchesArchiveView(item.status, ctl.scope.archiveView ?? "active")
412
+ (item) => isLiveConversationRow(item.status)
387
413
  ) : cachedSearchItems;
388
414
  const empty = !allLanesOff && status !== "loading" && status !== "idle" && !error && count === 0 && !searchTerm.trim() && emptyState;
389
415
  const showControls = showSearch || showGroupingToggle || !!headerActions || !!surfaceId;
@@ -596,8 +622,7 @@ const DenseView = ({
596
622
  count === 1 ? "" : "s"
597
623
  ] })
598
624
  ] }),
599
- /* @__PURE__ */ jsx(ConversationArchivedToggle, { ctl }),
600
- /* @__PURE__ */ jsx(ConversationTrashSection, { variant: "dense" })
625
+ /* @__PURE__ */ jsx(ConversationArchiveSection, { variant: "dense" })
601
626
  ] });
602
627
  };
603
628
  const ConsumerView = ({
@@ -609,13 +634,11 @@ const ConsumerView = ({
609
634
  openInPlace = false,
610
635
  headerSlot,
611
636
  topSlot,
612
- initialSearchOpen = false,
637
+ autoFocusSearch = false,
613
638
  hideSearchAffordance = false,
614
- historyLabel = "Filtered Chats",
615
639
  pageSize = 30,
616
640
  className
617
641
  }) => {
618
- const dispatch = useAppDispatch();
619
642
  const {
620
643
  byDate,
621
644
  status,
@@ -636,27 +659,19 @@ const ConsumerView = ({
636
659
  const cachedSearchItems = byDate.flatMap((bucket) => bucket.items);
637
660
  const hasAuthoritativeResults = serverSearchState.isSettled && (serverSearchState.status === "succeeded" || serverSearchState.status === "loading-more" || serverSearchState.status === "failed" && serverSearchState.items.length > 0);
638
661
  const searchItems = hasAuthoritativeResults ? serverSearchState.items.filter(
639
- (item) => rowMatchesArchiveView(item.status, ctl.scope.archiveView ?? "active")
662
+ (item) => isLiveConversationRow(item.status)
640
663
  ) : cachedSearchItems;
641
664
  const favoriteIds = useMemo(
642
665
  () => new Set(favorites.map((f) => f.conversationId)),
643
666
  [favorites]
644
667
  );
645
- const [searchOpen, setSearchOpen] = useState(initialSearchOpen);
646
668
  const searchInputRef = useRef(null);
647
- const openSearch = useCallback(() => {
648
- setSearchOpen(true);
649
- requestAnimationFrame(() => searchInputRef.current?.focus());
650
- }, []);
651
669
  useEffect(() => {
652
- if (initialSearchOpen) {
670
+ if (autoFocusSearch) {
653
671
  requestAnimationFrame(() => searchInputRef.current?.focus());
654
672
  }
655
- }, [initialSearchOpen]);
656
- const closeSearch = useCallback(() => {
657
- setSearchOpen(false);
658
- dispatch(setScopeSearch({ scopeId, searchTerm: "" }));
659
- }, [dispatch, scopeId]);
673
+ }, [autoFocusSearch]);
674
+ const showSearch = !hideSearchAffordance;
660
675
  return /* @__PURE__ */ jsxs(
661
676
  "div",
662
677
  {
@@ -666,9 +681,22 @@ const ConsumerView = ({
666
681
  ),
667
682
  children: [
668
683
  headerSlot,
669
- surfaceId && /* @__PURE__ */ jsxs("div", { className: "flex h-8 shrink-0 items-center gap-1 px-2", children: [
670
- /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-[11px] font-semibold uppercase tracking-wide text-muted-foreground/70", children: historyLabel }),
671
- /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center", children: [
684
+ (showSearch || surfaceId) && /* @__PURE__ */ jsxs("div", { className: "flex h-9 shrink-0 items-center gap-1 px-2", children: [
685
+ showSearch ? /* @__PURE__ */ jsx(
686
+ SearchField,
687
+ {
688
+ ref: searchInputRef,
689
+ value: searchTerm,
690
+ onChange: (e) => onSearchChange(e.target.value),
691
+ onKeyDown: (e) => {
692
+ if (e.key === "Escape") onSearchChange("");
693
+ },
694
+ placeholder: "Search",
695
+ "aria-label": "Search conversations",
696
+ className: "min-w-0 flex-1"
697
+ }
698
+ ) : /* @__PURE__ */ jsx("span", { className: "flex-1" }),
699
+ surfaceId && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center", children: [
672
700
  status === "loading" ? /* @__PURE__ */ jsx(
673
701
  LoadingTapButton,
674
702
  {
@@ -699,25 +727,6 @@ const ConsumerView = ({
699
727
  )
700
728
  ] })
701
729
  ] }),
702
- !hideSearchAffordance && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-1 px-1 pb-1", children: searchOpen ? /* @__PURE__ */ jsxs("div", { className: "relative flex flex-1 items-center", children: [
703
- /* @__PURE__ */ jsx(Search, { className: "absolute left-2.5 h-3.5 w-3.5 text-muted-foreground" }),
704
- /* @__PURE__ */ jsx(
705
- "input",
706
- {
707
- ref: searchInputRef,
708
- type: "search",
709
- value: searchTerm,
710
- onChange: (e) => onSearchChange(e.target.value),
711
- onKeyDown: (e) => {
712
- if (e.key === "Escape") closeSearch();
713
- },
714
- placeholder: "Search chats",
715
- className: "h-8 w-full rounded-lg border border-border bg-background pl-8 pr-8 text-sm text-foreground placeholder:text-muted-foreground/70 outline-none focus:border-ring/40",
716
- "aria-label": "Search conversations"
717
- }
718
- ),
719
- /* @__PURE__ */ jsx(Button, { variant: "quiet", icon: /* @__PURE__ */ jsx(X, {}), onClick: closeSearch, "aria-label": "Close search", className: "absolute right-1.5" })
720
- ] }) : /* @__PURE__ */ jsx(Button, { variant: "quiet", icon: /* @__PURE__ */ jsx(Search, {}), onClick: openSearch, "aria-label": "Search conversations", className: "flex-1", children: "Search chats" }) }),
721
730
  topSlot,
722
731
  /* @__PURE__ */ jsxs("div", { className: "min-h-0 flex-1 overflow-y-auto pt-1", children: [
723
732
  error && !searchActive && /* @__PURE__ */ jsx(ReadFailure, { error, what: "your conversations", onRetry: onRefresh, className: "m-2" }),
@@ -794,27 +803,11 @@ const ConsumerView = ({
794
803
  }
795
804
  ) })
796
805
  ] }),
797
- /* @__PURE__ */ jsx(ConversationArchivedToggle, { ctl }),
798
- /* @__PURE__ */ jsx(ConversationTrashSection, { variant: "consumer" })
806
+ /* @__PURE__ */ jsx(ConversationArchiveSection, { variant: "consumer" })
799
807
  ]
800
808
  }
801
809
  );
802
810
  };
803
- function ConversationArchivedToggle({ ctl }) {
804
- const open = ctl.scope.archiveView === "archived";
805
- const count = ctl.scope.archivedCount;
806
- return /* @__PURE__ */ jsx(
807
- ArchivedDisclosure,
808
- {
809
- count: count ?? 0,
810
- countLabel: count === null ? null : void 0,
811
- open,
812
- onOpenChange: ctl.onArchiveViewChange,
813
- keepWhileOpen: true,
814
- className: "px-2 py-1"
815
- }
816
- );
817
- }
818
811
  const GroupingToggle = ({ value, onChange }) => /* @__PURE__ */ jsx(
819
812
  SegmentedControl,
820
813
  {
@@ -894,7 +887,6 @@ const Row = ({
894
887
  getSourceMenuCtx,
895
888
  showAgentHint = true
896
889
  }) => {
897
- const dispatch = useAppDispatch();
898
890
  const title = conv.title?.trim() || untitled(conv);
899
891
  const agentName = useAppSelector(
900
892
  (s) => conv.agentId ? selectAgentById(s, conv.agentId)?.name ?? null : null
@@ -929,45 +921,28 @@ const Row = ({
929
921
  star
930
922
  ] }) : star;
931
923
  return /* @__PURE__ */ jsx(
932
- ItemRow,
924
+ ConversationListRow,
933
925
  {
926
+ conv,
927
+ href: resolveHref(conv),
928
+ linkRow: true,
934
929
  sourceFeature: "conversation",
935
930
  entity: {
936
931
  type: "conversation",
937
932
  id: conv.conversationId,
938
933
  title
939
934
  },
940
- label: title,
941
- size: "sm",
942
935
  active,
943
- href: resolveHref(conv),
944
936
  onOpen: onOpen ? () => onOpen(conv) : void 0,
945
937
  openInPlace,
946
938
  leading: /* @__PURE__ */ jsx(StreamingDot, { conversationId: conv.conversationId }),
947
939
  secondaryLabel: meta || void 0,
948
940
  trailing,
949
- menu: () => buildConversationMenu({
950
- conversationId: conv.conversationId,
951
- title: conv.title,
952
- isFavorite,
953
- isArchived: conv.status === "archived",
954
- excludeFromKg: conv.excludeFromKg ?? false,
955
- href: resolveHref(conv),
956
- surfaceKey,
957
- agent: conv.agentId ? { id: conv.agentId, name: agentName } : void 0,
958
- source: getSourceMenuCtx?.(conv),
959
- dispatch
960
- }),
961
- rename: {
962
- value: conv.title ?? "",
963
- emptyFallback: untitled(conv),
964
- onCommit: (next) => void dispatch(
965
- renameConversation({
966
- conversationId: conv.conversationId,
967
- title: next
968
- })
969
- )
970
- },
941
+ surfaceKey,
942
+ isFavorite,
943
+ agent: conv.agentId ? { id: conv.agentId, name: agentName } : void 0,
944
+ source: getSourceMenuCtx?.(conv),
945
+ untitled: untitled(conv),
971
946
  kebabAriaLabel: `Options for ${title}`
972
947
  }
973
948
  );
@@ -1031,12 +1006,14 @@ const ConsumerRow = ({
1031
1006
  getSourceMenuCtx,
1032
1007
  onMutationSuccess
1033
1008
  }) => {
1034
- const dispatch = useAppDispatch();
1035
1009
  const title = conv.title?.trim() || untitled(conv);
1036
1010
  const isStreaming = useAppSelector(selectIsStreaming(conv.conversationId));
1037
1011
  return /* @__PURE__ */ jsx(
1038
- ItemRow,
1012
+ ConversationListRow,
1039
1013
  {
1014
+ conv,
1015
+ href: resolveHref(conv),
1016
+ linkRow: true,
1040
1017
  sourceFeature: "conversation",
1041
1018
  entity: {
1042
1019
  type: "conversation",
@@ -1044,37 +1021,13 @@ const ConsumerRow = ({
1044
1021
  title
1045
1022
  },
1046
1023
  className: "mx-1",
1047
- label: title,
1024
+ size: "md",
1048
1025
  active,
1049
- href: resolveHref(conv),
1050
1026
  onOpen: onOpen ? () => onOpen(conv) : void 0,
1051
1027
  openInPlace,
1052
- menu: () => buildConversationMenu({
1053
- conversationId: conv.conversationId,
1054
- title: conv.title,
1055
- isFavorite: conv.isFavorite ?? false,
1056
- isArchived: conv.status === "archived",
1057
- excludeFromKg: conv.excludeFromKg ?? false,
1058
- href: resolveHref(conv),
1059
- source: getSourceMenuCtx?.(conv),
1060
- onMutationSuccess,
1061
- dispatch
1062
- }),
1063
- rename: {
1064
- value: conv.title ?? "",
1065
- emptyFallback: untitled(conv),
1066
- onCommit: async (next) => {
1067
- const result = await dispatch(
1068
- renameConversation({
1069
- conversationId: conv.conversationId,
1070
- title: next
1071
- })
1072
- );
1073
- if (renameConversation.fulfilled.match(result)) {
1074
- onMutationSuccess?.();
1075
- }
1076
- }
1077
- },
1028
+ source: getSourceMenuCtx?.(conv),
1029
+ onMutationSuccess,
1030
+ untitled: untitled(conv),
1078
1031
  trailing: isStreaming ? /* @__PURE__ */ jsxs("span", { className: "relative flex h-1.5 w-1.5", "aria-hidden": true, children: [
1079
1032
  /* @__PURE__ */ jsx("span", { className: "absolute inline-flex h-full w-full animate-ping rounded-full bg-primary opacity-60" }),
1080
1033
  /* @__PURE__ */ jsx("span", { className: "relative inline-flex h-1.5 w-1.5 rounded-full bg-primary" })
@@ -61,8 +61,7 @@ function ConversationPickerWindowInner({
61
61
  activeConversationId: activeConversationId ?? null,
62
62
  onOpenConversation: handleOpenConversation,
63
63
  openInPlace: true,
64
- historyLabel: "Conversations",
65
- initialSearchOpen: true,
64
+ autoFocusSearch: true,
66
65
  className: "h-full bg-transparent"
67
66
  }
68
67
  )
@@ -36,6 +36,8 @@ function TextareaInput({
36
36
  className: isCompact ? "min-h-[60px] text-xs" : "min-h-[160px] text-sm",
37
37
  rows: isCompact ? 2 : void 0,
38
38
  appendTranscript: true,
39
+ expandable: true,
40
+ auxiliaryControlsLabel: variableName,
39
41
  onEnterKey: onEnterAdvance ? () => onEnterAdvance() : void 0,
40
42
  onRequestClose,
41
43
  protectTranscription: true,
@@ -356,12 +356,13 @@ function VariableInputComponent({
356
356
  /* @__PURE__ */ jsx(Label, { className: "text-sm font-medium", children: formattedName }),
357
357
  shownHelpText && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-0.5", children: shownHelpText })
358
358
  ] }),
359
- !hideLabel && compact && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
360
- /* @__PURE__ */ jsx(Label, { className: "text-xs font-medium pb-1", children: formattedName }),
361
- shownHelpText && /* @__PURE__ */ jsxs("span", { className: "text-[11px] text-muted-foreground", children: [
362
- "\xB7 ",
363
- shownHelpText
364
- ] })
359
+ !hideLabel && compact && // The name stands on its own line; the help sits under it on ONE
360
+ // line (the whole sentence on hover). Side by side, a long help
361
+ // wrapped and centred the name against two lines after a "·"
362
+ // (Arman, 2026-10-08).
363
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 pb-1", children: [
364
+ /* @__PURE__ */ jsx(Label, { className: "block text-xs font-medium", children: formattedName }),
365
+ shownHelpText && /* @__PURE__ */ jsx("p", { className: "truncate text-[11px] text-muted-foreground", title: shownHelpText, children: shownHelpText })
365
366
  ] }),
366
367
  inputComponent,
367
368
  randomAssignmentEnabled && /* @__PURE__ */ jsx("div", { className: "flex justify-end pt-1", children: /* @__PURE__ */ jsxs(
@@ -0,0 +1,3 @@
1
+ export declare function ConversationCompanionPills({ conversationId }: {
2
+ conversationId: string;
3
+ }): import("react").JSX.Element;
@@ -0,0 +1,40 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import {
5
+ useConversationCompanions
6
+ } from "../../../../host/composer-extensions.js";
7
+ import { RailPill } from "./rail-pill.js";
8
+ function ConversationCompanionPills({ conversationId }) {
9
+ const companions = useConversationCompanions();
10
+ return /* @__PURE__ */ jsx(Fragment, { children: companions.map((companion) => /* @__PURE__ */ jsx(CompanionPill, { companion, conversationId }, companion.id)) });
11
+ }
12
+ function CompanionPill({
13
+ companion,
14
+ conversationId
15
+ }) {
16
+ const [open, setOpen] = useState(false);
17
+ const pill = companion.usePill?.(conversationId);
18
+ const Panel = companion.Panel;
19
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
20
+ pill?.hidden ? null : /* @__PURE__ */ jsx(
21
+ RailPill,
22
+ {
23
+ item: {
24
+ id: `companion:${companion.id}`,
25
+ icon: companion.icon,
26
+ label: companion.label,
27
+ word: companion.word,
28
+ detail: pill?.detail,
29
+ hint: "Click: open or close the panel",
30
+ active: open,
31
+ onOpen: () => setOpen((o) => !o)
32
+ }
33
+ }
34
+ ),
35
+ /* @__PURE__ */ jsx(Panel, { conversationId, open, onClose: () => setOpen(false) })
36
+ ] });
37
+ }
38
+ export {
39
+ ConversationCompanionPills
40
+ };
@@ -22,11 +22,6 @@ import {
22
22
  DropdownMenuTrigger
23
23
  } from "@ai-matrx/design-system";
24
24
  import { openAfterCurrentLayerCloses } from "../../../../ui/after-current-layer-closes.js";
25
- import {
26
- Tooltip,
27
- TooltipContent,
28
- TooltipTrigger
29
- } from "@ai-matrx/design-system";
30
25
  import { useChatCanvasOpeners, useChatCanvasView } from "../../../../host/canvas.js";
31
26
  import {
32
27
  conversationDocumentsTabId,
@@ -93,6 +88,9 @@ import { ActiveContextLensChip } from "../../../../context/sources/scopes.js";
93
88
  import { selectActiveScopeIdsByType } from "../../../../context/sources/scopes.js";
94
89
  import { contextEntryLabel } from "../../context-policies-display/contextEntryLabel.js";
95
90
  import { useConversationAbilities } from "../../../redux/execution-system/host-conversations/conversation-abilities.js";
91
+ import { ComposerAttachmentSourceChips } from "../../../../host/composer-extensions.js";
92
+ import { ConversationCompanionPills } from "./ConversationCompanionPills.js";
93
+ import { RailPill } from "./rail-pill.js";
96
94
  function entryHasValue(e) {
97
95
  const v = e.value;
98
96
  if (v === void 0 || v === null) return false;
@@ -370,9 +368,11 @@ function ConversationContextRailBody({
370
368
  inline: true
371
369
  }
372
370
  ),
373
- /* @__PURE__ */ jsx(AttachedDocumentChips, { conversationId, inline: true })
371
+ /* @__PURE__ */ jsx(AttachedDocumentChips, { conversationId, inline: true }),
372
+ /* @__PURE__ */ jsx(ComposerAttachmentSourceChips, { conversationId })
374
373
  ] }) : null,
375
374
  inline.map((item) => /* @__PURE__ */ jsx(RailPill, { item }, item.id)),
375
+ /* @__PURE__ */ jsx(ConversationCompanionPills, { conversationId }),
376
376
  overflow.length > 0 && /* @__PURE__ */ jsxs(DropdownMenu, { children: [
377
377
  /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
378
378
  ComposerChip,
@@ -426,29 +426,6 @@ function ConversationContextRailBody({
426
426
  detailSurfaces
427
427
  ] });
428
428
  }
429
- function RailPill({ item }) {
430
- const Icon = item.icon;
431
- return /* @__PURE__ */ jsxs(Tooltip, { children: [
432
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx("span", { "data-rail-entry": "", className: "inline-flex shrink-0", children: /* @__PURE__ */ jsx(
433
- ComposerChip,
434
- {
435
- tone: item.tone === "primary" ? "primary" : "neutral",
436
- pressed: item.active ? true : void 0,
437
- busy: item.busy,
438
- icon: /* @__PURE__ */ jsx(Icon, {}),
439
- label: item.word,
440
- onClick: item.onOpen,
441
- "aria-label": item.label,
442
- remove: item.onRemove ? { label: `Remove ${item.label}`, onRemove: item.onRemove } : void 0
443
- }
444
- ) }) }),
445
- /* @__PURE__ */ jsxs(TooltipContent, { side: "top", className: "max-w-[16rem]", children: [
446
- /* @__PURE__ */ jsx("div", { className: "font-medium text-popover-foreground", children: item.label }),
447
- item.detail && /* @__PURE__ */ jsx("div", { className: "mt-0.5 text-muted-foreground", children: item.detail }),
448
- item.hint && /* @__PURE__ */ jsx("div", { className: "mt-0.5 text-[10px] text-muted-foreground/80", children: item.hint })
449
- ] })
450
- ] });
451
- }
452
429
  function DetailSurfaces({ conversationId }) {
453
430
  return /* @__PURE__ */ jsx(CloudBrowserHandoffCanvasOpener, { conversationId });
454
431
  }
@@ -0,0 +1,3 @@
1
+ export declare function DeviceToolsModeRow({ agentId }: {
2
+ agentId: string | null;
3
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { useSyncExternalStore } from "react";
4
+ import { useMaybeChatHost } from "../../../../host/react.js";
5
+ import {
6
+ devicePermissionModeKey,
7
+ readDevicePermissionMode,
8
+ writeDevicePermissionMode
9
+ } from "../../../redux/execution-system/utils/host-turn.js";
10
+ import { PicksSwitchRow } from "./RunPicksSurface.js";
11
+ function DeviceToolsModeRow({ agentId }) {
12
+ const host = useMaybeChatHost();
13
+ const key = devicePermissionModeKey(agentId);
14
+ const mode = useSyncExternalStore(
15
+ (listener) => host?.prefs.subscribe((changed) => {
16
+ if (changed.startsWith("chat.device-tools.permission-mode")) listener();
17
+ }) ?? (() => void 0),
18
+ () => host ? readDevicePermissionMode(agentId) : "ask",
19
+ () => "ask"
20
+ );
21
+ if (!host?.deviceTools) return null;
22
+ return /* @__PURE__ */ jsx(
23
+ PicksSwitchRow,
24
+ {
25
+ label: "Ask before acting",
26
+ detail: "This agent",
27
+ title: `Browser actions ${mode === "ask" ? "wait for your approval" : "run without asking"} (${key})`,
28
+ checked: mode === "ask",
29
+ onCheckedChange: (ask) => writeDevicePermissionMode(agentId, ask ? "ask" : "act")
30
+ }
31
+ );
32
+ }
33
+ export {
34
+ DeviceToolsModeRow
35
+ };