diff --git a/apps/web/src/components/CopyDropdown.tsx b/apps/web/src/components/CopyDropdown.tsx index 67bcaed..c215f15 100644 --- a/apps/web/src/components/CopyDropdown.tsx +++ b/apps/web/src/components/CopyDropdown.tsx @@ -63,23 +63,23 @@ export function CopyDropdown({ {isOpen && ( -
+
{options.map((option) => ( - + {option.description && ( +
+ {option.description} +
+ )} + ))}
)} @@ -125,33 +125,21 @@ export function getCollectionCopyOptions( export function getAgentCopyOptions( username: string, agentUid: string, - agentName: string + _agentName: string ): CopyOption[] { const baseUrl = 'https://tpmjs.com'; - const mcpUrlHttp = `${baseUrl}/api/mcp/${username}/${agentUid}/http`; - const mcpUrlSse = `${baseUrl}/api/mcp/${username}/${agentUid}/sse`; + // Generate a random conversation ID + const randomConvoId = `conv-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`; + const chatUrl = `${baseUrl}/${username}/agents/${agentUid}/chat/${randomConvoId}`; - const claudeConfig = JSON.stringify( - { - mcpServers: { - [agentName.toLowerCase().replace(/\s+/g, '-')]: { - command: 'npx', - args: ['-y', '@anthropic-ai/mcp-remote', mcpUrlSse], - }, - }, - }, - null, - 2 - ); + const curlCommand = `curl -X POST "${baseUrl}/api/chat/${username}/${agentUid}/conversation/${randomConvoId}" \\ + -H "Content-Type: application/json" \\ + -H "Authorization: Bearer YOUR_TPMJS_API_KEY" \\ + -d '{"message": "Hello!"}'`; return [ { label: 'Agent UID', value: agentUid, description: agentUid }, - { label: 'MCP URL (HTTP)', value: mcpUrlHttp, description: mcpUrlHttp }, - { label: 'MCP URL (SSE)', value: mcpUrlSse, description: mcpUrlSse }, - { - label: 'Claude Config', - value: claudeConfig, - description: 'JSON for claude_desktop_config.json', - }, + { label: 'Chat URL', value: chatUrl, description: chatUrl }, + { label: 'cURL', value: curlCommand, description: 'Send a message via API' }, ]; }