mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-28 01:46:23 +02:00
Tool mentions (#239)
* disable click for invalid tools * handle variables as mentions in the editor * delete tools persist immediately * deleting tools in live view shows the same warning and option to switch to draft
This commit is contained in:
parent
158777b045
commit
5efdee18eb
3 changed files with 51 additions and 9 deletions
|
|
@ -105,8 +105,6 @@ export default function MarkdownContent({
|
|||
return (
|
||||
<span
|
||||
className="inline-block bg-[#e0f2fe] text-[red] px-1.5 py-0.5 rounded whitespace-nowrap cursor-pointer"
|
||||
onClick={handleMentionClick}
|
||||
title={onMentionNavigate ? 'Click to open' : undefined}
|
||||
>
|
||||
{displayLabel} (!)
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ Quill.register('modules/mention', Mention);
|
|||
|
||||
function markdownToParts(markdown: string, atValues: Match[]): (string | Match)[] {
|
||||
// Regex match for pattern [@type:name](#type:something) where type is tool/prompt/agent
|
||||
const mentionRegex = /\[@(tool|prompt|agent):([^\]]+)\]\(#mention\)/g;
|
||||
const mentionRegex = /\[@(tool|prompt|agent|variable):([^\]]+)\]\(#mention\)/g;
|
||||
const parts: (string | Match)[] = [];
|
||||
|
||||
let lastIndex = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue