diff --git a/app/components/agent/AgentSystemPromptModal.vue b/app/components/agent/AgentSystemPromptModal.vue index 58dd6c1..f27f465 100644 --- a/app/components/agent/AgentSystemPromptModal.vue +++ b/app/components/agent/AgentSystemPromptModal.vue @@ -2,11 +2,40 @@ const props = defineProps<{ show: boolean; systemPrompt: string; + isCustom: boolean; }>(); const emit = defineEmits<{ close: []; + save: [systemPrompt: string | null]; }>(); + +const editingText = ref(""); +const saving = ref(false); + +watch( + () => props.show, + (val) => { + if (val) { + editingText.value = props.systemPrompt; + } + }, +); + +async function handleSave() { + saving.value = true; + try { + const trimmed = editingText.value.trim(); + emit("save", trimmed.length > 0 ? trimmed.slice(0, 5000) : null); + } finally { + saving.value = false; + } +} + +function handleReset() { + editingText.value = ""; + emit("save", null); +}