diff --git a/apps/desktop/src/app/settings/constants.ts b/apps/desktop/src/app/settings/constants.ts index 83a4f1c531c9..9d5fd89476d3 100644 --- a/apps/desktop/src/app/settings/constants.ts +++ b/apps/desktop/src/app/settings/constants.ts @@ -227,7 +227,7 @@ export const ENUM_OPTIONS: Record = { 'code_execution.mode': ['project', 'strict'], 'context.engine': ['compressor', 'default', 'custom'], 'delegation.reasoning_effort': ['', 'minimal', 'low', 'medium', 'high', 'xhigh'], - 'memory.provider': ['', 'builtin', 'hindsight', 'honcho'], + 'memory.provider': ['', 'builtin', 'honcho', 'hindsight'], // Terminal execution backends — kept in sync with the dispatch ladder in // tools/terminal_tool.py::_create_environment (local/docker/singularity/ // modal/daytona/ssh). Remote backends need extra env (image, tokens, host). diff --git a/apps/desktop/src/app/settings/field-control.tsx b/apps/desktop/src/app/settings/field-control.tsx new file mode 100644 index 000000000000..88819e60c59c --- /dev/null +++ b/apps/desktop/src/app/settings/field-control.tsx @@ -0,0 +1,98 @@ +import { Input } from '@/components/ui/input' +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' +import { Switch } from '@/components/ui/switch' +import { Textarea } from '@/components/ui/textarea' +import { Check } from '@/lib/icons' +import type { MemoryProviderField } from '@/types/hermes' + +import { CONTROL_TEXT } from './constants' + +// Fade the placeholder well below set values so example text never reads as data. +const FIELD_INPUT = `font-mono ${CONTROL_TEXT} placeholder:text-muted-foreground/45` + +/** Generic control for one declared provider field, dispatching on its kind. + * Values are edited as strings; the backend coerces them to native types. */ +export function FieldControl({ + field, + value, + onChange +}: { + field: MemoryProviderField + value: string + onChange: (value: string) => void +}) { + if (field.kind === 'bool') { + return onChange(checked ? 'true' : 'false')} /> + } + + if (field.kind === 'number') { + return ( + onChange(event.target.value)} + placeholder={field.placeholder} + type="number" + value={value} + /> + ) + } + + if (field.kind === 'json') { + return ( +