feat(companion): add platform createHeartbeatLoop helper

This commit is contained in:
William Valentin
2026-02-16 18:48:33 -08:00
parent a5c5a320ca
commit f67362bf3b
4 changed files with 47 additions and 0 deletions
+1
View File
@@ -1197,6 +1197,7 @@ Companion runtime helper:
- `AndroidCompanionClient` (`platform: "android"`, FCM push registration)
- shared `bootstrap()` helper (`register` + `getCapabilities`) for startup handshakes
- shared `publishHeartbeat()` helper for periodic `node.status.set` updates with safe defaults
- `createHeartbeatLoop()` convenience helper that returns a bound `CompanionHeartbeatLoop`
- optional `defaultSessionId` for canvas helper calls so `sessionId` can be omitted per call
- `src/companion/heartbeatLoop.ts` provides `CompanionHeartbeatLoop` for periodic heartbeat scheduling (`publishHeartbeat`) with start/stop safety, `tickNow()` for manual sends, error hooks, and optional auto-stop after repeated failures.