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