(s: string)
| 25 | return ( |
| 26 | (s || "diagram") |
| 27 | .replace(/[^a-z0-9]+/gi, "-") |
| 28 | .replace(/^-|-$/g, "") |
| 29 | .toLowerCase() || "diagram" |
| 30 | ); |
| 31 | } |
| 32 | |
| 33 | export const renderDiagramTool = defineChannelTool({ |
| 34 | name: "render_diagram", |
| 35 | description: |
| 36 | "Render a Mermaid diagram as an image and post it to the conversation " + |
| 37 | "thread. Pass Mermaid source (flowchart/sequence/state/etc). Use this to " + |