diff --git a/frontend/src/lib/components/flows/agentEditorStore.svelte.ts b/frontend/src/lib/components/flows/agentEditorStore.svelte.ts index 25d9ed0e78..24a44df0ad 100644 --- a/frontend/src/lib/components/flows/agentEditorStore.svelte.ts +++ b/frontend/src/lib/components/flows/agentEditorStore.svelte.ts @@ -14,7 +14,7 @@ export interface AgentEditorTarget { workspace?: string toolId?: string /** A level of the editor that is not the form. Mutually exclusive with `toolId`. */ - view?: 'evals' | 'path' + view?: 'evals' | 'settings' /** Where to re-resolve a graph's tool nodes after a deploy, when opened from a flow step. Only a * real flow sets it: the agent editor offers no way to open a second editor from inside itself. */ host?: { flowPath: string; moduleId: string } diff --git a/frontend/src/lib/components/flows/content/AgentEditorModal.svelte b/frontend/src/lib/components/flows/content/AgentEditorModal.svelte index c08627e0ef..f8e9ce1f8a 100644 --- a/frontend/src/lib/components/flows/content/AgentEditorModal.svelte +++ b/frontend/src/lib/components/flows/content/AgentEditorModal.svelte @@ -2,7 +2,7 @@ import { ChevronRight, FlaskConical, - FolderOpen, + Settings, FormInput, History, MessageSquare, @@ -36,7 +36,7 @@ import { publishLinkedAgentTools } from '../flowState' import { linkedModulesForAgent, linkedToolsScope } from '../linkedAgentToolsStore.svelte' import AgentEditorHost from './AgentEditorHost.svelte' - import AgentPathField from './AgentPathField.svelte' + import AgentSettings from './AgentSettings.svelte' import { useOperatingWorkspace } from '$lib/components/operatingWorkspace.svelte' const operatingWorkspace = useOperatingWorkspace() @@ -91,7 +91,7 @@ let ws = $derived(target?.workspace ?? $operatingWorkspace) let host = $state | undefined>(undefined) let versionDrawer: Drawer | undefined = $state(undefined) - let pathDrawer: Drawer | undefined = $state(undefined) + let settingsDrawer: Drawer | undefined = $state(undefined) let saving = $state(false) // Counted per agent, so a deploy that leaves the editor on the same agent still refetches the @@ -124,8 +124,8 @@ // the dialog carries only the refusal the host renders. let refused = $derived(draft?.refusal != null) let inEvals = $derived(target?.view === 'evals' && !refused) - // A level of its own in the dialog; the page layout opens the same field in a drawer instead. - let inPath = $derived(target?.view === 'path' && !refused) + // A level of its own in the dialog; the page layout opens the same settings in a drawer instead. + let inSettings = $derived(target?.view === 'settings' && !refused) let readOnly = $derived(draft ? !draft.canWrite : false) let draftOnly = $derived(draft?.noDeployed ?? false) // A never-deployed agent is stored at a minted `draft_` path, so it is named by the path @@ -146,7 +146,7 @@ let root = $derived({ label: shownPath ?? 'Agent', - onclick: inEvals || inPath ? () => showAgentEditorView(undefined) : undefined + onclick: inEvals || inSettings ? () => showAgentEditorView(undefined) : undefined }) let trail = $derived( inEvals @@ -155,17 +155,17 @@ { label: 'Evals', onclick: evalsLocation ? evalsLocation.back : undefined }, ...(evalsLocation ? [{ label: evalsLocation.label }] : []) ] - : inPath - ? [root, { label: 'Path' }] + : inSettings + ? [root, { label: 'Settings' }] : [root] ) // The root's alone: below it the header's second line is the way back, and what a level is for // belongs to that level rather than to the dialog's own name. - let description = $derived(inEvals || inPath || refused ? undefined : AGENT_DESCRIPTION) + let description = $derived(inEvals || inSettings || refused ? undefined : AGENT_DESCRIPTION) - function openPath() { - if (layout === 'modal') showAgentEditorView('path') - else pathDrawer?.openDrawer() + function openSettings() { + if (layout === 'modal') showAgentEditorView('settings') + else settingsDrawer?.openDrawer() } /** The unsaved edits, in the shape the server builds from a deployed config @@ -357,7 +357,7 @@ {#if !inEvals && !refused} - {#if testPane?.mode && !inPath} + {#if testPane?.mode && !inSettings} testPane?.mode, @@ -392,16 +392,15 @@ Read only {/if} - {#if !inPath} + {#if !inSettings} + startIcon={{ icon: Settings }} + iconOnly + title="Settings" + on:click={openSettings} + /> {/if} @@ -457,10 +456,10 @@ and evals answers them for its own levels. --> @@ -483,9 +482,9 @@ /> {/snippet} - {#snippet pathField()} + {#snippet settingsFields()} {#if draft} - {@render pathField()} + {#snippet settingsPage()} +
{@render settingsFields()}
{/snippet} {#snippet evalsPage()} @@ -508,9 +507,9 @@ /> {/snippet} - - pathDrawer?.closeDrawer()}> - {@render pathField()} + + settingsDrawer?.closeDrawer()}> + {@render settingsFields()} diff --git a/frontend/src/lib/components/flows/content/AgentSettings.svelte b/frontend/src/lib/components/flows/content/AgentSettings.svelte index 9f4f8800ba..c680b82bc4 100644 --- a/frontend/src/lib/components/flows/content/AgentSettings.svelte +++ b/frontend/src/lib/components/flows/content/AgentSettings.svelte @@ -1,9 +1,16 @@ - - -{#if !readOnly && draft.state?.path?.startsWith('f/')} - - Anyone who runs this agent needs access to its AI resource, and to the resources and workspace - scripts its tools use. - +{#if draft.state} +
+ + + {#if deployTo.current} + + {/if} + +
{/if}