@ai-matrx/chat 0.3.32 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/agents/components/ambient-assistant/intelligence-places.js +2 -2
- package/dist/agents/components/chat/ChatConversationRoom.d.ts +7 -1
- package/dist/agents/components/chat/ChatConversationRoom.js +8 -2
- package/dist/agents/components/chat/intelligence-places.js +7 -7
- package/dist/agents/components/inputs/smart-input/RunToolPicker.js +7 -13
- package/dist/agents/components/inputs/smart-input/composer/ComposerAgentPill.js +3 -2
- package/dist/agents/components/inputs/smart-input/composer/useComposerAgent.js +5 -5
- package/dist/agents/components/inputs/smart-input/composer/useComposerAgentFilter.js +3 -2
- package/dist/agents/components/run-controls/RunConfigOverrides.js +10 -16
- package/dist/agents/components/run-controls/panels/shared.d.ts +0 -1
- package/dist/agents/hooks/useAgentModelLabel.js +4 -3
- package/dist/agents/hooks/useDiffEnrichment.js +3 -5
- package/dist/agents/hooks/useModelControls.d.ts +5 -161
- package/dist/agents/identity/model-catalog.d.ts +37 -0
- package/dist/agents/identity/model-catalog.js +103 -0
- package/dist/agents/redux/agent-definition/selectors.d.ts +0 -237
- package/dist/agents/redux/agent-definition/thunks.d.ts +1 -1
- package/dist/agents/redux/agent-settings/agentSettingsSlice.d.ts +1 -1
- package/dist/agents/redux/agent-settings/agentSettingsSlice.js +4 -6
- package/dist/agents/redux/agent-settings/selectors.d.ts +1 -152
- package/dist/agents/redux/agent-settings/selectors.js +0 -39
- package/dist/agents/redux/agent-settings/useNormalizedControls.d.ts +8 -0
- package/dist/agents/redux/agent-settings/useNormalizedControls.js +24 -0
- package/dist/agents/redux/agent-shortcut-categories/selectors.d.ts +0 -50
- package/dist/agents/redux/agent-shortcuts/selectors.d.ts +0 -147
- package/dist/agents/redux/conversation-history/selectors.d.ts +0 -16
- package/dist/agents/redux/conversation-list/conversation-list.selectors.d.ts +0 -2
- package/dist/agents/redux/execution-system/active-requests/active-requests.selectors.d.ts +0 -54
- package/dist/agents/redux/execution-system/context-state/context-state.selectors.d.ts +0 -14
- package/dist/agents/redux/execution-system/conversations/conversations.selectors.d.ts +0 -5
- package/dist/agents/redux/execution-system/instance-context/instance-context.selectors.d.ts +0 -3
- package/dist/agents/redux/execution-system/instance-resources/instance-resources.selectors.d.ts +0 -8
- package/dist/agents/redux/execution-system/instance-ui-state/instance-ui-state.selectors.d.ts +0 -5
- package/dist/agents/redux/execution-system/instance-variable-values/instance-variable-values.selectors.d.ts +0 -7
- package/dist/agents/redux/execution-system/messages/messages.selectors.d.ts +0 -1
- package/dist/agents/redux/execution-system/observability/observability.selectors.d.ts +0 -7
- package/dist/agents/redux/execution-system/observational-memory/observational-memory.selectors.d.ts +0 -1
- package/dist/agents/redux/execution-system/selectors/aggregate.selectors.d.ts +0 -14
- package/dist/agents/redux/execution-system/thunks/execute-manual-instance.thunk.js +2 -2
- package/dist/agents/redux/execution-system/thunks/launch-agent-execution.thunk.js +10 -2
- package/dist/agents/redux/execution-system/utils/required-organization.d.ts +14 -0
- package/dist/agents/redux/execution-system/utils/required-organization.js +4 -0
- package/dist/agents/redux/model-registry.d.ts +6 -4
- package/dist/agents/redux/model-registry.js +23 -5
- package/dist/agents/redux/proposed-directives/proposedDirectivesSlice.d.ts +0 -1
- package/dist/agents/redux/tools/tools.selectors.d.ts +0 -1
- package/dist/agents/runtime/generation-job.js +4 -7
- package/dist/agents/runtime/get-model-capabilities.js +3 -3
- package/dist/agents/ui-first-tools/redux/agent-lists.selectors.d.ts +0 -2
- package/dist/host/db-types.d.ts +276 -9
- package/dist/store/create-chat-store.d.ts +0 -2
- package/dist/store/middlewares.d.ts +0 -5
- package/dist/store/slices.d.ts +0 -1
- package/dist/store/slices.js +0 -2
- package/dist/surfaces/redux/selectors.d.ts +0 -2
- package/dist/tool-call-visualization/intelligence-places.js +1 -1
- package/dist/tool-call-visualization/redux/selectors.d.ts +0 -1
- package/dist/voice-agent/intelligence-places.js +6 -6
- package/package.json +4 -4
- package/dist/agents/model-registry/modelRegistrySlice.d.ts +0 -691
- package/dist/agents/model-registry/modelRegistrySlice.js +0 -574
- package/dist/host/model-class.d.ts +0 -33
- 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 {
|
|
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
|
|
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
|
|
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,
|
|
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,7 +69,6 @@ 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;
|
|
74
73
|
} & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => Partial<{
|
|
75
74
|
model?: string | undefined;
|
|
@@ -2607,7 +2606,6 @@ export declare const selectEffectiveModelId: ((state: {
|
|
|
2607
2606
|
proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
|
|
2608
2607
|
agentSettings: import("./types.js").AgentSettingsState;
|
|
2609
2608
|
conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
|
|
2610
|
-
modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
|
|
2611
2609
|
chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
|
|
2612
2610
|
} & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => string | null) & {
|
|
2613
2611
|
clearCache: () => void;
|
|
@@ -2630,145 +2628,6 @@ export declare const selectEffectiveModelId: ((state: {
|
|
|
2630
2628
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
2631
2629
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
2632
2630
|
};
|
|
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
2631
|
export declare const selectPendingSwitch: (state: RootState, agentId: string) => PendingModelSwitch | null;
|
|
2773
2632
|
export declare const selectHasPendingSwitch: (state: RootState, agentId: string) => boolean;
|
|
2774
2633
|
/**
|
|
@@ -2818,7 +2677,6 @@ export declare const selectPreviewedResolution: ((state: {
|
|
|
2818
2677
|
proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
|
|
2819
2678
|
agentSettings: import("./types.js").AgentSettingsState;
|
|
2820
2679
|
conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
|
|
2821
|
-
modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
|
|
2822
2680
|
chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
|
|
2823
2681
|
} & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => Partial<{
|
|
2824
2682
|
model?: string | undefined;
|
|
@@ -5357,7 +5215,6 @@ export declare const selectConflictActions: ((state: {
|
|
|
5357
5215
|
proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
|
|
5358
5216
|
agentSettings: import("./types.js").AgentSettingsState;
|
|
5359
5217
|
conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
|
|
5360
|
-
modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
|
|
5361
5218
|
chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
|
|
5362
5219
|
} & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => Record<string, "keep" | "reset">) & {
|
|
5363
5220
|
clearCache: () => void;
|
|
@@ -5425,7 +5282,6 @@ export declare const selectConflictSummary: ((state: {
|
|
|
5425
5282
|
proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
|
|
5426
5283
|
agentSettings: import("./types.js").AgentSettingsState;
|
|
5427
5284
|
conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
|
|
5428
|
-
modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
|
|
5429
5285
|
chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
|
|
5430
5286
|
} & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => {
|
|
5431
5287
|
totalConflicts: number;
|
|
@@ -5529,7 +5385,6 @@ export declare const selectApiPayload: ((state: {
|
|
|
5529
5385
|
proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
|
|
5530
5386
|
agentSettings: import("./types.js").AgentSettingsState;
|
|
5531
5387
|
conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
|
|
5532
|
-
modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
|
|
5533
5388
|
chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
|
|
5534
5389
|
} & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => Partial<{
|
|
5535
5390
|
model?: string | undefined;
|
|
@@ -8068,7 +7923,6 @@ export declare const selectOverriddenFields: ((state: {
|
|
|
8068
7923
|
proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
|
|
8069
7924
|
agentSettings: import("./types.js").AgentSettingsState;
|
|
8070
7925
|
conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
|
|
8071
|
-
modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
|
|
8072
7926
|
chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
|
|
8073
7927
|
} & 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
7928
|
clearCache: () => void;
|
|
@@ -8881,7 +8735,6 @@ export declare const selectEffectiveVariableValues: ((state: {
|
|
|
8881
8735
|
proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
|
|
8882
8736
|
agentSettings: import("./types.js").AgentSettingsState;
|
|
8883
8737
|
conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
|
|
8884
|
-
modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
|
|
8885
8738
|
chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
|
|
8886
8739
|
} & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => Record<string, string>) & {
|
|
8887
8740
|
clearCache: () => void;
|
|
@@ -8956,7 +8809,6 @@ export declare const selectAgentStatus: ((state: {
|
|
|
8956
8809
|
proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
|
|
8957
8810
|
agentSettings: import("./types.js").AgentSettingsState;
|
|
8958
8811
|
conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
|
|
8959
|
-
modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
|
|
8960
8812
|
chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
|
|
8961
8813
|
} & import("../../../store/root-state.js").ChatHostReadSlices, agentId: string) => {
|
|
8962
8814
|
isDirty: boolean;
|
|
@@ -9050,7 +8902,6 @@ export declare const selectActiveEffectiveSettings: ((state: {
|
|
|
9050
8902
|
proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
|
|
9051
8903
|
agentSettings: import("./types.js").AgentSettingsState;
|
|
9052
8904
|
conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
|
|
9053
|
-
modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
|
|
9054
8905
|
chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
|
|
9055
8906
|
} & import("../../../store/root-state.js").ChatHostReadSlices) => Partial<{
|
|
9056
8907
|
model?: string | undefined;
|
|
@@ -10103,7 +9954,6 @@ export declare const selectActiveModelId: ((state: {
|
|
|
10103
9954
|
proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
|
|
10104
9955
|
agentSettings: import("./types.js").AgentSettingsState;
|
|
10105
9956
|
conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
|
|
10106
|
-
modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
|
|
10107
9957
|
chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
|
|
10108
9958
|
} & import("../../../store/root-state.js").ChatHostReadSlices) => string | null) & {
|
|
10109
9959
|
clearCache: () => void;
|
|
@@ -10169,7 +10019,6 @@ export declare const selectAllAgentIds: ((state: {
|
|
|
10169
10019
|
proposedDirectives: import("../proposed-directives/proposedDirectivesSlice.js").ProposedDirectivesState;
|
|
10170
10020
|
agentSettings: import("./types.js").AgentSettingsState;
|
|
10171
10021
|
conversationAttachments: import("../../connectors/attachments.slice.js").AttachmentsSliceState;
|
|
10172
|
-
modelRegistry: import("../../model-registry/modelRegistrySlice.js").ModelRegistryState;
|
|
10173
10022
|
chatHost: import("../../../store/chat-host.slice.js").ChatHostState;
|
|
10174
10023
|
} & import("../../../store/root-state.js").ChatHostReadSlices) => string[]) & {
|
|
10175
10024
|
clearCache: () => void;
|
|
@@ -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
|
+
};
|