@ai-matrx/chat 0.3.33 → 0.4.2

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 (129) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/agents/addressing/useAgentHref.js +4 -1
  3. package/dist/agents/api/submit-tool-results.js +11 -1
  4. package/dist/agents/components/ambient-assistant/intelligence-places.js +2 -2
  5. package/dist/agents/components/chat/intelligence-places.js +7 -7
  6. package/dist/agents/components/chat/useCanvasScopedToConversation.js +1 -1
  7. package/dist/agents/components/inputs/smart-input/RunToolPicker.js +7 -13
  8. package/dist/agents/components/inputs/smart-input/composer/ComposerAgentPill.js +3 -2
  9. package/dist/agents/components/inputs/smart-input/composer/useComposerAgent.js +5 -5
  10. package/dist/agents/components/inputs/smart-input/composer/useComposerAgentFilter.js +3 -2
  11. package/dist/agents/components/messages-display/AgentConversationDisplay.js +4 -1
  12. package/dist/agents/components/run-controls/RunConfigOverrides.js +10 -16
  13. package/dist/agents/components/run-controls/panels/shared.d.ts +1 -1
  14. package/dist/agents/components/shared/AgentConversationColumn.js +3 -2
  15. package/dist/agents/components/working-document/workingDocumentSurface.d.ts +1 -1
  16. package/dist/agents/hooks/useAgentModelLabel.js +4 -3
  17. package/dist/agents/hooks/useDiffEnrichment.js +3 -5
  18. package/dist/agents/hooks/useModelControls.d.ts +5 -161
  19. package/dist/agents/identity/model-catalog.d.ts +37 -0
  20. package/dist/agents/identity/model-catalog.js +105 -0
  21. package/dist/agents/redux/agent-definition/selectors.d.ts +237 -237
  22. package/dist/agents/redux/agent-definition/thunks.d.ts +1 -1
  23. package/dist/agents/redux/agent-settings/agentSettingsSlice.d.ts +1 -1
  24. package/dist/agents/redux/agent-settings/agentSettingsSlice.js +4 -6
  25. package/dist/agents/redux/agent-settings/selectors.d.ts +13 -152
  26. package/dist/agents/redux/agent-settings/selectors.js +0 -39
  27. package/dist/agents/redux/agent-settings/useNormalizedControls.d.ts +8 -0
  28. package/dist/agents/redux/agent-settings/useNormalizedControls.js +24 -0
  29. package/dist/agents/redux/agent-shortcut-categories/selectors.d.ts +50 -50
  30. package/dist/agents/redux/agent-shortcuts/selectors.d.ts +147 -147
  31. package/dist/agents/redux/conversation-history/selectors.d.ts +16 -16
  32. package/dist/agents/redux/conversation-list/conversation-list.selectors.d.ts +2 -2
  33. package/dist/agents/redux/execution-system/active-requests/active-requests.selectors.d.ts +54 -54
  34. package/dist/agents/redux/execution-system/context-state/context-state.selectors.d.ts +14 -14
  35. package/dist/agents/redux/execution-system/conversations/conversations.selectors.d.ts +5 -5
  36. package/dist/agents/redux/execution-system/host-conversations/conversation-abilities.d.ts +12 -0
  37. package/dist/agents/redux/execution-system/host-conversations/conversation-abilities.js +25 -0
  38. package/dist/agents/redux/execution-system/host-conversations/host-conversation.thunks.d.ts +50 -0
  39. package/dist/agents/redux/execution-system/host-conversations/host-conversation.thunks.js +367 -0
  40. package/dist/agents/redux/execution-system/host-conversations/host-conversations.selectors.d.ts +28 -0
  41. package/dist/agents/redux/execution-system/host-conversations/host-conversations.selectors.js +41 -0
  42. package/dist/agents/redux/execution-system/host-conversations/host-conversations.slice.d.ts +43 -0
  43. package/dist/agents/redux/execution-system/host-conversations/host-conversations.slice.js +38 -0
  44. package/dist/agents/redux/execution-system/host-conversations/source-registry.d.ts +9 -0
  45. package/dist/agents/redux/execution-system/host-conversations/source-registry.js +15 -0
  46. package/dist/agents/redux/execution-system/host-conversations/useHostConversation.d.ts +4 -0
  47. package/dist/agents/redux/execution-system/host-conversations/useHostConversation.js +24 -0
  48. package/dist/agents/redux/execution-system/instance-context/instance-context.selectors.d.ts +3 -3
  49. package/dist/agents/redux/execution-system/instance-resources/default-remark-durability.d.ts +22 -0
  50. package/dist/agents/redux/execution-system/instance-resources/default-remark-durability.js +164 -0
  51. package/dist/agents/redux/execution-system/instance-resources/instance-resources.selectors.d.ts +8 -8
  52. package/dist/agents/redux/execution-system/instance-ui-state/instance-ui-state.selectors.d.ts +5 -5
  53. package/dist/agents/redux/execution-system/instance-user-input/composer-draft-store.js +20 -0
  54. package/dist/agents/redux/execution-system/instance-user-input/useComposerDraftRestore.js +2 -1
  55. package/dist/agents/redux/execution-system/instance-variable-values/instance-variable-values.selectors.d.ts +7 -7
  56. package/dist/agents/redux/execution-system/messages/messages.selectors.d.ts +1 -1
  57. package/dist/agents/redux/execution-system/observability/observability.selectors.d.ts +7 -7
  58. package/dist/agents/redux/execution-system/observational-memory/observational-memory.selectors.d.ts +1 -1
  59. package/dist/agents/redux/execution-system/selectors/aggregate.selectors.d.ts +14 -14
  60. package/dist/agents/redux/execution-system/thunks/execute-instance.thunk.js +2 -1
  61. package/dist/agents/redux/execution-system/thunks/execute-manual-instance.thunk.js +4 -3
  62. package/dist/agents/redux/execution-system/thunks/load-conversation.thunk.js +6 -0
  63. package/dist/agents/redux/execution-system/thunks/load-older-messages.thunk.js +12 -0
  64. package/dist/agents/redux/execution-system/thunks/process-stream.js +5 -3
  65. package/dist/agents/redux/execution-system/thunks/resolve-base-url.js +1 -1
  66. package/dist/agents/redux/execution-system/thunks/smart-execute.thunk.js +43 -0
  67. package/dist/agents/redux/execution-system/utils/continuation-body.d.ts +1 -0
  68. package/dist/agents/redux/execution-system/utils/continuation-body.js +2 -1
  69. package/dist/agents/redux/model-registry.d.ts +6 -4
  70. package/dist/agents/redux/model-registry.js +23 -5
  71. package/dist/agents/redux/proposed-directives/proposedDirectivesSlice.d.ts +1 -1
  72. package/dist/agents/redux/tools/tools.selectors.d.ts +1 -1
  73. package/dist/agents/resources/default-picker-items.d.ts +17 -0
  74. package/dist/agents/resources/default-picker-items.js +48 -0
  75. package/dist/agents/runtime/generation-job.js +4 -7
  76. package/dist/agents/runtime/get-model-capabilities.js +3 -3
  77. package/dist/agents/types/instance.types.d.ts +2 -1
  78. package/dist/agents/ui-first-tools/redux/agent-lists.selectors.d.ts +2 -2
  79. package/dist/cx-chat/components/SsrSidebarChats.js +1 -1
  80. package/dist/cx-chat/components/sidebar/SidebarUserFooter.js +1 -1
  81. package/dist/host/app-identity.d.ts +20 -0
  82. package/dist/host/app-identity.js +21 -0
  83. package/dist/host/bare-host-chrome.d.ts +14 -0
  84. package/dist/host/bare-host-chrome.js +44 -0
  85. package/dist/host/configure.d.ts +9 -1
  86. package/dist/host/configure.js +44 -8
  87. package/dist/host/content-ir-slots.d.ts +5 -1
  88. package/dist/host/content-ir-slots.js +5 -1
  89. package/dist/host/contract.d.ts +39 -2
  90. package/dist/host/db-types.d.ts +375 -10
  91. package/dist/host/defaults/navigation-hooks.d.ts +2 -0
  92. package/dist/host/defaults/navigation-hooks.js +7 -1
  93. package/dist/host/defaults/navigation.d.ts +4 -3
  94. package/dist/host/defaults/navigation.js +38 -7
  95. package/dist/host/defaults/org.d.ts +12 -4
  96. package/dist/host/defaults/org.js +39 -1
  97. package/dist/host/defaults/workspace-gate.d.ts +16 -0
  98. package/dist/host/defaults/workspace-gate.js +88 -0
  99. package/dist/host/diagnostics.d.ts +7 -2
  100. package/dist/host/diagnostics.js +6 -0
  101. package/dist/host/identity.js +2 -1
  102. package/dist/host/index.d.ts +5 -2
  103. package/dist/host/index.js +21 -1
  104. package/dist/host/no-database.d.ts +38 -0
  105. package/dist/host/no-database.js +107 -0
  106. package/dist/host/react.d.ts +1 -0
  107. package/dist/host/react.js +25 -2
  108. package/dist/host/registered-source.js +2 -2
  109. package/dist/host/source.d.ts +109 -0
  110. package/dist/host/source.js +86 -0
  111. package/dist/host/ui-slots.d.ts +8 -8
  112. package/dist/host/ui-slots.js +5 -3
  113. package/dist/mandates/useMandate.js +13 -0
  114. package/dist/public-chat/components/PublicMessageOptionsMenu.js +1 -1
  115. package/dist/store/create-chat-store.d.ts +4 -4
  116. package/dist/store/middlewares.d.ts +5 -5
  117. package/dist/store/slices.d.ts +1 -1
  118. package/dist/store/slices.js +4 -3
  119. package/dist/surfaces/redux/selectors.d.ts +2 -2
  120. package/dist/testing/turn-harness.d.ts +35 -0
  121. package/dist/testing/turn-harness.js +85 -0
  122. package/dist/tool-call-visualization/intelligence-places.js +1 -1
  123. package/dist/tool-call-visualization/redux/selectors.d.ts +1 -1
  124. package/dist/voice-agent/intelligence-places.js +6 -6
  125. package/package.json +9 -6
  126. package/dist/agents/model-registry/modelRegistrySlice.d.ts +0 -691
  127. package/dist/agents/model-registry/modelRegistrySlice.js +0 -574
  128. package/dist/host/model-class.d.ts +0 -33
  129. package/dist/host/model-class.js +0 -21
@@ -35,7 +35,7 @@
35
35
  import { type AgentAccessLevelRow } from "@ai-matrx/agents/runtime";
36
36
  import type { ChatDispatch, ChatRootState } from "../../../store/root-state.js";
37
37
  import type { Database } from "../../../host/db-types.js";
38
- import { type AIModelRecord } from "../../model-registry/modelRegistrySlice.js";
38
+ import type { AIModelRecord } from "../model-registry.js";
39
39
  export type AgentToolAssignmentRow = Pick<Database["agent"]["Tables"]["definition"]["Row"], "id" | "created_by" | "organization_id" | "version" | "tools" | "model_id" | "is_archived">;
40
40
  export declare class AgentToolAssignmentError extends Error {
41
41
  constructor(message: string);
@@ -557,7 +557,7 @@ export declare const loadAgentSettingsDirect: import("@reduxjs/toolkit").AsyncTh
557
557
  * Core model switch thunk — contains ALL the intelligence.
558
558
  *
559
559
  * Steps:
560
- * 1. Get new model from modelRegistry
560
+ * 1. Get new model from the model catalog's records
561
561
  * 2. Parse its controls → NormalizedControls
562
562
  * 3. Extract its defaults
563
563
  * 4. Get current effective settings from state
@@ -2,7 +2,7 @@ import { createSlice, createAsyncThunk } from "@reduxjs/toolkit";
2
2
  import { tryWriteOne } from "@ai-matrx/data/db";
3
3
  import { createClient } from "../../../host/db.js";
4
4
  import { recordUnavailable } from "../../../host/diagnostics.js";
5
- import { selectModelById } from "../model-registry.js";
5
+ import { readModelRecords, selectModelById } from "../model-registry.js";
6
6
  import {
7
7
  computeOverrideDiff,
8
8
  detectConflicts,
@@ -160,7 +160,8 @@ const requestModelSwitch = createAsyncThunk(
160
160
  offeringId
161
161
  }, { getState, rejectWithValue }) => {
162
162
  const state = getState();
163
- const newModel = selectModelById(state, newModelId);
163
+ const models = readModelRecords();
164
+ const newModel = selectModelById(models, newModelId);
164
165
  if (!newModel) {
165
166
  return rejectWithValue(`Model ${newModelId} not found in registry`);
166
167
  }
@@ -184,10 +185,7 @@ const requestModelSwitch = createAsyncThunk(
184
185
  newDefaults
185
186
  );
186
187
  const prevModelId = currentEffective.model ?? entry.defaults.model ?? "";
187
- const prevModel = selectModelById(
188
- state,
189
- prevModelId
190
- );
188
+ const prevModel = selectModelById(models, prevModelId);
191
189
  const prevModelName = prevModel?.common_name || prevModel?.name || prevModelId || "Unknown";
192
190
  const newModelName = newModel.common_name || newModel.name || newModelId;
193
191
  return {
@@ -7,7 +7,7 @@
7
7
  * All selectors are keyed by agentId for multi-agent support.
8
8
  */
9
9
  import type { ChatRootState as RootState } from "../../../store/root-state.js";
10
- import type { AgentSettings, AgentSettingsEntry, AgentVariable, AvailableTool, NormalizedControls, PendingModelSwitch } from "./types.js";
10
+ import type { AgentSettings, AgentSettingsEntry, AgentVariable, AvailableTool, PendingModelSwitch } from "./types.js";
11
11
  /**
12
12
  * Full entry for a given agentId. Returns undefined if not initialized.
13
13
  */
@@ -69,8 +69,8 @@ export declare const selectEffectiveSettings: ((state: {
69
69
  proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
70
70
  agentSettings: import("./types.js").AgentSettingsState;
71
71
  conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
72
- modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
73
72
  chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
73
+ hostConversations: import("../execution-system/host-conversations/host-conversations.slice.js").HostConversationsState;
74
74
  } & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => Partial<{
75
75
  model?: string | undefined;
76
76
  offering_id?: string | undefined;
@@ -2607,8 +2607,8 @@ export declare const selectEffectiveModelId: ((state: {
2607
2607
  proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
2608
2608
  agentSettings: import("./types.js").AgentSettingsState;
2609
2609
  conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
2610
- modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
2611
2610
  chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
2611
+ hostConversations: import("../execution-system/host-conversations/host-conversations.slice.js").HostConversationsState;
2612
2612
  } & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => string | null) & {
2613
2613
  clearCache: () => void;
2614
2614
  resultsCount: () => number;
@@ -2630,145 +2630,6 @@ export declare const selectEffectiveModelId: ((state: {
2630
2630
  memoize: typeof import("reselect").weakMapMemoize;
2631
2631
  argsMemoize: typeof import("reselect").weakMapMemoize;
2632
2632
  };
2633
- /**
2634
- * The display name for the effective model (common_name → name → id).
2635
- * Reads from modelRegistry.
2636
- */
2637
- export declare const selectEffectiveModelName: ((state: {
2638
- voiceAgent: import("../../../voice-agent/types.js").VoiceAgentState;
2639
- agentDefinition: import("../../types/agent-definition.types.js").AgentDefinitionSliceState;
2640
- conversationList: import("../conversation-list/conversation-list.types.js").ConversationListState;
2641
- conversationHistory: import("../conversation-history/index.js").ConversationHistoryState;
2642
- agentShortcut: import("../agent-shortcuts/types.js").AgentShortcutSliceState;
2643
- agentShortcutCategory: import("../agent-shortcut-categories/types.js").AgentShortcutCategorySliceState;
2644
- surfaceUserState: import("../../../surfaces/redux/userStateSlice.js").SurfaceUserStateSlice;
2645
- tools: import("../tools/tools.slice.js").ToolsSliceState;
2646
- conversations: import("../execution-system/conversations/conversations.slice.js").ConversationsState;
2647
- chatIncognito: import("../chat/chat-incognito.slice.js").ChatIncognitoState;
2648
- chatRoute: import("../chat/chat-route.slice.js").ChatRouteState;
2649
- instanceModelOverrides: import("../execution-system/instance-model-overrides/instance-model-overrides.slice.js").InstanceModelOverridesState;
2650
- instanceInputCapabilities: import("../execution-system/instance-input-capabilities/instance-input-capabilities.slice.js").InstanceInputCapabilitiesState;
2651
- instanceVariableValues: import("../execution-system/instance-variable-values/instance-variable-values.slice.js").InstanceVariableValuesState;
2652
- instanceResources: import("../execution-system/instance-resources/instance-resources.slice.js").InstanceResourcesState;
2653
- instanceContext: import("../execution-system/instance-context/instance-context.slice.js").InstanceContextState;
2654
- instanceWorkingDocument: import("../execution-system/instance-working-document/instance-working-document.slice.js").InstanceWorkingDocumentSliceState;
2655
- instanceUserInput: import("../execution-system/instance-user-input/instance-user-input.slice.js").InstanceUserInputSliceState;
2656
- instanceClientTools: import("../execution-system/instance-client-tools/instance-client-tools.slice.js").InstanceClientToolsState;
2657
- pendingAsks: import("../../ui-first-tools/redux/pending-asks.slice.js").PendingAsksState;
2658
- conversationInbox: import("../execution-system/inbox/inbox.slice.js").ConversationInboxState;
2659
- agentLists: import("../../ui-first-tools/redux/agent-lists.slice.js").AgentListsState;
2660
- instanceUIState: import("../execution-system/instance-ui-state/instance-ui-state.slice.js").InstanceUIStateSlice;
2661
- activeTools: import("../execution-system/active-tools/active-tools.slice.js").ActiveToolsState;
2662
- activeRequests: import("../execution-system/active-requests/active-requests.slice.js").ActiveRequestsState;
2663
- runSets: import("../execution-system/run-sets/run-sets.slice.js").RunSetsState;
2664
- messages: import("../execution-system/messages/messages.slice.js").MessagesState;
2665
- observability: import("../execution-system/observability/observability.slice.js").ObservabilityState;
2666
- contextState: import("../execution-system/context-state/context-state.slice.js").ContextStateSliceState;
2667
- observationalMemory: import("../execution-system/observational-memory/observational-memory.slice.js").ObservationalMemoryState;
2668
- cacheBypass: import("../execution-system/message-crud/cache-bypass.slice.js").CacheBypassState;
2669
- conversationFocus: import("../execution-system/conversation-focus/conversation-focus.slice.js").ConversationFocusState;
2670
- surfaces: import("../surfaces/surfaces.slice.js").SurfacesState;
2671
- surfacesCatalog: import("../../../surfaces/redux/surfacesCatalogSlice.js").SurfacesCatalogSliceState;
2672
- agentSurfaceBindings: import("../../../surfaces/redux/agentSurfaceBindingsSlice.js").AgentSurfaceBindingsSliceState;
2673
- surfaceConfig: import("../../../surfaces/redux/surfaceConfigSlice.js").SurfaceConfigSliceState;
2674
- agentAssistantMarkdownDraft: import("../agent-assistant-markdown-draft.slice.js").AgentAssistantMarkdownDraftState;
2675
- mcp: import("../mcp/mcp.slice.js").McpSliceState;
2676
- proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
2677
- agentSettings: import("./types.js").AgentSettingsState;
2678
- conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
2679
- modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
2680
- chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
2681
- } & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => string | null) & {
2682
- clearCache: () => void;
2683
- resultsCount: () => number;
2684
- resetResultsCount: () => void;
2685
- } & {
2686
- resultFunc: (resultFuncArgs_0: string | null, resultFuncArgs_1: Record<string, import("../model-registry.js").AIModelRecord>) => string | null;
2687
- memoizedResultFunc: ((resultFuncArgs_0: string | null, resultFuncArgs_1: Record<string, import("../model-registry.js").AIModelRecord>) => string | null) & {
2688
- clearCache: () => void;
2689
- resultsCount: () => number;
2690
- resetResultsCount: () => void;
2691
- };
2692
- lastResult: () => string | null;
2693
- dependencies: [(state: RootState, agentId: string) => string | null, (state: RootState) => Record<string, import("../model-registry.js").AIModelRecord>];
2694
- recomputations: () => number;
2695
- resetRecomputations: () => void;
2696
- dependencyRecomputations: () => number;
2697
- resetDependencyRecomputations: () => void;
2698
- } & {
2699
- memoize: typeof import("reselect").weakMapMemoize;
2700
- argsMemoize: typeof import("reselect").weakMapMemoize;
2701
- };
2702
- /**
2703
- * Parsed NormalizedControls for the effective model.
2704
- * Reads model.controls from modelRegistry and parses on demand.
2705
- * Memoized by modelId — only re-parses when the model changes.
2706
- */
2707
- export declare const selectNormalizedControls: ((state: {
2708
- voiceAgent: import("../../../voice-agent/types.js").VoiceAgentState;
2709
- agentDefinition: import("../../types/agent-definition.types.js").AgentDefinitionSliceState;
2710
- conversationList: import("../conversation-list/conversation-list.types.js").ConversationListState;
2711
- conversationHistory: import("../conversation-history/index.js").ConversationHistoryState;
2712
- agentShortcut: import("../agent-shortcuts/types.js").AgentShortcutSliceState;
2713
- agentShortcutCategory: import("../agent-shortcut-categories/types.js").AgentShortcutCategorySliceState;
2714
- surfaceUserState: import("../../../surfaces/redux/userStateSlice.js").SurfaceUserStateSlice;
2715
- tools: import("../tools/tools.slice.js").ToolsSliceState;
2716
- conversations: import("../execution-system/conversations/conversations.slice.js").ConversationsState;
2717
- chatIncognito: import("../chat/chat-incognito.slice.js").ChatIncognitoState;
2718
- chatRoute: import("../chat/chat-route.slice.js").ChatRouteState;
2719
- instanceModelOverrides: import("../execution-system/instance-model-overrides/instance-model-overrides.slice.js").InstanceModelOverridesState;
2720
- instanceInputCapabilities: import("../execution-system/instance-input-capabilities/instance-input-capabilities.slice.js").InstanceInputCapabilitiesState;
2721
- instanceVariableValues: import("../execution-system/instance-variable-values/instance-variable-values.slice.js").InstanceVariableValuesState;
2722
- instanceResources: import("../execution-system/instance-resources/instance-resources.slice.js").InstanceResourcesState;
2723
- instanceContext: import("../execution-system/instance-context/instance-context.slice.js").InstanceContextState;
2724
- instanceWorkingDocument: import("../execution-system/instance-working-document/instance-working-document.slice.js").InstanceWorkingDocumentSliceState;
2725
- instanceUserInput: import("../execution-system/instance-user-input/instance-user-input.slice.js").InstanceUserInputSliceState;
2726
- instanceClientTools: import("../execution-system/instance-client-tools/instance-client-tools.slice.js").InstanceClientToolsState;
2727
- pendingAsks: import("../../ui-first-tools/redux/pending-asks.slice.js").PendingAsksState;
2728
- conversationInbox: import("../execution-system/inbox/inbox.slice.js").ConversationInboxState;
2729
- agentLists: import("../../ui-first-tools/redux/agent-lists.slice.js").AgentListsState;
2730
- instanceUIState: import("../execution-system/instance-ui-state/instance-ui-state.slice.js").InstanceUIStateSlice;
2731
- activeTools: import("../execution-system/active-tools/active-tools.slice.js").ActiveToolsState;
2732
- activeRequests: import("../execution-system/active-requests/active-requests.slice.js").ActiveRequestsState;
2733
- runSets: import("../execution-system/run-sets/run-sets.slice.js").RunSetsState;
2734
- messages: import("../execution-system/messages/messages.slice.js").MessagesState;
2735
- observability: import("../execution-system/observability/observability.slice.js").ObservabilityState;
2736
- contextState: import("../execution-system/context-state/context-state.slice.js").ContextStateSliceState;
2737
- observationalMemory: import("../execution-system/observational-memory/observational-memory.slice.js").ObservationalMemoryState;
2738
- cacheBypass: import("../execution-system/message-crud/cache-bypass.slice.js").CacheBypassState;
2739
- conversationFocus: import("../execution-system/conversation-focus/conversation-focus.slice.js").ConversationFocusState;
2740
- surfaces: import("../surfaces/surfaces.slice.js").SurfacesState;
2741
- surfacesCatalog: import("../../../surfaces/redux/surfacesCatalogSlice.js").SurfacesCatalogSliceState;
2742
- agentSurfaceBindings: import("../../../surfaces/redux/agentSurfaceBindingsSlice.js").AgentSurfaceBindingsSliceState;
2743
- surfaceConfig: import("../../../surfaces/redux/surfaceConfigSlice.js").SurfaceConfigSliceState;
2744
- agentAssistantMarkdownDraft: import("../agent-assistant-markdown-draft.slice.js").AgentAssistantMarkdownDraftState;
2745
- mcp: import("../mcp/mcp.slice.js").McpSliceState;
2746
- proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
2747
- agentSettings: import("./types.js").AgentSettingsState;
2748
- conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
2749
- modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
2750
- chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
2751
- } & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => NormalizedControls | null) & {
2752
- clearCache: () => void;
2753
- resultsCount: () => number;
2754
- resetResultsCount: () => void;
2755
- } & {
2756
- resultFunc: (resultFuncArgs_0: import("../model-registry.js").AIModelRecord | null | undefined, resultFuncArgs_1: import("../../model-registry/modelRegistrySlice.js").ModelClassConfig | undefined) => NormalizedControls | null;
2757
- memoizedResultFunc: ((resultFuncArgs_0: import("../model-registry.js").AIModelRecord | null | undefined, resultFuncArgs_1: import("../../model-registry/modelRegistrySlice.js").ModelClassConfig | undefined) => NormalizedControls | null) & {
2758
- clearCache: () => void;
2759
- resultsCount: () => number;
2760
- resetResultsCount: () => void;
2761
- };
2762
- lastResult: () => NormalizedControls | null;
2763
- dependencies: [(state: RootState, agentId: string) => import("../model-registry.js").AIModelRecord | null | undefined, (state: RootState, agentId: string) => import("../../model-registry/modelRegistrySlice.js").ModelClassConfig | undefined];
2764
- recomputations: () => number;
2765
- resetRecomputations: () => void;
2766
- dependencyRecomputations: () => number;
2767
- resetDependencyRecomputations: () => void;
2768
- } & {
2769
- memoize: typeof import("reselect").weakMapMemoize;
2770
- argsMemoize: typeof import("reselect").weakMapMemoize;
2771
- };
2772
2633
  export declare const selectPendingSwitch: (state: RootState, agentId: string) => PendingModelSwitch | null;
2773
2634
  export declare const selectHasPendingSwitch: (state: RootState, agentId: string) => boolean;
2774
2635
  /**
@@ -2818,8 +2679,8 @@ export declare const selectPreviewedResolution: ((state: {
2818
2679
  proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
2819
2680
  agentSettings: import("./types.js").AgentSettingsState;
2820
2681
  conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
2821
- modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
2822
2682
  chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
2683
+ hostConversations: import("../execution-system/host-conversations/host-conversations.slice.js").HostConversationsState;
2823
2684
  } & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => Partial<{
2824
2685
  model?: string | undefined;
2825
2686
  offering_id?: string | undefined;
@@ -5357,8 +5218,8 @@ export declare const selectConflictActions: ((state: {
5357
5218
  proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
5358
5219
  agentSettings: import("./types.js").AgentSettingsState;
5359
5220
  conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
5360
- modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
5361
5221
  chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
5222
+ hostConversations: import("../execution-system/host-conversations/host-conversations.slice.js").HostConversationsState;
5362
5223
  } & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => Record<string, "keep" | "reset">) & {
5363
5224
  clearCache: () => void;
5364
5225
  resultsCount: () => number;
@@ -5425,8 +5286,8 @@ export declare const selectConflictSummary: ((state: {
5425
5286
  proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
5426
5287
  agentSettings: import("./types.js").AgentSettingsState;
5427
5288
  conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
5428
- modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
5429
5289
  chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
5290
+ hostConversations: import("../execution-system/host-conversations/host-conversations.slice.js").HostConversationsState;
5430
5291
  } & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => {
5431
5292
  totalConflicts: number;
5432
5293
  unsupportedCount: number;
@@ -5529,8 +5390,8 @@ export declare const selectApiPayload: ((state: {
5529
5390
  proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
5530
5391
  agentSettings: import("./types.js").AgentSettingsState;
5531
5392
  conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
5532
- modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
5533
5393
  chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
5394
+ hostConversations: import("../execution-system/host-conversations/host-conversations.slice.js").HostConversationsState;
5534
5395
  } & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => Partial<{
5535
5396
  model?: string | undefined;
5536
5397
  offering_id?: string | undefined;
@@ -8068,8 +7929,8 @@ export declare const selectOverriddenFields: ((state: {
8068
7929
  proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
8069
7930
  agentSettings: import("./types.js").AgentSettingsState;
8070
7931
  conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
8071
- modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
8072
7932
  chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
7933
+ hostConversations: import("../execution-system/host-conversations/host-conversations.slice.js").HostConversationsState;
8073
7934
  } & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => ("aspect_ratio" | "audio_format" | "background" | "camera_control" | "clear_thinking" | "compaction_settings" | "count" | "custom_tools" | "detected_contexts" | "dictionary" | "disable_reasoning" | "disable_safety_checker" | "duration" | "duration_seconds" | "encode_quality" | "enhance_prompt" | "fps" | "frame_images" | "generate_audio" | "guidance_scale" | "height" | "image_input" | "image_inputs" | "image_loras" | "include_thoughts" | "input_fidelity" | "internal_url_context" | "internal_web_search" | "internal_x_search" | "language_code" | "last_frame_image" | "mask" | "max_output_tokens" | "max_tokens" | "mcp_servers" | "model" | "moderation" | "n" | "negative_prompt" | "num_outputs" | "number_of_images" | "offering_id" | "output_compression" | "output_format" | "output_quality" | "parallel_tool_calls" | "partial_images" | "performance_direction" | "previous_interaction_id" | "quality" | "reasoning_effort" | "reasoning_summary" | "reference_images" | "reference_strength" | "render_quality" | "resolution" | "response_format" | "seconds" | "seed" | "speech_speed" | "steps" | "stop_sequences" | "store" | "stream" | "style" | "task" | "temperature" | "thinking_budget" | "thinking_level" | "tool_choice" | "top_k" | "top_p" | "tts_quality" | "tts_voice" | "turn_pause_ms" | "verbosity" | "video_action" | "video_input" | "visualization" | "width")[]) & {
8074
7935
  clearCache: () => void;
8075
7936
  resultsCount: () => number;
@@ -8881,8 +8742,8 @@ export declare const selectEffectiveVariableValues: ((state: {
8881
8742
  proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
8882
8743
  agentSettings: import("./types.js").AgentSettingsState;
8883
8744
  conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
8884
- modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
8885
8745
  chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
8746
+ hostConversations: import("../execution-system/host-conversations/host-conversations.slice.js").HostConversationsState;
8886
8747
  } & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => Record<string, string>) & {
8887
8748
  clearCache: () => void;
8888
8749
  resultsCount: () => number;
@@ -8956,8 +8817,8 @@ export declare const selectAgentStatus: ((state: {
8956
8817
  proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
8957
8818
  agentSettings: import("./types.js").AgentSettingsState;
8958
8819
  conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
8959
- modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
8960
8820
  chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
8821
+ hostConversations: import("../execution-system/host-conversations/host-conversations.slice.js").HostConversationsState;
8961
8822
  } & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => {
8962
8823
  isDirty: boolean;
8963
8824
  isLoading: boolean;
@@ -9050,8 +8911,8 @@ export declare const selectActiveEffectiveSettings: ((state: {
9050
8911
  proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
9051
8912
  agentSettings: import("./types.js").AgentSettingsState;
9052
8913
  conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
9053
- modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
9054
8914
  chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
8915
+ hostConversations: import("../execution-system/host-conversations/host-conversations.slice.js").HostConversationsState;
9055
8916
  } & import("../../../store/root-state.js").ChatHostReadSlices) => Partial<{
9056
8917
  model?: string | undefined;
9057
8918
  offering_id?: string | undefined;
@@ -10103,8 +9964,8 @@ export declare const selectActiveModelId: ((state: {
10103
9964
  proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
10104
9965
  agentSettings: import("./types.js").AgentSettingsState;
10105
9966
  conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
10106
- modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
10107
9967
  chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
9968
+ hostConversations: import("../execution-system/host-conversations/host-conversations.slice.js").HostConversationsState;
10108
9969
  } & import("../../../store/root-state.js").ChatHostReadSlices) => string | null) & {
10109
9970
  clearCache: () => void;
10110
9971
  resultsCount: () => number;
@@ -10169,8 +10030,8 @@ export declare const selectAllAgentIds: ((state: {
10169
10030
  proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
10170
10031
  agentSettings: import("./types.js").AgentSettingsState;
10171
10032
  conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
10172
- modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
10173
10033
  chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
10034
+ hostConversations: import("../execution-system/host-conversations/host-conversations.slice.js").HostConversationsState;
10174
10035
  } & import("../../../store/root-state.js").ChatHostReadSlices) => string[]) & {
10175
10036
  clearCache: () => void;
10176
10037
  resultsCount: () => number;
@@ -1,12 +1,9 @@
1
1
  import { createSelector } from "@reduxjs/toolkit";
2
- import { classConfigKey, selectModelById } from "../model-registry.js";
3
2
  import {
4
3
  buildApiPayload,
5
- effectiveOfferingPinOf,
6
4
  getActionForMode,
7
5
  mergeEffectiveSettings,
8
6
  mergeVariableValues,
9
- parseModelControls,
10
7
  resolveConflicts
11
8
  } from "./internal-utils.js";
12
9
  const EMPTY_SETTINGS = {};
@@ -32,40 +29,6 @@ const selectEffectiveModelId = createSelector(
32
29
  ],
33
30
  (overrideModelId, defaultModelId) => overrideModelId ?? defaultModelId ?? null
34
31
  );
35
- const selectEffectiveModelName = createSelector(
36
- [
37
- (state, agentId) => state.agentSettings?.entries[agentId]?.overrides?.model ?? state.agentSettings?.entries[agentId]?.defaults?.model ?? null,
38
- (state) => state.modelRegistry?.entities
39
- ],
40
- (modelId, entities) => {
41
- if (!modelId || !entities) return null;
42
- const model = entities[modelId];
43
- if (!model) return null;
44
- return model.common_name || model.name || model.id;
45
- }
46
- );
47
- const selectNormalizedControls = createSelector(
48
- [
49
- (state, agentId) => {
50
- const modelId = state.agentSettings?.entries[agentId]?.overrides?.model ?? state.agentSettings?.entries[agentId]?.defaults?.model ?? null;
51
- if (!modelId) return null;
52
- return selectModelById(state, modelId);
53
- },
54
- // The pinned CLASS's controls (loaded by useModelClassControls) — a model's
55
- // classes run through different APIs, so Lightning ≠ Fast.
56
- (state, agentId) => {
57
- const entry = state.agentSettings?.entries[agentId];
58
- const modelId = entry?.overrides?.model ?? entry?.defaults?.model;
59
- const pin = effectiveOfferingPinOf(entry);
60
- return pin && typeof modelId === "string" ? state.modelRegistry?.classConfigByOffering?.[classConfigKey(modelId, pin)] : void 0;
61
- }
62
- ],
63
- (model, classConfig) => {
64
- if (!model) return null;
65
- const controls = classConfig ? classConfig.controls : model.controls;
66
- return parseModelControls(controls);
67
- }
68
- );
69
32
  const selectPendingSwitch = (state, agentId) => state.agentSettings?.entries[agentId]?.pendingSwitch ?? null;
70
33
  const selectHasPendingSwitch = (state, agentId) => (state.agentSettings?.entries[agentId]?.pendingSwitch ?? null) !== null;
71
34
  const selectPreviewedResolution = createSelector(
@@ -249,7 +212,6 @@ export {
249
212
  selectContext,
250
213
  selectDefaults,
251
214
  selectEffectiveModelId,
252
- selectEffectiveModelName,
253
215
  selectEffectiveSettings,
254
216
  selectEffectiveVariableValues,
255
217
  selectEntry,
@@ -262,7 +224,6 @@ export {
262
224
  selectIsLoadingTools,
263
225
  selectIsSaving,
264
226
  selectLastFetchedAt,
265
- selectNormalizedControls,
266
227
  selectOverriddenFields,
267
228
  selectOverrides,
268
229
  selectPendingSwitch,
@@ -0,0 +1,8 @@
1
+ import type { NormalizedControls } from "./types.js";
2
+ /**
3
+ * Parsed controls for an agent-settings entry's effective model, from the model catalog's
4
+ * records: the pinned CLASS's controls when a pin is set and loaded (a model's classes run
5
+ * through different APIs, so Lightning ≠ Fast), else the model's own. Null until the record
6
+ * (full, with controls) is loaded.
7
+ */
8
+ export declare function useNormalizedControls(agentId: string): NormalizedControls | null;
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { useMemo } from "react";
3
+ import { selectModelById, selectModelClassConfig } from "@ai-matrx/agents/models";
4
+ import { useAppSelector } from "../../../store/hooks.js";
5
+ import { useModelRecords } from "../../identity/model-catalog.js";
6
+ import { effectiveOfferingPinOf, parseModelControls } from "./internal-utils.js";
7
+ function useNormalizedControls(agentId) {
8
+ const modelId = useAppSelector((state) => {
9
+ const entry = state.agentSettings?.entries[agentId];
10
+ const id = entry?.overrides?.model ?? entry?.defaults?.model;
11
+ return typeof id === "string" ? id : null;
12
+ });
13
+ const pin = useAppSelector((state) => effectiveOfferingPinOf(state.agentSettings?.entries[agentId]) ?? null);
14
+ const model = useModelRecords((s) => selectModelById(s, modelId));
15
+ const classConfig = useModelRecords((s) => selectModelClassConfig(s, modelId, pin));
16
+ return useMemo(() => {
17
+ if (!model) return null;
18
+ const controls = classConfig ? classConfig.controls : model.controls;
19
+ return parseModelControls(controls);
20
+ }, [model, classConfig]);
21
+ }
22
+ export {
23
+ useNormalizedControls
24
+ };