@ai-matrx/chat 0.6.6 → 0.7.1

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 (249) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +1 -1
  3. package/dist/agents/components/agent-widgets/AgentChatHistorySidebar.js +16 -55
  4. package/dist/agents/components/chat/chat-door.d.ts +67 -0
  5. package/dist/agents/components/chat/chat-door.js +100 -0
  6. package/dist/agents/components/conversation-history/AgentConversationList.d.ts +83 -0
  7. package/dist/agents/components/conversation-history/AgentConversationList.js +252 -0
  8. package/dist/agents/components/conversation-history/ConversationArchiveSection.d.ts +5 -1
  9. package/dist/agents/components/conversation-history/ConversationArchiveSection.js +22 -4
  10. package/dist/agents/components/conversation-history/ConversationHistorySidebar.js +20 -65
  11. package/dist/agents/components/inputs/input-components/TextareaInput.js +2 -0
  12. package/dist/agents/components/inputs/input-components/VariableInputComponent.js +7 -6
  13. package/dist/agents/components/inputs/smart-input/ConversationCompanionPills.d.ts +3 -0
  14. package/dist/agents/components/inputs/smart-input/ConversationCompanionPills.js +40 -0
  15. package/dist/agents/components/inputs/smart-input/ConversationContextRail.js +6 -29
  16. package/dist/agents/components/inputs/smart-input/DeviceToolsModeRow.d.ts +3 -0
  17. package/dist/agents/components/inputs/smart-input/DeviceToolsModeRow.js +35 -0
  18. package/dist/agents/components/inputs/smart-input/InboxQueueStrip.js +0 -8
  19. package/dist/agents/components/inputs/smart-input/RunToolPicker.js +15 -11
  20. package/dist/agents/components/inputs/smart-input/composer/ComposerPlusMenu.js +22 -0
  21. package/dist/agents/components/inputs/smart-input/rail-pill.d.ts +35 -0
  22. package/dist/agents/components/inputs/smart-input/rail-pill.js +30 -0
  23. package/dist/agents/components/inputs/variable-input-variations/AgentVariableForm.js +52 -48
  24. package/dist/agents/components/run-controls/panels/shared.d.ts +1 -1
  25. package/dist/agents/components/shared/AgentModeController.js +3 -2
  26. package/dist/agents/components/shell/AgentRunSidebarMenu.js +15 -54
  27. package/dist/agents/components/working-document/documents-workspace/DocumentsListRail.js +1 -2
  28. package/dist/agents/engine.d.ts +15 -0
  29. package/dist/agents/engine.js +17 -0
  30. package/dist/agents/hooks/useModelControls.js +3 -175
  31. package/dist/agents/redux/agent-definition/selectors.d.ts +237 -237
  32. package/dist/agents/redux/agent-shortcut-categories/selectors.d.ts +50 -50
  33. package/dist/agents/redux/agent-shortcuts/selectors.d.ts +147 -147
  34. package/dist/agents/redux/conversation-history/thunks.js +6 -18
  35. package/dist/agents/redux/conversation-list/conversation-list.selectors.d.ts +1 -73
  36. package/dist/agents/redux/conversation-list/conversation-list.selectors.js +2 -36
  37. package/dist/agents/redux/conversation-list/conversation-list.slice.d.ts +7 -22
  38. package/dist/agents/redux/conversation-list/conversation-list.slice.js +7 -62
  39. package/dist/agents/redux/conversation-list/conversation-list.thunks.d.ts +0 -25
  40. package/dist/agents/redux/conversation-list/conversation-list.thunks.js +2 -58
  41. package/dist/agents/redux/conversation-list/conversation-list.types.d.ts +0 -5
  42. package/dist/agents/redux/conversation-list/conversation-rows.d.ts +16 -0
  43. package/dist/agents/redux/conversation-list/conversation-rows.js +24 -0
  44. package/dist/agents/redux/conversation-list/conversation-trash.thunks.d.ts +1 -0
  45. package/dist/agents/redux/conversation-list/conversation-trash.thunks.js +13 -18
  46. package/dist/agents/redux/execution-system/active-requests/active-requests.selectors.d.ts +54 -54
  47. package/dist/agents/redux/execution-system/context-state/context-state.selectors.d.ts +14 -14
  48. package/dist/agents/redux/execution-system/conversations/conversations.selectors.d.ts +5 -5
  49. package/dist/agents/redux/execution-system/instance-context/instance-context.selectors.d.ts +3 -3
  50. package/dist/agents/redux/execution-system/instance-resources/instance-resources.selectors.d.ts +8 -8
  51. package/dist/agents/redux/execution-system/instance-ui-state/instance-ui-state.selectors.d.ts +5 -5
  52. package/dist/agents/redux/execution-system/instance-variable-values/instance-variable-values.selectors.d.ts +7 -7
  53. package/dist/agents/redux/execution-system/messages/messages.selectors.d.ts +1 -1
  54. package/dist/agents/redux/execution-system/observability/observability.selectors.d.ts +7 -7
  55. package/dist/agents/redux/execution-system/observational-memory/observational-memory.selectors.d.ts +1 -1
  56. package/dist/agents/redux/execution-system/selectors/aggregate.selectors.d.ts +14 -14
  57. package/dist/agents/redux/execution-system/thunks/create-instance.thunk.d.ts +10 -1
  58. package/dist/agents/redux/execution-system/thunks/create-instance.thunk.js +114 -265
  59. package/dist/agents/redux/execution-system/thunks/dispatch-matrx-extend-tool.thunk.js +18 -2
  60. package/dist/agents/redux/execution-system/thunks/dispatch-surface-client-tool.thunk.js +10 -28
  61. package/dist/agents/redux/execution-system/thunks/dispatch-surface-write.thunk.js +10 -25
  62. package/dist/agents/redux/execution-system/thunks/execute-instance.thunk.js +20 -0
  63. package/dist/agents/redux/execution-system/thunks/execute-manual-instance.thunk.js +6 -1
  64. package/dist/agents/redux/execution-system/thunks/notify-and-play-dispatcher.d.ts +58 -0
  65. package/dist/agents/redux/execution-system/thunks/notify-and-play-dispatcher.js +62 -0
  66. package/dist/agents/redux/execution-system/thunks/post-delegated-tool-outcome.d.ts +23 -0
  67. package/dist/agents/redux/execution-system/thunks/post-delegated-tool-outcome.js +37 -0
  68. package/dist/agents/redux/execution-system/thunks/resume-instance.thunk.js +10 -2
  69. package/dist/agents/redux/execution-system/utils/build-tool-injection.d.ts +7 -0
  70. package/dist/agents/redux/execution-system/utils/build-tool-injection.js +18 -6
  71. package/dist/agents/redux/execution-system/utils/host-turn.d.ts +45 -0
  72. package/dist/agents/redux/execution-system/utils/host-turn.js +119 -0
  73. package/dist/agents/redux/proposed-directives/proposedDirectivesSlice.d.ts +1 -1
  74. package/dist/agents/scribe-tools/dispatcher/dispatch-scribe-tool.thunk.d.ts +50 -20
  75. package/dist/agents/scribe-tools/dispatcher/dispatch-scribe-tool.thunk.js +9 -101
  76. package/dist/agents/types/tool-injection.types.d.ts +18 -2
  77. package/dist/agents/ui-first-tools/redux/agent-lists.selectors.d.ts +2 -2
  78. package/dist/agents/ui-first-tools/redux/pending-asks.slice.d.ts +2 -1
  79. package/dist/agents/ui-first-tools/redux/resolve-asks-with-input.thunk.js +1 -1
  80. package/dist/agents/ui-first-tools/tools/ask-response.d.ts +29 -0
  81. package/dist/agents/ui-first-tools/tools/ask-response.js +15 -0
  82. package/dist/agents/ui-first-tools/tools/schemas.d.ts +3 -25
  83. package/dist/agents/ui-first-tools/tools/schemas.js +1 -12
  84. package/dist/agents/ui-first-tools/ui/ApprovalCard.js +1 -1
  85. package/dist/agents/ui-first-tools/ui/AskWizard.d.ts +1 -1
  86. package/dist/agents/ui-first-tools/ui/AskWizard.js +1 -1
  87. package/dist/cx-chat/_legacy-stubs.d.ts +5 -5
  88. package/dist/cx-chat/components/SsrSidebarChats.js +13 -15
  89. package/dist/cx-chat/components/messages/UserMessage.d.ts +2 -2
  90. package/dist/cx-chat/types/conversation.d.ts +6 -6
  91. package/dist/cx-chat/utils/buildContentBlocksForSave.d.ts +1 -1
  92. package/dist/cx-chat/utils/cx-content-converter.d.ts +1 -1
  93. package/dist/host/bare-host-chrome.js +9 -3
  94. package/dist/host/composer-extensions.d.ts +75 -0
  95. package/dist/host/composer-extensions.js +92 -0
  96. package/dist/host/configure.js +1 -0
  97. package/dist/host/contract.d.ts +105 -13
  98. package/dist/host/defaults/confirm.d.ts +15 -0
  99. package/dist/host/defaults/confirm.js +25 -0
  100. package/dist/host/defaults/files-ui.d.ts +85 -0
  101. package/dist/host/defaults/files-ui.js +158 -0
  102. package/dist/host/defaults/gates.d.ts +27 -0
  103. package/dist/host/defaults/gates.js +72 -0
  104. package/dist/host/defaults/media-client.d.ts +15 -0
  105. package/dist/host/defaults/media-client.js +40 -0
  106. package/dist/host/defaults/voice.d.ts +81 -0
  107. package/dist/host/defaults/voice.js +239 -0
  108. package/dist/host/device-tool-handoff.d.ts +26 -0
  109. package/dist/host/device-tool-handoff.js +45 -0
  110. package/dist/host/index.d.ts +1 -0
  111. package/dist/host/index.js +4 -1
  112. package/dist/host/microphone.d.ts +11 -0
  113. package/dist/host/microphone.js +17 -0
  114. package/dist/host/ui-slots.d.ts +29 -74
  115. package/dist/host/ui-slots.js +40 -42
  116. package/dist/store/create-chat-store.d.ts +2 -2
  117. package/dist/store/middlewares.d.ts +5 -5
  118. package/dist/store/slices.d.ts +1 -1
  119. package/dist/surfaces/redux/selectors.d.ts +2 -2
  120. package/dist/tool-call-visualization/components/ToolCallVisualization.js +3 -2
  121. package/dist/tool-call-visualization/configured-rows/ConfiguredRowRenderer.d.ts +15 -0
  122. package/dist/tool-call-visualization/configured-rows/ConfiguredRowRenderer.js +36 -0
  123. package/dist/tool-call-visualization/configured-rows/ConfiguredToolRow.d.ts +40 -0
  124. package/dist/tool-call-visualization/configured-rows/ConfiguredToolRow.js +296 -0
  125. package/dist/tool-call-visualization/configured-rows/CopyToolButton.d.ts +23 -0
  126. package/dist/tool-call-visualization/configured-rows/CopyToolButton.js +62 -0
  127. package/dist/tool-call-visualization/configured-rows/ToolProgressView.d.ts +23 -0
  128. package/dist/tool-call-visualization/configured-rows/ToolProgressView.js +147 -0
  129. package/dist/tool-call-visualization/configured-rows/field-components.d.ts +15 -0
  130. package/dist/tool-call-visualization/configured-rows/field-components.js +244 -0
  131. package/dist/tool-call-visualization/configured-rows/helpers.d.ts +39 -0
  132. package/dist/tool-call-visualization/configured-rows/helpers.js +110 -0
  133. package/dist/tool-call-visualization/configured-rows/register.d.ts +25 -0
  134. package/dist/tool-call-visualization/configured-rows/register.js +51 -0
  135. package/dist/tool-call-visualization/configured-rows/registries.d.ts +27 -0
  136. package/dist/tool-call-visualization/configured-rows/registries.js +14 -0
  137. package/dist/tool-call-visualization/configured-rows/to-row-entry.d.ts +8 -0
  138. package/dist/tool-call-visualization/configured-rows/to-row-entry.js +38 -0
  139. package/dist/tool-call-visualization/configured-rows/transforms.d.ts +14 -0
  140. package/dist/tool-call-visualization/configured-rows/transforms.js +30 -0
  141. package/dist/tool-call-visualization/configured-rows/types.d.ts +140 -0
  142. package/dist/tool-call-visualization/redux/selectors.d.ts +1 -1
  143. package/dist/tool-call-visualization/registry/registry.d.ts +1 -1
  144. package/dist/tool-call-visualization/registry/registry.js +8 -1
  145. package/dist/tool-call-visualization/types.d.ts +1 -1
  146. package/dist/ui/chat-protocol-types.d.ts +0 -1
  147. package/dist/ui/ownership.d.ts +25 -0
  148. package/dist/ui/ownership.js +18 -0
  149. package/dist/voice-agent/audio/audioCapture.js +11 -6
  150. package/dist/window-panels/windows/agents/AgentRunHistoryWindow.d.ts +1 -2
  151. package/dist/window-panels/windows/agents/AgentRunHistoryWindow.js +21 -181
  152. package/dist/window-panels/windows/agents/AgentRunWindow.js +26 -13
  153. package/package.json +4627 -125
  154. package/dist/agents/components/agent-widgets/chat-assistant/AssistantMessageCard.d.ts +0 -7
  155. package/dist/agents/components/agent-widgets/chat-assistant/AssistantMessageCard.js +0 -33
  156. package/dist/agents/components/agent-widgets/chat-assistant/StatusCard.d.ts +0 -6
  157. package/dist/agents/components/agent-widgets/chat-assistant/StatusCard.js +0 -21
  158. package/dist/agents/components/agent-widgets/chat-assistant/UserMessageCard.d.ts +0 -6
  159. package/dist/agents/components/agent-widgets/chat-assistant/UserMessageCard.js +0 -11
  160. package/dist/agents/components/agent-widgets/chat-assistant/VariableInputCard.d.ts +0 -12
  161. package/dist/agents/components/agent-widgets/chat-assistant/VariableInputCard.js +0 -7
  162. package/dist/agents/components/agent-widgets/execution-gates/PreExecutionCard.d.ts +0 -4
  163. package/dist/agents/components/agent-widgets/execution-gates/PreExecutionCard.js +0 -81
  164. package/dist/agents/components/run/run-sidebar/SidebarHeader.d.ts +0 -21
  165. package/dist/agents/components/run/run-sidebar/SidebarHeader.js +0 -50
  166. package/dist/agents/components/run-controls/AdvancedRunSettings/index.d.ts +0 -6
  167. package/dist/agents/components/run-controls/AdvancedRunSettings/index.js +0 -32
  168. package/dist/agents/components/run-controls/RunSettingsModal.d.ts +0 -5
  169. package/dist/agents/components/run-controls/RunSettingsModal.js +0 -22
  170. package/dist/agents/components/shell/AgentBuildSidebarExtras.d.ts +0 -6
  171. package/dist/agents/components/shell/AgentBuildSidebarExtras.js +0 -30
  172. package/dist/agents/constants/agent-system-competitors.d.ts +0 -9
  173. package/dist/agents/constants/agent-system-competitors.js +0 -125
  174. package/dist/agents/hooks/message-crud/useMessageActions.d.ts +0 -29
  175. package/dist/agents/hooks/message-crud/useMessageActions.js +0 -119
  176. package/dist/agents/hooks/useConversationPendingCalls.d.ts +0 -30
  177. package/dist/agents/hooks/useConversationPendingCalls.js +0 -42
  178. package/dist/agents/model-registry/model-classes.d.ts +0 -1
  179. package/dist/agents/model-registry/model-classes.js +0 -1
  180. package/dist/agents/redux/conversation-history/index.d.ts +0 -18
  181. package/dist/agents/redux/conversation-history/index.js +0 -4
  182. package/dist/agents/redux/execution-system/instance-variable-values/instance-variable-values.thunks.d.ts +0 -38
  183. package/dist/agents/redux/execution-system/instance-variable-values/instance-variable-values.thunks.js +0 -42
  184. package/dist/agents/redux/execution-system/message-crud/server/compact-turns.thunk.d.ts +0 -58
  185. package/dist/agents/redux/execution-system/message-crud/server/compact-turns.thunk.js +0 -50
  186. package/dist/agents/redux/execution-system/message-crud/server/fork-and-run-server.thunk.d.ts +0 -76
  187. package/dist/agents/redux/execution-system/message-crud/server/fork-and-run-server.thunk.js +0 -101
  188. package/dist/agents/redux/execution-system/thunks/attach-workflow-run.d.ts +0 -38
  189. package/dist/agents/redux/execution-system/thunks/attach-workflow-run.js +0 -25
  190. package/dist/agents/redux/execution-system/utils/source-slice-helpers.d.ts +0 -45
  191. package/dist/agents/redux/execution-system/utils/source-slice-helpers.js +0 -50
  192. package/dist/agents/runtime/realtime/launchRealtimeSession.thunk.d.ts +0 -25
  193. package/dist/agents/runtime/realtime/launchRealtimeSession.thunk.js +0 -15
  194. package/dist/agents/services/agentService.d.ts +0 -12
  195. package/dist/agents/services/agentService.js +0 -92
  196. package/dist/agents/utils/escape-code-fences.d.ts +0 -15
  197. package/dist/agents/utils/escape-code-fences.js +0 -9
  198. package/dist/agents/utils/normalize-managed-options.d.ts +0 -30
  199. package/dist/agents/utils/normalize-managed-options.js +0 -29
  200. package/dist/agents/utils/processedDocumentContext.d.ts +0 -51
  201. package/dist/agents/utils/processedDocumentContext.js +0 -51
  202. package/dist/agents/utils/variable-validation.d.ts +0 -28
  203. package/dist/agents/utils/variable-validation.js +0 -54
  204. package/dist/cx-chat/components/ChatConversationSkeleton.d.ts +0 -9
  205. package/dist/cx-chat/components/ChatConversationSkeleton.js +0 -45
  206. package/dist/cx-chat/components/ChatPanelBackButton.d.ts +0 -1
  207. package/dist/cx-chat/components/ChatPanelBackButton.js +0 -26
  208. package/dist/cx-chat/components/messages/MessageErrorBoundary.d.ts +0 -20
  209. package/dist/cx-chat/components/messages/MessageErrorBoundary.js +0 -40
  210. package/dist/cx-chat/components/variable-inputs/CheckboxGroupInput.d.ts +0 -14
  211. package/dist/cx-chat/components/variable-inputs/CheckboxGroupInput.js +0 -160
  212. package/dist/cx-chat/components/variable-inputs/NumberInput.d.ts +0 -15
  213. package/dist/cx-chat/components/variable-inputs/NumberInput.js +0 -79
  214. package/dist/cx-chat/components/variable-inputs/RadioGroupInput.d.ts +0 -14
  215. package/dist/cx-chat/components/variable-inputs/RadioGroupInput.js +0 -125
  216. package/dist/cx-chat/components/variable-inputs/SelectInput.d.ts +0 -14
  217. package/dist/cx-chat/components/variable-inputs/SelectInput.js +0 -92
  218. package/dist/cx-chat/components/variable-inputs/TextareaInput.d.ts +0 -14
  219. package/dist/cx-chat/components/variable-inputs/TextareaInput.js +0 -46
  220. package/dist/cx-chat/components/variable-inputs/ToggleInput.d.ts +0 -14
  221. package/dist/cx-chat/components/variable-inputs/ToggleInput.js +0 -46
  222. package/dist/cx-chat/hooks/useChatPersistence.d.ts +0 -28
  223. package/dist/cx-chat/hooks/useChatPersistence.js +0 -180
  224. package/dist/cx-chat/hooks/useInstanceBootstrap.d.ts +0 -1
  225. package/dist/cx-chat/hooks/useInstanceBootstrap.js +0 -115
  226. package/dist/cx-chat/types/content.d.ts +0 -184
  227. package/dist/cx-chat/types/content.js +0 -91
  228. package/dist/cx-chat/types/cx-tables.d.ts +0 -176
  229. package/dist/cx-chat/utils/settings-diff.d.ts +0 -13
  230. package/dist/cx-chat/utils/settings-diff.js +0 -25
  231. package/dist/public-chat/components/AgentSelector.d.ts +0 -22
  232. package/dist/public-chat/components/AgentSelector.js +0 -80
  233. package/dist/public-chat/components/GuidedVariableInputs.d.ts +0 -25
  234. package/dist/public-chat/components/GuidedVariableInputs.js +0 -623
  235. package/dist/public-chat/components/PublicVariableInputs.d.ts +0 -29
  236. package/dist/public-chat/components/PublicVariableInputs.js +0 -172
  237. package/dist/public-chat/types/content.d.ts +0 -184
  238. package/dist/public-chat/types/content.js +0 -91
  239. package/dist/tool-call-visualization/renderers/_shared-entity/EntityOpenActions.d.ts +0 -15
  240. package/dist/tool-call-visualization/renderers/_shared-entity/EntityOpenActions.js +0 -31
  241. package/dist/tool-call-visualization/utils/toolCallBlockToLifecycleEntry.d.ts +0 -24
  242. package/dist/tool-call-visualization/utils/toolCallBlockToLifecycleEntry.js +0 -26
  243. package/dist/ui/AudioOutputBlockSkeleton.d.ts +0 -17
  244. package/dist/ui/AudioOutputBlockSkeleton.js +0 -78
  245. package/dist/ui/lazy/PublicChatVariableInputs.d.ts +0 -2
  246. package/dist/ui/lazy/PublicChatVariableInputs.js +0 -16
  247. package/dist/utils/xml/readXmlTag.d.ts +0 -12
  248. package/dist/utils/xml/readXmlTag.js +0 -66
  249. /package/dist/{cx-chat/types/cx-tables.js → tool-call-visualization/configured-rows/types.js} +0 -0
@@ -199,13 +199,11 @@ function InboxQueueStripBody({ conversationId }) {
199
199
  {
200
200
  type: "button",
201
201
  icon: RotateCcw,
202
- size: "xs",
203
202
  variant: "ghost",
204
203
  tooltip: "Retry \u2014 try saving this message to the queue again.",
205
204
  tooltipSide: "top",
206
205
  "aria-label": "Retry queued message",
207
206
  className: queueActionClassName,
208
- iconClassName: "h-4 w-4",
209
207
  onClick: () => {
210
208
  dispatch(
211
209
  removeInboxItem({
@@ -228,13 +226,11 @@ function InboxQueueStripBody({ conversationId }) {
228
226
  {
229
227
  type: "button",
230
228
  icon: Zap,
231
- size: "xs",
232
229
  variant: "ghost",
233
230
  tooltip: "Deliver at the next pause \u2014 the agent keeps working, but receives this sooner.",
234
231
  tooltipSide: "top",
235
232
  "aria-label": "Deliver queued message at the agent's next pause",
236
233
  className: queueActionClassName,
237
- iconClassName: "h-4 w-4",
238
234
  onClick: async () => {
239
235
  setPromotingIds(
240
236
  (ids) => new Set(ids).add(item.injectionId)
@@ -261,13 +257,11 @@ function InboxQueueStripBody({ conversationId }) {
261
257
  {
262
258
  type: "button",
263
259
  icon: Pencil,
264
- size: "xs",
265
260
  variant: "ghost",
266
261
  tooltip: "Edit \u2014 change this message before the agent receives it.",
267
262
  tooltipSide: "top",
268
263
  "aria-label": "Edit queued message",
269
264
  className: queueActionClassName,
270
- iconClassName: "h-4 w-4",
271
265
  onClick: () => setEditing({
272
266
  injectionId: item.injectionId,
273
267
  mode: item.mode,
@@ -280,13 +274,11 @@ function InboxQueueStripBody({ conversationId }) {
280
274
  {
281
275
  type: "button",
282
276
  icon: X,
283
- size: "xs",
284
277
  variant: "ghost",
285
278
  tooltip: failed ? "Dismiss \u2014 remove this failed message." : "Withdraw \u2014 remove this message before the agent receives it.",
286
279
  tooltipSide: "top",
287
280
  "aria-label": failed ? "Dismiss failed message" : "Withdraw queued message",
288
281
  className: queueActionClassName,
289
- iconClassName: "h-4 w-4",
290
282
  onClick: () => dispatch(
291
283
  retractInboxItem({
292
284
  conversationId,
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { UntrustedCount } from "../../../../host/ui-slots.js";
4
4
  import { readOf } from "../../../../host/ui-slots.js";
5
5
  import { useEffect } from "react";
@@ -14,6 +14,7 @@ import {
14
14
  PicksSkeletons,
15
15
  PicksSwitchRow
16
16
  } from "./RunPicksSurface.js";
17
+ import { DeviceToolsModeRow } from "./DeviceToolsModeRow.js";
17
18
  import { ReadFailure } from "../../../../host/ui-slots.js";
18
19
  import {
19
20
  selectAgentError,
@@ -206,16 +207,19 @@ function RunToolPicker({ conversationId }) {
206
207
  {
207
208
  noun: "tools",
208
209
  icon: Wrench,
209
- topSlot: /* @__PURE__ */ jsx(
210
- PicksSwitchRow,
211
- {
212
- label: "Auto tools",
213
- detail: autoChoice === null ? "Agent default" : "This chat",
214
- title: `Agent default: ${agentDefaultOn ? "on" : "off"}`,
215
- checked: autoOn,
216
- onCheckedChange: setAutoTools
217
- }
218
- ),
210
+ topSlot: /* @__PURE__ */ jsxs(Fragment, { children: [
211
+ /* @__PURE__ */ jsx(
212
+ PicksSwitchRow,
213
+ {
214
+ label: "Auto tools",
215
+ detail: autoChoice === null ? "Agent default" : "This chat",
216
+ title: `Agent default: ${agentDefaultOn ? "on" : "off"}`,
217
+ checked: autoOn,
218
+ onCheckedChange: setAutoTools
219
+ }
220
+ ),
221
+ /* @__PURE__ */ jsx(DeviceToolsModeRow, { agentId: agentId ?? null })
222
+ ] }),
219
223
  notice: modelSupportsTools ? null : /* @__PURE__ */ jsx(PicksNotice, { icon: AlertTriangle, children: "This model can't use tools; they're dropped" }),
220
224
  agentCount: /* @__PURE__ */ jsx(
221
225
  UntrustedCount,
@@ -12,6 +12,7 @@ import {
12
12
  Eye,
13
13
  CornerDownLeft,
14
14
  Cpu,
15
+ Crown,
15
16
  FileText,
16
17
  FolderOpen,
17
18
  Globe,
@@ -30,6 +31,9 @@ import {
30
31
  } from "lucide-react";
31
32
  import { Popover, PopoverContent, PopoverTrigger } from "@ai-matrx/design-system";
32
33
  import { useAppDispatch, useAppSelector } from "../../../../../store/hooks.js";
34
+ import { selectShowCreatorPanel, toggleShowCreatorPanel } from "../../../../../host/prefs.js";
35
+ import { selectIsSuperAdmin } from "../../../../../host/identity.js";
36
+ import { selectIsCreator } from "../../../../redux/execution-system/instance-ui-state/instance-ui-state.selectors.js";
33
37
  import { ResourcePickerMenu } from "../../../../../host/ui-slots.js";
34
38
  import { flattenResourcePickerItems } from "../../../../../host/ui-slots.js";
35
39
  import { useKnowledgeAttachSearch } from "../../../../../host/ui-slots.js";
@@ -109,6 +113,10 @@ function ComposerPlusMenu({
109
113
  onOpenChange
110
114
  }) {
111
115
  const dispatch = useAppDispatch();
116
+ const isCreator = useAppSelector(selectIsCreator(conversationId));
117
+ const isSystemAdmin = useAppSelector(selectIsSuperAdmin);
118
+ const showCreatorSwitch = isCreator || isSystemAdmin;
119
+ const showCreatorPanel = useAppSelector(selectShowCreatorPanel);
112
120
  const touchOnly = useTouchOnlyDevice();
113
121
  const [openState, setOpenState] = useState(false);
114
122
  const open = openProp ?? openState;
@@ -345,6 +353,20 @@ function ComposerPlusMenu({
345
353
  onCheckedChange: (value) => dispatch(setAutoClearMode({ conversationId, value, surfaceKey }))
346
354
  }
347
355
  ) : null,
356
+ showCreatorSwitch ? (
357
+ // The agent's creator (or a system admin): the creator panel above
358
+ // the variables. The choice is saved to the person's preferences,
359
+ // so it opens the same way on the next load (Arman, 2026-10-08).
360
+ /* @__PURE__ */ jsx(
361
+ ComposerMenuSwitchRow,
362
+ {
363
+ icon: Crown,
364
+ label: "Creator panel",
365
+ checked: showCreatorPanel,
366
+ onCheckedChange: () => dispatch(toggleShowCreatorPanel())
367
+ }
368
+ )
369
+ ) : null,
348
370
  /* @__PURE__ */ jsx(ComposerMenuDivider, {}),
349
371
  /* @__PURE__ */ jsx(
350
372
  ComposerMenuRow,
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The composer rail's pill: icon + ONE word, the full name / detail / hint in the tooltip, and an
3
+ * optional floating X. Shared by `ConversationContextRail` and the host companion-panel pills
4
+ * (`ConversationCompanionPills`) so a pill looks and behaves the same wherever it sits.
5
+ */
6
+ import type { LucideIcon } from "lucide-react";
7
+ export type RailTone = "default" | "primary";
8
+ export interface RailItem {
9
+ id: string;
10
+ icon: LucideIcon;
11
+ /** Full name — shown in the tooltip and the overflow menu, never on the pill. */
12
+ label: string;
13
+ /** ONE word for the pill face (chips stay tiny; the tooltip carries the rest). */
14
+ word: string;
15
+ /** Short trailing meta (e.g. "3/5", a count, a status word) — tooltip only. */
16
+ detail?: string;
17
+ /** One-line description of what clicking does, for the tooltip. */
18
+ hint?: string;
19
+ tone?: RailTone;
20
+ /** Tiny spinner instead of a static state (e.g. saving). */
21
+ busy?: boolean;
22
+ /** Pill's detail surface is currently open. */
23
+ active?: boolean;
24
+ onOpen: () => void;
25
+ /** Floating X — detaches the item from this conversation's context. */
26
+ onRemove?: () => void;
27
+ }
28
+ /**
29
+ * Tiny pill: icon + ONE word. Everything else (full name, status, click hint)
30
+ * lives in the tooltip; a floating X (hover/focus reveal, always visible on
31
+ * touch) detaches the item from this conversation's context.
32
+ */
33
+ export declare function RailPill({ item }: {
34
+ item: RailItem;
35
+ }): import("react").JSX.Element;
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Tooltip, TooltipContent, TooltipTrigger } from "@ai-matrx/design-system";
4
+ import { ComposerChip } from "./ComposerChip.js";
5
+ function RailPill({ item }) {
6
+ const Icon = item.icon;
7
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [
8
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx("span", { "data-rail-entry": "", className: "inline-flex shrink-0", children: /* @__PURE__ */ jsx(
9
+ ComposerChip,
10
+ {
11
+ tone: item.tone === "primary" ? "primary" : "neutral",
12
+ pressed: item.active ? true : void 0,
13
+ busy: item.busy,
14
+ icon: /* @__PURE__ */ jsx(Icon, {}),
15
+ label: item.word,
16
+ onClick: item.onOpen,
17
+ "aria-label": item.label,
18
+ remove: item.onRemove ? { label: `Remove ${item.label}`, onRemove: item.onRemove } : void 0
19
+ }
20
+ ) }) }),
21
+ /* @__PURE__ */ jsxs(TooltipContent, { side: "top", className: "max-w-[16rem]", children: [
22
+ /* @__PURE__ */ jsx("div", { className: "font-medium text-popover-foreground", children: item.label }),
23
+ item.detail && /* @__PURE__ */ jsx("div", { className: "mt-0.5 text-muted-foreground", children: item.detail }),
24
+ item.hint && /* @__PURE__ */ jsx("div", { className: "mt-0.5 text-[10px] text-muted-foreground/80", children: item.hint })
25
+ ] })
26
+ ] });
27
+ }
28
+ export {
29
+ RailPill
30
+ };
@@ -262,6 +262,40 @@ function VariableField({ conversationId, def, value, onChange }) {
262
262
  )
263
263
  ] });
264
264
  }
265
+ function OtherAnswerBox({
266
+ otherText,
267
+ onTextChange
268
+ }) {
269
+ return /* @__PURE__ */ jsx("div", { className: "mt-1 pl-6", children: /* @__PURE__ */ jsx(
270
+ VoiceTextarea,
271
+ {
272
+ value: otherText === "__other__" ? "" : otherText,
273
+ placeholder: "Enter your answer...",
274
+ onChange: (e) => onTextChange(e.target.value),
275
+ autoGrow: true,
276
+ minHeight: 28,
277
+ maxHeight: 80,
278
+ className: "text-xs bg-transparent",
279
+ style: IOS_INPUT_STYLE
280
+ }
281
+ ) });
282
+ }
283
+ function OptionsFrame({
284
+ needsScroll,
285
+ otherInput,
286
+ children
287
+ }) {
288
+ if (needsScroll) {
289
+ return /* @__PURE__ */ jsxs("div", { className: "max-h-36 overflow-y-auto", children: [
290
+ children,
291
+ otherInput
292
+ ] });
293
+ }
294
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
295
+ children,
296
+ otherInput
297
+ ] });
298
+ }
265
299
  function RadioField({
266
300
  cc,
267
301
  value,
@@ -312,32 +346,17 @@ function RadioField({
312
346
  ]
313
347
  }
314
348
  );
315
- const otherInput = isOtherSelected && /* @__PURE__ */ jsx("div", { className: "mt-1 pl-6", children: /* @__PURE__ */ jsx(
316
- VoiceTextarea,
349
+ const otherInput = isOtherSelected && /* @__PURE__ */ jsx(
350
+ OtherAnswerBox,
317
351
  {
318
- value: otherText === "__other__" ? "" : otherText,
319
- placeholder: "Enter your answer...",
320
- onChange: (e) => {
321
- setOtherText(e.target.value);
322
- onChange(e.target.value || "__other__");
323
- },
324
- autoGrow: true,
325
- minHeight: 28,
326
- maxHeight: 80,
327
- className: "text-xs bg-transparent",
328
- style: IOS_INPUT_STYLE
352
+ otherText,
353
+ onTextChange: (text) => {
354
+ setOtherText(text);
355
+ onChange(text || "__other__");
356
+ }
329
357
  }
330
- ) });
331
- if (needsScroll) {
332
- return /* @__PURE__ */ jsxs("div", { className: "max-h-36 overflow-y-auto", children: [
333
- content,
334
- otherInput
335
- ] });
336
- }
337
- return /* @__PURE__ */ jsxs(Fragment, { children: [
338
- content,
339
- otherInput
340
- ] });
358
+ );
359
+ return /* @__PURE__ */ jsx(OptionsFrame, { needsScroll, otherInput, children: content });
341
360
  }
342
361
  function CheckboxField({
343
362
  cc,
@@ -405,35 +424,20 @@ function CheckboxField({
405
424
  ]
406
425
  }
407
426
  );
408
- const otherInput = isOtherChecked && /* @__PURE__ */ jsx("div", { className: "mt-1 pl-6", children: /* @__PURE__ */ jsx(
409
- VoiceTextarea,
427
+ const otherInput = isOtherChecked && /* @__PURE__ */ jsx(
428
+ OtherAnswerBox,
410
429
  {
411
- value: otherText === "__other__" ? "" : otherText,
412
- placeholder: "Enter your answer...",
413
- onChange: (e) => {
414
- setOtherText(e.target.value);
430
+ otherText,
431
+ onTextChange: (text) => {
432
+ setOtherText(text);
415
433
  const knownSelected = selected.filter((s) => options.includes(s));
416
434
  onChange(
417
- e.target.value ? [...knownSelected, e.target.value] : knownSelected
435
+ text ? [...knownSelected, text] : knownSelected
418
436
  );
419
- },
420
- autoGrow: true,
421
- minHeight: 28,
422
- maxHeight: 80,
423
- className: "text-xs bg-transparent",
424
- style: IOS_INPUT_STYLE
437
+ }
425
438
  }
426
- ) });
427
- if (needsScroll) {
428
- return /* @__PURE__ */ jsxs("div", { className: "max-h-36 overflow-y-auto", children: [
429
- content,
430
- otherInput
431
- ] });
432
- }
433
- return /* @__PURE__ */ jsxs(Fragment, { children: [
434
- content,
435
- otherInput
436
- ] });
439
+ );
440
+ return /* @__PURE__ */ jsx(OptionsFrame, { needsScroll, otherInput, children: content });
437
441
  }
438
442
  export {
439
443
  AgentVariableForm
@@ -26,7 +26,7 @@ export declare function makeSelectConversationRequests(conversationId: string):
26
26
  voiceAgent: import("../../../../voice-agent/types.js").VoiceAgentState;
27
27
  agentDefinition: import("../../../types/agent-definition.types.js").AgentDefinitionSliceState;
28
28
  conversationList: import("../../../redux/conversation-list/conversation-list.types.js").ConversationListState;
29
- conversationHistory: import("../../../redux/conversation-history/index.js").ConversationHistoryState;
29
+ conversationHistory: import("../../../redux/conversation-history/types.js").ConversationHistoryState;
30
30
  agentShortcut: import("../../../redux/agent-shortcuts/types.js").AgentShortcutSliceState;
31
31
  agentShortcutCategory: import("../../../redux/agent-shortcut-categories/types.js").AgentShortcutCategorySliceState;
32
32
  surfaceUserState: import("../../../../surfaces/redux/userStateSlice.js").SurfaceUserStateSlice;
@@ -171,11 +171,12 @@ function AgentModeController({
171
171
  ) }, id);
172
172
  }),
173
173
  /* @__PURE__ */ jsxs(DropdownMenu, { onOpenChange: (open) => open && readFolded(), children: [
174
- /* @__PURE__ */ jsx(NavItemTooltip, { label: "More", children: /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
174
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
175
175
  "button",
176
176
  {
177
177
  type: "button",
178
178
  "aria-label": "More modes",
179
+ title: "More",
179
180
  className: cn(
180
181
  "flex items-center justify-center py-0.5 px-2.5 rounded-full transition-colors cursor-pointer",
181
182
  "[&_svg]:w-3.5 [&_svg]:h-3.5",
@@ -184,7 +185,7 @@ function AgentModeController({
184
185
  ),
185
186
  children: /* @__PURE__ */ jsx(MoreHorizontal, {})
186
187
  }
187
- ) }) }),
188
+ ) }),
188
189
  /* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", className: "min-w-40", children: MODES.filter((m) => folded.includes(m.id)).map(
189
190
  ({ id, label, icon: Icon }) => /* @__PURE__ */ jsxs(
190
191
  DropdownMenuItem,
@@ -1,6 +1,5 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { ArchivedDisclosure } from "@ai-matrx/design-system";
4
3
  import { useEffect, useMemo, useState } from "react";
5
4
  import { useRouter, usePathname, useSearchParams } from "../../../host/navigation.js";
6
5
  import { Loader2, ChevronRight, ChevronDown } from "lucide-react";
@@ -9,10 +8,9 @@ import { useAppDispatch, useAppSelector } from "../../../store/hooks.js";
9
8
  import { selectAgentById } from "../../redux/agent-definition/selectors.js";
10
9
  import { fetchAgentConversations } from "../../redux/conversation-list/conversation-list.thunks.js";
11
10
  import { makeSelectAgentConversations } from "../../redux/conversation-list/conversation-list.selectors.js";
12
- import { ItemRow } from "../../../host/ui-slots.js";
11
+ import { ConversationArchiveSection } from "../conversation-history/ConversationArchiveSection.js";
12
+ import { ConversationListRow } from "../conversation-history/AgentConversationList.js";
13
13
  import { Button } from "@ai-matrx/design-system/controls";
14
- import { buildConversationMenu } from "../conversation-actions/conversationActionRegistry.js";
15
- import { renameConversation } from "../../redux/conversation-list/conversation-row-actions.thunks.js";
16
14
  import {
17
15
  buildAgentRunUrl,
18
16
  resolveAgentRunRoute
@@ -68,7 +66,6 @@ function AgentRunSidebarMenu({
68
66
  archived,
69
67
  error: convError
70
68
  } = useAppSelector(selectConversations);
71
- const [showArchived, setShowArchived] = useState(false);
72
69
  useEffect(() => {
73
70
  if (canonicalAgentId && convStatus === "idle") {
74
71
  dispatch(
@@ -83,7 +80,6 @@ function AgentRunSidebarMenu({
83
80
  () => groupByVersion(conversations),
84
81
  [conversations]
85
82
  );
86
- const archivedGroups = useMemo(() => groupByVersion(archived), [archived]);
87
83
  const handleConversationSelect = (convId) => {
88
84
  if (!runRoute) return;
89
85
  router.push(buildAgentRunUrl(runRoute, convId));
@@ -142,28 +138,15 @@ function AgentRunSidebarMenu({
142
138
  onSelect: handleConversationSelect
143
139
  },
144
140
  version
145
- )),
146
- /* @__PURE__ */ jsx(
147
- ArchivedDisclosure,
148
- {
149
- count: archived.length,
150
- open: showArchived,
151
- onOpenChange: setShowArchived,
152
- className: "mx-1 mt-1",
153
- children: archivedGroups.map(({ version, items }) => /* @__PURE__ */ jsx(
154
- VersionGroup,
155
- {
156
- version,
157
- items,
158
- runRoute,
159
- activeConversationId: conversationIdFromUrl,
160
- onSelect: handleConversationSelect
161
- },
162
- version
163
- ))
164
- }
165
- )
166
- ] })
141
+ ))
142
+ ] }),
143
+ canonicalAgentId && /* @__PURE__ */ jsx(
144
+ ConversationArchiveSection,
145
+ {
146
+ agentIds: [canonicalAgentId],
147
+ onOpen: handleConversationSelect
148
+ }
149
+ )
167
150
  ] });
168
151
  }
169
152
  function VersionGroup({
@@ -208,39 +191,17 @@ function ConversationRow({
208
191
  isActive,
209
192
  onSelect
210
193
  }) {
211
- const dispatch = useAppDispatch();
212
- const title = conv.title?.trim() || "Untitled";
213
- const href = buildAgentRunUrl(runRoute, conv.conversationId);
214
194
  return /* @__PURE__ */ jsx(
215
- ItemRow,
195
+ ConversationListRow,
216
196
  {
197
+ conv,
198
+ href: buildAgentRunUrl(runRoute, conv.conversationId),
217
199
  sourceFeature: "agent-runner",
200
+ surfaceKey: `agent-run:${runRoute.agentId}`,
218
201
  className: "mx-1",
219
- size: "sm",
220
- label: title,
221
202
  secondaryLabel: conv.updatedAt ? formatRelativeDate(conv.updatedAt) : void 0,
222
203
  active: isActive,
223
204
  onOpen: onSelect,
224
- menu: () => buildConversationMenu({
225
- conversationId: conv.conversationId,
226
- title: conv.title,
227
- isFavorite: conv.isFavorite ?? false,
228
- isArchived: conv.status === "archived",
229
- excludeFromKg: conv.excludeFromKg ?? false,
230
- href,
231
- surfaceKey: `agent-run:${runRoute.agentId}`,
232
- dispatch
233
- }),
234
- rename: {
235
- value: conv.title ?? "",
236
- emptyFallback: "Untitled",
237
- onCommit: (next) => void dispatch(
238
- renameConversation({
239
- conversationId: conv.conversationId,
240
- title: next
241
- })
242
- )
243
- },
244
205
  trailing: isActive ? /* @__PURE__ */ jsx(ChevronRight, { className: "w-3 h-3 shrink-0" }) : void 0
245
206
  }
246
207
  );
@@ -128,8 +128,7 @@ function DocumentsListRail({
128
128
  entity: {
129
129
  type: "document",
130
130
  id: d.id,
131
- title: label,
132
- resourceType: "document"
131
+ title: label
133
132
  },
134
133
  size: "sm",
135
134
  active: isActive,
@@ -0,0 +1,15 @@
1
+ /**
2
+ * THE ENGINE DOOR — the few operations a host that drives ONE conversation by hand (outside the
3
+ * chat screens) needs: create an instance, load a saved conversation, send, cancel, write the draft,
4
+ * and ask whether a turn is running. workflow-studio's launcher-agent chat is the first caller.
5
+ *
6
+ * A stable public subpath (`@ai-matrx/chat/agents/engine`, in FRONT_DOOR): the modules behind it may
7
+ * move; a host never deep-imports them. Add to this list when a host legitimately needs another
8
+ * operation — never hand a host the redux internals.
9
+ */
10
+ export { createInstanceFull } from "./redux/execution-system/create-instance-full.js";
11
+ export { destroyInstance, patchConversation } from "./redux/execution-system/conversations/conversations.slice.js";
12
+ export { loadConversation } from "./redux/execution-system/thunks/load-conversation.thunk.js";
13
+ export { cancelExecution, smartExecute } from "./redux/execution-system/thunks/smart-execute.thunk.js";
14
+ export { setUserInputText } from "./redux/execution-system/instance-user-input/instance-user-input.slice.js";
15
+ export { selectIsExecuting, selectLatestRequestStatus } from "./redux/execution-system/selectors/aggregate.selectors.js";
@@ -0,0 +1,17 @@
1
+ import { createInstanceFull } from "./redux/execution-system/create-instance-full.js";
2
+ import { destroyInstance, patchConversation } from "./redux/execution-system/conversations/conversations.slice.js";
3
+ import { loadConversation } from "./redux/execution-system/thunks/load-conversation.thunk.js";
4
+ import { cancelExecution, smartExecute } from "./redux/execution-system/thunks/smart-execute.thunk.js";
5
+ import { setUserInputText } from "./redux/execution-system/instance-user-input/instance-user-input.slice.js";
6
+ import { selectIsExecuting, selectLatestRequestStatus } from "./redux/execution-system/selectors/aggregate.selectors.js";
7
+ export {
8
+ cancelExecution,
9
+ createInstanceFull,
10
+ destroyInstance,
11
+ loadConversation,
12
+ patchConversation,
13
+ selectIsExecuting,
14
+ selectLatestRequestStatus,
15
+ setUserInputText,
16
+ smartExecute
17
+ };