@ai-matrx/chat 0.4.0 → 0.4.7

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 (226) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/dist/agent-copy/RichCopySplit.d.ts +17 -0
  3. package/dist/agent-copy/RichCopySplit.js +34 -0
  4. package/dist/agents/addressing/useAgentHref.js +4 -1
  5. package/dist/agents/api/submit-tool-results.js +11 -1
  6. package/dist/agents/components/agent-widgets/chat-assistant/AssistantMessageCard.js +1 -1
  7. package/dist/agents/components/chat/ConversationRecordsChip.js +1 -1
  8. package/dist/agents/components/chat/useCanvasScopedToConversation.js +1 -1
  9. package/dist/agents/components/context-items/bodies/WorkingDocumentBody.d.ts +5 -2
  10. package/dist/agents/components/context-items/bodies/WorkingDocumentBody.js +6 -1
  11. package/dist/agents/components/context-policies-display/ContextValueBody.js +1 -1
  12. package/dist/agents/components/context-preview/ContextCompareView.js +1 -1
  13. package/dist/agents/components/custom-agent/CustomAgentWindow.js +1 -1
  14. package/dist/agents/components/inputs/smart-input/AgentTextarea.d.ts +6 -1
  15. package/dist/agents/components/inputs/smart-input/AgentTextarea.js +2 -2
  16. package/dist/agents/components/inputs/smart-input/ComposerToolsNotice.d.ts +1 -0
  17. package/dist/agents/components/inputs/smart-input/ComposerToolsNotice.js +5 -0
  18. package/dist/agents/components/inputs/smart-input/ConversationContextRail.d.ts +5 -1
  19. package/dist/agents/components/inputs/smart-input/ConversationContextRail.js +6 -1
  20. package/dist/agents/components/inputs/smart-input/InboxQueueStrip.d.ts +6 -1
  21. package/dist/agents/components/inputs/smart-input/InboxQueueStrip.js +6 -1
  22. package/dist/agents/components/inputs/smart-input/InputActionButtons.js +8 -6
  23. package/dist/agents/components/inputs/smart-input/SmartInputFileDropTarget.d.ts +5 -1
  24. package/dist/agents/components/inputs/smart-input/SmartInputFileDropTarget.js +8 -1
  25. package/dist/agents/components/inputs/smart-input/composer/ComposerAgentPill.js +2 -2
  26. package/dist/agents/components/inputs/smart-input/composer/ComposerChipsRow.d.ts +5 -2
  27. package/dist/agents/components/inputs/smart-input/composer/ComposerChipsRow.js +6 -1
  28. package/dist/agents/components/inputs/smart-input/composer/ComposerMetaRow.d.ts +6 -8
  29. package/dist/agents/components/inputs/smart-input/composer/ComposerMetaRow.js +13 -1
  30. package/dist/agents/components/inputs/smart-input/composer/useOutputShapeCatalog.d.ts +1 -1
  31. package/dist/agents/components/inputs/smart-input/composer/useOutputShapeCatalog.js +1 -1
  32. package/dist/agents/components/live-run/LiveRunDisplay.js +1 -1
  33. package/dist/agents/components/live-run/RunSetDisplay.js +1 -1
  34. package/dist/agents/components/memory/components/AgentMemoryAllView.js +1 -1
  35. package/dist/agents/components/messages-display/AgentConversationDisplay.js +4 -1
  36. package/dist/agents/components/messages-display/assistant/AgentAssistantMessage.d.ts +1 -0
  37. package/dist/agents/components/messages-display/assistant/AgentAssistantMessage.js +4 -3
  38. package/dist/agents/components/messages-display/assistant/AgentEmptyMessageDisplay.js +1 -1
  39. package/dist/agents/components/messages-display/assistant/AssistantMessageFooter.d.ts +2 -2
  40. package/dist/agents/components/messages-display/assistant/AssistantMessageFooter.js +4 -7
  41. package/dist/agents/components/messages-display/assistant/InPlaceAnswerEditor.js +2 -2
  42. package/dist/agents/components/messages-display/citations/MessageSourcesRow.js +1 -1
  43. package/dist/agents/components/messages-display/rich-document/chat-message-source.d.ts +2 -0
  44. package/dist/agents/components/messages-display/rich-document/chat-message-source.js +41 -0
  45. package/dist/agents/components/messages-display/rich-document/chatMessageActions.d.ts +31 -0
  46. package/dist/agents/components/messages-display/rich-document/chatMessageActions.js +39 -0
  47. package/dist/agents/components/messages-display/user/AgentUserMessage.d.ts +1 -0
  48. package/dist/agents/components/messages-display/user/AgentUserMessage.js +7 -4
  49. package/dist/agents/components/messages-display/user/CollabNoteMessage.js +1 -1
  50. package/dist/agents/components/messages-display/user/UserActionBar.js +49 -39
  51. package/dist/agents/components/run-controls/panels/shared.d.ts +1 -0
  52. package/dist/agents/components/shared/AgentConversationColumn.js +3 -2
  53. package/dist/agents/components/working-document/WorkingDocumentEditor.d.ts +1 -1
  54. package/dist/agents/components/working-document/WorkingDocumentPanel.js +2 -1
  55. package/dist/agents/components/working-document/workingDocumentSurface.d.ts +1 -1
  56. package/dist/agents/identity/model-catalog.js +5 -3
  57. package/dist/agents/identity/run-tier-store.js +3 -0
  58. package/dist/agents/redux/agent-definition/cache-bust-middleware.js +2 -0
  59. package/dist/agents/redux/agent-definition/selectors.d.ts +237 -0
  60. package/dist/agents/redux/agent-settings/agentSettingsSlice.d.ts +0 -4
  61. package/dist/agents/redux/agent-settings/agentSettingsSlice.js +12 -5
  62. package/dist/agents/redux/agent-settings/selectors.d.ts +12 -0
  63. package/dist/agents/redux/agent-shortcut-categories/selectors.d.ts +50 -0
  64. package/dist/agents/redux/agent-shortcuts/selectors.d.ts +147 -0
  65. package/dist/agents/redux/conversation-history/selectors.d.ts +16 -0
  66. package/dist/agents/redux/conversation-list/conversation-list.selectors.d.ts +2 -0
  67. package/dist/agents/redux/execution-system/active-requests/active-requests.selectors.d.ts +54 -0
  68. package/dist/agents/redux/execution-system/context-state/context-state.selectors.d.ts +14 -0
  69. package/dist/agents/redux/execution-system/conversations/conversations.selectors.d.ts +5 -0
  70. package/dist/agents/redux/execution-system/host-conversations/conversation-abilities.d.ts +12 -0
  71. package/dist/agents/redux/execution-system/host-conversations/conversation-abilities.js +25 -0
  72. package/dist/agents/redux/execution-system/host-conversations/host-conversation.thunks.d.ts +53 -0
  73. package/dist/agents/redux/execution-system/host-conversations/host-conversation.thunks.js +412 -0
  74. package/dist/agents/redux/execution-system/host-conversations/host-conversations.selectors.d.ts +28 -0
  75. package/dist/agents/redux/execution-system/host-conversations/host-conversations.selectors.js +41 -0
  76. package/dist/agents/redux/execution-system/host-conversations/host-conversations.slice.d.ts +43 -0
  77. package/dist/agents/redux/execution-system/host-conversations/host-conversations.slice.js +38 -0
  78. package/dist/agents/redux/execution-system/host-conversations/source-registry.d.ts +9 -0
  79. package/dist/agents/redux/execution-system/host-conversations/source-registry.js +15 -0
  80. package/dist/agents/redux/execution-system/host-conversations/useHostConversation.d.ts +4 -0
  81. package/dist/agents/redux/execution-system/host-conversations/useHostConversation.js +24 -0
  82. package/dist/agents/redux/execution-system/inbox/inbox-turn-end.middleware.js +2 -1
  83. package/dist/agents/redux/execution-system/instance-context/instance-context.selectors.d.ts +3 -0
  84. package/dist/agents/redux/execution-system/instance-resources/default-remark-durability.d.ts +22 -0
  85. package/dist/agents/redux/execution-system/instance-resources/default-remark-durability.js +164 -0
  86. package/dist/agents/redux/execution-system/instance-resources/instance-resources.selectors.d.ts +8 -0
  87. package/dist/agents/redux/execution-system/instance-ui-state/instance-ui-state.selectors.d.ts +5 -0
  88. package/dist/agents/redux/execution-system/instance-ui-state/run-configuration-persist.js +2 -0
  89. package/dist/agents/redux/execution-system/instance-user-input/composer-draft-store.js +20 -0
  90. package/dist/agents/redux/execution-system/instance-user-input/useComposerDraftRestore.js +2 -1
  91. package/dist/agents/redux/execution-system/instance-variable-values/instance-variable-values.selectors.d.ts +7 -0
  92. package/dist/agents/redux/execution-system/messages/messages.selectors.d.ts +1 -0
  93. package/dist/agents/redux/execution-system/messages/messages.selectors.js +1 -1
  94. package/dist/agents/redux/execution-system/observability/observability.selectors.d.ts +7 -0
  95. package/dist/agents/redux/execution-system/observational-memory/observational-memory.selectors.d.ts +1 -0
  96. package/dist/agents/redux/execution-system/selectors/aggregate.selectors.d.ts +14 -0
  97. package/dist/agents/redux/execution-system/thunks/execute-instance.thunk.js +8 -1
  98. package/dist/agents/redux/execution-system/thunks/execute-manual-instance.thunk.js +2 -1
  99. package/dist/agents/redux/execution-system/thunks/load-conversation.thunk.js +6 -0
  100. package/dist/agents/redux/execution-system/thunks/load-older-messages.thunk.js +12 -0
  101. package/dist/agents/redux/execution-system/thunks/process-stream.js +6 -4
  102. package/dist/agents/redux/execution-system/thunks/resolve-base-url.js +1 -1
  103. package/dist/agents/redux/execution-system/thunks/smart-execute.thunk.js +43 -0
  104. package/dist/agents/redux/execution-system/utils/assemble-cx-content-blocks.js +2 -1
  105. package/dist/agents/redux/execution-system/utils/continuation-body.d.ts +1 -0
  106. package/dist/agents/redux/execution-system/utils/continuation-body.js +2 -1
  107. package/dist/agents/redux/execution-system/utils/inbound-render-block.d.ts +8 -0
  108. package/dist/agents/redux/execution-system/utils/inbound-render-block.js +17 -2
  109. package/dist/agents/redux/execution-system/utils/normalize-content-blocks.js +1 -1
  110. package/dist/agents/redux/execution-system/utils/progress-data-block.d.ts +11 -0
  111. package/dist/agents/redux/execution-system/utils/progress-data-block.js +37 -0
  112. package/dist/agents/redux/execution-system/utils/stream-block-accumulator.js +10 -8
  113. package/dist/agents/redux/mcp/mcp.slice.js +15 -7
  114. package/dist/agents/redux/proposed-directives/proposedDirectivesSlice.d.ts +1 -0
  115. package/dist/agents/redux/tools/tools.selectors.d.ts +1 -0
  116. package/dist/agents/redux/tools/tools.thunks.js +3 -0
  117. package/dist/agents/resources/default-picker-items.d.ts +17 -0
  118. package/dist/agents/resources/default-picker-items.js +48 -0
  119. package/dist/agents/runtime-reconnect/ServerOperationBanner.d.ts +6 -1
  120. package/dist/agents/runtime-reconnect/ServerOperationBanner.js +6 -1
  121. package/dist/agents/types/instance.types.d.ts +2 -1
  122. package/dist/agents/ui-first-tools/redux/agent-lists.selectors.d.ts +2 -0
  123. package/dist/agents/ui-first-tools/ui/ApprovalCard.js +1 -1
  124. package/dist/agents/ui-first-tools/ui/AskCard.js +1 -1
  125. package/dist/agents/ui-first-tools/ui/lists/TaskPanel.js +1 -1
  126. package/dist/conversation/hooks/useDomCapturePrint.js +1 -1
  127. package/dist/conversation/utils/markdown-print.js +1 -1
  128. package/dist/cx-chat/components/SsrSidebarChats.js +1 -1
  129. package/dist/cx-chat/components/messages/AssistantMessage.js +3 -5
  130. package/dist/cx-chat/components/sidebar/SidebarUserFooter.js +1 -1
  131. package/dist/cx-conversation/AssistantMessage.js +3 -5
  132. package/dist/host/app-data-slots.d.ts +85 -0
  133. package/dist/host/app-data-slots.js +42 -0
  134. package/dist/host/app-identity.d.ts +20 -0
  135. package/dist/host/app-identity.js +21 -0
  136. package/dist/host/bare-host-chrome.d.ts +14 -0
  137. package/dist/host/bare-host-chrome.js +45 -0
  138. package/dist/host/configure.d.ts +9 -1
  139. package/dist/host/configure.js +44 -8
  140. package/dist/host/contract.d.ts +39 -2
  141. package/dist/host/db-types.d.ts +99 -1
  142. package/dist/host/defaults/navigation-hooks.d.ts +2 -0
  143. package/dist/host/defaults/navigation-hooks.js +7 -1
  144. package/dist/host/defaults/navigation.d.ts +4 -3
  145. package/dist/host/defaults/navigation.js +38 -7
  146. package/dist/host/defaults/org.d.ts +12 -4
  147. package/dist/host/defaults/org.js +39 -1
  148. package/dist/host/defaults/prefs.d.ts +11 -0
  149. package/dist/host/defaults/prefs.js +43 -0
  150. package/dist/host/defaults/workspace-gate.d.ts +16 -0
  151. package/dist/host/defaults/workspace-gate.js +89 -0
  152. package/dist/host/diagnostics.d.ts +7 -2
  153. package/dist/host/diagnostics.js +6 -0
  154. package/dist/host/identity.js +2 -1
  155. package/dist/host/index.d.ts +6 -3
  156. package/dist/host/index.js +23 -2
  157. package/dist/host/no-database.d.ts +38 -0
  158. package/dist/host/no-database.js +107 -0
  159. package/dist/host/react.d.ts +1 -0
  160. package/dist/host/react.js +40 -2
  161. package/dist/host/registered-source.js +2 -2
  162. package/dist/host/source.d.ts +130 -0
  163. package/dist/host/source.js +86 -0
  164. package/dist/host/ui-slots.d.ts +9 -31
  165. package/dist/host/ui-slots.js +5 -37
  166. package/dist/mandates/useMandate.js +13 -0
  167. package/dist/public-chat/components/PublicMessageOptionsMenu.js +3 -2
  168. package/dist/store/create-chat-store.d.ts +4 -2
  169. package/dist/store/middlewares.d.ts +5 -0
  170. package/dist/store/slices.d.ts +1 -0
  171. package/dist/store/slices.js +4 -1
  172. package/dist/surfaces/redux/selectors.d.ts +2 -0
  173. package/dist/surfaces/redux/surfaceConfigSlice.js +2 -0
  174. package/dist/surfaces/redux/userStateSlice.js +3 -1
  175. package/dist/surfaces/runtime/agent-offer.js +1 -1
  176. package/dist/surfaces/runtime/surface-writeback.js +1 -1
  177. package/dist/testing/turn-harness.d.ts +35 -0
  178. package/dist/testing/turn-harness.js +85 -0
  179. package/dist/tool-call-visualization/db-renderer/fetchToolRendererRow.js +2 -0
  180. package/dist/tool-call-visualization/redux/selectors.d.ts +1 -0
  181. package/dist/tool-call-visualization/renderers/agent-call/AgentCallInline.js +1 -1
  182. package/dist/tool-call-visualization/renderers/agent-call/CollabCallCard.js +1 -1
  183. package/dist/tool-call-visualization/renderers/fs/FsInline.js +1 -1
  184. package/dist/tool-call-visualization/renderers/random-wheel/RandomWheelInline.js +1 -1
  185. package/dist/tool-call-visualization/renderers/research/ResearchOverlay.js +4 -4
  186. package/dist/tool-call-visualization/renderers/research/SubagentReportBlock.js +2 -2
  187. package/dist/tool-call-visualization/renderers/scrape/ScrapeOverlay.js +1 -1
  188. package/dist/tool-call-visualization/renderers/search/SearchInline.js +1 -1
  189. package/dist/tool-call-visualization/renderers/search/SearchOverlay.js +1 -1
  190. package/dist/tool-call-visualization/renderers/sql/SqlInline.js +1 -1
  191. package/dist/tool-call-visualization/result-fields/KeyValueGrid.js +1 -1
  192. package/dist/tool-call-visualization/result-fields/ResultMarkdown.js +1 -1
  193. package/dist/tool-call-visualization/result-fields/ResultValue.js +1 -1
  194. package/dist/tool-call-visualization/surface-write/SurfaceWriteDiff.js +1 -1
  195. package/dist/ui/AudioOutputBlockSkeleton.d.ts +17 -0
  196. package/dist/ui/AudioOutputBlockSkeleton.js +78 -0
  197. package/dist/ui/chat-protocol-from-stream.d.ts +60 -0
  198. package/dist/ui/chat-protocol-from-stream.js +135 -0
  199. package/dist/ui/markdown-stream/EnhancedChatMarkdown.d.ts +59 -0
  200. package/dist/ui/markdown-stream/EnhancedChatMarkdown.js +1108 -0
  201. package/dist/ui/markdown-stream/MarkdownStream.d.ts +88 -0
  202. package/dist/ui/markdown-stream/MarkdownStream.js +14 -0
  203. package/dist/ui/markdown-stream/MarkdownStreamImpl.d.ts +4 -0
  204. package/dist/ui/markdown-stream/MarkdownStreamImpl.js +86 -0
  205. package/dist/ui/markdown-stream/StreamAwareChatMarkdown.d.ts +58 -0
  206. package/dist/ui/markdown-stream/StreamAwareChatMarkdown.js +294 -0
  207. package/dist/ui/markdown-stream/internal-handlers/AgentCallChildTrace.d.ts +22 -0
  208. package/dist/ui/markdown-stream/internal-handlers/AgentCallChildTrace.js +128 -0
  209. package/dist/ui/markdown-stream/internal-handlers/InlineAssistantError.d.ts +3 -0
  210. package/dist/ui/markdown-stream/internal-handlers/InlineAssistantError.js +26 -0
  211. package/dist/ui/markdown-stream/internal-handlers/InlineThinkingSlot.d.ts +14 -0
  212. package/dist/ui/markdown-stream/internal-handlers/InlineThinkingSlot.js +23 -0
  213. package/dist/ui/markdown-stream/internal-handlers/ToolHandlers.d.ts +42 -0
  214. package/dist/ui/markdown-stream/internal-handlers/ToolHandlers.js +109 -0
  215. package/dist/ui/markdown-stream/useBoundAgentOutputSchema.d.ts +2 -0
  216. package/dist/ui/markdown-stream/useBoundAgentOutputSchema.js +33 -0
  217. package/dist/window-panels/windows/agents/AgentAssistantMarkdownDebugWindow.js +1 -1
  218. package/package.json +10 -5
  219. package/dist/host/content-ir-slots.d.ts +0 -231
  220. package/dist/host/content-ir-slots.js +0 -131
  221. package/dist/host/markdown-slots.d.ts +0 -53
  222. package/dist/host/markdown-slots.js +0 -32
  223. package/dist/host/rich-document-slots.d.ts +0 -123
  224. package/dist/host/rich-document-slots.js +0 -36
  225. package/dist/utils/content-ir/report-kind-at-raw-renderer.d.ts +0 -19
  226. package/dist/utils/content-ir/report-kind-at-raw-renderer.js +0 -32
@@ -85,6 +85,7 @@ export declare const selectOwnVariableValues: (conversationId: string) => ((stat
85
85
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
86
86
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
87
87
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
88
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
88
89
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => Record<string, unknown>) & {
89
90
  clearCache: () => void;
90
91
  resultsCount: () => number;
@@ -150,6 +151,7 @@ export declare const selectOwnSubmittedFirstTurnValues: (conversationId: string)
150
151
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
151
152
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
152
153
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
154
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
153
155
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => Record<string, unknown>) & {
154
156
  clearCache: () => void;
155
157
  resultsCount: () => number;
@@ -222,6 +224,7 @@ export declare const selectHostSubmittedFirstTurnValues: (conversationId: string
222
224
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
223
225
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
224
226
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
227
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
225
228
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => Record<string, unknown>) & {
226
229
  clearCache: () => void;
227
230
  resultsCount: () => number;
@@ -298,6 +301,7 @@ export declare const selectResolvedVariables: (conversationId: string) => ((stat
298
301
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
299
302
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
300
303
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
304
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
301
305
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => Record<string, unknown>) & {
302
306
  clearCache: () => void;
303
307
  resultsCount: () => number;
@@ -374,6 +378,7 @@ export declare const selectVariablesForRequest: (conversationId: string) => ((st
374
378
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
375
379
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
376
380
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
381
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
377
382
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => Record<string, unknown>) & {
378
383
  clearCache: () => void;
379
384
  resultsCount: () => number;
@@ -442,6 +447,7 @@ export declare const selectMissingRequiredVariables: (conversationId: string) =>
442
447
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
443
448
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
444
449
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
450
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
445
451
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => string[]) & {
446
452
  clearCache: () => void;
447
453
  resultsCount: () => number;
@@ -510,6 +516,7 @@ export declare const selectVariableProvenance: (conversationId: string) => ((sta
510
516
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
511
517
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
512
518
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
519
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
513
520
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => Record<string, "default" | "none" | "scope" | "user">) & {
514
521
  clearCache: () => void;
515
522
  resultsCount: () => number;
@@ -271,6 +271,7 @@ export declare const selectMessageInterleavedContent: (conversationId: string, m
271
271
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
272
272
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
273
273
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
274
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
274
275
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => ContentSegment[]) & {
275
276
  clearCache: () => void;
276
277
  resultsCount: () => number;
@@ -12,7 +12,7 @@ import {
12
12
  fromCxAudioPart,
13
13
  fromCxVideoPart
14
14
  } from "@ai-matrx/media/files";
15
- import { seedPersistedEnvelopeCache } from "../../../../host/content-ir-slots.js";
15
+ import { seedPersistedEnvelopeCache } from "@ai-matrx/rich-content/kinds/registry/region-envelope-memo";
16
16
  import {
17
17
  readEnvelope,
18
18
  reconstructRegionValue
@@ -46,6 +46,7 @@ export declare const selectUserRequestsForConversation: (conversationId: string)
46
46
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
47
47
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
48
48
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
49
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
49
50
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => CxUserRequestRecord[]) & {
50
51
  clearCache: () => void;
51
52
  resultsCount: () => number;
@@ -111,6 +112,7 @@ export declare const selectRequestsForUserRequest: (userRequestId: string) => ((
111
112
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
112
113
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
113
114
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
115
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
114
116
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => CxRequestRecord[]) & {
115
117
  clearCache: () => void;
116
118
  resultsCount: () => number;
@@ -175,6 +177,7 @@ export declare const selectToolCallsForUserRequest: (userRequestId: string) => (
175
177
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
176
178
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
177
179
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
180
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
178
181
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => CxToolCallRecord[]) & {
179
182
  clearCache: () => void;
180
183
  resultsCount: () => number;
@@ -251,6 +254,7 @@ export declare const selectToolCallsForMessage: (messageId: string) => ((state:
251
254
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
252
255
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
253
256
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
257
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
254
258
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => CxToolCallRecord[]) & {
255
259
  clearCache: () => void;
256
260
  resultsCount: () => number;
@@ -324,6 +328,7 @@ export declare const selectToolCallsForConversation: (conversationId: string) =>
324
328
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
325
329
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
326
330
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
331
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
327
332
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => CxToolCallRecord[]) & {
328
333
  clearCache: () => void;
329
334
  resultsCount: () => number;
@@ -397,6 +402,7 @@ export declare const selectCorrectedToolCallIds: (conversationId: string) => ((s
397
402
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
398
403
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
399
404
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
405
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
400
406
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => ReadonlySet<string>) & {
401
407
  clearCache: () => void;
402
408
  resultsCount: () => number;
@@ -452,6 +458,7 @@ export declare const selectCorrectedToolCallIds: (conversationId: string) => ((s
452
458
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
453
459
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
454
460
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
461
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
455
462
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => CxToolCallRecord[]) & {
456
463
  clearCache: () => void;
457
464
  resultsCount: () => number;
@@ -66,6 +66,7 @@ export declare const selectRecentMemoryEvents: (conversationId: string | null |
66
66
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
67
67
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
68
68
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
69
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
69
70
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => MemoryEventEntry[]) & {
70
71
  clearCache: () => void;
71
72
  resultsCount: () => number;
@@ -113,6 +113,7 @@ export declare const selectLatestAnswerText: (conversationId: string) => ((state
113
113
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
114
114
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
115
115
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
116
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
116
117
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => string) & {
117
118
  clearCache: () => void;
118
119
  resultsCount: () => number;
@@ -185,6 +186,7 @@ export declare const selectLatestAccumulatedText: (conversationId: string) => ((
185
186
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
186
187
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
187
188
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
189
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
188
190
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => string) & {
189
191
  clearCache: () => void;
190
192
  resultsCount: () => number;
@@ -314,6 +316,7 @@ export declare const selectPendingToolCallsForInstance: (conversationId: string)
314
316
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
315
317
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
316
318
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
319
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
317
320
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => PendingToolCall[] | undefined) & {
318
321
  clearCache: () => void;
319
322
  resultsCount: () => number;
@@ -408,6 +411,7 @@ export declare function makeSelectAssembledRequest(conversationId: string): ((st
408
411
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
409
412
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
410
413
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
414
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
411
415
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => AssembledAgentStartRequest | null) & {
412
416
  clearCache: () => void;
413
417
  resultsCount: () => number;
@@ -530,6 +534,7 @@ export declare const selectInstanceSummary: (conversationId: string) => ((state:
530
534
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
531
535
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
532
536
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
537
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
533
538
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => {
534
539
  conversationId: string;
535
540
  agentId: string;
@@ -694,6 +699,7 @@ export declare const makeSelectInstanceDisplaySnapshot: () => ((state: {
694
699
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
695
700
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
696
701
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
702
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
697
703
  } & import("../../../../store/root-state.js").ChatHostReadSlices, conversationId: string) => {
698
704
  readonly displayMode: import("../../agent-shortcuts/types.js").ResultDisplayMode;
699
705
  readonly isExpanded: boolean;
@@ -791,6 +797,7 @@ export declare const selectActiveInstancesByDisplayMode: ((state: {
791
797
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
792
798
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
793
799
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
800
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
794
801
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => Record<string, string[]> | undefined) & {
795
802
  clearCache: () => void;
796
803
  resultsCount: () => number;
@@ -859,6 +866,7 @@ export declare const selectOverlayInstancesByDisplayMode: ((state: {
859
866
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
860
867
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
861
868
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
869
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
862
870
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => Record<string, string[]> | undefined) & {
863
871
  clearCache: () => void;
864
872
  resultsCount: () => number;
@@ -926,6 +934,7 @@ export declare const selectActiveModalInstanceIds: ((state: {
926
934
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
927
935
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
928
936
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
937
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
929
938
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => string[] | undefined) & {
930
939
  clearCache: () => void;
931
940
  resultsCount: () => number;
@@ -993,6 +1002,7 @@ export declare const selectActivePanelInstanceIds: ((state: {
993
1002
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
994
1003
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
995
1004
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
1005
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
996
1006
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => string[] | undefined) & {
997
1007
  clearCache: () => void;
998
1008
  resultsCount: () => number;
@@ -1071,6 +1081,7 @@ export declare const selectLatestRenderBlocks: (conversationId: string) => ((sta
1071
1081
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
1072
1082
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
1073
1083
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
1084
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
1074
1085
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => RenderBlockPayload[] | undefined) & {
1075
1086
  clearCache: () => void;
1076
1087
  resultsCount: () => number;
@@ -1143,6 +1154,7 @@ export declare const selectLatestActiveTools: (conversationId: string) => ((stat
1143
1154
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
1144
1155
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
1145
1156
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
1157
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
1146
1158
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => ToolLifecycleEntry[] | undefined) & {
1147
1159
  clearCache: () => void;
1148
1160
  resultsCount: () => number;
@@ -1211,6 +1223,7 @@ export declare const selectLatestToolLifecycles: (conversationId: string) => ((s
1211
1223
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
1212
1224
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
1213
1225
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
1226
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
1214
1227
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => ToolLifecycleEntry[] | undefined) & {
1215
1228
  clearCache: () => void;
1216
1229
  resultsCount: () => number;
@@ -1324,6 +1337,7 @@ export declare const makeSelectAvailableShortcuts: (context: ShortcutContext) =>
1324
1337
  agentSettings: import("../../agent-settings/types.js").AgentSettingsState;
1325
1338
  conversationAttachments: import("../../../connectors/attachments.slice.js").AttachmentsSliceState;
1326
1339
  chatHost: import("../../../../store/chat-host.slice.js").ChatHostState;
1340
+ hostConversations: import("../host-conversations/host-conversations.slice.js").HostConversationsState;
1327
1341
  } & import("../../../../store/root-state.js").ChatHostReadSlices) => import("../../agent-shortcuts/types.js").AgentShortcutRecord[]) & {
1328
1342
  clearCache: () => void;
1329
1343
  resultsCount: () => number;
@@ -1,6 +1,8 @@
1
1
  import {
2
2
  executionRejectionMeta
3
3
  } from "./execution-rejection-meta.js";
4
+ import { isHostConversation } from "../host-conversations/host-conversations.selectors.js";
5
+ import { attributionForSend } from "../../../../host/app-identity.js";
4
6
  import { mintClientTempId } from "@ai-matrx/kit/ids";
5
7
  import { createAsyncThunk } from "@reduxjs/toolkit";
6
8
  import { toast } from "../../../../host/notify.js";
@@ -188,7 +190,7 @@ function assembleRequest(state, conversationId, opts) {
188
190
  (id) => !!id
189
191
  );
190
192
  const active_scope_type_ids = selectActiveScopeTypeIds(state) ?? [];
191
- const { sourceApp, sourceFeature } = instance;
193
+ const { sourceApp, sourceFeature } = attributionForSend(instance);
192
194
  const block_mode = selectIsBlockMode(state);
193
195
  const snapshot = selectIsSnapshot(state);
194
196
  const memoryToggle = selectMemoryToggleRequest(conversationId)(state);
@@ -261,6 +263,11 @@ const executeInstance = createAsyncThunk(
261
263
  if (!instance) {
262
264
  throw new Error(`Conversation ${conversationId} not found`);
263
265
  }
266
+ if (isHostConversation(state, conversationId)) {
267
+ throw new Error(
268
+ `Conversation ${conversationId} is carried by its host; it sends through the host's source.`
269
+ );
270
+ }
264
271
  const claimHeldElsewhere = isExecutionClaimed(conversationId);
265
272
  if (claimHeldElsewhere || hasAbortController(conversationId) || instance.status === "running" || instance.status === "streaming") {
266
273
  if (submission) {
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  executionRejectionMeta
3
3
  } from "./execution-rejection-meta.js";
4
+ import { attributionForSend } from "../../../../host/app-identity.js";
4
5
  import { selectAgentById } from "../../agent-definition/selectors.js";
5
6
  import { mintClientTempId } from "@ai-matrx/kit/ids";
6
7
  import { createAsyncThunk } from "@reduxjs/toolkit";
@@ -263,7 +264,7 @@ async function assembleManualRequest(state, conversationId, opts) {
263
264
  mcp: mcpServers
264
265
  };
265
266
  }
266
- const { sourceApp, sourceFeature } = instance;
267
+ const { sourceApp, sourceFeature } = attributionForSend(instance);
267
268
  const isEphemeral = instance.isEphemeral === true;
268
269
  const organization_id = requireExecutionOrganizationId(state, conversationId);
269
270
  const request = {
@@ -1,3 +1,5 @@
1
+ import { selectHostConversation } from "../host-conversations/host-conversations.selectors.js";
2
+ import { loadHostHistory } from "../host-conversations/host-conversation.thunks.js";
1
3
  import { selectAgentById } from "../../agent-definition/selectors.js";
2
4
  import { createAsyncThunk } from "@reduxjs/toolkit";
3
5
  import { supabase } from "../../../../host/db.js";
@@ -84,6 +86,10 @@ const loadConversation = createAsyncThunk(
84
86
  displayOverrides,
85
87
  agentBehindApp = false
86
88
  }, { dispatch, getState }) => {
89
+ if (selectHostConversation(conversationId)(getState())) {
90
+ await loadHostHistory(dispatch, getState, conversationId);
91
+ return { conversationId };
92
+ }
87
93
  let authedUserId = null;
88
94
  try {
89
95
  const { data: authData } = await getClaimsUser(supabase);
@@ -1,3 +1,5 @@
1
+ import { selectHostConversation } from "../host-conversations/host-conversations.selectors.js";
2
+ import { loadHostHistory } from "../host-conversations/host-conversation.thunks.js";
1
3
  import { createAsyncThunk } from "@reduxjs/toolkit";
2
4
  import { prependMessages, setOlderLoading } from "../messages/messages.slice.js";
3
5
  import { mergeToolCalls } from "../observability/observability.slice.js";
@@ -10,6 +12,16 @@ import {
10
12
  const loadOlderMessages = createAsyncThunk(
11
13
  "conversations/loadOlder",
12
14
  async ({ conversationId, pageSize = 50 }, { dispatch, getState, rejectWithValue }) => {
15
+ if (selectHostConversation(conversationId)(getState())) {
16
+ const before = getState().messages.byConversationId[conversationId]?.orderedIds.length ?? 0;
17
+ await loadHostHistory(dispatch, getState, conversationId, { older: true });
18
+ const after = getState().messages.byConversationId[conversationId];
19
+ return {
20
+ conversationId,
21
+ prependedCount: Math.max(0, (after?.orderedIds.length ?? 0) - before),
22
+ hasMoreOlder: after?.hasMoreOlder ?? false
23
+ };
24
+ }
13
25
  const entry = getState().messages.byConversationId[conversationId];
14
26
  if (!entry) {
15
27
  return rejectWithValue({ reason: "no-entry" });
@@ -1,3 +1,4 @@
1
+ import { selectHostConversation } from "../host-conversations/host-conversations.selectors.js";
1
2
  import {
2
3
  applyServerUsageState,
3
4
  applyUsageRefusal,
@@ -189,7 +190,7 @@ import {
189
190
  import { StreamProfiler } from "../../../../ui/stream-profiler.js";
190
191
  import { makePartialKindStalenessGate } from "@ai-matrx/content-ir/wire";
191
192
  import { prepareInboundRenderBlock } from "../utils/inbound-render-block.js";
192
- import { progressDataRenderBlock } from "../../../../host/content-ir-slots.js";
193
+ import { progressDataRenderBlock } from "../utils/progress-data-block.js";
193
194
  import { DECISION_ANSWERS_BLOCK_TYPE } from "../../../../utils/content-ir/decision-answers-ids.js";
194
195
  import { recordContextReceipt } from "../context-rules/receipt-check.js";
195
196
  import { assembleMessageParts } from "../utils/assemble-cx-content-blocks.js";
@@ -2340,8 +2341,9 @@ async function processStream({
2340
2341
  }
2341
2342
  } else if (assistantBlocks.length > 0) {
2342
2343
  const conv = finalState.conversations.byConversationId[conversationId];
2343
- (conv?.isEphemeral === true ? console.info : console.error)(
2344
- `[stream:${requestId.slice(0, 8)}] no assistant reservation arrived but ${assistantBlocks.length} content block(s) were produced \u2014 committing to a client-temp message to avoid transcript loss. DIAGNOSIS isEphemeral=${conv?.isEphemeral ?? false} apiEndpointMode=${conv?.apiEndpointMode ?? "agent"} userRequestReserved=${reservedUserRequestId !== null} toolReservations=${toolCallIdByProviderCallId.size} streamError=${!!finalErrorMessage}. ` + (conv?.isEphemeral === true ? `Expected for an ephemeral (incognito) turn: the server reserves no message rows for store:false.` : `isEphemeral=false: the server should have reserved a cx_message(role=assistant) \u2014 a backend reservation gap (userRequestReserved alone proves nothing; the preamble announces it even for store:false).`)
2344
+ const clientMintsIds = conv?.isEphemeral === true || selectHostConversation(conversationId)(finalState) !== null;
2345
+ (clientMintsIds ? console.info : console.error)(
2346
+ `[stream:${requestId.slice(0, 8)}] no assistant reservation arrived but ${assistantBlocks.length} content block(s) were produced \u2014 committing to a client-temp message to avoid transcript loss. DIAGNOSIS isEphemeral=${conv?.isEphemeral ?? false} apiEndpointMode=${conv?.apiEndpointMode ?? "agent"} userRequestReserved=${reservedUserRequestId !== null} toolReservations=${toolCallIdByProviderCallId.size} streamError=${!!finalErrorMessage}. ` + (clientMintsIds ? `Expected: the client mints this conversation's message ids (incognito, or a host-owned source), so no reservation arrives.` : `isEphemeral=false: the server should have reserved a cx_message(role=assistant) \u2014 a backend reservation gap (userRequestReserved alone proves nothing; the preamble announces it even for store:false).`)
2345
2347
  );
2346
2348
  const tempId = mintClientTempId("assistant", requestId);
2347
2349
  const existingById = finalState.messages.byConversationId[conversationId]?.byId ?? {};
@@ -2464,7 +2466,7 @@ async function processStream({
2464
2466
  if (!textProtected && !hasUnsentResources) {
2465
2467
  dispatch(resetUserVariableValues(conversationId));
2466
2468
  }
2467
- if (finalErrorMessage === null && materializeTargets.length > 0) {
2469
+ if (finalErrorMessage === null && materializeTargets.length > 0 && selectHostConversation(conversationId)(getState()) === null) {
2468
2470
  void Promise.all(
2469
2471
  materializeTargets.map(
2470
2472
  (target) => materializeMessageArtifacts({
@@ -14,7 +14,7 @@ import {
14
14
  supportsLocalAgentExecution
15
15
  } from "../../../../host/server/local-engine.js";
16
16
  import { selectOrganizationId } from "../../../../host/org.js";
17
- const EC2_SANDBOX_SERVER_URL = process.env.NEXT_PUBLIC_EC2_SANDBOX_SERVER_URL || "";
17
+ const EC2_SANDBOX_SERVER_URL = typeof process !== "undefined" && process.env.NEXT_PUBLIC_EC2_SANDBOX_SERVER_URL || "";
18
18
  function dedicatedEc2ServerForConversation(state, conversationId) {
19
19
  if (selectActiveServer(state) !== "production") return null;
20
20
  const ref = resolveAgentSandboxRef(state, conversationId);
@@ -38,6 +38,9 @@ import {
38
38
  } from "./settle-after-stop.thunk.js";
39
39
  import { cancelAgentRunRequest } from "../../../../host/server/matrx-transport.js";
40
40
  import { toast } from "../../../../host/notify.js";
41
+ import { selectHostConversation } from "../host-conversations/host-conversations.selectors.js";
42
+ import { sendToHost, stopHostTurn } from "../host-conversations/host-conversation.thunks.js";
43
+ import { isHostSendRefused } from "../../../../host/source.js";
41
44
  import { refreshSurfaceScope } from "./refresh-surface-scope.thunk.js";
42
45
  import {
43
46
  ensureExecutionOrganization,
@@ -173,6 +176,36 @@ const smartExecute = createAsyncThunk(
173
176
  }
174
177
  }
175
178
  let submission = handed ?? captureSubmission(entryState, conversationId);
179
+ const hosted = selectHostConversation(conversationId)(entryState);
180
+ if (hosted) {
181
+ if (isEmptySubmission(submission)) return;
182
+ if (!hosted.canSend) {
183
+ toast.info("This chat is read-only here");
184
+ return;
185
+ }
186
+ if (hosted.held) {
187
+ toast.info("Not sent yet", { description: hosted.held });
188
+ return;
189
+ }
190
+ const busy = selectIsExecuting(conversationId)(entryState);
191
+ if (busy && hosted.whileBusy === "refuse") {
192
+ toast.info("Wait for the answer to finish", {
193
+ description: "This chat takes the next message once the current one ends."
194
+ });
195
+ return;
196
+ }
197
+ const mode = busy ? hosted.whileBusy === "steer" ? "steer" : "queue" : "send";
198
+ if (!handed) detachFromComposer(dispatch, getState, conversationId, submission);
199
+ try {
200
+ await sendToHost(dispatch, getState, conversationId, submission.text, mode);
201
+ } catch (error) {
202
+ returnToComposer(dispatch, getState, conversationId, submission);
203
+ toast.error("Message not sent", {
204
+ description: isHostSendRefused(error) ? error.message : error instanceof Error ? error.message : String(error)
205
+ });
206
+ }
207
+ return;
208
+ }
176
209
  if (isSendInFlight(conversationId)) {
177
210
  if (!handed) {
178
211
  if (isEmptySubmission(submission)) return;
@@ -418,6 +451,11 @@ const cancelExecution = createAsyncThunk(
418
451
  "instances/cancelExecution",
419
452
  async (conversationId, { getState, dispatch }) => {
420
453
  const state = getState();
454
+ if (selectHostConversation(conversationId)(state)) {
455
+ await stopHostTurn(conversationId);
456
+ dispatch(resetSubmissionPhase(conversationId));
457
+ return;
458
+ }
421
459
  const serverRequestId = latestServerRequestId(state, conversationId);
422
460
  abortConversation(conversationId);
423
461
  if (serverRequestId) {
@@ -465,6 +503,11 @@ const interruptAndSend = createAsyncThunk(
465
503
  "instances/interruptAndSend",
466
504
  async ({ conversationId, surfaceKey }, { getState, dispatch }) => {
467
505
  const initial = getState();
506
+ if (selectHostConversation(conversationId)(initial)) {
507
+ await stopHostTurn(conversationId);
508
+ await dispatch(smartExecute({ conversationId, surfaceKey }));
509
+ return;
510
+ }
468
511
  if (!selectIsExecuting(conversationId)(initial)) {
469
512
  await dispatch(smartExecute({ conversationId, surfaceKey }));
470
513
  return;
@@ -1,7 +1,8 @@
1
1
  import { computeChildOwnedRanges } from "./child-owned-ranges.js";
2
2
  import { toCxMediaPart } from "@ai-matrx/media/files";
3
3
  import { isUnifiedImageBlock } from "@ai-matrx/media/files";
4
- import { isSpecialCodeLanguage } from "../../../../host/content-ir-slots.js";
4
+ import { SPECIAL_CODE_LANGUAGES } from "@ai-matrx/rich-content/display/markdown-classification/processors/utils/content-splitter-core";
5
+ const isSpecialCodeLanguage = (language) => SPECIAL_CODE_LANGUAGES.includes(language);
5
6
  import { IR_ENVELOPE_KEY } from "@ai-matrx/content-ir";
6
7
  import { envelopeCacheFromEnvelopes } from "@ai-matrx/content-ir";
7
8
  import { readEnvelope } from "@ai-matrx/content-ir";
@@ -56,6 +56,7 @@ export declare const CONTINUATION_FIELD_ROUTING: {
56
56
  readonly max_iterations: "not assembled by this thunk";
57
57
  readonly max_retries_per_iteration: "not assembled by this thunk";
58
58
  readonly responder_agent_id: "coding-mirror replies only; not assembled by this thunk";
59
+ readonly host_turn: "host-owned turns only; not assembled by this thunk";
59
60
  };
60
61
  export interface ContinuationBodyOptions {
61
62
  retry: boolean;
@@ -49,7 +49,8 @@ const CONTINUATION_FIELD_ROUTING = {
49
49
  allow_context_create: "not assembled by this thunk",
50
50
  max_iterations: "not assembled by this thunk",
51
51
  max_retries_per_iteration: "not assembled by this thunk",
52
- responder_agent_id: "coding-mirror replies only; not assembled by this thunk"
52
+ responder_agent_id: "coding-mirror replies only; not assembled by this thunk",
53
+ host_turn: "host-owned turns only; not assembled by this thunk"
53
54
  };
54
55
  const EMPTY_IS_MEANINGFUL = /* @__PURE__ */ new Set(["tools", "output_kinds"]);
55
56
  const FALSE_IS_MEANINGFUL = /* @__PURE__ */ new Set(["memory", "tools_replace", "context_withheld"]);
@@ -40,3 +40,11 @@ export declare function prepareInboundRenderBlock(data: RenderBlockPayload, gate
40
40
  block: RenderBlockPayload;
41
41
  sanitized: RenderBlockPayload;
42
42
  };
43
+ /**
44
+ * Ingest guard for SERVER-BUILT envelopes riding `metadata.__ir` on a `render_block` event:
45
+ * valid -> same reference back + seeded into rich-content's region-envelope memo; malformed ->
46
+ * stripped copy + a loud diagnostic. Semantics live on the pure function in `@ai-matrx/content-ir`.
47
+ */
48
+ export declare function sanitizeInboundEnvelopeMetadata(metadata: Record<string, unknown> | null | undefined, context: {
49
+ blockId: string;
50
+ }): Record<string, unknown> | undefined;
@@ -1,5 +1,6 @@
1
1
  import { captureError } from "../../../../host/diagnostics.js";
2
- import { sanitizeInboundEnvelopeMetadata } from "../../../../host/content-ir-slots.js";
2
+ import { sanitizeInboundEnvelopeMetadata as sanitizeInboundEnvelopeMetadataPure } from "@ai-matrx/content-ir";
3
+ import { seedEnvelope } from "@ai-matrx/rich-content/kinds/registry/region-envelope-memo";
3
4
  import { sanitizeInboundPartialKindMetadata } from "@ai-matrx/content-ir/wire";
4
5
  import { fromRenderBlock } from "@ai-matrx/media/files";
5
6
  function prepareInboundRenderBlock(data, gatePartialKindStaleness) {
@@ -30,6 +31,20 @@ function prepareInboundRenderBlock(data, gatePartialKindStaleness) {
30
31
  sanitized
31
32
  };
32
33
  }
34
+ function sanitizeInboundEnvelopeMetadata(metadata, context) {
35
+ return sanitizeInboundEnvelopeMetadataPure(metadata, context, {
36
+ seedEnvelope: (envelope) => seedEnvelope(envelope),
37
+ reportMalformed: ({ blockId, engine, raw }) => {
38
+ captureError({
39
+ source: "content-ir",
40
+ message: `render_block "${blockId}" carried a malformed metadata.__ir envelope (engine "${engine}") \u2014 dropped before Redux so it can't poison the pipeline`,
41
+ relation: engine,
42
+ raw
43
+ });
44
+ }
45
+ });
46
+ }
33
47
  export {
34
- prepareInboundRenderBlock
48
+ prepareInboundRenderBlock,
49
+ sanitizeInboundEnvelopeMetadata
35
50
  };
@@ -6,7 +6,7 @@ import {
6
6
  } from "@ai-matrx/media/files";
7
7
  import { DECISION_ANSWERS_BLOCK_TYPE } from "../../../../utils/content-ir/decision-answers-ids.js";
8
8
  import { withPerformedScript } from "../../../speech-script/types.js";
9
- import { seedPersistedEnvelopeCache } from "../../../../host/content-ir-slots.js";
9
+ import { seedPersistedEnvelopeCache } from "@ai-matrx/rich-content/kinds/registry/region-envelope-memo";
10
10
  function normalizeContentBlocks(rawBlocks) {
11
11
  return rawBlocks.map((block, i) => normalizeSingle(block, i));
12
12
  }
@@ -0,0 +1,11 @@
1
+ import type { RenderBlockPayload } from "@ai-matrx/agents/generated/stream-events";
2
+ /**
3
+ * Promote a server progress event's canonical `content_ir` value into the
4
+ * render block consumed by MarkdownStream/LiveRunDisplay.
5
+ *
6
+ * Pipeline endpoints still need their ordinary typed `data` event for domain
7
+ * state. When that event also carries `content_ir`, this adapter gives the
8
+ * exact same event a canonical visual representation without asking each
9
+ * feature to parse or route it itself.
10
+ */
11
+ export declare function progressDataRenderBlock(data: unknown, eventIndex: number, blockIndex: number): RenderBlockPayload | null;
@@ -0,0 +1,37 @@
1
+ import { IR_ENVELOPE_KEY } from "@ai-matrx/content-ir";
2
+ import { envelopeFromCompleteValue } from "@ai-matrx/rich-content/kinds/registry/kind-correctors";
3
+ import { applyIrKindRoute } from "@ai-matrx/rich-content/kinds/react/kind-route";
4
+ function progressDataRenderBlock(data, eventIndex, blockIndex) {
5
+ if (!isJsonObject(data) || !isJsonObject(data.content_ir)) return null;
6
+ const value = data.content_ir;
7
+ const kind = value.__kind;
8
+ if (typeof kind !== "string" || kind.trim().length === 0) return null;
9
+ const source = JSON.stringify(value);
10
+ const metadata = {
11
+ [IR_ENVELOPE_KEY]: envelopeFromCompleteValue(value, kind)
12
+ };
13
+ const routed = applyIrKindRoute({
14
+ type: "code",
15
+ serverData: { language: "json" },
16
+ metadata
17
+ });
18
+ const projectedContent = routed.serverData?.content;
19
+ return {
20
+ blockId: `progress_content_ir_${eventIndex}`,
21
+ blockIndex,
22
+ type: routed.type,
23
+ status: "complete",
24
+ // The unified artifact stage consumes RenderBlockPayload.content directly
25
+ // for structured_info. Preserve the JSON in the envelope fingerprint; put
26
+ // the registered component's canonical projection on the visible channel.
27
+ content: typeof projectedContent === "string" ? projectedContent : source,
28
+ data: routed.serverData ?? null,
29
+ metadata: routed.metadata
30
+ };
31
+ }
32
+ function isJsonObject(value) {
33
+ return typeof value === "object" && value !== null && !Array.isArray(value);
34
+ }
35
+ export {
36
+ progressDataRenderBlock
37
+ };