@ai-matrx/chat 0.7.5 → 0.7.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 (158) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/agents/api/fetch-pending-calls.js +4 -3
  3. package/dist/agents/api/submit-tool-results.js +3 -6
  4. package/dist/agents/components/ambient-assistant/ScrollAssistantLauncherImpl.js +13 -6
  5. package/dist/agents/components/chat/begin-fresh-chat.js +2 -2
  6. package/dist/agents/components/identity-refs/AiIdentityRef.js +2 -2
  7. package/dist/agents/components/inputs/smart-input/composer/ComposerSplash.js +2 -3
  8. package/dist/agents/components/inputs/smart-input/composer/useComposerMode.js +4 -2
  9. package/dist/agents/components/live-run/LiveRunDisplay.d.ts +7 -1
  10. package/dist/agents/components/live-run/LiveRunDisplay.js +3 -1
  11. package/dist/agents/components/messages-display/AgentConversationDisplay.js +1 -1
  12. package/dist/agents/components/messages-display/assistant/AgentEmptyMessageDisplay.js +4 -4
  13. package/dist/agents/components/messages-display/assistant/AssistantNoAnswer.js +1 -1
  14. package/dist/agents/components/messages-display/assistant/BreathingOrb.js +1 -1
  15. package/dist/agents/components/messages-display/assistant/InPlaceAnswerEditor.js +1 -1
  16. package/dist/agents/components/messages-display/citations/MessageSourcesRow.js +1 -1
  17. package/dist/agents/components/messages-display/conversation-tools/ConversationFindBar.js +4 -4
  18. package/dist/agents/components/messages-display/message-options/EditHistoryDialog.js +7 -7
  19. package/dist/agents/components/messages-display/user/AgentUserMessage.js +4 -4
  20. package/dist/agents/components/messages-display/user/CollabNoteMessage.js +2 -2
  21. package/dist/agents/components/messages-display/user/FirstTurnVariables.js +3 -3
  22. package/dist/agents/components/messages-display/user/PendingSendMessage.js +4 -4
  23. package/dist/agents/components/messages-display/user/RemarksTranscriptView.js +7 -7
  24. package/dist/agents/components/messages-display/user/ResourceAttachmentTile.js +9 -9
  25. package/dist/agents/components/messages-display/user/ResourceEditableToggleSamples.js +4 -4
  26. package/dist/agents/components/messages-display/user/UserActionBar.js +3 -3
  27. package/dist/agents/components/messages-display/user/UserMessageAttachmentStyleComparison.js +12 -12
  28. package/dist/agents/components/messages-display/user/UserMessageChipsDemo.js +19 -19
  29. package/dist/agents/components/messages-display/user/UserMessageHybridTileSamples.js +22 -22
  30. package/dist/agents/components/run/AgentRunnerPage.js +4 -4
  31. package/dist/agents/components/run/AssistantError.js +1 -1
  32. package/dist/agents/components/run/AssistantWarning.js +1 -1
  33. package/dist/agents/components/run/GenerationJobCard.js +5 -5
  34. package/dist/agents/components/run/IncompleteNote.js +1 -1
  35. package/dist/agents/components/run/RunJobWorkingLine.js +1 -1
  36. package/dist/agents/components/shared/AgentConversationColumn.js +1 -1
  37. package/dist/agents/components/shared/AgentHeaderMobile.js +6 -6
  38. package/dist/agents/components/shared/AgentModeController.js +1 -1
  39. package/dist/agents/components/shared/AutoInjectionSwitch.js +6 -6
  40. package/dist/agents/components/shared/DesktopFilterPanel.js +8 -8
  41. package/dist/agents/components/smart/AgentRunner.js +1 -1
  42. package/dist/agents/components/smart/CreateWithAiTabs.js +1 -1
  43. package/dist/agents/redux/agent-definition/agent-cache-bust-request.js +7 -7
  44. package/dist/agents/redux/execution-system/context-rules/receipt-check.js +2 -2
  45. package/dist/agents/redux/execution-system/inbox/inbox.thunks.d.ts +2 -2
  46. package/dist/agents/redux/execution-system/inbox/inbox.thunks.js +7 -15
  47. package/dist/agents/redux/execution-system/observational-memory/fetch-memory-cost.thunk.d.ts +1 -1
  48. package/dist/agents/redux/execution-system/observational-memory/fetch-memory-cost.thunk.js +7 -4
  49. package/dist/agents/redux/execution-system/selectors/aggregate.selectors.d.ts +1 -114
  50. package/dist/agents/redux/execution-system/selectors/aggregate.selectors.js +28 -43
  51. package/dist/agents/redux/execution-system/thunks/call-conversation-api.d.ts +44 -0
  52. package/dist/agents/redux/execution-system/thunks/call-conversation-api.js +78 -0
  53. package/dist/agents/redux/execution-system/thunks/continue-agent-json.d.ts +41 -0
  54. package/dist/agents/redux/execution-system/thunks/continue-agent-json.js +66 -0
  55. package/dist/agents/redux/execution-system/thunks/execute-instance.thunk.d.ts +20 -0
  56. package/dist/agents/redux/execution-system/thunks/execute-instance.thunk.js +9 -2
  57. package/dist/agents/redux/execution-system/thunks/launch-agent-execution.thunk.js +4 -6
  58. package/dist/agents/redux/execution-system/thunks/notify-and-play-dispatcher.d.ts +1 -5
  59. package/dist/agents/redux/execution-system/thunks/notify-and-play-dispatcher.js +2 -1
  60. package/dist/agents/redux/execution-system/thunks/resolve-base-url.js +7 -17
  61. package/dist/agents/redux/execution-system/thunks/settle-after-stop.thunk.js +2 -2
  62. package/dist/agents/redux/execution-system/thunks/smart-execute.thunk.js +3 -3
  63. package/dist/agents/redux/execution-system/utils/continuation-body.d.ts +8 -2
  64. package/dist/agents/redux/execution-system/utils/continuation-body.js +3 -3
  65. package/dist/agents/redux/execution-system/utils/required-organization.d.ts +18 -0
  66. package/dist/agents/redux/execution-system/utils/required-organization.js +14 -10
  67. package/dist/agents/redux/execution-system/utils/stream-block-accumulator.d.ts +69 -333
  68. package/dist/agents/redux/execution-system/utils/stream-block-accumulator.js +268 -1896
  69. package/dist/agents/services/mcp-connections.service.js +5 -8
  70. package/dist/agents/ui-first-tools/dispatcher/dispatch-ui-first-tool.thunk.js +2 -1
  71. package/dist/host/defaults/files-host.js +11 -1
  72. package/dist/host/defaults/files-ui.js +2 -1
  73. package/dist/host/defaults/server-api.d.ts +1 -15
  74. package/dist/host/defaults/server-api.js +0 -21
  75. package/dist/host/defaults/server.d.ts +2 -1
  76. package/dist/host/defaults/server.js +8 -6
  77. package/dist/host/request-headers.d.ts +26 -0
  78. package/dist/host/request-headers.js +15 -0
  79. package/dist/host/server/call-api.d.ts +0 -13
  80. package/dist/host/server/call-api.js +0 -2
  81. package/dist/host/server/matrx-transport.d.ts +0 -1
  82. package/dist/host/server/matrx-transport.js +0 -2
  83. package/dist/store/root-state.d.ts +4 -21
  84. package/dist/surfaces/hooks/useSurfaceConfig.js +2 -1
  85. package/dist/surfaces/runtime/surface-feedback.js +2 -2
  86. package/dist/tool-call-visualization/components/ArtifactResultBar.js +4 -4
  87. package/dist/tool-call-visualization/components/ChatResultColumn.d.ts +1 -1
  88. package/dist/tool-call-visualization/components/ToolCallBatch.js +2 -2
  89. package/dist/tool-call-visualization/components/ToolCallVisualization.js +5 -5
  90. package/dist/tool-call-visualization/components/ToolTabBodies.js +12 -12
  91. package/dist/tool-call-visualization/components/ToolUpdatesOverlay.js +4 -4
  92. package/dist/tool-call-visualization/configured-rows/ConfiguredToolRow.js +8 -8
  93. package/dist/tool-call-visualization/configured-rows/CopyToolButton.js +1 -1
  94. package/dist/tool-call-visualization/configured-rows/ToolProgressView.js +7 -7
  95. package/dist/tool-call-visualization/configured-rows/field-components.js +28 -50
  96. package/dist/tool-call-visualization/registry/GenericRenderer.js +4 -4
  97. package/dist/tool-call-visualization/renderers/_shared-entity/EmptyResultCard.js +1 -1
  98. package/dist/tool-call-visualization/renderers/_shared-entity/EntityCard.js +5 -5
  99. package/dist/tool-call-visualization/renderers/_shared-entity/PartPeekPopover.js +2 -2
  100. package/dist/tool-call-visualization/renderers/_shared-entity/ToolGlyph.js +1 -1
  101. package/dist/tool-call-visualization/renderers/_shared-entity/ToolResultCard.js +6 -6
  102. package/dist/tool-call-visualization/renderers/agent-call/AgentCallInline.js +5 -5
  103. package/dist/tool-call-visualization/renderers/agent-call/CollabCallCard.js +4 -4
  104. package/dist/tool-call-visualization/renderers/agent-call/ImageGenerationResult.js +1 -1
  105. package/dist/tool-call-visualization/renderers/ask/AskInline.js +3 -3
  106. package/dist/tool-call-visualization/renderers/ask-person/AskPersonInline.js +2 -2
  107. package/dist/tool-call-visualization/renderers/cloud-browser/CloudBrowserRunCard.js +5 -5
  108. package/dist/tool-call-visualization/renderers/ctx/CtxBatchInline.js +3 -3
  109. package/dist/tool-call-visualization/renderers/ctx/CtxGetInline.js +2 -2
  110. package/dist/tool-call-visualization/renderers/ctx/CtxItemCard.js +3 -3
  111. package/dist/tool-call-visualization/renderers/ctx/CtxPatchInline.js +6 -6
  112. package/dist/tool-call-visualization/renderers/dictionary/DictEntryList.js +12 -12
  113. package/dist/tool-call-visualization/renderers/dictionary/DictionaryOverlay.js +5 -5
  114. package/dist/tool-call-visualization/renderers/fs/FsInline.js +7 -7
  115. package/dist/tool-call-visualization/renderers/news-api/NewsInline.js +17 -17
  116. package/dist/tool-call-visualization/renderers/news-api/NewsOverlay.js +12 -12
  117. package/dist/tool-call-visualization/renderers/random-wheel/RandomWheelInline.js +34 -34
  118. package/dist/tool-call-visualization/renderers/records/RecordsInline.js +1 -1
  119. package/dist/tool-call-visualization/renderers/research/ResearchInline.js +10 -10
  120. package/dist/tool-call-visualization/renderers/research/ResearchOverlay.js +19 -19
  121. package/dist/tool-call-visualization/renderers/research/SubagentReportBlock.js +11 -11
  122. package/dist/tool-call-visualization/renderers/scrape/ScrapeInline.js +18 -18
  123. package/dist/tool-call-visualization/renderers/scrape/ScrapeOverlay.js +17 -17
  124. package/dist/tool-call-visualization/renderers/search/SearchInline.js +30 -30
  125. package/dist/tool-call-visualization/renderers/search/SearchOverlay.js +40 -40
  126. package/dist/tool-call-visualization/renderers/shell/ShellInline.js +3 -3
  127. package/dist/tool-call-visualization/renderers/skill/SkillInline.js +5 -5
  128. package/dist/tool-call-visualization/renderers/sql/DbSchemaInline.js +7 -7
  129. package/dist/tool-call-visualization/renderers/sql/SqlInline.js +4 -4
  130. package/dist/tool-call-visualization/renderers/workbook/WorkbookGrid.js +4 -4
  131. package/dist/tool-call-visualization/renderers/workbook/WorkbookInline.js +2 -2
  132. package/dist/tool-call-visualization/renderers/workbook/WorkbookOverlay.js +7 -7
  133. package/dist/tool-call-visualization/renderers/working-document/PatchDiffInline.js +3 -3
  134. package/dist/tool-call-visualization/result-fields/EmptyResult.js +1 -1
  135. package/dist/tool-call-visualization/result-fields/KeyValueGrid.js +9 -9
  136. package/dist/tool-call-visualization/result-fields/ResultFile.js +4 -4
  137. package/dist/tool-call-visualization/result-fields/ResultJson.js +1 -1
  138. package/dist/tool-call-visualization/result-fields/ResultMedia.js +2 -2
  139. package/dist/tool-call-visualization/result-fields/ResultScalar.js +2 -2
  140. package/dist/tool-call-visualization/result-fields/ResultTable.js +10 -10
  141. package/dist/tool-call-visualization/result-fields/ResultValue.js +7 -7
  142. package/dist/tool-call-visualization/result-fields/ShortId.js +3 -3
  143. package/dist/tool-call-visualization/result-fields/ToolErrorCard.js +4 -4
  144. package/dist/tool-call-visualization/result-fields/UrlChips.js +3 -3
  145. package/dist/tool-call-visualization/surface-write/SurfaceWriteDiff.js +2 -2
  146. package/dist/tool-call-visualization/surface-write/SurfaceWriteStress.js +1 -1
  147. package/dist/tool-call-visualization/window-panel/ToolCallWindowPanel.js +9 -9
  148. package/dist/ui/mandates-storage/mandateStorage.d.ts +36 -0
  149. package/dist/ui/mandates-storage/shortcutStorage.d.ts +9 -0
  150. package/dist/ui/markdown-stream/EnhancedChatMarkdown.js +22 -0
  151. package/dist/ui/markdown-stream/MarkdownStreamImpl.js +3 -3
  152. package/dist/ui/markdown-stream/StreamTextFallback.d.ts +6 -0
  153. package/dist/ui/markdown-stream/StreamTextFallback.js +23 -0
  154. package/dist/ui/markdown-stream/merge-thinking-across-hidden.d.ts +19 -0
  155. package/dist/ui/markdown-stream/merge-thinking-across-hidden.js +21 -0
  156. package/package.json +14 -9
  157. package/dist/agents/redux/execution-system/utils/content-prefilter.d.ts +0 -50
  158. package/dist/agents/redux/execution-system/utils/content-prefilter.js +0 -243
@@ -4,7 +4,7 @@ import {
4
4
  readMatrxJsonResponse,
5
5
  sendMatrxRequest
6
6
  } from "@ai-matrx/agents/matrx";
7
- import { applyOrganizationContextHeader } from "../../host/server/organization-context.js";
7
+ import { chatRequestHeaders } from "../../host/request-headers.js";
8
8
  import { ensureOrganizationForRequest } from "../../host/org.js";
9
9
  import { readSessionToken } from "../../host/identity.js";
10
10
  function backendBase() {
@@ -17,13 +17,10 @@ async function authHeaders(method, explicitOrganizationId) {
17
17
  method,
18
18
  organizationId: explicitOrganizationId
19
19
  });
20
- return applyOrganizationContextHeader(
21
- {
22
- Authorization: `Bearer ${accessToken}`,
23
- "Content-Type": "application/json"
24
- },
25
- organizationId
26
- );
20
+ return {
21
+ "Content-Type": "application/json",
22
+ ...chatRequestHeaders({ accessToken, fingerprintId: null }, organizationId)
23
+ };
27
24
  }
28
25
  async function mcpFetch(path, init, explicitOrganizationId) {
29
26
  const headers = await authHeaders(init?.method ?? "GET", explicitOrganizationId);
@@ -3,11 +3,12 @@ import { extractErrorMessage } from "@ai-matrx/data/net";
3
3
  import { submitToolResult } from "../../api/submit-tool-results.js";
4
4
  import { upsertToolLifecycle } from "../../redux/execution-system/active-requests/active-requests.slice.js";
5
5
  import { getUiFirstToolEntry } from "../tools/registry.js";
6
+ import { selectUserId } from "../../../host/identity.js";
6
7
  const dispatchUiFirstTool = createAsyncThunk(
7
8
  "uiFirstTools/dispatch",
8
9
  async ({ conversationId, requestId, callId, toolName, args }, { dispatch, getState }) => {
9
10
  const state = getState();
10
- const userId = state.userAuth?.id ?? null;
11
+ const userId = selectUserId(state);
11
12
  if (!userId) {
12
13
  dispatch(
13
14
  upsertToolLifecycle({
@@ -3,6 +3,7 @@ import {
3
3
  isFilesHostConfigured
4
4
  } from "@ai-matrx/media/files/engine/host/configure";
5
5
  import { getStoreSingleton } from "../../store/store-singleton.js";
6
+ import { chatRequestHeaders } from "../request-headers.js";
6
7
  const DEFAULT_FILES_SERVICE_URL = "https://files.matrxserver.com";
7
8
  const UUID = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
8
9
  const FILES_SERVICE_ROUTES = [
@@ -45,7 +46,16 @@ function createDefaultFilesServer(host) {
45
46
  async function buildHeaders(opts, includeContentType) {
46
47
  const requestId = opts.requestId ?? (globalThis.crypto?.randomUUID?.() ?? `${Date.now()}`);
47
48
  const headers = { ...await host().server.headers?.() ?? {}, "X-Request-Id": requestId };
48
- if (opts.organizationId) headers["X-Organization-Id"] = opts.organizationId;
49
+ if (opts.organizationId) {
50
+ const identity = host().identity;
51
+ Object.assign(
52
+ headers,
53
+ chatRequestHeaders(
54
+ { accessToken: await identity.getAccessToken(), fingerprintId: identity.current().fingerprintId },
55
+ opts.organizationId
56
+ )
57
+ );
58
+ }
49
59
  if (opts.idempotencyKey) headers["Idempotency-Key"] = opts.idempotencyKey;
50
60
  if (includeContentType) headers["Content-Type"] = "application/json";
51
61
  return { headers, requestId };
@@ -3,6 +3,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useCallback, useEffect, useState } from "react";
4
4
  import { X } from "lucide-react";
5
5
  import { downloadFile as saveBlob } from "@ai-matrx/kit/download";
6
+ import { formatFileSize } from "@ai-matrx/kit/format";
6
7
  import { FileIcon, MediaThumbnail } from "@ai-matrx/media/react";
7
8
  import { downloadFile } from "@ai-matrx/media/files/engine/api/files";
8
9
  import { useFile } from "@ai-matrx/media/files/engine/handler/hooks/useFile";
@@ -115,7 +116,7 @@ function useDefaultFileResourceFamily(fileId) {
115
116
  if (state.fileId !== fileId) return { data: null, loading: true, error: null };
116
117
  return { data: state.data, loading: false, error: state.error };
117
118
  }
118
- const formatBytes = (n) => n == null ? null : n < 1024 ? `${n} B` : n < 1024 * 1024 ? `${(n / 1024).toFixed(0)} KB` : `${(n / 1024 / 1024).toFixed(1)} MB`;
119
+ const formatBytes = (n) => n == null ? null : formatFileSize(n);
119
120
  function DefaultFileResourceChip({ fileId, fileHint, nameOverride, badge, onOpen, onRemove, className }) {
120
121
  const { file, status } = useFile(fileId && !isSyntheticId(fileId) ? { kind: "file_id", fileId } : null);
121
122
  const name = nameOverride || file?.meta.fileName || fileHint?.fileName || (status === "resolving" ? "Loading\u2026" : "File");
@@ -10,7 +10,7 @@
10
10
  * values here — no admin lane, no admin door, no endpoint overrides, no local
11
11
  * engine, no browser extension (each refusal says so once).
12
12
  */
13
- import { applyOrganizationContextHeader, type MatrxCallError, type MatrxCallResult, type MatrxCancelResponse, type MatrxTransport, type ProviderSessionFailure, type ProviderSessionFailureVerdict } from "@ai-matrx/agents/matrx";
13
+ import { applyOrganizationContextHeader, type MatrxCallError, type MatrxCallResult, type MatrxTransport, type ProviderSessionFailure, type ProviderSessionFailureVerdict } from "@ai-matrx/agents/matrx";
14
14
  import type { TypedStreamEvent } from "@ai-matrx/agents/generated/stream-events";
15
15
  import type { ApiPaths, ApiSchemas as Schemas, DefaultBrokeredCredential, DefaultRequestOptions, GetResult, PatchBody, PatchResult, PathWith, PostBody, PostResult } from "./typed-paths.js";
16
16
  import type { ChatIdentityPort, ChatOrgPort, ChatServerPort } from "../contract.js";
@@ -113,19 +113,6 @@ export declare function createDefaultServerApi(host: () => ServerHostView): {
113
113
  resolveScope: (_state?: unknown, overrides?: Partial<DefaultCallScope>) => DefaultCallScope;
114
114
  buildRequestBody: (body: unknown, scope: DefaultCallScope) => Record<string, unknown>;
115
115
  waitForAuthReady: (_getState?: AnyGetState) => Promise<boolean>;
116
- callConversationMemoryCost: (conversationId: string, options?: {
117
- signal?: AbortSignal;
118
- scopeOverrides?: Partial<DefaultCallScope>;
119
- }) => DefaultServerThunk<Promise<DefaultApiCallResult<{
120
- conversation_id: string;
121
- total_cost: number;
122
- total_input_tokens: number;
123
- total_output_tokens: number;
124
- event_count: number;
125
- by_event_type: {
126
- [key: string]: import("@ai-matrx/agents/generated/api-types").components["schemas"]["MemoryCostByEventType"];
127
- };
128
- }>>>;
129
116
  callConversationFork: (options: {
130
117
  conversationId: string;
131
118
  body?: unknown;
@@ -302,7 +289,6 @@ export declare function createDefaultServerApi(host: () => ServerHostView): {
302
289
  source?: string;
303
290
  expectedErrorStatuses?: readonly number[];
304
291
  }) => MatrxTransport;
305
- cancelAgentRunRequest: (requestId: string, mode?: "cancel" | "interrupt", seenSeq?: number) => DefaultServerThunk<Promise<DefaultApiCallResult<MatrxCancelResponse>>>;
306
292
  peekSelectedOrganizationId: () => string | null;
307
293
  waitForOrganizationAdmission: () => Promise<DefaultChatServerTypes["OrganizationAdmission"]>;
308
294
  adminLaneOrganizationId: () => string | null;
@@ -3,7 +3,6 @@ import {
3
3
  applyOrganizationContextHeader,
4
4
  buildMatrxRequestBody,
5
5
  buildMatrxRequestUrl,
6
- cancelAgentRun,
7
6
  createMatrxTransport as createPackageTransport,
8
7
  executeMatrxCall,
9
8
  normalizeMatrxError,
@@ -156,14 +155,6 @@ function createDefaultServerApi(host) {
156
155
  resolveScope,
157
156
  buildRequestBody,
158
157
  waitForAuthReady: async (_getState) => true,
159
- callConversationMemoryCost: (conversationId, options) => callApi({
160
- path: "/ai/conversations/{conversation_id}/memory_cost",
161
- method: "GET",
162
- pathParams: { conversation_id: conversationId },
163
- stream: false,
164
- ...options?.signal ? { signal: options.signal } : {},
165
- ...options?.scopeOverrides ? { scopeOverrides: options.scopeOverrides } : {}
166
- }),
167
158
  callConversationFork: call("POST", "/cx/conversations/{conversation_id}/fork"),
168
159
  callConversationForkAndRun: call("POST", "/ai/conversations/{conversation_id}/fork-and-run", true),
169
160
  callBatchDeleteMessages: call("POST", "/cx/conversations/{conversation_id}/messages/delete"),
@@ -184,18 +175,6 @@ function createDefaultServerApi(host) {
184
175
  ...options.source ? { source: options.source } : {},
185
176
  ...options.expectedErrorStatuses ? { expectedErrorStatuses: options.expectedErrorStatuses } : {}
186
177
  }),
187
- cancelAgentRunRequest: (requestId, mode = "cancel", seenSeq) => async () => {
188
- const base = transport();
189
- const sender = seenSeq === void 0 ? base : {
190
- fetch: (path, init) => base.fetch(`${path}${path.includes("?") ? "&" : "?"}seen_seq=${seenSeq}`, init)
191
- };
192
- try {
193
- const data = await cancelAgentRun(sender, requestId, { mode });
194
- return { data, requestId: data.request_id };
195
- } catch (error) {
196
- return { error: normalizeMatrxError(error) };
197
- }
198
- },
199
178
  // organization admission + the admin seat (none in a bare host)
200
179
  peekSelectedOrganizationId: () => host().org.active()?.id ?? null,
201
180
  waitForOrganizationAdmission: async () => host().org.active() ? "ready" : "unresolved",
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Default server port: the production AI Dream server; headers carry the
3
- * bearer token and the active organization.
3
+ * session credential and the active organization, built by THE ONE header
4
+ * builder (`../request-headers.ts`).
4
5
  */
5
6
  import type { ChatIdentityPort, ChatOrgPort, ChatServerPort } from "../contract.js";
6
7
  export declare const DEFAULT_CHAT_SERVER_URL = "https://server.app.matrxserver.com";
@@ -1,14 +1,16 @@
1
+ import { chatRequestHeaders } from "../request-headers.js";
1
2
  const DEFAULT_CHAT_SERVER_URL = "https://server.app.matrxserver.com";
2
3
  function createDefaultServer(identity, org) {
3
4
  return {
4
5
  baseUrl: () => DEFAULT_CHAT_SERVER_URL,
5
6
  async headers() {
6
- const headers = {};
7
- const token = await identity().getAccessToken();
8
- if (token) headers.Authorization = `Bearer ${token}`;
9
- const active = org().active();
10
- if (active) headers["X-Organization-Id"] = active.id;
11
- return headers;
7
+ return chatRequestHeaders(
8
+ {
9
+ accessToken: await identity().getAccessToken(),
10
+ fingerprintId: identity().current().fingerprintId
11
+ },
12
+ org().active()?.id ?? null
13
+ );
12
14
  }
13
15
  };
14
16
  }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * THE ONE HEADER BUILDER for every request the chat package sends to an AI Matrx server
3
+ * (Audit B family 8, "the inbox class").
4
+ *
5
+ * Who is asking (credential) and which organization the request names, as headers:
6
+ * - `Authorization: Bearer <jwt>` for a signed-in session, else `X-Fingerprint-ID` for a guest
7
+ * (the platform's one credential mapping, `credentialToHeaders` in `@ai-matrx/data`, which
8
+ * `@ai-matrx/api` carries forward unchanged);
9
+ * - `X-Organization-Id` when an organization is named;
10
+ * - the admin-lane marker when that organization is the platform tenant on the admin seat
11
+ * (`adminLaneHeadersFor`, the host's rule; none in a bare host).
12
+ *
13
+ * Every request path uses it: the conversation door (`resolveBackendForConversation`, which every
14
+ * turn and every conversation-bound call rides), the package default server port and the web
15
+ * app's server port. WHICH organization a conversation request names is a separate, single rule:
16
+ * `conversationRequestOrganizationId` (`agents/redux/execution-system/utils/required-organization.ts`).
17
+ * Guard: `host/__tests__/one-header-builder.test.ts` fails when a second builder appears.
18
+ */
19
+ export interface ChatRequestCredential {
20
+ /** The session's bearer token, or null. */
21
+ accessToken: string | null;
22
+ /** The guest fingerprint a signed-out visitor is known by, or null. */
23
+ fingerprintId: string | null;
24
+ }
25
+ /** The headers that say who is asking and in which organization. */
26
+ export declare function chatRequestHeaders(credential: ChatRequestCredential, organizationId: string | null | undefined): Record<string, string>;
@@ -0,0 +1,15 @@
1
+ import { credentialToHeaders } from "@ai-matrx/data";
2
+ import { adminLaneHeadersFor } from "./server/admin-lane.js";
3
+ function chatRequestHeaders(credential, organizationId) {
4
+ const presented = credential.accessToken ? { kind: "user", accessToken: credential.accessToken } : credential.fingerprintId ? { kind: "guest", fingerprintId: credential.fingerprintId } : null;
5
+ const headers = credentialToHeaders(presented);
6
+ if (!organizationId) return headers;
7
+ return {
8
+ ...headers,
9
+ "X-Organization-Id": organizationId,
10
+ ...adminLaneHeadersFor(organizationId)
11
+ };
12
+ }
13
+ export {
14
+ chatRequestHeaders
15
+ };
@@ -8,19 +8,6 @@ export declare const callApi: <T = unknown>(config: import("../defaults/server-a
8
8
  export declare const buildRequestBody: (body: unknown, scope: import("../defaults/server-api.js").DefaultCallScope) => Record<string, unknown>;
9
9
  export declare const resolveScope: (_state?: unknown, overrides?: Partial<import("../defaults/server-api.js").DefaultCallScope>) => import("../defaults/server-api.js").DefaultCallScope;
10
10
  export declare const waitForAuthReady: (_getState?: () => unknown) => Promise<boolean>;
11
- export declare const callConversationMemoryCost: (conversationId: string, options?: {
12
- signal?: AbortSignal;
13
- scopeOverrides?: Partial<import("../defaults/server-api.js").DefaultCallScope>;
14
- }) => import("../defaults/server-api.js").DefaultServerThunk<Promise<import("../defaults/server-api.js").DefaultApiCallResult<{
15
- conversation_id: string;
16
- total_cost: number;
17
- total_input_tokens: number;
18
- total_output_tokens: number;
19
- event_count: number;
20
- by_event_type: {
21
- [key: string]: import("@ai-matrx/agents/generated/api-types").components["schemas"]["MemoryCostByEventType"];
22
- };
23
- }>>>;
24
11
  export declare const callConversationFork: (options: {
25
12
  conversationId: string;
26
13
  body?: unknown;
@@ -3,7 +3,6 @@ const callApi = forwardServer("callApi");
3
3
  const buildRequestBody = forwardServer("buildRequestBody");
4
4
  const resolveScope = forwardServer("resolveScope");
5
5
  const waitForAuthReady = forwardServer("waitForAuthReady");
6
- const callConversationMemoryCost = forwardServer("callConversationMemoryCost");
7
6
  const callConversationFork = forwardServer("callConversationFork");
8
7
  const callConversationForkAndRun = forwardServer("callConversationForkAndRun");
9
8
  const callBatchDeleteMessages = forwardServer("callBatchDeleteMessages");
@@ -23,7 +22,6 @@ export {
23
22
  callConversationDelete,
24
23
  callConversationFork,
25
24
  callConversationForkAndRun,
26
- callConversationMemoryCost,
27
25
  callConversationSandboxBind,
28
26
  callConversationSandboxUnbind,
29
27
  callConversationUpdate,
@@ -17,5 +17,4 @@ export declare const createMatrxTransportFromTarget: (getState: () => unknown, r
17
17
  source?: string;
18
18
  expectedErrorStatuses?: readonly number[];
19
19
  }) => import("@ai-matrx/agents").MatrxTransport;
20
- export declare const cancelAgentRunRequest: (requestId: string, mode?: "cancel" | "interrupt", seenSeq?: number) => import("../defaults/server-api.js").DefaultServerThunk<Promise<import("../defaults/server-api.js").DefaultApiCallResult<import("@ai-matrx/agents").MatrxCancelResponse>>>;
21
20
  export type MatrxTransportOptions = ChatServerTypes["MatrxTransportOptions"];
@@ -1,9 +1,7 @@
1
1
  import { forwardServer } from "../server.js";
2
2
  const createMatrxTransport = forwardServer("createMatrxTransport");
3
3
  const createMatrxTransportFromTarget = forwardServer("createMatrxTransportFromTarget");
4
- const cancelAgentRunRequest = forwardServer("cancelAgentRunRequest");
5
4
  export {
6
- cancelAgentRunRequest,
7
5
  createMatrxTransport,
8
6
  createMatrxTransportFromTarget
9
7
  };
@@ -4,32 +4,15 @@ import type { ChatState } from "./state.js";
4
4
  export interface ChatStoreRegister {
5
5
  }
6
6
  /**
7
- * Slices the HOST owns that package code reads when present (§2.3). A private store has none of
7
+ * Slices the HOST owns that package code reads when present (§2.3). Identity, the active
8
+ * organization and the profile are NEVER read from host slices: they come from the package's own
9
+ * `chatHost` slice (the host's identity and org ports) — guard
10
+ * `store/__tests__/no-host-identity-slice-reads.test.ts`. A private store has none of
8
11
  * them, so every read is optional; a registered host store supplies the real shapes. Only the
9
12
  * fields the package reads are named, with no index signatures, so a host's concrete slice
10
13
  * interfaces (which carry extra fields) stay assignable.
11
14
  */
12
15
  export interface ChatHostReadSlices {
13
- userAuth?: {
14
- id: string | null;
15
- email?: string | null;
16
- isAnonymous?: boolean;
17
- accessToken?: string | null;
18
- isAdmin?: boolean;
19
- adminLaneOpen?: boolean;
20
- adminLevel?: string | null;
21
- };
22
- appContext?: {
23
- organization_id?: string | null;
24
- };
25
- userProfile?: {
26
- fingerprintId?: string | null;
27
- userMetadata?: {
28
- fullName?: string | null;
29
- name?: string | null;
30
- preferredUsername?: string | null;
31
- } | null;
32
- };
33
16
  cloudFiles?: {
34
17
  filesById: Record<string, {
35
18
  fileName?: string | null;
@@ -12,6 +12,7 @@ import {
12
12
  addRosterItem
13
13
  } from "../services/surface-config.service.js";
14
14
  import { getNamespaceHandler } from "../config/namespace-registry.js";
15
+ import { selectUserId } from "../../host/identity.js";
15
16
  function useSurfaceConfig(surfaceName) {
16
17
  const dispatch = useAppDispatch();
17
18
  const entry = useAppSelector((s) => selectSurfaceConfigEntry(s, surfaceName));
@@ -42,7 +43,7 @@ function useSurfaceConfig(surfaceName) {
42
43
  }
43
44
  function useSurfaceAgentRoles(surfaceName) {
44
45
  const { status, roles, refresh } = useSurfaceConfig(surfaceName);
45
- const userId = useAppSelector((s) => s.userAuth?.id ?? null);
46
+ const userId = useAppSelector(selectUserId);
46
47
  const buildView = useCallback(
47
48
  (resolved) => {
48
49
  const first = resolved.effective[0] ?? null;
@@ -6,6 +6,7 @@ import {
6
6
  SURFACE_FEEDBACK_MESSAGE_MAX,
7
7
  SURFACE_FEEDBACK_MESSAGE_MIN
8
8
  } from "../manifests/_baseline.manifest.js";
9
+ import { selectOrganizationId } from "../../host/org.js";
9
10
  const SURFACE_FEEDBACK_TARGET_NAME = PLATFORM_WRITE_TARGETS.surface_feedback.name;
10
11
  const KIND_LIST = SURFACE_FEEDBACK_KINDS.join(" | ");
11
12
  const SURFACE_FEEDBACK_TARGET = PLATFORM_WRITE_TARGETS.surface_feedback;
@@ -72,8 +73,7 @@ ${message}`,
72
73
  };
73
74
  }
74
75
  function readActiveOrganizationId() {
75
- const state = getStoreSingleton()?.getState();
76
- return state?.appContext?.organization_id ?? null;
76
+ return selectOrganizationId(getStoreSingleton()?.getState());
77
77
  }
78
78
  async function saveSurfaceFeedback(value, ctx) {
79
79
  const result = await getChatHost().feedback.submit(
@@ -92,7 +92,7 @@ function ArtifactResultBar({
92
92
  }
93
93
  },
94
94
  className: cn(
95
- "group/bar flex w-full cursor-pointer items-center gap-3 border border-border/50 bg-card px-4 py-2.5 text-left transition-colors hover:bg-accent/30",
95
+ "group/bar flex w-full cursor-pointer items-center gap-3 border border-border/50 bg-[var(--mx-chat-card,hsl(var(--card)))] px-4 py-2.5 text-left transition-colors hover:bg-accent/30",
96
96
  // Collapsed: a full pill. Expanded: the letterhead of the attached
97
97
  // document — square bottom, no bottom border, the body continues it.
98
98
  peekExpanded ? "rounded-t-xl border-b-0" : "rounded-xl"
@@ -106,8 +106,8 @@ function ArtifactResultBar({
106
106
  }
107
107
  ),
108
108
  /* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
109
- /* @__PURE__ */ jsx("span", { className: "block truncate text-sm font-medium text-foreground", children: title }),
110
- /* @__PURE__ */ jsxs("span", { className: "block truncate text-xs text-muted-foreground", children: [
109
+ /* @__PURE__ */ jsx("span", { className: "block truncate text-sm font-medium text-[color:var(--mx-chat-text,hsl(var(--foreground)))]", children: title }),
110
+ /* @__PURE__ */ jsxs("span", { className: "block truncate text-xs text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]", children: [
111
111
  meta.noun,
112
112
  " \xB7 ",
113
113
  artifact.verbPast
@@ -121,7 +121,7 @@ function ArtifactResultBar({
121
121
  tabIndex: 0,
122
122
  onClick: (e) => e.stopPropagation(),
123
123
  onKeyDown: (e) => e.stopPropagation(),
124
- className: "flex shrink-0 cursor-pointer items-center gap-1.5 rounded-xl border border-border/70 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/40 hover:text-foreground",
124
+ className: "flex shrink-0 cursor-pointer items-center gap-1.5 rounded-xl border border-border/70 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))] transition-colors hover:bg-accent/40 hover:text-[color:var(--mx-chat-text,hsl(var(--foreground)))]",
125
125
  "aria-label": "Open options",
126
126
  children: [
127
127
  /* @__PURE__ */ jsx(PanelRightOpen, { className: "size-3.5" }),
@@ -6,7 +6,7 @@ import React from "react";
6
6
  * In the real conversation, a tool card sits inside `AgentConversationColumn`'s
7
7
  * centered content (`w-full max-w-3xl mx-auto px-2`) directly on the plain
8
8
  * conversation surface — NO surrounding card, border, padding, or background
9
- * change. Tools that look fine inside a decorative `bg-card` demo panel can
9
+ * change. Tools that look fine inside a decorative `bg-[var(--mx-chat-card,hsl(var(--card)))]` demo panel can
10
10
  * render badly in chat (stray borders, odd bg shifts). Previewing in anything
11
11
  * but this column lies about how the tool actually renders, so every gallery /
12
12
  * "in action" preview must wrap its `ToolCallVisualization` in this.
@@ -131,8 +131,8 @@ const ToolCallBatch = ({
131
131
  text: `Running ${count} tools\u2026`,
132
132
  className: "truncate font-sans text-sm leading-relaxed tracking-wide"
133
133
  }
134
- ) : /* @__PURE__ */ jsx("span", { className: "truncate font-sans text-sm leading-relaxed tracking-wide text-muted-foreground", children: label }),
135
- isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" })
134
+ ) : /* @__PURE__ */ jsx("span", { className: "truncate font-sans text-sm leading-relaxed tracking-wide text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]", children: label }),
135
+ isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5 shrink-0 text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-3.5 w-3.5 shrink-0 text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]" })
136
136
  ]
137
137
  }
138
138
  ),
@@ -282,7 +282,7 @@ const ToolCallVisualizationInner = ({
282
282
  ) : /* @__PURE__ */ jsx(
283
283
  "span",
284
284
  {
285
- className: "truncate font-sans text-sm leading-relaxed tracking-wide text-muted-foreground",
285
+ className: "truncate font-sans text-sm leading-relaxed tracking-wide text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]",
286
286
  title: guardRouting?.tooltip,
287
287
  children: phaseLabel
288
288
  }
@@ -298,7 +298,7 @@ const ToolCallVisualizationInner = ({
298
298
  querySubtitle
299
299
  ] }))
300
300
  ] }),
301
- isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
301
+ isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5 shrink-0 text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-3.5 w-3.5 shrink-0 text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]" }),
302
302
  /* @__PURE__ */ jsxs("span", { className: "flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity focus-within:opacity-100 group-hover/toolcard:opacity-100", children: [
303
303
  /* @__PURE__ */ jsx(
304
304
  "span",
@@ -316,7 +316,7 @@ const ToolCallVisualizationInner = ({
316
316
  handleOpenWindowPanel();
317
317
  }
318
318
  },
319
- className: "cursor-pointer rounded p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
319
+ className: "cursor-pointer rounded p-0.5 text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))] transition-colors hover:bg-[var(--mx-chat-fill,hsl(var(--muted)))] hover:text-[color:var(--mx-chat-text,hsl(var(--foreground)))]",
320
320
  title: "Open in floating window",
321
321
  children: /* @__PURE__ */ jsx(PanelRightOpen, { className: "h-3 w-3" })
322
322
  }
@@ -339,7 +339,7 @@ const ToolCallVisualizationInner = ({
339
339
  setIsOverlayOpen(true);
340
340
  }
341
341
  },
342
- className: "cursor-pointer rounded p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
342
+ className: "cursor-pointer rounded p-0.5 text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))] transition-colors hover:bg-[var(--mx-chat-fill,hsl(var(--muted)))] hover:text-[color:var(--mx-chat-text,hsl(var(--foreground)))]",
343
343
  title: "Open fullscreen overlay",
344
344
  children: /* @__PURE__ */ jsx(Maximize2, { className: "h-3 w-3" })
345
345
  }
@@ -372,7 +372,7 @@ const ToolCallVisualizationInner = ({
372
372
  const entryParked = parkedOnPersonOf(entry, suspendedCallIds);
373
373
  const InlineRenderer = isErrored || entryWait || entryParked ? null : getInlineRenderer(entry.toolName);
374
374
  return /* @__PURE__ */ jsxs("div", { children: [
375
- entries.length > 1 && /* @__PURE__ */ jsx("div", { className: "mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground", children: groupDisplayName }),
375
+ entries.length > 1 && /* @__PURE__ */ jsx("div", { className: "mb-1 text-[10px] font-semibold uppercase tracking-wide text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]", children: groupDisplayName }),
376
376
  entryParked ? /* @__PURE__ */ jsx(
377
377
  ParkedOnPersonCard,
378
378
  {
@@ -34,8 +34,8 @@ const InputView = ({
34
34
  const args = entry.arguments ?? {};
35
35
  const argCount = Object.keys(args).length;
36
36
  return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col", children: [
37
- /* @__PURE__ */ jsxs("div", { className: "flex flex-shrink-0 items-center justify-between border-b border-border bg-muted/30 px-3 py-1.5", children: [
38
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
37
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-shrink-0 items-center justify-between border-b border-[color:var(--mx-chat-border,hsl(var(--border)))] bg-muted/30 px-3 py-1.5", children: [
38
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]", children: [
39
39
  /* @__PURE__ */ jsx(Settings2, { className: "h-3.5 w-3.5" }),
40
40
  /* @__PURE__ */ jsx("span", { children: "Tool input" }),
41
41
  /* @__PURE__ */ jsxs(Badge, { variant: "outline", className: "px-1.5 py-0 text-[10px]", children: [
@@ -102,9 +102,9 @@ const ErrorView = ({
102
102
  const hasArgs = Object.keys(args).length > 0;
103
103
  const bundle = buildToolEntryBundle(entry);
104
104
  return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col", children: [
105
- /* @__PURE__ */ jsxs("div", { className: "flex flex-shrink-0 items-center justify-between border-b border-border bg-muted/30 px-3 py-1.5", children: [
106
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
107
- routed ? /* @__PURE__ */ jsx(Route, { className: "h-3.5 w-3.5 text-muted-foreground" }) : /* @__PURE__ */ jsx(CircleAlert, { className: "h-3.5 w-3.5 text-destructive" }),
105
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-shrink-0 items-center justify-between border-b border-[color:var(--mx-chat-border,hsl(var(--border)))] bg-muted/30 px-3 py-1.5", children: [
106
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]", children: [
107
+ routed ? /* @__PURE__ */ jsx(Route, { className: "h-3.5 w-3.5 text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]" }) : /* @__PURE__ */ jsx(CircleAlert, { className: "h-3.5 w-3.5 text-destructive" }),
108
108
  /* @__PURE__ */ jsx("span", { children: routed ? "Routed" : "Error" }),
109
109
  entry.errorType && /* @__PURE__ */ jsxs(
110
110
  Badge,
@@ -134,11 +134,11 @@ const ErrorView = ({
134
134
  ] }),
135
135
  /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-4 overflow-auto px-3 py-3", children: [
136
136
  /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
137
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-foreground", children: label }),
138
- message ? /* @__PURE__ */ jsx("p", { className: "whitespace-pre-wrap break-words text-sm leading-relaxed text-muted-foreground", children: message }) : /* @__PURE__ */ jsx("p", { className: "text-sm italic text-muted-foreground", children: "No error message was recorded. Check the Raw tab for events." })
137
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[color:var(--mx-chat-text,hsl(var(--foreground)))]", children: label }),
138
+ message ? /* @__PURE__ */ jsx("p", { className: "whitespace-pre-wrap break-words text-sm leading-relaxed text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]", children: message }) : /* @__PURE__ */ jsx("p", { className: "text-sm italic text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]", children: "No error message was recorded. Check the Raw tab for events." })
139
139
  ] }),
140
- hasArgs && /* @__PURE__ */ jsxs("div", { className: "space-y-1.5 border-t border-border pt-3", children: [
141
- /* @__PURE__ */ jsx("p", { className: "text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: "Input that failed" }),
140
+ hasArgs && /* @__PURE__ */ jsxs("div", { className: "space-y-1.5 border-t border-[color:var(--mx-chat-border,hsl(var(--border)))] pt-3", children: [
141
+ /* @__PURE__ */ jsx("p", { className: "text-[11px] font-medium uppercase tracking-wide text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]", children: "Input that failed" }),
142
142
  /* @__PURE__ */ jsx(KeyValueGrid, { value: args, density: "full" })
143
143
  ] })
144
144
  ] })
@@ -149,8 +149,8 @@ const RawDataView = ({
149
149
  }) => {
150
150
  const bundle = buildToolEntryBundle(entry);
151
151
  return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col", children: [
152
- /* @__PURE__ */ jsxs("div", { className: "flex flex-shrink-0 items-center justify-between border-b border-border bg-muted/30 px-3 py-1.5", children: [
153
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
152
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-shrink-0 items-center justify-between border-b border-[color:var(--mx-chat-border,hsl(var(--border)))] bg-muted/30 px-3 py-1.5", children: [
153
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]", children: [
154
154
  /* @__PURE__ */ jsx(FileCode2, { className: "h-3.5 w-3.5" }),
155
155
  /* @__PURE__ */ jsx("span", { children: "All" }),
156
156
  /* @__PURE__ */ jsxs(Badge, { variant: "outline", className: "px-1.5 py-0 text-[10px]", children: [
@@ -172,7 +172,7 @@ const RawDataView = ({
172
172
  }
173
173
  )
174
174
  ] }),
175
- /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-hidden p-2", children: /* @__PURE__ */ jsx("div", { className: "h-full min-h-[280px] overflow-hidden rounded-md border border-border bg-card", children: /* @__PURE__ */ jsx(JsonInspector, { showSource: true, data: bundle }) }) })
175
+ /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-hidden p-2", children: /* @__PURE__ */ jsx("div", { className: "h-full min-h-[280px] overflow-hidden rounded-md border border-[color:var(--mx-chat-border,hsl(var(--border)))] bg-[var(--mx-chat-card,hsl(var(--card)))]", children: /* @__PURE__ */ jsx(JsonInspector, { showSource: true, data: bundle }) }) })
176
176
  ] });
177
177
  };
178
178
  const EntryResultsBody = ({ entry, conversationId: conversationIdProp }) => {
@@ -19,8 +19,8 @@ import {
19
19
  import { Button } from "@ai-matrx/design-system/controls";
20
20
  const EntrySelector = ({ entries, selectedCallId, onSelect }) => {
21
21
  if (entries.length <= 1) return null;
22
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-shrink-0 items-center gap-1.5 overflow-x-auto border-b border-border bg-muted/40 px-3 py-1.5 scrollbar-none", children: [
23
- /* @__PURE__ */ jsx("span", { className: "mr-1 flex-shrink-0 text-xs text-muted-foreground", children: "Tool" }),
22
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-shrink-0 items-center gap-1.5 overflow-x-auto border-b border-[color:var(--mx-chat-border,hsl(var(--border)))] bg-muted/40 px-3 py-1.5 scrollbar-none", children: [
23
+ /* @__PURE__ */ jsx("span", { className: "mr-1 flex-shrink-0 text-xs text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]", children: "Tool" }),
24
24
  entries.map((entry, idx) => {
25
25
  const label = getToolDisplayName(entry.toolName);
26
26
  const isActive = entry.callId === selectedCallId;
@@ -72,7 +72,7 @@ const InputTabContent = ({ entries, selectedCallId, onSelect }) => {
72
72
  onSelect
73
73
  }
74
74
  ),
75
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-hidden", children: entry ? /* @__PURE__ */ jsx(InputView, { entry }) : /* @__PURE__ */ jsx("div", { className: "p-8 text-center text-muted-foreground", children: /* @__PURE__ */ jsx("p", { className: "text-sm", children: "No tool data available" }) }) })
75
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-hidden", children: entry ? /* @__PURE__ */ jsx(InputView, { entry }) : /* @__PURE__ */ jsx("div", { className: "p-8 text-center text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]", children: /* @__PURE__ */ jsx("p", { className: "text-sm", children: "No tool data available" }) }) })
76
76
  ] });
77
77
  };
78
78
  const RawTabContent = ({ entries, selectedCallId, onSelect }) => {
@@ -86,7 +86,7 @@ const RawTabContent = ({ entries, selectedCallId, onSelect }) => {
86
86
  onSelect
87
87
  }
88
88
  ),
89
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-hidden", children: entry ? /* @__PURE__ */ jsx(RawDataView, { entry }) : /* @__PURE__ */ jsx("div", { className: "p-8 text-center text-muted-foreground", children: /* @__PURE__ */ jsx("p", { className: "text-sm", children: "No tool data available" }) }) })
89
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-hidden", children: entry ? /* @__PURE__ */ jsx(RawDataView, { entry }) : /* @__PURE__ */ jsx("div", { className: "p-8 text-center text-[color:var(--mx-chat-text-secondary,hsl(var(--muted-foreground)))]", children: /* @__PURE__ */ jsx("p", { className: "text-sm", children: "No tool data available" }) }) })
90
90
  ] });
91
91
  };
92
92
  const ToolUpdatesOverlay = ({