(tag: string)
| 374 | }, [systemPrompt, model, availableModels]); |
| 375 | |
| 376 | const insertSensor = (tag: string) => { |
| 377 | let finalTag = tag; |
| 378 | if (tag === '$MEMORY@agent_id') { |
| 379 | finalTag = `$MEMORY@${agentId || 'your_agent_id'}`; |
| 380 | } else if (tag === '$IMEMORY@agent_id') { |
| 381 | finalTag = `$IMEMORY@${agentId || 'your_agent_id'}`; |
| 382 | } |
| 383 | if (!promptRef.current) return; |
| 384 | const { selectionStart, selectionEnd, value } = promptRef.current; |
| 385 | const newPrompt = `${value.substring(0, selectionStart)} ${finalTag} ${value.substring(selectionEnd)}`; |
| 386 | setSystemPrompt(newPrompt); |
| 387 | setTimeout(() => { |
| 388 | promptRef.current?.focus(); |
| 389 | const newPos = selectionStart + finalTag.length + 2; |
| 390 | promptRef.current?.setSelectionRange(newPos, newPos); |
| 391 | }, 0); |
| 392 | }; |
| 393 | |
| 394 | // --- MODIFIED: toggleTool now handles showing/hiding warnings --- |
| 395 | const toggleTool = (tool: SimpleTool) => { |
no outgoing calls
no test coverage detected