export const AgentMarks = () => (
Or add memory to Claude Code Cursor Codex OpenCode
) export const CopyPromptButton = ({ prompt, className, label, copiedLabel }) => { const [copied, setCopied] = useState(false) const onCopy = async () => { try { await navigator.clipboard.writeText(prompt) setCopied(true) setTimeout(() => setCopied(false), 1600) } catch {} } return ( ) } export const PromptPanel = ({ tabs }) => { const [active, setActive] = useState(0) const [copied, setCopied] = useState(false) const tab = tabs[active] const onCopy = async () => { try { await navigator.clipboard.writeText(tab.text) setCopied(true) setTimeout(() => setCopied(false), 1600) } catch {} } const promptLine = (line) => { const h = /^(#{1,6}) (.*)$/.exec(line) if (h) { return ( <> {h[1]} {h[2]} > ) } if (/^\|[-| ]+\|$/.test(line)) return {line} const out = [] let last = 0 let k = 0 for (const m of line.matchAll( /(\|)|(\b(?:GET|POST|PATCH|DELETE) \/[^\s|]+)/g, )) { const at = m.index ?? 0 if (at > last) out.push(line.slice(last, at)) out.push( m[1] ? ( | ) : ( {m[2]} ), ) last = at + m[0].length } if (last < line.length) out.push(line.slice(last)) return out } const codeLine = (line) => { if (/^\s*(\/\/|#)/.test(line)) return {line} const out = [] let last = 0 let k = 0 for (const m of line.matchAll(/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/g)) { const at = m.index ?? 0 if (at > last) out.push(line.slice(last, at)) out.push( {m[0]} , ) last = at + m[0].length } if (last < line.length) out.push(line.slice(last)) return out } const render = tab.kind === "prompt" ? promptLine : codeLine return (
{tab.text.split("\n").map((text, i) => (
{text.length === 0 ? " " : render(text)}
))}