@ai-matrx/chat 0.5.18 → 0.6.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 +6 -0
- package/dist/agents/components/identity-refs/AiIdentityRef.d.ts +33 -0
- package/dist/agents/components/identity-refs/AiIdentityRef.js +138 -0
- package/dist/agents/components/inputs/smart-input/QuicksetPanel.js +5 -9
- package/dist/agents/components/inputs/smart-input/RunSkillPicker.js +1 -1
- package/dist/agents/components/inputs/smart-input/RunToolPicker.js +6 -11
- package/dist/agents/components/inputs/smart-input/ShapeChipsRow.js +1 -1
- package/dist/agents/components/inputs/smart-input/composer/ComposerEffortPill.js +1 -1
- package/dist/agents/components/inputs/smart-input/composer/ComposerOutput.js +1 -1
- package/dist/agents/components/inputs/smart-input/composer/ComposerPlusMenu.js +1 -1
- package/dist/agents/components/inputs/smart-input/composer/useComposerAgent.js +1 -1
- package/dist/agents/components/inputs/smart-input/composer/useRunControlCounts.d.ts +3 -0
- package/dist/agents/components/inputs/smart-input/composer/useRunControlCounts.js +54 -0
- package/dist/agents/components/model-tiers/ModelTierIdentityList.js +1 -1
- package/dist/agents/components/run-controls/RunConfigOverrides.js +1 -1
- package/dist/agents/components/run-controls/RunInputCapabilities.js +1 -1
- package/dist/agents/components/run-controls/panels/shared.d.ts +0 -2
- package/dist/agents/hooks/useDiffEnrichment.js +3 -6
- package/dist/agents/identity/agent-catalog-lists.js +2 -1
- package/dist/agents/identity/agent-identity.js +2 -1
- package/dist/agents/identity/model-catalog.d.ts +9 -0
- package/dist/agents/identity/model-catalog.js +25 -0
- package/dist/agents/identity/preferred-chat-model.d.ts +9 -0
- package/dist/agents/identity/preferred-chat-model.js +33 -0
- package/dist/agents/identity/settings-store.d.ts +10 -0
- package/dist/agents/identity/settings-store.js +49 -0
- package/dist/agents/identity/skill-catalog.d.ts +27 -0
- package/dist/agents/identity/skill-catalog.js +100 -0
- package/dist/agents/identity/tool-catalog.d.ts +15 -0
- package/dist/agents/identity/tool-catalog.js +67 -0
- package/dist/agents/redux/agent-definition/cache-bust-middleware.d.ts +0 -1
- package/dist/agents/redux/agent-definition/cache-bust-middleware.js +1 -13
- package/dist/agents/redux/agent-definition/selectors.d.ts +12 -546
- package/dist/agents/redux/agent-settings/internal-utils.d.ts +2 -123
- package/dist/agents/redux/agent-settings/internal-utils.js +1 -315
- package/dist/agents/redux/agent-settings/settings-catalogue.d.ts +2 -78
- package/dist/agents/redux/agent-settings/settings-catalogue.js +1 -176
- package/dist/agents/redux/agent-settings/types.d.ts +2 -148
- package/dist/agents/redux/agent-settings/types.js +1 -0
- package/dist/agents/redux/agent-settings/ui-gates.d.ts +2 -54
- package/dist/agents/redux/agent-settings/ui-gates.js +1 -38
- package/dist/agents/redux/agent-shortcut-categories/selectors.d.ts +0 -100
- package/dist/agents/redux/agent-shortcuts/selectors.d.ts +0 -294
- package/dist/agents/redux/conversation-history/selectors.d.ts +0 -32
- package/dist/agents/redux/conversation-list/conversation-list.selectors.d.ts +0 -4
- package/dist/agents/redux/execution-system/active-requests/active-requests.selectors.d.ts +0 -108
- package/dist/agents/redux/execution-system/context-state/context-state.selectors.d.ts +0 -28
- package/dist/agents/redux/execution-system/conversations/conversations.selectors.d.ts +0 -10
- package/dist/agents/redux/execution-system/instance-context/instance-context.selectors.d.ts +0 -6
- package/dist/agents/redux/execution-system/instance-model-overrides/launch-model-overrides.js +1 -1
- package/dist/agents/redux/execution-system/instance-resources/instance-resources.selectors.d.ts +0 -16
- package/dist/agents/redux/execution-system/instance-ui-state/instance-ui-state.selectors.d.ts +0 -10
- package/dist/agents/redux/execution-system/instance-variable-values/instance-variable-values.selectors.d.ts +0 -14
- package/dist/agents/redux/execution-system/messages/messages.selectors.d.ts +0 -2
- package/dist/agents/redux/execution-system/observability/observability.selectors.d.ts +0 -14
- package/dist/agents/redux/execution-system/observational-memory/observational-memory.selectors.d.ts +0 -2
- package/dist/agents/redux/execution-system/selectors/aggregate.selectors.d.ts +0 -28
- package/dist/agents/redux/execution-system/thunks/process-stream.js +2 -5
- package/dist/agents/redux/execution-system/utils/loaded-skill-sources.d.ts +1 -1
- package/dist/agents/redux/execution-system/utils/loaded-skill-sources.js +3 -3
- package/dist/agents/redux/proposed-directives/proposedDirectivesSlice.d.ts +0 -2
- package/dist/agents/ui-first-tools/redux/agent-lists.selectors.d.ts +0 -4
- package/dist/host/ui-slots.d.ts +0 -46
- package/dist/host/ui-slots.js +0 -33
- package/dist/store/create-chat-store.d.ts +0 -4
- package/dist/store/middlewares.d.ts +0 -10
- package/dist/store/slices.d.ts +0 -2
- package/dist/store/slices.js +0 -4
- package/dist/surfaces/redux/selectors.d.ts +0 -4
- package/dist/tool-call-visualization/redux/selectors.d.ts +0 -2
- package/dist/ui/chat-default-model-knob.d.ts +1 -1
- package/dist/ui/chat-default-model-knob.js +1 -1
- package/package.json +4 -4
- package/dist/agents/components/model/AgentModelPanel.d.ts +0 -4
- package/dist/agents/components/model/AgentModelPanel.js +0 -9
- package/dist/agents/redux/agent-settings/agentSettingsSlice.d.ts +0 -1015
- package/dist/agents/redux/agent-settings/agentSettingsSlice.js +0 -659
- package/dist/agents/redux/agent-settings/selectors.d.ts +0 -10057
- package/dist/agents/redux/agent-settings/selectors.js +0 -234
- package/dist/agents/redux/agent-settings/useNormalizedControls.d.ts +0 -8
- package/dist/agents/redux/agent-settings/useNormalizedControls.js +0 -24
- package/dist/agents/redux/tools/tools.selectors.d.ts +0 -529
- package/dist/agents/redux/tools/tools.selectors.js +0 -24
- package/dist/agents/redux/tools/tools.slice.d.ts +0 -12
- package/dist/agents/redux/tools/tools.slice.js +0 -37
- package/dist/agents/redux/tools/tools.thunks.d.ts +0 -125
- package/dist/agents/redux/tools/tools.thunks.js +0 -45
- package/dist/host/defaults/setting-control-input.d.ts +0 -11
- package/dist/host/defaults/setting-control-input.js +0 -91
|
@@ -1,176 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { humanizeIdentifier } from "@ai-matrx/kit/text-case";
|
|
3
|
-
const CONTROL_TYPES = [
|
|
4
|
-
"number",
|
|
5
|
-
"integer",
|
|
6
|
-
"boolean",
|
|
7
|
-
"string",
|
|
8
|
-
"enum",
|
|
9
|
-
"array",
|
|
10
|
-
"string_array",
|
|
11
|
-
"object_array"
|
|
12
|
-
];
|
|
13
|
-
function isControlDefinitionShape(value) {
|
|
14
|
-
return typeof value.type === "string" && CONTROL_TYPES.includes(value.type);
|
|
15
|
-
}
|
|
16
|
-
const TEXT_GROUP = [
|
|
17
|
-
{ key: "response_format", label: "Response Format" },
|
|
18
|
-
{ key: "stop_sequences", label: "Stop Sequences" },
|
|
19
|
-
{ key: "temperature", label: "Temperature" },
|
|
20
|
-
{ key: "max_output_tokens", label: "Max Output Tokens" },
|
|
21
|
-
{ key: "top_p", label: "Top P" },
|
|
22
|
-
{ key: "top_k", label: "Top K" },
|
|
23
|
-
{ key: "thinking_budget", label: "Thinking Budget" },
|
|
24
|
-
{ key: "thinking_level", label: "Thinking Level" },
|
|
25
|
-
{ key: "reasoning_effort", label: "Reasoning Effort" },
|
|
26
|
-
{ key: "reasoning_summary", label: "Reasoning Summary" },
|
|
27
|
-
// Deep Research agents: charts and images inside the report.
|
|
28
|
-
{ key: "visualization", label: "Charts and Images" },
|
|
29
|
-
{ key: "verbosity", label: "Verbosity" },
|
|
30
|
-
{ key: "tool_choice", label: "Tool Choice" }
|
|
31
|
-
];
|
|
32
|
-
const FEATURE_FLAGS_GROUP = [
|
|
33
|
-
{ key: "stream", label: "Stream Response" },
|
|
34
|
-
{ key: "store", label: "Store Conversation" },
|
|
35
|
-
{ key: "parallel_tool_calls", label: "Parallel Tool Calls" },
|
|
36
|
-
{ key: "include_thoughts", label: "Include Thoughts" },
|
|
37
|
-
{ key: "internal_web_search", label: "Internal Web Search" },
|
|
38
|
-
{ key: "internal_url_context", label: "Internal URL Context" },
|
|
39
|
-
{ key: "disable_safety_checker", label: "Disable Safety Checker" },
|
|
40
|
-
{ key: "clear_thinking", label: "Clear Thinking" },
|
|
41
|
-
{ key: "disable_reasoning", label: "Disable Reasoning" },
|
|
42
|
-
{ key: "generate_audio", label: "Generate Audio" },
|
|
43
|
-
{ key: "enhance_prompt", label: "Enhance Prompt" },
|
|
44
|
-
{ key: "include_rai_reason", label: "Include RAI Reason" }
|
|
45
|
-
];
|
|
46
|
-
const IMAGE_VIDEO_GROUP = [
|
|
47
|
-
{ key: "size", label: "Size" },
|
|
48
|
-
{ key: "quality", label: "Quality" },
|
|
49
|
-
{ key: "count", label: "Count" },
|
|
50
|
-
{ key: "steps", label: "Steps" },
|
|
51
|
-
{ key: "guidance_scale", label: "Guidance Scale" },
|
|
52
|
-
{ key: "seed", label: "Seed" },
|
|
53
|
-
{ key: "width", label: "Width" },
|
|
54
|
-
{ key: "height", label: "Height" },
|
|
55
|
-
{ key: "fps", label: "FPS" },
|
|
56
|
-
{ key: "seconds", label: "Duration (s) [legacy string]" },
|
|
57
|
-
{ key: "output_quality", label: "Output Quality" },
|
|
58
|
-
{ key: "negative_prompt", label: "Negative Prompt" },
|
|
59
|
-
{ key: "aspect_ratio", label: "Aspect Ratio" },
|
|
60
|
-
{ key: "ratio", label: "Aspect Ratio (Together/Runway)" },
|
|
61
|
-
{ key: "resolution", label: "Resolution" },
|
|
62
|
-
{ key: "image_size", label: "Image Size" },
|
|
63
|
-
{ key: "num_outputs", label: "Outputs" },
|
|
64
|
-
{ key: "number_of_images", label: "Number of Images" },
|
|
65
|
-
{ key: "render_quality", label: "Render Quality" },
|
|
66
|
-
{ key: "background", label: "Background" },
|
|
67
|
-
{ key: "input_fidelity", label: "Input Fidelity" },
|
|
68
|
-
{ key: "output_compression", label: "Output Compression" },
|
|
69
|
-
{ key: "moderation", label: "Moderation" },
|
|
70
|
-
{ key: "partial_images", label: "Partial Images" },
|
|
71
|
-
{ key: "output_mime_type", label: "Output MIME Type" },
|
|
72
|
-
{ key: "person_generation", label: "Person Generation" },
|
|
73
|
-
{ key: "image_format", label: "Image Format" },
|
|
74
|
-
{ key: "style", label: "Style" },
|
|
75
|
-
{ key: "reference_strength", label: "Reference Strength" },
|
|
76
|
-
{ key: "duration_seconds", label: "Duration (s)" },
|
|
77
|
-
{ key: "duration", label: "Duration" },
|
|
78
|
-
{ key: "encode_quality", label: "Encode Quality" },
|
|
79
|
-
{ key: "video_action", label: "Video Action" },
|
|
80
|
-
{ key: "reference_images", label: "Reference Images" },
|
|
81
|
-
{ key: "frame_images", label: "Frame Images" },
|
|
82
|
-
{ key: "image_loras", label: "Image LoRAs" }
|
|
83
|
-
];
|
|
84
|
-
const AUDIO_GROUP = [
|
|
85
|
-
{ key: "tts_voice", label: "Voice" },
|
|
86
|
-
{ key: "performance_direction", label: "Performance Direction" },
|
|
87
|
-
{ key: "speech_speed", label: "Speed" },
|
|
88
|
-
{ key: "turn_pause_ms", label: "Pause Between Turns (ms)" },
|
|
89
|
-
{ key: "language_code", label: "Language" },
|
|
90
|
-
{ key: "audio_format", label: "Audio Format" }
|
|
91
|
-
];
|
|
92
|
-
const SETTINGS_CATALOGUE = [
|
|
93
|
-
{ id: "text", label: "", entries: TEXT_GROUP },
|
|
94
|
-
{ id: "featureFlags", label: "Feature Flags", entries: FEATURE_FLAGS_GROUP },
|
|
95
|
-
{ id: "imageVideo", label: "Image / Video Settings", entries: IMAGE_VIDEO_GROUP },
|
|
96
|
-
{ id: "audio", label: "Audio Settings", entries: AUDIO_GROUP }
|
|
97
|
-
];
|
|
98
|
-
const CATALOGUE_KEYS = new Set(
|
|
99
|
-
SETTINGS_CATALOGUE.flatMap((g) => g.entries.map((e) => e.key))
|
|
100
|
-
);
|
|
101
|
-
const CATCHALL_EXCLUDED = /* @__PURE__ */ new Set([
|
|
102
|
-
"rawControls",
|
|
103
|
-
"unmappedControls",
|
|
104
|
-
"model_id",
|
|
105
|
-
"model",
|
|
106
|
-
// chosen via the dedicated model picker, never a generic settings row
|
|
107
|
-
"multi_speaker",
|
|
108
|
-
// edited via the Voice editor alongside tts_voice
|
|
109
|
-
// Model-gated UI flags live in the ui_gates column + UiGatesEditor, never as
|
|
110
|
-
// settings rows — even when the model declares them as controls (e.g. every
|
|
111
|
-
// model now declares `tools` for the tool-support capability).
|
|
112
|
-
...UI_GATE_KEYS
|
|
113
|
-
]);
|
|
114
|
-
function lookupControl(controls, key) {
|
|
115
|
-
if (!controls) return null;
|
|
116
|
-
if (CATCHALL_EXCLUDED.has(key)) {
|
|
117
|
-
if (key === "rawControls" || key === "unmappedControls") return null;
|
|
118
|
-
}
|
|
119
|
-
const candidate = controls[key];
|
|
120
|
-
if (candidate && typeof candidate === "object" && !Array.isArray(candidate)) {
|
|
121
|
-
const c = candidate;
|
|
122
|
-
if (isControlDefinitionShape(c)) {
|
|
123
|
-
return c;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
function hasMeaningfulValue(settings, key) {
|
|
129
|
-
if (!settings) return false;
|
|
130
|
-
const v = settings[key];
|
|
131
|
-
return v !== void 0 && v !== null;
|
|
132
|
-
}
|
|
133
|
-
function buildSettingsRows(controls, settings) {
|
|
134
|
-
const groups = SETTINGS_CATALOGUE.map((group) => ({
|
|
135
|
-
id: group.id,
|
|
136
|
-
label: group.label,
|
|
137
|
-
rows: group.entries.flatMap((entry) => {
|
|
138
|
-
const control = lookupControl(controls, entry.key);
|
|
139
|
-
if (!control) return [];
|
|
140
|
-
return [
|
|
141
|
-
{
|
|
142
|
-
key: entry.key,
|
|
143
|
-
label: entry.label,
|
|
144
|
-
group: group.id,
|
|
145
|
-
control,
|
|
146
|
-
supported: true,
|
|
147
|
-
hasValue: hasMeaningfulValue(settings, entry.key)
|
|
148
|
-
}
|
|
149
|
-
];
|
|
150
|
-
})
|
|
151
|
-
}));
|
|
152
|
-
const declaredExtra = [];
|
|
153
|
-
if (controls) {
|
|
154
|
-
for (const key of Object.keys(controls)) {
|
|
155
|
-
if (CATALOGUE_KEYS.has(key) || CATCHALL_EXCLUDED.has(key)) continue;
|
|
156
|
-
if (lookupControl(controls, key)) declaredExtra.push(key);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
if (declaredExtra.length > 0) {
|
|
160
|
-
const rows = declaredExtra.sort().map((key) => ({
|
|
161
|
-
key,
|
|
162
|
-
label: humanizeIdentifier(key),
|
|
163
|
-
group: "other",
|
|
164
|
-
control: lookupControl(controls, key),
|
|
165
|
-
supported: true,
|
|
166
|
-
hasValue: hasMeaningfulValue(settings, key)
|
|
167
|
-
}));
|
|
168
|
-
groups.push({ id: "other", label: "Other Settings", rows });
|
|
169
|
-
}
|
|
170
|
-
return groups;
|
|
171
|
-
}
|
|
172
|
-
export {
|
|
173
|
-
CATALOGUE_KEYS,
|
|
174
|
-
SETTINGS_CATALOGUE,
|
|
175
|
-
buildSettingsRows
|
|
176
|
-
};
|
|
1
|
+
export * from "@ai-matrx/agents/settings";
|
|
@@ -1,148 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* All field names are snake_case to match the Python backend exactly.
|
|
5
|
-
* This is the single canonical type used across all contexts:
|
|
6
|
-
* - Prompt Builder (defaults only, no override tracking)
|
|
7
|
-
* - Chat (overrides tracked separately from agent defaults)
|
|
8
|
-
* - Test (multiple agents simultaneously, all in memory)
|
|
9
|
-
*/
|
|
10
|
-
import type { VariableCustomComponent } from "../../types/agent-definition.types.js";
|
|
11
|
-
import type { LLMParams } from "../../types/agent-api-types.js";
|
|
12
|
-
/**
|
|
13
|
-
* Agent model settings are the generated server contract—never a handwritten
|
|
14
|
-
* subset or frontend extension. UI-only input capabilities live in UiGates and
|
|
15
|
-
* runtime attachment state; selected tools live in the client-tools slice.
|
|
16
|
-
*/
|
|
17
|
-
export type AgentSettings = LLMParams;
|
|
18
|
-
export type ControlType = "number" | "integer" | "boolean" | "string" | "enum" | "array" | "string_array" | "object_array";
|
|
19
|
-
export interface ControlDefinition {
|
|
20
|
-
type: ControlType;
|
|
21
|
-
min?: number;
|
|
22
|
-
max?: number;
|
|
23
|
-
default?: unknown;
|
|
24
|
-
enum?: string[];
|
|
25
|
-
required?: boolean;
|
|
26
|
-
/** True when the control is an "allowed" feature flag (not a submission param) */
|
|
27
|
-
isFeatureFlag?: boolean;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Parsed capability map for a model. Keyed by AgentSettings field names (snake_case).
|
|
31
|
-
* Always has rawControls and unmappedControls for debugging.
|
|
32
|
-
*/
|
|
33
|
-
export type NormalizedControls = Partial<Record<keyof AgentSettings, ControlDefinition>> & {
|
|
34
|
-
/** Frontend capability declarations from model controls, never API params. */
|
|
35
|
-
tools?: ControlDefinition;
|
|
36
|
-
image_urls?: ControlDefinition;
|
|
37
|
-
file_urls?: ControlDefinition;
|
|
38
|
-
youtube_videos?: ControlDefinition;
|
|
39
|
-
rawControls: Record<string, unknown>;
|
|
40
|
-
unmappedControls: Record<string, unknown>;
|
|
41
|
-
};
|
|
42
|
-
export type ConflictReason = "unsupported_key" | "value_out_of_range" | "invalid_enum_value";
|
|
43
|
-
export interface ConflictItem {
|
|
44
|
-
key: keyof AgentSettings;
|
|
45
|
-
currentValue: unknown;
|
|
46
|
-
newModelDefault: unknown;
|
|
47
|
-
reason: ConflictReason;
|
|
48
|
-
description: string;
|
|
49
|
-
/** If the new model uses a different parameter name for the same concept */
|
|
50
|
-
aliasHint?: string;
|
|
51
|
-
}
|
|
52
|
-
export type ResolutionMode = "keep_all" | "auto_resolve" | "remove_only" | "custom";
|
|
53
|
-
export type ConflictAction = "keep" | "reset";
|
|
54
|
-
/**
|
|
55
|
-
* All state needed to present and resolve a pending model switch.
|
|
56
|
-
* Lives in Redux state until the user confirms or cancels.
|
|
57
|
-
*/
|
|
58
|
-
export interface PendingModelSwitch {
|
|
59
|
-
prevModelId: string;
|
|
60
|
-
prevModelName: string;
|
|
61
|
-
newModelId: string;
|
|
62
|
-
newModelName: string;
|
|
63
|
-
conflicts: ConflictItem[];
|
|
64
|
-
/** Keys from current settings that are fully compatible with the new model */
|
|
65
|
-
supportedKeys: Array<keyof AgentSettings>;
|
|
66
|
-
newModelControls: NormalizedControls;
|
|
67
|
-
mode: ResolutionMode;
|
|
68
|
-
/** Per-conflict override when mode === 'custom' */
|
|
69
|
-
customActions: Partial<Record<keyof AgentSettings, ConflictAction>>;
|
|
70
|
-
/**
|
|
71
|
-
* The CLASS (offering) picked with the new model, applied on confirm.
|
|
72
|
-
* Absent = no class picked → the old model's pin is dropped on confirm (a
|
|
73
|
-
* class belongs to exactly one model). Never written before confirm, so the
|
|
74
|
-
* entry never pairs the old model with the new model's class.
|
|
75
|
-
*/
|
|
76
|
-
offeringId?: string;
|
|
77
|
-
}
|
|
78
|
-
export interface AgentVariable {
|
|
79
|
-
name: string;
|
|
80
|
-
defaultValue: string;
|
|
81
|
-
customComponent?: VariableCustomComponent;
|
|
82
|
-
required?: boolean;
|
|
83
|
-
helpText?: string;
|
|
84
|
-
}
|
|
85
|
-
export type AgentSource = "prompt" | "builtin";
|
|
86
|
-
export type AgentContext = "builder" | "chat" | "test";
|
|
87
|
-
export interface AgentSettingsEntry {
|
|
88
|
-
agentId: string;
|
|
89
|
-
source: AgentSource;
|
|
90
|
-
context: AgentContext;
|
|
91
|
-
/**
|
|
92
|
-
* The agent's persisted configuration loaded from the DB.
|
|
93
|
-
* In 'builder' context, user edits mutate this directly.
|
|
94
|
-
* In 'chat'/'test' contexts, this is read-only — changes go to overrides.
|
|
95
|
-
*/
|
|
96
|
-
defaults: AgentSettings;
|
|
97
|
-
/**
|
|
98
|
-
* User-made changes that differ from defaults.
|
|
99
|
-
* Only populated in 'chat' and 'test' contexts.
|
|
100
|
-
* In 'builder' context, always empty (edits go directly to defaults).
|
|
101
|
-
*/
|
|
102
|
-
overrides: Partial<AgentSettings>;
|
|
103
|
-
/**
|
|
104
|
-
* Variable defaults — from the separate `variable_defaults` DB column.
|
|
105
|
-
* NOT inside the settings JSONB blob.
|
|
106
|
-
*/
|
|
107
|
-
variable_defaults: AgentVariable[];
|
|
108
|
-
/**
|
|
109
|
-
* Variable value overrides — used in 'chat'/'test' contexts.
|
|
110
|
-
* Maps variable name → current value. Never saved to DB.
|
|
111
|
-
*/
|
|
112
|
-
variable_overrides: Record<string, string>;
|
|
113
|
-
/**
|
|
114
|
-
* A pending model switch awaiting user confirmation.
|
|
115
|
-
* Populated by requestModelSwitch thunk, cleared by confirm/cancel.
|
|
116
|
-
*/
|
|
117
|
-
pendingSwitch: PendingModelSwitch | null;
|
|
118
|
-
isDirty: boolean;
|
|
119
|
-
isLoading: boolean;
|
|
120
|
-
isSaving: boolean;
|
|
121
|
-
error: string | null;
|
|
122
|
-
lastFetchedAt: string | null;
|
|
123
|
-
}
|
|
124
|
-
/** Minimal tool shape stored in the slice — matches the DB `tools` table */
|
|
125
|
-
export interface AvailableTool {
|
|
126
|
-
id: string;
|
|
127
|
-
name: string;
|
|
128
|
-
description: string;
|
|
129
|
-
category?: string;
|
|
130
|
-
icon?: string;
|
|
131
|
-
}
|
|
132
|
-
export interface AgentSettingsState {
|
|
133
|
-
entries: Record<string, AgentSettingsEntry>;
|
|
134
|
-
/** The agentId currently "focused" in the UI (for shortcut selectors) */
|
|
135
|
-
activeAgentId: string | null;
|
|
136
|
-
/** All active tools fetched from Supabase — shared across all agents */
|
|
137
|
-
availableTools: AvailableTool[];
|
|
138
|
-
isLoadingTools: boolean;
|
|
139
|
-
toolsError: string | null;
|
|
140
|
-
}
|
|
141
|
-
/** Shape of a raw Supabase row from `prompts` or `agent.definition` (was `prompt_builtins`).
|
|
142
|
-
* Note: agent.definition uses `variable_definitions` (mapped to `variable_defaults` at load time). */
|
|
143
|
-
export interface RawAgentDbRow {
|
|
144
|
-
id: string;
|
|
145
|
-
settings: AgentSettings | null;
|
|
146
|
-
variable_defaults: AgentVariable[] | null;
|
|
147
|
-
[key: string]: unknown;
|
|
148
|
-
}
|
|
1
|
+
/** Agent settings live in the agent core (B4): `@ai-matrx/agents/settings`. */
|
|
2
|
+
export * from "@ai-matrx/agents/settings";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ai-matrx/agents/settings";
|
|
@@ -1,54 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* FE-ONLY. These flags NEVER reach the server. They gate what the chat / agent
|
|
5
|
-
* builder UI exposes for the currently-selected model (e.g. whether to offer the
|
|
6
|
-
* image-URL, file-URL or YouTube attachment inputs) — which in turn shapes the
|
|
7
|
-
* request the client constructs. The flags themselves are not model parameters,
|
|
8
|
-
* so the backend neither receives nor cares about them.
|
|
9
|
-
*
|
|
10
|
-
* Persisted in the dedicated `agx_agent.ui_gates` / `agx_version.ui_gates` jsonb
|
|
11
|
-
* column — NEVER inside `settings` (which holds only server-consumed params).
|
|
12
|
-
*
|
|
13
|
-
* This module is the SINGLE SOURCE OF TRUTH that replaced the `UI_CAPABILITY_KEYS`
|
|
14
|
-
* sets formerly copy-pasted across the execution selectors, the manual-execute
|
|
15
|
-
* thunk, the validation rules/resolve-config, and the model-controls parser.
|
|
16
|
-
* The concept is intentionally generic and open to growth: any future
|
|
17
|
-
* "show X in the UI when the model supports it" affordance lands here.
|
|
18
|
-
*/
|
|
19
|
-
import { z } from "zod";
|
|
20
|
-
/**
|
|
21
|
-
* UI-only agent/run configuration. This schema is the source of truth for the
|
|
22
|
-
* persisted `ui_gates` JSONB boundary; never mirror it with an interface.
|
|
23
|
-
* New product UI capabilities are added here, never to the Python parameter
|
|
24
|
-
* contract. Unknown persisted keys are stripped at this boundary.
|
|
25
|
-
*/
|
|
26
|
-
export declare const uiGatesSchema: z.ZodObject<{
|
|
27
|
-
tools: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
-
image_urls: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
-
file_urls: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
-
youtube_videos: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
-
}, z.core.$strip>;
|
|
32
|
-
export type UiGates = z.infer<typeof uiGatesSchema>;
|
|
33
|
-
/** Parse persisted/UI-boundary data. Invalid shapes fail loudly. */
|
|
34
|
-
export declare function parseUiGates(value: unknown): UiGates;
|
|
35
|
-
/** Every gate key the UI currently understands. Extend here, nowhere else. */
|
|
36
|
-
export declare const UI_GATE_KEYS: readonly ["tools", "image_urls", "file_urls", "youtube_videos"];
|
|
37
|
-
export type UiGateKey = (typeof UI_GATE_KEYS)[number];
|
|
38
|
-
/**
|
|
39
|
-
* The gates a USER toggles per-agent (the chat-attachment affordances).
|
|
40
|
-
*
|
|
41
|
-
* `tools` is intentionally **excluded**: tool support is a MODEL capability
|
|
42
|
-
* (resolved from `ai_model.controls.tools` via `supportsTools` in
|
|
43
|
-
* `useModelControls`), not a per-agent UI gate. `tools` remains in
|
|
44
|
-
* `UI_GATE_KEYS` so any legacy `ui_gates.tools` value is still recognized and
|
|
45
|
-
* stripped before the API call — it is just never offered as an editable toggle.
|
|
46
|
-
*/
|
|
47
|
-
export declare const UI_GATE_EDITABLE_KEYS: readonly ["image_urls", "file_urls", "youtube_videos"];
|
|
48
|
-
export type UiGateEditableKey = (typeof UI_GATE_EDITABLE_KEYS)[number];
|
|
49
|
-
/** True when `key` is a model-gated UI flag (belongs in ui_gates, not settings). */
|
|
50
|
-
export declare function isUiGateKey(key: string): boolean;
|
|
51
|
-
/** The empty default — a record with no gates set. */
|
|
52
|
-
export declare const EMPTY_UI_GATES: UiGates;
|
|
53
|
-
/** Read a single gate as a strict boolean (absent ⇒ false). */
|
|
54
|
-
export declare function gateEnabled(gates: UiGates | null | undefined, key: UiGateKey): boolean;
|
|
1
|
+
/** Agent settings live in the agent core (B4): `@ai-matrx/agents/settings`. */
|
|
2
|
+
export * from "@ai-matrx/agents/settings";
|
|
@@ -1,38 +1 @@
|
|
|
1
|
-
|
|
2
|
-
const uiGatesSchema = z.object({
|
|
3
|
-
tools: z.boolean().optional(),
|
|
4
|
-
image_urls: z.boolean().optional(),
|
|
5
|
-
file_urls: z.boolean().optional(),
|
|
6
|
-
youtube_videos: z.boolean().optional()
|
|
7
|
-
});
|
|
8
|
-
function parseUiGates(value) {
|
|
9
|
-
return uiGatesSchema.parse(value ?? {});
|
|
10
|
-
}
|
|
11
|
-
const UI_GATE_KEYS = [
|
|
12
|
-
"tools",
|
|
13
|
-
"image_urls",
|
|
14
|
-
"file_urls",
|
|
15
|
-
"youtube_videos"
|
|
16
|
-
];
|
|
17
|
-
const UI_GATE_EDITABLE_KEYS = [
|
|
18
|
-
"image_urls",
|
|
19
|
-
"file_urls",
|
|
20
|
-
"youtube_videos"
|
|
21
|
-
];
|
|
22
|
-
const UI_GATE_KEY_SET = new Set(UI_GATE_KEYS);
|
|
23
|
-
function isUiGateKey(key) {
|
|
24
|
-
return UI_GATE_KEY_SET.has(key);
|
|
25
|
-
}
|
|
26
|
-
const EMPTY_UI_GATES = {};
|
|
27
|
-
function gateEnabled(gates, key) {
|
|
28
|
-
return gates?.[key] === true;
|
|
29
|
-
}
|
|
30
|
-
export {
|
|
31
|
-
EMPTY_UI_GATES,
|
|
32
|
-
UI_GATE_EDITABLE_KEYS,
|
|
33
|
-
UI_GATE_KEYS,
|
|
34
|
-
gateEnabled,
|
|
35
|
-
isUiGateKey,
|
|
36
|
-
parseUiGates,
|
|
37
|
-
uiGatesSchema
|
|
38
|
-
};
|
|
1
|
+
export * from "@ai-matrx/agents/settings";
|