diff --git a/apps/web/src/app/(app)/gastown/[townId]/settings/TownSettingsPageClient.tsx b/apps/web/src/app/(app)/gastown/[townId]/settings/TownSettingsPageClient.tsx index 5b3d6a234f..3fe5abdf28 100644 --- a/apps/web/src/app/(app)/gastown/[townId]/settings/TownSettingsPageClient.tsx +++ b/apps/web/src/app/(app)/gastown/[townId]/settings/TownSettingsPageClient.tsx @@ -31,6 +31,7 @@ import { Container, User, Key, + MessageSquareText, X, } from 'lucide-react'; import { @@ -40,6 +41,7 @@ import { AccordionContent, } from '@/components/ui/accordion'; import { Slider } from '@/components/ui/slider'; +import { Textarea } from '@/components/ui/textarea'; import { motion } from 'motion/react'; import { AdminViewingBanner } from '@/components/gastown/AdminViewingBanner'; import { useRouter } from 'next/navigation'; @@ -71,6 +73,7 @@ const SECTIONS = [ { id: 'merge-strategy', label: 'Merge Strategy', icon: GitPullRequest }, { id: 'refinery', label: 'Refinery', icon: Shield }, { id: 'container', label: 'Container', icon: Container }, + { id: 'custom-instructions', label: 'Custom Instructions', icon: MessageSquareText }, { id: 'danger-zone', label: 'Danger Zone', icon: Trash2 }, ] as const; @@ -280,6 +283,9 @@ export function TownSettingsPageClient({ townId, readOnly = false, organizationI const [gitAuthorName, setGitAuthorName] = useState(''); const [gitAuthorEmail, setGitAuthorEmail] = useState(''); const [disableAiCoauthor, setDisableAiCoauthor] = useState(false); + const [polecatInstructions, setPolecatInstructions] = useState(''); + const [refineryInstructions, setRefineryInstructions] = useState(''); + const [mayorInstructions, setMayorInstructions] = useState(''); const [initialized, setInitialized] = useState(false); const [showTokens, setShowTokens] = useState(false); @@ -316,6 +322,9 @@ export function TownSettingsPageClient({ townId, readOnly = false, organizationI setGitAuthorName(cfg.git_author_name ?? ''); setGitAuthorEmail(cfg.git_author_email ?? ''); setDisableAiCoauthor(cfg.disable_ai_coauthor ?? false); + setPolecatInstructions(cfg.custom_instructions?.polecat ?? ''); + setRefineryInstructions(cfg.custom_instructions?.refinery ?? ''); + setMayorInstructions(cfg.custom_instructions?.mayor ?? ''); setInitialized(true); } @@ -366,6 +375,11 @@ export function TownSettingsPageClient({ townId, readOnly = false, organizationI auto_merge_delay_minutes: autoMergeDelayMinutes, }, convoy_merge_mode: convoyMergeMode, + custom_instructions: { + polecat: polecatInstructions || undefined, + refinery: refineryInstructions || undefined, + mayor: mayorInstructions || undefined, + }, }, }); } @@ -1057,13 +1071,47 @@ export function TownSettingsPageClient({ townId, readOnly = false, organizationI + {/* ── Custom Instructions ────────────────────────────────── */} + +
+ {( + [ + ['Polecat Instructions', polecatInstructions, setPolecatInstructions], + ['Refinery Instructions', refineryInstructions, setRefineryInstructions], + ['Mayor Instructions', mayorInstructions, setMayorInstructions], + ] as const + ).map(([roleLabel, value, setValue]) => ( + +
+