Skip to content

Commit c5db094

Browse files
authored
refactor(desktop): rename agent config files to agent-config family (#2140)
1 parent ed432f9 commit c5db094

44 files changed

Lines changed: 78 additions & 78 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎desktop/src/features/agents/ui/AgentAiDefaults.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type * as React from "react";
22
import type { InheritedDefault } from "./bakedEnvHelpers";
3-
import { getPersonaProviderOptions } from "./personaDialogPickers";
3+
import { getPersonaProviderOptions } from "./agentConfigOptions";
44
import { Button } from "@/shared/ui/button";
55

66
function providerLabel(providerId: string) {

desktop/src/features/agents/ui/GlobalAgentConfigFields.tsx renamed to desktop/src/features/agents/ui/AgentConfigFields.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Controlled field group for global agent config (provider, model, effort, env vars).
33
*
4-
* Used by GlobalAgentConfigSettingsCard (settings panel) and AgentDefaultsSection
4+
* Used by AgentDefaultsSettingsCard (settings panel) and AgentDefaultsSection
55
* (onboarding setup step). The parent manages load/save state; this component is
66
* purely presentational and calls onConfigChange on every user edit.
77
*/
@@ -28,11 +28,11 @@ import {
2828
getProviderApiKeyEnvVar,
2929
requiredCredentialEnvKeys,
3030
runtimeSupportsLlmProviderSelection,
31-
} from "@/features/agents/ui/personaDialogPickers";
31+
} from "@/features/agents/ui/agentConfigOptions";
3232
import {
3333
AgentDropdownSelect,
3434
AgentModelField,
35-
} from "@/features/agents/ui/personaProviderModelFields";
35+
} from "@/features/agents/ui/agentConfigControls";
3636
import { PersonaProviderApiKeyField } from "@/features/agents/ui/PersonaProviderApiKeyField";
3737
import { usePersonaModelDiscovery } from "@/features/agents/ui/usePersonaModelDiscovery";
3838
import {
@@ -61,7 +61,7 @@ const BAKED_STRUCTURED_KEYS = new Set([
6161
BUZZ_AGENT_THINKING_EFFORT,
6262
]);
6363

64-
export type GlobalAgentConfigFieldsProps = {
64+
export type AgentConfigFieldsProps = {
6565
bakedEnv: BakedEnvEntry[];
6666
selectedRuntime: AcpRuntimeCatalogEntry | undefined;
6767
config: GlobalAgentConfig;
@@ -96,7 +96,7 @@ export type GlobalAgentConfigFieldsProps = {
9696
useChevronSelectIcon?: boolean;
9797
};
9898

99-
export function GlobalAgentConfigFields({
99+
export function AgentConfigFields({
100100
bakedEnv,
101101
selectedRuntime,
102102
config,
@@ -129,7 +129,7 @@ export function GlobalAgentConfigFields({
129129
unstyled = false,
130130
useCustomSelect = false,
131131
useChevronSelectIcon = false,
132-
}: GlobalAgentConfigFieldsProps) {
132+
}: AgentConfigFieldsProps) {
133133
const bakedProvider = React.useMemo(
134134
() => bakedEnv.find((e) => e.key === "BUZZ_AGENT_PROVIDER")?.value ?? null,
135135
[bakedEnv],

‎desktop/src/features/agents/ui/AgentConfigPanel.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import type {
2525
NormalizedConfig,
2626
NormalizedField,
2727
} from "@/shared/api/types";
28-
import { providerDisplayLabel } from "./personaDialogPickers";
28+
import { providerDisplayLabel } from "./agentConfigOptions";
2929

3030
type Props = {
3131
pubkey: string;

desktop/src/features/agents/ui/AgentAiDefaultsDialog.tsx renamed to desktop/src/features/agents/ui/AgentDefaultsDialog.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as React from "react";
22

33
import {
4-
GlobalAgentConfigEditor,
4+
AgentDefaultsEditor,
55
type GlobalAgentConfigSaveResult,
6-
} from "./GlobalAgentConfigEditor";
6+
} from "./AgentDefaultsEditor";
77
import {
88
AlertDialog,
99
AlertDialogAction,
@@ -23,7 +23,7 @@ import {
2323
DialogTitle,
2424
} from "@/shared/ui/dialog";
2525

26-
export function AgentAiDefaultsDialog({
26+
export function AgentDefaultsDialog({
2727
open,
2828
onOpenChange,
2929
returnFocusRef,
@@ -93,7 +93,7 @@ export function AgentAiDefaultsDialog({
9393
running agents.
9494
</DialogDescription>
9595
</DialogHeader>
96-
<GlobalAgentConfigEditor
96+
<AgentDefaultsEditor
9797
onDirtyChange={setDirty}
9898
onSaveSuccess={handleSaveSuccess}
9999
onSavingChange={setSaving}

desktop/src/features/agents/ui/GlobalAgentConfigEditor.tsx renamed to desktop/src/features/agents/ui/AgentDefaultsEditor.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import { getBakedBuildEnv, type BakedEnvEntry } from "@/shared/api/tauri";
2121
import { globalAgentConfigQueryKey } from "@/features/agents/useGlobalAgentConfig";
2222
import { useAcpRuntimesQuery } from "@/features/agents/hooks";
2323
import {
24-
GlobalAgentConfigFields,
24+
AgentConfigFields,
2525
EMPTY_GLOBAL_CONFIG,
26-
} from "@/features/agents/ui/GlobalAgentConfigFields";
26+
} from "@/features/agents/ui/AgentConfigFields";
2727
import { Button } from "@/shared/ui/button";
2828

2929
type SaveState = "idle" | "saving" | "saved" | "error";
@@ -32,19 +32,19 @@ export type GlobalAgentConfigSaveResult = Awaited<
3232
ReturnType<typeof setGlobalAgentConfig>
3333
>;
3434

35-
type GlobalAgentConfigEditorProps = {
35+
type AgentDefaultsEditorProps = {
3636
onDirtyChange?: (dirty: boolean) => void;
3737
onSaveSuccess?: (result: GlobalAgentConfigSaveResult) => void;
3838
onSavingChange?: (saving: boolean) => void;
3939
secondaryAction?: React.ReactNode;
4040
};
4141

42-
export function GlobalAgentConfigEditor({
42+
export function AgentDefaultsEditor({
4343
onDirtyChange,
4444
onSaveSuccess,
4545
onSavingChange,
4646
secondaryAction,
47-
}: GlobalAgentConfigEditorProps) {
47+
}: AgentDefaultsEditorProps) {
4848
const [config, setConfig] =
4949
React.useState<GlobalAgentConfig>(EMPTY_GLOBAL_CONFIG);
5050
const configRef = React.useRef(config);
@@ -178,7 +178,7 @@ export function GlobalAgentConfigEditor({
178178
Couldn't load agent defaults. Restart the app to try again.
179179
</div>
180180
) : (
181-
<GlobalAgentConfigFields
181+
<AgentConfigFields
182182
bakedEnv={bakedEnv}
183183
selectedRuntime={buzzAgentRuntime}
184184
config={config}

‎desktop/src/features/agents/ui/AgentDefinitionDialog.tsx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ import {
5151
PERSONA_LABEL_OPTIONAL_CLASS,
5252
shouldClearKnownModelForSelectionScope,
5353
sortPersonaRuntimes,
54-
} from "./personaDialogPickers";
55-
import { RequiredFieldLabel } from "./personaProviderModelFields";
54+
} from "./agentConfigOptions";
55+
import { RequiredFieldLabel } from "./agentConfigControls";
5656
import {
5757
modelDropdownOptions as buildModelDropdownOptions,
5858
relayMeshModelPickerState,
@@ -70,7 +70,7 @@ import {
7070
import { useBakedBuildEnvKeysQuery, useRuntimeFileConfigQuery } from "../hooks";
7171
import { useAgentDialogDefaults } from "./useAgentDialogDefaults";
7272
import { AgentAiDefaultsNotice } from "./AgentAiDefaults";
73-
import { AgentAiDefaultsDialog } from "./AgentAiDefaultsDialog";
73+
import { AgentDefaultsDialog } from "./AgentDefaultsDialog";
7474
import {
7575
AgentAiConfigurationModeField,
7676
HarnessModelDefaultNotice,
@@ -967,7 +967,7 @@ export function AgentDefinitionDialog({
967967
)
968968
) : null}
969969

970-
<AgentAiDefaultsDialog
970+
<AgentDefaultsDialog
971971
onOpenChange={setAiDefaultsOpen}
972972
open={runtimeCanChooseLlmProvider && aiDefaultsOpen}
973973
returnFocusRef={aiDefaultsTriggerRef}

‎desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import {
4343
shouldClearKnownModelForSelectionScope,
4444
sortPersonaRuntimes,
4545
type PersonaDropdownOption,
46-
} from "./personaDialogPickers";
46+
} from "./agentConfigOptions";
4747
import {
4848
modelDropdownOptions as buildModelDropdownOptions,
4949
relayMeshModelPickerState,
@@ -76,10 +76,10 @@ import {
7676
getBakedModelInheritLabel,
7777
getBakedProviderInheritLabel,
7878
} from "./bakedEnvHelpers";
79-
import { getProviderApiKeyEnvVar } from "./personaDialogPickers";
79+
import { getProviderApiKeyEnvVar } from "./agentConfigOptions";
8080
import { useAgentDialogDefaults } from "./useAgentDialogDefaults";
8181
import { AgentAiDefaultsNotice } from "./AgentAiDefaults";
82-
import { AgentAiDefaultsDialog } from "./AgentAiDefaultsDialog";
82+
import { AgentDefaultsDialog } from "./AgentDefaultsDialog";
8383
import { useProviderApiKeyFieldState } from "./providerApiKeyFieldState";
8484

8585
const ADVANCED_FIELDS_MOTION_TRANSITION = {
@@ -1099,7 +1099,7 @@ export function AgentInstanceEditDialog({
10991099
inheritedProvider={inheritedProviderDefault}
11001100
/>
11011101

1102-
<AgentAiDefaultsDialog
1102+
<AgentDefaultsDialog
11031103
onOpenChange={setAiDefaultsOpen}
11041104
open={aiDefaultsOpen}
11051105
returnFocusRef={aiDefaultsTriggerRef}

‎desktop/src/features/agents/ui/AgentsView.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
} from "@/features/agents/openSnapshotImportFromUrlEvent";
77
import { AddAgentToChannelDialog } from "./AddAgentToChannelDialog";
88
import { AddTeamToChannelDialog } from "./AddTeamToChannelDialog";
9-
import { AgentAiDefaultsDialog } from "./AgentAiDefaultsDialog";
9+
import { AgentDefaultsDialog } from "./AgentDefaultsDialog";
1010
import { AgentDialog } from "./AgentDialog";
1111
import { PersonaCatalogDialog } from "./PersonaCatalogDialog";
1212
import { PersonaDeleteDialog } from "./PersonaDeleteDialog";
@@ -241,7 +241,7 @@ export function AgentsView() {
241241
</div>
242242
</div>
243243

244-
<AgentAiDefaultsDialog
244+
<AgentDefaultsDialog
245245
onOpenChange={setIsAiDefaultsOpen}
246246
open={isAiDefaultsOpen}
247247
returnFocusRef={aiDefaultsTriggerRef}

‎desktop/src/features/agents/ui/EditAgentAdvancedFields.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
PERSONA_FIELD_CONTROL_CLASS,
77
PERSONA_FIELD_SHELL_CLASS,
88
PERSONA_LABEL_OPTIONAL_CLASS,
9-
} from "./personaDialogPickers";
9+
} from "./agentConfigOptions";
1010
import type { AgentPersona } from "@/shared/api/types";
1111
import { BuzzAgentModelTuningFields } from "./buzzAgentModelTuningFields";
1212
import { isBuzzAgentRuntime } from "./buzzAgentConfig";

‎desktop/src/features/agents/ui/EnvVarsEditor.test.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ test("inheritedRows_masked_secret_local_override_shows_masked_build_value", () =
462462
test("inheritedRows_structured_keys_excluded_from_generic_rows", () => {
463463
// BUZZ_AGENT_PROVIDER, BUZZ_AGENT_MODEL, BUZZ_AGENT_THINKING_EFFORT must
464464
// be excluded from bakedGenericRows (they go to structured fields instead).
465-
// This mirrors the BAKED_STRUCTURED_KEYS filter in GlobalAgentConfigSettingsCard.
465+
// This mirrors the BAKED_STRUCTURED_KEYS filter in AgentDefaultsSettingsCard.
466466
const STRUCTURED = new Set([
467467
"BUZZ_AGENT_PROVIDER",
468468
"BUZZ_AGENT_MODEL",

0 commit comments

Comments
 (0)