(agentId: string)
| 64 | * Wake agent from sleep early |
| 65 | */ |
| 66 | export function wakeAgentLoop(agentId: string): void { |
| 67 | const loop = activeLoops[agentId]; |
| 68 | if (loop?.isRunning && loop.sleepUntil) { |
| 69 | loop.sleepUntil = null; |
| 70 | |
| 71 | // Dispatch sleep end event |
| 72 | Logger.info(agentId, `Agent woken up early`, { |
| 73 | logType: 'agent-sleep-end', |
| 74 | content: { agentId, wokeEarly: true } |
| 75 | }); |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | export async function startAgentLoop(agentId: string, getToken?: TokenProvider, skipWhitelistCheck = false): Promise<void> { |
| 80 | if (activeLoops[agentId]?.isRunning) { |
no test coverage detected