feat: merge heartbeat service improvements from feat-heartbeat branch

- Add ChannelSender interface for sending heartbeat results to users
- Add sendResponse() to automatically deliver results to last channel
- Add createDefaultHeartbeatTemplate() for first-run setup
- Support HEARTBEAT_OK silent response (legacy compatibility)
- Add structured logging with INFO/ERROR levels
- Move integration tests to separate file with build tag

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
yinwm
2026-02-13 01:42:22 +08:00
parent 53b5be862f
commit e7e086155e
4 changed files with 372 additions and 183 deletions

View File

@@ -213,7 +213,7 @@ func TestLogPath(t *testing.T) {
hs := NewHeartbeatService(tmpDir, nil, 30, true)
// Write a log entry
hs.log("Test log entry")
hs.log("INFO", "Test log entry")
// Verify log file exists at correct path
expectedLogPath := filepath.Join(memDir, "heartbeat.log")