(tag: string)
| 375 | }, [systemPrompt, model, availableModels]); |
| 376 | |
| 377 | const insertSensor = (tag: string) => { |
| 378 | let finalTag = tag; |
| 379 | if (tag === '$MEMORY@agent_id') { |
| 380 | finalTag = `$MEMORY@${agentId || 'your_agent_id'}`; |
| 381 | } else if (tag === '$IMEMORY@agent_id') { |
| 382 | finalTag = `$IMEMORY@${agentId || 'your_agent_id'}`; |
| 383 | } |
| 384 | if (!promptRef.current) return; |
| 385 | const { selectionStart, selectionEnd, value } = promptRef.current; |
| 386 | const newPrompt = `${value.substring(0, selectionStart)} ${finalTag} ${value.substring(selectionEnd)}`; |
| 387 | setSystemPrompt(newPrompt); |
| 388 | setTimeout(() => { |
| 389 | promptRef.current?.focus(); |
| 390 | const newPos = selectionStart + finalTag.length + 2; |
| 391 | promptRef.current?.setSelectionRange(newPos, newPos); |
| 392 | }, 0); |
| 393 | }; |
| 394 | |
| 395 | // lockPhone() can't ask for its permission once the agent runs in the background, so the |
| 396 | // tile asks for it here, from the tap. The tile only turns on once it's granted. |
no outgoing calls
no test coverage detected