diff --git a/apps/rowboat/app/lib/components/atmentions.ts b/apps/rowboat/app/lib/components/atmentions.ts index f1b94712..1b416148 100644 --- a/apps/rowboat/app/lib/components/atmentions.ts +++ b/apps/rowboat/app/lib/components/atmentions.ts @@ -55,11 +55,15 @@ export function createAtMentions({ agents, prompts, tools, pipelines = [], curre // Add prompts (always allowed) for (const prompt of prompts) { - const id = `prompt:${prompt.name}`; + // Use 'variable' for base_prompt types, 'prompt' for others + const isVariable = prompt.type === 'base_prompt'; + const type = isVariable ? 'variable' : 'prompt'; + const label = isVariable ? 'Variable' : 'Prompt'; + const id = `${type}:${prompt.name}`; atMentions.push({ id, value: id, - label: `Prompt: ${prompt.name}`, + label: `${label}: ${prompt.name}`, denotationChar: "@", link: id, target: "_self" diff --git a/apps/rowboat/app/lib/feature_flags.ts b/apps/rowboat/app/lib/feature_flags.ts index 74d4fa1c..a80df7c6 100644 --- a/apps/rowboat/app/lib/feature_flags.ts +++ b/apps/rowboat/app/lib/feature_flags.ts @@ -15,6 +15,6 @@ export const USE_VOICE_FEATURE = false; export const USE_TRANSFER_CONTROL_OPTIONS = false; export const USE_PRODUCT_TOUR = false; export const SHOW_COPILOT_MARQUEE = false; -export const SHOW_PROMPTS_SECTION = false; +export const SHOW_PROMPTS_SECTION = true; export const SHOW_DARK_MODE_TOGGLE = false; export const SHOW_VISUALIZATION = false \ No newline at end of file diff --git a/apps/rowboat/app/lib/types/workflow_types.ts b/apps/rowboat/app/lib/types/workflow_types.ts index 9c75e4c1..8f6b184f 100644 --- a/apps/rowboat/app/lib/types/workflow_types.ts +++ b/apps/rowboat/app/lib/types/workflow_types.ts @@ -129,8 +129,8 @@ export function sanitizeTextWithMentions( sanitized: string; entities: z.infer[]; } { - // Regex to match [@type:name](#type:something) pattern where type is tool/prompt/agent/pipeline - const mentionRegex = /\[@(tool|prompt|agent|pipeline):([^\]]+)\]\(#mention\)/g; + // Regex to match [@type:name](#type:something) pattern where type is tool/prompt/agent/pipeline/variable + const mentionRegex = /\[@(tool|prompt|agent|pipeline|variable):([^\]]+)\]\(#mention\)/g; const seen = new Set(); // collect entities @@ -144,8 +144,10 @@ export function sanitizeTextWithMentions( return true; }) .map(match => { + // Treat @variable: as @prompt: internally + const type = match[1] === 'variable' ? 'prompt' : match[1]; return { - type: match[1] as 'tool' | 'prompt' | 'agent' | 'pipeline', + type: type as 'tool' | 'prompt' | 'agent' | 'pipeline', name: match[2], }; }) @@ -176,6 +178,12 @@ export function sanitizeTextWithMentions( const id = `${entity.type}:${entity.name}`; const textToReplace = `[@${id}](#mention)`; text = text.replace(textToReplace, `[@${id}]`); + + // Also handle @variable: mentions for prompts + if (entity.type === 'prompt') { + const variableTextToReplace = `[@variable:${entity.name}](#mention)`; + text = text.replace(variableTextToReplace, `[@variable:${entity.name}]`); + } } return { diff --git a/apps/rowboat/app/projects/[projectId]/entities/prompt_config.tsx b/apps/rowboat/app/projects/[projectId]/entities/prompt_config.tsx index 159bd7b9..1ae2d998 100644 --- a/apps/rowboat/app/projects/[projectId]/entities/prompt_config.tsx +++ b/apps/rowboat/app/projects/[projectId]/entities/prompt_config.tsx @@ -14,6 +14,9 @@ const sectionHeaderStyles = "block text-xs font-medium uppercase tracking-wider // Enhanced textarea styles with improved states const textareaStyles = "rounded-lg p-3 border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-750 focus:shadow-inner focus:ring-2 focus:ring-indigo-500/20 dark:focus:ring-indigo-400/20 placeholder:text-gray-400 dark:placeholder:text-gray-500"; +// Value field styles without grey placeholder text +const valueTextareaStyles = "rounded-lg p-3 border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-750 focus:shadow-inner focus:ring-2 focus:ring-indigo-500/20 dark:focus:ring-indigo-400/20 placeholder:text-black dark:placeholder:text-white"; + export function PromptConfig({ prompt, agents, @@ -128,7 +131,7 @@ export function PromptConfig({